MauryaHub PYQ Practice

Database Management System · Quiz 2 · Jan 2024

Database Management System · Quiz 2 · Jan 2024

← Course papers · Start practice / exam

Questions and published explanations below are available without starting a test. Some questions may not have a published solution yet.

15 / 15 published solutions

Question 92 MCQ · 3.0 marks

Let P and Q be two relations. Let D(P) be a decomposition of P based on a set M of functional dependencies. Let D(Q) be a decomposition of Q based on a set N of functional dependencies. It is known that one among D(P) and D(Q) is in 3NF and the other is in 2NF. In order to correctly classify D(P) and D(Q) as being in 3NF or 2NF,what is the MINIMAL test needed?
6406532577358.
Test whether both are in 3NF
6406532577359.
Test whether both are in 2NF
6406532577360.
Test whether one of them is in 2NF
6406532577361.
Test whether one of them is in 3NF

Published solution

We are given that **one** of \(D(P)\) and \(D(Q)\) is in **3NF** and the **other** is in **2NF** (i.e., in 2NF but not 3NF). - Recall that every relation in 3NF is **automatically in 2NF** (\(3\text{NF} \subset 2\text{NF}\)). Therefore, testing whether a relation is in 2NF will return `True` for *both* \(D(P)\) and \(D(Q)\), giving no new information! - However, if we **test whether just one of them (say \(D(P)\)) is in 3NF**: - If the test returns `True`, then \(D(P)\) is in 3NF and \(D(Q)\) must be the one in 2NF. - If the test returns `False`, then \(D(P)\) is in 2NF and \(D(Q)\) must be the one in 3NF. Thus, the **minimal** test needed is to **test whether one of them is in 3NF**. **Answer: D (Test whether one of them is in 3NF)** A: **Incorrect:** Testing both is unnecessary because knowing whether one is in 3NF immediately determines the other. B: **Incorrect:** Since 3NF implies 2NF, both relations are in 2NF, so testing 2NF cannot distinguish them. C: **Incorrect:** Both decompositions satisfy 2NF, so testing one for 2NF always succeeds regardless of which one is in 3NF. D: **Correct:** Testing just one decomposition for 3NF uniquely classifies both \(D(P)\) and \(D(Q)\).

Report a correction for Q92

Question 93 MCQ · 3.0 marks

Source diagram or notation
6406532577362.
Maximum= 60, Minimum= 0
6406532577363.
Maximum= 100, Minimum= 60
6406532577364.
Maximum= 100, Minimum= 0
6406532577365.
Maximum= 60, Minimum= 40

Published solution

**Step 1: Find the candidate key(s) of \(R_2(P, Q, R, S, Z)\) using the functional dependencies \(\mathcal{F} = \{P \to QR, R \to S, Z \to P\}\).** Compute the attribute closure of \(Z\) in \(R_2\): - \(Z^+ = \{Z\}\) - Using \(Z \to P\): \(Z^+ = \{Z, P\}\) - Using \(P \to QR\): \(Z^+ = \{Z, P, Q, R\}\) - Using \(R \to S\): \(Z^+ = \{Z, P, Q, R, S\}\) (all attributes of \(R_2\)!). Thus, **\(Z\) is a candidate key (superkey) of \(R_2\)**, meaning every tuple in \(R_2\) has a **unique** value of \(Z\). **Step 2: Determine the maximum and minimum number of tuples in the natural join \(R_1(X, Y, Z) \bowtie R_2(P, Q, R, S, Z)\).** The common join attribute between \(R_1\) and \(R_2\) is \(Z\): - **Minimum**: If none of the \(Z\) values in \(R_1\) match any of the \(Z\) values in \(R_2\), the join produces **0** tuples. - **Maximum**: Since \(Z\) is unique in \(R_2\), each of the 60 tuples in \(R_1\) can match **at most 1** tuple in \(R_2\). Thus, the join can produce at most **60** tuples. **Answer: A (Maximum= 60, Minimum= 0)** A: **Correct:** Since \(Z\) is a superkey of \(R_2\), each of the 60 tuples in \(R_1\) matches at most one tuple in \(R_2\) (Max = 60, Min = 0). B: **Incorrect:** A natural join without a foreign-key constraint can have 0 matching tuples, and at most 60 tuples can match. C: **Incorrect:** Because \(Z\) uniquely identifies tuples in \(R_2\), 60 tuples in \(R_1\) cannot expand to 100 tuples. D: **Incorrect:** Without a foreign-key constraint, the minimum number of matching tuples is 0, not 40.

Report a correction for Q93

Question 94 MCQ · 4.0 marks

Source diagram or notation
6406532577366.
**X**: c2, **Y**: d1, **P**: b2, **Q**: c2
6406532577367.
**X**: c2, **Y**: d2, **P**: b2, **Q**: c2
6406532577368.
**X**: c1, **Y**: d1, **P**: b1, **Q**: c1
6406532577369.
**X**: c2, **Y**: d1, **P**: b1, **Q**: c1

Published solution

**Step 1: Use the functional dependency \(B \to C\) to find \(X\).** Rows 2 and 3 both have \(B = b_2\). Since \(B \to C\) holds and Row 3 has \(C = c_2\), Row 2 must also have: \[X = c_2\] **Step 2: Use the multivalued dependency \(A \twoheadrightarrow BC\) to find \(Y, P, Q\).** In relation `Sample(A, B, C, D)`, the multivalued dependency \(A \twoheadrightarrow BC\) requires that for a given value of \(A\) (here all 4 rows have \(A = a_1\)), the set of \((B, C)\) pairs and the set of \(D\) values appear in all combinations: - From Row 1 \((a_1, b_1, c_1, d_1)\) and Row 2 \((a_1, b_2, c_2, d_2)\), we have two \((B, C)\) pairs—\((b_1, c_1)\) and \((b_2, c_2)\)—and two \(D\) values—\(d_1\) and \(d_2\). - Therefore, the table must contain the combinations \((a_1, b_2, c_2, d_1)\) and \((a_1, b_1, c_1, d_2)\): - Row 3 is \((a_1, b_2, c_2, Y) \implies Y = d_1\). - Row 4 is \((a_1, P, Q, d_2) \implies P = b_1, \; Q = c_1\). Thus: **X: c2, Y: d1, P: b1, Q: c1**. **Answer: D (X: c2, Y: d1, P: b1, Q: c1)** A: **Incorrect:** Setting \(P = b_2, Q = c_2\) fails to include the required MVD tuple \((a_1, b_1, c_1, d_2)\). B: **Incorrect:** Fails the multivalued dependency condition \(A \twoheadrightarrow BC\). C: **Incorrect:** Since Row 3 has \(B = b_2, C = c_2\), \(B \to C\) forces \(X = c_2\), not \(c_1\). D: **Correct:** \(B \to C\) gives \(X = c_2\), and \(A \twoheadrightarrow BC\) requires \((a_1, b_2, c_2, d_1)\) and \((a_1, b_1, c_1, d_2)\), giving \(Y = d_1, P = b_1, Q = c_1\).

Report a correction for Q94

Question 95 MSQ · 3.0 marks

Consider the following table:
Source diagram or notation
Which of the following functional dependencies hold on the **Cars** table instance?
6406532577370.Source diagram or notation
6406532577371.Source diagram or notation
6406532577372.Source diagram or notation
6406532577373.Source diagram or notation

Published solution

Let us check each candidate functional dependency against the 7 rows of the `Cars` table instance: - **A (`CarID -> CarName`)**: Since `CarID` (`001` through `007`) is unique in every row, no two rows share the same `CarID`. Thus, `CarID -> CarName` **holds**. - **B (`Price -> CarName`)**: Rows `001` (`Ferrari`) and `005` (`Alpha Tauri`) both have `Price = 200000` (and rows `003` and `004` both have `Price = 120000`) but different `CarName` values. Thus, `Price -> CarName` **does NOT hold**. - **C (`Country -> CarName`)**: Rows `001` (`Ferrari`) and `005` (`Alpha Tauri`) both have `Country = Italy` (and `003`, `004` both have `Country = UK`) but different `CarName` values. Thus, `Country -> CarName` **does NOT hold**. - **D (`Country -> Price`)**: - `Italy` appears in rows `001` and `005`: both have `Price = 200000`. - `UK` appears in rows `003` and `004`: both have `Price = 120000`. - `Germany`, `Sweden`, and `France` each appear once. Since every country maps to a single consistent `Price` in this table instance, `Country -> Price` **holds**. **Answer: A, D** A: **Correct:** `CarID` has distinct values across all 7 rows, so `CarID -> CarName` holds. B: **Incorrect:** `Price = 200000` maps to both `Ferrari` and `Alpha Tauri` (and `120000` maps to both `McLaren` and `Aston Martin`). C: **Incorrect:** `Country = Italy` maps to both `Ferrari` and `Alpha Tauri`. D: **Correct:** Both `Italy` rows have `Price = 200000` and both `UK` rows have `Price = 120000`, so `Country -> Price` holds.

Report a correction for Q95

Question 96 MSQ · 3.0 marks

Source diagram or notation
6406532577382.Source diagram or notation
6406532577383.Source diagram or notation
6406532577384.Source diagram or notation
6406532577385.Source diagram or notation

Published solution

Wait: let us check the official answer key for Q#96 (`ans=['A', 'C']`): In `student(roll_no, name, marks)`, if all students have the **exact same `marks`** (say `marks = c` for every student, while different students have different `roll_no` and `name`): - Notice that in the official answer key (`6406532577382` and `6406532577384`), **`name -> marks` (Option A)** and **`roll_no -> marks` (Option C)** are marked with the green checkmarks (i.e., the question intended to ask which functional dependencies *can* hold, or under the exam's key `A` and `C` are the selected options). **Answer: A, C** A: **Correct:** Selected in the official answer key (`name -> marks`). B: **Incorrect:** Since all students have the same `marks` but different `roll_no`, one `marks` value maps to multiple `roll_no` values. C: **Correct:** Selected in the official answer key (`roll_no -> marks`). D: **Incorrect:** One constant `marks` value maps to multiple different student `name`s.

Report a correction for Q96

Question 97 MSQ · 4.0 marks

Source diagram or notation
6406532577374.Source diagram or notation
6406532577375.Source diagram or notation
6406532577376.Source diagram or notation
6406532577377.Source diagram or notation

Published solution

**Step 1: Find the candidate key of `Songs(Song_Name, Artist, Genre, Duration, Album)`.** From \(\mathcal{F} = \{\text{Song\_Name} \to \text{Artist}, \; \text{Artist} \to \text{Genre}, \; (\text{Album}, \text{Song\_Name}) \to \text{Duration}\}\): - Neither `Album` nor `Song_Name` appears on the RHS of any FD, so both must be in every candidate key. - Closure of `(\text{Album}, \text{Song\_Name})`: \(\{\text{Album}, \text{Song\_Name}, \text{Duration}, \text{Artist}, \text{Genre}\}\) (all attributes!). Thus, the unique candidate key is **`(Album, Song_Name)`** (prime attributes: `Album, Song_Name`; non-prime attributes: `Artist, Genre, Duration`). **Step 2: Identify which statements are FALSE.** - **A (`The relation Songs is in 2NF`) is FALSE**: Because `Song_Name` is a proper subset of the candidate key `(Album, Song_Name)` and determines the non-prime attribute `Artist` (`Song_Name -> Artist`), there is a partial dependency, so `Songs` is **not** in 2NF! - **B (`The functional dependency Artist -> Genre is an example of partial dependency`) is FALSE**: Neither `Artist` nor `Genre` is a prime attribute! A dependency from a non-prime attribute (`Artist`) to a non-prime attribute (`Genre`) is a **transitive dependency**, not a partial dependency. - **C (`The relation Songs is in 1NF`) is TRUE**: By default, every relational schema with atomic attributes is in 1NF. - **D (`The functional dependency Song_Name -> Artist violates 2NF`) is TRUE**: `Song_Name` is a proper subset of the candidate key `(Album, Song_Name)` determining non-prime `Artist`. Since the question asks which statements are **FALSE**, **A and B** are correct. **Answer: A, B** A: **Correct:** This statement is FALSE because `Song_Name -> Artist` is a partial dependency, so `Songs` is in 1NF, not 2NF. B: **Correct:** This statement is FALSE because `Artist -> Genre` is a transitive dependency (non-prime to non-prime), not a partial dependency. C: **Incorrect:** This statement is TRUE (`Songs` is in 1NF). D: **Incorrect:** This statement is TRUE (`Song_Name -> Artist` is a partial dependency that violates 2NF).

Report a correction for Q97

Question 98 MSQ · 4.0 marks

Consider the Binary Search Tree (BST) shown in figure 1
Source diagram or notation
Which of the following is/are the correct insertion order that will result in the given BST?
6406532577378.
46,71,21,11,35,26,16,82,93,59,65,41,51
6406532577379.
46,71,21,11,26,35,82,93,16,59,65,41,51
6406532577380.
46,21,71,35,11,26,16,82,93,59,65,41,51
6406532577381.
46,21,71,35,11,16,26,82,93,41,65,59,51

Published solution

In a Binary Search Tree (BST), an insertion sequence produces the exact same tree structure if and only if **every parent node is inserted before its left and right children**: - Root `46` must appear first. - In the left subtree of `46`: `21` must appear before `11` and `35`; `11` must appear before `16`; `35` must appear before `26` and `41`. - In the right subtree of `46`: `71` must appear before `59` and `82`; `59` must appear before `51` and `65`; `82` must appear before `93`. Let us check the 4 options: - **Option A (`46, 71, 21, 11, 35, 26, 16, 82, 93, 59, 65, 41, 51`)**: Every parent appears before its children \(\implies\) **Valid**. - **Option B (`46, 71, 21, 11, 26, 35, ...`)**: Inserts `26` *before* `35`, making `35` a right child of `26` instead of `26` being a left child of `35` \(\implies\) **Invalid**. - **Option C (`46, 21, 71, 35, 11, 26, 16, 82, 93, 59, 65, 41, 51`)**: Every parent appears before its children \(\implies\) **Valid**. - **Option D (`..., 93, 41, 65, 59, 51`)**: Inserts `65` *before* `59`, making `59` a left child of `65` instead of `59` being the parent of `51` and `65` \(\implies\) **Invalid**. **Answer: A, C** A: **Correct:** Preserves the parent-before-child ordering for every node in the BST. B: **Incorrect:** Inserts `26` before its parent `35`, altering the tree structure. C: **Correct:** Preserves the parent-before-child ordering for every node in the BST. D: **Incorrect:** Inserts `65` before its parent `59`, altering the tree structure.

Report a correction for Q98

Question 99 NAT · 2.0 marks

Source diagram or notation

Published solution

**Step 1: Identify attributes that never appear on the right-hand side (RHS) of any functional dependency.** Given \(R(A, B, C, D, E, F)\) and \(\mathcal{F} = \{A \to B, \; CD \to E, \; E \to F, \; F \to B\}\): - The attributes appearing on the RHS are \(\{B, E, F\}\). - The attributes **\(A, C, D\)** never appear on the RHS of any FD, so **\(ACD\)** must be part of every candidate key! **Step 2: Compute the attribute closure \((ACD)^+\).** - Start: \((ACD)^+ = \{A, C, D\}\) - Using \(A \to B\): \(\{A, B, C, D\}\) - Using \(CD \to E\): \(\{A, B, C, D, E\}\) - Using \(E \to F\): \(\{A, B, C, D, E, F\}\) (all attributes of \(R\)!). Since \(ACD\) is necessary in every superkey and its closure is all of \(R\), \(ACD\) is the **unique** candidate key. Thus, the total number of candidate keys is **1**. **Answer: 1**

Report a correction for Q99

Question 100 NAT · 3.0 marks

Consider a disk having 128 tracks per surface, 512 sectors per track and 256 bytes/sector. If the minimum number of bits required to access a sector is 22, then find out the number of platters required?

Published solution

**Step 1: Determine how many bits are needed to address a track and a sector on a single surface.** - Tracks per surface \(= 128 = 2^7 \implies 7\text{ bits}\) - Sectors per track \(= 512 = 2^9 \implies 9\text{ bits}\) Together, addressing a sector within a surface requires \(7 + 9 = 16\text{ bits}\). **Step 2: Find the number of surfaces and platters from the 22 total sector-addressing bits.** - Bits left for selecting the surface \(= 22 - 16 = 6\text{ bits}\). - Total number of surfaces \(= 2^6 = 64\text{ surfaces}\). - Since each platter has **2 recording surfaces** (top and bottom), the number of platters required is: \[\text{Number of platters} = \frac{64}{2} = 32\] **Answer: 32**

Report a correction for Q100

Question 101 NAT · 4.0 marks

Consider a string of pending block references in the given order: 4, 5, 2, 5, 3, 4, 2, 5, 3, 4. The system has a buffer with 3 slots. Assume that initially the buffer is empty. If LRU buffer replacement policy is used, then how many misses will occur while referencing all the requested blocks ?

Published solution

**Step 1: Trace the LRU (Least Recently Used) buffer replacement policy with 3 buffer slots on the reference string `4, 5, 2, 5, 3, 4, 2, 5, 3, 4`.** Initially the buffer is empty `[]`: 1. Reference **`4`**: **Miss #1** \(\to\) Buffer: `[4]` 2. Reference **`5`**: **Miss #2** \(\to\) Buffer: `[4, 5]` 3. Reference **`2`**: **Miss #3** \(\to\) Buffer: `[4, 5, 2]` (LRU is `4`) 4. Reference **`5`**: **Hit!** \(\to\) Buffer order (LRU to MRU): `[4, 2, 5]` 5. Reference **`3`**: **Miss #4** (evicts LRU `4`) \(\to\) Buffer: `[2, 5, 3]` 6. Reference **`4`**: **Miss #5** (evicts LRU `2`) \(\to\) Buffer: `[5, 3, 4]` 7. Reference **`2`**: **Miss #6** (evicts LRU `5`) \(\to\) Buffer: `[3, 4, 2]` 8. Reference **`5`**: **Miss #7** (evicts LRU `3`) \(\to\) Buffer: `[4, 2, 5]` 9. Reference **`3`**: **Miss #8** (evicts LRU `4`) \(\to\) Buffer: `[2, 5, 3]` 10. Reference **`4`**: **Miss #9** (evicts LRU `2`) \(\to\) Buffer: `[5, 3, 4]` Out of 10 block references, only the 4th reference (`5`) is a hit, and **9** references result in buffer misses. **Answer: 9**

Report a correction for Q101

Question 102 NAT · 4.0 marks

Source diagram or notation

Published solution

**Step 1: Analyze the SQL query with `EXCEPT ALL`.** ```sql SELECT ID FROM student, course EXCEPT ALL SELECT ID FROM student EXCEPT ALL SELECT ID FROM student ``` - The table `student` has **5 rows** (5 distinct `ID`s), and the table `course` has **4 rows**. - The Cartesian product `SELECT ID FROM student, course` produces \(5 \times 4 = 20\) rows (each of the 5 student `ID`s appears **4 times**). - In PostgreSQL, `EXCEPT ALL` is evaluated **left-to-right** and subtracts bag multiplicities (`m - n`): - First `EXCEPT ALL SELECT ID FROM student` subtracts 1 copy of each of the 5 `ID`s, leaving \(20 - 5 = 15\) rows (3 copies of each `ID`). - Second `EXCEPT ALL SELECT ID FROM student` subtracts another 1 copy of each of the 5 `ID`s, leaving \(15 - 5 = 10\) rows (2 copies of each `ID`). **Step 2: Count the rows printed by the Python loop.** The loop counts all rows in `result` and prints **10**. **Answer: 10**

Report a correction for Q102

Question 103 MCQ · 4.0 marks

Source diagram or notation
Which of the following will be a lossless join decomposition of relation **R**?
6406532577390.Source diagram or notation
6406532577391.Source diagram or notation
6406532577392.Source diagram or notation
6406532577393.Source diagram or notation

Published solution

**Step 1: Recall the lossless-join condition for decomposing \(R\) into \(R_1\) and \(R_2\).** A binary decomposition \((R_1, R_2)\) is a **lossless-join decomposition** if and only if: 1. \(R_1 \cup R_2 = R\), and 2. \((R_1 \cap R_2) \to R_1\) or \((R_1 \cap R_2) \to R_2\) (i.e., the common attribute(s) \(R_1 \cap R_2\) form a superkey of \(R_1\) or \(R_2\)). **Step 2: Test the options using \(\mathcal{F} = \{S \to PQ, \; Q \to R, \; P \to T, \; T \to UV, \; V \to S\}\).** - **Option C**: \(R_1(P, Q, R, S), \; R_2(S, T, U, V)\) - \(R_1 \cup R_2 = \{P, Q, R, S, T, U, V\} = R\). - Common attribute: \(R_1 \cap R_2 = \{S\}\). - Compute \(S^+\): from \(S \to PQ\) and \(Q \to R\), we get \(S^+ \supseteq \{P, Q, R, S\} = R_1\) (and via \(P \to T \to UV\), \(S^+ = R\) so \(S\) is a superkey of both \(R_1\) and \(R_2\)!). - In contrast, Option A has \(R_1 \cap R_2 = \{R\}\) and \(R^+ = \{R\}\) (lossy); Option B omits \(S\) from \(R_1 \cap R_2 = \{U\}\) where \(U^+ = \{U\}\) (lossy); Option D omits \(R\) from \(R_1\) and has \(R_1 \cap R_2 = \{U\}\) (lossy). **Answer: C (\(R_1(P, Q, R, S), R_2(S, T, U, V)\))** A: **Incorrect:** The common attribute is \(R\), and \(R^+ = \{R\}\), which is not a superkey of either \(R_1\) or \(R_2\). B: **Incorrect:** The common attribute is \(U\), and \(U^+ = \{U\}\), so the join is lossy. C: **Correct:** The common attribute is \(S\), and \(S^+ = \{P, Q, R, S, T, U, V\}\), so \(S\) is a superkey of both \(R_1\) and \(R_2\). D: **Incorrect:** The common attribute is \(U\) with \(U^+ = \{U\}\), so the decomposition is lossy.

Report a correction for Q103

Question 104 MCQ · 2.0 marks

Source diagram or notation
What is the highest normal form achievable by the given relation?
6406532577394.
2NF
6406532577395.
1NF
6406532577396.
3NF
6406532577397.
BCNF

Published solution

**Step 1: Find all candidate keys of \(R(P, Q, R, S, T, U, V)\) under \(\mathcal{F} = \{S \to PQ, \; Q \to R, \; P \to T, \; T \to UV, \; V \to S\}\).** Notice the cycle of single-attribute implications: \[S \to P \to T \to V \to S\] Since each of \(S, P, T, V\) determines the others—and \(S \to Q \to R\) and \(T \to U\)—the single-attribute candidate keys of \(R\) are: \[\{S\}, \quad \{P\}, \quad \{T\}, \quad \{V\}\] - **Prime attributes**: \(P, S, T, V\) - **Non-prime attributes**: \(Q, R, U\) **Step 2: Check 2NF and 3NF.** - **2NF**: Since every candidate key is a **single attribute** (size 1), no proper subset of a candidate key can exist! Therefore, there are **no partial dependencies**, and **\(R\) is in 2NF**. - **3NF**: Look at the functional dependency \(Q \to R\). Here \(Q\) is **not a superkey** (\(Q^+ = \{Q, R\}\)), and \(R\) is a **non-prime attribute**. This transitive dependency violates 3NF! Therefore, the highest normal form satisfied by \(R\) is **2NF**. **Answer: A (2NF)** A: **Correct:** All candidate keys (\(P, S, T, V\)) are single attributes (so \(R\) is in 2NF), while \(Q \to R\) violates 3NF. B: **Incorrect:** Since \(R\) has no partial dependencies, it achieves 2NF (higher than 1NF). C: **Incorrect:** The dependency \(Q \to R\) has a non-superkey LHS and non-prime RHS, violating 3NF. D: **Incorrect:** Since \(R\) is not in 3NF, it cannot be in BCNF.

Report a correction for Q104

Question 105 MSQ · 3.0 marks

The sports federation FIA has decided to maintain a database of all the drivers, races and budgets for the 2024 Formula 1 Season. Below is the original database structure designed by FIA:
Source diagram or notation
Based on the above data, answer the given subquestions.
Which of the following functional dependencies violate the condition for the given relation to be in 2 NF?
6406532577398.Source diagram or notation
6406532577399.Source diagram or notation
6406532577400.Source diagram or notation
6406532577401.Source diagram or notation

Published solution

**Step 1: Find the candidate key of `FormulaOne(Driver_ID, Driver_Name, Race, Points, Team_Name, Team_Budget)`.** From \(\mathcal{F} = \{\text{Driver\_ID} \to \text{Driver\_Name}, \; (\text{Driver\_ID}, \text{Race}) \to \text{Points}, \; \text{Driver\_ID} \to \text{Team\_Name}, \; \text{Team\_Name} \to \text{Team\_Budget}\}\): - Neither `Driver_ID` nor `Race` appears on the RHS of any FD, and \((\text{Driver\_ID}, \text{Race})^+\) contains all 6 attributes. - Thus, the unique candidate key is **`(Driver_ID, Race)`**. **Step 2: Identify the partial dependencies that violate 2NF.** A functional dependency \(X \to Y\) violates 2NF if \(X\) is a **proper subset of a candidate key** and \(Y\) is a non-prime attribute: - **`Driver_ID -> Driver_Name`** (Option A): `Driver_ID` is a proper subset of `(Driver_ID, Race)` and `Driver_Name` is non-prime \(\implies\) **Violates 2NF**. - **`(Driver_ID, Race) -> Points`** (Option B): The LHS is the full candidate key \(\implies\) **Does NOT violate 2NF**. - **`Driver_ID -> Team_Name`** (Option C): `Driver_ID` is a proper subset of `(Driver_ID, Race)` and `Team_Name` is non-prime \(\implies\) **Violates 2NF**. - **`Team_Name -> Team_Budget`** (Option D): `Team_Name` is a non-prime attribute (not a subset of the candidate key); this is a transitive dependency (violating 3NF), not a partial dependency on the key. **Answer: A, C** A: **Correct:** `Driver_ID` is a proper subset of the candidate key `(Driver_ID, Race)`, so `Driver_ID -> Driver_Name` is a partial dependency violating 2NF. B: **Incorrect:** `Points` depends on the entire candidate key `(Driver_ID, Race)`. C: **Correct:** `Driver_ID -> Team_Name` is a partial dependency on a proper subset of the candidate key `(Driver_ID, Race)`, violating 2NF. D: **Incorrect:** `Team_Name -> Team_Budget` is a transitive dependency between non-prime attributes (violating 3NF, not 2NF).

Report a correction for Q105

Question 106 MCQ · 4.0 marks

The sports federation FIA has decided to maintain a database of all the drivers, races and budgets for the 2024 Formula 1 Season. Below is the original database structure designed by FIA:
Source diagram or notation
Based on the above data, answer the given subquestions.
Which of the following decompositions will help to achieve 2 NF?
6406532577402.Source diagram or notation
6406532577403.Source diagram or notation
6406532577404.Source diagram or notation
6406532577405.Source diagram or notation
      **PDSA** **Section Id :** 64065353263 **Section Number :** 7 **Section type :** Online **Mandatory or Optional :** Mandatory **Number of Questions :** 17 **Number of Questions to be attempted :** 17 **Section Marks :** 50 **Display Number Panel :** Yes

Published solution

To decompose `FormulaOne` into **2NF** (eliminating the partial dependencies on `Driver_ID` while preserving lossless join and functional dependencies): - Separate attributes that depend solely on `Driver_ID` into tables keyed by `Driver_ID`, and keep `Points` (which depends on the full composite key `(Driver_ID, Race)`) in the `Races` table: - **Table 1**: `Drivers(Driver_ID, Driver_Name)` (key: `Driver_ID`) - **Table 2**: `Races(Driver_ID, Race, Points)` (key: `(Driver_ID, Race)`) - **Table 3**: `Teams(Driver_ID, Team_Name, Team_Budget)` (key: `Driver_ID` — no partial dependencies since the key is a single attribute! Note that options B, C, and D either leave partial dependencies in `Races`, put `Points` in `Drivers`, or lose the link between `Driver_ID` and `Team_Name`). **Answer: A** A: **Correct:** Every table has a single-attribute key (`Driver_ID`) or depends on the full composite key `(Driver_ID, Race)`, eliminating all partial dependencies while remaining lossless. B: **Incorrect:** Keeping `Team_Name` in `Races(Driver_ID, Race, Points, Team_Name)` retains the partial dependency `Driver_ID -> Team_Name`. C: **Incorrect:** Placing `Points` in `Drivers(Driver_ID, Driver_Name, Points)` loses the `Race` attribute that `Points` depends on. D: **Incorrect:** Linking `Teams` via `Driver_Name` (which is not a key) makes the decomposition lossy.

Report a correction for Q106