From the course: SQL Essential Training

Unlock the full course today

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

Creating a view

Creating a view

- [Instructor] As I just mentioned, if you find yourself repeatedly constructing the same query, particularly if this query is complex or difficult to write, then it's worth your while to start looking at views. Now, officially, a view is referred to as a virtual table. And all of the SQL statements that we've been introduced to thus far in our course can all be saved and reused when we create a view out of them. Now, let's take a look at our query in front of us, which we visited a few times in the past. What this query is doing is just simply getting us the average total amount for our invoices. When we run this query, we do see that we have a total of $8.06 as we visited prior. We can turn this particular SQL statement into a view by means of some particular keywords. Let's go ahead and do this now. To start, let's go ahead and push our query down a little. And above the SELECT, we're going to introduce a new keyword,…

Contents