
SQL Advance Functions MCQs
Authored by Dinesh Kumar
Other
Professional Development
Used 2+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
15 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
10 sec • 1 pt
What does the function CAST(Sales AS VARCHAR) do?
Rounds the Sales to integer
Converts Sales into a string
Trims Sales value
Encrypts Sales
Answer explanation
The function CAST(Sales AS VARCHAR) converts the Sales value from its original data type into a string format (VARCHAR). This allows for text manipulation or display, making 'Converts Sales into a string' the correct choice.
2.
MULTIPLE CHOICE QUESTION
10 sec • 1 pt
Which of these is an equivalent to CAST(Sales AS INT)?
CONVERT(INT, Sales)
TO_INT(Sales)
CAST(Sales TO INT)
PARSE(Sales, INT)
Answer explanation
The function CONVERT(INT, Sales) is equivalent to CAST(Sales AS INT) in SQL, as both convert the Sales value to an integer type. The other options are either incorrect syntax or do not exist in SQL.
3.
MULTIPLE CHOICE QUESTION
10 sec • 1 pt
What is the output of COALESCE(NULL, '', 'Hello')?
NULL
'' (empty string)
'Hello'
Error
Answer explanation
COALESCE returns the first non-null value. Here, NULL is ignored, '' (empty string) is the first non-null value, so it is returned. 'Hello' is not considered since '' is already a valid output.
4.
MULTIPLE CHOICE QUESTION
10 sec • 1 pt
What does NVL(Sales, 0) do?
Returns NULL if Sales is 0
Returns 0 if Sales is NULL
Converts Sales to text
Deletes NULL rows
Answer explanation
NVL(Sales, 0) returns 0 when Sales is NULL, effectively replacing NULL values with 0. This is useful for calculations to avoid NULL results.
5.
MULTIPLE CHOICE QUESTION
10 sec • 1 pt
Which function aggregates values into a comma-separated string?
CONCAT_ALL
LISTAGG
GROUP_CONCAT
STRING_JOIN
Answer explanation
LISTAGG is the correct function that aggregates values into a comma-separated string in SQL. While CONCAT_ALL, GROUP_CONCAT, and STRING_JOIN are similar, LISTAGG is the standard function used for this purpose in many SQL databases.
6.
MULTIPLE CHOICE QUESTION
10 sec • 1 pt
What does LPAD('SQL', 5, '*') return?
SQL**
**SQL
SQL
SQL
Answer explanation
LPAD('SQL', 5, '*') pads the string 'SQL' on the left with '*' until the total length is 5. Since 'SQL' is 3 characters long, it adds 2 '*' characters, resulting in '**SQL', which is the correct answer.
7.
MULTIPLE CHOICE QUESTION
10 sec • 1 pt
Which function removes spaces from the beginning of a string?
RPAD
LTRIM
RTRIM
TRIMEND
Answer explanation
The LTRIM function is specifically designed to remove spaces from the beginning of a string. In contrast, RPAD and RTRIM deal with padding and trimming spaces from the right side, while TRIMEND is not a standard function.
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Similar Resources on Wayground
20 questions
preTest COS Intermediete
Quiz
•
Professional Development
10 questions
RECEPTION
Quiz
•
Professional Development
13 questions
Prodigy Epics
Quiz
•
Professional Development
10 questions
HEM Chapter 1
Quiz
•
Professional Development
10 questions
Introduction to the hair and beauty sector
Quiz
•
Professional Development
13 questions
liczby niemiecki
Quiz
•
1st Grade - Professio...
10 questions
Townhall Q3 2021 - Henkel Indonesia
Quiz
•
Professional Development
10 questions
Basic JavaScript (Henry)
Quiz
•
Professional Development
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
22 questions
fractions
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
15 questions
Equivalent Fractions
Quiz
•
4th Grade
20 questions
Figurative Language Review
Quiz
•
6th Grade
Discover more resources for Other
10 questions
How to Email your Teacher
Quiz
•
Professional Development
6 questions
3RD GRADE DECLARATION OF INDEPENDENCE EXIT TICKET
Quiz
•
Professional Development
19 questions
Black History Month Trivia
Quiz
•
6th Grade - Professio...
22 questions
Multiplying Exponents with the Same Base
Quiz
•
9th Grade - Professio...
40 questions
Flags of the World
Quiz
•
KG - Professional Dev...