🧠 Don’t miss out! Get FREE access to my Skool community — packed with resources, tools, and support to help you with Data, Machine Learning, and AI Automations! 📈 https://www.skool.com/data-and-ai-aut...
Today we take a look at Views within SQL. How you can create, alter, delete them. As well as using them for queries.
Everything is coded within MSSQL and inside SQL Server Management Studio.
🚀 Hire me for Data Work: https://ryanandmattdatascience.com/da...
👨💻 Mentorships: https://ryanandmattdatascience.com/me...
📧 Email: [email protected]
🌐 Website & Blog: https://ryanandmattdatascience.com/
🖥️ Discord: / discord
📚 *Practice SQL & Python Interview Questions: https://stratascratch.com/?via=ryan
📖 *SQL and Python Courses: https://datacamp.pxf.io/XYD7Qg
🍿 WATCH NEXT
SQL Tutorials Playlist: • SQL Tutorials for Data Analysts
SQL Temp Tables: • Learn SQL Temp Tables in 13 Minutes: Examp...
SQL Union vs Union All: • SQL UNION vs UNION ALL: Understand the Dif...
SQL Lead and Lag functions: • Lead & Lag Window Functions in SQL (EXAMPL...
In this comprehensive SQL tutorial, I break down everything you need to know about creating and using views in SQL. Whether you're just getting started or looking to streamline your database queries, this video walks you through the complete process of working with SQL views from start to finish.
I demonstrate how to create your first SQL view, alter existing views, delete views when needed, and most importantly, how to use views as part of larger queries to simplify complex database operations. We start with a practical example using three related tables—product distribution, store information, and product details—and transform a complex join query into a simple, reusable view.
You'll learn the key differences between SQL views and stored procedures, with views offering the unique ability to be used within other queries just like regular tables, while stored procedures allow for parameters but can't be nested in SELECT statements. I also cover important limitations, like why ORDER BY clauses can't be used directly inside view definitions and how to work around this.
Throughout the video, I show real examples of querying views with WHERE clauses, aggregate functions like SUM, and GROUP BY statements to extract meaningful business insights. By the end, you'll understand exactly when to use SQL views and how they can make your database queries cleaner, more maintainable, and easier for stakeholders to access important data without dealing with complex SQL joins.
TIMESTAMPS
00:00 Introduction to SQL Views
00:39 Views vs Stored Procedures
01:00 Example Query Setup
02:02 Creating Your First View
02:52 Locating and Dropping Views
03:42 Altering a View
04:50 Querying From a View
05:55 Order By Limitations in Views
OTHER SOCIALS:
Ryan’s LinkedIn: / ryan-p-nolan
Matt’s LinkedIn: / matt-payne-ceo
Twitter/X: https://x.com/RyanMattDS
Who is Ryan
Ryan is a Data Scientist at a fintech company, where he focuses on fraud prevention in underwriting and risk. Before that, he worked as a Data Analyst at a tax software company. He holds a degree in Electrical Engineering from UCF.
Who is Matt
Matt is the founder of Width.ai, an AI and Machine Learning agency. Before starting his own company, he was a Machine Learning Engineer at Capital One.
*This is an affiliate program. We receive a small portion of the final sale at no extra cost to you.