Relational Model Flashcards
In the context of RDBMS…
What is meant by DDL?
(Data Definition Language)
Refers to defining relation schemas and constraints.
In the context of RDBMS…
What is meant by DML?
(Data Manipulation Language)
Refers to inserting, updating, deleting and retrieving data.
In the context of RDBMS…
What is meant by DCL?
(Data Control Language)
Refers to security and accessibility.
What is an attribute in a relational data model?
One (of potentially many) properties that define an entity.
What is a tuple in a relational data model?
Each row in the relation is known as a tuple.
E.g:
- UserID, Name, Address, Phone (The format a tuple might take)
- 451, John, Detroit, 071626339 (An instance of a tuple)
What is the cardinality in the relational data model?
The number of tuples in a relation.
What is degree in the relational data model?
The number of attributes in the relation
What is in a column?
The column contais the set of values for any particular attribute.
What is a NULL value?
A value which is either not known or unavailable, it is filled with “NULL”.
What is a relational database?
A collection of relations
What would a relational schema for a member of staff with attributes staffNo, name, dob, and branchNo, which references a branch with attributes branchNo, street, city, and postcode look like?
Branch(branchNo,street,city,postcode)
Primary key branchNo
Staff(staffNo,Name,DOB,branchNo)
primary key StaffNo
foreign key branchNo references Branch(branchNo)
Bold means underlined, means primary key
What is a primary key?
Uniquely identify a tuple. Must not have duplicate values, or it cannot identify a specific tuple. Only one primary key.
Cannot be null.
Specifies the most important attribute for the relation
What is a candidate key?
A set of attributes that uniquely identify tuples in the relation. Can be more than one candidate key.
Can be null.
What is a foreign key?
An attribute or set of attributes that uniquely identiy a row of a different table.
In terms of relational integrity…
What is meant by domain constraints?
Domain constraints mean that data values must live in a specified domain.
E.g. Phone numbers will always be made up of exclusively integers.
In terms of relational integrity…
What is meant by entity integrity?
Entity integrity means that the value of a primary key must not be NULL and must be unique for that table.
In terms of relational integrity…
What is meant by referential integrity?
Referential integrity means that if there is a foreign key, then its value must match a primary key in the referenced relation or be null.
In terms of relational integrity…
What is meant by enterprise constraints?
Enterprise constraints are additional rules that are specified by users or admins.
In terms of constraints…
What is meant by restrict?
Restrict will prevent the violation of referential integrity constraints by disallowing the operation.
In terms of constraints…
What is meant by cascade?
Cascade will maintain referential integrity by allowing the changes to flow through to keep integrity.
E.g. If you delete a branch with branchNo 07, then all references to branchNo 07 will also be deleted.
Alternatively, if you updated branchNo 05 to branchNo 06, then all references to branchNo 05 will be changed to 06.
In terms of constraints…
What is meant by nullify?
Nullify maintains referential integrity by changing any violating value to “NULL”.
E.g, if you updated branchNo 05 to 06, all references to 05 will become NULL.
In terms of constraints…
What is meant by triggers?
Triggers maintain referential integrity by following specific user-defined ations.
What do you use as a key for a weak entity type?
Foreign keys of the parent nodes make up the primary key