Views with Joins

Imagine you have two tables Menu and Ingredients. The Menu table contains data about different food items and their prices, while the Ingredients table contains data about the ingredients as well as their quantities used in each food item. It turns out that you need to analyse food products that cost above ?200 repeatedly to understand if there is any way to drive down their costs. Is there a way to avoid writing join statements every single time for each query? Well, it turns out there is. Watch the video given below and find out how you can do this.

Views with joins are especially useful if you need to store data from multiple columns in a single place for ready reference. You can even use subqueries and CTEs in views. Feel free to explore such use cases and try writing queries to get the exact results for further analysis.

By now, you have mastered the most important aspect of writing SQL queries, joins. Do keep practising different queries involving multiple joins, as joins form a majority of the questions that are generally asked in interviews.

In the next segment, you will learn about the different sets operation with SQL.

Report an error