0% found this document useful (0 votes)
12 views

Event Management System

The document outlines a lab final assignment for a Database Management System course, focusing on creating a database-driven event management system. It details the development process, including the creation of an ER diagram, database tables, and SQL queries for managing events, users, and bookings. The conclusion highlights the system's capabilities and limitations, emphasizing the importance of a well-designed database structure.

Uploaded by

shihab.touhid777
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)
12 views

Event Management System

The document outlines a lab final assignment for a Database Management System course, focusing on creating a database-driven event management system. It details the development process, including the creation of an ER diagram, database tables, and SQL queries for managing events, users, and bookings. The conclusion highlights the system's capabilities and limitations, emphasizing the importance of a well-designed database structure.

Uploaded by

shihab.touhid777
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/ 23

Lab Final Assignment

Course Code: CSE 2302


Course Title: Database Management System Lab
Section: 02
Summer 2024

Submitted By:
Name: Israt Islam
ID: 223014108
Department of Computer Science Engineering, ULAB

Submitted To:
Name: Jannatul Ferdous Ruma
Lecturer
Department of Computer Science Engineering,

ULAB Date of Submission:

12th September 2024


Problem Statement and Summary

In today's fast-paced world, managing and organizing events are increasing day by day,
managing is becoming harder with traditional methods. Traditional methods are not working
properly. It may cause many problems. And that will cause negative impact on the success of
the event. To make those event successful, we should implement a database driven system.
The given problems goal is to create a database driven event management system which will
solve all the problems. This system will allow users to search for events, booking or cancelling
tickets, viewing events details like organizers, categories, locations etc. It will monitor user’s
activity and so on.

According to the given report file, to create a event management database system, at first I
created an ER diagram. I used proper entities, attributes, relationships like one to one, one to
many, many to one, and many to many. Identified primary keys and foreign keys. Then I
developed a proper database named database event management system based on ER
diagram. I made this ER diagram by using smart draw. To implement the database, I used
modern tool like MSQL and phpMyAdmin. This tool helped me to create a proper database for
event management system with all SQL queries. Finally, I made a proper report on the
database.

ER Diagram
The ER Diagram or Entity Relationship Diagram is a high-level conceptual data model diagram.
ER diagrams is a blueprint to create a database. It helps to organize data efficiently and helps to
analyze data requirements systematically to create a well-designed database. Entity
relationship diagram displays the relationships of entity set stored in a database.ER diagram is
similar like a flowchart. But ER Diagram includes many special symbols which make the model
unique. There are 3 elements of ERD: 1. Entity Sets 2. Attributes 3. Relationship Sets. ER
Diagrams Helps to define terms related to entity relationship modeling. It Helps to describe
entities, attributes, relationships. ER diagram can build databases quickly.
ER Diagram
ER Diagram of Database Event Management System
Database, Table, Data Set
Creating database
CREATE DATABASE database_event_management_system;
Create & Insert data into the Users table
CREATE TABLE Users (

user_id INT AUTO_INCREMENT PRIMARY KEY,


username VARCHAR(50) NOT NULL,
email VARCHAR(50) NOT NULL,

password VARCHAR(50) NOT NULL,


phone_number VARCHAR(15),

created_at DATETIME DEFAULT CURRENT_TIMESTAMP );

INSERT INTO Users (username, email, password, phone_number)


VALUES
('Sunonda_Islam', '[email protected]', 'password123',
'01712345678'), ('Shofik_Khan', '[email protected]', 'pass123',

'01887654321'), ('Rustam_Mirza', '[email protected]', 'kaderpass',


'01799887766'), ('Shayla_Hasan', '[email protected]', 'shaylapassword',
'01822334455'), ('Fahim_Chowdhury', '[email protected]', 'fahimpass',
'01966778890'), ('Maliha_Rahman', '[email protected]', 'malihapass',
'01744556677');
Output:

Create & Insert data into the Organizers table


CREATE TABLE Organizers (

organizer_id INT AUTO_INCREMENT PRIMARY KEY,


organizer_name VARCHAR(50) NOT NULL,

email VARCHAR(50) NOT NULL,


phone_number VARCHAR(15),

address VARCHAR(50) );

INSERT INTO Organizers (organizer_name, email, phone_number, address) VALUES


('TechExpo Dhaka', '[email protected]', '01799887766', '123 Karwan Bazar'), ('Dhaka
Music Fest', '[email protected]', '01899887755', '456 Gulshan Avenue'),
('Bangladesh Sports Club', '[email protected]', '01755667788', '789 Dhanmondi Road'),
('Business Summit BD', '[email protected]', '01966778890', '101 Motijheel Commercial
Area'),

('Art Gallery BD', '[email protected]', '01877889901', '202 Banani Avenue'), ('Food Festival
Dhaka', '[email protected]', '01988900112', '303 Lalmatia Street');

Output:

Create & Insert data into the Categories table


CREATE TABLE Categories (
category_id INT AUTO_INCREMENT PRIMARY KEY,

category_name VARCHAR(50) NOT NULL );

INSERT INTO Categories (category_name)

VALUES

('Technology'),
('Music'),
('Sports'),

('Business'),

('Art'),
('Food & Drink');

Output:

Create & Insert data into the Locations


table CREATE TABLE Locations (
location_id INT AUTO_INCREMENT PRIMARY KEY,

location_name VARCHAR(50) NOT NULL, address


VARCHAR(50),

city VARCHAR(50),

capacity INT );

INSERT INTO Locations (location_name, address, city, capacity)

VALUES ('Bangabandhu International Conference Center', 'Agargaon', 'Dhaka', 2000),


('National Stadium', 'Motijheel', 'Dhaka', 30000),

('Shilpakala Academy', 'Segunbagicha', 'Dhaka', 1500),

('Bashundhara Expo Center', 'Bashundhara', 'Dhaka', 1000),

('Rabindra Sarobar', 'Dhanmondi', 'Dhaka', 5000),


('Army Stadium', 'Banani', 'Dhaka', 10000);

Output:

Create & Insert data into the Events table


CREATE TABLE Events (

event_id INT AUTO_INCREMENT PRIMARY KEY,


event_name VARCHAR(50) NOT NULL,

organizer_id INT,

category_id INT,
location_id INT,

date DATE NOT NULL,


time TIME NOT NULL,
total_tickets INT NOT NULL,

available_tickets INT NOT NULL,


description TEXT,

FOREIGN KEY (organizer_id) REFERENCES Organizers(organizer_id),


FOREIGN KEY (category_id) REFERENCES Categories(category_id),
FOREIGN KEY (location_id) REFERENCES Locations(location_id)

);

INSERT INTO Events (event_name, organizer_id, category_id, location_id, date, time,


total_tickets, available_tickets, description)

VALUES

('TechExpo 2024', 1, 1, 1, '2024-11-20', '09:00:00', 2000, 1800, 'Annual technology exhibition in


Dhaka.'),
('Dhaka Music Fest 2024', 2, 2, 3, '2024-10-15', '18:00:00', 1500, 1200, 'A grand musical festival
featuring top Bangladeshi artists.'),

('Sports Championship Finals', 3, 3, 2, '2024-12-01', '15:00:00', 30000, 25000, 'National sports


championship finals.'),

('Business Summit 2024', 4, 4, 1, '2024-09-30', '10:00:00', 1000, 900, 'Summit for Bangladeshi
entrepreneurs and investors.'),

('Art Expo BD 2024', 5, 5, 4, '2024-07-25', '11:00:00', 1000, 800, 'Art exposition showcasing
contemporary Bangladeshi artists.'),

('Dhaka Food Festival 2024', 6, 6, 6, '2024-08-18', '12:00:00', 10000, 9000, 'A festival celebrating
Bangladeshi culinary experiences.');

Output:

Create & Insert data into the Tickets table


CREATE TABLE Tickets (
ticket_id INT AUTO_INCREMENT PRIMARY KEY,
event_id INT,
ticket_price DECIMAL(10, 2) NOT NULL,

FOREIGN KEY (event_id) REFERENCES Events(event_id) );

INSERT INTO Tickets (event_id, ticket_price)


VALUES (13, 200.00),
(14, 100.00),
(15, 50.00),
(16, 300.00),

(17, 150.00),
(18, 100.00);

Output:

Create & Insert bookings into the Bookings table


CREATE TABLE Bookings (

booking_id INT PRIMARY KEY AUTO_INCREMENT,


user_id INT,

ticket_id INT,
status ENUM('Booked', 'Cancelled') NOT NULL,

booking_date DATE DEFAULT CURRENT_DATE,

cancellation_date DATE DEFAULT NULL,


FOREIGN KEY (user_id) REFERENCES Users(user_id),

FOREIGN KEY (ticket_id) REFERENCES Tickets(ticket_id) );


INSERT INTO
Bookings (user_id, ticket_id, status, booking_date, cancellation_date) VALUES (1,
31, 'Booked', '2024-09-01', NULL),
(2, 32, 'Cancelled', '2024-09-05', '2024-09-07'),

(3, 33, 'Booked', '2024-09-10', NULL),

(4, 34, 'Cancelled', '2024-09-12', '2024-09-14'),


(5, 35, 'Booked', '2024-09-15', NULL),

(6, 36, 'Booked', '2024-09-16', NULL);

Output:

Create & Insert data into the Payments table


CREATE TABLE Payments (
payment_id INT AUTO_INCREMENT PRIMARY KEY,
booking_id INT,
amount DECIMAL(10, 2) NOT NULL,

payment_date DATETIME DEFAULT CURRENT_TIMESTAMP,


payment_status ENUM('Completed', 'Failed') NOT NULL,

FOREIGN KEY (booking_id) REFERENCES Bookings(booking_id)


);

INSERT INTO Payments (booking_id, amount, payment_status)


VALUES (20, 200.00, 'Completed'),

(21, 100.00, 'Completed'),

(22, 50.00, 'Completed'),

(23, 300.00, 'Completed'),


(24, 150.00, 'Completed'),
(25, 100.00, 'Completed');

Output
Queries
• Retrieve all bookings for a specific user with event details.
Code
SELECT b.booking_id, b.booking_date, b.status, e.event_name, e.date AS event_date,
e.time AS event_time

FROM Bookings b

JOIN Tickets t ON b.ticket_id = t.ticket_id


JOIN Events e ON t.event_id = e.event_id

WHERE b.user_id = 1;

Output
Explanation
This query display all bookings done by a specific user. It displays booking details like
booking id, booking date, status, event name, event date, event time. Used join
operation to get data from bookings, tickets, events table.

• Find the top 3 organizers by the number of events they have hosted.
Code
SELECT o.organizer_name, COUNT(e.event_id) AS event_count

FROM Organizers o

JOIN Events e ON o.organizer_id = e.organizer_id


GROUP BY o.organizer_name

ORDER BY event_count DESC


LIMIT 3;

Output

Explanation
This query search for top 3 organizers based on the number of events they have been hosted.
This query search their data and display it. It also used join operation.

• List events along with their organizers' contact information (email and
phone).
Code
SELECT e.event_name, o.organizer_name, o.email AS organizer_email, o.phone_number AS
organizer_phone

FROM Events e

JOIN Organizers o ON e.organizer_id = o.organizer_id;

Output

Explanation
This query list all the events with organizers names, emails, phone numbers. It also used join
operation to get info from event and organizer table.

• Find the location with the highest capacity available for new events on a
specific date.
Code
SELECT l.location_name, l.capacity

FROM Locations l WHERE l.capacity = (SELECT MAX(l2.capacity)


FROM Locations l2 WHERE NOT EXISTS (
SELECT 1 FROM Events e WHERE e.location_id = l2.location_id AND e.date = '2024-10-01') );

Output
Explanation
This query marks all the location with largest available capacity, it ensures that no events are
booked on that date.

• Find the event name and location for the event with the highest ticket
price.
Code
SELECT e.event_name, l.location_name

FROM Events e JOIN Tickets t ON e.event_id = t.event_id

JOIN Locations l ON e.location_id = l.location_id


WHERE t.ticket_price = (SELECT MAX(ticket_price) FROM Tickets);

Output

Explanation
This query searches the name of event with highest ticket price and display the event name
and location name. it used join operation to get data from ticket table.

• Calculate the average ticket price per event category.


Code
SELECT c.category_name, AVG(t.ticket_price) AS average_price

FROM Categories c JOIN Events e ON c.category_id = e.category_id

JOIN Tickets t ON e.event_id = t.event_id

GROUP BY c.category_name;
Output

Explanation
This query calculates the average ticket price per event category.it used join operation. As
output it shows the category name and average price serially.
• Show the total number of available tickets and tickets sold for each event.
Code
SELECT e.event_name, e.total_tickets, e.total_tickets - e.available_tickets AS tickets_sold

FROM Events e;

Output

Explanation
This query lists all events with available tickets and sold out tickets total number. It calculates
sold tickets number by subtracting available tickets from total tickets.

• List all canceled bookings for a specific user.


Code
SELECT b.booking_id, b.booking_date, b.cancellation_date, e.event_name
FROM Bookings b

JOIN Tickets t ON b.ticket_id = t.ticket_id

JOIN Events e ON t.event_id = e.event_id

WHERE b.user_id = 2 AND b.status = 'Cancelled';

Output

Explanation
This query finds back all bookings which been canceled by a specific user. Also display the
canceled date and event name. it filters by users ID and status of booking being canceled.

• List all upcoming events in a specific city and category.


Code
SELECT e.event_name, e.date, e.time, l.location_name, l.city

FROM Events e

JOIN Locations l ON e.location_id = l.location_id

JOIN Categories c ON e.category_id = c.category_id


WHERE l.city = 'Dhaka' AND c.category_name = 'Music' AND e.date > CURRENT_DATE;
Output

Explanation
This query list the upcoming events happening in a specific city and category. It used joint
operation.it joins the event, location, category table and filter data.

• Find all events happening within the next month.


Code
SELECT e.event_name, e.date, e.time

FROM Events e
WHERE e.date BETWEEN CURRENT_DATE AND DATE_ADD(CURRENT_DATE, INTERVAL 1
MONTH);

Output

Explanation
This query marked all events scheduled to happen within the next month. It checks the date
and compare with recent date. Ecsured that there is one month gap.

• Find the total revenue generated for each category of events


Code
SELECT c.category_name, SUM(p.amount) AS total_revenue
FROM Categories c
JOIN Events e ON c.category_id = e.category_id
JOIN Tickets t ON e.event_id = t.event_id
JOIN Bookings b ON t.ticket_id = b.ticket_id
JOIN Payments p ON b.booking_id = p.booking_id
GROUP BY c.category_name;

Output

Explanation
This query calculated revenue generated for each event category by counting payment mount
from payment table.

• List all events with the number of bookings they have received
Code
SELECT e.event_name, COUNT(b.booking_id) AS total_bookings
FROM Events e
JOIN Tickets t ON e.event_id = t.event_id

JOIN Bookings b ON t.ticket_id = b.ticket_id


GROUP BY e.event_name;
Output

Explanation
This query lists all events with total number of bookings. it joins the events, tickets, bookings
table. Counts how many bookings has received.

Conclusion
This lab report is created based on an event management system. The blueprint shows several
interrelated tables designed to handle many properties of event organization and user
interaction. This database has Organizers, Categories, Users, Events, Tickets, Bookings, locations,
Payments, and Cancellations entity. I used foreign keys to interconnect tables. Used various
queries to get specific information like booking details, organizers performance, ticket avaibility
etc. the project shows how a well-designed ER diagram can guide to development of a
relationship database.

There are some limitations in this database. This database doesn’t have enough data set or
information. This database many not be able to handle large dataset. Few features are
simplified. There is no user feedback options, real time ticket tracking option, advanced
payment system.

During project, I faced some problems. During data entry I didn’t maintained data integrity with
foreign key constrains, so I faced difficulties. Then I corrected it.

I used PHPMYADMIN to create this database. Its very user friendly for users to write and
execute SQL queries. Also, to create this database, I used my knowledge gained from lectures
and self-studies. To further enhance the project several other tools and technique could be
used.

If we modify and enhanced this database with additional features like user feedback options,
real time ticket tracking option, advanced payment system and many more, it could be perfect
database and a complete end to end solution for event organizers, ticket selling agencies, etc.
Modified version of this database could be used in real life event management.

---------- X ----------

You might also like