Exam 1z0-071 All QuestionsBrowse all questions from this exam
Question 74

Examine the description of the BRICKS table:

Examine the description of the BRICKS_STAGE table:

Which two queries execute successfully? (Choose two.)

A.

B.

C.

D.

E.

    Correct Answer:

    Based on the descriptions of the BRICKS and BRICKS_STAGE tables and the structure of the queries, the two queries that will execute successfully are A and D. These queries conform to the rules that both the number of columns and the data types of the columns being compared must match for a MINUS operation. The column names do not need to be identical, but the number and data types do. For query A: the first SELECT statement has 'brick_id' (NUMBER) and 'shape' (VARCHAR2), while the second SELECT statement has 'weight' (NUMBER) and 'color' (VARCHAR2). The data types do not match, so this query will not execute successfully. For query D: the first SELECT statement has 'shape' (VARCHAR2) and 'color' (VARCHAR2), and the second SELECT statement has 'color' (VARCHAR2) and 'shape' (VARCHAR2). Despite the different column order, both columns have matching data types, so this query will execute successfully.

Discussion
Artur1991

AD are the correct answers

paddy95

A D create table briks ( brick_id number(38) , shape varchar2(30) , color varchar2(30) , weight number ); create table bricks_stage( weight number , shape varchar2(30) , color varchar2(30)); --A + select brick_id , shape from briks minus select weight, color from bricks_stage; --B - select * from briks minus select * from bricks_stage; -- C - select shape, color from briks minus select weight, color from bricks_stage; -- D + select shape, color from briks minus select color, shape from bricks_stage; --E select shape, color, weight from briks minus select * from bricks_stage;

zouve

tested twice AD

Sushmasri

A,D are correct

yaya32

AD for me

Arth1989

AD, number of columns and order types should match

HassanMkhlalati

AD are the correct

Arth1989

It is no brainer. AD!

super04

AD is Correct answer. Use Minus operator to return all distinct rows selected by the first query, but not present in the second query result set. In Minus operator, the number of columns must be the same and data type of columns being selected by the SELECT statements in queries must belong to the same data type group in all the SELECT statements used in the query. The names of the columns, however, need not be identical.

Orxan_H

why C inccorect?

fgramos

Because Shape (1st column, 1st select) is VARCHAR2(20) and the first column of the second query is Weight, type number

mage2611

Answer is A, D is not correct because of the ordering of the columns (datatype mismatch)

Ayman_Khalifa

shape and color both have the same datatype, therefore, ordering doesn't matter

ArslanAltaf

AD is correct. The Data type and number of columns have to be same.

yanoolthecool

if D works, why wont E?

yanoolthecool

oh nvm, cuz D have varchar and varchar for both, so the order wont matter. E's wrong cuz it will match a number with varchar, so yea..

Raja29

AD are the correct answers

lucemqy

AD should be the correct answer since the data types match with same number of columns

Salmanbutt786

I have tested A,D and E these all are correct.

Salmanbutt786

B- AND C ARE FALSE B - Return error, coz no of column must be same in both queries. C- will also return error, coz expression must have same datatype in both queries.

metallers

AD are the correct answers

Nelita

AD ARE CORRECT. The others show errors.