What is the primary clause used to retrieve data from a table in SQL?
RETRIEVE
GET
FETCH
SELECT
How would you select the top 5 highest-scoring games from a table named 'games' with a column called 'score'?
SELECT * FROM games ORDER BY score DESC LIMIT 5;
SELECT TOP 5 * FROM games ORDER BY score DESC;
SELECT * FROM games ORDER BY score ASC LIMIT 5;
SELECT * FROM games WHERE score LIMIT 5;
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
IN Subquery
Any of the above would be equally efficient.
What potential issue should be considered when using correlated subqueries?
They cannot be used with aggregate functions.
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.
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
Which data type would be most suitable for storing a person's last name in a SQL database?
DECIMAL
VARCHAR
INTEGER
DATE
Which SQL clause is used to sort the result set?
ORDER
SORT
SORT BY
ORDER BY
Which comparison operator means 'not equal to' in SQL?
<>
!=
=
<
What type of join returns all rows from both tables, regardless of whether there is a match?
LEFT JOIN
RIGHT JOIN
FULL OUTER JOIN
INNER JOIN
Which of the following is NOT a valid SQL data type?
BOOLEAN
FLOAT