What is the function of the SQL 'WHERE' clause?
To order the results of a query
To group rows with the same value in a certain column
To limit the number of rows returned by a query
To filter records based on a specified condition
You are using a subquery to fetch a list of product IDs from an 'Orders' table. What is the main purpose of using the DISTINCT keyword within this subquery?
To limit the number of product IDs returned.
To filter product IDs based on a specific condition.
To retrieve only unique product IDs, eliminating duplicates.
To sort the product IDs in ascending order.
Which of the following is NOT a valid SQL data type?
BOOLEAN
VARCHAR
INTEGER
FLOAT
Which keyword is used in conjunction with the UPDATE statement to specify the conditions for updating rows?
CONDITION
IF
WHEN
WHERE
You want to select the department with the highest average salary. What SQL clause would you use to filter the grouped results based on the calculated average salary?
ORDER BY
HAVING
LIMIT
You want to find customers who have placed orders in the last month. You have two tables: 'Customers' and 'Orders'. Which subquery type would be most efficient to achieve this?
EXISTS Subquery
Any of the above would be equally efficient.
Correlated Subquery
IN Subquery
What is the purpose of the 'LIMIT' clause in SQL?
It restricts the number of rows returned by the query.
It sorts the result set.
It groups rows with the same values.
It filters rows based on a condition.
What type of join returns all rows from the left table, even if there are no matching rows in the right table?
INNER JOIN
FULL JOIN
LEFT JOIN
RIGHT JOIN
Which aggregate function would you use to find the highest value in a column?
SUM()
AVG()
MAX()
MIN()
Which SQL statement is used to remove rows from a table?
DROP
REMOVE
TRUNCATE
DELETE