13
IST 210 Team H Ford Dealerships Online Management System

IST 210 Team H Ford Dealerships Online Management System

Embed Size (px)

DESCRIPTION

 

Citation preview

Page 1: IST 210 Team H Ford Dealerships Online Management System

IST 210Team H

Ford Dealerships Online Management System

Page 2: IST 210 Team H Ford Dealerships Online Management System

Description

• Tracks transactions

• Dealership employees

• Cars in stock

• Dealership Locations

• Customers

Page 3: IST 210 Team H Ford Dealerships Online Management System

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

Page 4: IST 210 Team H Ford Dealerships Online Management System

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

Page 5: IST 210 Team H Ford Dealerships Online Management System

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

Page 6: IST 210 Team H Ford Dealerships Online Management System

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

Page 7: IST 210 Team H Ford Dealerships Online Management System

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

Page 8: IST 210 Team H Ford Dealerships Online Management System

Relational Schema (before Optimization)

Page 9: IST 210 Team H Ford Dealerships Online Management System

Relational Schema (after Optimization)

Page 10: IST 210 Team H Ford Dealerships Online Management System

Scenario

The CEO of Ford wants to move the best salesman to the worst dealership to improve sales.

Page 11: IST 210 Team H Ford Dealerships Online Management System

Step 1

• Find the salesman with the highest profit, where profit is equal to the selling price – MSRP.

Page 12: IST 210 Team H Ford Dealerships Online Management System

Step 2

• Find the dealership with the lowest overall profit, where profit equals selling price – MSRP.

Page 13: IST 210 Team H Ford Dealerships Online Management System

Step 3

• Move the salesman with the highest profit to the dealership with the lowest profit.

• (Update the salesman’s dealership ID.)