Recall & Review
beginner
What is a one-to-one relationship in database design?
A one-to-one relationship means each record in one table is linked to exactly one record in another table. It's like having a unique ID card for each person.
Click to reveal answer
beginner
Explain a one-to-many relationship with an example.
In a one-to-many relationship, one record in a table can be linked to many records in another table. For example, one author can write many books.
Click to reveal answer
intermediate
What is a many-to-many relationship and how is it usually implemented?
Many-to-many means multiple records in one table relate to multiple records in another. It's often done using a join table that connects the two tables.
Click to reveal answer
intermediate
How does a GraphQL schema represent a one-to-many relationship?
GraphQL uses fields that return lists of related objects. For example, a type Author can have a field books that returns a list of Book objects.
Click to reveal answer
beginner
Why is it important to design relationships carefully in databases?
Good relationship design helps keep data organized, avoids duplication, and makes queries faster and easier to write.
Click to reveal answer
Which relationship pattern allows multiple records in one table to relate to multiple records in another?
✗ Incorrect
Many-to-many relationships connect multiple records from both tables, often using a join table.
In GraphQL, how do you represent a one-to-many relationship?
✗ Incorrect
A one-to-many relationship is represented by a field returning a list of related objects.
What is the purpose of a join table in many-to-many relationships?
✗ Incorrect
Join tables link records from two tables in many-to-many relationships.
Which of these is NOT a common relationship pattern in databases?
✗ Incorrect
Many-to-zero is not a recognized relationship pattern.
Why should relationships be designed carefully in databases?
✗ Incorrect
Careful design avoids duplication and makes data easier to manage and query.
Describe the three main types of relationship design patterns in databases and give a simple example for each.
Think about how many records in one table connect to records in another.
You got /4 concepts.
Explain how you would represent a many-to-many relationship in a GraphQL schema.
Consider how GraphQL fields can return lists to show multiple connections.
You got /3 concepts.