CDE CORRECT. PLEASE HAVE A TRY:
CREATE TABLE ORDERS_01
(
ORDER_ID NUMBER(38),
ORDER_DATE DATE
);
CREATE TABLE INVOICES_01
(
INVOICE_ID NUMBER(38),
INVOICE_DATE DATE
);
SELECT * FROM ORDERS_01
ORDER BY order_id
INTERSECT
SELECT * FROM INVOICES_01
ORDER BY invoice_id;
SELECT * FROM ORDERS_01
UNION ALL
SELECT * FROM INVOICES_01 ORDER BY ORDER_ID;
SELECT order_id, order_date FROM ORDERS_01
UNION ALL
SELECT invoice_id, invoice_date FROM INVOICES_01
ORDER BY order_id;
SELECT * FROM ORDERS_01
MINUS
SELECT * FROM INVOICES_01
ORDER BY 1;
SELECT order_id invoice_id, order_date FROM ORDERS_01
MINUS
SELECT invoice_id, invoice_date FROM INVOICES_01
ORDER BY invoice_id;
SELECT * FROM ORDERS_01
ORDER BY order_id
UNION
SELECT * FROM INVOICES_01;
SELECT order_id, order_date FROM ORDERS_01
INTERSECT
SELECT invoice_id, invoice_date FROM INVOICES_01
ORDER BY invoice_id;
B HAS TWO ERRORS:
1. MUST START TO BEGIN WITH 'SELECT', NOT () BRACKETS
2. CANNOT ORDER BY ORDER_ID
ORA-00904: "ORDER_ID": invalid identifier
WHY E IS CORRECT:
SELECT order_id invoice_id, order_date FROM ORDERS_01
equals
SELECT order_id AS invoice_id, order_date FROM ORDERS_01
(a little trap here)
Invoice_id is an alias for order_id in the first select. So it can be used in order by clause and it works.
E. SELECT order_id invoice_id, order_date FROM orders
MINUS -
SELECT invoice_id, invoice_date FROM invoices ORDER BY invoice_id;
F. SELECT * FROM orders ORDER BY order_id
Answer is BCD
E is wrong because 1) The first select has 3 columns and second select has only 2 columns which is wrong. 2) The first select selects column invoice_id from the second table which is wrong . 3) Order by invoice_id is wrong.
CDE:
Pruebas:
/*A NOOK*/
SELECT * FROM orders ORDER BY order_id
INTERSECT
SELECT * FROM invoices ORDER BY invoice_id;
/*B NOOK*/
(SELECT * FROM orders
UNION ALL
SELECT * FROM invoices) ORDER BY order_id;
/*C OK*/
SELECT order_id, order_date FROM orders
UNION ALL
SELECT invoice_id, invoice_date FROM invoices ORDER BY order_id;
/*D OK*/
SELECT * FROM orders
MINUS
SELECT * FROM invoices ORDER BY 1;
/*E OK*/
SELECT order_id invoice_id, order_date FROM orders
MINUS
SELECT invoice_id, invoice_date FROM invoices ORDER BY invoice_id;
/*F. NOOK */
SELECT * FROM orders ORDER BY order_id
UNION
SELECT * FROM invoices;
/*G. NOOK*/
SELECT order_id, order_date FROM orders
INTERSECT
SELECT invoice_id, invoice_date FROM invoices ORDER BY invoice_id;
upvoted 2 times
...
This section is not available anymore. Please use the main Exam Page.1z0-071 Exam Questions
Log in to ExamTopics
Sign in:
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
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.
Thameur01
2 months, 3 weeks agoHUGO2024
7 months, 3 weeks agolucemqy
1 year, 5 months agojm9999
1 year, 6 months agofasolazgrochem
1 year, 7 months agoShrimathi
1 year, 9 months agoWingL
1 year, 9 months agoWingL
1 year, 9 months agoOrxan_H
1 year, 9 months agoMooonLight
1 year, 12 months agoSathitest071
1 year, 11 months agoWingL
1 year, 9 months agoDarnun
2 years agoSathitest071
2 years agoIzzicertificacion
1 year, 8 months agoSathitest071
1 year, 12 months agoSantiBZ_07032022_1744
2 years, 1 month ago