Home »
SQL »
SQL MCQs
MCQ | SQL – Select, Clause, Order By, Insert, Update and Delete Statements
SQL Select, Clause, Order By, Insert, Update and Delete Statements MCQ: This section contains the Multiple-Choice Questions & Answers on SQL Select, Clause, Order By, Insert, Update and Delete Statements.
Submitted by Anushree Goswami, on September 26, 2021
SQL Select, Clause, Order By, Insert, Update and Delete Statements MCQs
1. Which one is not the OPTIONAL Clause in SELECT statement?
- WHERE
- ORDER BY
- HAVE
- HAVING
Answer: C) HAVE
Explanation:
WHERE, ORDER BY and HAVING are all OPTIONAL Clauses in SELECT statement.
Discuss this Question
2. Which statement is TRUE about the WHERE Clause?
- In order to retrieve rows, WHERE Clause is used.
- In order to group the rows, WHERE Clause is used.
- In order to select the defined groups, WHERE Clause is used.
- In order to return the rows, WHERE Clause is used.
Answer: A) In order to retrieve rows, WHERE Clause is used
Explanation:
In order to retrieve rows, WHERE Clause is used.
Discuss this Question
3. Which statement is TRUE about the GROUP BY Clause?
- In order to retrieve rows, GROUP BY Clause is used.
- In order to group the rows that share the same property, GROUP BY Clause is used.
- In order to select the defined groups, GROUP BY Clause is used.
- In order to return the rows, GROUP BY Clause is used.
Answer: B) In order to group the rows that share the same property, GROUP BY Clause is used
Explanation:
In order to group the rows that share the same property, GROUP BY Clause is used.
Discuss this Question
4. Which statement is TRUE about the HAVING Clause?
- In order to group the rows, HAVING Clause is used.
- In order to return the rows, HAVING Clause is used.
- In order to select the defined groups by the GROUP BY Clause, HAVING Clause is used.
- None of the above
Answer: C) In order to select the defined groups by the GROUP BY Clause, HAVING Clause is used
Explanation:
In order to select the defined groups by the GROUP BY Clause, HAVING Clause is used.
Discuss this Question
5. Which statement is TRUE about the ORDER BY Clause?
- In order to return the rows in a specific order, ORDER BY Clause is used.
- In order to group the rows, ORDER BY Clause is used.
- In order to select the defined groups, ORDER BY Clause is used.
- None of the above
Answer: A) In order to return the rows in a specific order, ORDER BY Clause is used
Explanation:
In order to return the rows in a specific order, ORDER BY Clause is used.
Discuss this Question
6. Which of the following clause cannot be optional in SQL SELECT Statement?
- WHERE
- GROUP BY
- ORDER BY
- None of the above
Answer: D) None of the above
Explanation:
WHERE, GROUP BY and ORDER BY all are optional clauses in SQL SELECT Statement.
Discuss this Question
7. Which of the following clause is optional in SQL SELECT Statement?
- SELECT
- FROM
- HAVING
- None of the above
Answer: C) HAVING
Explanation:
HAVING Clause is optional in SQL SELECT Statement.
Discuss this Question
8. Which clause is used to retrieve a unique element from the table?
- SELECT UNIQUE
- SELECT DISTINCT
- Both A) and B)
- None of the above
Answer: C) Both A) and B)
Explanation:
SELECT UNIQUE and SELECT DISTINCT clauses are used to retrieve a unique element from a table.
Discuss this Question
9. What is the functionality of SQL COUNT?
- It returns the no of record of table
- It returns the no of record of database
- It returns the no of record of row
- It returns the no of record of column
Answer: A) It returns the no of record of table
Explanation:
SQL COUNT returns the no of record of table.
Discuss this Question
10. In SQL SELECT COUNT, one needs to specify the –
- Column Name
- Row Name
- Table Name
- None of the above
Answer: A) Column Name
Explanation:
In SQL SELECT COUNT, one needs to specify the Column Name.
Discuss this Question
11. The SELECT TOP statement shows the limited number of:
- Rows
- Columns
- Tables
- None of the above
Answer: A) Rows
Explanation:
The SELECT TOP statement shows the limited number of records or rows.
Discuss this Question
12. Select the correct syntax of SELECT TOP clause?
- SELECT TOP name
- SELECT TOP column
- SELECT TOP FROM
- SELECT TOP Number
Answer: D) SELECT TOP Number
Explanation:
The correct syntax of SELECT TOP clause is SELECT TOP Number.
Discuss this Question
13. Using the SQL first() function, one can return the ____ value of the selected column.
- First
- Second
- Third
- Last
Answer: A) First
Explanation:
Using the SQL first() function, one can return the first value of the selected column.
Discuss this Question
14. Using the SQL last() function, one can return the ______ value of the selected column.
- First
- Second
- Third
- Last
Answer: D) Last
Explanation:
Using the SQL last() function, one can return the last value of the selected column.
Discuss this Question
15. Using SQL SELECT RANDOM() function, one can return the random –
- Table
- Database
- Row
- Column
Answer: C) Row
Explanation:
Using SQL SELECT RANDOM() function, one can return the random row.
Discuss this Question
16. In order to assign a random name to a column or table, which SQL SELECT Clause is used?
- FROM
- WHERE
- HAVING
- AS
Answer: D) AS
Explanation:
In order to assign a random name to a column or table, SQL SELECT AS Clause is used.
Discuss this Question
17. Which function combines the two different columns?
- ADD
- MERGE
- CONCAT
- None of the above
Answer: C) CONCAT
Explanation:
CONCAT() function, combines the two different columns.
Discuss this Question
18. What is the difference between HAVING and WHERE clause?
- HAVING clause is used in column operation whereas WHERE clause is used in row operation.
- HAVING clause is post-filter whereas WHERE clause is pre-filter.
- HAVING clause filters the groups whereas WHERE clauses filter the single record of the table.
- All of the above
Answer: D) All of the above
Explanation:
The differences between HAVING and WHERE clauses are:
- HAVING clause is used in column operation whereas WHERE clause is used in row operation.
- HAVING clause is post-filter whereas WHERE clause is pre-filter.
- HAVING clause filters the groups whereas WHERE clauses filter the single record of the table.
Discuss this Question
19. What is the difference between MIN and MAX function?
- MIN function is used to show the minimum data and MAX function is used to show the maximum data.
- MIN function is used to show the maximum data and MAX function is used to show the minimum data.
- Both of the above
- None of the above
Answer: A) MIN function is used to show the minimum data and MAX function is used to show the maximum data
Explanation:
MIN function is used to show the minimum data and MAX function is used to show the maximum data.
Discuss this Question
20. In order to sort the records according to the columns, which clause is used?
- HAVING
- GROUP BY
- ORDER BY
- None of the above
Answer: C) ORDER BY
Explanation:
ORDER BY clause is used to sort the records according to the columns.
Discuss this Question
21. By default, sorting by ORDER BY clause is done in which order?
- Ascending
- Descending
Answer: A) Ascending
Explanation:
By default, sorting by ORDER BY clause is done in ascending order.
Discuss this Question
22. What is the keyword of the Ascending and Descending?
- ASCE, DESC
- ASC, DES
- ASCE, DES
- ASC, DESC
Answer: D) ASC, DESC
Explanation:
ASC, DESC are the keywords of the ascending and descending.
Discuss this Question
23. SQL INSERT is used to insert a –
- Single or Multiple record
- Single or Multiple database
- Single or Multiple table
- None of the above
Answer: A) Single or Multiple record
Explanation:
SQL INSERT is used to insert a single or multiple records in the table.
Discuss this Question
24. In order to insert a row directly in the table, which command is used?
- INSERT IN
- INSERT INSIDE
- INSERT UNDER
- INSERT INTO
Answer: D) INSERT INTO
Explanation:
INSERT INTO command is used to insert a row directly in the table.
Discuss this Question
25. In order to update one table using another table and join condition, which statement is used.
- SQL UPDATE INTO
- SQL UPDATE JOIN
- SQL JOIN
- SQL JOIN UPDATE
Answer: B) SQL UPDATE JOIN
Explanation:
SQL UPDATE JOIN is used to update one table using another table and join condition.
Discuss this Question
26. SQL DELETE can be used to delete,
- Rows
- Database
- View
- All of the above
Answer: D) All of the above
Explanation:
SQL DELETE can be used to delete Rows, Database and View using specific SQL clauses.
Discuss this Question
27. What is the clause to delete all rows from the table?
- SQL DELETE ALL ROWS Table_Name;
- SQL DELETE ROWS Table_Name;
- DELETE FROM ALL ROWS Table_Name;
- DELETE FROM Table_Name;
Answer: D) DELETE FROM Table_Name;
Explanation:
DELETE FROM Table_Name is used to delete all rows from the table.
Discuss this Question
28. In order to delete duplicate rows from the table, which keyword is used?
- DELETE
- DISTINCT
- FROM
- WHERE
Answer: B) DISTINCT
Explanation:
DISTINCT keyword is used to delete duplicate rows from the table.
Discuss this Question
29. In order to delete the database, which keyword is used?
- DROP
- DELETE
- ALTER
- None of the above
Answer: A) DROP
Explanation:
DROP keyword is used to delete the database.
Discuss this Question
30. Which of the following keyword is used to delete the Join?
- DELETE
- ON
- WHERE
- All of the above
Answer: D) All of the above
Explanation:
DELETE, ON, WHERE and few other keywords are used to delete the Join.
Discuss this Question