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
WHERE
HAVING
LIMIT
What does the asterisk (*) symbol represent when used in a SELECT statement?
A specific column name
A wildcard for searching data
A comment indicator
All columns
What is the purpose of the 'LIMIT' clause in SQL?
It groups rows with the same values.
It sorts the result set.
It restricts the number of rows returned by the query.
It filters rows based on a condition.
What type of join returns all rows from both tables, regardless of whether there is a match?
FULL OUTER JOIN
RIGHT JOIN
LEFT JOIN
INNER JOIN
Which aggregate function would you use to find the highest value in a column?
MAX()
MIN()
SUM()
AVG()
What is the result of SELECT NOW(); in SQL?
SELECT NOW();
Current date
Current date and time
An error message
Current time
How would you sort results in descending order by the 'date_created' column?
SORT BY date_created ASC
ORDER BY date_created DESC
SORT BY date_created DESC
ORDER BY date_created ASC
What type of join returns all rows from the left table, even if there are no matching rows in the right table?
FULL JOIN
What is the purpose of a subquery in SQL?
To define a new aggregate function.
To create a temporary table for intermediate results.
To retrieve data from a table that will be used in a larger query.
To modify data in multiple tables simultaneously.
Which keyword is used in conjunction with the UPDATE statement to specify the conditions for updating rows?
IF
WHEN
CONDITION