Schema Refinement: Functional Dependencies and Normal Forms in Database Design

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/60

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.

61 Terms

1
New cards

What is the primary goal of schema refinement?

To improve database design by addressing issues such as anomalies and ensuring data integrity.

2
New cards

What are functional dependencies (FDs)?

FDs express the relationship where a set of attributes uniquely determines another set of attributes within a relation schema.

3
New cards

What is a lossless-join decomposition?

A decomposition of a relation that allows the original relation to be reconstructed without any loss of information.

4
New cards

What does dependency preservation mean in schema design?

It ensures that all functional dependencies are maintained in the decomposed relations.

5
New cards

What is Boyce-Codd Normal Form (BCNF)?

A normal form that requires every functional dependency X → Y to have X as a superkey.

6
New cards

What are the design principles for relational databases?

Relations should have semantic unity, avoid information repetition, minimize anomalies, and limit null values.

7
New cards

What is an example of a change anomaly?

Update problems, such as changing a supplier's name, can lead to inconsistencies if not managed properly.

8
New cards

What is the purpose of normalization in database design?

Normalization aims to improve the design by organizing data to reduce redundancy and dependency.

9
New cards

What is a superkey?

A set of attributes that can uniquely identify tuples in a relation.

10
New cards

What is a candidate key?

A minimal superkey; it is a set of attributes that uniquely identifies tuples without any unnecessary attributes.

11
New cards

What is the significance of integrity constraints in database design?

Integrity constraints help identify regularities in database instances that can indicate anomalies.

12
New cards

What is a schema's semantic unity?

It refers to the logical coherence of the data within a relation, ensuring that all attributes contribute to a meaningful whole.

13
New cards

What are spurious joins?

Joins that produce incorrect or unintended results due to improper schema design.

14
New cards

What is the role of the ER model in database design?

The ER model provides a conceptual framework for designing the database schema before mapping it to a relational model.

15
New cards

What does it mean for a schema to be good?

A good schema minimizes redundancy, avoids anomalies, and accurately represents the relationships between data.

16
New cards

What is the impact of excessive null values in a database?

Excessive null values can lead to confusion and complicate data retrieval and integrity.

17
New cards

How can schema decompositions avoid anomalies?

By breaking down relations into smaller, more manageable parts while retaining all necessary information.

18
New cards

What is the relationship between functional dependencies and keys?

Keys are derived from functional dependencies; a candidate key is a minimal set of attributes that functionally determines all other attributes.

19
New cards

What is an example of a functional dependency?

In a relation schema, if SIN determines EName, it can be expressed as SIN → EName.

20
New cards

What are the potential problems with a single-table schema?

It can lead to update, insert, and delete anomalies, as well as increased space requirements.

21
New cards

What does the term 'anomaly' refer to in database design?

An anomaly refers to inconsistencies or issues that arise during data operations like insertion, deletion, or updating.

22
New cards

What is the purpose of evaluating schemas?

To detect anomalies and assess the overall quality and effectiveness of the database design.

23
New cards

What is the significance of the parts/suppliers database example?

It illustrates the importance of schema design in managing relationships between parts, suppliers, and pricing.

24
New cards

What is the difference between a relation schema and an instance of a relation?

A relation schema defines the structure of the data, while an instance is a specific set of data that conforms to that structure.

25
New cards

What is a primary key?

A primary key is a candidate key chosen by the Database Administrator (DBA).

26
New cards

Define a superkey.

A superkey is a set of attributes such that no two tuples in an instance agree on their values for those attributes.

27
New cards

What is the relationship between superkeys and functional dependencies?

If K is a superkey for relation schema R, then the dependency K → R holds on R.

28
New cards

What does the closure of a set of functional dependencies F (denoted F +) represent?

F + is the set of all functional dependencies satisfied by every relational instance that satisfies F.

29
New cards

What are Armstrong's axioms in the context of functional dependencies?

Armstrong's axioms are reflexivity, augmentation, and transitivity, which are used to derive logical implications.

30
New cards

What does reflexivity state in Armstrong's axioms?

If Y is a subset of X, then X → Y.

31
New cards

What does augmentation state in Armstrong's axioms?

If X → Y, then XZ → YZ for any Z.

32
New cards

What does transitivity state in Armstrong's axioms?

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

33
New cards

What is schema decomposition?

Schema decomposition is the process of breaking down a relation schema R into a collection of relation schemas R1, R2, ..., Rn such that R = R1 ∪ R2 ∪ ... ∪ Rn.

34
New cards

What are the criteria for a good schema decomposition?

A good decomposition does not lose information, complicate checking of constraints, or contain anomalies.

35
New cards

What condition must be met for a decomposition to be lossless?

The common attributes of the decomposed schemas must form a superkey for at least one of the schemas.

36
New cards

In the example of Grades decomposition, what was the issue with the natural join?

The natural join produced extra data (spurious tuples), indicating that information would be lost.

37
New cards

What is dependency preservation in schema decomposition?

Dependency preservation ensures that all functional dependencies can be enforced on the decomposed schema without needing to join tables.

38
New cards

Which decomposition is better for testing functional dependencies: D1 or D2?

Decomposition D1 is better because it allows testing of functional dependencies on individual tables without requiring joins.

39
New cards

What is the significance of the common attributes in a decomposition?

Common attributes must form a superkey for the decomposition to be considered lossless.

40
New cards

What is the implication of having a lossy decomposition?

A lossy decomposition can lead to loss of information when reconstructing the original relation from its decomposed parts.

41
New cards

How can additional rules for functional dependencies be derived?

Additional rules can be derived using Armstrong's axioms, such as union and decomposition.

42
New cards

What does the union rule state in functional dependencies?

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

43
New cards

What does the decomposition rule state in functional dependencies?

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

44
New cards

What does it mean if a functional dependency is sound?

It means that anything derived from F is also in F +.

45
New cards

What does it mean if a functional dependency is complete?

It means that anything in F + can be derived from F.

46
New cards

What is dependency preservation in database schema decomposition?

A decomposition is dependency preserving if there is an equivalent set of functional dependencies, none of which are interrelational.

47
New cards

Why is decomposition D1 preferred over D2?

Decomposition D1 allows testing functional dependencies FD1 and FD2 on separate tables R1 and R2, while D2 requires joining tables R1 and R3 to test FD2.

48
New cards

What is a 'good' relational database schema?

A good schema consists of independent facts in separate tables, with each relation schema having a primary key and mutually independent attributes.

49
New cards

What are the goals of transforming a schema into a normal form?

The goals are intuitive transformation and an anomaly-free, non-redundant representation of data.

50
New cards

What is the formal definition of BCNF?

A schema R is in BCNF if for every functional dependency (X → Y) in F+, either (X → Y) is trivial or X is a superkey of R.

51
New cards

How does BCNF avoid redundancy?

BCNF avoids redundancy by ensuring that attributes that functionally determine others are superkeys, preventing the need to repeat values.

52
New cards

What is the process for lossless-join BCNF decomposition?

The process involves replacing a relation Ri that violates BCNF with a new relation and adding the functional dependencies to the result until all relations satisfy BCNF.

53
New cards

What is a potential issue with BCNF decomposition?

There may be no efficient procedure for decomposition, and it is possible that no lossless join dependency preserving BCNF decomposition exists.

54
New cards

Provide an example of a schema that is not in BCNF.

R = {Sno, Sname, City, Pno, Pname, Price} is not in BCNF because Sno determines Sname and City but is not a superkey.

55
New cards

What are the functional dependencies in the example schema?

The functional dependencies are Sno → Sname, City; Pno → Pname; Sno, Pno → Price.

56
New cards

What is the result of decomposing a non-BCNF schema?

The schema can be decomposed into R1 = {Sno, Sname, City}, R2 = {Sno, Pno, Price}, and R3 = {Pno, Pname}, which is a lossless-join BCNF decomposition.

57
New cards

What does 1NF eliminate in a relational schema?

1NF eliminates relations within relations or relations as attributes of tuples.

58
New cards

What does 2NF eliminate in a relational schema?

2NF eliminates transitive functional dependencies of non-prime attributes to key attributes.

59
New cards

What does 3NF eliminate in a relational schema?

3NF eliminates partial and transitive functional dependencies of prime attributes to key attributes.

60
New cards

What is the importance of functional dependencies in schema refinement?

Functional dependencies provide clues for eliminating redundancies in a relational schema.

61
New cards

What is the significance of a superkey in BCNF?

A superkey is a set of attributes that can uniquely identify a tuple in a relation, ensuring no redundancy in data representation.