CSE 2111 In Class Exercise 4

advertisement
Database Name: ABC Employees
The tables below represent the database system for the ABC Consulting Company. The employee table lists
information about each employee in the company. The Compensation Type table is a list of the different
types of compensation an employee can receive, meaning the company will pay the employee for engaging
in the activity. The Deduction Type table lists the different items that can be deducted from the employee’s
paycheck. The Addtl Compensation and Addtl Deduction Table contain a list of each type of compensation
and deduction an employee has elected.
Employee
Emp
Num
12667
13091
14993
17738
18760
18839
First Name
John
Willie
Charlie
Brutus
Harey
Sponge Bob
Last Name
Brown
Nelson
Brown
Buckeye
Carey
Square Pants
Address
647 Main St
PO Box 555
PO Box 444
PO Box 029
PO Box 409
128 University Dr
City
Lancaster
Lancaster
Newark
Columbus
Newark
Hebron
State
OH
OH
OH
OH
OH
OH
Zipcode
43130
43130
43055
43228
43055
43025
Benefits
Eligible
FALSE
TRUE
TRUE
FALSE
TRUE
FALSE
Hourly
Wages
$15.00
$35.00
$15.00
$22.00
$27.00
$10.00
Compensation Type
Deduction Type
Compensation
Description
Amount
Type
A
Wellness Program
$10.00
B
Educational Program $25.00
C
Mentoring Program $15.00
Deduction Type Description Amount
A
Premium Health $55.00
B
Basic Health
$20.00
C
Dental
$5.00
D
Vision
$5.00
E
Gym
$3.00
Addtl Compensation
Emp Num
14993
14993
17738
17738
17738
16632
18839
18839
Compensation Type
A
C
A
B
C
D
B
C
Addtl Deduction
Emp Num
13091
13091
13091
13091
17738
17738
17738
17738
18839
18839
18839
Deduction Type
A
C
D
E
B
C
D
E
B
G
E
Hire Date
8 /22/2001
7 /11/2010
8 /19/1999
5 /1 /1980
6 /7 /1995
3 /6 /2009
In Class Exercise 4
Directions
1. Create a relationship diagram for the Employees database
a. Identify the primary keys and foreign keys
b. Establish the relationships between each table
2|Page
In Class Exercise 4
2. Has referential data integrity been violated between any of the tables? If so, name the table and the orphan.
Has referential data integrity been violated between the
Employee table and the Addtl Compensation table?
Has referential data integrity been violated between the
Addtl Compensation table and the Compensation Type table?
Has referential data integrity been violated between the
Employee table and the Addtl Deductions table?
Has referential data integrity been violated between the
Addtl Deductions table and the Deduction Type table?
STOP HERE. WE WILL GO OVER THE ANSWER BEFORE YOU CONTINUE TO THE NEXT PART.
3|Page
In Class Exercise 4
Database Name: Condo Management
You are the manager of several condos. These condos are owned by various real estate investors. It is your job to set
up the rentals for these condos, charge the renters who stay in them, and forward this money to the owner. You
manage the rentals using an Access database named Condo Management.accdb. The database consists of the
following tables:

Condo. This table contains information on the various rental properties you manage. Included is the number of
bedrooms, # bathrooms, and the number of occupants this property can sleep, whether or not this property has a
powder room and/or included linens. Also included is the weekly rate for this property, the owner of the property,
the appraised value of the property, and whether or not the condo is currently for sale by the owner.

Owner. This table lists the names and contact information of the rental property owners.

Renters. This table is a list of all people (names, addresses etc.) who have inquired about renting any of the units
you manage. Some may have stayed one or more times in one of your properties, and some were just looking for
information.

RenterLog. This table is a record of actual rental contracts including renter#, unit# and duration of stay (in weeks).
Each rental transaction is represented by a unique Log#. Many of your renters are listed more than once since
they have stayed in one or more rental properties multiple times. In this case, each stay would have its own Log#.

Payments. This is a list of all payments made to you by Renters. You try to be as flexible as possible in your
payment schedule. You allow renters to pay in many smaller payments or in one lump sum for their rentals. Some
clients also like to pay ahead for future rentals, so you allow this as well. The table includes Renter#, Date of
Payment and Amount of Payment.
4|Page
In Class Exercise 4
5|Page
In Class Exercise 4
1. Create a relationship diagram for the Condo Management database.
a. Identify the primary keys and foreign keys
b. Establish the relationships between each table
6|Page
In Class Exercise 4
2. Has referential data integrity been violated between any of the tables? If so, name the table and the orphan.
Has referential data integrity been violated between the Owner
table and the Condo table?
Has referential data integrity been violated between the
Condo table and the RenterLog table?
Has referential data integrity been violated between the
RenterLog table and the Renters table?
Has referential data integrity been violated between the
Renters table and the Payments table?
7|Page
Download