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
WHERE
ORDER BY
HAVING
By default, how does the 'ORDER BY' clause sort data?
In ascending order
In descending order
Alphabetically
Randomly
What is the function of the SQL 'WHERE' clause?
To group rows with the same value in a certain column
To filter records based on a specified condition
To order the results of a query
To limit the number of rows returned by a query
In which scenario would a subquery be a more suitable choice than a JOIN operation?
When you need to update data in one table based on data from another table.
When you need to combine data from multiple tables based on a common column.
When you need to filter data based on a condition that involves a separate query.
When you need to sort data from multiple tables based on a common column.
How would you convert the text 'hello world' to uppercase in SQL?
UCASE('hello world')
TO_UPPER('hello world')
MAKE_UPPER('hello world')
UPPER('hello world')
Which SQL statement is used to add new rows into a table?
APPEND
INSERT
CREATE
ADD
What is the purpose of the 'OR' operator in a SQL WHERE clause?
It negates a condition.
It limits the number of rows returned.
It selects rows where both conditions are true.
It selects rows where at least one condition is true.
What potential issue should be considered when using correlated subqueries?
They cannot be used with aggregate functions.
They cannot return more than one column.
They can lead to performance issues if not used carefully.
They require the use of the JOIN clause.
What does the asterisk (*) symbol represent when used in a SELECT statement?
A wildcard for searching data
A comment indicator
All columns
A specific column name
How would you select the top 5 highest-scoring games from a table named 'games' with a column called 'score'?
SELECT TOP 5 * FROM games ORDER BY score DESC;
SELECT * FROM games ORDER BY score DESC LIMIT 5;
SELECT * FROM games WHERE score LIMIT 5;
SELECT * FROM games ORDER BY score ASC LIMIT 5;