Oracle
1Z0-007 · Question #193
The EMPLOYEES table contains these columns: EMPLOYEE_ID NUMBER(4) LAST_NAME VARCHAR2 (25) JOB_ID VARCHAR2(10) You want to search for strings that contain 'SA_' in the JOB_ID column. Which SQL…
The correct answer is A. SELECT employee_id, last_name, job_id FROM employees WHERE job_id LIKE '%SA\_%' ESCAPE '\'. ESCAPE identifier to search for the actual % and _ symbol Incorrect answer: B ESCAPE identifier must be use
Restricting and Sorting Data
Question
The EMPLOYEES table contains these columns:
EMPLOYEE_ID NUMBER(4) LAST_NAME VARCHAR2 (25) JOB_ID VARCHAR2(10) You want to search for strings that contain 'SA_' in the JOB_ID column. Which SQL statement do you use?
Options
- ASELECT employee_id, last_name, job_id FROM employees WHERE job_id LIKE '%SA_%' ESCAPE '';
- BSELECT employee_id, last_name, job_id FROM employees WHERE job_id LIKE '%SA_';
- CSELECT employee_id, last_name, job_id FROM employees WHERE job_id LIKE '%SA_' ESCAPE "";
- DSELECT employee_id, last_name, job_id FROM employees WHERE job_id = '%SA_';
How the community answered
(41 responses)- A83% (34)
- B2% (1)
- C5% (2)
- D10% (4)
Explanation
ESCAPE identifier to search for the actual % and _ symbol Incorrect answer: B ESCAPE identifier must be use
Topics
#LIKE operator#ESCAPE clause#wildcard characters#pattern matching
Community Discussion
No community discussion yet for this question.