Junior — Middle
Can you list the main types of relationships between tables in relational databases?
sobes.tech AI
Answer from AI
Main types of relationships between tables in relational databases:
- One-to-One — each record in the first table corresponds to exactly one record in the second table and vice versa.
- One-to-Many — one record in the first table corresponds to multiple records in the second table.
- Many-to-Many — records in one table can correspond to multiple records in another table and vice versa. Usually implemented through an intermediate linking table.
Example: Users and Profiles tables — one-to-one relationship; Authors and Books — one-to-many; Students and Courses — many-to-many through the Course Registrations table.