Home »
SQL »
SQL MCQs
MCQ | SQL – Functions
SQL Functions MCQ: This section contains the Multiple-Choice Questions & Answers on SQL Functions.
Submitted by Anushree Goswami, on October 09, 2021
SQL Functions MCQs
1. In how many parts are the SQL functions are divided into?
- 1
- 2
- 3
- 4
Answer: B) 2
Explanation:
SQL functions are divided into 2 parts, Aggregate, and Scalar Functions.
Discuss this Question
2. ____ value is returned by the SQL Aggregate functions?
- Single
- Twice
- NULL
- Infinite
Answer: A) Single
Explanation:
Single value is returned by the SQL Aggregate functions.
Discuss this Question
3. Select the Aggregate function(s) among the following.
- AVG()
- FIRST()
- LAST()
- All of the above
Answer: D) All of the above
Explanation:
AVG(), FIRST() and LAST() are all the aggregate functions.
Discuss this Question
4. What does AVG() function returns?
- First value of the column
- Last value of the column
- Sum of rows of the table
- Average value of the column
Answer: D) Average value of the column
Explanation:
AVG() function returns the Average value of the column.
Discuss this Question
5. Which function returns the largest value of the column?
- MIN()
- MAX()
- LARGE()
- AVG()
Answer: B) MAX()
Explanation:
MAX() function returns the largest value of the column.
Discuss this Question
6. What does COUNT() function returns?
- Average value
- Largest value
- Smallest value
- Number of rows
Answer: D) Number of rows
Explanation:
COUNT() function returns the number of rows in the table.
Discuss this Question
7. Select the function which is not the Scalar Function(s)?
- UCASE()
- LEN()
- SUM()
- NOW()
Answer: C) SUM()
Explanation:
SUM() is aggregate function and not the Scalar function.
Discuss this Question
8. What does UCASE() function do?
- Converts database field to uppercase
- Converts database field to lowercase
- Returns the length of the text field
- Returns the current date and time
Answer: A) Converts database field to uppercase
Explanation:
UCASE() function converts database field to uppercase.
Discuss this Question
9. ____ function extract characters from the text field.
- LEN()
- NOW()
- MID()
- FORMAT()
Answer: C) MID()
Explanation:
MID() function extract characters from the text field.
Discuss this Question
10. Which function returns the correct date and time?
- DATE()
- NOW()
- TIME()
- DATETIME()
Answer: B) NOW()
Explanation:
NOW() function returns the correct date and time.
Discuss this Question
11. In order to merge two or more strings, which string function is used?
- CHAR
- ALTER
- CONCAT
- MERGE
Answer: C) CONCAT
Explanation:
In order to merge two or more strings, CONCAT string function is used.
Discuss this Question
12. We can use literal in the CONCAT function. What does literal refer to?
- Number
- Character
- Date
- All of the above
Answer: D) All of the above
Explanation:
Literals are the numbers, characters and the data in the CONCAT function.
Discuss this Question
13. What is the symbol of Concatenation Operator?
- |
- ||
- //
- \\
Answer: B) ||
Explanation:
"||" is the symbol of Concatenation Operator.
Discuss this Question
14. What is the full form of CTE in SQL?
- Character Table Expressions
- Character Table Evaluator
- Common Table Evaluator
- Common Table Expressions
Answer: D) Common Table Expressions
Explanation:
Common Table Expressions is the full form of CTE in SQL.
Discuss this Question
15. Which clause is needed in CTE SQL syntax?
- FOR
- AS
- WITH
- TO
Answer: C) WITH
Explanation:
WITH clause is needed in CTE SQL syntax.
Discuss this Question
16. In case of ____ data, recursive CTE is used?
- Round
- Hierarchal
- Linear
- None of the above
Answer: B) Hierarchal
Explanation:
In case of Hierarchal data, recursive CTE is used.
Discuss this Question
17. In case the CTE is wrong, it goes into –
- Infinite Loop
- Null State
- False State
- True State
Answer: A) Infinite Loop
Explanation:
In case the CTE is wrong, it goes into Infinite Loop.
Discuss this Question
18. In case to prevent the endless loop in CTE, ____ is added.
- MAXLINEAR
- MAXROUND
- MAXRECURSION
- None of the above
Answer: C) MAXRECURSION
Explanation:
In case to prevent the endless loop in CTE, MAXRECURSION is added.
Discuss this Question
19. From the set of results, in order to remove the duplicate columns, ____ Clause is used.
- DUPLICATE
- DISTINCT
- REMOVE
- DROP
Answer: B) DISTINCT
Explanation:
From the set of results, in order to remove the duplicate columns, DISTINCT Clause is used. It is used in conjunction with SELECT keyword.
Discuss this Question
20. Which of the following statement is TRUE about DISTINCT Clause?
- Returns only Distinct values.
- Only on the single column, it operates.
- It can be used with the aggregates such as COUNT, AVG, etc.
- All of the above
Answer: D) All of the above
Explanation:
- DISTINCT can return only distinct values.
- DISTINCT operates only on the single column
- DISTINCT can be used with the aggregates such as COUNT, AVG, etc.
Discuss this Question
21. ____ are the columns for the retrieval purpose.
- Tables
- WHERE Conditions
- Expressions
- None of the above
Answer: C) Expressions
Explanation:
Expressions are the columns for the retrieval purpose.
Discuss this Question
22. Which of the following statement is TRUE about DISTINCT Clause?
- It cannot ignore the NULL values
- It can ignore the NULL values
- Its query can return multiple values
- None of the above
Answer: A) It cannot ignore the NULL values
Explanation:
DISTINCT Clause cannot ignore the NULL values.
Discuss this Question
23. In order to join N tables, minimum number of join statements required is –
- N
- N-1
- N-2
- N+1
Answer: B) N-1
Explanation:
In order to join N tables, minimum number of join statements required is N-1.
Discuss this Question
24. ____ Clause is used in Parent-child relationship in order to join two or more tables.
- FROM
- TO
- WHERE
- IN
Answer: C) WHERE
Explanation:
WHERE Clause is used in Parent-child relationship in order to join two or more tables.
Discuss this Question
25. The Web SQL API is supported by –
- Opera
- Google Chrome
- Android Browsers
- All of the above
Answer: D) All of the above
Explanation:
The WEB SQL API is supported by Opera, Google Chrome and Android Browsers.
Discuss this Question
26. In order to manage or store the data in the database, WEB SQL Database is used which is a –
- Web site
- Web page
- Web browser
- None of the above
Answer: B) Web page
Explanation:
In order to manage or store the data in the database, WEB SQL Database is used which is a Webpage.
Discuss this Question
27. Which of the following statement is TRUE?
- Web API is the part of HTML5
- Web API is not the part of HTML5
- Web API is the part of HTML
- Web API is the part of XHTML
Answer: B) Web API is not the part of HTML5
Explanation:
Web API a separate specification and not the part of HTML5.
Discuss this Question
28. Select the correct method of Web SQL?
- Execute SQL
- Transaction
- Open Database
- All of the above
Answer: D) All of the above
Explanation:
Execute SQL, Transaction and Open Database are all the methods of Web SQL.
Discuss this Question
29. In order to execute a query in Web SQL, which function is used?
- open()
- translate()
- transaction()
- execute()
Answer: C) transaction()
Explanation:
In order to execute a query in Web SQL, db.transaction() is used.
Discuss this Question
30. Transaction is able to control the following –
- Transaction
- Commit
- Rollback
- All of the above
Answer: D) All of the above
Explanation:
Transaction is able to control transaction and rollback or commit.
Discuss this Question