Skip to content

Instantly share code, notes, and snippets.

@fzrhrs
Last active August 29, 2015 14:06
Show Gist options
  • Save fzrhrs/a681d26043e777529e3b to your computer and use it in GitHub Desktop.
Save fzrhrs/a681d26043e777529e3b to your computer and use it in GitHub Desktop.
PostgreSQL Cheat Sheet
PostgreSQL Cheat Sheet
To start type:
psql
To list all databases:
\list
To connect to a database:
\c (name of database)
To list tables in connected database:
\dt
To see a table:
select * from (name of a table);
To delete data from a table:
delete from (name of table) where id=(id no);
To delete a database:
drop database (name of database);
To create a database:
create database (name of database);
To quit psql:
\q
update
insert
delete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment