0% found this document useful (0 votes)
16 views31 pages

IP Project - PARKING MANAGEMENT - 1-HOSUR

IP Project - PARKING MANAGEMENT

Uploaded by

shabharish9380
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)
16 views31 pages

IP Project - PARKING MANAGEMENT - 1-HOSUR

IP Project - PARKING MANAGEMENT

Uploaded by

shabharish9380
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/ 31

Parking Database Management System March 2021

A PROJECT REPORT

ON

PARKING DATABASE MANAGEMENT SYSTEM


FOR

AISSCE 2021 EXAMINATION

As a part of the Informatics Practices Course (065)

SUBMITTED BY:

Name of the Student


1) S SRI RAM
2) S SREENATH
3) PRADEP M
4) KISHORE M S

Under the guidance of

Mr. K. SATISH KUMAR RAJU

PGT in Informatics Practices

DEPARTMENT OF INFORMATICS PRACTICES

SRI CHAITANYA TECHNO SCHOOL


Survey No: 116/2, Dinnur Bus Stop, Denkanikotta Road, Behind HR Super Market, Hosur,
Tamil Nadu – 635109

1
Parking Database Management System March 2021

CERTIFICATE

This is to certify that the Project / Dissertation entitled PARKING DATABASE


MANAGEMENT SYSTEM is a bonafide work done by Mr. ……………………..of class XII in
partial fulfillment of CBSE’s AISSCE Examination 2020-2021 and has been carried out under my direct
supervision and guidance. This report or a similar report on the topic has not been submitted for any other
examination and does not form a part of any other course undergone by the candidate.

Signature of Student Signature of Teacher/Guide


Name: ……………………. Name: K. SATISH KUMAR RAJU
Roll No.: …………………… Designation: PGT in IP

Signature of Principal
Name:
Place: Hosur

Date: ……………..

2
Parking Database Management System March 2021

ACKNOWLEDGEMENT

I would like to thank the institution for giving the opportunity to encase and display our
talent through this project.

I would like to thank my Informatics Practices teacher Mr. K. SATISH KUMAR RAJU
for having the patience to guide me at every step in the project.

I am also grateful to the CBSE BOARD for challenging and giving us this project in
which we all were so engrossed.

I would also like to thank my team, who helped me in getting the right information for
this project.

3
Parking Database Management System March 2021

TABLE OF CONTENTS

S.No Topic Name Page No

1. Abstract 5
2. System requirements 6
3. Python Introduction 7
4. My SQL Introduction 9
5. Database design 10
6. Coding 11
7. Output Screens 26
8. Bibliography 31

4
Parking Database Management System March 2021

ABSTRACT

This is a project on the topic ‘Parking Database Management System’. In this


project we have tried to design an interface for an efficient parking database
management.

By using this software, we can store all details of vehicles in a database using python
interface. Here, we can insert new vehicle details, updating existing vehicle details using
vehicle number, deleting existing vehicle details using vehicle number, creating new
database, creating new table(s). We can also search for specific record of a vehicle using
its vehicle number.

5
Parking Database Management System March 2021

SYSTEM REQUIREMENTS

Hardware Components

1. VGA Monitor

2. Qwerty keyboard

3. 2GB RAM

4. 2.6 GHz Processor

5. Graphics card

Software Components

1. Windows 7

2. Python 3.7 with suitable modules

3. MySQL Command Client

6
Parking Database Management System March 2021

Python Introduction
It is widely used general purpose, high level and Object-Oriented Programming
Language. Developed by Guido van Rossum in February 1991.

It is used for:
Software development, web development (server-side), system scripting,
Mathematics.

Features of Python
1. Easy to use : Due to simple syntax rule

2. Interpreted language : Code execution & interpretation line by line.

3. Cross-platform language : It can run on Windows, Linux, Macintosh


etc. equally

4. Expressive language : Less code to be written as it itself express the


purpose of the code.

5. Completeness : Support wide range of library.

6. Free & Open Source : Can be downloaded freely and source code can be modify
for improvement.

Shortcomings of Python
1. Lesser libraries : as compared to other programming languages like
c++,java,.net
2. Slow language : as it is interpreted languages, it executes the program
slowly.
3. Weak on Type-binding : It will not pin point on use of a single variable for
different data types.

7
Parking Database Management System March 2021

Object Oriented Programming

Object Oriented Programming is an approach that provides a way of modularizing


programs by creating partitioned memory area for both data and functions that can be
used as templates for creating copies of such modules on demand.

Objects and Classes - An object is a software bundle of variables and related methods.
Objects are key to understanding object-oriented technology. Real-world objects share
two characteristics: They all have state and behavior.

Software objects are modeled after real-world objects in that they too have state and
behavior Classes can also define class variables. A class variable contains information
that is shared by all instances of the class. A class can also declare class methods. You
can invoke a class method directly from the class, whereas you must invoke instance
methods on a particular instance.

Abstraction - Hiding the Unnecessary details from the user and providing only the
required details, is called Data Abstraction.

Encapsulation - Wrapping of data and methods into a single unit is known as


encapsulation. It is the most striking feature of class. The data is not accessible to
outside world and only those methods which are wrapped in the class can access it. The
insulation of the data from direct access by the program is called data hiding.

Inheritance - Inheritance is the process by which objects of one class acquire the
property of objects of another class. Each subclass inherits state. However, subclasses
are not limited to the states and behaviors provided to them by their superclass.
Subclasses can add variables and methods to the ones they inherit from the superclass.
It supports the concept of hierarchical classification it also provides the use of
reusability.

Polymorphism - This means the ability to take more than one form. An operation may
exhibit different behaviour in different instances. The behaviour depends upon the
types of data used in the operation. It plays an important role in allowing objects having
different internal structures to share external interface.

8
Parking Database Management System March 2021

MYSQL Introduction

MySQL is currently the most popular open source database software.


It is a multi-user, multithreaded database management system. MySQL is
especially popular on the web. It is one of the most popular LAMP platform
(Linux, Apache, MySQL and PHP) or WAMP platform (Windows, Apache,
MySQL and PHP). MySQL AB was a Swedish software company founded by
Michael Widenius (Monty), David Axmark and Allan Larsson in Sweden in year
1995. It was acquired by Sun Microsystems in 2008.

Features of mysql:

Open Source & Free of Cost:


It is Open Source and available at free of cost.

Portability: Small enough in size to install and run it on any types of


Hardware and OS like Linux, MS Windows or Mac etc.

Security : Its Databases are secured & protected with password.

Connectivity : Various APIs are developed to connect it with many


programming languages.

Query Language : It supports SQL (Structured Query Language) for


handling database.

9
Parking Database Management System March 2021

DATABASE DESIGN

Name of the database of this project: - Parking Management System

Tables created for this project:-

1. ratecard
2. vehtrans

1. ratecard Table

2. vehtrans Table

10
Parking Database Management System March 2021

CODING

import pymysql

import datetime

def db_create():

#conn=pymysql.connect(host='localhost',user='root',password='ma
nager')

#a=conn.cursor()

db_name=input('ENTER DATABASE NAME: ')

acon.execute('create database '+db_name)

print('SUCCESS!!! DATABASE CREATED SUCCESSFULLY!')

return db_name

conn.commit()

def tab_create():

#db_name=input('ENTER DATABASE NAME: ')

11
Parking Database Management System March 2021

#conn=pymysql.connect(host='localhost',user='root',password='ma
nager',db=db_name)

#a=conn.cursor()

ans='YES'

while ans == 'YES' or ans == 'yes' or ans == 'Yes':

ans=input('DO YOU WANT TO DROP TABLE BEFORE


CREATE: ')

if ans == 'YES' or ans == 'yes' or ans == 'Yes':

tab_name=input('ENTER TABLE NAME TO DROP: ')

acon.execute('DROP TABLE '+tab_name)

print("1. Vehicle Movements")

print("2. Rate Card")

tbl=int(input("CHOOSE THE TABLE TO BE CREATED: "))

if tbl == 1:

tab_name=input('ENTER TABLE NAME FOR VEHICLE


MOVEMENT: ')

acon.execute('Create table '+tab_name+'(SNo int NOT NULL


AUTO_INCREMENT, Veh_Type int, Veh_No varchar(10),
Entry_Date date, Entry_Time int, PhNo bigint, Exit_Date date,

12
Parking Database Management System March 2021

Exit_Time int, Park_Time int, Amount decimal(5,2), PRIMARY KEY


(SNo));')

print('SUCCESS!!! TABLE CREATED SUCCESSFULLY!')

elif tbl == 2:

rate_card=input('ENTER TABLE NAME FOR RATE CARD: ')

acon.execute('Create table '+rate_card+'(Veh_Type int,


Min_Time int, Max_Time int, Rate int);')

print('SUCCESS!!! TABLE CREATED SUCCESSFULLY!')

conn.commit()

def rate_card():

print_table("SELECT * FROM " +rate_card)

mint = int(input("ENTER MIN TIME: "))

maxt = int(input("ENTER MAX TIME: "))

rate = int(input("ENTER RATE: "))

sql = "INSERT INTO "+rate_card+" (Min_Time, Max_Time,


Rate) VALUES(" +str(mint)+", "+str(maxt)+", "+str(rate)+");"

print(sql)

acon.execute(sql)

13
Parking Database Management System March 2021

conn.commit()

def search():

r=input('ENTER VEHICLE NUMBER: ')

print_table("Select * from "+tab_name+" Where


Veh_No='"+r+"'")

def print_table(Query):

acon.execute(Query)

dt1=acon.fetchall()

title = [i[0] for i in acon.description]

print('\n')

for col in title:

print(col, end="\t")

print(end='\n')

for i in dt1:

for j in i:

print(j, end="\t")

14
Parking Database Management System March 2021

print()

print('\n')

def cprint(Query,Cnt):

print(Query.center(Cnt))

def lprint(Query,Cnt):

x=' '

print(Cnt*x+Query)

def validate(date_text):

try:

datetime.datetime.strptime(str(date_text), '%Y%m%d')

except ValueError:

raise ValueError("Incorrect data format, should be YYYY-


MM-DD")

15
Parking Database Management System March 2021

a=0

while a != 5:

cprint('PARKING MANAGEMENT',100)

lprint('1. WELCOME',30)

lprint('2. ADMIN',30)

lprint('3. VEHICLE MOVEMENT',30)

lprint('4. REPORTS',30)

lprint('5. LOGOUT',30)

a = int(input('ENTER VALID CHOICE: '))

db_name = 'Parking_Management'

tab_name='VehTrans'

rate_card='RateCard'

conn=pymysql.connect(host='localhost',user='root',password='man
ager', db=db_name)

acon=conn.cursor()

if a == 1:

cprint('WELCOME TO PARKING MANAGEMENT TOOL',100)


16
Parking Database Management System March 2021

a1=int(input('ENTER 1 TO CONTINUE :: '))

if a1 == 1:

continue

if a == 2:

username='parkadmin'

passwd='****'

z1=input('ENTER USERNAME:')

z2=input('ENTER PASSWORD: ')

if z1==username and z2==passwd:

ch1=0

while ch1 != 1:

cprint("ADMIN MENU",30)

lprint("1. HOME",10)

lprint("2. DATABASE CREATION",10)

lprint("3. TABLE CREATION",10)

lprint("4. MAINTAIN RATE CARD",10)

lprint("5. LOGOUT",10)

ch1=int(input('ENTER CHOICE: '))

17
Parking Database Management System March 2021

if ch1==1:

continue

elif ch1==2:

db_create()

elif ch1==3:

tab_create()

elif ch1==4:

print_table("SELECT * FROM " +rate_card)

veh = int(input("VEHICLE TYPE - 2 OR 4 WHEELER: "))

mint = int(input("ENTER MIN TIME: "))

maxt = int(input("ENTER MAX TIME: "))

rate = int(input("ENTER RATE: "))

sql = "INSERT INTO "+rate_card+" (Veh_Type,


Min_Time, Max_Time, Rate) VALUES(" +str(veh)+", "+str(mint)+",
"+str(maxt)+", "+str(rate)+");"

acon.execute(sql)

conn.commit()

elif ch1==5:

break
18
Parking Database Management System March 2021

else:

print("INVALID CHOICE")

if ch1 == 5:

break

else:

print('INVALID USERNAME OR PASSWORD.. RETRY ')

continue

#db_name=input('ENTER DATABASE NAME: ')

#tab_name=input('ENTER TABLE NAME: ')

#conn=pymysql.connect(host='localhost',user='root',password='ma
nager',db='Parking_Management')

#acon=conn.cursor()

elif a == 3:

#db_name=input('ENTER DATABASE NAME:')

#tab_name=input('ENTER TABLE NAME:')

#db_name = 'Parking_Management'

#tab_name='VehTrans'
19
Parking Database Management System March 2021

#rate_card='RateCard'

#conn=pymysql.connect(host='localhost',user='root',password='ma
nager', db=db_name)

#acon=conn.cursor()

a3=0

while a3 != 1:

cprint('VEHICLE MOVEMENT MENU',40)

lprint('1. HOME',10)

lprint('2. PARKING ENTRY',10)

lprint('3. PARKING EXIT',10)

lprint('4. CHECK VACANCY',10)

lprint('5. LOGOUT',10)

a3 = int(input('ENTER VALID CHOICE: '))

if a3==1:

continue

elif a3==2:

a21=int(input('PARKING FOR 2 WHEELER OR 4


WHEELER: '))

20
Parking Database Management System March 2021

a22=input('ENTER VEHICLE NUMBER: ')

a23=int(input('ENTER ENTRY DATE: '))

validate(a23)

a24=int(input('ENTER ENTRY TIME: '))

a25=eval(input('ENTER PHONE NUMBER: '))

acon.execute("INSERT INTO "+tab_name+" (Veh_Type,


Veh_No, Entry_Date, Entry_Time, PhNo) VALUES ("+str(a21)+" ,
'"+a22+ "', "+str(a23)+", "+str(a24)+", "+str(a25)+")")

conn.commit()

elif a3==3:

a31=input('ENTER VEHICLE NUMBER: ')

a32=int(input('ENTER EXIT DATE: '))

validate(a32)

a33=int(input('ENTER EXIT TIME: '))

acon.execute("SELECT * FROM "+tab_name+" WHERE


Veh_No='"+a31+"' AND Exit_Time IS NULL")

tab = acon.fetchall()

for i in tab:

sno = i[0]

21
Parking Database Management System March 2021

veh = i[1]

acon.execute("UPDATE "+tab_name+" SET Exit_Date =


"+str(a32)+", Exit_Time = "+str(a33)+" WHERE SNo = "+str(sno))

conn.commit()

acon.execute("SELECT (((Exit_Date-
Entry_Date)*2400)+(Exit_Time-Entry_Time)) FROM
"+tab_name+" WHERE SNo = "+str(sno))

abc = acon.fetchall()

for i in abc:

calc = i[0]

print("Parking time = "+str(calc))

acon.execute("SELECT RATE FROM "+rate_card+" WHERE


Veh_Type="+str(veh)+" AND Min_Time<"+str(calc)+" AND
Max_Time>"+str(calc))

ghi=acon.fetchall()

for i in ghi:

rt = i[0]

acon.execute("UPDATE "+tab_name+" SET Park_Time =


"+str(calc)+", Amount = "+str(rt)+" WHERE SNo = "+str(sno))

conn.commit()

22
Parking Database Management System March 2021

elif a3==4:

totalspace=300

n = acon.execute("SELECT * FROM "+tab_name+" WHERE


Exit_Date IS NULL")

print('Vehichles in parking lot: '+str(acon.rowcount))

spaceleft=300-acon.rowcount

print("Empty parking space = "+str(spaceleft))

elif a3==5:

break

else:

print("INVALID CHOICE")

if a3==5:

break

elif a == 4:

a4=0

while a4 != 1:

cprint("REPORTS MENU",30)

23
Parking Database Management System March 2021

lprint('1. HOME',10)

lprint('2. AMOUNT COLLECTED',10)

lprint('3. CHECK DETAILS',10)

lprint('4. DISPLAY FULL TABLE',10)

lprint('5. LOGOUT',10)

a4=int(input('ENTER VALID CHOICE: '))

if a4 == 1:

continue

elif a4 == 2:

print_table("SELECT MONTH(Entry_Date) as Month,


Sum(Amount) as Amount from VehTrans Group By
Month(Entry_Date);")

elif a4 == 3:

search()

elif a4 == 4:

print_table('select * from '+tab_name)

elif a4 == 5:

break
24
Parking Database Management System March 2021

else:

print("INVALID CHOICE")

if a4==5:

break

elif a == 5:

break

25
Parking Database Management System March 2021

OUTPUT SCREEN

Screen-1: WELCOME SCREEN

Screen-2: Create option

26
Parking Database Management System March 2021

Screen-3: Database Creation

Screen-4: Table Creation

27
Parking Database Management System March 2021

Screen-5: Vehicle entry data into Table

Screen-6: Display Entire Table

28
Parking Database Management System March 2021

Screen-7: Search(Successful)
1

Screen-8:Reporting Amount Summary

29
Parking Database Management System March 2021

Screen-9 : Vehicle Exit data into Table

Screen-10 : Checking Vacancy

Screen-12:Exit Screen

30
Parking Database Management System March 2021

Bibliography:
www.google.com

www.python.org.

www.geeksforgeeks.org

www.stackoveflow.com

Martin Brown and Martin C Brown, “Python: The Complete Reference”,Mc-Graw-Hill,2001

31

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy