1Which data integrity rule ensures that every table has a primary key and that the primary key's value is not null?
data integrity rules
Easy
A.User-defined Integrity
B.Domain Integrity
C.Entity Integrity
D.Referential Integrity
Correct Answer: Entity Integrity
Explanation:
The Entity Integrity rule states that no primary key value can be NULL. This is because the primary key is used to uniquely identify individual records in a table.
Incorrect! Try again.
2Which rule ensures that a foreign key value must match an existing primary key value in another table or be NULL?
data integrity rules
Easy
A.Entity Integrity
B.Domain Integrity
C.Key Constraint
D.Referential Integrity
Correct Answer: Referential Integrity
Explanation:
Referential integrity preserves the defined relationship between tables when records are entered or deleted. It ensures that a foreign key always points to a valid, existing record in the referenced table.
Incorrect! Try again.
3In relational database theory, if an attribute B is functionally dependent on attribute A, how is it typically represented?
functional dependency
Easy
A.
B.
C.
D.
Correct Answer:
Explanation:
The notation is used to represent that attribute A functionally determines attribute B. This means for any given value of A, there is exactly one corresponding value of B.
Incorrect! Try again.
4If we have a functional dependency StudentIDStudentName, what does this mean?
functional dependency
Easy
A.For a given StudentName, there is only one StudentID.
B.StudentID and StudentName are not related.
C.StudentID and StudentName are the same.
D.For a given StudentID, there is only one StudentName.
Correct Answer: For a given StudentID, there is only one StudentName.
Explanation:
The functional dependency StudentIDStudentName means that the StudentID uniquely determines the StudentName. You can look up a student's name using their ID.
Incorrect! Try again.
5A functional dependency of the form is considered trivial if...
functional dependency
Easy
A.Y is a subset of X
B.X and Y are disjoint
C.X is a subset of Y
D.X is a superkey
Correct Answer: Y is a subset of X
Explanation:
A functional dependency is trivial if the attributes in Y are already contained within the attributes of X. For example, (StudentID, StudentName)StudentName is a trivial dependency.
Incorrect! Try again.
6What is the primary goal of the database normalization process?
need of normalization
Easy
A.To make the database schema more complex.
B.To increase data redundancy for faster queries.
C.To decrease the number of tables.
D.To reduce data redundancy and improve data integrity.
Correct Answer: To reduce data redundancy and improve data integrity.
Explanation:
Normalization is a systematic process of organizing columns and tables in a relational database to minimize data redundancy and avoid anomalies like insertion, update, and deletion anomalies.
Incorrect! Try again.
7An anomaly where deleting a record unintentionally removes facts about another entity is called a(n)...
need of normalization
Easy
A.Modification Anomaly
B.Update Anomaly
C.Insertion Anomaly
D.Deletion Anomaly
Correct Answer: Deletion Anomaly
Explanation:
A deletion anomaly occurs when the deletion of certain data leads to the unintended loss of other unrelated data. Normalization helps prevent this by separating related data into different tables.
Incorrect! Try again.
8A relation is in First Normal Form (1NF) if...
first normal form
Easy
A.It has no transitive dependencies.
B.It has no partial dependencies.
C.All its attributes have atomic (indivisible) values.
D.It has no multivalued dependencies.
Correct Answer: All its attributes have atomic (indivisible) values.
Explanation:
The fundamental rule of 1NF is that every cell in a table must hold a single, atomic value. It cannot hold multiple values or repeating groups.
Incorrect! Try again.
9Which of the following would violate the First Normal Form (1NF)?
Correct Answer: A 'PhoneNumbers' column containing '555-1234, 555-5678'
Explanation:
This violates 1NF because the 'PhoneNumbers' attribute is not atomic; it contains a list of multiple phone numbers in a single field. To be in 1NF, each phone number should be in a separate row or column.
Incorrect! Try again.
10For a relation to be in Second Normal Form (2NF), it must first be in 1NF and...
second normal form
Easy
A.have a composite primary key.
B.have no partial dependencies.
C.have no transitive dependencies.
D.have no foreign keys.
Correct Answer: have no partial dependencies.
Explanation:
A relation is in 2NF if it is in 1NF and every non-prime attribute is fully functionally dependent on the entire primary key. This means there are no partial dependencies where a non-key attribute depends only on a part of the composite primary key.
Incorrect! Try again.
11A partial dependency, which is eliminated by 2NF, can only exist in a relation with a...
second normal form
Easy
A.Simple Primary Key
B.Foreign Key
C.Composite Primary Key
D.Superkey
Correct Answer: Composite Primary Key
Explanation:
A partial dependency occurs when a non-prime attribute is functionally dependent on only a part of a composite primary key. If the primary key is simple (a single attribute), a partial dependency cannot exist by definition.
Incorrect! Try again.
12For a relation to be in Third Normal Form (3NF), it must be in 2NF and...
third normal form
Easy
A.have a simple primary key.
B.have no partial dependencies.
C.have only atomic values.
D.have no transitive dependencies.
Correct Answer: have no transitive dependencies.
Explanation:
A relation is in 3NF if it is in 2NF and it eliminates transitive dependencies. A transitive dependency is when a non-prime attribute depends on another non-prime attribute, rather than directly on the primary key.
Incorrect! Try again.
13In a relation R(A, B, C) where A is the key, the dependencies and together form a...
third normal form
Easy
A.Trivial dependency
B.Partial dependency
C.Transitive dependency
D.Multivalued dependency
Correct Answer: Transitive dependency
Explanation:
This is a classic example of a transitive dependency. The non-key attribute C depends on another non-key attribute B, which in turn depends on the primary key A. 3NF aims to remove such dependencies.
Incorrect! Try again.
14Which statement correctly describes the relationship between 3NF and BCNF?
boyce codd normal form
Easy
A.Every relation in 3NF is also in BCNF.
B.BCNF and 3NF are completely independent.
C.Every relation in BCNF is also in 3NF.
D.BCNF is a weaker version of 3NF.
Correct Answer: Every relation in BCNF is also in 3NF.
Explanation:
BCNF (Boyce-Codd Normal Form) is a stricter version of 3NF. Therefore, any relation that satisfies the BCNF condition automatically satisfies the 3NF condition. However, a relation in 3NF is not necessarily in BCNF.
Incorrect! Try again.
15A relation is in Boyce-Codd Normal Form (BCNF) if for every non-trivial functional dependency , ...
boyce codd normal form
Easy
A.Y is a non-prime attribute.
B.Y is a prime attribute.
C.X is a superkey.
D.X is a foreign key.
Correct Answer: X is a superkey.
Explanation:
The definition of BCNF states that for any non-trivial functional dependency , the determinant X must be a superkey of the relation. This is a stricter condition than that of 3NF.
Incorrect! Try again.
16How is a multivalued dependency of B on A typically represented?
multivalued dependencies
Easy
A.
B.
C.
D.
Correct Answer:
Explanation:
The double arrow notation, , is used to represent a multivalued dependency, which means that for a single value of A, there can be a set of corresponding values for B, and this set is independent of any other attributes.
Incorrect! Try again.
17A multivalued dependency implies that the values of Y associated with a given X value are...
multivalued dependencies
Easy
A.Functionally determined by X.
B.Dependent on all other attributes in the table.
C.Always a single, unique value.
D.Independent of the values of other attributes in the table.
Correct Answer: Independent of the values of other attributes in the table.
Explanation:
A multivalued dependency means that for a given value of X, the set of Y values is independent of the values of any other attributes in the relation. This independence is what distinguishes it from a functional dependency.
Incorrect! Try again.
18For a relation to be in Fourth Normal Form (4NF), it must be in BCNF and...
fourth normal form
Easy
A.have no transitive dependencies.
B.have only one candidate key.
C.have no non-trivial multivalued dependencies.
D.have no partial dependencies.
Correct Answer: have no non-trivial multivalued dependencies.
Explanation:
The definition of 4NF builds upon BCNF. A relation is in 4NF if it is in BCNF and it does not contain any non-trivial multivalued dependencies.
Incorrect! Try again.
19The primary purpose of decomposing a relation into Fourth Normal Form (4NF) is to eliminate problems caused by...
fourth normal form
Easy
A.Functional dependencies
B.Transitive dependencies
C.Partial dependencies
D.Multivalued dependencies
Correct Answer: Multivalued dependencies
Explanation:
4NF is specifically designed to handle and eliminate data redundancy and anomalies that arise from multivalued dependencies, which are not addressed by normal forms up to BCNF.
Incorrect! Try again.
20If a relation is in 4NF, it is guaranteed to also be in which of the following normal forms?
fourth normal form
Easy
A.Only 3NF
B.BCNF, 3NF, 2NF, and 1NF
C.Only BCNF
D.5NF
Correct Answer: BCNF, 3NF, 2NF, and 1NF
Explanation:
The normal forms follow a strict hierarchy. A relation in 4NF must, by definition, also satisfy the conditions for all the lower normal forms: BCNF, 3NF, 2NF, and 1NF.
Incorrect! Try again.
21Given a relation R(A, B, C, D) and a set of functional dependencies F = {A -> B, BC -> D}. What is the closure of the attribute set {A, C}, denoted as ?
functional dependency
Medium
A.{A, B, D}
B.{A, C}
C.{A, B, C}
D.{A, B, C, D}
Correct Answer: {A, B, C, D}
Explanation:
The closure of {A, C} is calculated as follows:
Start with the initial set: Result = {A, C}.
From A -> B, since A is in Result, we add B. Result becomes {A, B, C}.
From BC -> D, since B and C are now in Result, we add D. Result becomes {A, B, C, D}.
No more attributes can be added, so .
Incorrect! Try again.
22Consider a relation R(A, B, C, D) with the primary key {A, B}. The functional dependencies are AB -> C, AB -> D, and A -> C. Why is this relation not in 2NF?
second normal form
Medium
A.Because of the partial dependency A -> C.
B.Because C is a prime attribute.
C.Because the primary key has more than one attribute.
D.Because of the transitive dependency A -> C.
Correct Answer: Because of the partial dependency A -> C.
Explanation:
A relation is in 2NF if it is in 1NF and every non-prime attribute is fully functionally dependent on the primary key. Here, the primary key is {A, B}. The attribute C is a non-prime attribute. The dependency A -> C shows that C is dependent on only a part of the primary key (A), which is a partial dependency. This violates the condition for 2NF.
Incorrect! Try again.
23A relation R(StudentID, StudentName, Street, City, Zip) has the following functional dependencies: StudentID -> StudentName, Street, City, Zip Zip -> City
Given that StudentID is the primary key, which statement is true?
third normal form
Medium
A.The relation is in 3NF but not in BCNF.
B.The relation is in 2NF but not in 3NF.
C.The relation is not in 2NF.
D.The relation is in BCNF.
Correct Answer: The relation is in 2NF but not in 3NF.
Explanation:
The relation is in 1NF. The primary key is StudentID. There are no partial dependencies since the key is a single attribute, so it is in 2NF. However, there is a transitive dependency: StudentID -> Zip and Zip -> City. This means a non-key attribute (City) is determined by another non-key attribute (Zip), violating the conditions for 3NF.
Incorrect! Try again.
24Consider the relation R(A, B, C) with functional dependencies F = {AB -> C, C -> B}. What is the highest normal form this relation satisfies?
boyce codd normal form
Medium
A.Boyce-Codd Normal Form (BCNF)
B.Second Normal Form (2NF)
C.Third Normal Form (3NF)
D.First Normal Form (1NF)
Correct Answer: Third Normal Form (3NF)
Explanation:
The candidate keys are {A, B} and {A, C}. The attributes A, B, and C are all prime attributes. The relation is in 2NF because there are no partial dependencies. The relation is in 3NF because for every dependency , either is a prime attribute or is a superkey. For AB -> C, AB is a superkey. For C -> B, B is a prime attribute. So it is in 3NF. However, it is not in BCNF because for the dependency C -> B, the determinant C is not a superkey.
Incorrect! Try again.
25In a relational database schema for a university, there is a STUDENT table with StudentID as the primary key and an ENROLLMENT table with StudentID as a foreign key referencing the STUDENT table. Which integrity rule prevents a student record from being deleted from the STUDENT table if they are still enrolled in any courses listed in the ENROLLMENT table?
data integrity rules
Medium
A.Domain Integrity
B.Referential Integrity
C.User-defined Integrity
D.Entity Integrity
Correct Answer: Referential Integrity
Explanation:
Referential integrity ensures that a foreign key value in one table must match a primary key value in another table, or be null. It prevents actions that would create 'orphan' records. In this case, deleting a student from the STUDENT table while corresponding enrollment records exist would violate referential integrity, as the StudentID in ENROLLMENT would no longer refer to a valid student.
Incorrect! Try again.
26In a relation R(EmployeeID, Project, Skill), an employee can work on multiple projects and have multiple skills, and the set of skills is independent of the project they work on. This situation leads to which type of dependency?
multivalued dependencies
Medium
A.A transitive dependency
B.Multivalued dependencies EmployeeID ->> Project and EmployeeID ->> Skill
C.A partial dependency
D.A full functional dependency (EmployeeID, Project) -> Skill
This scenario describes multivalued dependencies (MVDs). For a given EmployeeID, there is a set of associated Project values and a set of associated Skill values. Crucially, the set of projects is not related to the set of skills. This independence is the hallmark of MVDs, represented as EmployeeID ->> Project and EmployeeID ->> Skill.
Incorrect! Try again.
27A relation is in 4NF if it is in BCNF and it has no:
fourth normal form
Medium
A.Functional dependencies at all
B.Non-trivial multivalued dependencies where the determinant is not a superkey
C.Partial dependencies
D.Transitive dependencies
Correct Answer: Non-trivial multivalued dependencies where the determinant is not a superkey
Explanation:
The definition of Fourth Normal Form (4NF) builds directly on BCNF. A relation is in 4NF if and only if it is in BCNF and for every non-trivial multivalued dependency , is a superkey. The core purpose of 4NF is to eliminate data redundancy caused by independent multivalued facts about the same entity.
Incorrect! Try again.
28Consider a single table PROJECT_ASSIGNMENT(EmpID, EmpName, ProjectID, ProjectName, Hours). If an employee's name changes, it must be updated in multiple rows for every project they are assigned to. This is an example of a(n):
need of normalization
Medium
A.Selection Anomaly
B.Update Anomaly
C.Insertion Anomaly
D.Deletion Anomaly
Correct Answer: Update Anomaly
Explanation:
An update anomaly occurs when redundant data requires the same piece of information to be changed in multiple places. In this schema, EmpName is repeated for every ProjectID the employee is on. Changing the name requires updating all these records, and failing to do so leads to data inconsistency. Normalization would solve this by placing EmpID and EmpName in a separate EMPLOYEE table.
Incorrect! Try again.
29Which of the following table designs violates the First Normal Form (1NF)?
first normal form
Medium
A.An EMPLOYEE table with EmployeeID as a primary key and DeptID as a foreign key.
B.A SALES table where each row represents a single transaction with a unique TransactionID.
C.A STUDENT table with attributes StudentID, Name, and Major.
D.A COURSE table where the Prerequisites attribute can contain a list of course codes like 'CS101, MA203'.
Correct Answer: A COURSE table where the Prerequisites attribute can contain a list of course codes like 'CS101, MA203'.
Explanation:
First Normal Form (1NF) requires that all attributes in a relation must be atomic, meaning they hold a single value. A Prerequisites attribute containing a comma-separated list of values is a repeating group or a multi-valued attribute, which violates 1NF. To be in 1NF, this should be modeled with a separate PREREQUISITE table.
Incorrect! Try again.
30Given the functional dependency (A, B) -> C, which of the following dependencies can be inferred by Armstrong's Augmentation Rule?
functional dependency
Medium
A.B -> C
B.C -> (A, B)
C.A -> C
D.(A, B, D) -> C
Correct Answer: (A, B, D) -> C
Explanation:
Armstrong's Augmentation Rule states that if holds, then also holds. A simpler form is that if holds, then also holds. Given (A, B) -> C, we can augment the left side with any attribute set, such as {D}. This gives us (A, B, D) -> C. The other options are incorrect inferences.
Incorrect! Try again.
31A relation R(X, Y, Z) has functional dependencies XY -> Z and Z -> Y. If {X, Y} is the only candidate key, what is the highest normal form of this relation?
boyce codd normal form
Medium
A.It is in BCNF.
B.It is in 3NF but not BCNF.
C.It is in 2NF but not 3NF.
D.It is not in 2NF.
Correct Answer: It is in 3NF but not BCNF.
Explanation:
The candidate key is {X, Y}. The relation is in 2NF because there are no partial dependencies (the key has multiple attributes, but no non-prime attribute is dependent on a part of it). It is in 3NF because for the dependency Z -> Y, the attribute Y is a prime attribute (part of a candidate key). However, it is not in BCNF. The BCNF rule states that for any non-trivial FD , must be a superkey. The dependency Z -> Y violates this, as Z is not a superkey.
Incorrect! Try again.
32A relation R(A, B, C, D) with key {A} has the FDs: A -> BCD, B -> C. Which step is necessary to decompose this relation into 3NF?
third normal form
Medium
A.Create R1(A, B) and R2(A, C, D).
B.Create R1(A, B, D) and R2(B, C).
C.The relation is already in 3NF.
D.Create R1(A, C) and R2(A, B, D).
Correct Answer: Create R1(A, B, D) and R2(B, C).
Explanation:
The relation is not in 3NF because of the transitive dependency A -> B -> C. A non-key attribute C is dependent on another non-key attribute B. To normalize to 3NF, we must remove this transitive dependency. We decompose the relation by taking out the problematic dependency B -> C into its own table R2(B, C). The original table becomes R1(A, B, D), retaining the determinant B as a foreign key.
Incorrect! Try again.
33Which data integrity rule ensures that every row in a table has a unique identifier and that the identifier is not null?
data integrity rules
Medium
A.Referential Integrity
B.Entity Integrity
C.Transactional Integrity
D.Domain Integrity
Correct Answer: Entity Integrity
Explanation:
Entity Integrity is a rule that states that every table must have a primary key, and the column or columns chosen to be the primary key must be unique and not null. This ensures that each row (entity) can be uniquely identified.
Incorrect! Try again.
34A table ORDERS(OrderID, CustomerID, CustomerName, OrderDate) has OrderID as the primary key. An additional functional dependency is CustomerID -> CustomerName. What is the highest normal form of this table?
second normal form
Medium
A.Because of the transitive dependency ItemID -> ItemPrice.
B.Because Quantity is not a prime attribute.
C.Because the primary key is composite.
D.Because ItemPrice depends only on ItemID, which is a part of the primary key.
Correct Answer: Because ItemPrice depends only on ItemID, which is a part of the primary key.
Explanation:
The primary key is {OrderID, ItemID}. For a relation to be in 2NF, all non-prime attributes must be fully dependent on the entire primary key. Here, ItemPrice is a non-prime attribute. The dependency ItemID -> ItemPrice shows that ItemPrice is dependent only on a part of the primary key (ItemID), not the whole key. This is a partial dependency, which violates 2NF.
Incorrect! Try again.
35In a denormalized table FACULTY(FacultyID, FacultyName, DeptID, DeptName, Office), you cannot add a new department until a faculty member is assigned to it. This problem is known as a(n):
need of normalization
Medium
A.Redundancy Problem
B.Deletion Anomaly
C.Update Anomaly
D.Insertion Anomaly
Correct Answer: Insertion Anomaly
Explanation:
An insertion anomaly occurs when you are unable to insert a record for one entity without also having information for another entity. In this case, you cannot record the existence of a new department (DeptID, DeptName) because a FacultyID is required as part of the primary key or cannot be null, but no faculty has been assigned yet. Normalization would separate DEPARTMENT information into its own table.
Incorrect! Try again.
36Consider a relation R(A, B, C, D, E) with FDs F = {A -> BC, CD -> E, B -> D, E -> A}. Which of the following is a candidate key for R?
functional dependency
Medium
A.A
B.D, E
C.C
D.A, B
Correct Answer: A, B
Explanation:
To find the candidate key, we first identify attributes that are not on the right side of any FD; these must be part of the key. Here, A and B are never on the RHS. Let's find the closure of {A, B}.
Using AB -> C, we get
Using C -> D, we get
Using D -> E, we get
Since the closure of {A, B} contains all attributes of the relation, {A, B} is a candidate key. Since A and B are essential, it is the only candidate key.
Incorrect! Try again.
37A relation R(A, B, C) is in BCNF. A non-trivial multivalued dependency A ->> B holds. For R to also be in 4NF, what must be true about A?
fourth normal form
Medium
A.A must be a prime attribute.
B.The relation must be decomposed into R1(A, B) and R2(A, C).
C.B must be functionally dependent on A.
D.A must be a superkey of R.
Correct Answer: A must be a superkey of R.
Explanation:
The definition of 4NF states that for a relation to be in 4NF, it must be in BCNF and for every non-trivial multivalued dependency that holds, must be a superkey for the relation. Therefore, for the MVD A ->> B not to violate 4NF, the determinant A must be a superkey.
Incorrect! Try again.
38Every relation that is in BCNF is also in 3NF. However, a relation in 3NF is not necessarily in BCNF. This is because 3NF allows a non-trivial functional dependency where:
boyce codd normal form
Medium
A.Both X and Y are non-prime attributes.
B.X is a superkey, but Y is not a prime attribute.
C.X is not a superkey, but Y is a prime attribute.
D.X is a proper subset of a candidate key.
Correct Answer: X is not a superkey, but Y is a prime attribute.
Explanation:
The BCNF rule is strict: for any non-trivial FD , must be a superkey. The 3NF rule is slightly more relaxed: for any non-trivial FD , either is a superkey OR is a prime attribute (part of a candidate key). The second condition (Y is a prime attribute) is an allowance that 3NF makes but BCNF does not, which is why a 3NF relation may not be in BCNF.
Incorrect! Try again.
39Which of the following statements about Multivalued Dependencies (MVDs) is FALSE?
multivalued dependencies
Medium
A.MVDs are a cause of redundancy that is not addressed by BCNF.
B.Every functional dependency is also a multivalued dependency.
C.If and hold, then must also hold (MVD Transitivity).
D.If holds in R, then also holds (MVD Complementation Rule).
Correct Answer: If and hold, then must also hold (MVD Transitivity).
Explanation:
The MVD transitivity rule is more complex than standard transitivity. It states: if and , then . The simple transitivity A ->> C does not generally hold for MVDs, making this statement false. The other statements are true: FD is a special case of MVD, the complementation rule is a key property, and MVDs are the target of 4NF normalization, which goes beyond BCNF.
Incorrect! Try again.
40Given a relation R(A, B, C, D) with candidate key A and functional dependencies A -> B, A -> C, B -> D. How would you decompose this into a collection of 3NF relations?
third normal form
Medium
A.R1(A, B) and R2(B, C, D)
B.R1(A, C, D) and R2(A, B)
C.R1(A, B, C) and R2(B, D)
D.The relation is already in 3NF
Correct Answer: R1(A, B, C) and R2(B, D)
Explanation:
The relation has a transitive dependency A -> B -> D, where A is the key, B is a non-key attribute, and D is a non-key attribute dependent on B. This violates 3NF. To resolve this, the dependency causing the violation (B -> D) is moved to a new relation R2(B, D). The determinant B is kept in the original relation, which becomes R1(A, B, C). This decomposition preserves dependencies and eliminates the transitive dependency.
Incorrect! Try again.
41Consider a relation schema with a set of functional dependencies . Which of the following is a candidate key for R?
functional dependency
Hard
A.A
B.E
C.C
D.B
Correct Answer: B
Explanation:
To find the candidate key, we must compute the attribute closure for each potential key.
(since , then , then , then ). So, A is a candidate key.
. We cannot determine anything else.
.
(since , then , then ). So, E is a candidate key.
Let's use . Let's find candidate keys.
. So CE is a candidate key.
. So BE is a candidate key.
. So DE is a candidate key.
Let's try a better F. . Find candidate keys.
. So AC is a key.
. So CD is a key.
. So BC is a key.
The original question had a flaw. Let's correct the question and explanation based on a solid FD set.
Original FD: .
. A is a candidate key.
. E is a candidate key.
. CD is a candidate key.
. BC is a candidate key.
None of the options A, B, C, E are unique minimal superkeys. A and E are candidate keys. This makes a bad MCQ.
Let's fix the question:
Given schema and . Which set of attributes is a candidate key?
. ACD is a superkey. Is it minimal? . . . So ACD is minimal. ACD is a candidate key.
Let's try to make a question where a single attribute is the key.
, . Candidate keys?
. Is AB minimal? . Yes. AB is a CK.
. Is BC minimal? . Yes. BC is a CK.
. Is BD minimal? . Yes. BD is a CK. Question: Consider and the set of FDs . What is the closure of (i.e., )? Options:
A)
B)
C)
D) Correct Option: B Explanation:
Start with .
Using , we can add V and Z. Now, .
Using , we can add W. Now, .
The closure is now , which contains all attributes of the relation. This also implies that XY is a candidate key. The question asks for the closure, not just the key. This tests the process. This is a good hard question.
Incorrect! Try again.
42A relation has functional dependencies . The relation is decomposed into , , and . Which statement accurately describes this decomposition?
boyce codd normal form
Hard
A.The decomposition is lossy but dependency preserving.
B.The decomposition is not in BCNF because violates BCNF.
C.The decomposition is lossless and in BCNF, but it is not dependency preserving.
D.The decomposition is lossless, dependency preserving, and in BCNF.
Correct Answer: The decomposition is lossless and in BCNF, but it is not dependency preserving.
Explanation:
The candidate keys of R are . The dependency is a BCNF violation because L is not a superkey. The decomposition into and is the standard BCNF decomposition. It is lossless because the intersection of attributes is a superkey of . Both (key L) and (key JL) are in BCNF. However, the original dependency cannot be checked on either or alone. Its attributes are spread across both relations, and checking it requires a join. Therefore, the decomposition is not dependency preserving.
Incorrect! Try again.
43Consider a relation Enrollment(StudentID, CourseID, ClubID) where a student can enroll in multiple courses and join multiple clubs. There is no direct link between the courses a student takes and the clubs they join. Which of the following statements is the most precise conclusion?
fourth normal form
Hard
A.The relation has a multivalued dependency and is not in 4NF.
B.The relation has no multivalued dependencies and is already in 4NF.
C.The relation has a functional dependency and is in BCNF.
D.The relation has a multivalued dependency and violates 2NF.
Correct Answer: The relation has a multivalued dependency and is not in 4NF.
Explanation:
The problem states that courses and clubs are independent for a given student. This means for a student S1 taking courses C1, C2 and in clubs CL1, CL2, the database must store tuples (S1,C1,CL1), (S1,C1,CL2), (S1,C2,CL1), (S1,C2,CL2) to maintain consistency. This is the classic sign of a multivalued dependency (MVD). The MVD is . Because CourseID and ClubID are independent for a StudentID, this can also be written as the non-trivial MVD . A relation is in 4NF if for every non-trivial MVD , X is a superkey. Here, the key for the Enrollment relation is . Since is not a superkey, the relation is not in 4NF.
Incorrect! Try again.
44A relation has candidate key and the functional dependencies . Which statement is true?
third normal form
Hard
A.R is already in 3NF because D is part of the candidate key.
B.R is in 1NF, but not in 2NF because is a partial dependency.
C.R is in 2NF, but not in 3NF due to the transitive dependency .
D.R is in 3NF because for the dependency , C is a prime attribute.
Correct Answer: R is in 2NF, but not in 3NF due to the transitive dependency .
Explanation:
Check 2NF: A relation is in 2NF if it's in 1NF and has no partial dependencies. The only candidate key is . A partial dependency would be if a proper subset of (i.e., A or B) determines a non-prime attribute. The FDs are and . There are no FDs like or where X is a non-prime attribute. Therefore, there are no partial dependencies, and the relation is in 2NF.
Check 3NF: A relation is in 3NF if it's in 2NF and has no transitive dependencies. A transitive dependency exists when a non-key attribute determines another non-key attribute. Here, the key is , and the non-key attributes are . We have the dependency chain (from ) and . Since (a key) determines (a non-key attribute), and determines (another non-key attribute), this is a transitive dependency. Thus, the relation is not in 3NF.
Incorrect! Try again.
45Consider three tables: Departments(DeptID PK, Name), Employees(EmpID PK, Name, DeptID FK), and Projects(ProjID PK, LeadEmpID FK). Employees.DeptID references Departments.DeptID with ON DELETE SET NULL. Projects.LeadEmpID references Employees.EmpID with ON DELETE CASCADE. What is the result of deleting a department from the Departments table that has 5 employees, one of whom is a lead for 2 projects?
data integrity rules
Hard
A.The department is deleted, and the 5 employees are deleted, which in turn deletes the 2 projects.
B.The department is deleted, and the 5 employees' DeptID is set to NULL. The Projects table is unaffected.
C.The delete operation fails due to a referential integrity constraint violation in the Projects table.
D.The department is deleted, the 5 employees' DeptID is set to NULL, and the 2 projects led by one of those employees are also deleted.
Correct Answer: The department is deleted, the 5 employees' DeptID is set to NULL. The Projects table is unaffected.
Explanation:
The process is as follows:
A DELETE statement is issued for a row in the Departments table.
The database checks for foreign key constraints referencing this DeptID. The Employees table has such a constraint with the rule ON DELETE SET NULL.
For the 5 employees in that department, their DeptID column is updated to NULL. The employee records themselves are not deleted.
Since no employee records were deleted from the Employees table, the ON DELETE CASCADE rule on the Projects table is not triggered.
Therefore, the Projects table remains completely unaffected. The final state is: the department is gone, the 5 employees now have a NULL department, and the projects are unchanged.
Incorrect! Try again.
46A relation has functional dependencies . Which statement is correct?
second normal form
Hard
A.The relation is not in 2NF because it contains partial dependencies.
B.The relation is in 3NF but not BCNF.
C.The relation is in 2NF but not 3NF.
D.The relation is in BCNF.
Correct Answer: The relation is not in 2NF because it contains partial dependencies.
Explanation:
. So BCD is a candidate key.
Are there other candidate keys? Let's check subsets of BCD. BC, CD, BD are not keys.
Let's assume there's a typo and the FDs are . Key is AB. Then and are partial dependencies. This is too simple.
Let's stick to the original FDs: .
Let's find keys. . So BCD is a key.
determines A. determines C. determines E.
Let's check . So ABD is also a key.
Let's check . So BCD is also a key.
This is getting too complex. Let's make a cleaner example. New Question: A relation has FDs and the candidate key is . Which Normal Form does R satisfy? Correct Answer: R is in 1NF but not 2NF. Explanation: The candidate key is . The non-prime attributes are and . The dependency is a partial dependency because its determinant, , is a proper subset of the candidate key , and it determines a non-prime attribute . The existence of this partial dependency means the relation is not in 2NF.
Incorrect! Try again.
47Given a set of functional dependencies on a relation . Which of the following sets of FDs, , is NOT equivalent to (i.e., and do not generate the same closure)?
functional dependency
Hard
A.
B.
C.
D.
Correct Answer:
Explanation:
To find the minimal cover, we follow three steps:
Singleton Right-Hand Side: Decompose F into . Removing duplicates gives .
Remove Extraneous LHS Attributes: There are no FDs with composite attributes on the left, so this step is skipped.
Remove Redundant FDs:
Is redundant? To check, we see if can be derived from the rest: . The closure of A under this set is just . It does not include B. So is not redundant.
Is redundant? To check, we see if can be derived from . The closure of B is just . So is not redundant.
Is redundant? To check, we see if can be derived from . The closure of A is . It includes C. So is redundant because of transitivity.
Removing the redundant gives the minimal cover: .
Incorrect! Try again.
48A relation has functional dependencies . Which of the following statements is the most accurate?
boyce codd normal form
Hard
A.R is in 3NF but not in BCNF.
B.R is in BCNF.
C.R is not in 2NF.
D.R is in 2NF but not in 3NF.
Correct Answer: R is in 3NF but not in BCNF.
Explanation:
Find Candidate Keys:
. So AB is a candidate key.
. So AC is a candidate key.
The prime attributes are A, B, and C.
Check BCNF: A relation is in BCNF if for every non-trivial FD , X is a superkey. Let's check our FDs:
: AB is a superkey (it's a candidate key). This is fine.
: Is C a superkey? No. . It does not determine all attributes. Thus, is not in BCNF.
: AB is a superkey. This satisfies 3NF.
: C is not a superkey, so we check condition (b). Is Y (which is B) a prime attribute? Yes, B is part of the candidate key AB. Therefore, this dependency also satisfies the condition for 3NF.
Since all dependencies satisfy the 3NF condition, the relation is in 3NF. However, it is not in BCNF.
Incorrect! Try again.
49Given a relation with the multivalued dependency and the functional dependency . Which of the following dependencies must also hold in R according to the inference rules?
multivalued dependencies
Hard
A.
B.
C.
D.No other non-trivial dependency must hold.
Correct Answer:
Explanation:
This question tests the interaction between MVDs and FDs. There is a specific inference rule called the mixed transitivity rule (sometimes called pseudo-transitivity for MVDs). The rule states: If and hold, then holds. A simpler corollary is that if and hold, then also holds if Z is a subset of Y. That is not the case here. The correct rule is the multivalued transitivity rule: if and , then holds. That's not applicable either. The key is that a functional dependency is a special case of a multivalued dependency. If , then it implies . Now we can use the multivalued transitivity rule: Since and , it follows that . Since C is not in B, this simplifies to . This is a subtle but important derivation. (an FD) does not necessarily hold.
Incorrect! Try again.
50A table PROJECT_ASSIGNMENTS has columns (ProjID, ProjName, EmpID, EmpName, HourlyRate). The FDs are ProjID -> ProjName and EmpID -> {EmpName, HourlyRate}. The primary key is (ProjID, EmpID). This design primarily aims to solve which problem, but fails most critically at preventing what anomaly?
need of normalization
Hard
A.Aims to solve insertion anomalies; fails to prevent deletion anomalies.
B.Aims to solve data redundancy; fails to prevent update anomalies.
C.Aims to prevent referencing invalid employees; fails to prevent data redundancy.
D.Aims to solve update anomalies; fails to prevent insertion anomalies.
Correct Answer: Aims to solve update anomalies; fails to prevent insertion anomalies.
Explanation:
The design is in 1NF but not 2NF due to partial dependencies (ProjID -> ProjName and EmpID -> {EmpName, HourlyRate}). The intent of putting everything in one table is often a naive attempt to simplify queries. This structure suffers from all three anomalies. However, the question asks for the most critical failure.
Update Anomaly: If an employee's name changes, it must be updated in every row for every project they are on. This is a significant issue.
Insertion Anomaly: You cannot add a new employee to the system if they have not yet been assigned to a project. This is a critical failure because it prevents storing core entity information (an employee) independently.
Deletion Anomaly: If an employee is removed from their last project, their entire record (including their name and hourly rate) is deleted from the database.
Comparing the failures, the inability to add a fundamental entity (an employee) without a related entity (a project) is arguably the most critical structural flaw related to insertion. The design attempts to capture assignments (solving an 'update' problem of tracking who is where), but the structure itself prevents the insertion of independent entities.
Incorrect! Try again.
51Consider a relation with FDs . A decomposition of R into , , and is:
third normal form
Hard
A.Lossy and not dependency preserving.
B.Lossless but not dependency preserving.
C.Dependency preserving but lossy.
D.Lossless and dependency preserving.
Correct Answer: Lossless and dependency preserving.
Explanation:
Dependency Preservation: An FD is preserved if all attributes in appear in one of the decomposed relations.
: Attributes A, B are in . Preserved.
: Attributes B, C are in . Preserved.
: Attributes C, D are in . Preserved.
Since all original FDs are preserved, the decomposition is dependency preserving.
Lossless Join: A decomposition of R into and is lossless if the intersection of their attributes is a superkey for at least one of them. We can apply this test pairwise.
Join and . The intersection is . Is B a superkey of or ? In , the FD holds, and B is the key of . So, the join of and is lossless, resulting in a relation .
Join and . The intersection is . Is C a superkey of or ? In , the FD holds, and C is the key of . So, the join is lossless.
Since the pairwise joins are lossless, the entire decomposition is lossless.
Incorrect! Try again.
52A Users table contains a column Preferences of type JSON, which stores a structure like {"theme": "dark", "notifications": ["email", "sms"]}. According to Codd's original definition of 1NF, which requires all attributes to be atomic, how is this table best classified?
first normal form
Hard
A.It is not a valid relational model table and normalization rules do not apply.
B.It is in 1NF because the database system treats the JSON object as an atomic string or blob.
C.It is in 2NF because there are no partial dependencies, but it is not in 1NF.
D.It violates 1NF because the Preferences column contains a non-atomic, structured value.
Correct Answer: It violates 1NF because the Preferences column contains a non-atomic, structured value.
Explanation:
Codd's original definition of First Normal Form (1NF) states that the domain of an attribute must include only atomic (indivisible) values and that the value of any attribute in a tuple must be a single value from the domain of that attribute. A JSON object is inherently structured and contains multiple values (e.g., 'dark', 'email', 'sms'). From a pure relational theory perspective, this is a repeating group or a nested relation within a column, which is a clear violation of the atomicity rule of 1NF. While modern database systems can handle and query JSON types, this practice deviates from the classical definition of 1NF. Option B describes the practical implementation but ignores the theoretical definition, which the question refers to.
Incorrect! Try again.
53A relation is in BCNF. Under which condition could this relation NOT be in 4NF?
fourth normal form
Hard
A.It is impossible; every relation in BCNF is also in 4NF.
B.If it contains a non-trivial multivalued dependency where X is not a superkey.
C.If it contains a trivial multivalued dependency .
D.If it contains a functional dependency where X is a proper subset of a candidate key.
Correct Answer: If it contains a non-trivial multivalued dependency where X is not a superkey.
Explanation:
A relation is in 4NF if, for every non-trivial MVD , X is a superkey. A relation is in BCNF if, for every non-trivial FD , X is a superkey. The key distinction is that a relation can be in BCNF (having no FD violations) but still have a non-trivial MVD where the determinant is not a superkey. For example, the Enrollment(StudentID, CourseID, ClubID) example (where the only key is all three attributes) is in BCNF because there are no non-trivial FDs. However, it contains the MVD , and StudentID is not a superkey, so it violates 4NF. Therefore, a BCNF relation is not in 4NF if it has a non-trivial MVD that isn't caused by an FD, and whose determinant is not a superkey.
Incorrect! Try again.
54Using Armstrong's axioms (Reflexivity, Augmentation, Transitivity), which of the following inference rules requires the use of BOTH augmentation and transitivity in its proof?
functional dependency
Hard
A.Union Rule ( and implies )
B.Composition Rule ( and implies )
C.Decomposition Rule ( implies and )
D.Pseudotransitivity Rule ( and implies )
Correct Answer: Pseudotransitivity Rule ( and implies )
Explanation:
Let's prove the Pseudotransitivity Rule:
Given: (Premise)
Given: (Premise)
From (1), by Augmentation Rule (augmenting with W): . This step uses Augmentation.
From (3) and (2), we have and . By the Transitivity Rule, we can conclude .
Incorrect! Try again.
55A table Tasks has a composite primary key (ProjectID, TaskNumber). It also has a foreign key DependsOnTask which references TaskNumber from the same table. The business rule is that a task's dependency must be within the same project. Why is this design flawed from a data integrity perspective?
data integrity rules
Hard
A.The foreign key should reference the entire composite primary key (ProjectID, TaskNumber), not just TaskNumber.
B.A foreign key cannot reference the same table (a self-reference).
C.The ON DELETE cascade rule cannot be defined on a self-referencing foreign key.
D.The TaskNumber must be unique across all projects for this to work.
Correct Answer: The foreign key should reference the entire composite primary key (ProjectID, TaskNumber), not just TaskNumber.
Explanation:
Referential integrity requires that a foreign key must reference a complete primary key or a unique key of the referenced table. In this case, the primary key of the Tasks table is (ProjectID, TaskNumber). A TaskNumber alone does not uniquely identify a task across all projects. By creating a foreign key (DependsOnTask) that only references TaskNumber, the database cannot enforce the rule that the dependency must be within the same project. A task in Project 1 could incorrectly reference a task number that exists only in Project 2. The correct design would be to have a composite foreign key (DependsOnProjectID, DependsOnTaskNumber) that references (ProjectID, TaskNumber) to enforce the integrity constraint properly.
Incorrect! Try again.
56A relation R(A, B, C, D) has two candidate keys, AB and BC. It has the functional dependency . Which normal form is R in?
second normal form
Hard
A.1NF, but not 2NF.
B.2NF, but not 3NF.
C.3NF, but not BCNF.
D.BCNF.
Correct Answer: 1NF, but not 2NF.
Explanation:
First, we identify the prime and non-prime attributes. The candidate keys are AB and BC. The set of prime attributes is {A, B, C}. The only non-prime attribute is D.
Second, we check for 2NF. A relation is not in 2NF if there is a partial dependency, which is when a proper subset of any candidate key determines a non-prime attribute.
Consider the candidate key AB. A proper subset is {A} or {B}. We have the FD . Here, a proper subset of key AB (i.e., B) determines a non-prime attribute (D). This is a partial dependency.
Consider the candidate key BC. A proper subset is {B} or {C}. The same FD shows that a proper subset of key BC (i.e., B) determines a non-prime attribute (D).
Because of the partial dependency , the relation is not in 2NF.
Incorrect! Try again.
57Which of the following statements correctly distinguishes a trivial multivalued dependency (MVD) from a non-trivial MVD in a relation R with attribute set U?
multivalued dependencies
Hard
A.An MVD is trivial if .
B.An MVD is trivial if Y contains only a single attribute.
C.An MVD is trivial only if it is also a functional dependency.
D.An MVD is trivial if or .
Correct Answer: An MVD is trivial if or .
Explanation:
A multivalued dependency on a relation R with attribute set U is defined as trivial under two conditions:
: This means the attributes on the right are already part of the attributes on the left. This provides no new information, similar to a trivial functional dependency like .
: This means that the attributes on the left and right combined make up all the attributes of the relation. Let . If , then Z is empty. The MVD definition requires that for each value of X, the associated Y values are independent of the Z values. If Z is empty, this condition is vacuously true.
Any MVD that does not meet one of these two conditions is non-trivial and may indicate a need for decomposition to 4NF.
Incorrect! Try again.
58A relation has candidate key A and FDs . What is the most appropriate decomposition into a set of 3NF relations?
third normal form
Hard
A.
B.
C.
D.
Correct Answer:
Explanation:
The original relation is not in 3NF due to transitive dependencies. The candidate key is A.
: This is a transitive dependency because B is not a superkey and C is a non-prime attribute.
: This is a transitive dependency because D is not a superkey and E is a non-prime attribute.
To achieve 3NF, we decompose based on these violating FDs while ensuring the original key is preserved in one relation.
The FD leads to a relation .
The FD leads to a relation .
We must remove the transitively determined attributes (C and E) from the main relation and keep the determinants (B and D) along with the original key (A). This gives us .
This set of relations is in 3NF, is dependency preserving, and the decomposition is lossless.
Incorrect! Try again.
59Consider a relation with FDs . What is the primary reason this relation might not be in BCNF, and what is its highest normal form?
boyce codd normal form
Hard
A.The dependency violates 3NF because B is a non-prime attribute; the highest normal form is 2NF.
B.The dependency violates BCNF because it is a partial dependency; the highest normal form is 1NF.
C.All dependencies have a determinant that is a superkey; the relation is in BCNF.
D.The dependency violates BCNF if C is not a superkey; the highest normal form is 3NF.
Correct Answer: The dependency violates BCNF if C is not a superkey; the highest normal form is 3NF.
Explanation:
Find Candidate Key: We compute the closure of A: . So, A is the candidate key.
Check BCNF: For every non-trivial FD , X must be a superkey.
: A is a superkey. OK.
: A is a superkey. OK.
: Is C a superkey? No, . This dependency violates BCNF.
Check 3NF: For every non-trivial FD , either X is a superkey or Y is a prime attribute. The only prime attribute is A.
: X (A) is a superkey. OK.
: X (A) is a superkey. OK.
: X(C) is not superkey. Y(D) is not prime. So it violates 3NF.
Okay, let me re-craft the question for a 3NF but not BCNF case. The classic example is with . The question above is for 2NF not 3NF. New Question: with FDs . What is the highest normal form of R? Explanation: Keys are {ST, TV, UV}. The dependencies and violate BCNF because U and V are not superkeys. To check 3NF, we use the rule: for an FD , either X is a superkey or Y is a prime attribute. Prime attributes are S, T, U, V. In , V is prime. In , S is prime. So both dependencies satisfy the 3NF condition. The relation is in 3NF but not BCNF.