Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Provide the SQL select statements for the following queries. a . The airline is being audited for tax evasion. Retrieve the total cost of aircraft

Provide the SQL select statements for the following queries.
a. The airline is being audited for tax evasion. Retrieve the total cost of aircraft services for
aircraft A0001 in the financial year 1st July 2017 to 30th June 2018.[5 marks]
b. List the model ID, aircraft ID, total number of seats, destination country and actual flight
duration (in hours) of every flight to have departed from NEX airport (excluding flights
that have not arrived at their destinations yet).[5 marks]
c. Print the model ID, length, wingspan, destination country and actual flight duration (in
hours) of the longest (actual duration) flight to ever depart from NEX airport. [5 marks]
d. For each pilot, give the total amount of flying experience so far in hours (including
experience prior to joining NEA and experience with NEA as a captain, first officer, or
additional pilot). Hint: You may want to use a correlated nested query. [5 marks]
e. The analytics team want to investigate the amount of pilot experience on board flights.
Produce a table with the flightID and estimated departure date of each flight, along with
the staff IDs of the captain and first officer on board, their respective previous hours of
flying experience prior to joining NEA, and each of their total hours of experience with
new endor airlines before that flight (so the table will have a total of 8 columns). Order
the result by estimated departure date. Hint: It may be easier to complete Question d first.
[5 marks]
f. The management team wish to determine if an appropriate number of hosts have been
assigned to each flight. For each departed flight display the flight number, number of
tickets sold, and number of hosts assigned. [5 marks]
g. List the model ID, aircraft ID, haul type and number of seats for each aircraft whose model
has amongst the top 2 greatest number of seats of all models owned by NEA. [5 marks]
h. Display a table of all customer departures and arrivals from the airport with airport code
'NED'. For each row display the flight ID, customer ID, customer name, and the details of
the preferred contact method. The preferred method is the customer's phone number for
departures and email for arrivals. The displayed table should have exactly 4 columns. Order
the result by flight number (first) and customer ID (second).[5 marks]
i. Display a table of all customers who have purchased tickets for at least 5 flights, excluding
any flights that have experienced irregular events. Display the customer ID, number of
tickets purchased, and any description of medical conditions that the customer claimed on
their tickets. If a customer described different medical conditions on different tickets, then
display only the description that comes first alphanumerically (e.g. 'acrophobia' comes
before 'hemophilia').[5 marks]
CSE4DBF (2024) Assessment 4 T3 Page 2/3
______________________________________________________________________________________
j. For each flight that has already departed, display the flight ID, actual departure date,
actual departure time (in a separate column), and the number of days that have passed
between now (system date) and the departure. The displayed table should have 4 columns.
Display the date in the same format as '01st January 2019', and display the time in 12 hour
format ending in 'am' or 'pm' with hours and minutes shown (but not seconds).[5 marks]

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Expert Performance Indexing In SQL Server

Authors: Jason Strate, Grant Fritchey

2nd Edition

1484211189, 9781484211182

More Books

Students also viewed these Databases questions

Question

State the importance of motivation

Answered: 1 week ago

Question

Discuss the various steps involved in the process of planning

Answered: 1 week ago

Question

What are the challenges associated with tunneling in urban areas?

Answered: 1 week ago

Question

What are the main differences between rigid and flexible pavements?

Answered: 1 week ago

Question

What is the purpose of a retaining wall, and how is it designed?

Answered: 1 week ago