Relational model (source code)

= Relational model
{wiki}

The <relational model> represents data as <database relations>, which are <sets> of <database tuples> over specified value domains. A <relational schema> names the <database attributes> and states <database integrity constraints>; an instance supplies their current values. <Relational algebra> describes operations on this logical data, while storage order, indexes and access paths belong to its implementation.

For example, the <database relation> `Reading(sample, value)` can contain $(A,3),(B,8)$. A <relational selection> for values above five followed by <relational projection> onto sample identifiers returns $\{B\}$. Changing the underlying <file> layout or adding an index need not change that query's meaning. Mathematical <database relations> have <set semantics>; <SQL> often uses <bag semantics> and has additional <SQL NULL> behavior.

In his 1970 paper, <E. F. Codd> argued for <data independence>: application logic should not rely on particular stored orderings, indexes or navigational paths. His relational formulation made that separation central to <database> design.<A Relational Model of Data for Large Shared Data Banks by E. F. Codd>[abstract and sections 1.1–1.3]{ref}