19 Lecture

CS403

Midterm & Final Term Short Notes

Functional Dependency

Functional dependency is a relationship between two attributes or sets of attributes in a database, where the value of one attribute determines the value of another. In other words, if A determines B, then for each value of A, there can only be


Important Mcq's
Midterm & Finalterm Prepration
Past papers included

Download PDF
  1. What is functional dependency in a database? a) A relationship between two tables b) A relationship between two attributes or sets of attributes c) A method for sorting data d) A type of database query Answer: b) A relationship between two attributes or sets of attributes Which of the following is an example of a functional dependency? a) A customer's name and their address b) A customer's name and their favorite color c) A customer's phone number and their email address d) A customer's age and their gender Answer: c) A customer's phone number and their email address What does it mean if attribute B is functionally dependent on attribute A? a) The values in attribute A determine the values in attribute B b) The values in attribute B determine the values in attribute A c) The values in attribute A and B are independent of each other d) The values in attribute A and B are not related to each other Answer: a) The values in attribute A determine the values in attribute B What is a determinant in a functional dependency? a) The attribute that determines another attribute's value b) The attribute that is determined by another attribute's value c) An attribute that is not related to any other attributes in a table d) An attribute that is related to all other attributes in a table Answer: a) The attribute that determines another attribute's value Which normal form in database design involves removing partial dependencies? a) First normal form b) Second normal form c) Third normal form d) Fourth normal form Answer: c) Third normal form In a functional dependency A ? B, what does the symbol ? represent? a) Addition b) Subtraction c) Multiplication d) Dependency Answer: d) Dependency What is a transitive functional dependency? a) A dependency where one attribute determines another attribute b) A dependency where three or more attributes are related c) A dependency where an attribute determines another attribute through a third attribute d) A dependency where two attributes are unrelated to each other Answer: c) A dependency where an attribute determines another attribute through a third attribute Which of the following is an example of a partial dependency? a) A customer's name and their address b) A customer's name and their favorite color c) A customer's phone number and their email address d) A customer's age and their gender Answer: b) A customer's name and their favorite color Which normal form requires that every non-prime attribute is dependent on the primary key? a) First normal form b) Second normal form c) Third normal form d) Fourth normal form Answer: b) Second normal form Which normal form is the highest level of normalization? a) First normal form b) Second normal form c) Third normal form d) Fourth normal form Answer: d) Fourth normal form


Subjective Short Notes
Midterm & Finalterm Prepration
Past papers included

Download PDF
  1. What is functional dependency? Answer: Functional dependency is a relationship between two attributes or sets of attributes in a database where the value of one attribute determines the value of another. What is the difference between a full functional dependency and a partial functional dependency? Answer: Full functional dependency occurs when an attribute is dependent on the entire primary key, while partial functional dependency occurs when an attribute is dependent on only part of the primary key. What is a transitive dependency? Answer: A transitive dependency occurs when an attribute is dependent on another attribute that is not part of the primary key. Why is functional dependency important in database design? Answer: Functional dependency helps in eliminating data redundancy, improving data integrity, and preventing data anomalies. What is a determinant in a functional dependency? Answer: The determinant in a functional dependency is the attribute that determines the value of another attribute. What is the difference between first normal form and second normal form? Answer: First normal form eliminates repeating groups and creates a relation with atomic values, while second normal form eliminates partial dependencies by removing attributes that are not dependent on the primary key. What is a candidate key? Answer: A candidate key is a set of attributes that can uniquely identify each row in a table. How can you identify a functional dependency? Answer: A functional dependency can be identified by analyzing the data and determining whether the value of one attribute can determine the value of another attribute. What is a multivalued dependency? Answer: A multivalued dependency occurs when there is a relationship between two non-key attributes and a primary key attribute, and the non-key attributes are dependent on each other. How does normalization help in managing data? Answer: Normalization helps in organizing data in a structured manner, eliminating data redundancy, improving data integrity, and preventing data anomalies. It also makes it easier to manage and update the data.

Functional dependency is a fundamental concept in database design that defines the relationship between attributes in a table. It refers to the property of an attribute or set of attributes that determines the value of another attribute or set of attributes. In other words, if two attributes A and B are functionally dependent, the value of B is determined by the value of A. For example, consider a table called "Employees" with attributes "Employee ID", "Name", "Department", and "Salary". Here, "Employee ID" is the primary key. It is evident that the "Department" attribute is functionally dependent on the "Employee ID" attribute, as each employee is assigned to only one department. Similarly, the "Salary" attribute is functionally dependent on the "Employee ID" attribute, as each employee has a specific salary. Functional dependency plays a crucial role in database normalization, which is the process of organizing data in a structured manner to eliminate data redundancy, improve data integrity, and prevent data anomalies. The first step in normalization is to ensure that each table has a unique primary key. Then, the table is checked for functional dependencies to eliminate any redundancy. The normalization process involves a series of normal forms, each with its own set of rules. The first normal form (1NF) requires that each table has a unique primary key and that each attribute has an atomic value. The second normal form (2NF) requires that the table is in 1NF and that there are no partial dependencies, i.e., each non-key attribute is dependent on the entire primary key. The third normal form (3NF) requires that the table is in 2NF and that there are no transitive dependencies, i.e., each non-key attribute is dependent only on the primary key. Functional dependency is an essential concept for designing efficient and robust databases. It helps in reducing data redundancy, ensuring data integrity, and preventing data anomalies. By analyzing the functional dependencies in a table, we can determine the appropriate normalization level to ensure that the database is efficient, consistent, and easy to manage.