Relational Data Model
This the most extensively used data model for the last ten years. Relational model provides a declarative method for specifying data and queries. The database unambiguously informs what it contains. Users just specify what information they want from the database, and the database management system software takes care of describing data structures for storing the data and retrieval mechanisms for answering queries.
Most relational databases use the SQL data definition and query language.These systems implement a system with close approximation to the relational model. A table in an SQL database schema corresponds to a variable; the contents of a table to a relation; key constraints, other constraints, and SQL queries correspond to predicates.
However, most of the SQL databases deviate from the relational model by supporting the following:
- Duplicate rows:
The same row can appear multiple times in SQL table. But relational logic mandates that one tuple cannot appear more than once in a relation.
- Anonymous columns :
A column in an SQL table can be unnamed and cannot be referenced in expressions. The relational model recommends every attribute to be named and referenceable.
- Duplicate column names :
Two or more columns of the same SQL table can have the same name and therefore their reference indicates ambiguity. The relational model requires every attribute to be unambiguous.
- Fixed column order :
The order of columns in an SQL table is defined and significant. The relational model suggests not to have any ordering of the attributes of a relation.
- Views without CHECK option :
Views without CHECK OPTION do not reflect any data changes done to the underlying tables. For instance INSERT on the table is successful ,but the view does not show the inserted row. The relational model recommends that any changes to base objects should be immediately effected on the view.
- Column-less tables:
SQL requires every table to have at least one column. But some implementations support relations of degree zero and they are used for representing extensions of predicates that have no free variables.
- NULL :
This special mark can appear in place of an unavailable column value in some row. Implementation of NULL may deviate from the relation model, by declaring that the comparison of NULL with itself does not result TRUE but instead results in the third truth value “unknown”.