SQLab
LearnPracticeProblemsArenaLeaderboard

SQLab

Practice

Mission 2 / 8

The first shelf

create table · primary key · identity

In a pharmacy, medicines sit on shelves by category. In a database every “shelf” is a table. Your first table is the list of categories.

The category table

Create the table kategoriya with two columns: kategoriya_id — bigint, primary key, numbered by PostgreSQL itself (generated always as identity primary key); kategoriya_nomi — varchar(100), must not be empty (not null). A long command may span several lines: it does not end until you type ;.

Preparing the database…