Top 50+ Solved SQL MCQ Questions Answer

From 1 to 15 of 48

Q. Which SQL function is used to count the number of rows in a SQL query?

a. COUNT()

b. NUMBER()

c. SUM()

d. COUNT(*)

  • d. COUNT(*)

Q. Which SQL keyword is used to retrieve a maximum value?

a. MOST

b. TOP

c. MAX

d. UPPER

  • c. MAX

Q. Which of the following is not a DDL command?

a. UPDATE

b. TRUNCATE

c. ALTER

d. None of the Mentioned

  • a. UPDATE

Q. Which of the following are TCL commands?

a. UPDATE and TRUNCATE

b. SELECT and INSERT

c. GRANT and REVOKE

d. ROLLBACK and SAVEPOINT

  • d. ROLLBACK and SAVEPOINT

Q. ________________ is not a category of SQL command.

a. TCL

b. SCL

c. DCL

d. DDL

  • b. SCL

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

  • a. ASC

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

  • 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

Q. What does DML stand for?

a. Different Mode Level

b. Data Model Language

c. Data Mode Lane

d. Data Manipulation language

  • 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%’

  • c. SELECT * FROM Persons WHERE FirstName LIKE ‘%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

  • 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

  • a. 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

  • a. The SQL ALTER TABLE clause modifies a table definition by altering, adding, or deleting table columns and/or constraints

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

  • b. update more than one row at a time
Subscribe Now

Get All Updates & News