Database Assignment 3
Database Assignment 3
Section: L2C6
A. Create a User and give privileges to the user. Username should be your Name
and password should be your section.
DATABASE
Name: Ankush khadka
Section: L2C6
Creating tables:
DATABASE
Name: Ankush khadka
Section: L2C6
DATABASE
Name: Ankush khadka
Section: L2C6
DATABASE
Name: Ankush khadka
Section: L2C6
DATABASE
Name: Ankush khadka
Section: L2C6
DATABASE
Name: Ankush khadka
Section: L2C6
DATABASE
Name: Ankush khadka
Section: L2C6
DATABASE
Name: Ankush khadka
Section: L2C6
DATABASE
Name: Ankush khadka
Section: L2C6
DATABASE
Name: Ankush khadka
Section: L2C6
C.
1. Select an airport name where capacity is less than 60000 per month.
DATABASE
Name: Ankush khadka
Section: L2C6
DATABASE
Name: Ankush khadka
Section: L2C6
4. Display airports having either location Nepal or capacity greater or equal to 30000.
5. Display airports having neither location Nepal nor capacity greater or equal to 30000.
8. Display full name of employees who were born before 2000 and working in department 2.
DATABASE
Name: Ankush khadka
Section: L2C6
DATABASE
Name: Ankush khadka
Section: L2C6
11. Display flights number, airline where departure time is 2023-10-5 8:00:00 and arrival
time 2023- 10-5 20:00:00 and from Indian airlines.
12. Select full name and passenger id of passengers from Nepal, India, Bangladesh.
DATABASE
Name: Ankush khadka
Section: L2C6
13. Select full name and passenger id of passengers whose nationality is not Nepali and English.
14. Select all luggage id whose weight is between 20 to 30 kg from flight TK1001.
Before dropping:
After dropping:
DATABASE
Name: Ankush khadka
Section: L2C6
DATABASE
Name: Ankush khadka
Section: L2C6
17. Set the departure time of flight AF401 and AF402 to 2023-10-15 00:15:00 departing from JFK2.
DATABASE
Name: Ankush khadka
Section: L2C6
DATABASE
Name: Ankush khadka
Section: L2C6
19. Give discount of 15% to all tickets having seat no 20c, 21b, 20a.
Before Adding:
After Adding:
DATABASE
Name: Ankush khadka
Section: L2C6
21. Change runway id to store number and text and update all.
DATABASE
Name: Ankush khadka
Section: L2C6
DATABASE
Name: Ankush khadka
Section: L2C6
22. Drop Passengers table. If any error find reason for the error.
The reason for the error is because there is another table that depends on the existence of
the Passenger table through a foreign key relationship. That’s why to drop it first we have
to Identify the table that references the Passenger table through a foreign key. And after
that we should either drop the referencing table first or remove the foreign key constraint.
After resolving, the Passenger table can be dropped.
24. Show flight no, airline name, Departure and arrival airport, and runway id, name for all
flights. (Concept of join)
DATABASE
Name: Ankush khadka
Section: L2C6
DATABASE