Relational Model Flashcards

1
Q

In the context of RDBMS…

What is meant by DDL?

(Data Definition Language)

A

Refers to defining relation schemas and constraints.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

In the context of RDBMS…

What is meant by DML?

(Data Manipulation Language)

A

Refers to inserting, updating, deleting and retrieving data.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

In the context of RDBMS…

What is meant by DCL?

(Data Control Language)

A

Refers to security and accessibility.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is an attribute in a relational data model?

A

One (of potentially many) properties that define an entity.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is a tuple in a relational data model?

A

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)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is the cardinality in the relational data model?

A

The number of tuples in a relation.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is degree in the relational data model?

A

The number of attributes in the relation

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is in a column?

A

The column contais the set of values for any particular attribute.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is a NULL value?

A

A value which is either not known or unavailable, it is filled with “NULL”.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is a relational database?

A

A collection of relations

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

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?

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is a primary key?

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is a candidate key?

A

A set of attributes that uniquely identify tuples in the relation. Can be more than one candidate key.

Can be null.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is a foreign key?

A

An attribute or set of attributes that uniquely identiy a row of a different table.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

In terms of relational integrity…

What is meant by domain constraints?

A

Domain constraints mean that data values must live in a specified domain.

E.g. Phone numbers will always be made up of exclusively integers.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

In terms of relational integrity…

What is meant by entity integrity?

A

Entity integrity means that the value of a primary key must not be NULL and must be unique for that table.

17
Q

In terms of relational integrity…

What is meant by referential integrity?

A

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.

18
Q

In terms of relational integrity…

What is meant by enterprise constraints?

A

Enterprise constraints are additional rules that are specified by users or admins.

19
Q

In terms of constraints…

What is meant by restrict?

A

Restrict will prevent the violation of referential integrity constraints by disallowing the operation.

20
Q

In terms of constraints…

What is meant by cascade?

A

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.

21
Q

In terms of constraints…

What is meant by nullify?

A

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.

22
Q

In terms of constraints…

What is meant by triggers?

A

Triggers maintain referential integrity by following specific user-defined ations.

23
Q

What do you use as a key for a weak entity type?

A

Foreign keys of the parent nodes make up the primary key