SQL and Database Querying Flashcards
6 cards from real DA practice questions. Tap to flip, then mark Knew It or Still Learning โ missed cards come back until you master them.
Read the first 6 SQL and Database Querying flashcards as text
Which SQL clause is used to filter rows after a GROUP BY operation?
Answer: HAVING
HAVING is used to filter aggregated results produced by GROUP BY, whereas WHERE filters individual rows before aggregation.
What does a LEFT JOIN return?
Answer: All rows from the left table and matching rows from the right
A LEFT JOIN returns all rows from the left table and the matched rows from the right table; unmatched right-table rows appear as NULL.
Which aggregate function counts only non-NULL values in a column?
Answer: COUNT(column_name)
COUNT(column_name) counts only non-NULL entries in that column, while COUNT(*) counts all rows including those with NULLs.
What is the purpose of the SQL DISTINCT keyword?
Answer: Remove duplicate rows from the result set
DISTINCT eliminates duplicate rows from query results, returning only unique value combinations.
Which SQL statement is used to modify existing data in a table?
Answer: UPDATE
UPDATE changes existing records in a table based on a specified condition in the WHERE clause.
What does the SQL ORDER BY clause do?
Answer: Sorts result rows by one or more columns
ORDER BY sorts query results in ascending (ASC, default) or descending (DESC) order based on specified columns.