3.Consider the table FLIGHT given below. Write SQL queries for the questions below: a.Display details of all flights starting from Delhi. b.Display details of flights that have more than 4 number of flights operating. c.Display flight codes, starting place, destination, number of flights in descending order of number of flights. d.Display destinations along with flight codes of all the destinations starting with ‘A’.
时间: 2024-03-09 21:47:49 浏览: 74
flights_flights_flights.json_echarts_
Sure, here are the SQL queries for the questions:
a. To display details of all flights starting from Delhi:
```
SELECT * FROM FLIGHT WHERE STARTING_PLACE = 'Delhi';
```
b. To display details of flights that have more than 4 number of flights operating:
```
SELECT * FROM FLIGHT WHERE NUMBER_OF_FLIGHTS > 4;
```
c. To display flight codes, starting place, destination, number of flights in descending order of number of flights:
```
SELECT FLIGHT_CODE, STARTING_PLACE, DESTINATION, NUMBER_OF_FLIGHTS
FROM FLIGHT
ORDER BY NUMBER_OF_FLIGHTS DESC;
```
d. To display destinations along with flight codes of all the destinations starting with ‘A’:
```
SELECT FLIGHT_CODE, DESTINATION
FROM FLIGHT
WHERE DESTINATION LIKE 'A%';
```
阅读全文