This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
CS 352
Database Management Systems Term Project
DESIGN REPORT
Car Rental Database System
GroupID 13Cartal
http://code.google.com/p/cartal/
Murat Nalçakan Utku Can Yücel Dilara Tara Şahintepe
Make a reservation for a specific car in specified dates...................................................11
Show Selected Costumers Details and Past Actions.........................................................13
Confirm a reservation as reserved.....................................................................................14
Add a new branch.............................................................................................................14
Add new car to a branch...................................................................................................15
Sign up for a new customer..............................................................................................16
Delete a car from specific branch.....................................................................................16
List all staff.......................................................................................................................17
Update car price................................................................................................................17
2
1- Revised ER DiagramRevised version of our ER diagram is provided below. It is logical to overview the relations before reaching detailed descriptions of the relations.
Figure 1 Revised ER Diagram
3
2- FDs , Normalization of Tables and RelationsADDRESS(
addressid INTEGER DEFAULT 0 NOT NULLzipcode INTEGER DEFAULT 0 NOT NULLcity CHAR(10) NOT NULLdetailedaddress VARCHAR(50) NOT NULLphoneno INTEGERPRIMARY KEY(addressid))
Functional Dependencies: noCandidate Key: (addressid)Normal Form 3NF
PERSON(TCidno INTEGER NOT NULLname CHAR(20) NOT NULLage INTEGER NOT NULLPRIMARYKEY TCidnoFOREIGN KEY (addressid) REFERENCES ADDRESS (addressid))
Functional Dependencies: TCidno TCidno addressidCandidate Key: TCidnoNormal Form : 3NF
There will be two types of users in our system. We will only allow Customers and Branch Staffs to use system.
Figure 2 Use Case Diagram
10
3.2 Algorithms
There will be two different algorithms which will be used for update information of discount amount and next service date.
Since this algorithm needs input from the previous servicecheck our database will initially select the previous service check of the auto.nextservicecheckdate = previousservicedate + regularcheckperiod
4- Graphical user interface and corresponding queries
SELECT A.modelname A.modelyear A.brandname A.color A.carfareFROM AUTO A BRANCH B BOOKING BOOWHERE A.branch_id = ‘branch_id’ AND A.brandname = car_brand AND A.modelname = ‘car_model’ NOT EXIST (SELECT *
FROM BOOKING B2 AUTO A2WHERE B2.autoid = A2.autoid )
Make a reservation for a specific car in specified dates
User is allowed to make reservation for a car in a time period. However, user can not be able to make payment online. Only salesman can accept and confirm a payment.
Previous screen sample can only show the possible cars with their daily fares. In order to complete the reservation user should decide the drop off place and then the table will be updated.
12
when customer fulfills a payment, the table will be updated by the salesman
inputs: $payment_type, $payment_amount
UPDATE PAYMENTSET payment_type = $payment_type AND remaining_amount =remaining_amount – payment_amount
13
WHERE payment_id = $payment_id
Show Selected Costumers Details and Past Actions
SELECT Booking.booking_no P.payment_status P.remaining_amount A.modelname A.modelyear FROM BOOKING Booking PAYMENT P AUTO AWHERE Booking.customerid = $customer_id AND P.paymentno = Booking.paymentno AND Booking.auto_id = A.autoid
Confirm a reservation as reserved
UPDATE BOOKING BSET B.reservationstatus = “rsrvd”
confirm the payment of a reservation
UPDATE BOOKING BSET B.reservationstatus = “paid”
Add a new branch Inputs: ( $branchid, $branchname, $addressid, $detailedaddress, $phoneno)
INSERT
14
INTO ADDRESS(addressid, detailedaddress)VALUES(‘detailedaddress’, ’addressid’, ’phoneno’)
INSERT INTO BRANCH (branchid,branchname, addressid)VALUES(‘branchid’, ‘branchname’, ‘addressid’)
Add new car to a branchInputs: (‘autoid’, ‘brandname’,’modelyear’, ‘modelname’, ‘autocolor’,’lastbookingno’)
INSERT INTO AUTO (autoid, brandname,modelyear, modelname, autocolor,lastbookingno)VALUES (‘autoid’, ‘brandname’,’modelyear’, ‘modelname’, ‘autocolor’,’lastbookingno’)$autoid = Last index of Autoid
15
Sign up for a new customer
inputs ($name, $age, $address, $TCid, $address, $city, $detailedaddress, $zipcode, $phoneno)variables $customerid : Last index of customerid
Finally we will have a simple login screen which separates the users. According to the given credentials, system will differentiate the customers from branch staffs.