Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

When we need to use 1-to-1 relationship in database design?

When do we need to use a 1-to-1 relationship in database design? In my opinion, if two tables are in a 1-to-1 relationship, they can be combined into one table. Is this true?

like image 499
Just a learner Avatar asked Jun 15 '11 02:06

Just a learner


People also ask

In which condition is one-to-many relationship used?

In a one-to-many relationship, one record in a table can be associated with one or more records in another table. For example, each customer can have many sales orders.

Which of the following is an example of a 1 1 relationship?

Household One-to-One RelationshipsOne family lives in one house, and the house contains one family. One person has one passport, and the passport can only be used by one person. One person has one ID number, and the ID number is unique to one person. A person owns one dog, and the dog is owned by one person.

What is the 1 1 relation in DBMS?

One-to-One relationship in DBMS is a relationship between an instance of an entity with another. An Employee is issued an Employee ID Card. An individual employee is offered a unique ID card in the company. Here, Employee and ID Card (ID_Card) are entities.

What could be a mandatory one-to-one relationship indicate?

A mandatory relationship indicates that for every occurrence of entity A there must exist an entity B, and vice versa. When specifying a relationship as being mandatory one-to-one, you are imposing requirements known as integrity constraints.


1 Answers

  1. Vertical partitioning for large tables to reduce I/O and cache requirements -- separate columns that are queried often vs rarely.

  2. Adding a column to a production system when the alter table is "too expensive".

  3. Super-type/subtype pattern.

  4. Vertical partitioning to benefit from table (join) elimination -- providing optimizer supports it (again to reduce I/O and cache) .

  5. Anchor modeling -- similar to 4, but down to 6NF.

like image 101
Damir Sudarevic Avatar answered Sep 19 '22 05:09

Damir Sudarevic