\c connect
\q exit
\dt display table
\l list of databases
CREATE DATABASE my_database
CREATE TABLE table_name(id SERIAL PRIMARY KEY,name VARCHAR(lenght),age integer,description text)
C: 'create'
R: 'read'
U: 'update'
D: 'delete'
INSERT INTO (table name) (colmuns) VALUES (columns values)
SELECT * FROM (table name)
UPDATE (table name) SET (column to update) WHERE condition
DELETE FROM (table_name) WHERE condition
-
WHERE
specify condition to filter -
LIMIT
limit the N of responses -
BETWEEN
selects data between two values -
LIKE
identifies content that matches based on a patterns -
IS NULL
checks if value is null -
ISNOTNULL
checks if value is not null