01-11-2012, 12:31 PM
The Relational Data Model
The Relational Data.pdf (Size: 111.99 KB / Downloads: 26)
Pre Relational Database
Systems
• Network and hierarchical database systems
– Emerged in late sixties of the twentieth century
• Deficiencies of the network and hierarchical
database systems:
– complex data structures (hence hard to comprehend
and use),
– no separation between logical and physical data
description (hence program data dependency)
– navigational programming languages (low
programming productivity)
Relational Data Model
• Introduced in 1970 by E. F. Codd
• Based on a sound mathematical foundation
• Complete separation of logical structure and
physical structure
• Complete data model
– Structural component with constraints
– Dynamic component with operations
• Solves problems of previous models
• Has become the dominant model
Relation Schema
• A relation schema is an abstract description of a set of
similar objects
• Formally, relation schema is defined as a named list of
attributes, denoted as N (A1, …, An )
• Attributes A1, …, An describe properties of the set of
similar objects
• The number n is the order of the relation schema N
• e.g.
– Student(StudId, FName, LName, Major)
– Grades(StudId, CourId, Grade)
– Course(CourId, PName, Hours, Dept )
Attribute Constraint
• Association of a domain to each relation schema
attribute restricts the attribute values, but it is often not
sufficient
• Generally, the attribute constraint of an attribute A within
relation schema N is defined as
(Dom (N, A ), Range (N, A ), Null (N, A ))
• Dom(N, A ) associates attribute A in N with a domain
via domain name D
• Range(N, A ) is used to further restrict the range of
allowable attribute A values in the relations over N
• Null (N, A ) specifies whether attribute A may or may not
have a null value in any instance over N
DB Updates and Constraints
• Database update operations are:
– Insert,
– Delete, and
– Modify
• It is the task of a DBMS to check whether these
operations are tending to leave database in an
inconsistent state (with violated constraints), and to
undertake necessary actions to prevent constraint
violation
• The actions that are available to a DBMS are:
– Reject (the operation)
– Cascade (propagate the operation)
– Set null, or set default (foreign key)
Summary
• The relational data model is introduced to provide:
– Simple data structures,
– Sharp separation of physical and logical database aspects,
– Declarative database language
• Basic concepts of the relational data model are:
– Domain (set of values),
– Attribute (property of a set of similar UoD objects),
– Relation schema (semantically: a model of a set of similar UoD
objects, formally: a named pair (set of attributes, set of
constraints)),
– Relation schema is a specification of a complex data type
– Relational variable contains an instance of a relation schema in
each moment of time