2. Introduction to the Relational Model Flashcards

1
Q

What is the Relational Model?

A

A means of storing information in tables called relations, where each table has multiple columns each with a unique name

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

Explain the concept of tuples as rows

A
  • In mathematical terminology, a tuple is simply a sequence (or list) of values.
  • A relationship between n values is represented mathematically by an n-tuple of values, i.e a tuple with n values, which corresponds to a row in a table.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is meant by the terms relation, tuple and attribute?

A
  • Relation = table
  • Tuple = row
  • Attribute = column
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is meant by a relation instance?

A

This refers to a specific instance of a relation, i.e containing a specific set of rows.

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

What is the domain of an attribute?

A

The set of allowed values

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

What are the properties of relations? (7)

A
  • Relation has a distinct name
  • Each cell contains one single value
  • Attributes in a relation have distinct names
  • Values of an attribute are of the same domain
  • There are no duplicate tuples
  • Order of attributes has no significance
  • Order of tuples has no significance in theory
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Explain the concept of a key

A
  • We must have a way to specify how tuples within a given relation are distinguished.
  • This is expressed in terms of their attributes. That is, the values of the attribute values of a tuple must be such that they can uniquely identify the tuple.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is a superkey?

A

A superkey is a set of one or more attributes that, taken collectively, allow us to identify uniquely a tuple in the relation.

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

What is a candidate key?

A

A candidate key is the minimum amount of attributes you need to identify uniquely a tuple in the relation.

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

What is the Relational Schema Notation?

A

()

  • Primary keys are underlined
  • Foreign keys are followed by an asterisk
  • Attributes are optionally followed by domain information

e.g instructors (id: integer, name: string, dept_name*: string, salary: float)

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