Oracle
1Z0-082 · Question #151
The customers table has a cust_last_name column of data type varchar2. The table has two rows whose "jst_last_name values are Andersen and Ausson. Which query produces output for cust_last_xame…
The correct answer is A. SELECT REPLACE<TRIM<TRAILING 'son* FROM cust_last_name), 'An', *O'> FROM customers. See the full explanation below for the reasoning.
SQL and PL/SQL
Question
The customers table has a cust_last_name column of data type varchar2. The table has two rows whose "jst_last_name values are Andersen and Ausson. Which query produces output for cust_last_xame containing Oder for the first row and Aus for the second?
Options
- ASELECT REPLACE<TRIM<TRAILING 'son* FROM cust_last_name), 'An', *O'> FROM customers;
- BSELECT REPLACE(SUBSTR(cust_last_name, -3), 'An', 'O') FROM customers;
- CSELECT REPLACE(REPLACE(cust_last_name, 'son', ''), 'An', 'O'> FROM customers;
- DSELECT INITCAP (REPLACE(TRIM('son' FROM cust_last_name), 'An', 'O*)) FROM customers;
How the community answered
(34 responses)- A71% (24)
- B9% (3)
- C18% (6)
- D3% (1)
Topics
#REPLACE#TRIM#SUBSTR#string functions
Community Discussion
No community discussion yet for this question.