0% found this document useful (0 votes)
9 views21 pages

Project Report

The document describes the design and implementation of a database for a smart parking system. It includes conceptual and logical database designs with entity relationship diagrams and attribute details. It also describes the user interface and functions for parking and retrieving vehicles as well as displaying user information.

Uploaded by

dacbinh25
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views21 pages

Project Report

The document describes the design and implementation of a database for a smart parking system. It includes conceptual and logical database designs with entity relationship diagrams and attribute details. It also describes the user interface and functions for parking and retrieving vehicles as well as displaying user information.

Uploaded by

dacbinh25
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 21

Group #: 4

Group Member: Eric Li, Toby Zhu, Gloria Zhang

Phase 3: Database Implementation and Testing


1. Problem Statement 1

2. Conceptual Database Design 2

3. Logical Database Design 3

4. Application Program Design 8

5. User Manual 12
Parking Lot Interface 12
Park a vehicle 13
Check out a vehicle 16
User Interface 18
Display all relevant information about a user 18
Future Implementation 19

1. Problem Statement
Parking is an integral component of human lives, and how to park efficiently and conveniently has become a huge societal problem to
solve. There have been long-lasting complaints about the cumbersome procedure one has to go through to park somewhere. An intelligent
database system can reduce this complication. Imagine if you may park in any parking lot without the manual burden of grabbing a ticket
and paying every time. The smart parking system that we plan to design is exactly what you will need. The application allows users to see
the available spaces in all parking lots, park and check out their vehicles via a simple click, and pay for each parking session automatically.
In this app, a database system will store the user and vehicle information, as well as the up-to-date status of all parking lots and parking
spaces. Moreover, it will also save the user’s parking and payment history for administrative and tracing purposes.

1
2. Conceptual Database Design

Assumptions:
1. The vehicle owner must have a driving license in order to park in the lot.
2. A vehicle can only be registered with and parked in one parking space at a time.
3. A vehicle can only be registered under one owner.
4. Vehicles can only be truck or standard; there are only parking spaces for trucks and standard vehicles.
5. Parking lots and parking spaces can be empty.

2
3. Logical Database Design

- Relation Mapping:

3
- Attribute Metadata: All attributes below in all tables maintain the domain constraint.
Owner
Attribute Description Data Type Integrity Constraint

Driver_license_num The drivers license number of the Variable length string Key constraint
vehicle owner. Entity integrity constraint

Lname The last name of the vehicle owner. Variable length string NOT_NULL constraint

Minit The middle initial of the vehicle owner. 1 character

Fname The first name of the vehicle owner. Variable length string NOT_NULL constraint

Date_of_birth The date of birth of the vehicle owner. Variable length string NOT_NULL constraint

Owner_Phone
Attribute Description Data Type Integrity Constraint

Phone_num The phone number of the vehicle owner. Integer Key constraint
Entity integrity constraint

Driver_license_num The driving license number of the vehicle Variable length string Key constraint
owner. Entity integrity constraint
Referential integrity constraint

Parking_Lot
Attribute Description Data Type Integrity Constraint

LID The parking lot ID that uniquely identifies Variable length string Key constraint
each parking lot. Entity integrity constraint

Address The address of a parking lot. Variable length string NOT_NULL constraint

Total_space The total number of spaces in a parking lot. Integer NOT_NULL constraint

4
Parking_Space
Attribute Description Data Type Integrity Constraint

LID The parking lot ID that uniquely identifies each Variable length Key constraint
parking lot. string Entity integrity constraint
Referential integrity constraint

Space_no The space number that uniquely identifies each Integer Key constraint
parking space within a parking lot. Entity integrity constraint

Type The type of vehicle - standard or truck. Variable length NOT_NULL constraint
string Domain constraint: “Standard”,
“Truck”

Is_occupied Indicate whether the space is occupied by a truck. Boolean NOT_NULL constraint

Hourly_price The price to park an hour in this parking space ($). Integer NOT_NULL constraint

Height The height of this parking space (ft). Integer

Vehicle
Attribute Description Data Type Integrity Constraint

Plate The plate number of a vehicle. Variable length string Key constraint
Entity integrity constraint

Type The type of a vehicle - standard or truck. Variable length string NOT_NULL constraint
Domain constraint: “Standard”,
“Truck”

Standard_type The type of a standard vehicle - compact or Variable length string Domain constraint: “Compact”,
noncompact. “Noncompact”

Height The height of a truck. Integer

5
Payment
Attribute Description Data Type Integrity Constraint

Driver_license_num The driving license number of the vehicle owner. Variable Key constraint
length string Entity integrity constraint
Referential integrity constraint

LID The parking lot ID that uniquely identifies each Variable Key constraint
parking lot. length string Entity integrity constraint
Referential integrity constraint

Amount The amount of a payment. Integer NOT_NULL constraint

Check_in_datetime The datetime when the vehicle started parking. DateTime

Check_out_datetime The datetime when the vehicle left the parking lot. DateTime

Vehicle_Owning
Attribute Description Data Type Integrity Constraint

Driver_license_num The driving license number of the Variable length string Key constraint
vehicle owner. Entity integrity constraint
Referential integrity constraint

Plate The plate number of a vehicle. Variable length string Key constraint
Entity integrity constraint
Referential integrity constraint

6
Vehicle_Parking
Attribute Description Data Type Integrity Constraint

Plate The plate number of a vehicle. Variable length Key constraint


string Entity integrity constraint
Referential integrity constraint

LID The parking lot ID that uniquely identifies each Variable length Key constraint
parking lot. string Entity integrity constraint
Referential integrity constraint

Space_no The space number that uniquely identifies each Integer Key constraint
parking space within a parking lot. Entity integrity constraint
Referential integrity constraint

Check_in_datetime The datetime when the vehicle started parking. DateTime

7
4. Application Program Design

1. Get_all_lots
Description: This function displays all parking lot ids.
Steps: Retrieve and return “LID” attribute of all records from table “Parking_Lot.”

2. List_space
Description: This function displays space information given the specific parking lot.
Input: parking lot id (LID)
Steps: Retrieve and return “Space_no,” “Type”, “Is_occupied” attributes of all records from table “Parking_Space” with the given
parking lot id (LID).

3. Compute_idle
Description: This function computes the number of unoccupied parking spaces given the specific parking lot.
Input: parking lot id (LID)
Steps:
a. Count the number of records in table “Parking_Space” with the given parking lot id (LID) and not occupied.

4. Check_owner
Description: This function checks if a specific owner exists in the database.
Input: License_number
Steps: Retrieve and return “Drivers_license_num,” “Lname,” “Minit,” “Fname,” “Date_of_birth” attributes of all records from the
table “Owner” with License_num.

5. Check_vehicle
Description: This function checks if a specific vehicle exists in the database.
Input: Plate number
Steps: Retrieve and return all records from the table “Vehicle” with the given plate number (Plate).

6. Check_parking
Description: This function checks if a specific vehicle is parked somewhere.
8
Input: Plate number
Steps: Retrieve and return all records from the table “Vehicle_Parking” with the given plate number.

7. Check_parking_vehicle
Description: This function returns the parked vehicle plate number and the check-in time given a specific occupied parking space.
Input: parking lot id (LID), Space_no
Steps: Retrieve and return “Plate,” “Check_in_date” attributes of all records from the table “Vehicle_Parking” with the given LID
and Spac_no.

8. Register_owner
Description: This function inserts information of a vehicle owner into the database.
Input: License number, first name, last name, middle initial, phone number, date of birth
Steps:
a. Insert the tuple Ti = <License number, last name, middle initial, first name, date of birth> into the table “Owner”.
b. Insert the tuple Ti = <License number, phone number> into the table “Owner_Phone”.

9. Register_vehicle
Description: This function inserts information of a vehicle into the database.
Input: Plate number, vehicle type, height
Steps: Insert the tuple Ti = <Plate number, vehicle height, height=NULL> into the table “Vehicle”.

10. Get_owner
Description: This function returns the drivers’ license number of a given vehicle
Input: Plate number
Steps: Retrieve and return “Drivers_license_number” attribute of all records from table “Vehicle_Owning” with the given plate
number.

11. Park
Description: The function updates the space status for the selected unoccupied parking space and parks the vehicle.
Input: Parking lot id (LID), parking space number, vehicle plate number

9
Precondition: The input owner exists in the database (guaranteed through Check_owner and Register_owner). The input vehicle
exists in the database (guaranteed through Check_vehicle and Register_vehicle). The vehicle is unparked (guaranteed through
Check_parking).
Steps:
a. Reserve the selected space in the corresponding parking space table by updating the Is-occupied attribute to true.
b. Record the parking time and create the parking record = <LID, Plate, Check_in_date, Space_no>.
c. Insert the parking record into the “Vehicle_Parking” table.

12. Get_price
Description: The function returns the hourly price of a specific parking space
Input: Parking lot id (LID), parking space number
Steps:
a. Retrieve and return “Hourly_price” attribute of all records from table “Parking_space” with the LID and parking space
number.

13. Check_out
Description: This function computes the parking price given an occupied parking space, inserts payment information into the
database, updates the parking space status, and deletes the corresponding parking tuple.
Input: Parking lot id (LID), parking space number, plate number, check in time, payment amount
Precondition: Payment amount is already calculated using Get_price. Vehicle plate number and check in time are retrieved through
Check_parking_vehicle. Vehicle owner’s diverse license number is retrieved using Get_owner.
Steps:
a. Insert the payment record <Drivers_license_num, LID, Check_in_date, Check_out_date, Amount>into the “Payment” table.
b. Updating the Is-occupied attribute of the parking space to false.
c. Delete the parking record from the “Vehicle_Parking” table given LID, space_no, and plate.

14. List_owner_detail
Description: The function displays owner and vehicle information for all owners whose drivers license number is similar to the
user's input.
Input: Drivers license number
Steps:
a. (Left) Join the “Owner” table with the “Owner_Phone” table with the same License number.
10
b. (Left) Join the resulting table from above with the “Vehicle_Owning” table with the same License number.
c. (Left) Join the resulting table from above with the “Vehicle” table with the same Plate number.
d. Left) Join the resulting table from above with the “Vehicle_Parking” table with the same Plate number. Rename the new
table as “Owner_Detail”.
e. Retrieve and display all tuples from “Owner_Detail” whose Driver's license number is LIKE the user’s input.

15. List_payment_history
Description: The function lists all payment information of the given owner.
Input: License number
Steps: Retrieve and display all tuples with License number from table “Payment”.

11
5. User Manual

Parking Lot Interface


Park a vehicle
Check out a vehicle
User Interface
Display all relevant information about a user
Future Implementation

Github Repository: https://github.com/zxllxz2/smart-parking-system

Parking Lot Interface

12
- The function get_all_lots retrieves all parking lot information.

-
- Select any parking lot. The function list_space will list all parking spaces in this parking lot, and the function compute_idle will show the
number of unoccupied spaces in this lot.

13
Park a vehicle
- Click the “parking” button to start parking the vehicle. The pop-up window will prompt for the user information.

-
- According to the given information, the function check_owner will check the existence of this vehicle in the database. If the user does not
exist in the database, the function register_owner will insert the new user information into the database. Otherwise, the system will
display the information retrieved via the function check_owner.

-
- After the user’s confirmation, the system will prompt for vehicle information. If the input vehicle is a truck, the system will further ask for
its height information.

14
-
- The system will then call the function check_vehicle to check the existence of this vehicle in the database. If not found, the system will
register the vehicle via calling the function register_vehicle. Otherwise, the function check_parking will check if the vehicle has already
parked in any parking lots. If the vehicle is found to be parked somewhere, the system will display the parking information returned by
check_parking. Otherwise, the system will generate a review for the parking information.

-
- After confirming the parking action, the system will call the function park to park the car. It will update the parking space occupying
status and insert the parking record into the database. The system will also call the function compute_idle to update the occupancy status
of this parking lot.

15
-

16
Check out a vehicle
- Click the “checkout” button of the target parking space. The system will call the function check_parking_vehicle to get the plate and
check-in time of the vehicle parking at this space, call the function get_owner to get the owner information of the parked vehicle, and call
the function get_price to get the pricing information of this parking space. A receipt will be generated for the user.

-
- After computing the amount of payment according to parking time and space price, the system will display the amount and ask for
payment information. The session will stay for 5 minutes at most and will automatically close after 5 minutes.

17
- After confirmation of payment, the system will call the function check_out to insert the payment record into the database, update the
occupying status of this parking space, and delete the parking record. The system will also call the function compute_idle to update the
occupancy status of this parking lot.

18
User Interface

19
Display all relevant information about a user
- Once the user types a string into the search box and presses “Enter,” the program calls function list_owner_detail to retrieve and display
all attributes relevant to all users whose driver’s license number matches or is similar to the user’s search input. For example, if the user
enters “1,” the following records will be displayed.

20
Future Implementation
- The list_payments backend functions, queries, and servlet are fully implemented. Once the front-end is completed, we can extend
the list_payment function to our graphical user interface.

21

You might also like