Sample Question - Database Final Exam
Sample Question - Database Final Exam
Database
Sample Question
You are provided with a database schema for a travel system. Your task is to create the database,
insert sample data, and then write SQL queries to answer the questions about the data.
Company:
id name city contact
1 SR Group Dhaka 80988789
2 Karim Group Faridpur 576577867
3 Hanif Travel Dhaka 57678677
Bus
bus_id bus_name model company_id
1 Hanif volvo 3
2 Nabil scania 1
3 Alam volvo 1
4 SR sarkar 1
5 Hanif Scania Scania 3
Driver
Page 1 of 2
EDGE: BU-CSE Digital Skills Training
Passenger
p_id first_name last_name gender email phone
1 nasir Hossain male nasir@gmail.com 1900987654
2 azim Uddin male azim@gmail.com 9876262636
3 bina Kabir female bina@gmail.com 1933987654
4 aslam Khan male aslam@gmail.com 9876262636
Book_ticket:
t_id passenger_id bus_id route_id journey_date seat_no
1 1 3 1 11/15/2019 A3
2 2 3 2 11/15/2019 A4
3 3 3 1 11/15/2019 A8
4 4 3 1 11/15/2019 B4
Payment
payment_id passenger_id bus_id amount
1 4 3 500
2 2 1 500
Good Luck!!!
Page 2 of 2