Functional Dependencies in Databases
40 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 happens when an attribute is removed from the left-hand side of a functional dependency if it is extraneous?

  • The set of dependencies remains equivalent. (correct)
  • The dependency remains valid.
  • The dependency must be augmented.
  • The dependency becomes invalid.
  • In the process of finding a minimal cover, what step is taken after identifying that a dependency can be separated into individual dependencies?

  • Check for equivalence between the original and modified sets. (correct)
  • Determine if any attributes are redundant.
  • Augment the dependencies on both sides.
  • Eliminate redundant dependencies.
  • Which functional dependency set was derived from the original set E: {B → A, D → A, AB → D}?

  • {B → A, D → A, AB → D, B → D}
  • {A → B, D → A, B → D}
  • {B → D, D → A, A → B}
  • {B → A, D → A, B → D} (correct)
  • What is the rule used to replace AB → D with B → D?

    <p>Transitive rule.</p> Signup and view all the answers

    What is a situation where a functional dependency can be considered redundant?

    <p>If it can be derived using other dependencies.</p> Signup and view all the answers

    Why can Y, a proper subset of X, not replace X in a dependency X → A?

    <p>It might lose the association with A.</p> Signup and view all the answers

    What is the first step in finding a minimal cover for a set of functional dependencies?

    <p>Replace multi-valued dependencies with single dependencies.</p> Signup and view all the answers

    What is the minimum cover of the given set E: {B → A, D → A, AB → D}?

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

    What do functional dependencies (FDs) specify in relational designs?

    <p>Constraints derived from data attributes</p> Signup and view all the answers

    Which of the following statements correctly defines the relationship represented by X → Y?

    <p>X determines a unique value for Y</p> Signup and view all the answers

    Which example best illustrates a functional dependency?

    <p>Employee ID determines employee address</p> Signup and view all the answers

    What must be true for an attribute set X to functionally determine another attribute set Y?

    <p>Y must only have one corresponding value for each value of X</p> Signup and view all the answers

    Which condition is necessary for a set of attributes K to be a key in the schema R?

    <p>K must functionally determine all attributes in R</p> Signup and view all the answers

    How can functional dependencies be visually represented?

    <p>By indicating with arrows on a relation schema</p> Signup and view all the answers

    Which inference rule states that if X determines YZ, then X determines both Y and Z?

    <p>Decomposition</p> Signup and view all the answers

    In order to establish functional dependencies from data instances, what is required?

    <p>An understanding of the meanings of attributes and their relationships</p> Signup and view all the answers

    What is a characteristic feature of a dense index?

    <p>Has an entry for every search key value in the data file</p> Signup and view all the answers

    What is the closure of a set F of functional dependencies?

    <p>The set of attributes determined by F</p> Signup and view all the answers

    What characteristic does a valid functional dependency imply about two tuples in a relation?

    <p>If they have the same value for X, they have the same value for Y</p> Signup and view all the answers

    Which of the following describes a clustering index?

    <p>Organizes records based on a non-key field without distinct values</p> Signup and view all the answers

    What does the closure X+ represent with respect to a set of functional dependencies F?

    <p>All attributes determined by the subset X</p> Signup and view all the answers

    If the set of functional dependencies includes FD1: Classid → Course#, Instr_name, Credit_hrs, Text, Publisher, Classroom, Capacity, what can be concluded?

    <p>Classid determines all attributes in the relation</p> Signup and view all the answers

    Which inference rule applies if you have X determining Y and X determining Z, thus allowing you to conclude X determines YZ?

    <p>Union</p> Signup and view all the answers

    Which of the following statements is true about secondary indexes?

    <p>They offer an alternative way to access a data file</p> Signup and view all the answers

    What is the initial step in the algorithm to determine the closure of X under functional dependencies F?

    <p>Set X+ to X</p> Signup and view all the answers

    Which of the following would be a feasible solution for managing overflow records in primary indexes?

    <p>Implement an unordered overflow file</p> Signup and view all the answers

    In the closure determination algorithm, what denotes that the process should continue iterating?

    <p>When X+ does not change after an iteration</p> Signup and view all the answers

    What is the function of the Pseudotransitivity rule in relation to sets of functional dependencies?

    <p>To relate multiple dependencies through a common attribute</p> Signup and view all the answers

    What is the main purpose of a secondary index?

    <p>To facilitate a secondary means of data access when primary access exists</p> Signup and view all the answers

    In the context of primary indexes, what does 'P(i)' represent?

    <p>Pointer to a disk block</p> Signup and view all the answers

    What major problem is associated with primary indexes during data modifications?

    <p>Inserts and deletes require record rearrangement</p> Signup and view all the answers

    What is a disadvantage of a sparse index compared to a dense index?

    <p>Fewer pointers leading to some record access issues</p> Signup and view all the answers

    What is the result of applying a NATURAL JOIN on EMPLOYEE_1 and EMPLOYEE_3?

    <p>It excludes all employees with NULL values in Dnum.</p> Signup and view all the answers

    What defines a dangling tuple in the context of the EMPLOYEE relation?

    <p>It is a tuple without an associated department.</p> Signup and view all the answers

    Which representation avoids dangling tuples in regard to department assignments?

    <p>Excluding tuples without department assignments in EMPLOYEE_3.</p> Signup and view all the answers

    What format do the relations EMPLOYEE_1 and EMPLOYEE_2 have regarding their attributes?

    <p>EMPLOYEE_1 excludes Dnum while EMPLOYEE_2 includes it with NULL.</p> Signup and view all the answers

    How does the transformation of EMPLOYEE into EMPLOYEE_3 affect data integrity?

    <p>It enhances data integrity by removing unnecessary NULLs.</p> Signup and view all the answers

    What possible issue arises when using NULL values in the EMPLOYEE relation?

    <p>It may lead to unexpected results in JOIN operations.</p> Signup and view all the answers

    What is a key characteristic of the EMPLOYEE_2 relation?

    <p>It retains tuples even if Dnum is NULL.</p> Signup and view all the answers

    Which employees would not appear in the result of a NATURAL JOIN between EMPLOYEE_1 and EMPLOYEE_2?

    <p>Employees who have NULLs in Dnum.</p> Signup and view all the answers

    Study Notes

    Functional dependencies

    • Functional dependencies (FDs) are used to measure how good a relational database design is.
    • FDs are constraints derived from the real-world interrelationship between attributes.
    • A set of attributes (X) functionally determines another set of attributes (Y) if the value of X determines a unique value for Y.
    • Example of an FD constraint: SSN determines employee name (SSN → ENAME).

    Defining FDs

    • X → Y holds if whenever two tuples have the same value for X, they must have the same value for Y.
    • The constraint of X → Y applies to every relation instance.

    Examples of FD Constraints

    • SSN → ENAME: Social Security number determines employee name.
    • PNUMBER → {PNAME, PLOCATION}: Project number determines project name and location.
    • {SSN, PNUMBER} → HOURS: Employee SSN and project number determine hours per week worked on the project.
    • If K is a key of R, then K functionally determines all attributes in R.

    Inference Rules for FDs

    • Decomposition: If X → YZ, then X → Y and X → Z.
    • Union: If X → Y and X → Z, then X → YZ.
    • Pseudotransitivity: If X → Y and WY → Z, then WX → Z.

    Closure

    • The closure of a set F of FDs (F+) is the set of all FDs inferred from F.
    • The closure of a set of attributes X with respect to F (X+) is the set of all attributes that are functionally determined by X.

    Minimal Sets of FDs

    • A set of FDs is minimal if no FD can be removed or replaced with a simpler one without changing the meaning of the set.
    • Algorithm 15.2 finds a minimal cover F for a set of FDs E.
    • There are several steps to finding a minimal cover including replacing dependencies, removing redundant attributes, and removing redundant dependencies.

    Problems with Null Values and Dangling Tuples

    • There can be problems with null values in a database, especially when joining tables together.
    • Dangling tuples can occur when a tuple in one table does not have a matching tuple in another table, resulting in incomplete results.

    Primary Indexes

    • Ordered file with two fields: primary key and pointer to a disk block.
    • One index entry for each block in the data file.
    • Indexes can be dense or sparse:
      • Dense index: index entry for every search key value in the data file.
      • Sparse index: entries for only some search values.

    Clustering Indexes

    • File records are physically ordered on a nonkey field.
    • Ordered file with two fields: clustering field and disk block pointer.

    Secondary Indexes

    • Provide secondary means of accessing a data file.
    • Ordered file with two fields: indexing field and block pointer/record pointer.
    • Usually need more storage space and longer search time than primary indexes.
    • Improve search time for arbitrary records.

    Studying That Suits You

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

    Quiz Team

    Related Documents

    chapter 14_merged.pdf

    Description

    This quiz explores the concept of functional dependencies in relational database design. Learn how attributes interrelate and the significance of FDs in ensuring data integrity. Test your understanding with real-world examples and constraints.

    More Like This

    Use Quizgecko on...
    Browser
    Browser