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

IP Project Movie Ticket Sanjay

The document outlines a project titled 'Movie Ticket Booking System' completed by Sanjay Kumar as part of the CBSE Informatics Practices curriculum. It details the project's objectives, tools used, system design, database structure, source code, and sample outputs, demonstrating the automation of movie ticket booking using Python and MySQL. The project aims to enhance practical skills in programming and database management while providing a real-world application experience.

Uploaded by

Saravana Kumar
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 views14 pages

IP Project Movie Ticket Sanjay

The document outlines a project titled 'Movie Ticket Booking System' completed by Sanjay Kumar as part of the CBSE Informatics Practices curriculum. It details the project's objectives, tools used, system design, database structure, source code, and sample outputs, demonstrating the automation of movie ticket booking using Python and MySQL. The project aims to enhance practical skills in programming and database management while providing a real-world application experience.

Uploaded by

Saravana Kumar
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/ 14

IP Project for Computer

Movie Ticket Booking System

Submitted by:
Name: Sanjay Kumar
Roll No.: 9
Class: XII
School Name: Avarjya Dalyam
Academic Session: 2024–25
CERTIFICATE

This is to certify that Sanjay Kumar of Class XII, Roll No. 9, from Avarjya Dalyam has successfully
completed the Informatics Practices project titled Movie Ticket Booking System under my
guidance. This project is in partial fulfillment of the requirements of the CBSE Informatics Practices
curriculum for the academic session 2024–25.

__________________________
Teacher's Signature

__________________________
Principal's Signature
ACKNOWLEDGEMENT

I would like to express my sincere gratitude to my teacher for guiding me in the completion of this
project. I am also thankful to the Principal of my school for providing me with this opportunity. I
extend my heartfelt thanks to CBSE for including project work in Informatics Practices curriculum,
which gave me practical exposure. Finally, I thank my parents and friends for their constant
encouragement.
INDEX

S. No. Contents Description

1 Cover Page Title of project & student details


2 Certificate Authentication of project work
3 Acknowledgement Gratitude to supporters
4 Introduction Overview & significance of project
5 Objectives Aim and scope of the system
6 Tools & Technology Software & libraries used
7 System Design ER model, flow of program
8 Database Structure SQL tables with explanation
9 Source Code Full Python program with comments
10 Sample Outputs Example screenshots & results
11 Conclusion Learning outcomes & summary
12 Bibliography References & study material
INTRODUCTION
The Movie Ticket Booking System project is developed in Python with MySQL connectivity. It is
designed to automate the process of booking movie tickets, managing seat availability, and storing
booking details. In today's fast-paced digital world, automation of tasks is highly significant. This
project demonstrates how real-life applications like ticket booking can be handled easily using
Python and databases.
OBJECTIVES OF THE PROJECT
- To automate the ticket booking process.
- To store and manage movie and booking records effectively.
- To learn and apply Python-MySQL connectivity.
- To strengthen understanding of SQL commands.
- To simulate a real-life booking system for learning purposes.
TOOLS AND TECHNOLOGY USED
- Programming Language: Python 3.x
- Database: MySQL
- Python Library: mysql.connector
- IDE: Any Python editor (IDLE, PyCharm, VSCode)
- Database Tool: MySQL Workbench / Command Line Client
SYSTEM DESIGN
The system is designed around two main entities: Movies and Bookings. The relationship is
one-to-many, where a movie can have multiple bookings. This is represented in the database
through primary and foreign key relationships.

Entity-Relationship (ER) Model Description:


- Entity 1: Movies (Movie ID, Name, Price, Seats)
- Entity 2: Bookings (Booking ID, Customer, Movie ID, Tickets)
- Relationship: One Movie → Many Bookings
DATABASE STRUCTURE
SQL Queries to Create Tables:
CREATE DATABASE movieDB;

USE movieDB;

CREATE TABLE movies (


mid INT PRIMARY KEY,
name VARCHAR(50),
price INT,
seats INT
);

CREATE TABLE bookings (


bid INT AUTO_INCREMENT PRIMARY KEY,
customer VARCHAR(50),
movie_id INT,
tickets INT,
FOREIGN KEY (movie_id) REFERENCES movies(mid)
);
SOURCE CODE (Python Program)
import mysql.connector

db = mysql.connector.connect(
host="localhost",
user="root",
password="yourpassword",
database="movieDB"
)
cursor = db.cursor()

def add_movie():
mid = int(input("Enter Movie ID: "))
name = input("Enter Movie Name: ")
price = int(input("Enter Ticket Price: "))
seats = int(input("Enter Total Seats: "))
sql = "INSERT INTO movies (mid, name, price, seats) VALUES (%s, %s, %s,
%s)"
cursor.execute(sql, (mid, name, price, seats))
db.commit()

def show_movies():
cursor.execute("SELECT * FROM movies")
for row in cursor.fetchall():
print(row)

def book_ticket():
customer = input("Enter Customer Name: ")
mid = int(input("Enter Movie ID: "))
tickets = int(input("Enter Number of Tickets: "))
cursor.execute("SELECT seats, price FROM movies WHERE mid=%s", (mid,))
result = cursor.fetchone()
if result and result[0] >= tickets:
cursor.execute("UPDATE movies SET seats=%s WHERE mid=%s",
(result[0]-tickets, mid))
cursor.execute("INSERT INTO bookings (customer, movie_id, tickets) VALUES
(%s, %s, %s)", (customer, mid, tickets))
db.commit()
print("Booking successful! Total Price =", tickets * result[1])
else:
print("Not enough seats available!")

def show_bookings():
cursor.execute("SELECT b.bid, b.customer, m.name, b.tickets FROM bookings
b JOIN movies m ON b.movie_id=m.mid")
for row in cursor.fetchall():
print(row)

while True:
print("\n--- Movie Ticket Booking System ---")
print("1. Add Movie")
print("2. Show Movies")
print("3. Book Ticket")
print("4. Show Bookings")
print("5. Exit")
choice = int(input("Enter choice: "))
if choice == 1: add_movie()
elif choice == 2: show_movies()
elif choice == 3: book_ticket()
elif choice == 4: show_bookings()
elif choice == 5: break
SAMPLE OUTPUTS
--- Movie Ticket Booking System ---
1. Add Movie
2. Show Movies
3. Book Ticket
4. Show Bookings
5. Exit

Enter choice: 1
Enter Movie ID: 101
Enter Movie Name: Avatar
Enter Ticket Price: 250
Enter Total Seats: 50
Movie added successfully!

Enter choice: 3
Enter Customer Name: Rahul
Enter Movie ID: 101
Enter Number of Tickets: 2
Booking successful! Total Price = 500

Enter choice: 4
(1, 'Rahul', 'Avatar', 2)
CONCLUSION
This project enhanced my knowledge of Python programming and its ability to connect with
databases using MySQL. I learned about designing tables, executing SQL queries, and writing a
menu-driven program. It also helped me understand how software applications automate real-world
processes such as ticket booking. Overall, this project gave me hands-on experience in combining
theory with practical implementation.
BIBLIOGRAPHY
- CBSE Informatics Practices Textbook
- Python Official Documentation (https://docs.python.org)
- MySQL Documentation (https://dev.mysql.com/doc)
- Guidance from my teacher and school resources

You might also like