Instruction
Wow! We're pretty much done with this part of the course.
Let's summarize what we have learned so far:
- A single-column primary key is a
NOT NULLcolumn, whose value is unique for a given row. For instance:CREATE TABLE movie ( id integer PRIMARY KEY, title varchar(64), year integer );
- A multi-column primary key is a group of
NOT NULLcolumns, whose values constitute a unique combination for a given row. For instance:CREATE TABLE order_item ( order_id integer, sequence integer, name varchar(32), quantity integer, PRIMARY KEY (order_id, sequence) );
- You can add a
NOT NULLconstraint to a column. ANOT NULLcolumn must have a value other thanNULLin every row. For instance:CREATE TABLE rpg_game ( id int PRIMARY KEY, name varchar(32) NOT NULL, genre varchar(32) );
Before we let you go, we've got a short quiz! Are you ready?
Exercise
Let's get started with the review. Use the ERD diagram below to create the proper table:

Stuck? Here's a hint!
Type:
CREATE TABLE book ( isbn varchar(10) PRIMARY KEY, title varchar(128), author varchar(64), publishing_house varchar(64), genre varchar(64) NOT NULL );



