From the course: SQL Essential Training

Unlock the full course today

Join today to access over 23,100 courses taught by industry experts.

Joining views

Joining views

- Now, as I first mentioned when we first got into the introduction of views, the whole point of creating a view is to save us time, particularly when we are dealing with more complex queries. Now, if you recall on our chapter on subqueries, we introduced the invoice line table and the tracks table together to find out which songs from our tracks table had never been ordered. Now, this is a perfect scenario where it would've been helpful to have a join that linked these two tables together. Then we could have simply created a view out of this sort of complex query. What I've done in front of us here is created that join that is actually connecting our invoice line to our track table, and the result here we have a pretty useful view of what tracks, what prices, and what invoices all go together. Pretty useful but slightly involved when you consider the join that has to go into creating this query. Now this is a perfect…

Contents