Functional Dependencies Flashcards

1
Q

What are the two primary principles of database design?

A

The two primary principles of database design are:

Capture all the information that needs to be captured by the underlying application.
Achieve the above with little redundancy.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How is the first principle enforced in database design?

A

The first principle is enforced in database design through the use of an Entity-Relationship (ER) diagram. An ER diagram helps capture the essential entities, relationships, and attributes within the domain of the application.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

How is the second principle enforced in database design?

A

The second principle is enforced in database design through normalization. Normalization is the process of organizing data in a database to reduce redundancy and improve data integrity.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is the role of an ER diagram in the database design process?

A

An ER diagram plays a crucial role in capturing the information needed by the underlying application. It represents entities, relationships, and attributes, providing a visual representation of the data model.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Why is achieving little redundancy important in database design?

A

Achieving little redundancy is important in database design because it helps optimize storage, reduces the likelihood of data inconsistencies, and improves the overall efficiency and performance of the database.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is a functional dependency (FD) in the context of a database?

A

A functional dependency (FD) in the context of a database has the form of X → Y, where X and Y are sets of attributes. It signifies that whenever two tuples are identical on all the attributes in X, they must also be identical on all the attributes in Y. It is a constraint that reflects the relationships between attributes in a database.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

How does a functional dependency relate to redundancy in a database?

A

Functional dependencies play a crucial role in reducing redundancy in a database. By identifying and enforcing functional dependencies, we can organize data in a way that minimizes duplication and ensures data integrity. Redundancy is reduced because the values in one set of attributes (X) uniquely determine the values in another set (Y).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What are the properties of functional dependencies, and how do they contribute to their understanding?

A

The properties of functional dependencies include:

Reflexivity: If Y is a subset of X, then X → Y holds.
Augmentation: If X → Y holds, then adding attributes to both sides maintains the dependency, e.g., if X → Y, then XZ → YZ.
Transitivity: If X → Y and Y → Z hold, then X → Z.

These properties, also known as axioms or rules, help in understanding and manipulating functional dependencies.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is the Closure Test algorithm, and how does it work?

A

The Closure Test algorithm is a method to determine the closure of a set of attributes with respect to a set of functional dependencies. It starts with the given set of attributes and iteratively applies the given functional dependencies to find the closure. The closure is the set of all attributes that can be functionally determined from the given set.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

How are candidate keys and the Closure Test related?

A

Candidate keys can be identified using the Closure Test. To check if a set of attributes is a candidate key, the Closure Test is applied. If the closure of the set includes all attributes in the relation, then it is a candidate key.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

How can functional dependencies be inferred in the database design process?

A

Functional dependencies can be inferred by analyzing the relationships between attributes and identifying patterns in the data. The Closure Test is a powerful tool for inferring functional dependencies by determining the closure of attribute sets.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

In the functional dependency “NI → Name, Address, Birthdate,” what does it mean for the National Insurance number (NI) to determine the attributes Name, Address, and Birthdate?

A

The functional dependency “NI → Name, Address, Birthdate” indicates that the National Insurance number uniquely determines the values of Name, Address, and Birthdate. In other words, if you know the National Insurance number of an individual, you can uniquely determine their associated Name, Address, and Birthdate.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Provide an interpretation of the functional dependency “ISBN → Book Title, Author, Publisher.”

A

The functional dependency “ISBN → Book Title, Author, Publisher” means that the International Standard Book Number (ISBN) uniquely determines the values of Book Title, Author, and Publisher. Each unique ISBN corresponds to a specific combination of Book Title, Author, and Publisher in the dataset.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Why is the functional dependency “NI → Name, Address, Birthdate” a realistic representation in a database context?

A

In a database context, the functional dependency “NI → Name, Address, Birthdate” is realistic because the National Insurance number is often treated as a unique identifier for individuals. This dependency reflects the idea that a person’s name, address, and birthdate are directly associated with their National Insurance number, providing a way to organize and retrieve information efficiently.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

How does the functional dependency “ISBN → Book Title, Author, Publisher” align with the purpose of the International Standard Book Number (ISBN)?

A

The functional dependency “ISBN → Book Title, Author, Publisher” aligns with the purpose of the ISBN, which is to serve as a unique identifier for books. Each ISBN uniquely identifies a specific book and, as a result, is associated with a unique combination of Book Title, Author, and Publisher. This ensures accurate retrieval and organization of book-related information in a database.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What are Armstrong’s Axioms, and how do they contribute to understanding functional dependencies?

A

Armstrong’s Axioms are a set of rules that help manipulate and understand functional dependencies. The axioms include:

Reflexivity: If Y is a subset of X, then X → Y holds.
Augmentation: If X → Y holds, then adding attributes to both sides maintains the dependency, e.g., if X → Y, then XZ → YZ.
Transitivity: If X → Y and Y → Z hold, then X → Z.

These axioms provide a foundation for reasoning about functional dependencies and their implications.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

How does the Splitting Rule contribute to the analysis of functional dependencies?

A

The Splitting Rule is a technique used to derive additional functional dependencies from a given set of functional dependencies. It involves splitting the attributes in a functional dependency to create new dependencies. For example, if X → YZ, the Splitting Rule allows us to derive X → Y and X → Z.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

Explain the Closure Test and its significance in the context of functional dependencies.

A

The Closure Test is a powerful algorithm used to determine the closure of a set of attributes with respect to a set of functional dependencies. It involves iteratively applying the given functional dependencies to find the closure, which is the set of all attributes that can be functionally determined from the given set. The Closure Test is significant as it helps identify additional dependencies, candidate keys, and ensures completeness in analyzing functional dependencies.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

How can Armstrong’s Axioms be applied to infer new functional dependencies in a database design process?

A

Armstrong’s Axioms can be applied iteratively to derive new functional dependencies. By starting with the given set of dependencies and repeatedly applying the axioms (Reflexivity, Augmentation, Transitivity), additional dependencies can be inferred. This process helps in understanding the full set of dependencies within a database.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

What is the significance of splitting right sides of functional dependencies in the context of database design?

A

Splitting right sides of functional dependencies is significant in deriving new dependencies and understanding the relationships between attributes. It allows for the identification of additional dependencies by breaking down the attributes on the right side into smaller sets, contributing to a more comprehensive understanding of the data model.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

Explain the Closure Test algorithm and its role in database design.

A

The Closure Test algorithm is a powerful tool used in database design to determine the closure of a set of attributes with respect to a given set of functional dependencies. It involves iteratively applying the given functional dependencies to find the closure, which is the set of all attributes that can be functionally determined from the given set. The Closure Test is crucial for identifying candidate keys, ensuring completeness, and revealing implied dependencies in the database schema.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

How does the Closure Test algorithm contribute to the process of inferring new functional dependencies?

A

The Closure Test algorithm is instrumental in inferring new functional dependencies by systematically exploring the implied dependencies within a given set of attributes and functional dependencies. It helps identify attributes that are functionally dependent on a given set and reveals additional dependencies that might not be immediately apparent. This iterative process aids in the refinement and completeness of the database schema.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

Provide an example scenario where splitting right sides of functional dependencies and using the Closure Test algorithm would be beneficial in a database design project.

A

Consider a database schema with functional dependency A → BC. By splitting the right side (BC) and applying the Closure Test algorithm, we can discover whether there are additional implied dependencies involving A. This process is beneficial for identifying hidden relationships and ensuring that the database schema accurately represents the functional dependencies in the underlying data.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

What are Armstrong’s Axioms, and why are they essential in the context of functional dependencies?

A

Armstrong’s Axioms are a set of rules used to manipulate and understand functional dependencies. The axioms include:

Reflexivity: If Y is a subset of X, then X → Y holds.
Augmentation: If X → Y holds, then adding attributes to both sides maintains the dependency; for example, if X → Y, then XZ → YZ.
Transitivity: If X → Y and Y → Z hold, then X → Z.

These axioms are essential as they provide a formal foundation for reasoning about and deriving new functional dependencies, ensuring consistency and completeness in a database schema.

25
Q

How can Armstrong’s Axioms be applied to derive new functional dependencies from an existing set of dependencies?

A

Armstrong’s Axioms can be applied iteratively to derive new functional dependencies. By starting with the given set of dependencies and repeatedly applying the axioms (Reflexivity, Augmentation, Transitivity), additional dependencies can be inferred. This process helps in exploring the closure of attribute sets and uncovering implied relationships within the data.

26
Q

Provide an example scenario where Reflexivity, Augmentation, and Transitivity of Armstrong’s Axioms are applied to derive new functional dependencies.

A

Consider the functional dependency A → B and B → C. By applying Transitivity, we can derive A → C. Additionally, applying Augmentation, if A → B, then AZ → BZ. Reflexivity is straightforward, implying that any set X → X holds true.

27
Q

Explain the role of Armstrong’s Axioms in maintaining consistency and integrity in a relational database.

A

Armstrong’s Axioms play a crucial role in maintaining consistency and integrity in a relational database by providing a set of rules for deriving and validating functional dependencies. They help ensure that the dependencies captured in the database schema are logically sound and complete, contributing to the accuracy and reliability of the data model.

28
Q

What is the closure of an attribute set in the context of functional dependencies?

A

The closure of an attribute set, denoted as X^+, represents the set of all attributes that can be functionally determined from the given set X, based on a set of functional dependencies. It includes the original set X and any additional attributes that are implied by the given dependencies.

29
Q

How is the closure of an attribute set determined using the Closure Test algorithm?

A

The Closure Test algorithm involves iteratively applying the given functional dependencies to find the closure of an attribute set. Start with the initial set and systematically add attributes by checking which ones can be determined based on the dependencies. Continue this process until no more attributes can be added, and the closure is reached.

30
Q

Why is finding the closure of an attribute set important in the context of database design?

A

Finding the closure of an attribute set is crucial in determining candidate keys, understanding functional dependencies, and ensuring the completeness and correctness of a database schema. It helps identify all attributes that are functionally dependent on a given set, aiding in the normalization process and maintaining data integrity.

31
Q

Provide an example scenario where determining the closure of an attribute set is beneficial in a database design project.

A

Consider a database schema with functional dependencies A → B and B → C. To determine the closure of the attribute set {A}, the algorithm would iteratively add attributes based on the dependencies until no more attributes can be added. The resulting closure, {A, B, C}, reveals the complete set of attributes functionally determined by A.

32
Q

What is the process of finding the closure of an attribute set, and why is it important in the context of databases?

A

The process of finding the closure of an attribute set involves using functional dependencies to determine all attributes that are functionally dependent on the given set. It is important in databases as it helps identify candidate keys, ensures data integrity, and aids in normalization by understanding the complete set of attributes determined by a specific set.

33
Q

Describe the Closure Test algorithm and how it is applied to find the closure of an attribute set.

A

The Closure Test algorithm involves iteratively applying functional dependencies to a given attribute set. Start with the initial set and systematically add attributes based on the dependencies. Continue this process until no more attributes can be added, and the closure is reached. The result is the closure of the attribute set.

34
Q

Provide an example scenario where finding the closure of an attribute set is essential in the design of a relational database.

A

Consider a database schema with functional dependencies A → B and B → C. To find the closure of the attribute set {A}, apply the Closure Test algorithm. Initially, {A} is expanded to {A, B} based on the first dependency, and then further to {A, B, C} based on the second dependency. The closure reveals the complete set of attributes functionally determined by A.

35
Q

How can finding the closure of an attribute set contribute to the normalization process in a relational database?

A

The closure of an attribute set is instrumental in identifying candidate keys and understanding the functional dependencies within a database. This information is crucial for normalization, as it helps in organizing the data to eliminate redundancy, reduce anomalies, and maintain data integrity.

36
Q

What is the relationship between candidate keys and functional dependencies in the context of database design?

A

Candidate keys in database design are uniquely determined by the set of functional dependencies (F) that represent the underlying application’s constraints. The functional dependencies dictate the dependencies between attributes, and candidate keys are identified based on these dependencies.

37
Q

How does the set of functional dependencies influence the determination of candidate keys in a relational database?

A

The set F of functional dependencies provides the rules and constraints governing how attributes in a database are functionally dependent on each other. Candidate keys are determined by analyzing these dependencies to identify sets of attributes that uniquely determine all other attributes in the table.

38
Q

Why is it essential to consider functional dependencies when identifying candidate keys for a table?

A

Functional dependencies capture the inherent relationships between attributes in a database. Considering these dependencies is crucial when identifying candidate keys because candidate keys are subsets of attributes that uniquely determine other attributes based on these dependencies. This ensures data integrity and helps in the normalization process.

39
Q

How can a database designer leverage the information from functional dependencies to identify candidate keys accurately?

A

The database designer can use the Closure Test algorithm, applying functional dependencies to attribute sets iteratively. This process helps in determining the closure of each attribute set and identifying candidate keys based on the unique combinations of attributes that determine the entire set of attributes.

40
Q

Why is it essential to collect a set of functional dependencies (FD) when designing a database?

A

Collecting a set of functional dependencies is essential in database design to reflect the constraints of the underlying application accurately. These dependencies help minimize redundancy by specifying the relationships and dependencies between attributes in the database. They ensure that the data is stored efficiently and consistently.

41
Q

How can functional dependencies be identified in the database design process?

A

Functional dependencies can be identified through discussions with clients to understand the inherent constraints of the application. Additionally, designers can identify potential dependencies and verify them with clients to ensure accuracy. The goal is to capture the rules that govern the relationships between attributes in the database.

42
Q

Why is it insufficient to determine functional dependencies based on a single instance of the relation?

A

Determining functional dependencies based on a single instance of the relation is insufficient because it doesn’t provide a comprehensive understanding of the dependencies. Functional dependencies must hold for every instance of the relation to ensure consistency and reliability. A single instance may not represent all possible scenarios, and domain knowledge is crucial to identifying dependencies accurately.

43
Q

How do functional dependencies contribute to minimizing redundancy in a relational database?

A

Functional dependencies contribute to minimizing redundancy by specifying how attributes depend on each other. Identifying these dependencies allows designers to create tables with well-defined candidate keys, ensuring that each piece of information is stored in a normalized and efficient manner. This, in turn, reduces the likelihood of redundant data in the database.

44
Q

Why is inferring functional dependencies important in the database design process?

A

Inferring functional dependencies is crucial in the database design process as it helps uncover implicit relationships between attributes. By identifying additional dependencies beyond the explicitly specified ones, designers can create a more comprehensive and normalized database schema, reducing redundancy and ensuring data integrity.

45
Q

What is the significance of inferring every other FD that must hold in the context of FDs?

A

Inferring every other FD that must hold is essential for creating a complete and accurate set of functional dependencies. This comprehensive set ensures that all relevant dependencies are considered during the design phase, leading to a well-structured and normalized database schema. It helps capture the intricacies of relationships between attributes, allowing for efficient storage and retrieval of data.

46
Q

How does inferring functional dependencies simplify the task of database design?

A

Inferring functional dependencies simplifies database design by automating the process of identifying implicit dependencies. Designers can focus on specifying a core set of dependencies, and the inference mechanism helps extend this set by identifying additional dependencies that logically follow. This automated approach reduces the likelihood of missing crucial relationships and ensures a more thorough database design.

47
Q

Can you provide an example of how inferring functional dependencies may impact the design of a relational database?

A

Certainly! Suppose we have the functional dependency A → B, and another dependency B → C is explicitly specified. Through inference, we can automatically deduce the transitive dependency A → C. This inference contributes to a more complete understanding of relationships, allowing designers to incorporate necessary dependencies without explicitly stating each one, resulting in a more efficient and normalized database schema.

48
Q

Why is collecting a complete set of functional dependencies challenging in the database design process?

A

Collecting a complete set of functional dependencies is challenging in the database design process due to several factors. It relies on domain knowledge, which may not be fully understood or explicitly provided. The process is often iterative, requiring interaction with clients or stakeholders to refine and validate the dependencies. Additionally, complex relationships may not be immediately apparent, leading to potential oversight.

49
Q

What are the implications if we cannot discover all functional dependencies during the design process?

A

If we cannot discover all functional dependencies, it may result in an incomplete understanding of the underlying relationships in the data. This can lead to a database schema that lacks normalization and may contain redundancies. Despite the best efforts, some dependencies may remain undiscovered, impacting the overall quality of the design. In practice, designers must proceed with the available knowledge, understanding that a perfect design may be challenging to achieve.

50
Q

How does the iterative nature of functional dependency collection contribute to the challenges in database design?

A

The iterative nature of functional dependency collection contributes to challenges as it requires ongoing refinement and validation. The initial set of dependencies may evolve as the design progresses and more information becomes available. Interactions with clients and stakeholders are necessary to ensure that the collected dependencies accurately represent the business rules and constraints. This iterative process introduces complexity and uncertainty in achieving a complete set of functional dependencies.

51
Q

How can functional dependencies be visually represented in a diagram?

A

Functional dependencies can be represented in a diagram known as a Functional Dependence Diagram. In this diagram:

Entities: Represent entities as circles or ellipses.
Attributes: Represent attributes as ovals inside the corresponding entity.
Arrows: Use arrows to indicate functional dependencies. An arrow from attribute X to attribute Y (X → Y) implies that Y is functionally dependent on X.

52
Q

How does a Functional Dependence Diagram assist in identifying candidate keys?

A

A Functional Dependence Diagram is useful for identifying candidate keys as it visually represents the dependencies between attributes. Candidate keys are often associated with attributes that functionally determine all other attributes in an entity. By examining the diagram and identifying sets of attributes that determine all other attributes, potential candidate keys can be inferred. The closure test can then be applied to confirm the minimality and uniqueness of these sets as candidate keys.

53
Q

What role does the FD diagram play in the normalization process of a database design?

A

The FD diagram is instrumental in the normalization process. It aids in visualizing the relationships between entities and attributes, helping designers identify functional dependencies and candidate keys. Normalization involves organizing the database schema to minimize redundancy and dependency issues. The FD diagram serves as a visual guide to ensure that the design adheres to normalization principles, leading to a well-structured and efficient database.

54
Q

What is a candidate key in the context of a relational database?

A

In a relational database, a candidate key is a set of one or more attributes (columns) that can uniquely identify a tuple (row) in a relation (table). Each candidate key must possess two properties:

Uniqueness: No two distinct tuples should have the same combination of values for the attributes in the candidate key.

Minimality: No proper subset of the candidate key should have the uniqueness property. Removing any attribute from the candidate key should result in a set of attributes that no longer uniquely identifies tuples.

55
Q

How does a candidate key relate to the concept of redundancy in a database design?

A

The concept of a candidate key is closely tied to the goal of minimizing redundancy in a database design. By identifying and selecting appropriate candidate keys, designers can ensure that each tuple in a relation is uniquely identifiable without unnecessary duplication of information. This helps in optimizing storage space and maintaining data integrity by avoiding duplicate or redundant records.

56
Q

What role does a primary key play in a relational database, and how is it related to candidate keys?

A

In a relational database, a primary key is a specific candidate key chosen by the database designer to uniquely identify tuples in a relation. It is a subset of the candidate keys and is used to establish relationships between tables. The primary key is marked as such and may be referenced by foreign keys in other tables.

57
Q

Can a table have multiple candidate keys, and if so, how is the primary key selected?

A

Yes, a table can have multiple candidate keys. The selection of a primary key is typically based on factors such as simplicity, stability, and efficiency. The primary key is chosen from the candidate keys to act as the main identifier for tuples within the table. Designers often select the candidate key that best aligns with the goals of the database and its use cases.

58
Q

How does redundancy in a database lead to the INSERT, UPDATE, and DELETE problems?

A

Redundancy in a database can lead to several problems during the INSERT, UPDATE, and DELETE operations:

INSERT Problem: When inserting new data, redundancy may cause inconsistencies if the same information is recorded in multiple places. Maintaining consistency across redundant copies becomes challenging, and inserting new data requires updates to multiple locations, increasing the likelihood of errors.

UPDATE Problem: Redundant data complicates the updating process. If information is duplicated, updating one instance while neglecting another can result in inconsistent data. The update problem arises when changes are not propagated uniformly across all instances of redundant data.

DELETE Problem: When deleting data, redundancy can lead to unintentional loss of related information. Deleting one instance of redundant data may leave other instances intact, causing inconsistencies in the database. This problem is particularly pronounced when relationships between entities are not properly managed.

59
Q

How does normalisation help in reducing data redundancy?

A

Normalisation is a database design technique aimed at reducing data redundancy and improving data integrity. It involves organizing tables and their relationships to minimize redundancy and dependency issues. By adhering to normalisation principles, redundant data is removed or reduced, leading to the following benefits:

Elimination of Update Anomalies: Normalisation helps eliminate anomalies such as insertion, update, and deletion problems by organizing data into well-structured tables with minimal redundancy. This ensures that changes made to the database are consistently applied across all relevant instances.

Improved Data Integrity: By reducing redundancy, normalisation enhances data integrity. Data is stored in a way that reflects the relationships between entities, and modifications are less prone to inconsistencies.

Simplified Maintenance: Normalised databases are easier to maintain. Changes to the database structure or data are localized and do not require updates in multiple locations, making the system more robust and less error-prone.