Page 4 - Relational Databases
P. 4
If Branch relation have 5 number of tuples, the cardinality of Branch relation is 5.
Change as the number of tuples is added or deleted.
Relational Schema
A named relation/ table schema is a set of related attributes defining/describing the table.
Characteristics:
Each attribute has a distinct name
Order of attributes has no significance
Order of tuples has no significance, theoretically
Relational Database schema
A sets of relation schema for an organization.
The relation schema normally represented as follows:
(The primary key is underlined.)
Relation Keys
Refers to the important attribute in an entity.
Determine the uniqueness of a row in given table.
Identifiers for each row.
An attribute or more than one attributes can be declared as keys depending on
situations.
Types of keys:
Primary Key
Candidate Key
Alternate Key
Foreign key
Primary Key
Is an attributes that uniquely identify each rows.
Each table must have primary key.
Cannot be NULL value to maintain Entity Integrity.
Primary key is the one that officially declared as the row identifier inside a specific
table.
Primary key for a table:
Student(studentID, firstname, lastname, coursed): studentID
Candidate key
A candidate key is a single field or the least combination of fields that uniquely
identifies each record in the table.
There can be more than one candidate keys in a relation.