An airline stores ticket sales in a sales table with columns…

An airline stores ticket sales in a sales table with columns flight_number and amount. The finance team wants to know the total revenue per flight. Which SQL should they use? SELECT flight_number, SUM(amount) FROM sales GROUP BY flight_number SELECT SUM(amount) FROM sales SELECT flight_number, amount FROM sales ORDER BY flight_number SELECT flight_number, COUNT(amount) FROM sales GROUP BY flight_number Answer: SELECT flight_number, SUM(amount) FROM sales GROUP BY flight_number Explanation: SUM(amount) calculates total revenue per flight, grouped by flight_number. A plain SUM would only give overall revenue. Ordering by flight number doesn’t summarize. Using COUNT(amount) would return the number of sales, not revenue.

A hospital database includes a table named patients with a c…

A hospital database includes a table named patients with a column called city. The administrator wants to return only patients who live in Chicago. Which query should they write? SELECT * FROM patients WHERE city = Chicago SELECT * FROM patients WHERE city LIKE “Chicago” SELECT * FROM patients WHERE city = ‘Chicago’ SELECT * FROM patients WHERE city IS Chicago Answer: SELECT * FROM patients WHERE city = ‘Chicago’ Explanation: Text values must be enclosed in single quotes in SQL. Using double quotes or omitting quotes would cause errors. The LIKE operator is valid but unnecessary when looking for an exact match.

The following boxplot was created using data on the wait tim…

The following boxplot was created using data on the wait time (in minutes) for the Disney World ride Space Mountain at 5 PM on 50 different days. Estimate Q3 from the boxplot. Estimate the median from the boxplot. Approximately what percent wait times were shorter than 39 minutes? What is the length of the shortest wait time in the data set? *Data reported by Disney and found in Essentials of Statistics, Triola, 7th edition.