IMS-CSET-201-Lab Assignment 2.1
IMS-CSET-201-Lab Assignment 2.1
CO-Mapping
CO1 CO2 CO3
Q1 √ √
Q2 √ √
Q3 √ √
Q4 √ √
Q5 √ √
Q6 √ √
Q7 √ √
Q8 √ √
Q9 √ √
Q10 √ √
Q11 √ √
Q12 √ √
A- Type- Lab Assignment No. (Week 1, Assignment No. 1)
Objectives
1. Students will be able to learn SQL.
2. Student will be able to learn DDL commands and data types.
3. Student will be able to learn DML commands.
Case Study
School of Computer Science Engineering and Technology
Image Source:
[https://techcrunch.com/wp-content/uploads/2013/02/india_bangalore_bus_.jpg?w=1390&crop=1]
RedBus is India's largest online bus ticketing platform that has transformed bus travel in the country
by bringing ease and convenience to millions of Indians who travel using buses. Founded in 2006,
redBus is part of India's leading online travel company MakeMyTrip Limited.
Goal:
The bus reservation system facilitates the passengers to enquire about the buses available based on the
source and destination, booking and cancellation of tickets, enquire about the status of the booked ticket,
etc. The aim of case study is to design and develop a database maintaining the records of different buses,
buses status, and passengers. The record of buses includes its number, name, source, destination, and
days on which it is available, whereas the record of bus status includes dates for which tickets can be
booked, the total number of seats available, and the number of seats already booked. The database must
be developed on My Sql platform.
Description:
Passengers can book their tickets for the bus in which seats are available. For this, the passenger has to
provide the desired bus type and the date for which the ticket is to be booked. Before booking a ticket
for apassenger, the validity of the bus type and booking date is checked. Once the bus number and
booking dateare validated, it is checked whether the seat is available. If yes, the ticket is booked with
confirm status and the corresponding ticket ID is generated which is stored along with other details of
the passenger. Afterall the available tickets are booked, certain numbers of tickets are booked with
waiting status. If the waiting lot is also finished, then tickets are not booked and a message of non‐
availability of seats is displayed. The ticket once booked can be cancelled at any time. For this, the
passenger must provide the ticket ID(the unique key). The ticket ID is searched, and the corresponding
record is deleted. With this, the firstticket with a waiting status also gets confirmed.
Assumptions:
Since the reservation system is very large in reality, it is not feasible to develop the case study to that
extent and prepare documentation at that level. Therefore, a small sample case study has been created to
School of Computer Science Engineering and Technology
demonstrate the working of the reservation system. To implement this sample case study, some
assumptions have been made, which are as follows:
• The number of buses has been restricted to 7-10.
• The booking is considered only for 10 days from the current date.
• Only two categories of tickets can be booked, namely, AC and Non-AC.
• The status of the ticket will be either confirm or not confirmed.
• The source and destination of the buses have been restricted to Tables will be created as
follows:
1. List_bus: This table consists of details about all the available buses. The information stored in
this table includes bus number, bus name, source, destination, fair for AC ticket, fair for general
ticket, and weekdays on which bus is available.
Constraints: The bus no. should be unique.
2. Status_bus: This table consists of details about the dates on which ticket can be booked for a
bus and the status of the availability of tickets. The information stored in this table includes bus
number, bus date, total number of AC seats, total number of general seats, number of AC seats
booked, and number of non-AC seats booked.
3. Passenger_details: This table consists of details about the booked tickets. The information
stored in this table includes ticket ID, bus number, date for which ticket is booked, name, age,
sex and address of the passenger, status of reservation (either confirmed or waiting), and category
for which ticket is booked.
Constraints: Passenger_id should be unique.
School of Computer Science Engineering and
Technology
List_Buses
Datatypes Used:
Bus_no varchar();
Bus_name varchar();
Source varchar();
Destination varchar();
Fare int;
Date date;
Time time;
Bus_Status
Datatypes Used :
Bus_no varchar();
Available_seats int;
Booked_seats int;
School of Computer Science Engineering and
Technology
Passengers
Datatype Used:
Passenger_id Varchar();
P_name Varchar();
Bus_no varchar();
Gender varchar(),
Age int;
Status varchar();
Questions:
5. Find all records in the passengers table with null values in P_name
column.
7. Find all the buses whose source is either ISBT or Pari Chauk.
School of Computer Science Engineering and
Technology
8. Add a column name as blood group in passengers table.