Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

SEAT TABLE RCRAFTID SEATNO ACCESSIBLE 1QA 10A 10A 10 10B 10B 10C 10C 10C 10G Tic

ID: 3717856 • Letter: S

Question

SEAT TABLE RCRAFTID SEATNO ACCESSIBLE 1QA 10A 10A 10 10B 10B 10C 10C 10C 10G TicketNe Price PassengerlD flightN AircraftiD seatNo T001 1050 550 750 P1 P2 P1 P3 P2 PS P7 FO1 FO2 FO1 F04 FO5 FO2 F01 CT C2 C4 10A 10A 108 C3 0C 10C 1000 C2 Task 3 (2 marks) Winite an SOL statement that displays the details of seats (seat No only) for the aircraft C4 and the seat should be accessible. Task 4 (2 imarks) Write an SOL statement that displays flight No for the light arriving at a eity with a ?pace in its name or departure date is on or after 24-Mar-2018.

Explanation / Answer

1) SQL statement to display details of seats for articraft C4 and seat should be accessible.

SELECT distinct SEATNO FROM SEAT WHERE AIRCRAFTID = 'C1' AND ACCESSIBLE = 'Y';

Used distinct as SEATNO's are same in your table it will display distinct seats.

2) Assuming that FLIGHT is a table with columns FLIGHTNO, CITY, DEPARTURE DATE.

SELECT FLIGHTNO FROM FLIGHT WHERE (CITY = ' ' OR DEPARTUREDATE >= '24-MAR-2018');

Here it will display rows having space (' ') in city name and departure date is greater than or 24-MAR-2018.