Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 2

CHAPTER 3  ENTERPRISE INTEGRITY – additional

The Relational Model rules specified by the users or database


administrators of a database.
3.1 Definition of Terms  VIEW – is a virtual relation that does not
 RELATION - is a table with columns necessarily exist in the database but can be
and rows. produced upon request by a particular user, at
 ATTRIBUTE – is a named column of a the time of request.
relation.
 DOMAIN – is the set of allowable values 3.2 Brief History of the Relational Model
for one or more attributes.  The relational model was first proposed by E. F.
 TUPLE – is a row of a relation. Codd (mathematician). The relational model’s
 DEGREE – is the number of attributes it objectives were specified as follows:
contains. a. To allow a
 CARDINALITY – is the number of tuples high degree of data independence.
it contains b. To provide
 RELATIONAL DATABASE – a collection substantial grounds for dealing with data
of normalized relations with distinct relation semantics, consistency and redundancy
names. problems.
 RELATION SCHEMA – a named relation
defined by a set of attribute and domain name c. To enable

pairs. the expansion of set-oriented data

 RELATIONAL DATABASE SCHEMA – a manipulation languages.

set of relation schemas, each with a distinct


name. 3.3 Terminology

 SUPERKEY – an attribute or set of  The relational model is based on the

attributes, that uniquely identifies a tuple mathematical concept of a relation, which is

within a relation. physically represented as a table.

 CANDIDATE KEY – a superkey such Alternative Terminology


that no proper subset is a superkey within the Formal Alternative 1 Alternative 2
relation. Relation Table File
Tuple Row Record
 PRIMARY KEY – the candidate key that
Attribute Column Field
is selected to identify tuples uniquely within
the relation. 3.3.1 Properties of Relations
 FOREIGN KEY – an attribute or set of  A relation has the following
attributes, within one relation that matches the properties:
candidate key of some (possibly the same) a. The relation has a name that is distinct from all other
relation. relation names in the relational schema;
b. Each cell of the relation contains exactly one atomic
 NULL – represents a value for an (single) value;
c. Each attribute has a distinct name;
attribute that is currently unknown or is not d. The values of an attribute are all from the same
applicable for this tuple. domain;
e. Each tuple is distinct;
 ENTITY INTEGRITY – in a base f. The order of attributes has no significance;
g. The order of tuples has no significance, theoretically.
relation, no attribute of a primary key can be (However, in practice, the order may affect the
null. efficiency of accessing tuples)

 REFERENTIAL INTEGRITY – if a
3.3.2 Relational Keys
foreign key exists in a relation, either the
Superkey
foreign key value must match a candidate key Candidate key
value of some tuple in its home relation or the Primary key
Foreign key
foreign key value must be wholly null.
3.3.3 Representing Relational Database
Schema
 Using the Dreamhouse database, we
have this example:
BRANCH (branchNo, street, city, postcode)
STAFF (staffNo, Fname, Lname, position,
gender, DOB, salary, branchNo)
PROPERTYforRENT (propertyNo, street, city,
postcode, type, rooms,
rent, ownerNo,
staffNo,
branchNo)
CLIENT (clientNo, Fname, Lname, TelNo,
prefType, maxRent)
PRIVATEOWNER (ownerNo, Fname, Lname,
address, TelNo)
VIEWING (clientNo, propertyNo, viewDate,
comment)
REGISTRATION (clientNo, branchNo, staffNo,
dateJoined)

3.4 Relational Integrity


 two important integrity rules, which are
constraints or restrictions that apply to all
instances of the database, namely:
a. Entity Integrity - applies to primary key
b. Referential Integrity - applies to foreign
key

NULL - is not the same as zero numeric value


or a text string filled with spaces. (zeros &
spaces are values)

ENTERPRISE CONSTRAINTS
- users additional constraints that the data must
satisfy.

You might also like