exam questions

Exam 1z0-082 All Questions

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

Exam 1z0-082 topic 1 question 14 discussion

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

Examine the description of the CUSTOMERS table:

You want to display details of all customers who reside in cities starting with the letter D followed by at least two characters.
Which query can be used?

  • A. SELECT * FROM customers WHERE city LIKE 'D_%';
  • B. SELECT * FROM customers WHERE city = '%D_';
  • C. SELECT * FROM customers WHERE city LIKE 'D_';
  • D. SELECT * FROM customers WHERE city = 'D_%';
Show Suggested Answer Hide Answer
Suggested Answer: A 🗳️

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
NowOrNever
Highly Voted 3 years, 8 months ago
there is no valid answer here correct would be (followed by at least two characters): SELECT * FROM EMPLOYEES WHERE FIRST_NAME LIKE 'D__%'; but A is the most correct
upvoted 15 times
SimoneF
3 years, 7 months ago
I assume there's been some issue with copy-pasting the text, and the first ' as been replaced with "~ I think it's supposed to be A anyway, but you're certainly correct that they're all wrong written as they are.
upvoted 2 times
...
elvegaa
3 years, 8 months ago
You're right. Also, there's no valid answer because double quotes are used in the LIKE clause
upvoted 3 times
...
...
Ekos
Highly Voted 3 years, 8 months ago
yes, A is the correct answer
upvoted 7 times
...
emmededalus
Most Recent 2 weeks, 4 days ago
Selected Answer: A
I voted A, but the true correct answer is SELECT * FROM EMPLOYEES WHERE FIRST_NAME LIKE 'D__%';
upvoted 1 times
...
valiantvimal
2 months, 3 weeks ago
Many comments here saying that 2 underscores must be there but I think single underscore is enough because 'D_%' means that after underscore % means that there must be a character or more to display the result. Hence, A option is accurate and correct.
upvoted 1 times
...
nautil2
10 months ago
Selected Answer: A
A is the most close to be valid answer. LIKE must be used when comparing text strings (B, D are incorrect), metacharacter % must be used to accept strings of variable length (C is incorrect), metacharacter _ stands for any character. Underscore _ should be doubled to fulfill the request of two additional characters that follows initial letter D, so the query should end with LIKE ‘D__%’
upvoted 1 times
...
algerianphoenix
2 years, 2 months ago
No correct answer here, the correct SQL query would be: SELECT * FROM EMPLOYEES WHERE FIRST_NAME LIKE 'D__%'; Notice there 2 underscores;
upvoted 1 times
saad3577
1 year, 9 months ago
the table name CUSTOMERS table, from where you came with EMPLOYEES ? ex: WHERE CustomerName LIKE 'a_%' --> Finds any values that start with "a" and are at least 2 characters in length https://www.w3schools.com/sql/sql_like.asp
upvoted 1 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