Hamish Burke | 2025-03-12
Related to: #databases
Relational Model of Data
- Introduced in 1970
- RDM represents the database as a collection of relations
- Finite relations are sets of tuples (or records)
- Enables physical data independence
- Relation schema
- Corresponds to Entity Type in Entity-Relationship Model
Relation Schema
SUPPLIER(Supplier_no: INT, Name: STRING, Address: STRING)
-
The degree of the SUPPLIER relation is 3 (number of attributes)
-
is the name of the relation -
are attributes -
Each attribute has a domain
or a set of valid values -
And a set of constraints
defined on it
Relation schema key
AKA minimal key or a key
- Has to be
- Unique
- for all relations, for every tuple, if they agree on the values over
, they are the same tuple ( being the potential schema key)
- for all relations, for every tuple, if they agree on the values over
- minimal
- For all proper subsets
of , the uniqueness property does not hold
- For all proper subsets
- not null
- because we use this to identify individual tuples
Primary Key
- because we use this to identify individual tuples
- Unique
- A key used in UoD for identification most frequently
Entity Integrity Constraint
- No primary key values can be null
Foreign Keys
- To connect the relation schema's
- May contain null values
Define foreign key on student: