Top 50+ Solved SQL MCQ Questions Answer
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
Q. Which SQL statement is used to return only different values?
a. SELECT DIFFERENT
b. SELECT UNIQUE
c. SELECT DISTINCT
d. SELECT ALL
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’
Q. Which of the following command makes the updates performed by the transactionpermanent in the database?
a. ROLLBACK
b. COMMIT
c. TRUNCATE
d. DELETE
Q. Which TCL command undo all the updates performed by the SQL in the transaction?
a. ROLLBACK
b. COMMIT
c. TRUNCATE
d. DELETE
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
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
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
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’);
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
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
Q. Find all the cities with temperature, condition and humidity whose humidity is in the rangeof 63 to 79.
a. SELECT * FROM weather WHERE humidity IN (63 to 79)
b. SELECT * FROM weather WHERE humidity NOT IN (63 AND 79)
c. SELECT * FROM weather WHERE humidity BETWEEN 63 AND 79
d. SELECT * FROM weather WHERE humidity NOT BETWEEN 63 AND 79
Q. The command to remove rows from a table ‘CUSTOMER’ is __________________
a. DROP FROM CUSTOMER
b. UPDATE FROM CUSTOMER
c. REMOVE FROM CUSTOMER
d. DELETE FROM CUSTOMER WHERE
Q. What type of join is needed when you wish to include rows that do not have matchingvalues?
a. Equi-join
b. Natural join
c. Outer join
d. All of the Mentioned