Many-to-many (data model)

Many-to-many (data model)
An Author can write several Books, and a Book can be written by several Authors

In systems analysis, a many-to-many relationship is a type of cardinality that refers to the relationship between two entities (see also Entity-Relationship Model) A and B in which A may contain a parent row for which there are many children in B and vice versa. For instance, think of A as Authors, and B as Books. An Author can write several Books, and a Book can be written by several Authors. Because most database management systems only support one-to-many relationships, it is necessary to implement such relationships physically via a third junction table (cross-reference table), say, AB with two one-to-many relationships A -> AB and B -> AB. In this case the logical primary key for AB is formed from the two foreign keys (i.e. copies of the primary keys of A and B).

In web application frameworks such as CakePHP and Ruby on Rails, a many-to-many relationship between database tables in a model is sometimes referred to as a HasAndBelongsToMany (HABTM) relationship.

See also


Wikimedia Foundation. 2010.

Игры ⚽ Нужна курсовая?

Look at other dictionaries:

  • Data model — Overview of data modeling context: A data model provides the details of information to be stored, and is of primary use when the final product is the generation of computer software code for an application or the preparation of a functional… …   Wikipedia

  • Core Architecture Data Model — Example of a CADM Diagram for Overview and Summary Information (AV 1) of the DoDAF.[1] Core Architecture Data Model (CADM) in Enterprise Architecture is a logical data model of information used to describe and build architectures …   Wikipedia

  • Standard data model — A standard data model is a data model that is widely applied in some industry, and shared amongst competitors to some degree. They are often defined by database vendors or operating system vendors and thus used by default whether suitable for a… …   Wikipedia

  • Semantic data model — A semantic data model in software engineering is a data modeling technique to define the meaning of data within the context of its interrelationships with other data. A semantic data model is an abstraction which defines how the stored symbols… …   Wikipedia

  • Physical data model — A physical data model (a.k.a. database design) is a representation of a data design which takes into account the facilities and constraints of a given database management system. In the lifecycle of a project it is typically derived from a… …   Wikipedia

  • Many-to-many — For other uses, see Many to many (data model). Many to many is a term that describes a communication paradigm and an associated media form.[1] It is the third of three major Internet computing paradigms. The early Internet applications of e mail …   Wikipedia

  • Data, context and interaction — (DCI) is a paradigm used in computer software to program systems of communicating objects. Its goals are: To improve the readability of object oriented code by giving system behavior first class status; To cleanly separate code for rapidly… …   Wikipedia

  • Data Vault Modeling — is a database modeling method that is designed to provide historical storage of data coming in from multiple operational systems. It is also a method of looking at historical data that, apart from the modeling aspect, deals with issues such as… …   Wikipedia

  • Data warehouse — Overview In computing, a data warehouse (DW) is a database used for reporting and analysis. The data stored in the warehouse is uploaded from the operational systems. The data may pass through an operational data store for additional operations… …   Wikipedia

  • Data integrity — in its broadest meaning refers to the trustworthiness of system resources over their entire life cycle. In more analytic terms, it is the representational faithfulness of information to the true state of the object that the information represents …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”