Primary keys - the basics
Single-column primary keys
Multicolumn primary keys
17. Multicolumn primary keys in ERD
Auto-increment columns and sequences
Revision

Instruction

Fabulous! You're doing really great.

Of course, you can also note the information about a multiple column primary key in the ERD diagram, as shown below:

The movie table

Exercise

Try to create a table using the ERD diagram below:

The enrollment table

Stuck? Here's a hint!

Type

CREATE TABLE enrollment (
   student_id int,
   course_id int,
   start_date date,
   evaluation text,
   PRIMARY KEY (student_id, course_id, start_date)
);

Console

Code editor

Result

TableConsole