Which data type would be most suitable for storing a person's last name in a SQL database?
INTEGER
DATE
DECIMAL
VARCHAR
What is the purpose of the 'LIMIT' clause in SQL?
It filters rows based on a condition.
It restricts the number of rows returned by the query.
It groups rows with the same values.
It sorts the result set.
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?
Correlated Subquery
EXISTS Subquery
Any of the above would be equally efficient.
IN Subquery
What is the function of the SQL 'WHERE' clause?
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
To order the results of a query
Which aggregate function would you use to find the highest value in a column?
MAX()
SUM()
AVG()
MIN()
What potential issue should be considered when using correlated subqueries?
They require the use of the JOIN clause.
They can lead to performance issues if not used carefully.
They cannot return more than one column.
They cannot be used with aggregate functions.
Which SQL clause is used to sort the result set?
ORDER BY
ORDER
SORT
SORT BY
How would you sort results in descending order by the 'date_created' column?
SORT BY date_created ASC
ORDER BY date_created ASC
ORDER BY date_created DESC
SORT BY date_created DESC
What is the purpose of a subquery in SQL?
To modify data in multiple tables simultaneously.
To retrieve data from a table that will be used in a larger query.
To define a new aggregate function.
To create a temporary table for intermediate results.
What does the asterisk (*) symbol represent when used in a SELECT statement?
A wildcard for searching data
A comment indicator
A specific column name
All columns