Last Updated On
Welcome to the SQL Quiz!
SQL Multiple Choice Questions – MCQ2
Answers
1) c) Organized collection of data or information that can be accessed, updated, and managed
2) c) Table
3) a) All Correct
4) c) WHERE clause
The WHERE clause is incomplete and needs a condition to specify which records to update.
5) a) True
6) a) SELECT * FROM Employees WHERE FirstName=’Peter’ AND LastName=’Jackson’
7) a) All Correct
8) b) >= ‘2023-06-01’
The OR operator should be followed by a complete condition, including the column name.
SELECT * FROM Orders WHERE OrderDate >= ‘2023-01-01’ OR OrderDate >= ‘2023-06-01’;
9) c) HAVING
10) c) No error
11) a) SELECT * FROM Employees WHERE LastName BETWEEN ‘Hansen’ AND ‘Pettersen’
12) a) SELECT DISTINCT
13) a) ORDER BY
14) a) SELECT * FROM Employees ORDER BY FirstName DESC
15) a) INSERT INTO Employees VALUES (‘Jimmy’, ‘Jackson’)
16) a) INSERT INTO Persons (LastName) VALUES (‘Olsen’)
17) c) To give users access privileges
18) b) Removes specific access privileges from users
19) d) All Correct
20) c) ON Database
This is because the REVOKE statement usually specifies the type of object (such as a) specific table or schema) with tables). Just mentioning Database without specifying an object within it is incorrect. The corrected syntax typically needs to look like:
REVOKE INSERT, UPDATE ON Database.* FROM user123;
21) a) UPDATE Employees SET LastName=’Nilsen’ WHERE LastName=’Hansen’
22) a) DELETE FROM Employees WHERE FirstName = ‘Peter’
23) a) SELECT COUNT(*) FROM Employees
24) d) INNER JOIN
25) a) BETWEEN