NOTE: This is a "Pass/Fail" assignment. You will not receive any points on it, but you have to pass it in order to stay in the course. Read "REQUIREMENTS" carefully!!
The assignment is quite free-form. The purpose is to familiarize yourselves with PostgreSQL and try some simple SQL. Specially, you will design a tiny database for a grocery store, "Little Eagle". The manager wants to keep records for: customers, merchandise, and transactions and allow people to ask queries about the transactions. The example queries might be to find all the products brought by a particular customer, or to find all customers who brought milk, etc.
The design is up to you. The principle here is keeping things simple.
Here is a rough example design to give you a clearer idea about what we expect
from you (you can use this design in your homework):
Customers | (C_ID int, C_Name Char(40), C_Addr Char(50)) |
Products | (P_ID int, P_Name Char(40), P_Stack int) |
Transactions | (T_ID int, T_CID int, T_PID int, T_Amount int) |
You need to populate the tables (10 records per table would be enough to show the idea), and ask queries on them.
You should at least define 2 tables, with some data in them. Then, you write at least 2 queries (no more than 5 queries) to go along with your tables. Your queries should return some data.
script
" command.script hw0.script
" at a shell
prompt;psql
dbname
" to
start psql (replace dbname
with your own database name);select * from
tablename
;
" so we
can see the content of the tables.\q
or control-d
;exit
" to end the script program. It
should tell you "Script done, file is hw0.script".cat hw0.script
" to see the script.PASSING CRITERION: The script shows at least 2 tables and 2 queries.
Send all your questions to the course newsgroup, academic.cs.15-415. All questions sent to TAs will be posted to the newsgroup.