13.1k views
2 votes
Airline.expenses and airline.revenue both have 30 rows, and one column in common named Flight_ID. Each row in the first table has a value of Flight_ID that matches the Flight_ID value in one and only one row in the second table. When you run this PROC SQL program, how many rows appear in the result set?

proc sql;
select expenses.Flight_ID,
Amount, Date
from airline.expenses,
airline.revenue;
quit;
a. 0
b. 30
c. 60
d. 900

1 Answer

1 vote

Final answer:

When a PROC SQL query is run without specifying a join type or matching condition, a Cartesian product is created. In this case, joining two tables with 30 rows each without a where clause results in 900 rows.

Step-by-step explanation:

The student is asking about the result of running a PROC SQL query in SAS, which joins two tables without specifying the type of join or using a where clause to match rows based on the Flight_ID.

Given the described scenario, the result would be a Cartesian product of the two tables because every row in airline.expenses is matched with every row in airline.revenue, resulting in 30 rows squared, which is 900 rows in the result set. Thus, the correct answer to the question is d. 900.

User Tyler Shaddix
by
8.3k points

No related questions found