basant/raw/public-kitaab/psql.wiki
2021-12-01 00:24:51 +10:00

20 lines
464 B
Plaintext

%title Postgres Commands
:dev:
%date 20200109-1320
= Quick Tips =
`\l` List all Databases
`\c <database>` Connect to a database
`\dt` List all tables (once connected to a db)
`DELETE FROM <table> WHERE <condition>` delete rows from a table
Strings must be wrapped in ''
create a table:
`CREATE TABLE <table_name>(`
` column1 datatype,`
` column2 datatype,`
` column3 datatype,`
` .....`
` columnN datatype,`
` PRIMARY KEY( one or more columns )`
`);`