What is the key difference between the IN and EXISTS operators when used with subqueries?
IN checks for existence in a list, while EXISTS checks for existence in a table.
There is no difference; they are interchangeable.
IN is used for single values, while EXISTS is used for multiple values.
IN compares values, while EXISTS checks for the presence of rows.
How would you convert the text 'hello world' to uppercase in SQL?
UCASE('hello world')
UPPER('hello world')
MAKE_UPPER('hello world')
TO_UPPER('hello world')
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.
Which aggregate function would you use to find the highest value in a column?
AVG()
MIN()
MAX()
SUM()
What is the primary clause used to retrieve data from a table in SQL?
FETCH
GET
RETRIEVE
SELECT
Which comparison operator means 'not equal to' in SQL?
<>
=
<
!=
What type of join returns all rows from the left table, even if there are no matching rows in the right table?
INNER JOIN
RIGHT JOIN
FULL JOIN
LEFT JOIN
What is the result of SELECT NOW(); in SQL?
SELECT NOW();
Current time
Current date
Current date and time
An error message
What is the purpose of the 'OR' operator in a SQL WHERE clause?
It negates a condition.
It selects rows where at least one condition is true.
It limits the number of rows returned.
It selects rows where both conditions are true.
Which type of subquery is used to check if a value exists in a list of values returned by another query?
IN Subquery
Nested Subquery
Correlated Subquery
EXISTS Subquery