1z0-082 Exam QuestionsBrowse all questions from this exam

1z0-082 Exam - Question 158


Examine the data in the CUST_NAME column of the CUSTOMERS table:

You want to display the CUST_NAME values where the last name starts with Mc or MC.

Which two WHERE clauses give the required result? (Choose two.)

Show Answer
Correct Answer: ACD

To find the CUST_NAME values where the last name starts with 'Mc' or 'MC', the correct SQL statements should handle both uppercase and mixed-case scenarios. Option A uses the UPPER function to ensure that the comparison is case-insensitive and correctly identifies names like 'McCain' and 'MCEwen'. Meanwhile, Option C directly checks if the portion of the name starting after the space starts with 'Mc', which will correctly identify names like 'McCain'. Option D is incorrect because INITCAP will capitalize only the first letter of each word and not handle the all-uppercase 'MC' case. Option E is syntactically incorrect, and Option B's OR condition is improperly formatted, making them both invalid solutions.

Discussion

1 comment
Sign in to comment
sobrinhoOptions: AD
Apr 30, 2024

Tested. Correct answers are A e D.

sobrinho
Apr 30, 2024

Sorry, TYPO. A and D* A. WHERE UPPER (SUBSTR (cust_name, INSTR (cust_name, ' ') + 1)) LIKE UPPER ('MC%') D. WHERE INITCAP(SUBSTR(cust_name, INSTR(cust_name, ' ') +1)) LIKE 'Mc%'