What SQL clause is used to filter rows in a result set based on specific conditions?
FROM
SELECT
ORDER BY
WHERE
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.
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
Correlated Subquery
Any of the above would be equally efficient.
IN Subquery
By default, how does the 'ORDER BY' clause sort data?
Randomly
In descending order
In ascending order
Alphabetically
Which of the following is NOT a valid SQL data type?
FLOAT
VARCHAR
INTEGER
BOOLEAN
Which aggregate function would you use to find the highest value in a column?
SUM()
MAX()
MIN()
AVG()
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()
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 ASC LIMIT 5;
SELECT * FROM games ORDER BY score DESC LIMIT 5;
SELECT * FROM games WHERE score LIMIT 5;
What does the asterisk (*) symbol represent when used in a SELECT statement?
A specific column name
All columns
A wildcard for searching data
A comment indicator
How would you sort results in descending order by the 'date_created' column?
ORDER BY date_created DESC
SORT BY date_created DESC
ORDER BY date_created ASC
SORT BY date_created ASC