Fundamentals of Databases
45 Questions
0 Views

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to Lesson

Podcast

Play an AI-generated podcast conversation about this lesson

Questions and Answers

What is the correct interpretation of the functional dependency notation X → Y?

  • Each X value must be associated with exactly one Y value. (correct)
  • X value can have multiple Y values.
  • Y is independent of X.
  • X and Y must be the same attribute.

Which of the following statements about trivial functional dependencies is true?

  • A trivial FD must have different attributes on both sides.
  • Trivial FD includes all possible combinations of attributes.
  • A trivial FD is one where Y is not a subset of X.
  • A trivial FD occurs when Y is a subset of X. (correct)

If the functional dependency A → BC is true, which of the following is also true?

  • A does not determine B.
  • BC does not depend on A.
  • A → B is false.
  • A → B and A → C are both true. (correct)

In the relation Drinkers(name, addr, beersLiked, manf, favBeer), which functional dependency is correctly derived?

<p>name → beersLiked (B)</p> Signup and view all the answers

What does it mean for a functional dependency to hold in a relation R?

<p>There exists at least one tuple with the same X value leading to the same Y value. (D)</p> Signup and view all the answers

Which property does NOT apply to functional dependencies?

<p>Symmetry (D)</p> Signup and view all the answers

In the FD (title, year) → (length, genre, studioName), what can be inferred?

<p>title and year alone determine all attributes on the right side. (B)</p> Signup and view all the answers

Which of the following is a correct example of a functional dependency?

<p>A → B, B → C implies A → C (C)</p> Signup and view all the answers

What does the Subset Property (Axiom of Reflexivity) state?

<p>If Y is a subset of X, then X → Y. (C)</p> Signup and view all the answers

Which axiom states that if X functionally determines Y, then a combination of X and Z will functionally determine Y and Z?

<p>Axiom of Augmentation (A)</p> Signup and view all the answers

Which of the following correctly defines a key in a relation R?

<p>A set of attributes that uniquely determines all other attributes of R. (C)</p> Signup and view all the answers

What is a super-key?

<p>A set of attributes that contains a key and can uniquely identify records. (B)</p> Signup and view all the answers

What does the closure of a set of attributes X under a set of functional dependencies S signify?

<p>All the attributes that can be determined from X using S. (B)</p> Signup and view all the answers

If X → Y, Z → W is true, which statement incorrectly combines these functional dependencies?

<p>Z → XW is a valid relation. (B)</p> Signup and view all the answers

Which derived rule allows for separating attributes from a combined functional dependency?

<p>Decomposition (A)</p> Signup and view all the answers

In relation to the closure of attributes, what is a naïve approach to find a closure set?

<p>Always including the original set Y in its closure. (A)</p> Signup and view all the answers

What is the first step in the closure set finding algorithm?

<p>Split all FDs in F such that each FD has a single attribute on the right (A)</p> Signup and view all the answers

Which of the following statements is correct regarding the closure of a set of attributes?

<p>Closure can expand to include additional attributes based on FDs (C)</p> Signup and view all the answers

Given the functional dependencies S = {A→B, B→C, C→D, D→A}, what is a key of the relation R(A, B, C, D)?

<p>{B} (A), {A} (B), {C} (C), {D} (D)</p> Signup and view all the answers

What is the result of computing {AB}+ with the given functional dependencies S = {AB → C, BC → AD, D → E, CF → B}?

<p>{ABCDE} (A)</p> Signup and view all the answers

Which of the following super-keys can be identified for R(A, B, C, D) with the functional dependencies S = {A→B, A→C, C→D}?

<p>{A} (A), {AB} (B), {AC} (C)</p> Signup and view all the answers

What will happen if you reach a fixpoint when calculating the closure?

<p>No more attributes can be added to the closure (A)</p> Signup and view all the answers

Which of the following represents a misconception about super-keys?

<p>Super-keys are the same as keys (B)</p> Signup and view all the answers

For the relation R (A, B, C, D) with S = {AD→B, AB→C, BC→D, CD→A}, which of the following is a key?

<p>{AD} (A), {BC} (B), {AB} (C)</p> Signup and view all the answers

What is the main characteristic of a relation in First Normal Form (1NF)?

<p>Attributes must be single-valued and atomic. (B)</p> Signup and view all the answers

Which of the following indicates that a relation is not in 2NF?

<p>One non-primary key attribute depends on only part of the primary key. (B)</p> Signup and view all the answers

In which scenario would a relation be in Third Normal Form (3NF)?

<p>There are no transitive dependencies among non-key attributes. (A)</p> Signup and view all the answers

How can we recognize that a design is not in 1NF?

<p>There are repeating groups or arrays of values. (A)</p> Signup and view all the answers

Which operation can lead to the loss of information when reconstructing a relation from its decomposed parts?

<p>Applying a Cartesian product operation between two relations. (C)</p> Signup and view all the answers

What is true about a primary key in a relation that is in 2NF?

<p>It must ensure that all non-key attributes are fully dependent on it. (B)</p> Signup and view all the answers

In a relation with attributes A, B, C, and D, if A leads to B, and B leads to C, what can be concluded?

<p>There is a transitive dependency present. (C)</p> Signup and view all the answers

What is a potential outcome if primary key attributes are not unique in a relation?

<p>Data redundancy is likely to occur. (A)</p> Signup and view all the answers

What is one of the principal kinds of anomalies encountered in relational databases?

<p>Redundancy (B)</p> Signup and view all the answers

What type of anomaly occurs when the same information is updated in one tuple but left unchanged in others?

<p>Update Anomaly (D)</p> Signup and view all the answers

Which of the following best describes decomposition of relations?

<p>Splitting attributes of a relation into new relations (A)</p> Signup and view all the answers

What happens if we delete certain tuples with a specific studio name in a database?

<p>The entire movie information may be lost (A)</p> Signup and view all the answers

What can be a consequence of properly decomposing a relation?

<p>Loss of original information (D)</p> Signup and view all the answers

What is one sign that a relation is not properly designed and may lead to anomalies?

<p>Data about the same entities appears in multiple rows (C)</p> Signup and view all the answers

In the context of database anomalies, what does an update anomaly involve?

<p>Update of one occurrence but not all (A)</p> Signup and view all the answers

Which statement regarding decomposition is true?

<p>It can eliminate some anomalies while risking loss of data (C)</p> Signup and view all the answers

What is meant by the phrase 'deletion anomaly'?

<p>Loss of valuable data when a certain entry is deleted (B)</p> Signup and view all the answers

What issue may arise during the reconstruction of a decomposed relation?

<p>Functional dependencies may not hold (A)</p> Signup and view all the answers

Which term refers specifically to unnecessary repetition of data in multiple tuples?

<p>Redundancy (C)</p> Signup and view all the answers

What is the impact of a well-designed relational database schema?

<p>It reduces anomalies and preserves data integrity (D)</p> Signup and view all the answers

How can you describe a consequence of having too much data in a single relation?

<p>Higher likelihood of redundancy and anomalies (C)</p> Signup and view all the answers

Flashcards

Functional Dependency (FD)

A constraint between two sets of attributes in a relation where each value in one set (determinant) uniquely determines a value in the other set (dependent) .

Determinant Set

The set of attributes that functionally determines another attribute.

Dependent Attribute

The attribute whose value is determined by the determinant set of attributes.

Trivial FD

A functional dependency where the dependent attribute is a subset of the determinant set.

Signup and view all the flashcards

FD X → Y on a relation R

If two tuples in relation R agree on attribute X, then they must also agree on attribute Y. This states that the values in X completely determine the values in Y.

Signup and view all the flashcards

Splitting Right Sides of FD's

A functional dependency X → A1A2...An holds if and only if each of X → A1, X → A2, ..., X → An holds.

Signup and view all the flashcards

Key

A minimal set of attributes that uniquely identifies each tuple in a relation.

Signup and view all the flashcards

Super-Key

A set of attributes that uniquely identifies each tuple in a relation. A Key is a super-key, but a super-key is not necessarily a key

Signup and view all the flashcards

Armstrong's Axiom

Fundamental rules used in database normalization. They include the subset property, augmentation, and transitivity axioms.

Signup and view all the flashcards

Subset Property (Reflexivity)

If Y is a subset of X, then X functionally determines Y (X → Y).

Signup and view all the flashcards

Augmentation Axiom

If X functionally determines Y (X → Y), then adding extra attributes (XZ) also determines (YZ).

Signup and view all the flashcards

Transitivity Axiom

If X determines Y (X → Y) and Y determines Z (Y → Z), then X determines Z (X → Z).

Signup and view all the flashcards

Key (Database)

A set of attributes that uniquely identifies each tuple (row) in a relation. It cannot be reduced.

Signup and view all the flashcards

Functional Dependency

A constraint between two sets of attributes in a database where the value of one attribute determines the value of another attribute.

Signup and view all the flashcards

Closure Set

The set of all attributes that can be functionally determined from a given set of attributes using a set of functional dependencies.

Signup and view all the flashcards

Closure Set Algorithm - Step 1

Split all functional dependencies so that each one has only one attribute on the right side.

Signup and view all the flashcards

Closure Set Algorithm - Step 2

Initialize the result set with the given input set of attributes.

Signup and view all the flashcards

Closure Set Algorithm - Step 3

Iterate through the functional dependencies, adding each dependent attribute to the result set if the determinant is a subset of the current result.

Signup and view all the flashcards

Closure Set Algorithm - Example

Given the relation R(A,B,C,D,E,F) and functional dependencies {AB → C, BC → AD, D → E, CF → B}, compute the closure of {AB}.

Signup and view all the flashcards

Super-Key vs Key

A key is always a super-key, but a super-key is not always a key.

Signup and view all the flashcards

1NF (First Normal Form)

A relation is in 1NF if all attributes are atomic, meaning they cannot be further divided. Also, all tuples (rows) are unique.

Signup and view all the flashcards

Atomic Attribute

An attribute that cannot be further broken down into smaller components. It represents a single, indivisible piece of information.

Signup and view all the flashcards

2NF (Second Normal Form)

A relation is in 2NF if it is in 1NF and all non-key attributes are fully dependent on the primary key. This means no non-key attribute can be determined by only part of the primary key.

Signup and view all the flashcards

3NF (Third Normal Form)

A relation is in 3NF if it is in 2NF and no non-key attribute is dependent on another non-key attribute. It eliminates transitive dependencies.

Signup and view all the flashcards

Transitive Dependency

A non-key attribute depends on another non-key attribute, which in turn depends on the primary key.

Signup and view all the flashcards

Primary Key

A minimal set of attributes that uniquely identifies each tuple in a relation. Its values are unique and cannot be further reduced.

Signup and view all the flashcards

Is a relation in 1NF?

To determine if a relation is in 1NF, check if each attribute is atomic and each tuple is unique. Split non-atomic attributes into separate ones.

Signup and view all the flashcards

Is a relation in 2NF?

To determine if a relation is in 2NF, check if it's already in 1NF. Then verify if every non-key attribute depends on the full primary key, not just a portion of it.

Signup and view all the flashcards

Anomalies in Database Design

Issues that arise when a database schema is poorly designed, leading to redundancy and inconsistencies in data.

Signup and view all the flashcards

Redundancy Anomaly

When the same data is repeated unnecessarily in multiple records, leading to wasted space and potential inconsistencies.

Signup and view all the flashcards

Deletion Anomaly

Deleting a record unintentionally removes related information, causing data loss.

Signup and view all the flashcards

Decomposition

The process of breaking down a large relation into smaller, related relations to eliminate anomalies.

Signup and view all the flashcards

Relation Decomposition Rule

To decompose a relation R(A1,..,An) into S(B1,..,Bm) and T(C1,..,Ck), the following must hold: {A1,..,An} = {B1,..,Bm} U {C1,..,Ck}, S = ∏B1,..Bm(R), T = ∏C1,..,Ck(R). This means the attributes are split across the new relations, and the new relations are projections of the original relation.

Signup and view all the flashcards

Decomposition Benefits

Decomposition eliminates redundancy, reduces the risk of update anomalies, and helps to prevent data loss due to deletion anomalies.

Signup and view all the flashcards

Decomposition Drawbacks

Decomposition might lead to loss of information or make it difficult to reconstruct the original information. Also, after decomposition, the functional dependencies might not hold in the smaller relations.

Signup and view all the flashcards

Loss of Information

During decomposition, some information might be lost if it is not explicitly represented in the new relations.

Signup and view all the flashcards

Reconstructing Original Information

After decomposition, reconstructing the complete information from the smaller relations might not be possible or could be quite complex.

Signup and view all the flashcards

Functional Dependencies in Decomposition

Functional dependencies might not be preserved in the decomposed relations, potentially introducing inconsistencies.

Signup and view all the flashcards

Study Notes

Fundamentals of Databases

  • The presentation covers functional dependencies and normal forms in database design.
  • Functional dependencies (FDs) in database design establish constraints between sets of attributes in a relation.
    • An FD (X → Y) means that if two tuples in a relation share the same X value, they will also share the same Y value.
    • If Y is a subset of X (X → Y), then the dependency is considered trivial.
  • Several properties of functional dependencies are derived from Armstrong's axioms, which are important in database normalization.
    • Subset Property: If Y is a subset of X, then X → Y.
    • Augmentation: If X → Y, then XZ → YZ.
    • Transitivity: If X → Y and Y → Z, then X → Z.
    • Secondary rules derived from these include Union, Decomposition, Pseudo transitivity, Accumulation, and Extension.
  • Keys and Superkeys in databases are important to uniquely identify entities in a relation.
    • A key is a set of attributes that uniquely determines all other attributes of the relation.
    • A superkey is a set of attributes that contains a key.
    • Keys must be minimal, meaning no proper subset of the attributes can also serve as a key.
  • Closure sets are used to determine all attributes that can be derived from a given set of attributes using functional dependencies established in the dataset (relation).
    • The closure of X under S, written X+, represents all attributes determinable from X by applying all the functional dependencies in S.

Normal Forms

  • Normal forms (1NF, 2NF, 3NF) are used to organize data in a relational database to minimize redundancy and anomalies.

  • Anomalies are problems that can occur when data is not normalized correctly, such as redundancy in storing and retrieving data from the database.

  • First Normal Form (1NF): Ensure attributes are single-valued and atomic.

  • Correct: Each attribute contains only a single value; no attributes are multi-valued (e.g., contain comma-separated values.)

  • Incorrect : Example: a 'colors' attribute containing multiple colors for a single item, violates 1NF.

  • Second Normal Form (2NF): A relation is in 2NF if it is in 1NF and every non-prime attribute is fully functionally dependent on the primary key.

  • Non-primary key attributes must depend on the whole primary key, not just part of it.

  • Third Normal Form (3NF): A relation is in 3NF if it is in 2NF and no non-prime attribute depends on another non-prime attribute that is not part of the primary key.

  • Attributes should not be determined by non-key attributes, only by the primary key.

  • Decomposition: The accepted method to eliminate anomalies in database design involves splitting relations into smaller relations to reduce redundancy and avoid anomalies in databases

  • The presentation includes case studies and exercises to demonstrate how to identify functional dependencies, keys, superkeys, closure sets, different normal forms, and decompositions.

Studying That Suits You

Use AI to generate personalized quizzes and flashcards to suit your learning preferences.

Quiz Team

Related Documents

Lecture 5 FD NFs PDF

Description

This quiz covers essential concepts related to functional dependencies and normal forms in database design. It includes the properties derived from Armstrong's axioms and the importance of keys and superkeys in uniquely identifying entities within relations. Test your knowledge on these foundational topics critical to database normalization.

More Like This

Use Quizgecko on...
Browser
Browser