DB Midterm

0.0(0)
Studied by 1 person
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/59

encourage image

There's no tags or description

Looks like no tags are added yet.

60 Terms

1
New cards

What are the drawbacks of a file system? There are 6.

data redundancy and inconsisteny, difficulty accessing data, integrity problems, atomicity of updates, concurrent access anomolies, security problems

2
New cards

What is the network database model?

Navigational, any links allowed for quick access

3
New cards

What is the hierarchical database model?

Navifational, links but no cycles

4
New cards

Define the Relational database model

Data independence, data in tables

5
New cards

What is data independence?

Lets used say what data they want, not how to get it

6
New cards

What is physical (internal) data abstraction?

how data is stores, complex low-level data structures and access paths

7
New cards

What is logical (conceptual) data abstractions?

what data is stored and what replationships exist among the data

8
New cards

What is view (external) data abstraction?

the part of the data a user or group cares about

9
New cards

What is the storage manager?

The module between low-level stored data and the application program it queries.

10
New cards

What is query processing?

  1. parsing and translation 2. optimization 3. evaluation


11
New cards

What is a transaction?

a collection of operations that performs a single logical function

12
New cards

What is the transaction-management component?

keeps the database consistent despite system and transaction failures

13
New cards

What is the concurrency-control manager?

controls the interactions among concurrent transactions so the database stays consistent

14
New cards

What is a relation?

A table

15
New cards

What is a tuple?

a rowW

16
New cards

what is an attribute?

a column

17
New cards

What is schema (R)?

the set of attributeswha

18
New cards

What is instance r(R)?

The set of tuples at a given timeW

19
New cards

hat is the domain?

The limited set of values an attribute may take

20
New cards

What are the characteristics of relations?

no inherent ordering of tuples or attributes, all attribute levels are atomic, no duplicate tuplesW

21
New cards

What is a superkey?

any attribute or set of attributes that uniquely identify a tupleW

22
New cards

What is a candidate key (minimal key)?

a superkey where removing any attribute leaves a set that is no longer a superkey

23
New cards

What is a compound key?

a key made of several attributes, removing any one attribute must break uniqueness

24
New cards

What is a primary key?

the one candidate key chosen to identify tuples

25
New cards

What is a foreign key?

The primary key of relation R1 appearing in relation R2

26
New cards

What does σ_condition do?

Select, keeps the rows that satisfy the condition

27
New cards

What does π_attribute list do?

Project, keeps the listed columns

28
New cards

What does R ∪ S do?

Union, shows rows in R or S

29
New cards

What does R ∩ S do?

intersection, shows rows in R and S

30
New cards

What does R - S do?

Difference, rows in R but not in S

31
New cards

What does R x S do?

Cartesian product, every row of R paires with every row of S

32
New cards

What does R ⋈θ S do?

Theta join, cartesian product followed by a select on condition theta

33
New cards

What does R ⋈ S do do?

natural join, equi-join on all attributes with the same name

34
New cards

What does what does ⟕ ⟖ ⟗ do?

outer join, joins that keep unmatched rows, padded with nulls

35
New cards

What does R1/R2 do?

division, values in Ri paired with every row of R2

36
New cards

What does at does ρ do?

Renames a relation or attribute

37
New cards

What is the formula for R1/R2, if R1(Student#, Degree) and R2(Degree)?

R1 / R2 = pi_{student}(R1) - pi_{student}((pi_{student}(R1) R2) - R1)

38
New cards

What are the steps of a division problem?

  1. pair every student with every required degree 2. subtract what they actually have, leaving the disqualified students 3. subtract the disqualified students from all students


39
New cards

Why does a single wide table fail?

incompleteness, query complexity, and wasted storage

40
New cards

What is the design approach?

identify relations and relationships, normalize each relation and relationship

41
New cards

What is a functional dependency?

X → Y, whenever two tuples agree on X, they also agree on Y, a generalization of the notion of a key

42
New cards

What if F+?

the closure of F, the set of all FDs derivable from F using Armstrong’s axoims/

43
New cards

Reflexivity

If Y ⊆ X, then X → Y

44
New cards

Augmentation

If X → Y, then XZ → YZ

45
New cards

Transitivity

If X → Y and Y → Z, then X → Z

46
New cards

Projectivity

If X → YZ, then X → Y and X → Z

47
New cards

Additivity

If X → Y and X → Z, then X → YZ

48
New cards

Pseudotransitivity

If f X → Y and WY → Z, then XW → Z

49
New cards

What is attribute closure?

Attribute closure tests whether X → Y is in F+ without computing F+ and finding candidate keys

50
New cards

What is 1NF?

all domains hold atomic values, no multivalued cells

51
New cards

What is 2nf

1NF and every non-key attribute is fully dependent on the whole primary key

52
New cards

What is 3NF?

2NF and no non-key attribute depends transitively on the key

53
New cards

What is BCNF?

3NF and every attribute depends only on the key

54
New cards

4NF

BCNF and no non-trivial multivalued dependencies

55
New cards

What is the lossless decomposition?

R1 and R2 → R1 or R1 and R2 → R2, a decomposition is lossles sif the common attributes determine all of R1 and R2

56
New cards

What is an example of a lossless decomposition?

R1(sid, degree), R2(degree, program), The common attribute is degree and degree → program so R1 and R2 → R2

57
New cards

What is an example of a lossy decomposition?

R1(side, program), R2(degree, program). The common attribute is program which determines neither side.

58
New cards

What is dependency preservation?

F+ = (F1 or F2)+, a decomposition preserves dependencies if the FDs that hold inside each piece still imply all of F.

59
New cards

How do you build the minimal cover?

Remove transitive dependencies, combine FDs with the same left side, removing extra left-side attributes

60
New cards

What is the 3nf decomposition algorithm?

  1. compute the minimal cover of the FDs

  2. Create one relation Ri per FD in the cover

    1. if not Ri contains the whole key of R, add one more relation holding that key