Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
1. Getting started:
1. Download the database definition file and take note of the local
directory in which you save the downloaded file (e.g. U:)
2. Start the local PostgreSQL server (Start Menu > All Programs > CMP
Development Tools > PostgreSQL > Start PostgreSQL Database).
Wait until it tells you it is ready to be used. Minimize the window
because you will need it later to shutdown the database safely.
When you have finished using the database, restore this window and
press Enter (as instructed). This will save and shutdown the database.
3. Start a command window
4. Using "cd", move to the directory in which you saved the file
(e.g. cd U:CMPC1M01)
5. Type "psql postgres User". You should get a prompt
"postgres=> ".
Please note the capital U on User. If that does not happen, cry for help
- you won't get anywhere without the PostgreSQL monitor running and
connected to a database!
d) List employee names and the total cost of each employee for a 37 hour
week (use the hourly rate).
g) Display the minimum, maximum and average hourly rate for the
employees.
i) List the title, name and hourly rate of each employee, sorted by title
and within similar titles by name.
k) List the names and hourly rates of all employees with hourly rates over
30 and with titles contain ʻStarʼ.
o) List names, project description and total hours worked for each
employee
(Queries (a) to (l) use only one table. Queries (m) and onwards use more than
one table and you need to specify a 'join' condition to link the tables.)