DBMS 08 03

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

EX_NO:04

08/03/2024

SQL COMMANDS USING AGGREGATE FUNCTIONS

AIM:
Creation a database for automating an airline reservation process. You can create
the following schemas to store the necessary information.

Flights (Flight_number, Airline_name, Source_airport, Destination_airport,


Departure_time, Arrival_time, Maximum_Capacity, Seats_Remaining)
Passengers (Passport_number, First_name, Last_name, Email_ID, Mobile
number)
Ticket Bookings (Booking_ID, Booking date, Flight_number,
Passport_number, No. of Tickets, Seat_number, Ticket_price)
QUERIES:
1. Identify the passenger who has booked the maximum tickets on a given date.

2. Calculate the total seats available on all flights leaving from “Chennai”.

3. Which of the flights has the lowest seating capacity?

4. Display the total ticket cost for a passenger who is booking a ticket for his entire family (say 4 members).

5. List the mobile numbers of the passenger(s) traveling on a flight with number “9E126WT”.
6. Determine the average price of a ticket to fly from “Delhi” to “Mumbai”.

7. Display the number of flights and all the flight numbers operated by an airline starting with “Air”.

CONCLUSION:
Creation a database for using sql commands using aggregate functions in sql+ is
executed.

You might also like