Postgres Cheat Sheet

ADVERTISEMENT

PostGres Cheat Sheet
POSTGRES NOTES
1. Always put “ “ around column names and table names. Put ‘ ‘ around values (like
when inserting.
2. Using the command line Login command line with psql –d databasename or psql –d
database name –U:username
3. Remember at the command line you need a semi colon at the end of all statements.
4. SQL Terms Not supported in Postgres
a. mid
b. len
c. round()
d. format()
e. first()
f.
top () (but you can use limit instead!)
g. ifnull()
SQL NOTES
Select Statement
SELECT column_name(s) FROM table_name
Or to get everything in that table:
SELECT * FROM table_name
Example
SELECT LastName,FirstName FROM Employees
The Where Clause
SELECT column_name(s) FROM table_name WHERE column_name operator value
SELECT * FROM Employees WHERE City=
‘Richardson'
Operators
1

ADVERTISEMENT

00 votes

Related Articles

Related forms

Related Categories

Parent category: Education
Go
Page of 7