exam questions

Exam 1z0-071 All Questions

View all questions & answers for the 1z0-071 exam

Exam 1z0-071 topic 1 question 2 discussion

Actual exam question from Oracle's 1z0-071
Question #: 2
Topic #: 1
[All 1z0-071 Questions]

Examine the description of the PRODUCTS table:

Which three queries use valid expressions? (Choose three.)

  • A. SELECT product_id, unit_price, S "Discount", unit_price + surcharge - discount FROM products;
  • B. SELECT product_id, (unit_price * 0.15 / (4.75 + 552.25)) FROM products;
  • C. SELECT product_id, (expiry_date - delivery_date) * 2 FROM products;
  • D. SELECT product_id, unit_price || 5 "Discount", unit_price + surcharge - discount FROM products;
  • E. SELECT product_id, expiry_date * 2 FROM products;
  • F. SELECT product_id, unit_price, unit_price + surcharge FROM products;
Show Suggested Answer Hide Answer
Suggested Answer: BCF 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
GunduzHuseynli
Highly Voted 2 years, 4 months ago
BCE should be correct answer cause number+varchar in this case imspossible
upvoted 7 times
extopic01
2 years, 4 months ago
Have u tried it yourself in livesql.oracle.com? Number + varchar is possible due to implicit casting, so BCF is correct.
upvoted 6 times
zzsqlcoder
3 months, 3 weeks ago
D executes also. Implicit casting applies
upvoted 1 times
...
...
gioves28
2 years, 3 months ago
E is wrong inconsistent datatypes: expected NUMBER got DATE
upvoted 2 times
...
...
dici79
Most Recent 1 week, 2 days ago
Selected Answer: BCF
A: Discount field doesn't exist in the table. B: OK C: OK D: Discount field doesn't exist in the table. E: Date * Number is not a valid operation F: Depending on the values, it may or may not be OK. if the entered values are numeric, this statement will work. Because the question requires 3 answers, I pass this option as correct.
upvoted 1 times
...
Drexan
2 months, 3 weeks ago
Selected Answer: BCF
F works (altough is VARCAR2) if its content is numeric,
upvoted 1 times
...
alelejaja
7 months, 3 weeks ago
Selected Answer: BCF
B and C clearly correct. F is tricky. It can be correct only if the column Surcharge contains numeric characters defined as varchar2
upvoted 1 times
...
tom2992
8 months, 3 weeks ago
Selected Answer: BCF
A and D wrong cause they have invalid identifier "Discount". E wrong cause date can't multiple with number.
upvoted 1 times
...
Lee_jong_suk
1 year, 1 month ago
BCF is correct answer Please note: date+date is not allowed
upvoted 2 times
...
TMerlo
1 year, 3 months ago
Selected Answer: BCF
It´s not a right decision plus a NUMBER with VARCHAR2 fields.
upvoted 1 times
...
jm9999
1 year, 4 months ago
Seems like a sketchy question, have to assume surcharge contains only numerical characters in the string for F
upvoted 3 times
...
fantastic_side_eye
1 year, 6 months ago
BCF The three queries that use valid expressions are: B. SELECT product_id, (unit_price * 0.15 / (4.75 + 552.25)) FROM products; C. SELECT product_id, (expiry_date - delivery_date) * 2 FROM products; F. SELECT product_id, unit_price, unit_price + surcharge FROM products; Explanation: A. This query is invalid because the alias "S" is not defined anywhere in the query. B. This query is valid. It calculates a value based on the unit price of each product using a mathematical expression. C. This query is valid. It calculates the difference between the expiry date and delivery date for each product and multiplies it by 2. D. This query is invalid because the alias "discount" is not defined anywhere in the query. E. This query is invalid because you cannot multiply a date value by a number. F. This query is valid. It selects the product ID, unit price, and the sum of the unit price and surcharge for each product.
upvoted 3 times
...
zouve
1 year, 7 months ago
select '2'+3 from dual; it produces the SUM correctly so F is correct
upvoted 2 times
...
Nelita
1 year, 8 months ago
B-C-F IS CORRECT IF the varchar-column has stored number.
upvoted 2 times
...
Indhumathishan
1 year, 8 months ago
why is D incorrect?
upvoted 3 times
VoidWanderer
4 months, 3 weeks ago
they are subtracting discount but there's no such column in table.
upvoted 1 times
...
...
holdfaststrongly
2 years, 3 months ago
Is "-discount" in AD supposed to be an alias for the column?
upvoted 1 times
...
MZEnuovazelanda
2 years, 4 months ago
IT is correct BCF because in the Datatype Varchar2 there may be a number. Oracle makes it an implicit cast and uses it as a number
upvoted 4 times
...
gabolka
2 years, 4 months ago
you cant multiply date, BCF correct if varchar2 is number
upvoted 4 times
Efstathia
2 years, 4 months ago
Just to say the same things in other words.... If surcharge column contains numeric values (even as varchar2 type) can be implicitly converted
upvoted 3 times
...
CyberP
1 year, 7 months ago
If you cant multiply date, then why you chose c ? since c the date is also multiply ?
upvoted 1 times
MySekQL
1 year, 4 months ago
I'm guessing because if you subtract two dates that are relatively close, you will get a number not a date. And that CAN be multiplied.
upvoted 1 times
...
...
...
Averagenoob
2 years, 4 months ago
bce should be
upvoted 2 times
...
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.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago