What is the primary clause used to retrieve data from a table in SQL?
FETCH
SELECT
RETRIEVE
GET
How would you convert the text 'hello world' to uppercase in SQL?
TO_UPPER('hello world')
UCASE('hello world')
MAKE_UPPER('hello world')
UPPER('hello world')
What is the function of the SQL 'WHERE' clause?
To order the results of a query
To filter records based on a specified condition
To limit the number of rows returned by a query
To group rows with the same value in a certain column
What is the purpose of the 'LIMIT' clause in SQL?
It groups rows with the same values.
It restricts the number of rows returned by the query.
It sorts the result set.
It filters rows based on a condition.
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;
Which SQL statement is used to add new rows into a table?
APPEND
ADD
CREATE
INSERT
What is the key difference between the IN and EXISTS operators when used with subqueries?
There is no difference; they are interchangeable.
IN is used for single values, while EXISTS is used for multiple values.
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.
What SQL clause is used to filter rows in a result set based on specific conditions?
FROM
WHERE
ORDER BY
What is the purpose of the COUNT() function in SQL?
COUNT()
Returns the average value of a column
Returns the number of rows in a table
Finds the minimum value in a column
Calculates the sum of values in a column
Which aggregate function would you use to find the highest value in a column?
MAX()
MIN()
AVG()
SUM()