Basic use of psql (PostgreSQL command-line Client) on turing.cs.hmc.edu You must have an account on turing, an account name for the database, and a password. A brief tutorial that goes beyond this can be found at: http://homepages.inf.ed.ac.uk/s0235246/teaching/lab1.html Beyond that, refer to any of the SQL tutorials on the course home page: http://www.cs.hmc.edu/courses/2004/spring/cs133/ To access the database: psql -h muddcs for example: psql -h muddcs beer keller You will then be prompted for the password. You will have read-only access to the beer database, so you will not be able to create tables or add or delete tuples at this time. For general help: \? To list all commands: \h To list SQL commands beginning with, e.g. SELECT: \h SELECT It is not case-sensitive, so you may also use: \h select To list the tables in the database: \dt To list all tuples in a single table, e.g. 'likes': SELECT * FROM likes; Note that you need to end SQL commands with semi-colon. Here I've chosen to use upper cases for SQL keywords, but this is optional. Similar to commands, relation names are not case sensitive either. However, attribute values ARE case-sensitive. These aren't the same: SELECT * FROM likes WHERE beer = 'Duvel'; SELECT * FROM likes WHERE beer = 'duvel'; Note that single quotes are used for string values. Double quotes don't work. Note that readline works, so you can go back and forth between previous commands, edit them, etc. Quit with \q