Interactive SQL tutorial

Last modified: February 27, 2023

Create Table

To create a table you can useCREATE TABLE expression where you can define all columns with their types, constraints, and indexes.

For example, this is how you could create a table 'customers'.

CREATE TABLE customers (
  id INTEGER PRIMARY KEY,
  name VARCHAR(50) NOT NULL,
  email VARCHAR(50) NOT NULL,
  countryCode VARCHAR(2) NOT NULL
)

Now, try it for yourself. Let's create table customers

Navigated to Interactive SQL tutorial