1z0-071 Exam QuestionsBrowse all questions from this exam

1z0-071 Exam - Question 95


Examine the description of the EMPLOYEES table:

Which two statements will run successfully? (Choose two.)

Show Answer
Correct Answer: ABCD

The valid SQL statements should handle string concatenation correctly with respect to single quotes. Option B correctly escapes single quotes using '''' which concatenates a single quote around the first_name field. Option D simply concatenates 'The first_name is ' with the first_name field without any syntax errors. Other options either use mismatched quotes or invalid concatenation syntax. Therefore, options B and D are the correct choices.

Discussion

17 comments
Sign in to comment
SushmasriOptions: BD
Jul 31, 2023

Can someone explain why B,D is correct ?

Viviana3184Options: BD
Dec 27, 2022

BD are correct

cadcadleyOptions: BD
Jan 10, 2023

BD is correct regarding to try in SQL

dexdinh91Options: BD
Jan 11, 2023

BD are correct

jfc1Options: BD
Jan 24, 2023

BD is the correct answer

MooonLight
Apr 22, 2023

I tried... none works.... anybody can explain even just a bit?

pmeyerOptions: BD
Apr 28, 2023

Who chose the correct answer?

OrakolOptions: BC
Feb 27, 2023

*Tested in SQL* - BD are correct.

Poke90Options: BD
Mar 10, 2023

tested it

kuffOptions: BD
May 5, 2023

BD is the answer

CyberPOptions: BC
May 27, 2023

Why its BD ? explain the reason logically & don't tell me I tested it. In the exam there will be no tool to test anything if something changed so we need to understand the logic please.

zouveOptions: BD
Jun 22, 2023

BD checked

jelenadinere_1
Jul 25, 2023

it depends on quotation mark, since we can not copy from this question normally you have to guess where are double qoutes and where are single ones, but if it like that: SELECT 'The first_name is ' " || first_name || ' ' " FROM temp; (column name || first_name || ' ' ) SELECT 'The first_name is ' " || first_name || ' " FROM temp; (column name || first_name || ' ) SELECT 'The first_name is ' || first_name || ' ' FROM temp; ( The first_name is Jhon ) then 3 answers are right: BCD

lucemqyOptions: BD
Nov 16, 2023

BD is correct checked

yaya32Options: BD
Jan 17, 2024

BD for me

archit4321Options: BD
Apr 28, 2024

A. SELECT 'The first_name is " || first_name || " FROM (select 'user' first_name from dual); --O/P = ORA-00923: FROM keyword not found where expected B. SELECT 'The first_name is ''' || first_name || '''' FROM (select 'user' first_name from dual); --O/P = The first_name is 'user' C. SELECT 'The first_name is ''' || first_name || ''' FROM (select 'user' first_name from dual); --O/P = ORA-00923: FROM keyword not found where expected D. SELECT 'The first_name is ' || first_name || '' FROM (select 'user' first_name from dual); --O/P = The first_name is user E. SELECT 'The first_name is \" || first_name || '\" FROM (select 'user' first_name from dual); --O/P = ORA-24450: Cannot pre-process OCI statement

RIDA_007Options: AC
May 18, 2024

D is incorrect, there is a missing single quote before the (||) operator