Lecture 3B: Relational Model Flashcards

(26 cards)

1
Q

What is another name for relational Model?

A

Conceptual model of data.

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

describe facts for the relational model.

A
  1. all data is structured within relations (tables).

2. dominant database solution

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

Quickly list the DB design from top to bottom

A
  1. conceptual db design
  2. logical db design
  3. physical db design
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

define relation

A

table with columns and rows.

it is a set, thus no duplicate tuples in a relationship

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

define attributes

A

a column of a relation

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

define tuples

A

a row in a relation

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

define domain

A

a set of allowable values for one or more attributes

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

define degree (of a relation)

A

number of attributes it contains

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

define cardinality (of a relation)

A

number of tuples it contains

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

Maths behind Relational Model contains Cartesian products of two sets (D1, D2),

what other names are used to describe these sets?

A
  • a set of ordered pairs
  • sets D1 and D2 are called domains.
    can contain n domains. therefore the relation represented with that product has degree n
    and elements are n-tuples
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

in a relational model we have constraints that impose restrictions on values in a column or a combination of columns within a table.

define constraint.

A

a column or group of columns must be unique across all rows in the table

e.g. student_no must be unique in student table.

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

define superkey

A

attribute or set of attributes that uniquely identify a tuple in a relation

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

define candidate key

A

a superkey such that none of its subset is a superkey for that relation.
e.g. its unique and irreducible

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

what is a primary key

A

the candidate key, that is used to uniquely identify tuples in a relation.
thus, there may be many candidate keys, but only one is chosen as PK

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

What is a foreign key

A

an attribute or set of attributes within one relation (home relation) that matches the candidate key in another relation.

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

Describe “NULL’

A
  1. represents a value that is unknown or the absence of a value
  2. null is different from zero.
  3. null can be used when we don’t know the value for an attribute to prevent inserting a false value
17
Q

list two integrity constraints

A
  1. entity integrity

2. referential integrity

18
Q

define entity integrity

A

no attribute of a primary key can be null

19
Q

define referential integrity

A

if a FK exists, either:
1.the value of the FK matches the value of the Candidate key in the home relation

  1. value of the FK is null
20
Q

List three perspectives

A
  1. user
  2. conceptual
  3. storage
21
Q

describe how users view the data.

A

table, row, column

22
Q

describe the conceptual perspective

A

relation, tuple, attribute

23
Q

describe and explain the storage perspective

A

file, record, field

describe the details of how the data is stored in the computer.

24
Q

list the two constraints

A
  1. domain

2. primary key

25
explain domain constraint
the value of each attribute in each row must be from the domain assigned to this attribute
26
explain primary key constraint
two distinct tuples in any state of the relation, cannot have identical values for all attributes in the key.