1z0-071 Exam QuestionsBrowse all questions from this exam

1z0-071 Exam - Question 120


Examine the data in the COLORS table:

Examine the data in the BRICKS table:

Which two queries return all the rows from COLORS? (Choose two.)

Show Answer
Correct Answer: AC

The queries that will return all the rows from the COLORS table are ones that perform a RIGHT JOIN on the colors table or a LEFT JOIN on the bricks table, ensuring that all records from the COLORS table are included regardless of matching records in the BRICKS table. A RIGHT JOIN from the bricks table to the colors table will include all records from the COLORS table, even if there are no matching records in the BRICKS table. Similarly, a LEFT JOIN starting from the COLORS table ensures all records from the COLORS table are included.

Discussion

13 comments
Sign in to comment
anzacOptions: AB
Dec 12, 2022

Checked: A, B Check: CREATE TABLE COLORS_120 ( RGB_HEX_VALUE VARCHAR2(100) , COLOR_NAME VARCHAR2(100) ); CREATE TABLE BRIKS_120 ( BRICK_ID NUMBER , COLOR_RGB_HEX_VALUE VARCHAR2(100) ); INSERT INTO COLORS_120 SELECT 'FF0000','red' FROM DUAL UNION ALL SELECT '00FF00','green' FROM DUAL UNION ALL SELECT '0000FF','blue' FROM DUAL; INSERT INTO BRIKS_120 SELECT 1,'FF0000' FROM DUAL UNION ALL SELECT 2,'00FF00' FROM DUAL UNION ALL SELECT 3,'FFFFFF' FROM DUAL; A; SELECT * FROM BRIKS_120 b RIGHT JOIN COLORS_120 c ON b.COLOR_RGB_HEX_VALUE = c.RGB_HEX_VALUE; B; SELECT * FROM BRIKS_120 b FULL JOIN COLORS_120 c ON b.COLOR_RGB_HEX_VALUE = c.RGB_HEX_VALUE; C; SELECT * FROM c FULL JOIN BRIKS_120 b USING(RGB_HEX_VALUE); D; SELECT * FROM COLORS_120 c LEFT JOIN BRIKS_120 b ON b.COLOR_RGB_HEX_VALUE = c.RGB_HEX_VALUE WHERE b.brick_id > 0 ; E; SELECT * FROM BRIKS_120 b LEFT JOIN COLORS_120 c ON b.COLOR_RGB_HEX_VALUE = c.RGB_HEX_VALUE;

WingL
Jul 8, 2023

thanks for coding.

abdullah_barhamOptions: AB
Dec 13, 2022

AB ARE THE ANSWERS

jfc1Options: AB
Jan 26, 2023

AB are the answers

cadcadleyOptions: AB
Jan 11, 2023

AB is correct

dexdinh91Options: AB
Jan 12, 2023

AB are correct

DarnunOptions: AB
Mar 27, 2023

AB are correct ones

Orxan_H
Jun 11, 2023

Why D incorrect?

a947739
Jul 2, 2024

if you remove "where b.brick_id> 0" then D is correct. With the where clause, it only returns two rows.

WingLOptions: AB
Jul 8, 2023

A and B are correct.

jm9999
Sep 20, 2023

How can the answer key say DE? Not even close.

lucemqyOptions: AB
Nov 14, 2023

AB is the correct answer

yaya32Options: AB
Jan 18, 2024

Not possible to use the using clause as the names of the columns are not the same. For me AB is the correct answer.

amizhOptions: BC
Feb 18, 2024

tried it . A,B,C correct

ArslanAltaf
Apr 20, 2024

C is not true. look at the common column difference.

amizhOptions: AB
Feb 18, 2024

A, B is correct. tried.