What does the SELECT command do in SQL?
Retrieves data from a database table.
What does the FROM clause specify in SQL?
The table or tables from which data will be retrieved.
What is the purpose of the WHERE clause?
Filters rows based on a specified condition.
What does the JOIN clause do?
Combines rows from two or more tables based on a related column.
What is an INNER JOIN?
Returns rows that have matching values in both tables.
What is a LEFT JOIN?
Returns all rows from the left table and matching rows from the right table.
What is a RIGHT JOIN?
Returns all rows from the right table and matching rows from the left table.
What does GROUP BY do in SQL?
Groups rows that have the same values so aggregate functions can be applied.
What is the purpose of the HAVING clause?
Filters grouped results after aggregation.
What does ORDER BY do?
Sorts query results in ascending or descending order.
What does the LIMIT clause do?
Restricts the number of rows returned by a query.
What does DISTINCT do in SQL?
Removes duplicate rows from the result set.
What does the INSERT command do?
Adds new rows to a table.
What does the UPDATE command do?
Modifies existing rows in a table.
What does the DELETE command do?
Removes rows from a table.
What is MERGE or UPSERT used for?
Inserts a new row or updates an existing row depending on whether a match exists.
What does CREATE TABLE do?
Creates a new table in the database.
What does ALTER TABLE do?
Modifies the structure of an existing table.
What does DROP TABLE do?
Permanently deletes a table and its data.
What does TRUNCATE TABLE do?
Quickly removes all rows from a table without deleting the table itself.
What does CREATE INDEX do?
Creates an index to improve query performance.
What does DROP INDEX do?
Removes an index from a table.
What does the CASE expression do in SQL?
Performs conditional logic similar to an if-then-else statement.
What does COALESCE do in SQL?
Returns the first non-null value from a list of expressions.