Cellwise · SQL track

Creating tables and views

Define tables, add columns, and save queries as views.

CREATE TABLE defines a table: its name, its columns and each column’s type. Constraints such as NOT NULL and PRIMARY KEY stop bad data getting in.

A view is a saved query you can select from like a table. ALTER TABLE changes an existing table, for example to add a column.

What you’ll do

Start the lesson, free