Exercise: Multi-Column Key
Create table with composite key.
Solution
sql
1CREATE TABLE grades (
2 student_id INTEGER,
3 subject TEXT,
4 grade TEXT,
5 PRIMARY KEY (student_id, subject)
6);
Create table with composite key.
1CREATE TABLE grades (
2 student_id INTEGER,
3 subject TEXT,
4 grade TEXT,
5 PRIMARY KEY (student_id, subject)
6);