Content deleted Content added
ClueBot NG (talk | contribs) m Reverting possible vandalism by 68.59.243.22 to version by Mikhail Ryazanov. Report False Positive? Thanks, ClueBot NG. (4327982) (Bot) |
m Disambiguating links to Object-orientation (link changed to Object-oriented programming) using DisamAssist. |
||
(13 intermediate revisions by 12 users not shown) | |||
Line 1:
{{short description|Database model}}
The '''relational model''' ('''RM''') is an approach to managing [[data]] using a [[Structure (mathematical logic)|structure]] and language consistent with [[first-order logic|first-order predicate logic]], first described in 1969 by English computer scientist [[Edgar F. Codd]],<ref>{{Citation | title = Derivability, Redundancy, and Consistency of Relations Stored in Large Data Banks | first = E.F | last = Codd | publisher = IBM | series = Research Report | year = 1969}}.</ref><ref name="codd1970">{{cite journal |last= Codd |first= E.F |year= 1970 |title= A Relational Model of Data for Large Shared Data Banks |series= Classics
The purpose of the relational model is to provide a [[Declarative programming|declarative]] method for specifying data and queries: users directly state what information the database contains and what information they want from it, and let the [[database management system|database management system software]] take care of describing data structures for storing the data and retrieval procedures for answering queries.
Most relational databases use the [[SQL]] data definition and query language; these systems implement what can be regarded as an engineering approximation to the relational model. A ''[[Table (database)|table]]'' in a SQL [[database schema]] corresponds to a predicate variable; the contents of a table to a relation; key constraints, other constraints, and SQL queries correspond to predicates. However, SQL databases [[#SQL and the relational model|deviate from the relational model in many details]], and Codd fiercely argued against deviations that compromise the original principles.<ref>{{Citation | first = E. F | last = Codd | title = The Relational Model for Database Management | publisher = Addison-Wesley | year = 1990 | isbn = 978-0-201-14192-4 | pages=371–388}}.</ref>
== History ==
The relational model was developed by [[Edgar F. Codd]] as a general model of data, and subsequently promoted by [[Christopher J. Date|Chris Date]] and [[Hugh Darwen]] among others. In their 1995 ''The Third Manifesto'', Date and Darwen try to demonstrate how the relational model can accommodate certain "desired" [[Object-oriented programming|object-oriented]] features.<ref>{{Cite web |title=Did Date and Darwen's "Third Manifesto" have a lasting impact? |url=https://cs.stackexchange.com/questions/99350/did-date-and-darwens-third-manifesto-have-a-lasting-impact |access-date=2024-08-03 |website=Computer Science Stack Exchange |language=en}}</ref>
=== Extensions ===
Line 17:
[[File:Relational database terms.svg|thumb|A relation with 5 attributes (its degree) and 4 tuples (its cardinality) can be visualized as a table with 5 columns and 4 rows. However, unlike rows and columns in a table, a relation's attributes and tuples are unordered.]]
A ''relation'' consists of a ''heading'' and a ''body''. The heading defines a [[Set (mathematics)|set]] of ''attributes'', each with a ''name'' and ''data type'' (sometimes called a ''___domain''). The number of attributes in this set is the relation's ''degree'' or ''[[arity]]''. The body is a set of ''tuples''. A tuple is a collection of ''n'' ''values'', where ''n'' is the relation's degree, and each value in the tuple corresponds to a unique attribute.<ref>{{
Relations are represented by ''relational [[Variable (computer science)|variables]]'' or ''relvars'', which can be reassigned.<ref name="professionals"/>{{rp|22–24}} A ''[[database]]'' is a collection of relvars.<ref name="professionals"/>{{rp|112–113}}
Line 40:
{{main|Foreign key}}
A ''foreign key'' is a subset of attributes ''
=== Relational operations ===
Line 217:
''Datalog'' is a database definition language, which combines a relational view of data, as in the relational model, with a logical view, as in [[logic programming]]. Whereas relational databases use a relational calculus or relational algebra, with [[Relational database#Relational operations|relational operations]], such as ''union'', ''intersection'', ''set difference'' and ''cartesian product'' to specify queries, Datalog uses logical connectives, such as ''if'', ''or'', ''and'' and ''not'' to define relations as part of the database itself.
In contrast with the relational model, which cannot
== See also ==
Line 246:
* {{Citation | publisher = Handle | title = Feasibility of a set-theoretic data structure: a general structure based on a reconstituted definition of relation | last = Childs | year = 1968 | type = research| hdl = 2027.42/4164 }} cited in Codd's 1970 paper.
* {{Citation | last = Darwen | first = Hugh | url = http://www.thethirdmanifesto.com/ | title = The Third Manifesto (TTM)}}.
* {{Citation | contribution-url = http://c2.com/cgi/wiki?RelationalModel | contribution = Relational Model | title = C2}}.
* {{Citation | url = http://blogs.sun.com/bblfish/entry/why_binary_relations_beat_tuples | title = Binary relations and tuples compared with respect to the semantic web | publisher = Sun | type = [[World Wide Web]] log}}.
Line 258 ⟶ 257:
[[Category:Articles with example pseudocode]]
[[Category:Programming paradigms]]
[[Category:Database management systems]]
|