Which two queries give the required output?

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

You want to extract only those customer names that have three names and display the * symbol in place of the first name as follows:

Which two queries give the required output?
A. SELECT LPAD(SUBSTR(cust_name, INSTR(cust_name, ‘ ‘)),LENGTH(cust_name),’*’) "CUST NAME"
FROM customers
WHERE INSTR(cust_name, ‘ ‘,1,2)<>0;
B. SELECT LPAD(SUBSTR(cust_name, INSTR(cust_name, ‘ ‘)),LENGTH(cust_name),’*’) "CUST NAME"
FROM customers
WHERE INSTR(cust_name, ‘ ‘,-1,2)<>0;
C. SELECT LPAD(SUBSTR(cust_name ‘ ‘)),LENGTH(cust_name) – INSTR(cust_name, ‘ ‘), ‘*’) "CUST NAME"
FROM customers
WHERE INSTR(cust_name, ‘ ‘,1,-2)<>0;
D. SELECT LPAD(SUBSTR(cust_name ‘ ‘)),LENGTH(cust_name) – INSTR(cust_name, ‘ ‘), ‘*’) "CUST NAME"
FROM customers
WHERE INSTR(cust_name, ‘ ‘,1,2)<>0;

Download Printable PDF. VALID exam to help you PASS.

One thought on “Which two queries give the required output?

Leave a Reply

Your email address will not be published. Required fields are marked *


The reCAPTCHA verification period has expired. Please reload the page.