Bird
0
0

Given the table Enrollment(StudentID, CourseID, StudentName, CourseName, Grade) with primary key (StudentID, CourseID), which column violates 2NF if StudentName depends only on StudentID?

medium📝 query result Q4 of 15
SQL - Database Design and Normalization
Given the table Enrollment(StudentID, CourseID, StudentName, CourseName, Grade) with primary key (StudentID, CourseID), which column violates 2NF if StudentName depends only on StudentID?
AStudentID
BCourseName
CStudentName
DGrade
Step-by-Step Solution
Solution:
  1. Step 1: Identify partial dependency

    StudentName depends only on StudentID, part of the composite key.
  2. Step 2: Check 2NF violation

    This partial dependency violates 2NF because non-key column depends on part of key.
  3. Final Answer:

    StudentName -> Option C
  4. Quick Check:

    Partial dependency on part of key breaks 2NF [OK]
Quick Trick: Non-key columns must depend on whole key in 2NF [OK]
Common Mistakes:
  • Thinking Grade violates 2NF
  • Confusing full and partial dependencies
  • Ignoring composite key structure

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More SQL Quizzes