Write a query that provides a list of all planes that have a seat count of 100 or more, ordered from lowest to highest number of seats. What is the TAIL_NUMBER of the plane with the second lowest number of seats in that list

Respuesta :

Answer:

a. SELECT * FROM PLANES

WHERE SEAT >= 100 ORDER BY SEAT

b. SELECT TAIL_NUMBER from PLANES

where SEAT = (SELECT MIN(SEAT) from PLANES where SEAT > (SELECT MIN(SEAT) from PLANE))

Explanation:

There's no sufficient information to answer the b part of the question as the table is not provided.

For the (a) part! Here's the solution.

Assume the

1. Table name to be PLANES

2. Column name to be SEAT

The code is

SELECT * FROM PLANES

WHERE SEAT >= 100 ORDER BY SEAT

By default, it is being ordered in an ascending order.

(b)

I'll make use of sql query to answer the (b) part.

Using the same assumption in (a) above, the query is as follows

SELECT TAIL_NUMBER from PLANES

where SEAT = (SELECT MIN(SEAT) from PLANES where SEAT > (SELECT MIN(SEAT) from PLANE));

The above is a loop sql code that selects the TAIL_NUMBER for the least SEAT number then using this result, the query then select the TAIL_NUMBERof the next least available SEAT number.

The result of this is to select the tail number of the second lowest seat number

ACCESS MORE
EDU ACCESS