This assignment is designed to evaluate your understanding of database table design, ERD relationships and SQL queries. You will work with a simplified Vehicle Rental System database.
By completing this assignment, you will be able to:
- Design an ERD with 1 to 1, 1 to Many and Many to 1 relationships
- Understand primary keys and foreign keys
- Write SQL queries using JOIN, EXISTS and WHERE
The system manages:
- Users
- Vehicles
- Bookings
Your database design should support these real world scenarios:
- User role (Admin or Customer)
- Name, email, password, phone number
- Each email must be unique (no duplicate accounts)
- Vehicle name, type (car/bike/truck), model
- Registration number (must be unique)
- Rental price per day
- Availability status (available/rented/maintenance)
- Which user made the booking (link to Users table)
- Which vehicle was booked (link to Vehicles table)
- Start date and end date of rental
- Booking status (pending/confirmed/completed/cancelled)
- Total cost of the booking
Note: You must submit your ERD in the submission otherwise you will get 0 marks.
Design an Entity Relationship Diagram (ERD) for the Vehicle Rental System.
You must include the following tables:
- Users
- Vehicles
- Bookings
Your ERD must clearly show:
- One to Many: User → Bookings
- Many to One: Bookings → Vehicle
- One to One (logical): Each booking connects exactly one user and one vehicle
- Primary Keys (PK)
- Foreign Keys (FK)
- Relationship cardinality
- Status fields (e.g. booking status, vehicle availability)
You need to submit your ERD as:
- Lucidchart ERD Tool
- Submit a public, shareable ERD link.
Write SQL queries based on your designed schema.
Check Sample Input/Output: To understand the expected results for each query, please refer to the Sample Query Results (QUERY.md) file.
Retrieve booking information along with:
- Customer name
- Vehicle name
Concepts used: INNER JOIN
Find all vehicles that have never been booked.
Concepts used: NOT EXISTS
Retrieve all available vehicles of a specific type (e.g. cars).
Concepts used: SELECT, WHERE
Find the total number of bookings for each vehicle and display only those vehicles that have more than 2 bookings.
Concepts used: GROUP BY, HAVING, COUNT
Note: Answer the questions in your own words and record them on camera in Bengali or English. Spend about two minutes on each question.
"This video is a safe space to practice - confidence grows every time you speak."
What is a foreign key and why is it important in relational databases?
What is the difference between WHERE and HAVING clauses in SQL?
What is a primary key and what are its characteristics?
What is the difference between INNER JOIN and LEFT JOIN in SQL?
| Section | Marks |
|---|---|
| ERD Design | 60% |
| SQL Queries | 20% |
| Theory Answers | 20% |
- Sample Query Results - Expected input and output examples for SQL queries
- Submission Guide - Assignment submission guidelines and deadlines