A junction table is a useful tool for managing many-to-many relationships in a relational database application.
- [Instructor] In practice, it's very common to have tables … with many-to-many relationships. … For example, a single customer may buy many items, … and a single item may be purchased by many customers. … so that's create a many-to-many relationship … between customers and items. … This is often implemented with a junction table, … and here's a simple practical example of how that works. … Here, we're using the test database, … and you'll notice the sale table … has columns for its own id, and an item_id, … and a customer_id, which refer to the id column … in the item table and the id column in the customer table. … And so in this query, we're joining … these three tables from sales, … that's the left-hand side, as s; … item as i on the right; … and customer as c, also on the right. … And we're getting columns from each of them. … From the customer table, we have the name and zip columns. … And from the item table, … we have the name and description columns. … And you'll notice, because both customer and item …
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.