Class 04. Flashcards

relational models

1
Q

what are relational model terminology?

A
  1. row = tuple/entity
  2. column = attribute
  3. table = relation
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

what are table requirements?

A
  1. attributes have unique names
  2. attribute values are the same
  3. each cell contains single value
  4. non-duplicate rows
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

what do null values indicate?

A

missing information

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

what is a schema?

A

describes the content/relationship/structure of data

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

what does the schema include in a relational model?

A
  1. table name
  2. column name
  3. data type
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

how to convert an ERD to a model with the same attributes?

A
  1. underline primary keys
  2. composite attributes in separate columns
  3. multivariate attributes in separate tables
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

what is a relationship set?

A
  1. attributes are the primary keys
  2. attributes that apply to the relationship itself
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

how to convert many-to-one relationship sets?

A
  1. eliminate separate relation for the relationship
  2. capture the relationship on the “many” side
  3. “null” entity values that don’t participate in the relationship
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

how to convert one-to-one relationship sets?

A
  1. choose which side to capture the relationship on
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

how to convert many-to-many relationship sets?

A
  1. separate relations whose attributes are primary keys of participating entity sets
  2. and attributes that apply to the relationship itself
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

what is the primary key in many-to-many relationships?

A

the union of the primary keys of the entity

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

T/F: you separate the relation for many-to-one + one-to-one relationship sets

A

false

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

what is a foreign key?

A

an attribute in one relation that takes value from the primary key attributes of another relation

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

what is the best way to represent subclasses as relations?

A

using a foreign key to the superclass

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

how do you map higher order relationships?

A

create separate relation with attributes taken from the union of primary keys

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

what if there’s a cardinality constraint in the higher order?

A

entity on the “one” side should not be part of the primary key