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?
LIMIT
ORDER BY
HAVING
WHERE
What is the key difference between the IN and EXISTS operators when used with subqueries?
IN checks for existence in a list, while EXISTS checks for existence in a table.
IN compares values, while EXISTS checks for the presence of rows.
There is no difference; they are interchangeable.
IN is used for single values, while EXISTS is used for multiple values.
To modify existing data in a table, which SQL statement would you use?
ALTER
CHANGE
MODIFY
UPDATE
How would you sort results in descending order by the 'date_created' column?
SORT BY date_created DESC
ORDER BY date_created DESC
ORDER BY date_created ASC
SORT BY date_created ASC
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 filter product IDs based on a specific condition.
To sort the product IDs in ascending order.
To limit the number of product IDs returned.
To retrieve only unique product IDs, eliminating duplicates.
What does the asterisk (*) symbol represent when used in a SELECT statement?
A comment indicator
A specific column name
A wildcard for searching data
All columns
Which SQL function would you use to combine the first and last names from two different columns into a single column?
JOIN()
COMBINE()
CONCAT()
MERGE()
Which comparison operator means 'not equal to' in SQL?
=
<
<>
!=
How would you convert the text 'hello world' to uppercase in SQL?
TO_UPPER('hello world')
MAKE_UPPER('hello world')
UCASE('hello world')
UPPER('hello world')
What SQL clause is used to group rows with the same value in one or more columns into a summary row?
SELECT
GROUP BY