Deals Of The Week - hours only!Up to 80% off on all courses and bundles.-Close
Introduction
Identity columns
Sequences
Summary

Instruction

Good job! It's your turn to create a table with GENERATED ALWAYS AS IDENTITY.

Exercise

We need a table to keep track of movie reviews. Create a table named review with the following columns:

  1. id – Contains auto-generated integer values (GENERATED ALWAYS AS IDENTITY) and is the primary key for this table.
  2. author_id – An integer column.
  3. title – A column with up to 64 characters.
  4. rating – An integer column.

Stuck? Here's a hint!

The title column should be of type varchar(64). The id column can be defined in a following way:

id integer GENERATED ALWAYS AS IDENTITY PRIMARY KEY