Sobes.tech
Junior — Middle

What types of relationships between tables do you know in databases?

sobes.tech AI

Answer from AI

Main forms of relationships between tables in databases:

  • One-to-One: each record in the first table corresponds to exactly one record in the second.
  • One-to-Many: one record in the first table corresponds to multiple records in the second.
  • Many-to-Many: records in the first table can correspond to multiple records in the second and vice versa; implemented through an intermediate table.

Example of a one-to-many relationship: the "Users" table and the "Orders" table, where one user can have multiple orders.