-
Notifications
You must be signed in to change notification settings - Fork 1
Database cheatsheet for terminal
Sharina Stubbs edited this page May 12, 2020
·
3 revisions
$ \c database-name
List all available databases
\l
Once in the DB, create a table:
CREATE TABLE Persons (
PersonID int,
LastName varchar(255),
FirstName varchar(255),
Address varchar(255),
City varchar(255)
);
See the columns within the table
\d table_name
To see all available psql commands
\?
To get help on a particular command, such as INSERT
\h insert
$ \d
$ \dt
\q