NOTES
Relational Model Terminology
A relation is a table with columns and rows.
Attribute is a named column of a relation.
Domain is the set of allowable values for one or more attributes.
Relational Database is a collection of normalized relations with distinct relation names.
Database Relations
Relation schema
Named relation defined by a set of attribute and domain name pairs.
Relational database schema
Set of relation schemas, each with a distinct name.
Properties of Relations
Relation name is distinct from all other relation names in relational schema. Each cell of relation
contains exactly one atomic (single) value. Each attribute has a distinct name. Values of an
attribute are all from the same domain. Each tuple is distinct; there are no duplicate tuples.
Order of attributes has no significance. Order of tuples has no significance, theoretically.
Relational Keys
Superkey
Candidate Key
Primary Key
Alternate Keys
Foreign Key
Superkey
An attribute, or set of attributes, that uniquely identifies a tuple within a relation.
Candidate Key
Superkey (K) such that no proper subset is a superkey within the relation.
In each tuple of R, values of K uniquely identify that tuple (uniqueness).
No proper subset of K has the uniqueness property (irreducibility).
Primary Key
Candidate key selected to identify tuples uniquely within relation.
Alternate Keys
Candidate keys that are not selected to be primary key.
Foreign Key
Attribute, or set of attributes, within one relation that matches candidate key of some
(possibly same) relation.
Views
Base Relation
Named relation corresponding to an entity in conceptual schema, whose tuples are physically stored in
database.
View
Dynamic result of one or more relational operations operating on base relations to produce another
relation.
Purpose of Views
Provides powerful and flexible security mechanism by hiding parts of database from certain users.
Permits users to access data in a customized way, so that same data can be seen by different users in
different ways, at same time.
Can simplify complex operations on base relations.
Updating Views
All updates to a base relation should be immediately reflected in all views that reference that base
relation.
If view is updated, underlying base relation should reflect change.
Database System Development Lifecycle
Stages of Database System Development Lifecycle
Database planning
System definition
Requirements collection and analysis
Database design
DBMS selection (optional)
Application design
Prototyping (optional)
Implementation
Data conversion and loading
Testing
Operational maintenance
Database Planning
Database planning should also include development of standards that govern:
how data will be collected, how the format should be specified, what necessary documentation will be
needed, how design and implementation should proceed.
Database Design
Three phases of database design:
Conceptual database design
Logical database design
Physical database design.
Conceptual Database Design
Process of constructing a model of the data used in an enterprise, independent of all physical
considerations. Data model is built using the information in users’ requirements specification.
Conceptual data model is source of information for logical design phase.
Logical Database Design
Process of constructing a model of the data used in an enterprise based on a specific data model (e.g.
relational), but independent of a particular DBMS and other physical considerations. Conceptual data
model is refined and mapped on to a logical data model.
Physical Database Design
Process of producing a description of the database implementation on secondary storage. Describes
base relations, file organizations, and indexes used to achieve efficient access to data. Also describes any
associated integrity constraints and security measures. Tailored to a specific DBMS system.