Module 2: Relational Data Model Flashcards

1
Q

What are relations?

A

The main construct for representing data in a relational model. It is an unordered set of unique, non-duplicated tuples.

Relations are composed of the following:
– a relation name
– tuples
– attribute names
– attribute values (of a particular domain)

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

What is a domain?

A

A domain is a set of ATOMIC values; they can’t be broken down any further.

Each domain has a particular data type.

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

What are attributes?

A

The “columns” of the relation are named attributes, each with the own domain.

The number of attributes in a relation is the DEGREE of the relation.

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

What are tuples?

A

An ordered list of n values that represent all the data for a particular row in a relation.

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

What is relation schema?

A

Includes the relation name and, in square brackets, the list of attributes.

R [A1, A2, A3…]

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

What is a relation instance?

A

An instance of a relation schema shows the data in a relation at a particular moment in time. Includes the relation name and, in curly brackets, all the tuples of the relation.

r = {T1, T2, T3…}

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

What is the proper ordering of tuples?

A

Syntactically, the tuples can be in any order.

Semantically, each tuple must be in the same order as the attributes (and their domains).

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

What are the five main integrity constraints?

A

1) Domain constraints
2) Key constraints
3) Entity integrity constraints
4) Referential integrity constraints
5) Semantic integrity constraints

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

What is a domain constraint?

A

Each attribute belongs to a domain, i.e., it must include only a specified data type.

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

What is a key?

A

A key is the attribute within a relation that uniquely identifies a tuple.

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

What is a superkey?

A

Any combination of a relation’s attributes that also includes the primary key.

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

What is the key constraint?

A

The primary key in a relation (a set) must be unique at all times.

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

What is the entity integrity constraint?

A

Primary keys can NEVER be null; if they consist of multiple attributes, none of those attributes can be NULL at any time.

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

What is a foreign key?

A

When one relation has, as one of its attributes, the primary keys of another relation; these foreign keys allow us to reference that other relation.

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

What is the referential integrity constraint?

A

A relation cannot have a foreign key that does not yet exist as a primary key in another relation.

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

What is the semantic integrity constraint?

A

Constraints that cannot be captured in data model. These are business rule implemented using SQL or other such language.