Created
December 8, 2016 12:51
-
-
Save haikyuu/48d4370dc794ca86bcaa05f6dee43a17 to your computer and use it in GitHub Desktop.
Postgres
This file contains 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
A cluster is a group of databases runing on the same server; | |
- `COPY tablename FROM '/home/user/weather.txt'` *inserts* rows from the given file to `tablename`; [Copy](http://devdocs.io/postgresql~9.6/sql-copy) |
Requests:
SELECT city, (temp_hi+temp_lo)/2 AS temp_avg, date FROM weather;
SELECT * FROM weather WHERE city = 'San Francisco' AND prcp > 0.0;
SELECT * FROM weather ORDER BY city, temp_lo;
SELECT DISTINCT city FROM weather ORDER BY city;
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
A cluster is a group of databases runing on the same server;
COPY tablename FROM '/home/user/weather.txt'
inserts rows from the given file totablename
; Copy