1. : What does SQL stand for?
(A) Structured Query Language
(B) Standard Query Language
(C) Simple Query Language
(D) Sequential Query Language
2. : Which SQL clause is used to filter records?
(A) WHERE
(B) SELECT
(C) ORDER BY
(D) GROUP BY
3. : How do you select all the columns from a table named “customers”?
(A) SELECT * FROM customers;
(B) SELECT all FROM customers;
(C) SELECT columns FROM customers;
(D) SELECT all_columns FROM customers;
4. : Which SQL statement is used to delete data from a table?
(A) REMOVE
(B) DELETE
(C) DROP
(D) CLEAR
5. : How do you sort the result set in ascending order by “age”?
(A) ORDER BY age ASC;
(B) SORT BY age;
(C) ORDER age ASC;
(D) SORT age;
6. : Which function is used to count the number of rows in a table?
(A) SUM()
(B) COUNT()
(C) NUMBER()
(D) TOTAL()
7. : How do you calculate the average value of the “salary” column in a table named “employees”?
(A) SELECT MEAN(salary) FROM employees;
(B) SELECT AVG(salary) FROM employees;
(C) SELECT SUM(salary) FROM employees;
(D) SELECT AVERAGE(salary) FROM employees;
8. : Which SQL clause is used to group rows that have the same values?
(A) GROUP BY
(B) ORDER BY
(C) WHERE
(D) FILTER BY
9. : How do you select the minimum value of the “price” column from the “products” table?
(A) SELECT MIN(price) FROM products;
(B) SELECT LEAST(price) FROM products;
(C) SELECT LOW(price) FROM products;
(D) SELECT MINIMUM(price) FROM products;
10. : Which SQL function returns the maximum value of a column?
(A) MAX()
(B) HIGHEST()
(C) TOP()
(D) UPPER()
11. : What is the purpose of the JOIN clause in SQL?
(A) To combine rows from two or more tables based on a related column
(B) To delete rows in a table
(C) To update rows in a table
(D) To sort the result set
12. : How do you perform an inner join between two tables “orders” and “customers” on the “customer_id” column?
(A) SELECT * FROM orders INNER JOIN customers ON orders.customer_id = customers.customer_id;
(B) SELECT * FROM orders JOIN customers WHERE orders.customer_id = customers.customer_id;
(C) SELECT * FROM orders FULL JOIN customers ON orders.customer_id = customers.customer_id;
(D) SELECT * FROM orders LEFT JOIN customers ON orders.customer_id = customers.customer_id;
13. : Which join returns all rows from the left table and the matched rows from the right table?
(A) LEFT JOIN
(B) RIGHT JOIN
(C) INNER JOIN
(D) FULL JOIN
14. : What does a FULL JOIN return?
(A) All rows when there is a match in either left or right table
(B) All rows from the left table
(C) All rows from the right table
(D) Only the matched rows from both tables
15. : How do you perform a self-join?
(A) Joining a table with itself
(B) Joining two different tables
(C) Joining three tables together
(D) Joining a table with a view
16. : What is a subquery in SQL?
(A) A query within another query
(B) A query that updates multiple rows
(C) A query that deletes data
(D) A query that creates a new table
17. : How do you create an index on the “name” column in the “students” table?
(A) CREATE INDEX idx_name ON students(name);
(B) ADD INDEX idx_name ON students(name);
(C) MAKE INDEX idx_name ON students(name);
(D) SET INDEX idx_name ON students(name);
18. : What does the SQL statement ALTER TABLE employees ADD COLUMN age INT; do?
(A) Adds a new column “age” of type INT to the “employees” table
(B) Changes the data type of the “age” column in the “employees” table
(C) Deletes the “age” column from the “employees” table
(D) Renames the “employees” table to “age”
19. : How do you remove a table named “sales” from a database?
(A) DROP TABLE sales;
(B) DELETE TABLE sales;
(C) REMOVE TABLE sales;
(D) CLEAR TABLE sales;
20. : Which SQL statement is used to modify data in a table?
(A) UPDATE
(B) MODIFY
(C) ALTER
(D) CHANGE