Top 1000+ Solved DataBase Management System (DBMS) MCQ Questions Answer

From 796 to 810 of 1187

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

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. SELECT clause only

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

a. SELECT DIFFERENT

b. SELECT UNIQUE

c. SELECT DISTINCT

d. SELECT ALL

  • c. SELECT DISTINCT

Q. Which SQL keyword is used to sort the result-set?

a. ORDER BY

b. SORT

c. ORDER

d. SORT BY

  • a. ORDER BY

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’

  • d. UPDATE Persons SET LastName=’Nilsen’ WHERE LastName=’Hansen’

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

a. ROLLBACK

b. COMMIT

c. TRUNCATE

d. DELETE

  • b. COMMIT

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

  • b. SELECT city FROM weather WHERE humidity = 95

Q. SQL query to find the temperature in increasing order of all cities.

a. SELECT city FROM weather ORDER BY temperature

b. SELECT city, temperature FROM weather

c. SELECT city, temperature FROM weather ORDER BY temperature

d. SELECT city, temperature FROM weather ORDER BY city

  • d. SELECT city, temperature FROM weather ORDER BY city

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

a. Feature begins with two 0’s

b. Feature ends with two 0’s

c. Feature has more than two 0’s

d. Feature has two 0’s in it, at any position

  • d. Feature has two 0’s in it, at any position

Q. Find the names of these cities with temperature and condition whose condition is neithersunny 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. SELECT city, temperature, condition FROM weather WHERE condition NOT IN (‘sunny’, ‘cloudy’)

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’ OR temperature > 70

b. SELECT city, temperature, condition FROM weather WHERE condition = ‘sunny’ OR condition = ‘cloudy’ OR temperature > 70

c. SELECT city, temperature, condition FROM weather WHERE condition = ‘sunny’ OR condition = ‘cloudy’ AND temperature > 70

d. SELECT city, temperature, condition FROM weather WHERE condition = ‘sunny’ AND condition = ‘cloudy’ AND temperature > 70

  • c. SELECT city, temperature, condition FROM weather WHERE condition = ‘sunny’ OR condition = ‘cloudy’ AND temperature > 70

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

a. SELECT * FROM weather WHERE temperature > (SELECT temperature FROM weather WHERE city = ‘Paris’

b. SELECT * FROM weather WHERE temperature > (SELECT * FROM weather WHERE city = ‘Paris’)

c. SELECT * FROM weather WHERE temperature > (SELECT city FROM weather WHERE city = ‘Paris’)

d. SELECT * FROM weather WHERE temperature > ‘Paris’ temperature

  • a. SELECT * FROM weather WHERE temperature > (SELECT temperature FROM weather WHERE city = ‘Paris’
Subscribe Now

Get All Updates & News