DBMS Project 1
DBMS Project 1
Background
A logistics company manages a fleet of vehicles for transporting goods and services. The
company currently tracks vehicle details, trip records, driver assignments, and maintenance
schedules using paper-based methods. To improve efficiency and record-keeping, they require a
digital database system to manage these operations effectively.
You are required to design and implement a Fleet Management System using SQL Server
Management Studio (SSMS), following proper database design principles. This project will test
your understanding of database modeling, normalization, SQL queries, data types in SQL and
constraints.
Project Requirements
Before designing the database, identify and document the key requirements of the system.
Consider the following questions:
Vehicles:
o What information needs to be stored for each vehicle?
o How should the system track the availability and maintenance status of vehicles?
Drivers:
o What details should be recorded for each driver?
o How should driver-vehicle assignments be managed?
Trips:
o What information should be recorded for each trip (e.g., start and end location,
distance, fuel usage)?
o How should the system track trips completed by each vehicle and driver?
Maintenance:
o What maintenance details need to be recorded?
o How can the system help schedule and track upcoming maintenance?
Reports:
o What types of reports would be useful for fleet managers (e.g., total fuel
consumption, maintenance costs, driver performance)?
Deliverable:
A well-structured requirements document outlining all system needs, business rules and
assumptions.
Phase 2: Database Design
Deliverable:
1. Create Database:
o Write an SQL script to create the database.
2. Create Tables with Constraints:
o Implement tables for:
Vehicles: VehicleID, Make, Model, LicenseNumber, FuelType, Status
e.t.c.
Drivers: DriverID, Name, Contact, LicenseNumber, AssignedVehicleID
(Foreign Key).
Trips: TripID, VehicleID (Foreign Key), DriverID (Foreign Key), Origin,
Destination, Date, Distance, FuelConsumed.
Maintenance: MaintenanceID, VehicleID (Foreign Key), ServiceDate,
ServiceType, ServiceProvider, Cost.
o Include PRIMARY KEY, FOREIGN KEY, NOT NULL, and CHECK constraints
where necessary.
Deliverable:
Implement SQL queries to perform CRUD (Create, Read, Update, Delete) operations on the
database.
1. Data Insertion:
o Insert sample data for vehicles, drivers, trips, and maintenance records.
2. Data Retrieval:
o Retrieve details of all vehicles, drivers, and trips.
3. Updating Records:
o Update vehicle status (e.g., mark a vehicle as "Under Maintenance").
o Update driver assignments.
4. Deleting Records:
o Remove outdated records (e.g., discontinued vehicles).
5. Sample Queries to Implement:
o List all vehicles along with their status.
o Show all trips completed by a specific driver.
o Find vehicles that require maintenance in the next month.
o Calculate total fuel consumption for all trips made by a vehicle.
o Display a report on maintenance costs for each vehicle.
Deliverable:
For students who wish to go beyond the basic requirements, the following advanced queries can
be implemented:
Aggregation:
o Generate reports on total mileage per vehicle, fuel efficiency, and maintenance
costs.
JOIN Operations:
o Retrieve a list of trips with vehicle and driver details using INNER JOIN.
Subqueries:
o Identify the driver with the highest number of completed trips.
Deliverable:
Each student must submit a hard copy document with the following sections:
1. SQL Script for Database Creation – SQL file containing database and table creation
commands. (10 Marks) - Submit via email
2. SQL Script for Data Insertion – Sample data for testing the system. (10 Marks) -
Submit via email
3. SQL Queries for Data Operations – SELECT, INSERT, UPDATE, DELETE queries.
(10 Marks) - Submit via email
4. SSMS screenshots for the created tables and queries. - Hard copies per student
5. Each group MUST have a class presentation of their work. (10 Marks)