|Subject||CN5000/CD5000: Database Systems|
Vehicle Sale and Rental Database Design and Implementation
Vehicle Mart is a vehicle sale and rental agency, which sells and lets vehicle of various customers to customers(C2C). The head office (HO) of Vehicle Mart is in London but looking to expand across the UK. The agency is using basic database system to maintain their data, but due to technological advancements and lack of capturing the market. In addition to London, they recently opened two new branches in Manchester (MB) and Birmingham (BB). Assume they hire you as a technical consultant for replacing the old-fashioned file system with new database system.
The agency deals with the following Types: Sedan, Coupe, Crossover, Hatchback, Pickup, Van and SUV. They cover the following Cities: London, Manchester, Bolton, Liverpool, Leicester and Birmingham. The price of each vehicle is maintained as current price where a time/date object is associated with each change. We assume there is one change of price every fortnight.
In each branch, the agency has a receptionist, who is responsible for guiding the customers and booking their timeslot for either Purchasing or Leasing the Vehicle. The customers can book their timeslots either online/phone or in-person. The agency intends to use online system where customers can reserve vehicles online, but the process will need to be completed in-person through an agent. You are required to design Use Case and ERD, and then, implement the system using SQL.
The agency has couple of Agents, who assists customers in their queries and transactions. The system will have the Agent details where each Agent has different levels of dealer namely bronze, silver and gold. There are total of twelve Agents where two are assigned in each city and required to enter their login details in order to gain access to the system.
The Agent’s level is determined based on the number of bookings, where if an Agent have, equal or more than, 10 bookings, it is categorised as Gold, more than 4, but less then, 10 as Silver, and Bronze otherwise. These Agents give a quote with recommendations to customers to buy or rent; where customers have right to accept/reject them.
The agency has security protocols, such as antivirus and firewall, which are handled by an IT practitioner. There is a technical consultant, who deals with prediction modelling, and they will develop a prediction system in future.
Each branch has a CTO who keeps an eye over the total vehicles sold/rented and loss/gain. Customer cannot directly interact with CTO, the company CEO, resides in London office (HO) and manages the overall profit of the agency.Queries:
1. Show current price of Sedan in all the Cities.
2. Show largest of price value from all models associated to London and Manchester.
3. Show minimum price for London vehicles (from all models).
4. Find Agent who has maximum number of timeslots.
5. Find customer which booked the maximum number of timeslots.
6. Show all models having price higher than average for model in Birmingham.
7. Update the price for all models, for London and Manchester, for today, assuming they want to give offer of 80 GBP per vehicle.
8. Show the maximum price sold from all Gold and Bronze Agents, for all models.
9. Trigger: Create a trigger that places the customers, which have been deleted into a customer table. This allows records to be maintained while improving query times for existing customers.