Database Design Test 2 - John Stone

0.0(0)
studied byStudied by 0 people
0.0(0)
full-widthCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/55

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

56 Terms

1
New cards

Who introduced the relational model

E.F Codd in 1970 paper

2
New cards

Entity

some identifiable thing that users want to track

3
New cards

Relation

a dimensional table

4
New cards

Characteristics of a relation

- Rows contain data about an entity

- column contain data about attributes of entity

- all entries in a column are of the same kind

- unique name for each column

- cells of a table hold a single value

- row and column order are unimportant

- no 2 rows are identical

5
New cards

Functional dependency

when the value of one attribute determines the value of the second

6
New cards

Determinant

Determines the outcome of another attribute in Functional dependency

(the left side of the arrow)

7
New cards

candidate key

key that can determine all other columns in a relation

8
New cards

key

a combination of 1 or more columns that is used to identify particular rows in a relation

9
New cards

composite key

key that consists of 2 or more columns

10
New cards

primary key

a candidate key selected as primary to identify a particular row in a relations

Unique and NO NULL Values

11
New cards

surrogate key

an artificial column added to relation to serve as primary key. Has no value outside of the database

12
New cards

Foreign key

a column or composite of columns that is the Primary key of a table other than the one in which it appears

13
New cards

referential integrity constraint

limits the values of the foreign key to those already existing as the primary key values in the corresponding relation.

(the foreign key column has to match the table it comes from primary key)

14
New cards

Modification Anomalies

deletion

insertion

update

15
New cards

1NF

meets the conditions for a relation, has a defined primary key

16
New cards

2NF

in 1NF and all non-key attributes are determined by the entire primary key (partial dependency)

17
New cards

3NF

2NF and there is no non-key attributes determined by other non-key attributes (transitive dependcy)

18
New cards

BCNF

Boyce-Codd Normal Form

Every determinate is a candidate key

19
New cards

4NF

3NF and all multivalued dependencies are in their own relation

20
New cards

putting a relation into BCNF steps:

1. identify every functional dependency

2. identify every candidate key

3. if there is a functional dependency with a determinant that is not a candidate key:

a) move column to new relation

b) make determinant primary key in new relation

c) leave copy of determinant as foreign key in old relation

d) make referential integrity constrains between old and new relation

4. repeat step 3 until every determinant of every relation is a candidate key

21
New cards

Multivalued dependencies

a determinant is matched with a particular set of values

Ex. Employee ---> ---> degrees

(Determinant of MVD cannot be primary key)

22
New cards

advantages of normalization

reduced redundant data

data consistency

flexibility

quicker execution of queries

23
New cards

disadvantages of normalization

increase in the number of tables

requires more joins so it slows down apps

may not suit some types of data (analytical)

24
New cards

when do you not use BCNF

with attributes like zip codes

its just easier to leave them and they rarely change

25
New cards

read only database

non-operational database used in business intelligence for producing information for decision making

26
New cards

updatable database

production DB concerned with modification anomalies, users will be modifying the database, carefully consider normalization

27
New cards

denormalization

joining of data in normalized tables prior to storage

28
New cards

null values

they are ambiguous, meaning you have to assume what NULL means in every case

29
New cards

general-purpose columns

a comment column

users can type whatever they want

very inconsistent and can end up holding multiple data items

30
New cards

Who invented the ER model

Peter Chen 1976

31
New cards

The E-R model

a set of concepts and graphical symbols that can be used to create conceptual designs.

32
New cards

attributes

describe an entity's characteristics

33
New cards

identifiers

attributes that name or identify entity instances

(become keys in database design)

34
New cards

relationships

how entities are associated with eachother

35
New cards

cardinalities

Max= max number of relationship instances

Min= min number of relationship instances that an entity must participate in

36
New cards

Max cardinalities

[1:1]

[1:N]

[N:M]

37
New cards

Min cardinalities

O-O

O-M

M-O

M-M

(don't use the last 2)

38
New cards

Crows foot notation

mandatory one = exactly one ------||---

mandatory many = one or more -----|-<

optional to one = zero or one ------o-|--

optional to many = zero or more ------o-<

39
New cards

strong entities

entity that represents something that can exist on its own

Ex. (PERSON, BUILDING)

40
New cards

weak entities

entity whose existence depends on another entity

Ex (APARTMENT depends on BUILDING)

41
New cards

ID-Dependent entities

a child or weak entity whose identifier includes the identifier of their entity parent

42
New cards

exclusive subtypes

1 supertype relates to AT MOST 1 subtype

(O with an X through it)

43
New cards

inclusive subtype

1 supertype can relate to zero or many subtypes

(open O)

44
New cards

discriminator

attributes that indicate the subtype

Ex. a student can be in many clubs, each club has its own entity. The discriminator is the attribute that tells us which clubs they are in so we know which entities to use.

45
New cards

strong entity relationships

[1:1]

[1:N]

[N:M]

46
New cards

ID-Dependent relationships

multivalued attribute pattern

archetype/instance pattern

association pattern/line item pattern

47
New cards

Intersection table

id dependent table that connects 2 entities and has no attributes

48
New cards

multivalued attributes

one to many relationships

49
New cards

Archetype/Instance pattern

always weak

the id dependent child is the physical manefestation (instance) of the parent.

Ex. (CLASS:SECTION)

50
New cards

Line-Item Patterns

baseline for associative tables

used for selling multiple things on one order

51
New cards

for use by pattern

you have a discriminator and certain attributes are for certain things. Usually used on forms

Used with subtypes

52
New cards

Recursive relationship

self referencing

Ex. (EMPLOYEE and SUPERVISOR)

53
New cards

Transforming Data Models into DB Design: 3 basic steps

1. create a table for each entity

2. create relationships by placing foreign keys

3. specify logic for enforcing minimum cardinality

54
New cards

Transforming Data Models into DB Design: Step 1

1. create a table for each entity

- specify the primary key (consider surrogate)

- specify alternate key

- specify properties for each column

-Null status

-Data types

-default value (if any)

-data constraints (if any)

-verify normalization

55
New cards

Transforming Data Models into DB Design: Step 2

2. create relationships by placing foreign keys

-relationships between strong entities

-identifying relationships with id dependednt entities

-relationships between strong and weak non id dependent entities

-mixed relationship

-relationships between supertype/subtype entities

-recursive relationships

56
New cards

Transforming Data Models into DB Design: Step 3

3. specify logic for enforcing minimum cardinality

O-O relationships

O-M relationships

M-O relationships

M-M relationships