Views Solution in SQL

Use views to filter user spending data by amount or email address.

Discover how views simplify database queries by effortlessly filtering user spending data. Learn techniques to quickly pinpoint users based on customized criteria.

Key Insights

  • Demonstrates the use of views in databases to easily access and query summaries of user spending data.
  • Highlights flexibility in filtering data, such as identifying users who spent above specific thresholds or those using particular email providers like Gmail.
  • Explains that views function similarly to regular database tables, allowing versatile and powerful data retrieval through straightforward SQL queries.

This lesson is a preview from our SQL Bootcamp (includes software) and SQL Certification Online (includes software & exam). Enroll in a course for detailed lessons, live instructor support, and project-based training.

So let's wrap up the views. And then we'll talk about strings just for now. There's another view that gets the total each user spent in this one.

So I say, give me everything from that view. We can see everything in there. Now you can find anything in here.

People who spend over a certain amount—you can do any sort of filtering, right? You can just do a WHERE clause. You can say, WHERE total_spend is over a certain amount, or WHERE email LIKE '%@gmail.com'.

Just like we did before, you can apply any filters you want. You’re just treating it like a regular table.

Dan Rodney

Dan Rodney has been a designer and web developer for over 20 years. He creates coursework for Noble Desktop and teaches classes. In his spare time Dan also writes scripts for InDesign (Make Book Jacket, Proper Fraction Pro, and more). Dan teaches just about anything web, video, or print related: HTML, CSS, JavaScript, Figma, Adobe XD, After Effects, Premiere Pro, Photoshop, Illustrator, InDesign, and more.

More articles by Dan Rodney