You are on page 1of 25

VIETNAM NATIONAL UNIVERSITY, HANOI

INTERNATIONAL SCHOOL

REPORT OF FINAL EXAM PROJECT

CGV Cinemas' Online Ticket Sales


Data Management System

GROUP 7
Class: Database
INS2080 - INS2080.01
Lecturer: Trần Thị Ngân

Hanoi, ……………………2023

1
Member’s Contribution

Percentage of
Full name ID Assigned Task
contribution

Chapter 1:
Requirement specification:

Bùi Hoàng Chapter 2: 21%


22070785
Khánh Hưng Cardinality
Build ERD:
Design Canva

Abstract
Chapter 1:
Business Narratives: 21%
Vũ Hồng Thúy 22070360
Chapter 3:
Power BI:
References

List of Figure
Chapter 1:
About the organization
Chapter 2:
Build ERD: 21%
Trần Anh Thư 22070675 Create a physical database
based on relational schema and
real data.
Chapter 4:
CONCLUSION

Design Canva

2
Chapter 2:
Relational Schema:

Write SQL scripts for “Some


Chu Thị Thu Cúc 20070908 real data and SQL scripts 21%
Chapter 3:
Questions and solution for
1,2,3,4,5

Chapter 2:
Relational Schema:
Write SQL scripts for “Some
Nguyễn Văn real data and SQL scripts 16%
20070941
Khôi Chapter 3:
Questions and solution for
6,7,8,9,10
Design Canva

3
List of Figure

4
Table of Contents
Member’s Contribution ............................................................................................................ 2
List of Figure............................................................................................................................. 4
ABSTRACT ............................................................................................................................... 6
Chapter 1: INTRODUCTION .................................................................................................. 7
1. About the Organization: ...............................................................................................................7

2. Requirement specification: ...........................................................................................................7

3. Business Narratives: ......................................................................................................................9

Chapter 2: ANALYZING AND DESIGNING THE DATABASE ........................................ 10


1. Cardinality: ..................................................................................................................................10

2. ERD: .............................................................................................................................................11

3. Relational Schema: ......................................................................................................................11

4. Some real data and SQL script: .................................................................................................13

Chapter 3: SOME USEFUL REPORTS AND INFORMATION......................................... 14


1. Design some useful reports and information for real usage:...................................................15

2. Solution for the above report/information:...............................................................................15

3. Power BI:......................................................................................................................................21

Chapter 4: CONCLUSION ..................................................................................................... 24


1. Advantages of the project to the business: ...............................................................................................24

2. The downside of the database can be observed as follows: .....................................................................24

REFERENCES ....................................................................................................................... 25

5
ABSTRACT
This report looks at CGV cinema's online ticket booking service. Although we tried to
incorporate as much as possible, our work only includes the booking service of CGV rather
than its entire operation.
In the first chapter, our team briefly introduced CGV, the organization, and the business
narrative to assist in the ERD and relational schema-building process in the second chapter.
The final chapter includes some valuable solutions for CGV’s business.

6
Chapter 1: INTRODUCTION
1. About the Organization:
CJ CGV is the largest film distributor and cinema operator in Vietnam and one of the top 5
cinema chains in the world. Our mission is to become a role model company for the continuous
development of the film industry in Vietnam.
CJ CGV has created a unique concept of transforming former multiplexes into "Cultureplex,"
where customers enjoy the movies and have access to diverse entertainment experiences. At
CGV, we implement the latest technology, including SCREENX, IMAX, STARIUM, 4DX,
and Dolby Atmos, as well as entirely new and different F&B offerings. All while still providing
the highest quality service by CGV Cinema's staff.
Our CSR-CSV activities, such as the Scriptwriting Contest, CJ Short Film Making Project,
Toto's Film Making Class, CGV ArtHouse, and our sponsorship of significant film events such
as HANIFF and Vietnam Film Festival, aimed at building and enhancing platforms where
talented filmmakers can be identified.
CGV cinemas are also determined to provide movie-going experiences for audiences with
limited access to quality cinema environments through CSV programs such as Smile Moon
and Movie for Everyone.
In addition, CJ CGV Vietnam has a transparent and professional system which ensures fair
conditions for all the business partners. Together with our valued audiences, filmmakers and
business partners, CJ CGV Vietnam will continue our journey toward the prosperous future of
Vietnam's movie industry.

2. Requirement specification:
* Method of Investigating Business Rules: CGV
The investigation into the business rules of CGV encompasses multiple stages and methods to
ensure a comprehensive understanding of how they manage and implement their business. Here
are three methods we employed:

2.1 Document Analysis:


Document analysis is a crucial step to gain in-depth insights into CGV's business rules, helping
identify strategies and opportunities for future development.
- Company Document Research: Analyzing CGV's official documents, such as annual
reports, financial reports, and managerial documents, to understand their business strategies
and management rules.

7
- Policy and Regulation Review: Examining the policies and regulations that CGV applies in
managing their business operations.

2.2 Website Research:


After obtaining an overview of the content production process, we researched CGV's website
to understand how they interact with customers.
-Online Ticket Purchasing Process: Thoroughly examining the online ticket purchasing
process on CGV's website to understand how they optimize the customer experience. This
includes evaluating the user interface, search features, and the payment process.
-Movie Information Management: Investigating how movie information is managed on the
website. This involves understanding how they display information, trailers, and movie viewer
ratings. This analysis helps us comprehend how CGV promotes and markets its film projects.
-Online Interaction: Monitoring CGV's social media channels and online communities to
assess the level of interaction with customers. This includes evaluating responses from viewers,
how they address feedback and participation in online discussions.
-Other Service Booking Processes: Examining other services that customers can use on
CGV's website, such as booking tables and reserving VIP rooms. This evaluation helps us
assess the scope and diversity of CGV's services.
- Online Interaction Analysis: Utilizing web analytics tools to measure online interaction,
from website visits to the time users spend on the site. This helps us gain a deeper understanding
of the popularity and preferences of the CGV website.

2.3 Observation:
The observation was conducted at CGV cinemas to understand the transaction process when
customers purchase tickets at the counter. This includes assessing the flexibility and efficiency
of the payment system, queue times, and the interaction between staff and customers. The
observation also aimed to identify commercial activities after customers have purchased tickets,
such as gift shops, additional services, or promotional programs. This provides authentic and
detailed insights into how CGV optimizes the value from each transaction. The data gathered
from these methods will be integrated into the database, contributing to building a
comprehensive and detailed picture of CGV's business processes.

8
3. Business Narratives:
Each CGV cinema customer has a unique Customer_ID. Their Full Name, phone number, birth
date, and all the information related to the customer are also stored. When becoming a member
of CGV cinemas, customers are assigned their own card number. Here are 5 steps for
customers to watch movies at CGV cinemas:
Step 1: Select movies:
Customers will select a movie or movies that they want to see. Available movies will be shown
as posters on the home page.
MOVIES (STT, MovieName, MovieID, Premiere, Durations, Language, Category)
Step 2: Choose the location.
After the first step, the system will display a list of cinema locations currently showing the
selected movie. Information about the cinema hall and the cinema will also be listed.

Location (Location_id, Cinema_Name, Location, Total_CinemaHalls)


CINEMAHALL(CinemaHall_ID, CinemaHallName, TotalSeats)
Step 3: Choosing showtime:
After choosing the movie, they will select their preferred show time. There are different show
times for a movie on a given day.
SHOWTIME(Showtime_ID, Movie_ID, Showtime, DateShown, CinemaHall_ID)
Step 4: Choosing Seat
This is the most important part, directly influencing your watching experience. Every seat is
denoted with (CinemaSeatID, CinemaSeatNumber, CinemaSeatType and CinemaHall_ID).
After a seat is reserved, it will be recorded with TICKET along with the price of each type of
seat.
Step 5: Payment
There are many methods by which a customer can complete their payment.
Payment Method has MethodID and Method_Name.
Information on customers’ payments is stored under the:
PAYMENT (Payment_ID, PaymentDate, Price, Discount, Total, Method_ID, Movie_ID,
Customer_ID)

9
Chapter 2: ANALYZING AND DESIGNING THE DATABASE
1. Cardinality:
1. The relationship between Showtime and Cinema Hall is one to many:
- Each Showtime may occur in multiple Cinema Halls
- Each Cinema Hall corresponds to each Showtime.
2. The relationship between Cinema Hall and Cinema Seat is one to many:
- Each Cinema Hall has multiple seats.
- Each Cinema Seat corresponds to a specific Cinema Hall.
3. The relationship between Showtime and Ticket is one to many:
- Each screening time can have multiple tickets sold.
- Each Ticket corresponds to a specific Showtime.
4. The relationship between Customer and Ticket is one to many:
- Each Customer can purchase one or multiple Ticket.
- Each Ticket can belong to one multiple customers.
5. The relationship between Payment and Payment Method is one to many:
- Each Payment can be made using one payment methods.
- Each Payment Method is for one or multiple Payment
6. The relationship between Movie and Ticket is one to many:
- Each Movie is associated with multiple tickets for admission.
- Each Ticket can watch one Movie.
7. The relationship between Ticket and Payment Method is one to one:
- Each Ticket payment is linked to a specific payment method.
- Each Payment Method is for one Ticket.
8. The relationship between Customer and Payment is one to many:
- Each customer can have multiple payments.
- Each payment is paid by one Customer.
9. The relationship between Location and Cinema Hall is one to many:
- Each location can have multiple cinema halls.

10
- Each Cinema Hall is located in a specific Location.
10. The relationship between Cinema Hall and Ticket is one to many:

- Each Cinema Hall can have multiple Tickets.


- Each Ticket belongs to one specific Cinema Hall.
11. The relationship between Movie and Payment is one to one:
- Each Movie is paid for by multiple Payment.
- Each Payment is for one specific Movie
12. The relationship between Cinema Seat and Ticket is one to one:
- Each Ticket belongs to a specific Cinema Seat.
- Each Cinema Seat is assigned to only one Ticket.

2. ERD:

3. Relational Schema:
CUSTOMER (Customer_ID,CustomerName,Phone,MobileCard,RewardPoints,Birthdate,
CustomerType)
PRIMARY KEY (Customer_ID)

MOVIES (STT, MovieName, MovieID, Premiere, Durations, Language, Category)


11
PRIMARY KEY (MovieID)

SHOWTIME (ShowtimeID, MovieID, Showtime, DateShown, CinemahallID)


PRIMARY KEY (ShowtimeID)
FOREIGN KEY (MovieID) REFERENCES MOVIES
FOREIGN KEY (CinemaHallID) REFERENCES CINEMAHALL

CinemaHall (CinemaHallID, CinemaHall_Name, Total_Seats, Location_id)


PRIMARY KEY (CinemaHallID)
FOREIGN KEY (Location_id) REFERENCES Location

CinemaSeat (Cinemaseat_id, Cinema_seat_number, Seat_type, Cinemahall_id)


PRIMARY KEY (Cinemaseat_id)
FOREIGN KEY (CinemaHallID) REFERENCES CINEMAHALL

Location (Location_id, Cinema_Name, Location, Total_CinemaHalls)


PRIMARY KEY (Location_id)

PaymentMethod (MethodId,MethodName)
PRIMARY KEY (MethodId)

PAYMENT(PaymentID,PaymentDate,Price,Discount,Total,MethodId,MovieID,CustomerID)
PRIMARY KEY (PaymentID)
FOREIGN KEY (MethodId) REFERENCES PaymentMethod
FOREIGN KEY (MovieID) REFERENCES MOVIES
FOREIGN KEY (CustomerID) REFERENCES CUSTOMER

TICKET (TicketID,CinemahallID,PaymentID,MovieID,ShowtimeID,Cinemaseat_id,
SeatType, MethodID, CustomerID, CustomerType, Price)

12
PRIMARY KEY(TicketID)
FOREIGN KEY (ShowTimeID) REFERENCES SHOWTIME

FOREIGN KEY (MovieID) REFERENCES MOVIES


FOREIGN KEY (CinemaHallID) REFERENCES CINEMAHALL
FOREIGN KEY (Cinemaseat_id) REFERENCES CINEMA SEAT
FOREIGN KEY (MethodId) REFERENCES PaymentMethod

4. Some real data and SQL script:


• Insert values in CUSTOMER table:
INSERT INTO

CUSTOMER (CustomerID, CustomerName, Phone, MobileCard, RewardPoints, Birthdate, CustomerType)

VALUES

('CM-01','TranAnhThu',0343568866,9992128032141175,8,'2004-04-24','Member'),

('CM-19','NguyenThiDanPhuong',0907888565,9992397513675461,10,'2004-12-27','Member');

• Insert values in MOVIES table:


INSERT INTO

MOVIES (STT, MovieName, MovieID, Premiere, Durations, Language, Category)

VALUES

(1,'DuongCung',1855,'2023-11-17','123minutes','Korean-Vietnamesesubtitles','Mentality'),

(16,'ChiemDoat',3721,'2023-11-24','113minutes','Vietnamese-Englishsubtitles','Suspense,Psychology');

• Insert values in SHOWTIME table:


INSERT INTO

SHOWTIME (ShowtimeID, MovieID, Showtime, DateShown, CinemahallID)

VALUES

('ST-01', 4667, '20:30', '2023-12-12', 'HNCT01'),

('ST-13', 3721, '18:15', '2023-12-28', 'HNCT01');

• Insert values in CINEMAHALL table:


INSERT INTO

CinemaHall (CinemaHall_ID, CinemaHall_Name, Total_Seats, Location_id)

VALUES

('HNCT01', 'CGV NguyenChiThanh 01', 201, 'LC-01'),

13
('HVOP05', 'CGV VincomOceanPark 05', 77, 'LC-22');

• Insert values in CINEMASEAT table:


INSERT INTO

CinemaSeat (Cinemaseat_id, Cinema_seat_number, Seat_type, Cinemahall_id)

VALUES

('CS-01', 'F6', 'VIP', 'HNCT01'),

('CS-20', 'F5', 'VIP', 'HNCT03');

• Insert values in Location table:


INSERT INTO

location (Location_id, Cinema_Name, Location, Total_CinemaHalls)

VALUES

('LC-01', 'CGV VincomNguyenChiThanh', 'NguyenChiThanh', 7),

('LC-22', 'CGV VincomOceanPark', 'GiaLam', 5);

• Insert values in PaymentMethod table:


INSERT INTO

PaymentMethod (MethodId, MethodName)

VALUES

('MD-01', 'International Payment Card'),

('MD-12', 'All the Methods');

• Insert values in PAYMENT table:


INSERT INTO

PAYMENT (PaymentID, PaymentDate, Price, Discount, Total, MethodId, MovieID, CustomerID)

VALUES

('PM-01', '2023-11-03', '300000', '5%', '285000', 'MD-03', '4667', 'CM-01'),

('PM-10', '2023-11-16', '210000', '0%', '210000', 'MD-01', '9787', 'CM-15');

• Insert values in TICKET table:


INSERT INTO

TICKET (TicketID, CinemahallID, PaymentID, MovieID,ShowtimeID, CinemaSeatID,SeatType,


MethodID,CustomerID, CustomerType, Price)

VALUES

('TK01', 'HNCT01', 'PM-01', 4667, 'ST-01', 'CS-01', 'VIP', 'MD-03', 'CM-01', 'Member', 60000),

('TK30', 'HNCT03', 'PM-10', 9787, 'ST-03', 'CS-15', 'VIP', 'MD-01', 'CM-15', 'VIP', 70000);

14
Chapter 3: SOME USEFUL REPORTS AND INFORMATION
Think of at least 10 business questions and use SQL to find their answers to support the
organization's daily business activities. (Discuss these questions with your teacher.) Try using
a wide range of statements such as SELECT FROM WHERE ORDER BY GROUP BY
HAVING, TRIGGER, VIEW, PROCEDURE, TRANSACTION, etc. Use Power BI to prepare
useful reports for this organization if possible.

1. Design some useful reports and information for real usage:


1. List movies with a runtime greater than or equal to 120 minutes.
2. Search for customers who pay with an International Payment Card.
3. Create an SQL query to determine which movie has the highest revenue in the first week
of November 2023.

4. Which payment methods have been used for payments with a total amount exceeding
150000?
5. Create a view displaying the movie title, release date, duration, and genre of all movies.
6. How to do a PROCEDURE to get the total amount a particular customer spent?
7. Create a TRANSACTION when a customer makes a new payment, simultaneously adding
reward points.
8. Retrieve the name of the customer with the highest reward points.
9. Find customers with loyalty points greater than the average.
10. Retrieve movies released between 15/11/2023 and 25/11/2023.

2. Solution for the above report/information:


-- Question 1
UPDATE MOVIES

SET Durations =REPLACE(Durations,'minutes','')

SELECT * FROM MOVIES WHERE Durations >= 120

-- Question 2
SELECT

PAYMENT.PaymentID,

15
CUSTOMER.CustomerName,

PAYMENT.PaymentDate,

PAYMENT.Total,

PaymentMethod.MethodId,

PaymentMethod.MethodName,

PAYMENT.CustomerID

FROM

PAYMENT

Join CUSTOMER on PAYMENT.CustomerID = CUSTOMER.CustomerID

JOIN

PaymentMethod ON PAYMENT.MethodID = PaymentMethod.MethodId

WHERE

PAYMENT.MethodID = 'MD-01';

-- Question 3
SELECT Top 1

MovieID,

MAX(Total) AS Highest_revenue

FROM PAYMENT

WHERE PaymentDate >= '2023-11-1' AND PaymentDate <= '2023-11-7'

GROUP BY MovieID

ORDER BY Highest_revenue DESC

-- Question 4

16
SELECT

PaymentMethod.MethodId,

PaymentMethod.MethodName,

SUM(PAYMENT.Total) AS TotalAmount

FROM

PAYMENT

JOIN

PaymentMethod ON PAYMENT.MethodID = PaymentMethod.MethodId

GROUP BY

PaymentMethod.MethodId, PaymentMethod.MethodName

HAVING

SUM(PAYMENT.Total) > 150000;

-- Question 5
CREATE VIEW MovieDetailsView as

SELECT

MovieName,

Premiere,

Durations,

Category

FROM

MOVIES;

SELECT * from MovieDetailsView

17
-- Question 6
----- Create PROCEDURE

CREATE PROCEDURE GetCustomerTotalSpending

@inputCustomerID VARCHAR(255),

@totalSpending INT OUTPUT

AS

BEGIN

SELECT

@totalSpending = SUM(P.Total)

FROM

PAYMENT P

WHERE

P.CustomerID = @inputCustomerID;

END;

-------- Using procedure by input customer ID, example:

DECLARE @outputTotalSpending INT;

EXEC GetCustomerTotalSpending 'CM-07', @outputTotalSpending OUTPUT;

SELECT @outputTotalSpending AS TotalSpending;

18
-- Question 7
----- Start a transaction

BEGIN TRANSACTION;

----- Insert a new payment record, example PM-11 by CM -06

INSERT INTO PAYMENT (PaymentID, Total, CustomerID)

VALUES ('PM-11', 300000, 'CM-06');

----- Update customer's reward points

UPDATE CUSTOMER

SET RewardPoints = RewardPoints + 30

WHERE CustomerID = 'CM-06';

----- Commit the transaction

COMMIT;

Select * from CUSTOMER

-- Question 8

19
SELECT

CustomerID,

CustomerName,

RewardPoints,

CustomerType

FROM CUSTOMER

WHERE RewardPoints = (SELECT MAX(RewardPoints) FROM CUSTOMER);

-- Question 9
SELECT CustomerName,

CustomerID,

RewardPoints,

CustomerType

FROM CUSTOMER

WHERE RewardPoints > (SELECT AVG(RewardPoints) FROM CUSTOMER);

-- Question 10
SELECT * FROM MOVIES WHERE Premiere >= '2023-11-15' AND Premiere <= '2023-11-25' ORDER BY
Premiere

20
3. Power BI:
- Below are the Power BI visualization results for the question:

1. List movies with a runtime greater than or equal to 120 minutes.

2. Search for customers who pay with an International Payment Card.

21
4. Which payment methods have been used for payments with a total amount exceeding
150000?

8. Retrieve the name of the customer with the highest reward points.

22
10. Retrieve movies released between 15/11/2023 and 25/11/2023.

23
Chapter 4: CONCLUSION
The purpose of this paper is to give a broad overview of the CGV theatres' online booking
process. We admit that there are still discrepancies between our database and the original
database of CGV Cinema, even after making every attempt to reconstruct the theatre's database.
This is because, although we are users of the company, we are still students.
Regarding how our work is organized, we introduce the business, the business narrative, and
the investigation techniques used in this report. The ERD is constructed in the second chapter
using the business narrative as a guide, and the ERD subsequently writes the relational schema.
The SQL scripts that are part of this report are functional and precise. Lastly, we propose a
dozen uses for the database and then provide answers for each one.
To conclude the project, I hereby summarize some of the plus points and also the downsides
of the database built by our group as follows:
1. Advantages of the project to the business:

• Enhanced Customer Experience: The system offers a user-friendly interface for


online ticket booking, improving customer satisfaction and loyalty.
• Data-Driven Decision Making: Access to comprehensive data empowers CGV
Cinemas to make informed decisions regarding movie selection, pricing, and
marketing.
• Operational Efficiency: Automation reduces manual workload, minimizes errors, and
allows for more efficient resource allocation.
• Revenue Growth: The system's marketing and promotion capabilities can lead to
increased ticket and concession sales, boosting profitability.
• Cost Savings: Automation and process streamlining result in long-term cost
reductions.
• Future-Proofing: The system positions CGV Cinemas to adapt to emerging
technologies and market changes, ensuring long-term relevance.
2. The downside of the database can be observed as follows:

• Limited Data Types: The mentioned project lacks flexibility in data types; the CGV
Cinemas' system primarily deals with movie-related data, customer information, and
booking details.

24
REFERENCES
1. CGV cinemas, retrieved January 1, 2023, from:
[ https://www.cgv.vn/ ]

2. Link Power BI:


[https://vnueduvn-
my.sharepoint.com/:u:/g/personal/22070360_vnu_edu_vn/EaV2WtGVaihAsW6mhhnX4
j0Bnzh23K33aIWbPoC8STGNug?e=SjQw1l ]

3. Link Data Excel:


[https://vnueduvn-my.sharepoint.com/:x:/g/personal/22070360_vnu_edu_vn/EQz-16iiY-
hOiTbjjnsSEr8Bl-qET_MkE3CQssk8lDtjfg?e=BLlwZl]

25

You might also like