Exam 1z0-071 Topic 5 Question 299 Discussion

Actual exam question for Oracle's 1z0-071 exam
Question #: 299
Topic #: 5
Examine this query:
SELECT 2 FROM dual d1 CROSS JOIN dual d2 CROSS JOIN dual d3;
What is returned upon execution?

Suggested Answer: E Vote an answer

The given query is using the CROSS JOIN clause, which produces a Cartesian product of the tables involved.
The DUAL table in Oracle is a special one-row, one-column table present by default in all Oracle database installations. When you cross join the DUAL table with itself multiple times without any where clause to limit the rows, the result is a multiplication of the row count for each cross-joined instance.
Since DUAL has a single row, cross-joining it with itself any number of times will still result in a single row being returned. The SELECT 2 part of the query simply dictates that the number 2 will be the value in the column of this single row.
So, the result of this query will be one row with a single column containing the value 2.
References:
* Oracle Database SQL Language Reference 12c, especially sections on join operations and the DUAL table.

by Henry at Jan 31, 2025, 01:05 AM

Comments

Chosen Answer:
This is a voting comment (?) , you can switch to a simple comment.
Switch to a voting comment New
Nick name: Submit Cancel
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

Contact Us

If you have any question please leave me your email address, we will reply and send email to you in 12 hours.

Our Working Time: ( GMT 0:00-15:00 ) From Monday to Saturday

Support: Contact now 

日本語 Deutsch 繁体中文 한국어