PrepAway - Latest Free Exam Questions & Answers

how many rows will be returned?

Given the following tables:
YEAR_2006
EMPID NAME
———————————
1 Jagger, Mick
2 Richards, Keith
3 Wood, Ronnie
4 Watts, Charlie
5 Jones, Darryl
6 Leavell, Chuck
YEAR_1962
EMPID NAME
———————————
1 Jagger, Mick
2 Richards, Keith
3 Jones, Brian
4 Wyman, Bill
5 Chapman, Tony
6 Stewart, Ian
If the following SQL statement is executed, how many rows will be returned?

SELECT name FROM year_2006
UNION
SELECT name FROM year_1962

PrepAway - Latest Free Exam Questions & Answers

A.
0

B.
6

C.
10

D.
12

2 Comments on “how many rows will be returned?

  1. Chow, Kenneth KY says:

    When DB2 encounters the UNION keyword, it processes each select / subselect to form an interim result table, then it combines the interim result table and deletes duplicate rows to form a combined result table working similar as a JOIN.
    If the option is to keep the duplicate values, then the UNION ALL keyword should be used.




    0



    0

Leave a Reply