15
ID No :- 113323 B.S.C.S (3rd Semester) Database Management System PROJECT

Vehicle Parking System Project

Embed Size (px)

Citation preview

Page 1: Vehicle Parking System Project

ID No :- 113323B.S.C.S (3rd Semester)

Database Management System

PROJECT

Page 2: Vehicle Parking System Project

Table of Contents

1. Introduction

2. Scope

3. Objective

4. Vehicle Parking system

5. Data Flow Diagrams (DFD)

6. Entity Relationship Diagrams (E-RD)

7. Relational Database model

8. Queries

9. Select Statement (Views)

10.Interfacing in Visual Studio

Page 3: Vehicle Parking System Project

ACKNOWLEDGEMENT

In the beginning, I would like to thank ALMIGHTY ALLAH, the most merciful and beneficent, for giving me the strength to complete my project with full determination.

I would like to thank my teacher Sir Usman Sattar who gave me this opportunity and encouraged me by assigning this project; Without their help and guidance I would have not completed this assignment. I believe in future these efforts will pay off.

Page 4: Vehicle Parking System Project

INTRODUCTION

This project is about “Vehicle Parking system” of any plaza or mall, its a automatic recepit generated software with every essential details.

SCOPE

As we all know that the world is advancing day by day new technologies come and go, many new methods are been introduced almost daily, therefore, the demand of the new systems have been increased in every organization old systems have been replaced by new systems, the question is why? Its because every organization demands excellent quality work more profit to be earned in short span of time, to gain as much market trust as they can, and not to forget as quick they can so they can compete with other organizations. New systems should be

i. User friendly ii. More efficient iii. They should provide securityiv. Fast

As these four are mentioned, my idea will be based upon these.

OBJECTIVE + PROBLEM

As the world is facing many thread’s daily, robbries are done easily with no track to trace, bomb blasts occur with the use of car, so if a proper system is adopted each and every record can be saved and anyone can be track easily therefore mainly is to make a better and fast software, most important user-friendly.

Page 5: Vehicle Parking System Project

Vehicle Parking System

Flow:-

A vehicle is entering the typist type vehicle_type, registration_no, date, time_in (time of vehicle entered). And an auto generated slip_no is given to the specific car; now vehicle is exiting after some sum of amount for which we have different rates, the customer returns us the slip from there we only type the slip_no on the system and all the previous information will pop up with some more which are following time_out (time of vehicle exiting), total_time (calculated from time_in and time_out), total_amount (which is based upon total_time), this is the whole process which is converted into computer language.

Data Flow Diagram (DFD):-

Following is the DFD of the system.

Vehicle_type Rates

Vehicle_info

Parking SystemProcessing

Vehicle Type 1- Car2- Bike

Hourly rates

Finally after the processing the record is saved in Vehicle_info

Page 6: Vehicle Parking System Project

Entity Relationship Diagram (E-RD):-

Following is the E-RD diagram of the system

One vehicle will is either a car or bike, and its calculated amount can be only one amount therefore, Its 1 to 1 relationship between tables.

Vehicle_type

T_idV_type

Rates

R_idR_per_hourR_s

Vehicle_info

Slip_noV_typeRegistration_noDate Time_inTime_outAmount

Page 7: Vehicle Parking System Project

Relational Datamodel:-

Look-up Tables:-

Vehicle_type

Rates

R_id R_per_hour R_s1 0.00 - 1.10 102 0.00 - 2.00 203 0.00 - 3.00 304 0.00 - 4.00 405 0.00 - 5.00 50

Main Table:-

Vehicle_info

Slip_no T_id Registration_no

Date Time_in Time_out

1 1 LEX – 1313 From sys

From sys

From sys

2 1 LZY – 1790 From sys

From sys

From sys

* and so on records will be saved a IF statement will be required to calculate total

amount from time_in & time_out

T_id V_type1 Car2 Bike

Page 8: Vehicle Parking System Project

I prefer the Denormalization concept for my project as i don’t think an normalization is needed for such a project.

Queries:-

Following are the queries from which these tables are created and random data is inserted into it.

Query to create Database

CREATE DATABASE vehicle_parking_project

Query to create table (vehicle_type)

CREATE TABLE vehicle_type(t_id INT IDENTITY NOT NULL PRIMARY KEY,v_type char(5))

Query to insert data into table (vehicle_type)

INSERT INTO vehicle_typeVALUES ('Car')

INSERT INTO vehicle_typeVALUES ('Bike')

Query to create table (rates)

CREATE TABLE rates(r_id INT IDENTITY NOT NULL PRIMARY KEY,r_per_hour char(10),r_s INT )

Page 9: Vehicle Parking System Project

Query to insert data into table (rates)

INSERT INTO ratesVALUES ('0.00-1.10',10)

INSERT INTO ratesVALUES ('0.00-2.00',20)

INSERT INTO ratesVALUES ('0.00-3.00',30)

INSERT INTO ratesVALUES ('0.00-4.00',40)

INSERT INTO ratesVALUES ('0.00-5.00',50)

Query to create main table (Vehicle_info)

CREATE TABLE vehicle_info(slip_no INT IDENTITY NOT NULL PRIMARY KEY,v_type INT NOT NULL FOREIGN KEY REFERENCES vehicle_type (t_id),register_no CHAR(10),date DATETIME NOT NULL DEFAULT GETDATE(),time_in DATETIME NOT NULL DEFAULT GETDATE(),time_out DATETIME DEFAULT GETDATE(),total_amount INT FOREIGN KEY REFERENCES rates (r_id))

Page 10: Vehicle Parking System Project

Query to insert values into table (Vehicle_info)

INSERT INTO vehicle_infoVALUES (1,'LEX 1313',GETDATE(),GETDATE(),NULL,1)

INSERT INTO vehicle_infoVALUES (2,'LEZ 1234',GETDATE(),GETDATE(),NULL,3)

INSERT INTO vehicle_infoVALUES (1,'FDL 4444',GETDATE(),GETDATE(),NULL,1)

INSERT INTO vehicle_infoVALUES (1,'LZ 2323',GETDATE(),GETDATE(),NULL,2)

INSERT INTO vehicle_infoVALUES (2,'LZY 7777',GETDATE(),GETDATE(),NULL,2)

INSERT INTO vehicle_infoVALUES (2,'LXL 1790',GETDATE(),GETDATE(),NULL,1)

INSERT INTO vehicle_infoVALUES (1,'LHM 6993',GETDATE(),GETDATE(),NULL,1)

SELECT:-Following are the select statement queries which includes joins etc, to show the info in desired format.

1. Standard view of table vehicle_typeSELECT * FROM vehicle_type

2. Standard view of table ratesSELECT *FROM rates

3. Standard view of table vehicle_typeSELECT * FROM vehicle_info

4. Vehicle type carSELECT *FROM vehicle_infoWHERE v_type = 1

Page 11: Vehicle Parking System Project

5. Vehicle type bikeSELECT *FROM vehicle_infoWHERE v_type = 2

6. Rates of all vehicle SELECT vehicle_info.register_no,rates.r_sFROM vehicle_infoJOIN ratesON vehicle_info.total_amount = rates.r_id

7. Rate of car LEX 1313 SELECT vehicle_info.register_no,r_sFROM ratesJOIN (vehicle_type JOIN vehicle_infoON vehicle_info.v_type = vehicle_type.t_id)ON rates.r_id = vehicle_info.total_amountWHERE vehicle_info.register_no = 'LEX 1313'

8. Total amount calculated SELECT SUM(r_s)AS Whole_totalFROM ratesJOIN vehicle_infoON vehicle_info.total_amount = rates.r_id

INTERFACING:

Following are the images which of interfacing the project.

*This is optional as interfacing is not of this course.

Page 12: Vehicle Parking System Project

First image shows the home page of the software which through which our software will be operated, like if we want to enter the vehicle we click on vehicle enter and another form will be open.

Second form opens and vehicle entering form is filled with some mannual and some automatic enteries i.e date and time_in

Page 13: Vehicle Parking System Project

This third form is for when vehicle is exiting we just enter the slip no and all information is shown to us after receiving the money we only press save.