Created
May 8, 2014 15:49
-
-
Save zackn9ne/ae81cdfa1b0b4b56f229 to your computer and use it in GitHub Desktop.
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
PSQL CHECKING COMMANDS | |
1. $psql | |
2. =# \l List All The DB's | |
2. =# \c dbname CHANGE TO IT | |
3. dbname=# \d List All The Relations | |
4. dbname=# SELECT * FROM relation_of_your_choice; | |
PSQL CREATING COMMANDS | |
1. $psql | |
2. =# CREATE DATABASE dbname; | |
3. =# \c dbname CHANGE TO IT | |
4. dbname=# \d List All The Relations | |
5. dbname=# SELECT * FROM relation_of_your_choice; | |
EXTRA INFO | |
\l List all databases | |
\c dbname Change db | |
\d Display all tables in database | |
\d tablename Describe the details of given table | |
\h Get a help on syntax of SQL commands | |
\? Lists all psql slash commands. | |
\q Quit psql |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment