In
systems analysis
Systems analysis is "the process of studying a procedure or business to identify its goal and purposes and create systems and procedures that will efficiently achieve them". Another view sees systems analysis as a problem-solving technique that ...
, a one-to-many relationship is a type of
cardinality
The thumb is the first digit of the hand, next to the index finger. When a person is standing in the medical anatomical position (where the palm is facing to the front), the thumb is the outermost digit. The Medical Latin English noun for thum ...
that refers to the relationship between two
entities (see also
entity–relationship model
An entity–relationship model (or ER model) describes interrelated things of interest in a specific domain of knowledge. A basic ER model is composed of entity types (which classify the things of interest) and specifies relationships that can e ...
). For example, take a car and an owner of the car. The car can only be owned by one owner at a time or not owned at all, and an owner could own zero, one, or multiple cars. One owner could have many cars, one-to-many.
In a
relational database
A relational database (RDB) is a database based on the relational model of data, as proposed by E. F. Codd in 1970.
A Relational Database Management System (RDBMS) is a type of database management system that stores data in a structured for ...
, a one-to-many relationship exists when one record is related to many records of another table. A one-to-many relationship is not a property of the data, but rather of the relationship itself. One-to-many often refer to a primary key to foreign key relationship between two tables, where the record in the first table can relate to multiple records in the second table. A foreign key is one side of the relationship that shows a row or multiple rows, with one of those rows being the primary key already listed on the first table. This is also called a
foreign key constraint, which is important to keep data from being duplicated and have relationships within the database stay reliable as more information is added.
Many-to-many relationships are not able to be used in relational databases and must be converted to one-to-many relationships. Both one-to-many and one-to-one relationships are common in relational databases.
The opposite of one-to-many is many-to-one. The
transpose
In linear algebra, the transpose of a Matrix (mathematics), matrix is an operator which flips a matrix over its diagonal;
that is, it switches the row and column indices of the matrix by producing another matrix, often denoted by (among other ...
of a one-to-many relationship is a many-to-one relationship.
Entity relationship diagram (ERD) notations
One notation as described in
Entity Relationship modeling is Chen notation or formally Chen ERD notation created originally by
Peter Chen
Peter Pin-Shan Chen (; born 3 January 1947) is a Taiwanese-American computer scientist and applied mathematician. He is a retired distinguished career scientist and faculty member at Carnegie Mellon University and Distinguished Chair Professor E ...
in 1976 where a one-to-many relationship is notated as 1:N where N represents the cardinality and can be 0 or higher.
A many-to-one relationship is sometimes notated as N:1.
See also
*
One-to-one (data model)
In systems analysis, a one-to-one relationship is a type of cardinality that refers to the relationship between two entities (see also entity–relationship model) A and B in which one element of A may only be linked to one element of B, and vic ...
*
Many-to-many (data model)
In systems analysis, a many-to-many relationship is a type of cardinality that refers to the relationship between two entities, say, A and B, where A may contain a parent instance for which there are many children in B and vice versa.
Data ...
References
Data modeling
{{systemstheory-stub