From the course: Learning Relational Databases
Unlock the full course today
Join today to access over 24,800 courses taught by industry experts.
Create junction tables
From the course: Learning Relational Databases
Create junction tables
- [Instructor] In your data model, you may have created two tables that are joined together in a many-to-many relationship. If that's the case, now is the time to resolve that into a format that can be implemented in the database management system. We do this by creating a third table, called a "junction table", that sits between the other two. The most common example of a many-to-many relationship is the case of a class schedule, which includes the table storing information about students, and the table that stores information about various classes that are being offered. We'll note that each student can take between zero and several classes, and each class would have several students enrolled. Thus, a many-to-many relationship exists between these two tables. This accurately represents the real world situation that we're trying to capture. But in order to actually create this in the database, we need to create an…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.