Explore topic-wise MCQs in SQL Server.

This section includes 4 Mcqs, each offering curated multiple-choice questions to sharpen your SQL Server knowledge and support exam preparation. Choose a topic below to get started.

1.

How can you change Hansen into Nilsen in the LastName column in the Persons table?

A. UPDATE Persons SET LastName= Hansen INTO LastName= Nilsen
B. MODIFY Persons SET LastName= Nilsen WHERE LastName= Hansen
C. MODIFY Persons SET LastName= Hansen INTO LastName= Nilsen
D. UPDATE Persons SET LastName= Nilsen WHERE LastName= Hansen
Answer» E.
2.

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
Answer» B. SELECT COLUMNS() FROM Persons
3.

With SQL, how can you return all the records from a table named Persons sorted descending 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
Answer» E.
4.

With SQL, how do you select all the records from a table named Persons where the value of 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%
Answer» D. SELECT * FROM Persons WHERE FirstName= %a%