0% found this document useful (0 votes)
1 views16 pages

Database Project Report 2025[1]

The document is a project report for a Vehicle Showroom Management System, detailing its design and implementation to streamline vehicle bookings, customer management, and service records. It includes an abstract, problem statement, project goals, system design with ER diagrams, normalization, and SQL implementation for database operations. The report aims to provide a reliable digital solution for managing vehicle showrooms efficiently.

Uploaded by

ibrahiman2468
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
1 views16 pages

Database Project Report 2025[1]

The document is a project report for a Vehicle Showroom Management System, detailing its design and implementation to streamline vehicle bookings, customer management, and service records. It includes an abstract, problem statement, project goals, system design with ER diagrams, normalization, and SQL implementation for database operations. The report aims to provide a reliable digital solution for managing vehicle showrooms efficiently.

Uploaded by

ibrahiman2468
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 16

VEHICLE SHOWROOM MANA

PROJECT REPORT

5/30/2025

 M. Ibrahim Usman 243506


 Abdulrafay Jahangir 243504
 Abdul Ghani 243544
 Muhammad Abdullah 243608

Course Instructor: Mam aleena imran


1|DATABASE SYSTEM REPORT

TABLE OF CONTENTS

1. Abstract
2. Introduction
3. Problem Statement
4. Project Goal
5. System Design & Implementation
 ER Diagram
 Relational Model
 Relational Schema
6. Normalization
7. SQL Implementation
 DDL
 DML
 Select Queries
8. Results & Outputs
9. Database Connection with OOP Code
10.Conclusion
11.References
2|DATABASE SYSTEM REPORT

1. Abstract:

This report presents a comprehensive overview of a Vehicle Showroom Management System


designed to perform operations including customer management, vehicle bookings, payments,
employee management, showroom handling, and service records. Through database design and
SQL implementation, the system offers a reliable platform for vehicle booking and rental
services.

2. Introduction:

A Vehicle Showroom Management System maintains records of its customers, bookings,


vehicles, payments, employees, showrooms, and vehicle service records. The system allows a
customer having attributes such as CustomerID, Name, Contact Number, Address and Email
to log in and make one or more bookings. Each booking includes details like BookingID,
Booking Date, and DeliveryDate, and is linked to the respective customer. A booking can
include multiple vehicles, each described by attributes such as VehicleID, VehicleName,
Model, Engine, Ex_Price, and BodyType. Every booking is associated with exactly one
payment having attributes PaymentID, Amount, Date, and PaymentMethod. The system
tracks which employee, having attributes EmployeeID, Name, Designation, and Contact, is
responsible for processing each booking. One employee may handle several bookings. Each
vehicle is assigned to a specific showroom, with each showroom described by ShowroomID,
Name, ContactNumber and Location. A showroom may contain multiple vehicles. Vehicles
may also undergo regular maintenance or repairs and these are recorded in service records table.
Each service record includes ServiceID, ServiceDate, and Description. Employees also carry
out these service tasks. The system helps manage bookings, payments, and maintenance to keep
the vehicle rental process smooth and well-organized.

3. Problem Statement:

Manual vehicle booking and management systems are time consuming and inefficient.
Showrooms can’t manage their records for sales accurately. There is no digital storage of
customer and vehicle data for the showroom. Manual records maintenance becomes complex
when number of vehicles and customers increase. That’s why showrooms needs a trustable and
efficient management system for handing their records easily.

4. Project Goal:

To design and implement a Vehicle Showroom Management System that manages vehicle
inventory and bookings efficiently. It may help the showrooms to manage their records and store
them at a safe place.
3|DATABASE SYSTEM REPORT

5. System Design & Implementation:


 ER Diagram:

ENTITIES & ATTRIBUTES:

1. Customer
o CustomerID (PK)
o Name
o Contact Number
o Email
o Address
2. Vehicle
o VehicleID (PK)
o VehicleName
o Model
o Ex_Price
o Engine
o BodyType
3. Booking
o BookingID (PK)
o Booking Date
o Delivery Date
o VehicleID (FK)
o CustomerID (FK)
o EmployeeID (FK)
4. Payment
o PaymentID (PK)
o Amount
o Payment Date
o Payment Method
o BookingID (FK)
5. Employee
o EmployeeID (PK)
o Name
o Designation
o Contact
6. Showroom
o ShowroomID (PK)
o Name
o Location
o Contact Number
7. Service Record
o ServiceID (PK)
o ServiceDate
o Description
o ServicedBy
o VehicleID (FK)
4|DATABASE SYSTEM REPORT

RELATIONSHIPS AND TYPES:


Relationship Name Entities Type Explanation
A customer can make multiple bookings or each
Books Customer → Booking 1:M
booking is placed by exactly one customer
A booking can include exact one vehicle or one
Includes Booking → Vehicle 1:1
vehicle can be in one booking.
A booking generates one payment record or each
Generates Booking → Payment 1:1
payment is associated with one booking only.
An employee can process multiple bookings or
Processes Employee → Booking 1:M
each booking is processed by one employee.
Many employees belong to one showroom or
Belongs To Employee → Showroom M:1
each showroom contains many employees.
An employee can have multiple service records
Serviced By Employee → Service Record 1:M or each service record is created by one
employee.
A vehicle can have multiple service records or
Vehicle Service Vehicle → Service Record 1:M
each service record contains one vehicle.
5|DATABASE SYSTEM REPORT

 Relational Model:

 Relational Schema:

Customer (CustomerID, Name, ContactNumber, Email, Address)

Vehicle (VehicleID, VehicleName, Model, BodyType, Engine, Ex_Price)

Showroom (ShowroomID, Name, Location, ContactNumber)

Employee (EmployeeID, Name, Designation, Contact, ShowroomID)

Booking (BookingID, BookingDate, DeliveryDate, VehicleID, CustomerID, EmployeeID)

Payment (PaymentID, Amount, PaymentDate, PaymentMethod, BookingID)

Service Record (ServiceID, ServiceDate, Description, ServicedBy, VehicleID)

6. Normalization:
 1st NF
6|DATABASE SYSTEM REPORT

Tables are already in 1st NF because there are no multi-valued fields and no repeating groups.

 2nd NF

Tables are in 2nd NF because they are in 1st NF and there is no partial dependency (non-key
attributes depending on part of composite key).

 3rd NF

Tables are in 3rd NF because they are in 2nd NF and there is no transitive dependency (non-key
attributes depending on other non-key attribute).

Final Normalized Tables:

o Customer(CustomerID, Name, ContactNumber, Email, Address)


o Vehicle(VehicleID, VehicleName, Model, Engine, Ex_Price, BodyType)
o Showroom(ShowroomID, Name, Location, ContactNumber)
o Employee(EmployeeID, Name, Designation, Contact, ShowroomID)
o Booking(BookingID, BookingDate, DeliveryDate, VehicleID, CustomerID,
EmployeeID)
o Payment(PaymentID, Amount, PaymentDate, PaymentMethod, BookingID)
o ServiceRecord(ServiceID, ServiceDate, Description, ServicedBy (FK to EmployeeID),
VehicleID)

7. SQL Implementation:
 DDL:

create database Manage;


use Manage;

CREATE TABLE Customer(


CustomerID INT PRIMARY KEY,
Name VARCHAR(100),
ContactNumber VARCHAR(50),
Email VARCHAR(100),
Address VARCHAR(100)
);

CREATE TABLE Vehicle(


VehicleID INT PRIMARY KEY,
VehicleName VARCHAR(50),
Model INT,
BodyType VARCHAR(50),
7|DATABASE SYSTEM REPORT

Engine INT,
Ex_Price INT
);

CREATE TABLE Showroom(


ShowroomID INT PRIMARY KEY,
Name VARCHAR(100),
Location VARCHAR(100),
ContactNumber VARCHAR(50)
);

CREATE TABLE Employee(


EmployeeID INT PRIMARY KEY,
Name VARCHAR(100),
Designation VARCHAR(50),
Contact VARCHAR(50),
ShowroomID INT,
FOREIGN KEY(ShowroomID) REFERENCES Showroom(ShowroomID)
);

CREATE TABLE Booking(


BookingID INT PRIMARY KEY,
BookingDate DATE,
DeliveryDate DATE,
VehicleID INT UNIQUE,
CustomerID INT,
EmployeeID INT,
FOREIGN KEY(VehicleID) REFERENCES Vehicle(VehicleID),
FOREIGN KEY(CustomerID) REFERENCES Customer(CustomerID),
FOREIGN KEY(EmployeeID) REFERENCES Employee(EmployeeID)
);

CREATE TABLE Payment(


PaymentID INT PRIMARY KEY,
Amount INT,
PaymentDate DATE,
PaymentMethod VARCHAR(50),
BookingID INT UNIQUE,
FOREIGN KEY(BookingID) REFERENCES Booking(BookingID)
);

CREATE TABLE ServiceRecord(


ServiceID INT PRIMARY KEY,
ServiceDate DATE,
Description VARCHAR(50),
ServicedBy INT,
8|DATABASE SYSTEM REPORT

VehicleID INT,
FOREIGN KEY(ServicedBy) REFERENCES Employee(EmployeeID),
FOREIGN KEY(VehicleID) REFERENCES Vehicle(VehicleID)
);

 DML:
o INSERT

INSERT INTO Customer(CustomerID,Name,ContactNumber,Email,Address)


VALUES
(101,'Babar Azam','03001234567','[email protected]','Peshawar'),
(102,'Shaheen Afridi','03009876543','[email protected]','Lahore'),
(103,'Mohammad Rizwan','03111234567','[email protected]','Multan');

INSERT INTO
Vehicle(VehicleID,VehicleName,Model,Engine,Ex_Price,BodyType)
VALUES
(1,'Corolla', 2024, 44, 10000, 'Sedan'),
(2,'Tesla', 2014, 55, 9900, 'SUV'),
(3,'Civic', 2015, 25, 6900, 'Hatchback');

INSERT INTO Showroom(ShowroomID,Name,Location,ContactNumber)


VALUES
(501,'Kashif Motors','Multan','0611234567'),
(502,'Rafay Motors','Lahore','0427654321');

INSERT INTO
Employee(EmployeeID,Name,Designation,Contact,ShowroomID) VALUES
(201,'Saim Ayub','Manager','03005551234','501'),
(202,'Fakhar Zaman','Sales Executive','03211231234','501'),
(203,'Muhammad Amir','Manager','03097552323','502');

INSERT INTO
Booking(BookingID,BookingDate,DeliveryDate,VehicleID,CustomerID,Emp
loyeeID) VALUES
(301,'2025-05-10','2025-05-15',3,101,202),
(302,'2025-05-12','2025-05-18',2,102,201);

INSERT INTO
Payment(PaymentID,Amount,PaymentDate,PaymentMethod,BookingID)
VALUES
(401,5200000,'2025-05-11','Card',301),
(402,6500000,'2025-05-13','Cash',302);
9|DATABASE SYSTEM REPORT

INSERT INTO
ServiceRecord(ServiceID,ServiceDate,Description,ServicedBy,VehicleID)
VALUES
(601,'2025-05-20','Oil change',201,3),
(602,'2025-05-22','Brake pad replacement',202,2);

o UPDATE
UPDATE Vehicle SET Engine = 1400 WHERE VehicleID=2;
UPDATE Showroom SET ContactNumber = '03097552323' WHERE
ShowroomID=502;
o DELETE
DELETE FROM Customer WHERE CustomerID = 101;
DELETE FROM Vehicle WHERE VehicleID=3;

 Select Queries:

--SIMPLE QUERIES--
SELECT * FROM Customer;
SELECT Name, CustomerID FROM Customer;
SELECT * FROM Vehicle WHERE BodyType = 'Sedan';
SELECT DISTINCT VehicleName FROM Vehicle;
SELECT COUNT(ShowroomID) AS TotalShowrooms FROM Showroom;
SELECT * FROM Employee WHERE Designation = 'Manager' AND ShowroomID
= 502;
SELECT * FROM Vehicle ORDER BY Ex_Price ASC;
SELECT * FROM Payment ORDER BY Amount DESC;
SELECT Model,BodyType FROM Vehicle WHERE Ex_Price BETWEEN 7000
AND 10000;
/*------------------*/

/*JOINS*/
-- Inner Join
SELECT * FROM Booking INNER JOIN Customer ON Booking.CustomerID =
Customer.CustomerID;
-- Left Outer Join
SELECT * FROM Vehicle LEFT OUTER JOIN Booking ON Vehicle.VehicleID =
Booking.VehicleID;
-- Right Outer Join
SELECT * FROM Showroom RIGHT OUTER JOIN Employee ON
Showroom.ShowroomID = Showroom.ShowroomID;
-- Full Outer Join
10 | D A T A B A S E S Y S T E M R E P O R T

SELECT * FROM Booking FULL OUTER JOIN Payment ON Booking.BookingID


= Payment.BookingID;
-- Cross Join
SELECT * FROM Customer CROSS JOIN Vehicle;
-- Theta Join
SELECT Customer.CustomerID, Customer.Name AS CustomerName,
Vehicle.VehicleID, Vehicle.VehicleName, Vehicle.Ex_Price FROM Customer JOIN
Vehicle ON Vehicle.Ex_Price > 8000 WHERE Customer.CustomerID IN (101, 102,
103);
-- Left Outer Join Excluding Inner Join
SELECT Customer.CustomerID, Customer.Name, Customer.ContactNumber FROM
Customer LEFT JOIN Booking ON Customer.CustomerID = Booking.CustomerID
WHERE Booking.BookingID IS NULL;
-- Right Outer Join Excluding Inner Join
SELECT Booking.BookingID, Booking.BookingDate, Booking.DeliveryDate FROM
Customer RIGHT JOIN Booking ON Customer.CustomerID = Booking.CustomerID
WHERE Customer.CustomerID IS NULL;
-- Full Outer Join Excluding Inner Join
SELECT Customer.CustomerID, Customer.Name AS Name FROM Customer FULL
OUTER JOIN Booking ON Customer.CustomerID = Booking.CustomerID WHERE
Customer.CustomerID IS NULL OR Booking.BookingID IS NULL;
-- SELF JOIN
SELECT E1.EmployeeID AS E1_ID,E1.Name AS E1_Name,E2.EmployeeID AS
E2_ID,E2.Name AS E2_Name,E1.ShowroomID FROM Employee E1 JOIN
Employee E2 ON E1.ShowroomID = E2.ShowroomID AND E1.EmployeeID <
E2.EmployeeID;
/*------------------*/

/*SUBQUERIES*/
SELECT EmployeeID, Name, Designation, Contact FROM Employee WHERE
ShowroomID = (SELECT ShowroomID FROM Showroom WHERE Location =
'Multan');
SELECT VehicleID, VehicleName, Model, Ex_Price, Ex_Price - (SELECT
AVG(Ex_Price) FROM Vehicle) AS PriceDifference FROM Vehicle WHERE
Ex_Price > (SELECT AVG(Ex_Price) FROM Vehicle);
SELECT * FROM Booking WHERE VehicleID IN (SELECT VehicleID FROM
Vehicle WHERE BodyType IN ('Sedan', 'SUV'));
SELECT EmployeeID, Name, Designation, Contact FROM Employee WHERE
ShowroomID NOT IN (SELECT ShowroomID FROM Showroom WHERE Location
= 'Lahore');
SELECT * FROM Booking WHERE EmployeeID IN (SELECT EmployeeID FROM
Employee WHERE ShowroomID = (SELECT ShowroomID FROM Showroom
WHERE Location = 'Multan'));
SELECT * FROM Payment WHERE Amount > SOME (SELECT Amount FROM
Payment WHERE PaymentID = 401);
11 | D A T A B A S E S Y S T E M R E P O R T

SELECT * FROM Payment WHERE Amount < ALL (SELECT Amount FROM
Payment WHERE PaymentID = 402);
SELECT CustomerID, Name, ContactNumber, Email, Address FROM Customer
WHERE EXISTS (SELECT * FROM Booking WHERE Customer.CustomerID =
Booking.CustomerID);
SELECT CustomerID, Name, ContactNumber, Email, Address FROM Customer
WHERE NOT EXISTS (SELECT * FROM Booking WHERE Customer.CustomerID
= Booking.CustomerID);
SELECT Address AS City FROM Customer WHERE Address IS NOT NULL
UNION SELECT Location AS City FROM Showroom WHERE Location IS NOT
NULL;
SELECT Address AS City FROM Customer WHERE Address IS NOT NULL
INTERSECT SELECT Location AS City FROM Showroom WHERE Location IS
NOT NULL;
SELECT Name FROM Employee WHERE ShowroomID IN (SELECT ShowroomID
FROM Showroom WHERE Location = 'Multan')AND EmployeeID IN (SELECT
EmployeeID FROM Booking WHERE VehicleID = 3);
/*-------------------*/

---VIEWS CALLING---
SELECT * FROM SimpleCustomerBooking;
SELECT * FROM SimpleVehicleService;
/*-------------------*/

---STORED PROCEDURES CALLING---


DECLARE @count INT;
EXEC ListAllCustomers @customer_count = @count OUTPUT;
PRINT 'Total Customers: ' + CAST(@count AS VARCHAR);

DECLARE @old INT;


EXEC UpdateVehiclePrice @VehID = 1, @NewPrice = 10500, @OldPrice = @old
OUTPUT;
PRINT 'Old Price was: ' + CAST(@old AS VARCHAR);
/*-------------------*/

---FUNCTIONS CALLING---
SELECT dbo.GetEmployeeDescription('Saim Ayub', 'Manager') AS Description;

SELECT * FROM GetEmployeeDetailsByDesignation('Manager');


/*-------------------*/

---TRIGGER CALLING---
UPDATE ServiceRecord SET Description = 'Engine tuning' WHERE ServiceID =
601;
/*-------------------*/
12 | D A T A B A S E S Y S T E M R E P O R T

---TRANSACTION---
BEGIN TRANSACTION;
BEGIN TRY
INSERT INTO Booking (BookingID, BookingDate, DeliveryDate, VehicleID, CustomerID,
EmployeeID)
VALUES (303, '2025-06-01', '2025-06-05', 1, 103, 203);

INSERT INTO Payment (PaymentID, Amount, PaymentDate, PaymentMethod, BookingID)


VALUES (403, 7500000, '2025-06-02', 'Card', 303);

COMMIT;
PRINT 'Booking and payment saved successfully.';
END TRY
BEGIN CATCH
ROLLBACK;
PRINT 'Error occurred. Transaction rolled back.';
END CATCH;

8. Results & Outputs:


13 | D A T A B A S E S Y S T E M R E P O R T
14 | D A T A B A S E S Y S T E M R E P O R T

9. Database Connection with OOP Code:

We have connected our database project table Vehicle with our OOP project code using Dev C+
+ and MySQL. New vehicles can be added from the console and saved in the database table.
Then we can retrieve data on the Command Line Client or MySQL Workbench by writing
Queries.
15 | D A T A B A S E S Y S T E M R E P O R T

10.Conclusion:

The Vehicle Showroom Management System helps manage all the important records and
activities related to vehicles in a showroom. It keeps track of customers, vehicles, bookings,

employees, payments, and services in an organized way.

11.References:

 Database Systems: A Practical Approach to Design, Implementation, and Management


6th edition, Thomas Connolly, Carolyn Begg
 SQL Server Management Studio.
 MySQL Workbench
 MySQL 8.0 Command Line Client
 Course notes and project guidelines.

You might also like