Week 2 - Flashcards

1
Q

What is the challenge of the conceptual data model?

A

With the conceptual data model, we need to transform a textual description of a real problem into a set of concepts conveying exactly the same information.

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

What are the two fundamental approaches of conceptual data modelling?

A
Entity-Relationship Modelling
Relational modelling (mathematical)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is a limitation of ER model?

A

It does not guarantee optimality in operations and query executions, whereas the Relational Modelling does

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

What is a conceptional data model?

A

It is a mathematical model for interpreting our data. It uses theorems from set theory, functional dependency and normalisation theory and relational algebra

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

What do we need to identify before using the conceptual data model?

A

The entities, attributes and relationships

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

Any entity and any relationship are modelled as a relation, which maps to a 2-D table. What are the rows and columns in this 2-D table?

A

Columns are an ordered set of attributes.
A set of tuples (rows) represents instances.
There exists a specific attribute that uniquely identifies a tuple in the relation

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

How do you define a schema of a relation?

Hint: include relation R, attributes A1,…,An, and domain Di.

A

The schema of a relation: R(A1,A2,…,An)

Relation with name R and an ordered set of attributes A1,A2,…,An.
Each attribute Ai assumes values in a domain Di

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

How do you define a tuple t of relation R?

A

A tuple t of R is an ordered set of values corresponding to attributes of R, satisfying the domain constraints:
t=(v1,v2,…,vn), vi in Di

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

What is an instance of a relation r(R)?

A

An instance of a relation r(R) is a set of tuples:

r(R) = {t1,t2,t3,…,tm}: ti is a tuple of R

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

What are the possible reasons for a null value?

A

Represents an unknown, inapplicable, uncertain or missing value.

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

How do you define a relational database schema?

A

it is a set of relations:

s = {R1,R2,…,Rn} or {Null}

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

What is the definition of relational constraints?

A

Relational constraints are conditions that must hold on all instances, for each relation

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

What are the three fundamental constraints?

A
Key constraints (unique tuple identification)
Entity integrity constraint (keys are never null)
Referential integrity constraint (interpretation of relationships)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is the superkey of a relation?

A

A superkey of a relation R is a set of attributes containing at least one attribute that uniquely identifies any tuple.

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

Where SK is the super key and t1 and t2 are two distinct tuples, if t1 doesn’t equal t2 in the instance r(R), then what can we say about t1[SK] and t2[SK]

A

t1[SK] doesn’t equal t2[SK]

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

What is a candidate key?

A

A candidate key is the minimal super key; ie the key with the smallest number of attributes that uniquely identifies tuples. i.e. these are the only attributes that i need to provide a unique tuple.

17
Q

How do we prove a candidate key?

A

Let K = {A1,A2,…,An} i.e. a list of attributes, then:

K is a candidate key if and only if K’ = K{Aj} is not a SK for any Aj in K.

i.e. the removal of any attribute from K results in K’ that is no longer a superkey.

\ means “without”

18
Q

What is the primary key?

A

One of the available candidate keys.

19
Q

What is the entity integrity constraint principle?

A

The primary key (PK) cannot be null in any tuple of instance r(R).

i.e. t[PK] is not equal to NULL for any tuple t in r(R)

If PK has several attributes, NULL is not allowed in any of these attributes.

20
Q

What is a composite key?

A

When the primary key has more than one attribute

21
Q

What is the referential integrity constraint?

A

Two relations are associated if and only if they both share common attributes.

22
Q

If we have R1 and R2 as relations, what is a foreign key in R1?

A

There exists an attribute Foreign Key in R1 that either has exactly the same value with the primary key in R2 or is null.

23
Q

If K is a super key, then any superset of K is a….

A

Superkey

24
Q

The Candidate Key is the minimal superkey: i.e. K is a candidate key if there is no subset of K that is also a superkey. Is this statement true or false?

A

True

25
Q

Is the following statement true or false:

“A relation can have only one candidate key”?

A

This is false. A relation can have several different candidate keys; one of them is chosen to be the Primary Key (PK).

Convention: key attributes are underlined in the relation schema.

26
Q

What values should the foreign key have in a referencing relation?

A

A foreign key should either be NULL (if it is not part of the primary key) or should have a value of the primary key of the referenced relation.

27
Q

What is the secondary key?

A

Out of the candidate keys, you randomly name one of them the primary key and the rest which weren’t so lucky are secondary keys. Secondary keys therefore should never be null

28
Q

What is a composite primary and composite foreign key?

A

A primary key that is made by the combination of more than one attribute is known as a composite key.