IST 210 Team H Ford Dealerships Online Management System
-
Upload
fordlovers -
Category
Documents
-
view
897 -
download
0
description
Transcript of IST 210 Team H Ford Dealerships Online Management System
IST 210Team H
Ford Dealerships Online Management System
Description
• Tracks transactions
• Dealership employees
• Cars in stock
• Dealership Locations
• Customers
Original ER Diagram
Dealership ID
Seller ID
Year
Price
Model
Make
*VIN
Car
Dealership ID
Seller ID
Year
Price
Model
Make
*VIN
Car
Car VIN
Credit Score
Address
Name
*ID
Buyer
Car VIN
Credit Score
Address
Name
*ID
Buyer
Dealership ID
Address
Name
*ID
Salesman
Dealership ID
Address
Name
*ID
Salesman
Car VIN
Price
Dealership ID
Salesman ID
Buyer ID
*ID
Transaction
Car VIN
Price
Dealership ID
Salesman ID
Buyer ID
*ID
Transaction
Contact Person
Phone
Address
Name
*ID
Dealership
Contact Person
Phone
Address
Name
*ID
Dealership
Sells
Works At
Buys
Involved In
Modified ER Diagram
MSRP
Year
New/Used
Model
Make
*VIN
Car
MSRP
Year
New/Used
Model
Make
*VIN
CarCredit Score
Address
Name
*ID
Buyer
Credit Score
Address
Name
*ID
Buyer
Commission
Address
Name
*ID
Salesman
Commission
Address
Name
*ID
Salesman
Contact Person
Phone
Address
Name
*ID
Dealership
Contact Person
Phone
Address
Name
*ID
Dealership
Sells
Works At
Belongs To
Works For
Selling Price
Assumptions for ER Diagram (pt. 1)
• A buyer can buy one to many cars• A buyer must buy from a salesman
• A salesman sells one to many cars• A salesman works at one dealership• A salesman must sell to a buyer• A salesman can have zero to many subordinates• A salesman can be managed by zero to many managers
MSRP
Year
New/Used
Model
Make
*VIN
Car
MSRP
Year
New/Used
Model
Make
*VIN
CarCredit Score
Address
Name
*ID
Buyer
Credit Score
Address
Name
*ID
Buyer
Commission
Address
Name
*ID
Salesman
Commission
Address
Name
*ID
Salesman
Contact Person
Phone
Address
Name
*ID
Dealership
Contact Person
Phone
Address
Name
*ID
Dealership
Sells
Works At
Belongs To
Works For
Selling Price
Assumptions for ER Diagram (pt. 2)• A dealership employs one to many salesmen• A dealership sells one to many cars
• A car is bought by one buyer• A car is sold by one salesman• A car is located at one dealership• A record is kept of the amount the car is sold for
MSRP
Year
New/Used
Model
Make
*VIN
Car
MSRP
Year
New/Used
Model
Make
*VIN
CarCredit Score
Address
Name
*ID
Buyer
Credit Score
Address
Name
*ID
Buyer
Commission
Address
Name
*ID
Salesman
Commission
Address
Name
*ID
Salesman
Contact Person
Phone
Address
Name
*ID
Dealership
Contact Person
Phone
Address
Name
*ID
Dealership
Sells
Works At
Belongs To
Works For
Selling Price
Queries• Retrieve all cars sold by salesman x• How many model cars were sold at dealership x over price x• Retrieve all cars which were at the dealership before date• Retrieve all buyers which live in the same town as dealership x • How many cars under price are at dealership x• Where can one find a model car under price• Retrieve all people with credit score x and cars over price x• how many cars are older then date x• Find the average selling price from all salesmen at each
dealership• Retrieve all transactions under price x from car x
Relational Schema (before Optimization)
Relational Schema (after Optimization)
Scenario
The CEO of Ford wants to move the best salesman to the worst dealership to improve sales.
Step 1
• Find the salesman with the highest profit, where profit is equal to the selling price – MSRP.
Step 2
• Find the dealership with the lowest overall profit, where profit equals selling price – MSRP.
Step 3
• Move the salesman with the highest profit to the dealership with the lowest profit.
• (Update the salesman’s dealership ID.)