Top 50+ Solved SQL MCQ Questions Answer
Q. Which SQL function is used to count the number of rows in a SQL query?
a. COUNT()
b. NUMBER()
c. SUM()
d. COUNT(*)
Q. Which of the following SQL clauses is used to DELETE tuples from a database table?
a. DELETE
b. REMOVE
c. DROP
d. CLEAR
Q. ___________removes all rows from a table without logging the individual row deletions.
a. DELETE
b. REMOVE
c. DROP
d. TRUNCATE
Q. Which of the following is not a DDL command?
a. UPDATE
b. TRUNCATE
c. ALTER
d. None of the Mentioned
Q. Which of the following are TCL commands?
a. UPDATE and TRUNCATE
b. SELECT and INSERT
c. GRANT and REVOKE
d. ROLLBACK and SAVEPOINT
Q. If you don’t specify ASC or DESC after a SQL ORDER BY clause, the following is usedby default ______________
a. ASC
b. DESC
c. There is no default value
d. None of the mentioned
Q. What is the purpose of the SQL AS clause?
a. The AS SQL clause is used to change the name of a column in the result set or to assign a name to a derived column
b. The AS clause is used with the JOIN clause only
c. The AS clause defines a search condition
d. All of the mentioned
Q. What does DML stand for?
a. Different Mode Level
b. Data Model Language
c. Data Mode Lane
d. Data Manipulation language
Q. With SQL, how do you select all the records from a table named “Persons” where the valueof the column “FirstName” ends with an “a”?
a. SELECT * FROM Persons WHERE FirstName=’a’
b. SELECT * FROM Persons WHERE FirstName LIKE ‘a%’
c. SELECT * FROM Persons WHERE FirstName LIKE ‘%a’
d. SELECT * FROM Persons WHERE FirstName=’%a%’
Q. With SQL, how can you return all the records from a table named “Persons” sorteddescending by “FirstName”?
a. SELECT * FROM Persons SORT BY ‘FirstName’ DESC
b. SELECT * FROM Persons ORDER FirstName DESC
c. SELECT * FROM Persons SORT ‘FirstName’ DESC
d. SELECT * FROM Persons ORDER BY FirstName DESC
Q. With SQL, how can you return the number of not null records in the “Persons” table?
a. SELECT COUNT() FROM Persons
b. SELECT COLUMNS() FROM Persons
c. SELECT COLUMNS(*) FROM Persons
d. SELECT COUNT(*) FROM Persons
Q. What does the ALTER TABLE clause do?
a. The SQL ALTER TABLE clause modifies a table definition by altering, adding, or deleting table columns and/or constraints
b. The SQL ALTER TABLE clause is used to insert data into database table
c. THE SQL ALTER TABLE deletes data from database table
d. The SQL ALTER TABLE clause is used to delete a database table
Q. The UPDATE SQL clause can _____________
a. update only one row at a time
b. update more than one row at a time
c. delete more than one row at a time
d. delete only one row at a time