Which SQL function would you use to combine the first and last names from two different columns into a single column?
COMBINE()
CONCAT()
MERGE()
JOIN()
You want to select the department with the highest average salary. What SQL clause would you use to filter the grouped results based on the calculated average salary?
HAVING
WHERE
ORDER BY
LIMIT
To modify existing data in a table, which SQL statement would you use?
ALTER
UPDATE
CHANGE
MODIFY
In which scenario would a subquery be a more suitable choice than a JOIN operation?
When you need to sort data from multiple tables based on a common column.
When you need to update data in one table based on data from another table.
When you need to filter data based on a condition that involves a separate query.
When you need to combine data from multiple tables based on a common column.
In a SQL query, what does the logical operator 'AND' do?
It sorts the results in descending order.
It negates a condition.
It combines two conditions, and at least one condition must be true for the row to be included.
It combines two conditions, and both conditions must be true for the row to be included.
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 sort the product IDs in ascending order.
To retrieve only unique product IDs, eliminating duplicates.
To filter product IDs based on a specific condition.
Which of the following is NOT a valid SQL data type?
VARCHAR
INTEGER
BOOLEAN
FLOAT
What is the key difference between the IN and EXISTS operators when used with subqueries?
IN is used for single values, while EXISTS is used for multiple values.
There is no difference; they are interchangeable.
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 is the difference between CURDATE() and NOW() in SQL?
CURDATE()
NOW()
CURDATE() returns the current date, NOW() returns the current time.
They are interchangeable.
CURDATE() returns the current date and time, NOW() returns the current date.
CURDATE() returns the current date, NOW() returns the current date and time.
Which data type would be most suitable for storing a person's last name in a SQL database?
DATE
DECIMAL