Skip to content

Instantly share code, notes, and snippets.

@ph4un00b
Created December 5, 2018 18:04
Show Gist options
  • Save ph4un00b/6ec8603035c9c5e49500d07088bf0aea to your computer and use it in GitHub Desktop.
Save ph4un00b/6ec8603035c9c5e49500d07088bf0aea to your computer and use it in GitHub Desktop.
postgresql
\? -> help
create database JAMON; -> create DB | alternative: $ createdb JAMOM
\l -> list db's
drop database JAMON; -> drop DB
\q -> exits
\c JAMON -> switch over DB
\d TABLE? -> describe DB or TABLE
create table NAME(\n column TYPE, ...); -> start modeling table
SERIAL, TEXT -> column types
insert into TABLE(column) values('value'); -> fill the table
select * from TABLE; ->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment