0
0
SQLquery~10 mins

String quoting and concatenation differences in SQL - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to select the string 'Hello' from the database.

SQL
SELECT [1] AS greeting;
Drag options to blanks, or click blank then click option'
A`Hello`
B"Hello"
CHello
D'Hello'
Attempts:
3 left
💡 Hint
Common Mistakes
Using double quotes for strings causes errors in many SQL dialects.
Not quoting strings at all leads to syntax errors.
2fill in blank
medium

Complete the code to concatenate two strings 'Hello' and 'World' with a space in between.

SQL
SELECT 'Hello' [1] ' ' [1] 'World' AS greeting;
Drag options to blanks, or click blank then click option'
A+
B||
C&
DCONCAT
Attempts:
3 left
💡 Hint
Common Mistakes
Using + for string concatenation causes errors in many SQL dialects.
Using & is not valid for string concatenation in SQL.
3fill in blank
hard

Fix the error in the code to concatenate 'First' and 'Last' names with a space.

SQL
SELECT FirstName [1] ' ' [1] LastName AS FullName FROM Users;
Drag options to blanks, or click blank then click option'
A+
B&
C||
DCONCAT
Attempts:
3 left
💡 Hint
Common Mistakes
Using + causes syntax errors in standard SQL.
Using & is not a valid operator for string concatenation.
4fill in blank
hard

Fill both blanks to select a string with a single quote inside it: O'Reilly.

SQL
SELECT [1] AS publisher;
Drag options to blanks, or click blank then click option'
A'O''Reilly'
B"O'Reilly"
C'O'Reilly'
D`O'Reilly`
Attempts:
3 left
💡 Hint
Common Mistakes
Using single quotes inside single quotes without doubling causes errors.
Using backticks does not create string literals.
5fill in blank
hard

Fill all three blanks to create a concatenated full name with a comma and space: LastName, FirstName.

SQL
SELECT LastName [1] [2] [3] FirstName AS FullName FROM Employees;
Drag options to blanks, or click blank then click option'
A||
B', '
D+
Attempts:
3 left
💡 Hint
Common Mistakes
Using + for concatenation causes errors in standard SQL.
Not quoting the comma and space string causes syntax errors.