Sunday, 22 April 2012

Define relationship. | Oracle DBA

A relationship is an association between entities (or tables). It is based on having common data values in the designated columns of each table. A relationship is defined by linking the common columns in the two tables. Relationships are actual objects in the database.
Following are the three types of relationships:
i. One-to-many—  Implies that a single record from the first table can be linked to multiple records in the second table while a single record in the second table relates to only a single record in the first table.
ii. One-to-one — Implies that a single record from the first table can be linked to only a single record in the second table and vice versa.
iii. Many-to-many — Implies that multiple records from the first table can be linked to multiple records in the second table and vice versa.
One-to-many is the most commonly used relationship, where a parent table is the table on the one side of a one-to-many relationship; whereas, a child table is the table on the many side of a one-to-many relationship.

No comments: