235k views
5 votes
"If an inner join is performed on the following tables based on the ID and IDNO columns, how many rows will be in the PROC SQL report?

Name ID
Jack
111
Mary
333
Jane
555
IDNO Salary
111
75000
222
83000
333
82000



a. one
b. two
c. three
d. four""If an inner join is performed on the following tables based on the ID and IDNO columns, how many rows will be in the PROC SQL report?
Name ID
Jack
111
Mary
333
Jane
555
IDNO Salary
111
75000
222
83000
333
82000
a. one
b. two
c. three
d. four"

2 Answers

6 votes

Final answer:

The PROC SQL report will contain two rows after performing an inner join on the provided tables, corresponding to the matching pairs of IDs and IDNOs of Jack and Mary.

Step-by-step explanation:

When performing an inner join between two tables, the resulting set includes rows with matching values in both tables. In this case, we are joining on the columns ID and IDNO. We begin by comparing the IDs in both tables:

  • Jack has ID 111, which matches with the IDNO 111 in the second table.
  • Mary has ID 333, which also has a corresponding IDNO 333.
  • Jane has ID 555, which does not match any IDNO in the second table.

Since Jane's ID 555 doesn't match any IDNO, her row will not be included in the inner join. Therefore, the PROC SQL report will contain two rows - one corresponding to Jack and another to Mary. These are the rows with matching ID and IDNO pairs.

User Lucsan
by
8.4k points
4 votes

Final answer:

An inner join between the two tables based on the ID and IDNO columns will result in two rows in the PROC SQL report, one for Jack and another for Mary, as Jane's ID does not have a corresponding IDNO in the second table.

The correct answer is b. two.

Step-by-step explanation:

When performing an inner join on the two tables based on the ID and IDNO columns, we match each row in the first table with a row from the second table where the ID values correspond to the IDNO values. In this case:

  • Jack has an ID of 111, which matches IDNO 111 with a Salary of 75000 from the second table.
  • Mary has an ID of 333, which matches IDNO 333 with a Salary of 82000 from the second table.
  • Jane has an ID of 555, which has no matching IDNO in the second table.

Since there's no entry in the second table with an IDNO that matches Jane's ID of 555, her row will not appear in the joined table. Therefore, the PROC SQL report would consist of two rows, one for Jack and another for Mary.

User Zeleniy
by
7.0k points