TGViewer
SQL Programming Resources SQL Programming Resources @sqlanalyst ยท 76.7K subscribers
Post #2634 2.33K
๐Ÿš€ SQL Project Series #23

Movie Ticket Booking Analytics ๐ŸŽฌ

Analyze movies, theatres, customers, bookings, and payments using SQL to improve occupancy, revenue, and customer experience.

๐ŸŽฏ Business Objectives
โœ… Analyze ticket bookings
โœ… Track movie performance
โœ… Measure theatre occupancy
โœ… Analyze customer behavior
โœ… Monitor payment trends
โœ… Identify peak show timings
โœ… Optimize pricing strategy
โœ… Build executive dashboards

๐Ÿ“‚ Step 1: Create Database
CREATE DATABASE movie_booking_db;
USE movie_booking_db;

๐Ÿ“‚ Step 2: Create Customers Table
CREATE TABLE customers (
customer_id INT PRIMARY KEY,
customer_name VARCHAR(100),
gender VARCHAR(10),
city VARCHAR(50),
signup_date DATE
);

๐Ÿ“‚ Step 3: Create Movies Table
CREATE TABLE movies (
movie_id INT PRIMARY KEY,
movie_name VARCHAR(100),
genre VARCHAR(50),
language VARCHAR(30),
duration_minutes INT
);

๐Ÿ“‚ Step 4: Create Theatres Table
CREATE TABLE theatres (
theatre_id INT PRIMARY KEY,
theatre_name VARCHAR(100),
city VARCHAR(50),
total_seats INT
);

๐Ÿ“‚ Step 5: Create Bookings Table
CREATE TABLE bookings (
booking_id INT PRIMARY KEY,
customer_id INT,
movie_id INT,
theatre_id INT,
show_date DATETIME,
seats_booked INT,
ticket_amount DECIMAL(10,2),
booking_status VARCHAR(20),
payment_method VARCHAR(30),
FOREIGN KEY (customer_id) REFERENCES customers(customer_id),
FOREIGN KEY (movie_id) REFERENCES movies(movie_id),
FOREIGN KEY (theatre_id) REFERENCES theatres(theatre_id)
);

๐Ÿ“‚ Step 6: Insert Sample Customers
INSERT INTO customers VALUES
(1,'Rahul Sharma','Male','Mumbai','2025-01-10'),
(2,'Priya Verma','Female','Delhi','2025-01-15'),
(3,'Amit Patel','Male','Pune','2025-01-18'),
(4,'Sneha Joshi','Female','Bangalore','2025-01-20'),
(5,'Rohan Gupta','Male','Hyderabad','2025-01-22');

๐Ÿ“‚ Step 7: Insert Sample Movies
INSERT INTO movies VALUES
(101,'Leo','Action','Tamil',164),
(102,'Pushpa 2','Action','Telugu',180),
(103,'12th Fail','Drama','Hindi',147),
(104,'Inside Out 2','Animation','English',96);

๐Ÿ“‚ Step 8: Insert Sample Theatres
INSERT INTO theatres VALUES
(201,'PVR Phoenix','Mumbai',250),
(202,'INOX Select City','Delhi',220),
(203,'Cinepolis Seasons','Pune',180),
(204,'PVR Orion','Bangalore',240);

๐Ÿ“‚ Step 9: Insert Sample Bookings
INSERT INTO bookings VALUES
(1001,1,101,201,'2025-02-01 18:30:00',2,900,'Confirmed','UPI'),
(1002,2,102,202,'2025-02-01 20:00:00',3,1350,'Confirmed','Credit Card'),
(1003,3,103,203,'2025-02-02 16:00:00',1,350,'Cancelled','UPI'),
(1004,4,104,204,'2025-02-02 19:30:00',4,1800,'Confirmed','Debit Card'),
(1005,5,101,201,'2025-02-03 21:00:00',2,900,'Confirmed','Wallet');

๐Ÿง  SQL Concepts You'll Practice
โœ” DDL & DML
โœ” INNER JOIN
โœ” LEFT JOIN
โœ” Aggregate Functions
โœ” GROUP BY
โœ” HAVING
โœ” CASE WHEN
โœ” Date Functions
โœ” CTEs
โœ” Window Functions
โœ” Ranking Functions

๐Ÿ“Š Business KPIs You Can Build
๐Ÿ“ˆ Total Bookings
๐Ÿ“ˆ Total Tickets Sold
๐Ÿ“ˆ Total Revenue
๐Ÿ“ˆ Average Ticket Price
๐Ÿ“ˆ Average Booking Value
๐Ÿ“ˆ Booking Cancellation Rate
๐Ÿ“ˆ Occupancy Rate
๐Ÿ“ˆ Revenue by Movie
๐Ÿ“ˆ Revenue by Theatre
๐Ÿ“ˆ Revenue by City
๐Ÿ“ˆ Most Popular Movie
๐Ÿ“ˆ Most Popular Genre
๐Ÿ“ˆ Peak Booking Hours
๐Ÿ“ˆ Peak Show Timings
๐Ÿ“ˆ Weekend vs Weekday Bookings
๐Ÿ“ˆ Payment Method Distribution
๐Ÿ“ˆ Customer Retention Rate
๐Ÿ“ˆ Repeat Customers
๐Ÿ“ˆ Top Spending Customers
๐Ÿ“ˆ Theatre Utilization
๐Ÿ“ˆ Language-wise Revenue
๐Ÿ“ˆ Monthly Revenue Trend
๐Ÿ“ˆ Movie Performance Dashboard
๐Ÿ“ˆ Executive Booking Dashboard

๐ŸŽฏ This project reflects real-world SQL analysis performed by cinema chains, online ticketing platforms like BookMyShow, entertainment companies, and Business Intelligence teams to optimize occupancy, improve customer experience, and maximize revenue.

Double Tap โค๏ธ For More
  • โค 10
  • ๐Ÿค” 1
More from @sqlanalyst
  1. Oct 8, 2026๐ŸŽ“ ๐— ๐—ถ๐—ฐ๐—ฟ๐—ผ๐˜€๐—ผ๐—ณ๐˜ ๐—™๐—ฅ๐—˜๐—˜ ๐—–๐—ผ๐˜‚๐—ฟ๐˜€๐—ฒ๐˜€ ๐˜„๐—ถ๐˜๐—ต ๐—–๐—ฒ๐—ฟ๐˜๐—ถ๐—ณ๐—ถ๐—ฐ๐—ฎ๐˜๐—ฒ๐˜€! ๐Ÿš€๐Ÿ”ฅ Upgrโ€ฆ
  2. Oct 7, 2026๐Ÿš€๐—ฃ๐—ฎ๐˜† ๐—”๐—ณ๐˜๐—ฒ๐—ฟ ๐—ฃ๐—น๐—ฎ๐—ฐ๐—ฒ๐—บ๐—ฒ๐—ป๐˜ ๐—ง๐—ฟ๐—ฎ๐—ถ๐—ป๐—ถ๐—ป๐—ด | ๐—•๐—ฒ๐—ฐ๐—ผ๐—บ๐—ฒ ๐—ฎ ๐—™๐˜‚๐—น๐—น๐˜€๐˜๐—ฎ๐—ฐโ€ฆ
  3. Oct 7, 2026SQL Interview Series โ€” Part 4 ๐Ÿ“Œ Question 4: Find the Highest Salary in Each Department Suโ€ฆ
  4. Oct 7, 2026๐— ๐—ฎ๐˜€๐˜๐—ฒ๐—ฟ ๐—ฃ๐—ผ๐˜„๐—ฒ๐—ฟ ๐—•๐—œ ๐—ณ๐—ผ๐—ฟ ๐—™๐—ฅ๐—˜๐—˜! ๐Ÿ”ฅ Learn Power BI through these FREE learninโ€ฆ
  5. Sep 29, 2026SQL Interview Series โ€” Part 2 ๐Ÿ“Œ Question 2: Find Duplicate Records Suppose you have an Emโ€ฆ
  6. Sep 29, 2026๐—™๐—ฅ๐—˜๐—˜ ๐—ฅ๐—ฒ๐˜€๐—ผ๐˜‚๐—ฟ๐—ฐ๐—ฒ๐˜€ ๐—ง๐—ผ ๐—Ÿ๐—ฒ๐—ฎ๐—ฟ๐—ป ๐—”๐—œ ๐—ถ๐—ป ๐Ÿฎ๐Ÿฌ๐Ÿฎ๐Ÿฒ๐Ÿš€ โ€‹ Explore 6 free resourceโ€ฆ
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook โ†’Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 โ†’