SQL CTEs, or Common Table Expressions, are a helpful feature in SQL. They can help you clean up a query and make it easier to read, and are available in many vendors including Oracle, SQL Server, MySQL, and Postgres.
In this video, you’ll learn what a CTE is, why you would want to use one, see an example of transforming a query to use a CTE, and see the benefits of a CTE.
Timestamps:
00:00 What is a CTE?
01:13 Our sample data
01:51 Create a CTE
04:38 Benefits of using CTEs
06:27 CTE vs Temp Table
/// RESOURCES
📝 Get my free SQL Cheat Sheets: www.databasestar.com/get-sql-...
🧭 SQL Roadmap from basics to advanced: www.databasestar.com/sql-road...
✍️ Learn how to design a database: databasestar.mykajabi.com/edd
📧 Contact me here: www.databasestar.com/contact/
📝 Database Design Exercises: bbrumm.gumroad.com/l/hqsxi
📝 SQL Practice Questions: bbrumm.gumroad.com/l/ulekqk
📝 SQL Performance Quick Guide: bbrumm.gumroad.com/l/fcvny
📝 Ultimate SQL How-To Guide: bbrumm.gumroad.com/l/oqggau
Links:
Script on GitHub for sample data and SQL query: github.com/bbrumm/databasesta...
Негізгі бет Ғылым және технология SQL CTEs (Common Table Expressions) - Why and How to Use Them
Пікірлер: 20