CMPT 354 (00-3): Assignment 1

(100 marks)


Submission Requirements


Due time and date: 9:30 on October 11, 2000, Wednesday.

Please hand in your assignment to the instructor.

Part 1: Exercise Assignment (70 points)

1. (20 points) p48. Exercise 2.6 (Chapter 2)
2. (20 points) p84. Exercise 3.8 (Chapter 3)
3. (30 points) Consider the following relational database:

person(pname, street, city)
works_for(pname, cname, salary)
company(cname, city)
manages(pname, manager)
Answer each of the following queries in:
(a) Find the street and city of all employees who work for the Future Shop, live in Burnaby, and earn more than $40,000.
(b) Find the names and the companies they work for, for all the people who have a higher salary than their manager.
(c) Assume that companies may be located in several cities. Find all the companies located in every city in which the Future Shop is located.
(d) For SQL only, find the number of managers who manage more than 5 employees living in Richmond.

Part 2: Program Assignment (30 points, 5 points each)

Please use only SQL query to do all the questions.
Diagram for the DB
Help with the assignment

Preparation:

Open SQL Server. (under cmpt354) and open the Northwind database and you can see the definition and datatype for the five table in that database. get familiar with SQL server.

Problems

Solution to assignment one (question one and two)
Solution to assignment one (question three)
Solution to programming part

Page maintained by: Nancy Liao
Last update: September 23, 2000