Last active
August 29, 2015 14:06
-
-
Save fzrhrs/a681d26043e777529e3b to your computer and use it in GitHub Desktop.
PostgreSQL Cheat Sheet
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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