Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
- Understanding Relationship Tables 3:41
- Relational Data 5 questions
- Querying Multiple Tables with JOIN 4:02
- JOINing Tables 1 objective
- Understanding SQL Injections 5:21
- SQL Injection 1 question
- Preparing SQL Statements 6:25
- Using a Prepared Statement 3 objectives
- Adding a Secondary Query 4:30
- Fetching in a While Loop 7:38
- Fetching Many Relationships 1 objective

- 2x 2x
- 1.75x 1.75x
- 1.5x 1.5x
- 1.25x 1.25x
- 1.1x 1.1x
- 1x 1x
- 0.75x 0.75x
- 0.5x 0.5x
A relational database is all about relationships. When talking about relationships within a database, there are three types of relationship.
1. One-to-one
2. Many-to-one (also used One-to-many)
3. Many-to-many
Learn More About Relational Databases
A many-to-one relationship can also be referred to as a one-to-many depending on how you are referencing the relationship. Genre_id in our Media table links to a genre table which includes a genre_id and the genre. This is a Many-to-one relationship. Many media items link to one genre. We could also say that One genre has Many media items using a One-to-Many relationship.
https://teamtreehouse.com/library/database-foundations
https://teamtreehouse.com/library/sql-basics
Database Diagram
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up-
Taraj Shah
21,073 Points6 Answers
View all discussions for this video
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up