Identify partial dependency (2NF)
SQL
Easy
2 views
Problem Description
Table Marks(student_id, subject_id, student_name, subject_name, marks) with PK(student_id, subject_id). Explain what is wrong and show a 2NF decomposition using SQL tables.
Output Format
DDL statement(s)
Sample Test Case
Input:
Marks composite key
Output:
Decomposed tables
Constraints
Remove partial dependencies
Official Solution
CREATE TABLE Students (student_id INT PRIMARY KEY, student_name VARCHAR(100)); CREATE TABLE Subjects (subject_id INT PRIMARY KEY, subject_name VARCHAR(100)); CREATE TABLE StudentMarks (student_id INT, subject_id INT, marks INT, PRIMARY KEY(student_id, subject_id));
Solutions (0)
No solutions submitted yet. Be the first!
No comments yet. Start the discussion!