basant/raw/public-kitaab/psql.wiki

20 lines
464 B
Plaintext
Raw Normal View History

2021-11-30 06:24:51 -08:00
%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 )`
`);`