Multiple choice technology programming languages

Consider this PROC SQL query: proc sql; select flightnumber, count(*) as Flights, avg(boarded) label="Average Boarded" format=3. from sasuser.internationalflights group by flightnumber having avg(boarded) > 150; The table Sasuser.Internationalflights contains 201 rows, 7 unique values of FlightNumber, 115 unique values of Boarded, and 4 different flight numbers that have an average value of Boarded that is greater than 150. How many rows of output will the query generate?

  1. 150

  2. 7

  3. 4

  4. 1

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

The query groups by FlightNumber and filters with HAVING to show only the 4 flights where average boarded passengers exceeds 150. The GROUP BY produces 7 groups (one per unique flight), but HAVING filters this to only the 4 matching flights, regardless of total rows.

AI explanation

A GROUP BY clause collapses the 201 rows into one row per distinct FlightNumber (7 groups), and the HAVING clause then filters those groups down to only the ones whose average Boarded exceeds 150. Since the problem states exactly 4 flight numbers meet that average threshold, the query returns 4 rows — one summary row per qualifying group, not one row per underlying detail row or per all 7 groups.