Professional Documents
Culture Documents
1
Database and Database Users
Introduction
The relational model (RM) was first described by Computer Scientist Edgar F. Codd.
A relation is nothing, but you call it as a table. Relational Model means how we will
organize the tables in a database.
Relational Model
Relational Model is a relation, or we call it a table with columns and rows. It is based
on the mathematical concept of relation which is represented physically as table. It is
used for data storage and processing.
Course Module
Informal Terms Formal terms
Table Relation
Row Tuples
Relation schema – describes the relation name or table name, attributes, and their names.
Degree of relation
It is the number of attributes in a relation.
Cardinality of relation
It is the number of tuples in a relation.
Properties of Relation
1. The relation has name that is distinct, from all the names in the relationship schema.
2. Each cell of the relation contains exactly one value.
3. Each attribute has distinct names
4. Each tuple is distinct. There are no duplicate tuples.
5. The order of attributes has no significance.
6. The order of tuples has no significance.
Course Module
Key
Its is one or more columns of a relation or table that is used to identify a record.
1. Unique keys
• Primary key
• Candidate key
• Alternate key
• Surrogate key
2. Foreign key
3. Composite key
Fundamentals of Database Systems
5
Database and Database Users
Candidate key
▪ Identifies a single record or row.
▪ The value is unique in each column.
Primary key
• It is the identifying key of a candidate key; the rest will be alternate keys
• Used to uniquely identify a record
• There’s only ONE primary key for a table
Composite Key
• Contains two or more attributes (columns)
• All keys can be composite keys
Course Module
Fundamentals of Database Systems
7
Database and Database Users
Course Module
Schema in Relational Database
Relational database schema commonly defines:
▪ Tables - name, primary key
▪ Columns – name, data type, size, value range
▪ Constraints – all kinds of keys
Fundamentals of Database Systems
9
Database and Database Users
Course Module