A subselect can be used anywhere you would use a table because the result of a SELECT is effectively another table itself.
- [Instructor] In this lesson, … I'll show you a couple of practical examples … of using a sub select to provide a list … of rows for searching a table. … We're using the album database here, … and suppose you want a list of albums … that have tracks with a duration of 90 seconds or less, … we've done this before, … we can say select distinct, … album ID, … from track, … where, … duration is less than or equal to 90, right? … And now we select this, we have two album ID's, … 11 and 13, but we don't know what those albums are. … Well we can find out easy enough, … we simply use this select statement as a sub select, … and now we have a list of album IDs, … and so we can just say select asterisk form album, … where ID, and we use the IN operator, … because we have a list of values, … and now when I execute this, … we don't just get the IDs … but now we get the information from the album table, … and we know what these albums are. … Now if we want to get all of the information on these albums …
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.