Structured Query Language (SQL) MCQs

Topic-wise practice questions for Database Management Systems. Test your knowledge, check solutions on demand, and pace your preparation.

Zero-leak answer engine • Rate-limited explanations
Practice in Timed Mode
Q1hard
A database administrator needs to change the data type of the phone_number column from INT to VARCHAR(20) in an existing Contacts table. Which SQL command should be used? sql-logic-test

-- Table Data: (id, category, stock)
-- 1, 'A', 10
-- 2, 'B', 50
-- 3, 'A', 100
SELECT * FROM inventory
WHERE category = 'A' OR category = 'B' AND stock > 60;
Q2easy
What is the result of the following query if the salary column contains a NULL for the employee 'Bob'?
Q3medium
Why is the TRUNCATE command generally much faster than the DELETE command for removing all rows from a large table?
Q4medium
Which of the following SQL keywords is strictly required to remove duplicate rows from the result set of a SELECT query?
Q5medium
Which of the following is a key requirement for the UNION operator to work between two SELECT statements?
Q6medium
A banking application needs to find all accounts that do not have a secondary_owner assigned. Which SQL condition is mathematically correct?
Q7easy
What does the following command achieve?
Q8hard
A developer executes the following query on a Products table. What will be the final calculated value in the discounted_price column for a product with a price of 100 and a tax of 10?
Q9medium
Which query returns exactly the same result as: SELECT * FROM

Items WHERE id IN (1, 2, 3);?
Q10medium
In SQL, which of the following is true about the BETWEEN operator (e.g.,

WHERE price BETWEEN 10 AND 20)?