Many-to-many relationships are theoretically possible, but unsupported by most relational database management systems. In order to implement a many-to-many relationship, Adam shows how to use a linking table and two one-to-many joins.
- The third and final type of relationship … that you can create … is a many-to-many relationship. … If you've been following along … then it's probably no surprise … that a many-to-many relationship … is created between two columns … where neither of them have a unique constraint applied. … In theory this is what a many-to-many relationship … looks like in a design diagram. … Here we have a database … that keeps track of class schedules … for a university. … Each student can be enrolled … in zero to multiple classes … and each class can have … between zero and many students. … I've noted the optionality and cardinality here … so we can clearly see the need … for a many-to-many relationship … based on the cardinality of N at both ends. … However, there isn't a good way … to relate the tables together … based (mumbles) the columns that we have. … To create the relationship according to the cardinality … we would need a non-unique column in each table. … The solution to this problem … is to simply not create a many-to-many relationship. …
Author
Released
9/23/2019- The basics of data storage
- Choosing an entity-relationship design tool
- Using primary keys to identify records
- What to consider when naming objects
- Creating a unique constraint
- Establishing table indexes
- Relating tables with foreign keys
- One-to-many and one-to-one relationships
- Normalization
- Writing SELECT queries in SQL
Skill Level Intermediate
Duration
Views
Related Courses
-
Database Foundations: Administration
with Adam Wilbert1h 14m Beginner -
Learning Relational Databases
with Adam Wilbert2h 43m Beginner
-
Introduction
-
1. Get to Know Relational Databases
-
What the CRUD?3m 48s
-
2. Entity Relationship Diagrams
-
Choose an ER design tool5m 7s
-
Design a table3m 39s
-
3. Data Integrity and Validation
-
Data constraints1m 44s
-
Create a unique constraint5m 46s
-
Define a default value3m 58s
-
Establish table indexes4m 49s
-
Add check constraints5m 31s
-
-
4. Relationships
-
Diagram a relationship2m 42s
-
One-to-many relationships2m 10s
-
One-to-one relationships1m 10s
-
Many-to-many relationships2m 21s
-
Self joins2m 17s
-
Cascade changes2m 17s
-
5. Normalization
-
When not to normalize2m 29s
-
6. Structured Query Language
-
Data definition queries6m 22s
-
Data manipulation queries4m 52s
-
Create a database view2m 44s
-
7. Beyond the Relational Model
-
Graph databases1m 38s
-
Document databases1m 32s
-
-
Conclusion
-
Next steps59s
-
- 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.
CancelTake 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.
Share this video
Embed this video
Video: Many-to-many relationships