Reference no: EM133531927
Homework: Database Design Project
Details:
You will design and implement a database that support a firm involved in various activities. It must have stored functions and procedures. The database can be accessed by a specific user with suitable security and authentication facilities.
Learning Outcome
1. Model, design and implement complex database structures (including databases distributed over a network) using a relational database management system (RDBMS)
2. Apply advanced SQL programming (often as a stored procedure) to fulfill complex data/information retrievals from an RDBMS
3. Develop and apply scripts and configure web server software as part of a Web database
4. Examine how modern RDBMSs manage multiple concurrent user access to a database as well as how these RDBMSs manage online or real-time backup and recovery processes
Homework Requirements
You have started a small consulting services business in developing databases.
WIN Car rental services is a small business in Sydney. As the name suggests they are in the business of car rentals. They approached you to develop a database for their business. Till date they are using an excel file to manage their business. The excel file is attached with this homework document. Have a look at it before you start working on the homework.
The entities required for the database are as follows:
1) Customer: customerId, lastName, firstName, address, postcode, state, phone, memberDate.
2) Insurance: insuranceId, insuranceType, price
3) Vehicle:rego, description, make, model, carYear, value, engineCapacity, odometer, purchaseDate, vehicleTypeId.
4) Rental: rentalId, bookingDate, bookingMethod, checkout, rentDays, checkin, dueDate, odometerIn, damage, paymentId, rego, customerId, insuranceId.
5) VehicleType: VehicleTypeID, VehicleType, Charge.
6) RentalCharge: RentalID, Rent.
7) PayType: Payment_ID, Pay_Type.
Along with the database files you were asked to submit other documentation as listed below:
Task A:
I. ER Diagram in Crows Foot Notation. (Draw using Draw.io)
1. Primary keys and foreign keys must be identified.
2. All attributes must be identified.
3. All relationships (both directions) must be clearly listed.
II. Data dictionary (create in Excel)
III. Any other required information.
Task B:
The following SQL files must be submitted.
I. SQL Statements to create the database and insert at least 5 records in every table.
1. Create a database called "winCarRentals" that has all the above listed tables.
2. Insert all the data shown in the excel file.
3. Create a minimum of 5 customers. You four people and me.
4. Create at least 3 rentals.
II. SQL statements to incorporate functions and triggers in the database.
1. When data is inserted in the customer table, CustomerMemberDatemustbebeforeorequaltothecurrentdate.
2. When data is inserted in the vehicle table, Vehicle's PurchaseDate, must be before or equal to the current date.
3. When data is inserted in the rental table, rental booking date, checkoutdate must be after or equal to the current date.
4. When a vehicle is checked in (the check-in filed is set to null when the record is created, when the vehicle is returned, check in date is set to the returned date), the rental must be calculated and stored in the rental charge table.
III. SQL statements to run a number of report queries.
1. Write a query to print the list of customers who did not rent a vehicle.
2. Write a query to display the cars that are currently on rent.