Functional dependency and determinants

Tip: Choose Save as PDF in the print dialog to download. Use A4 paper size.

Functional dependency and determinants

Name:
Date:
Class:

Quick Questions

Shade in the A or B circle for each question.

1. In a students table, studentId = 7 always has studentName = 'Ava'. Which statement is correct?
A studentName is functionally dependent on studentId
B studentId is functionally dependent on studentName
2. In the notation studentId → studentName, which field is the determinant?
A studentId
B studentName
3. What does it mean when we say 'A determines B'?
A Each value of A can be paired with many different values of B
B Each value of A is always paired with exactly one value of B
4. Sample data: (house, points) = (Red, 120), (Blue, 95), (Red, 150). Does house determine points?
A Yes, because every row has a house value
B No, because Red appears with two different points values
5. Sample data: (subjectId, name) = (1, Maths), (2, English), (1, Maths), (3, Science). Does subjectId determine name?
A Yes, because each subjectId always has the same name
B No, because subjectId 1 appears more than once

Match the Pairs

Draw a line connecting each item on the left to its match on the right.

Left columnRight column
1studentId -> studentName Ahouse -> firstName (Red: Ava, Zoe)
2studentId 7 appears twice: Ava Nguyen, Ava Nguyen BConsistent sample data: the same studentId always gives the same name, so the dependency studentId -> studentName holds.
3A determinant is the field whose value fixes the value of another field CstudentId -> firstName
4A dependency does not hold if one determinant value is linked to two different values DThe dependency is written backwards. Ava matches two different studentId values, so studentName cannot determine studentId. It is studentId that determines studentName.
5studentName -> studentId (Ava appears for IDs 1 and 12) EstudentName is functionally dependent on studentId: each studentId value determines exactly one studentName.
6yearLevel -> studentId (Year 7: Ava, Mia) FyearLevel is wrongly named as a determinant. Year 7 matches more than one studentId, so one value of yearLevel does not fix a single studentId.

Definitions

functional dependency

Fill in the Blanks

Complete each line of code by filling in the missing parts.

1.
studentId __ studentName
2.
-- The determinant fixes studentName _________ -> studentName
3.
studentId -> studentName -- studentId is the ___________ field
4.
-- 101 Ava, 102 Liam, 103 Ava studentName -> studentId is _____
5.
-- 101 Ava, 101 Ava, 102 Liam studentId -> studentName is ____

Spot the Error

Shade in the letter of the line that contains an error.

Question 1
A Student(studentId, name, year)
B studentId -> name
C year -> studentId
D Determinant: studentId
Question 2
A studentId, studentName
B 101, Mia
C 102, Liam
D 101, Ava
E studentId -> studentName holds
Question 3
A studentId -> studentName
B Left side: determinant
C Right side: the determinant
Question 4
A Sample: house, yearLevel
B Red, 7 and Red, 8
C One house, one year level
D house does not determine year
Question 5
A Product(productId, price)
B price -> productId
C Determinant: productId

Answer Key

Functional dependency and determinants
Section A: Quick Questions
Q1
A — studentName is functionally dependent on studentId
Q2
A — studentId
Q3
B — Each value of A is always paired with exactly one value of B
Q4
B — No, because Red appears with two different points values
Q5
A — Yes, because each subjectId always has the same name
Section B: Match the Pairs
Q1
studentId -> studentName → studentName is functionally dependent on studentId: each studentId value determines exactly one studentName.
Q2
studentId 7 appears twice: Ava Nguyen, Ava Nguyen → Consistent sample data: the same studentId always gives the same name, so the dependency studentId -> studentName holds.
Q3
A determinant is the field whose value fixes the value of another field → studentId -> firstName
Q4
A dependency does not hold if one determinant value is linked to two different values → house -> firstName (Red: Ava, Zoe)
Q5
studentName -> studentId (Ava appears for IDs 1 and 12) → The dependency is written backwards. Ava matches two different studentId values, so studentName cannot determine studentId. It is studentId that determines studentName.
Q6
yearLevel -> studentId (Year 7: Ava, Mia) → yearLevel is wrongly named as a determinant. Year 7 matches more than one studentId, so one value of yearLevel does not fix a single studentId.
Section C: Definitions
Q1
functional dependency — A field is functionally dependent on another when the other field's value determines it. The determinant fixes the value: studentId determines studentName.
Section D: Fill in the Blanks
Q1
studentId -> studentName
Q2
-- The determinant fixes studentName studentId -> studentName
Q3
studentId -> studentName -- studentId is the determinant field
Q4
-- 101 Ava, 102 Liam, 103 Ava studentName -> studentId is false
Q5
-- 101 Ava, 101 Ava, 102 Liam studentId -> studentName is true
Section E: Spot the Error
Q1
C — Many students share the same year level, so year cannot determine studentId. The dependency should be studentId -> year.
Q2
B — Line 4 shows studentId 101 with the name Ava. If line 2 gave 101 a different name, one studentId would have two names and the dependency would fail. Line 2 should be 101, Ava.
Q3
C — In A -> B, the left side (A) is the determinant. The right side (B) is the dependent field, the one whose value is determined.
Q4
C — The sample data shows Red with both 7 and 8, so one house gives two year levels. That is why house does not determine yearLevel.
Q5
B — Different products can have the same price, so price cannot determine productId. The dependency should be productId -> price.