SQL Server MCQs with answers Page - 18

Here, you will find a collection of MCQ questions on SQL Server. Go through these questions to enhance your preparation for upcoming examinations and interviews.

To check the correct answer, simply click the View Answer button provided for each question.

Have your own questions to contribute? Click the button below to share your MCQs with others!

+ Add Question

A

Admin • 833.24K Points
Coach

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

A

Admin • 833.24K Points
Coach

Q. The UNION SQL clause can be used with _____________

  • (A) SELECT clause only
  • (B) DELETE and UPDATE clauses
  • (C) UPDATE clause only
  • (D) All of the mentioned

A

Admin • 833.24K Points
Coach

Q. Which SQL statement is used to return only different values?

  • (A) SELECT DIFFERENT
  • (B) SELECT UNIQUE
  • (C) SELECT DISTINCT
  • (D) SELECT ALL

A

Admin • 833.24K Points
Coach

Q. 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’

A

Admin • 833.24K Points
Coach

Q. Which TCL command undo all the updates performed by the SQL in the transaction?

  • (A) DELETE
  • (B) TRUNCATE
  • (C) COMMIT
  • (D) ROLLBACK

A

Admin • 833.24K Points
Coach

Q. SQL query to find all the cities whose humidity is 95.

  • (A) SELECT city WHERE humidity = 95
  • (B) SELECT city FROM weather WHERE humidity = 95
  • (C) SELECT humidity = 89 FROM weather
  • (D) SELECT city FROM weather

A

Admin • 833.24K Points
Coach

Q. What is the meaning of LIKE ‘%0%0%’?

  • (A) Feature has two 0’s in it, at any position
  • (B) Feature has more than two 0’s
  • (C) Feature ends with two 0’s
  • (D) Feature begins with two 0’s

A

Admin • 833.24K Points
Coach

Q. Find the names of these cities with temperature and condition whose condition is neither sunny nor cloudy.

  • (A) SELECT city, temperature, condition FROM weather WHERE condition NOT IN (‘sunny’, ‘cloudy’)
  • (B) SELECT city, temperature, condition FROM weather WHERE condition NOT BETWEEN (‘sunny’, ‘cloudy’)
  • (C) SELECT city, temperature, condition FROM weather WHERE condition IN (‘sunny’, ‘cloudy’)
  • (D) SELECT city, temperature, condition FROM weather WHERE condition BETWEEN (‘sunny’, ‘cloudy’);

A

Admin • 833.24K Points
Coach

Q. Find the name of those cities with temperature and condition whose condition is either sunny or cloudy but temperature must be greater than 70.

  • (A) SELECT city, temperature, condition FROM weather WHERE condition = ‘sunny’ AND condition = ‘cloudy’ AND temperature > 70
  • (B) SELECT city, temperature, condition FROM weather WHERE condition = ‘sunny’ OR condition = ‘cloudy’ AND temperature > 70
  • (C) SELECT city, temperature, condition FROM weather WHERE condition = ‘sunny’ OR condition = ‘cloudy’ OR temperature > 70
  • (D) SELECT city, temperature, condition FROM weather WHERE condition = ‘sunny’ AND condition = ‘cloudy’ OR temperature > 70

A

Admin • 833.24K Points
Coach

Q. Find all the tuples having a temperature greater than ‘Paris’.

  • (A) SELECT * FROM weather WHERE temperature > ‘Paris’ temperature
  • (B) SELECT * FROM weather WHERE temperature > (SELECT city FROM weather WHERE city = ‘Paris’)
  • (C) SELECT * FROM weather WHERE temperature > (SELECT * FROM weather WHERE city = ‘Paris’)
  • (D) SELECT * FROM weather WHERE temperature > (SELECT temperature FROM weather WHERE city = ‘Paris’

Add MCQ in this Category

If you want to share an MCQ question in this category, it's a great idea! It will be helpful for many other students using this website.

Share Your MCQ