0% found this document useful (0 votes)
11 views24 pages

Database Assignment 3

Uploaded by

khadkaankush10
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views24 pages

Database Assignment 3

Uploaded by

khadkaankush10
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 24

Name: Ankush khadka

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

B. Create a table with necessary constraints.

Creating tables:

DATABASE
Name: Ankush khadka
Section: L2C6

Inserting values to Airport table:

DATABASE
Name: Ankush khadka
Section: L2C6

Inserting values to Manager table:

DATABASE
Name: Ankush khadka
Section: L2C6

Inserting values to Department table:

DATABASE
Name: Ankush khadka
Section: L2C6

Inserting values to Employees table:

DATABASE
Name: Ankush khadka
Section: L2C6

Inserting values to Terminal table:

DATABASE
Name: Ankush khadka
Section: L2C6

Inserting to Runaway table:

Inserting into Flights table:

DATABASE
Name: Ankush khadka
Section: L2C6

Inserting into Passenger values:

DATABASE
Name: Ankush khadka
Section: L2C6

Inserting into Tickets table:

Inserting values to Luggage table:

DATABASE
Name: Ankush khadka
Section: L2C6

C.
1. Select an airport name where capacity is less than 60000 per month.

2. Display all airports from Nepal.

DATABASE
Name: Ankush khadka
Section: L2C6

DATABASE
Name: Ankush khadka
Section: L2C6

3. Display capacity of airports annually.

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.

6. Display airports from location ‘Nepal’, ‘India’, ‘China’ and ‘USA’.

7. Display airports from location Nepal as ‘Nepal Airlines’.

8. Display full name of employees who were born before 2000 and working in department 2.

DATABASE
Name: Ankush khadka
Section: L2C6

9. Display employees having last name ‘Willson’.

DATABASE
Name: Ankush khadka
Section: L2C6

10. Display unique department names.

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.

15. Drop price of tickets by 10 %.

Before dropping:

After dropping:

16. Change name of Indian Airlines to Bharat Mata airlines.

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.

18. Add a column Dashain discounts in tickets.

Before adding the column:

After adding the column:

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.

20. Add runaway names for all records.

Before Adding:

After Adding:

DATABASE
Name: Ankush khadka
Section: L2C6

21. Change runway id to store number and text and update all.

Changing runaway id to store number:

DATABASE
Name: Ankush khadka
Section: L2C6

Updating all values of store number as well

After changing and updating:

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.

23. Rename column manager id to employee.

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

You might also like