Instruction
Great, let's study the theory for a while.
We usually choose a single column to become our primary key. If we want to inform our database that a given column is supposed to be the primary key (often abbreviated in ERDs as PK), we place the keywords PRIMARY KEY after the name and type of the column:
CREATE TABLE movie ( id integer PRIMARY KEY, title varchar(40) );
Quite simple, right?
Exercise
You are now going to create a table with a primary key.
Let's reconstruct our movie table so that it has the following columns:
film_id– an integer number and the primary key.title– a field of up to 64 characters.year– an integer.genre– a field of up to 10 characters.
Stuck? Here's a hint!
Type:
CREATE TABLE movie ( film_id integer PRIMARY KEY, title varchar(64), year integer, genre varchar(10) );



