1 -- Example table
2 CREATE TABLE accounts (
3 user_id serial PRIMARY KEY,
4 username VARCHAR ( 50 ) UNIQUE NOT NULL,
5 password VARCHAR ( 50 ) NOT NULL,
6 email VARCHAR ( 255 ) UNIQUE NOT NULL,
7 created_on TIMESTAMP NOT NULL,
8 last_login TIMESTAMP
9);
1CREATE TABLE cities (
2 city_id serial PRIMARY KEY,
3 city_name VARCHAR (255) NOT NULL,
4 population INT NOT NULL CHECK (population >= 0)
5);
6
7
1CREATE TABLE films_recent AS
2 SELECT * FROM films WHERE date_prod >= '2002-01-01';
3