week 3 : relational data model Flashcards

(18 cards)

1
Q

what is a relational data model?

A
  • based on the mathematical concept of a relation
  • organizes and represents data in a form of a table
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

relation

A

a table with rows and columns

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

tuple

A

row of a relation

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

attribute

A

a named column of a relation

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

degree (of a relation)

A

number of attributes in a relation

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

cardinality (of a relation)

A

number of tuples in a relation

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

domain

A

set of allowable values for each attribute

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

relational model terminology

A
  • base relation
  • view
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

base relation

A

a named relation corresponding to an entity in conceptual schema, whose tuples are physically stored in a database

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

view

A
  • dynamic result of one or more relational operations operating on base relations to produce another relation
  • a virtual relation that does not necessarily actually exist in the database but is produced upon request (at time of request)
  • dynamic : changes made to base relations that affect view attributes are immediately reflected in the view
  • contents of a view : query on one or more base relations
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

properties of relations (1-3)

A

1) relation name is distinct from all other relation names in relational schema

2) each cell of relation contains exactly one atomic (single) value

3) values of an attribute are all from the same domain

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

properties of relations

A

4) each attribute has a distinct name

5) each tuple is distinct (no duplicates)

6) order of attributes has no significance

7) order of tuples as no significance

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

relational keys

A
  • candidate key
  • primary key
  • alternate key
  • foreign key
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

candidate key

A
  • any minimal set of attributes that can uniquely identify each tuple in relation
  • relation may have 1 or more candidate keys
  • consists of a single attribute or multiple attributes
  • multiple attribute keys = composite keys
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

primary key

A

one candidate key –> primary key whose values are used to identify tuples uniquely in a relation

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

alternate key

A

candidate keys that are not selected to be the primary key

17
Q

primary key criteria

A
  • minimal set of attributes
  • less likely to have its values changed
  • less likely to lose uniqueness in the future
  • fewest characters
  • easier to use from the user’s POV
18
Q

foreign key

A
  • attribute which provides a logical link between tables
  • an attribute/set of attributes within one relation (r1) that matches the candidate key of some relation (r2), (can be the same key)