A view is a saved query. Because the result of a SELECT is effectively a table, you can use a view anywhere you would use a table.
- [Instructor] In SQL you can save a query as a view … and you can use that view as if it were a table. … It's very simple and very useful. … For example, here in the album database, … I pasted a query from the ExerciseFiles for chapter 11. … And it's just a simple query. … I've got id, album id, title, and track number … from the track table, … but I also have duration separated out … as minutes and seconds using integer division … and the modular operator. … And so when I execute this query, … you see we get all these tracks, … but our duration is in minutes and seconds, … which could be very useful. … And so I can save this query as a view … simply with CREATE VIEW and I'll call it trackView AS … and the SELECT statement is the view. … And now when I execute this, … it'll save that view under that table in the database, … and now I can use that view in a query. … For example, I'm just going to paste this … out of the exercise file here for chapter 11. … Here's a joint query. … We have album as the left side, …
This course was created by Bill Weinman. We are pleased to offer this training in our library.
- How databases are organized
- Selecting rows and columns
- Creating new tables
- Inserting and updating data
- Sorting and filtering
- Accessing related tables with JOIN
- Working with strings
- Understanding numeric types
- Using aggregate functions and transactions
- Automating data with triggers
- Creating views
- Using CRUD functions
Skill Level Beginner
2. SQL Overview
3. Fundamental Concepts
7. Dates and Times
Dates and times2m 6s
11. Views and Subselects
12. A Simple CRUD Application
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.