A VIEW is a saved query. Because the result of a SELECT is effectively a TABLE, learn how 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.…This is very simple and useful.…For this example, I'll be using the album database.…I'm just going to create a quick little…select statement here.…Select ID, album ID, title, track number,…and we're gonna do a little math on duration.…This is from the track table.…Duration divided by 60 as M for minutes,…and duration MOD 60 as seconds, S for seconds.…
And we're gonna say from track.…And I'll press the go button.…And we get this nice little query,…it shows all the tracks in the track table…with minutes and seconds.…Now if I know I'm gonna use this query a lot…I can save it as a view.…And it's very simple, I simply say…create view and give the view a name, Trackview.…And the keyword as and the select statement…remains exactly the same.…
And then I can say select asterisk from track view,…and we get that same result,…and now that it's saved I don't need this anymore,…and I can select from track view anytime I want…and get exactly that result.…
- Understanding SQL terminology and syntax
- Creating new tables
- Inserting and updating data
- Writing basic SQL queries
- 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
- Defining functions in PHP
Skill Level Beginner
2. SQL Overview
3. Fundamental Concepts
7. Dates and Times
Dates and times1m 52s
11. Views and Subselects
12. Defined Functions
13. 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.