You are on page 1of 54

COMPUTER

SCIENCE

MOVIE TICKET BOOKING SYSTEM MANAGEMENT


PROJECT REPORT

SUBMITTED BY:
DIYA RAKESH GUNANI
(XII SCIENCE)
APPASAHEB BIRNALE PUBLIC SCHOOL,
SENIOR SECONDARY
(AFFILIATED TO CBSE, NEW DELHI,NO:1130074)
Shinde Mala Sangli ,Maharastra

DEPARTMENT OF COMPUTER SCIENCE


CERTIFICATE
Certified that this is a bonafide record of the project work in

COMPUTER SCIENCE
Submittted to the Central Board of Secondary Education in
partial fulfillment of Senior Secondary Examination

__________ __________
DATE PRINCIPAL
Submitted for Practical Examination and Viva Voce held on
25th November 2021

__________ __________
INTERNAL EXAMINER EXTERNAL
EXAMINER
DECLARATION

I , DIYA RAKESH GUNANIhereby declare that this work


entitled “Class XII Practical Journal” submitted to
APPASAHEB BIRNALE SCHOOL SENIOR SECONDARY, Shinde
Mala Sangli,Maharastra,416416(Affiliated to CBSE,New
Delhi, and Affiliation No. 1130074) is original record work
done by me under the supervision and guidance of Mr.
Sushant Pawar , Department of Computer Science

Name of the candidate register no signature of the


candidate

_________________ ___________ ______________

Countersigned by:
Mr.Sushant Pawar

M.sc(comp sci),M.sc(maths),B.Ed,DSM

Teacher in Charge

Department of Computer Science

Aappasaheb Birnale public school

Senior Secondary , Shinde Mala

Place : Sangli

date:
ACKNOWLEDGEMENT
The success and final outcome of this project required a lot of
guidance and assistance from many people and I’m extremely
fortunate to have got this all along the completions of my project
work. Whatever I’ve done is only due to such guidance and
assistance and I would not forget to thank them.

I’ve taken efforts in this project however it would not have been
possible without the kind support and help of many individuals. I
would like to extent my sincere thanks all of them.

I’m highly indebted to my computer teacher Mr. Sushant Pawar for


his guidance and constant supervision as well as for providing
necessary information regarding the project and also for supporting
me in completing this project. I also thank our respected principal
Ms. Sharda Khot for her support.

I’m thankful to and fortunate enough to get constant


encouragement, support and guidance from all teaching staff of
Department of Computer Science which helped us in successfully
completing this project.

I would like to express my gratitude towards my parents for their


cooperation and encouragement which helped me in completion of
this project.

My thanks and appreciations also go to my colleague in developing


the project and people who have willingly helped me out with their
abilities.
INDEX
SR. CONTENT
NO
1. Overview of python
2. Overview of SQL
3. Introduction
4. System requirements
i. Hardware ii Software
5. Aim the project
6. Reference to the python source code
i. Basic python functions
ii. Python Keywords
iii. Software python
functions
7. Reference to the SQL source code
i. Basic SQL functions
ii. SQL data types
iii. SQL operators
8. Layout for the software
8. Source code – python
9. Output for python
10. Source code - SQL
11. Output of SQL
12. Biblograhy
OVERVIEW OF PYTHON

Python is an interpreted high-level general-


purpose programming language. Its design
philosophy emphasizes code readability with its
use of significant indentation. Its language
constructs as well as its object-oriented approach
aim to help programmers write clear, logical code
for small and large-scale projects.
Python’s simple, easy to learn syntax emphasizes
readability and therefore reduces the cost of program
maintenance. Python supports modules and packages,
which encourages program modularity and code reuse.
The python interpreter and extensive standard library
are available in source or binary form without charge for
all major platforms and can be freely distributed.
This software is developed in the programming
language python available in the syllabus of CBSE XII
for the academic year 2021-2022.
OVERVIEW OF MySQL

MySQL is an open-source relational database


management system (RDBMS). It is the most popular
database system used with PHP. MySQL is developed,
distributed and supported by Oracle Corporation. The
data in a MySQL database are stored in table which
consists of columns and rows. MySQL is a database
System that runs on a sever. MySQL is ideal for both
small and large applications. MySQL is very fast, reliable
and easy to use database system. It uses standard
SQL. MySQL compiles on a number of platforms.
INTRODUCTION

The proposed project “Online Movie Ticket Booking

System” is the process where by consumers directly buy

movie tickets online from a multiple website interactively

in real time without an intermediary service over the


"Internet’” The Given System provides the detailed

working of the Online Movie Ticket Booking Processing

and what all happens whenever we or any one of us

goes to book movie tickets online.

“Online Movie Ticket Booking System” is an online

ticket booking project &customers can book tickets

‘(hours a day from anywhere in the world and interact

with multiplex) s website to know about currently running

movies and their schedule or service information

provided by the multiplex. Multiplex customer

relationship manager can interact with customers and

enable them to learn more about customers) needs and


build good customer relationships and increase

efficiency and reduce costs, and gain access to national

markets quickly.
SYSTEM REQUIREMENT

 HARDWARE REQUIRMENTS :

1) Processor :

 Intel core

2) IV Ram :
 512 MB

3) Hard Disk :

 40 GB
 SOFTWARE REQUIRMENTS :

1) Operating System:

 Windows 7,8,8.1,10,11

2) Tools:
 Python 3.10 IDLE
 Python 3.10
 MY SQL workbench 5.7

 PYCHARM 3.2
AIM OF THE PROJECT
The project “Online Movie Ticket Booking System” is

dedicated to the general requirements of multiplex

theaters. The main objective of the project is to create

an Online Movie Ticket Booking processing that allows

customers to know about new movies and their

schedules and cinema locations and class and ticket

price etc. In the booking process when customer selects

his city then cinemas of that city are filtered. In next step

he/she selects his/her desired cinema where he/she

wish to see movie and then selects movie and other

details like show date and show time and class and no

of tickets.

Based on given parameters a graphical layout of

seat status is visible to the customer. Now customer can

select his/her desired seat location and number of seats.

The Administrator will be able to see all booked and

canceled tickets.
REFRENCE TO PYTHON SOURCE CODE

 Basic python functions

FUNCTION DESCRIPTION

Input() Reads and returns a line of


string
Int() Returns integer from a
number or string
Len() Returns length of object

List() Creates list in python

Max() Returns max length of object


Print() Prints the given object
Range() Return sequence of integers
between start and stop
Tuple() Returns a tuple
 Python Keywords
KEYWORD DESCRIPTION

Print Prints a console


while Control flow of a code
For Iterate over items of a
collection in order that they
appear
if To determine which
statements are to be executed
else This statement is executed if
condition is false
elif Stands for else if ;if 1st
statement is false then test for
next one
and Execute program if all the
given tests re true
or At least one condition should
be true
import Import other modules into
python scripts
def Used to create new used
defined function
as It gives a different alias to a
module
Return Exits a function and returns a
value
Try Specify exception handling
 SOFTWARE PYTHON FUNCTIONS

FUNCTIONS DESCRIPTION

t_movie() This method is used to


select the movie name
Theater() This method is used to
select the screen
Timing(a) This method is used to
select the timing of the
movie
Movie(theater) This method is used to
select the movie
accordingly to the theater
City() This method is used to
select the city

Center() This method is used to


select the theater
Number of This method is used to
seats () select the number of seats
to book
Placement of This method is used to
the seat() select the position of seat
Method of This method is used to
payment() select the method of
payment
REFRENCE TO SQL SOURCE CODE

 Basic SQL functions

FUNCTION DESCRIPTION
Create() Used to create new table in
database
Drop() Used to delete tables from
database
Alter() Used to change the structure of
the database table
Rename() Used to rename a table
Insert() Used to insert data into a table
Select() Used to retrieve data from a
databases
Update() Used to update the existing
data within a table
Delete() Used to delete all the records
from a table
 SQL data types

DATA SYNTAX DESCRIPTION


TYPE
Integer INT A 32 bit signed integer
value
Numeric NUMERIC Where ,p=precision
(p<s) value ,s= scale value
Decimal DECIMAL Where ,p=precision
(p<s) value ,s= scale value
Float FLOAT(p) Where p is a precision
value
Character CHAR(x) X is the number of
characters to be
stored
Character VARCHAR(x) X is the number of
varying characters to be
stored
Date DATE Stores year ,month
and day values
Time TIME Stores hour , minute
and second values
 SQL operators

OPERATOR DESCRIPTION
Addition (+) Add the two arguments
together
Subtraction (-) Subtract the second
argument from the first
argument
Multiplication(*) Multiplies the two arguments
Division (/) Divide the first argument by
the second argument
Modulo (%) Divide the first argument
from the second argument
and provides he remainder
of that operation
AND Logical AND compares 2
expressions and return true
when expressions are true
OR Logical OR compares 2
expressions and return true,
when at least one of the
expressions is true
NOT(!) NOT takes a single
expression as an argument
and changes its value from
false to true or from true to
false
= Equal to
LAYOUT FOR THE SOFTWARE

Gangubai Kathiawadi
It All Start Here
Rating: 82% 29.9K
1. Pawankhind 2D, Hindi
2. Gangubai
2h 37m; Biography,
Kathiawadi
Crime, Drama; 25
3. Luck Down Be
Feb,2022
Positive
4. Valimai: The Power Cast: Alia Bhatt, Ajay
Devgan
Book Tickets

Mon Tue Wed Thu


How Many Seats?
28 1 2 3
1 2 3 4 5 6
Feb Feb Feb Feb
Premium: Rs. 280.00 NewPride Multiplex, Sangli
Silver: Rs. 230.00 10.00-1.00 1.10-4.10

4.20-7.20 7.30-10.30
Gold: Rs. 230.00
Mukta A2 Cinema, Sangli
Let’s Select Seats 10.15-1.15 1.25-4.25

4.35-7.35 7.45-10.45

Aurum Cinemas, Sangli


10.30-1.30 1.40-4.40

4.50-7.50 8.00-10.45
Pay Rs. 920.00

Grab a Bite! Skip Contact Details

1. Large Salted Name:


Popcorn
Phone Number:
2. Tub Popcorn + 2
Medium Soft Drink Your Email:
3. Large Coke
Update Details
4. Jalapeno Nachos

Proceed
Bill Almost There!
Food & Beverage Gangubai Kathiawadi 4
Large Salted Popcorn (1) Rs.180.00 Hindi, 2D M-Ticket

Tub Popcorn + 2 Medium Rs.470.00 Mon, 28 February 2022|1.10p.m.


Soft Drink (1) NewPride Cinemas, Sangli

Large Coke (1) Rs.180.00

Jalapeno Nachos Rs.180.00 Tickets Prices Rs. 920.00

Base Amount Rs.92.00

Central GST @9% Rs.8.28

State GST @9% Rs.8.28

TOTAL PAYABLE

AMOUNT Rs.2042.56

Choose Payment Method SUCCESSFUL!


1. UPI
2. Debit/Credit Card
3. Net Banking
4. Pay Later
Pay Rs. 2042.56
SOURCE CODE – PYTHON
global f
f=0

#this t_movie function is used to select movie


name
def t_movie ():
global f
f = f+1
print ("which movie do you want to watch?")
print ("1, movie 1 ")
print ("2, movie 2 ")
print ("3, movie 3")
print (" 4, back")
movie = int (input ("choose your movie: "))
if movie == 4:
# In this it goes to center function and from
center it goes to movie function and it comes
back here and then go to theater
center ()
theater ()
return 0
if f == 1:
theater ()
# This theater function used to select screen
def theater ():
print ("which screen do you want to watch
movie: ")
print ("1, SCREEN 1")
print ("2, SCREEN 2")
print ("3, SCREEN 3")
a = int (input ("choose your screen: "))
ticket = int (input ("number of tickets do you
want?: "))
timing(a)
# This timing function used to select timing for
movie
def timing(a):
time1 = {
"1": "10.00-1.00",
"2": "1.10-4.10",
"3": "4.20-7.20",
"4": "7.30-10.30"
}
time2 = {
"1": "10.15-1.15",
"2": "1.25-4.25",
"3": "4.35-7.35",
"4": "7.45-10.45"
}
time3 = {
"1": "10.30-1.30",
"2": "1.40-4.40",
"3": "4.50-7.50",
"4": "8.00-10.45"
}
if a == 1:
print ("choose your time:")
print(time1)
t = input ("select your time:")
x = time1[t]
print ("successful!, enjoy movie at "+x)
elif a == 2:
print ("choose your time:")
print(time2)
t = input ("select your time:")
x = time2[t]
print ("successful!, enjoy movie at "+x)
elif a == 3:
print ("choose your time:")
print(time3)
t = input ("select your time:")
x = time3[t]
print ("successful!, enjoy movie at "+x)
return 0
#This method is used to select movies
accordingly to the theater .
def movie(theater):
if theater == 1:
t_movie ()
elif theater == 2:
t_movie ()
elif theater == 3:
t_movie ()
elif theater == 4:
city ()
else:
print ("wrong choice")
#This method is used to select the theater.
def center():
print("which theater do you wish to see
movie? ")
print("1,Mukta")
print("2,New pride")
print("3,Arum")
print ("4, back")
a = int (input ("choose your option: "))
movie(a)
return 0
# This function is used to select city

def city ():


print ("Hi welcome to movie ticket booking:
")
print ("where you want to watch movie?:")
print ("1, city 1")
print ("2, city 2 ")
print ("3, city 3 ")
place = int (input ("choose your option: "))
if place == 1:
center ()
elif place == 2:
center ()
elif place == 3:
center ()
else:
print ("wrong choice")
Output for python

Hi welcome to movie ticket booking:

where you want to watch movie?:

1, city 1

2, city 2

3, city 3

choose your option: 2

which theater do you wish to see movie?

1, Mukta

2, New pride

3, Arum

4, back
choose your option: 1

which movie do you want to watch?

1, movie 1

2, movie 2

3, movie 3

4, back

choose your movie: 3

which screen do you want to watch movie:

1, SCREEN 1

2, SCREEN 2

3, SCREEN 3

choose your screen: 1

number of tickets do you want?: 4


choose your time:

{‘1’: ‘10.00-1.00’, ‘2’: ‘1.10-4.10’, ‘3’: ‘4.20-

7.20’, ‘4’: ‘7.30-10.30’}

select your time:2

successful!, enjoy movie at 1.10-4.10


SOURCE CODE – SQL

DROP DATABASE movies;


CREATE DATABASE movies;
\c movies;

CREATE Table Web_user(


Web_User_ID varchar(5),
First_Name varchar(15),
Last_Name varchar(20),
Email_ID varchar(30),
Age int,
Phone_Number varchar(10) NOT NULL,
Primary Key(Web_User_ID));

Create Table Theatre(


Theatre_ID varchar(5),
Name_of_Theatre varchar(30) NOT NULL,
No_of_Screens int,
Area varchar(30),
Primary Key(Theatre_ID));

CREATE TABLE Screen(


Screen_ID varchar(5),
No_of_Seats_Gold int NOT NULL,
No_of_Seats_Silver int NOT NULL,
Theatre_ID varchar(5),
Primary Key(Screen_ID),
Foreign Key(Theatre_ID) REFERENCES
Theatre(Theatre_ID) ON DELETE CASCADE ON
UPDATE CASCADE);

Create Table Movie(


Movie_ID varchar(5),
Name varchar(30) NOT NULL,
Language varchar(10),
Genre varchar(20),
Target_Audience varchar(5),
Primary Key(Movie_ID));

CREATE Table Show(


Show_ID varchar(10),
Show_Time time NOT NULL,
Show_Date date NOT NULL,
Seats_Remaining_Gold int NOT NULL CHECK
(Seats_Remaining_Gold >= 0),
Seats_Remaining_Silver int NOT NULL CHECK
(Seats_Remaining_Silver >= 0),
Class_Cost_Gold int NOT NULL,
Class_Cost_Silver int NOT NULL,
Screen_ID varchar(5) NOT NULL,
Movie_ID varchar(5) NOT NULL,
Primary Key(Show_ID),
Foreign Key (Screen_ID) REFERENCES
Screen(Screen_ID) ON DELETE CASCADE ON
UPDATE CASCADE,
Foreign Key (Movie_ID) REFERENCES
Movie(Movie_ID) ON DELETE CASCADE ON
UPDATE CASCADE);

CREATE Table Booking(


Booking_ID varchar(10),
No_of_Tickets int NOT NULL,
Total_Cost int NOT NULL,
Card_Number varchar(19),
Name_on_card varchar(21),
User_ID varchar(5),
Show_ID varchar(10),
Foreign Key (User_ID) REFERENCES Web_User
(Web_User_ID) ON DELETE CASCADE ON UPDATE
CASCADE,
Foreign Key (Show_ID) REFERENCES
Show(Show_ID) ON DELETE CASCADE ON
UPDATE CASCADE,
Primary Key(Booking_ID));

CREATE Table Ticket(


Ticket_ID varchar(20),
Booking_ID varchar(10),
Class varchar(3) NOT NULL,
Price int NOT NULL,
Primary Key(Ticket_ID),
Foreign Key(Booking_ID) REFERENCES
Booking(Booking_ID)ON DELETE CASCADE);
CREATE FUNCTION Seats_Booked()
RETURNS TRIGGER AS $Seats$
declare S_ID varchar(10);
declare Booked_Class varchar(3);
declare Gold int;
declare Silver int;

BEGIN
Select Show_ID into S_ID from Booking
Where Booking_ID = New.Booking_ID;
Select Seats_Remaining_Gold into Gold from
Show where Show_ID LIKE S_ID;
Select Seats_Remaining_Silver into Silver
from Show where Show_ID LIKE S_ID;
IF New.Class LIKE 'GLD' THEN
IF Gold = 0 THEN
RAISE NOTICE 'No More GOLD Seats
Available. Try a different Class';
Return NULL;
ELSE
UPDATE Show SET
Seats_Remaining_Gold = Seats_Remaining_Gold
- 1 Where Show_ID LIKE S_ID;
Return New;
END IF;
ELSE
IF Silver = 0 THEN
RAISE NOTICE 'No More SILVER Seats
Available. Try a different Class';
Return NULL;
ELSE
UPDATE Show SET
Seats_Remaining_Silver =
Seats_Remaining_Silver - 1 Where Show_ID LIKE
S_ID;
Return New;
END IF;
END IF;
END
$Seats$ LANGUAGE plpgsql;

CREATE TRIGGER Seats_Reduce


BEFORE INSERT
ON Ticket
FOR EACH ROW
EXECUTE PROCEDURE Seats_Booked();

CREATE FUNCTION Booking_Deleted()


RETURNS TRIGGER AS $Seats$
declare Gold int;
declare Silver int;
BEGIN
SELECT Count(*) into Gold from Ticket Where
Booking_ID = OLD.Booking_ID AND Class = 'GLD';
SELECT Count(*) into Silver from Ticket
Where Booking_ID = OLD.Booking_ID AND Class
= 'SLV';
UPDATE Show SET Seats_Remaining_Gold =
Seats_Remaining_Gold + Gold Where Show_ID
LIKE OLD.Show_ID;
UPDATE Show SET Seats_Remaining_Silver =
Seats_Remaining_Silver + Silver Where Show_ID
LIKE OLD.Show_ID;
RAISE NOTICE '% OLD Booking_ID',
OLD.Booking_ID;
RAISE NOTICE '% Gold Freed', Gold;
RAISE NOTICE '% Silver Freed', Silver;
Return OLD;
END;
$Seats$ LANGUAGE plpgsql;
CREATE TRIGGER Booking_Delete
BEFORE DELETE ON Booking
FOR EACH ROW
EXECUTE PROCEDURE Booking_Deleted();

CREATE FUNCTION Seats_Not_Available()


RETURNS TRIGGER AS
$Seats$
declare Gold_Seats int;
declare Silver_Seats int;

BEGIN
Select Seats_Remaining_Gold into
Gold_Seats from Show where Show_ID =
New.Show_ID;
Select Seats_Remaining_Silver into
Silver_Seats from Show where Show_ID =
New.Show_ID;
IF New.No_of_Tickets > Gold_Seats +
Silver_Seats THEN
RAISE NOTICE '% seats not available.
BOOKING FAILED.', New.No_of_Tickets;
Return NULL;
ELSE
RAISE NOTICE 'Booked.';
Return New;
END IF;
END
$Seats$ LANGUAGE plpgsql;

CREATE TRIGGER House_Full


BEFORE INSERT
ON Booking
FOR EACH ROW
EXECUTE PROCEDURE Seats_Not_Available();
Output for sql
BIBLOGRAPHY

 BOOKS:

 Sumita Arora (class xi) textbook


 Sumita Arora (class xii) textbook

 WEBSITES:

 https://www.codewithc.com/movie-
ticket-booking-system-in-c-with-mysql/

https://github.com/ShaliniSP/Movie-
Ticket-Booking-
SQL/tree/master/Movie%20ticket%20book
ing

https://www.geeksforgeeks.org/movie-
tickets-booking-management-system-in-
python/

You might also like