|
CSCI A114 / INFO I111
|
You need to develop an example application for a fictitious business that we call Dependable Database Developers (or D3 for short). The business constructs database applications for its customers, billing the customer for the time spent in developing each application. The background of this process can be taken from your textbook (Sengupta & Groth, chapter 6).
Step 0: Here's the entity relationship diagram:
Step 1: Use Access to define a database "Second Practical" that contains the required tables.
The description of the tables should be clear from the data presented at step 2. All tables (with the exception EMPLOYEE) will have their first columns (tableName_id) contain the primary key (auto generated). For EMPLOYEE we use the regular IDs of our technicians at Bavant.Step 2: Add data to the tables.
CUSTOMER table customer_id customer_name customer_address 1 AD57 314 Central, Burton, MI 49611 2 BL72 281 Robin, Burton, MI 49611 3 EL25 462 River, Torino, MI 48268 4 FB96 36 Bayview, Cavela, MI 47926 5 FM22 283 Waterfront, Burton, MI 49611 6 PM34 27 Lake, Masondale, 49832 7 TR72 92 East Bay, Woodview, MI 47212
PROJECT table project_id project_name project_desc customer_id 1 A21 3 1 2 B14 4 1 3 129 1 2 4 146 2 2 5 11A 5 3 6 15A 4 3 7 43B 2 3 8 79 2 4 9 A21 6 5 10 D14 8 5 11 D31 3 5 12 56 8 6 13 88 2 6 14 B11 5 7 15 B15 7 7
EMPLOYEE table employee_id last_name first_name 23 Anderson Trista 36 Nichols Ashton 49 Gomez Teresa
CONTRACT table contract_id project_id employee_id billing_rate 1 1 23 24.00 2 2 23 24.00 3 3 36 21.00 4 4 36 21.00 5 5 49 22.00 6 6 49 22.00 7 7 49 22.00 8 8 23 24.00 9 9 36 21.00 10 10 36 21.00 11 11 36 21.00 12 12 49 22.00 13 13 49 22.00 14 14 36 21.00 15 15 36 21.00
TIMESHEET table timesheet_id contract_id work_date work_hours 1 1 10/1/2000 2 2 5 10/9/2000 2 3 8 10/7/2000 1 4 11 10/3/2000 1 5 13 10/10/2000 2 6 15 10/14/2000 3
Step 3: Write the SQL for the following three queries.
This exercise adapted from Sengupta and Groth chapter 6
A114/I111