โ† All DAC Flashcard Decks

DAC Database & SQL Analytics Flashcards

6 cards from real DAC practice questions. Tap to flip, then mark Knew It or Still Learning โ€” missed cards come back until you master them.

Read the first 6 DAC Database & SQL Analytics flashcards as text
  1. Which SQL clause is used to filter rows after aggregation has been performed?

    Answer: HAVING

    The HAVING clause filters groups after aggregation (e.g., after GROUP BY), while WHERE filters individual rows before aggregation.

  2. What is the difference between an INNER JOIN and a LEFT JOIN in SQL?

    Answer: INNER JOIN returns only matching rows; LEFT JOIN returns all rows from the left table plus matching rows from the right

    INNER JOIN returns only rows with matching values in both tables, while LEFT JOIN returns all rows from the left table and matching rows from the right (NULLs for non-matches).

  3. Which SQL aggregate function returns the number of non-NULL values in a column?

    Answer: COUNT()

    COUNT() counts non-NULL values when given a column name, or all rows (including NULLs) when used as COUNT(*).

  4. What does a database index primarily improve?

    Answer: Data query and retrieval speed

    Database indexes speed up SELECT queries by allowing the database engine to find rows quickly without scanning the entire table.

  5. In SQL, what does the DISTINCT keyword do?

    Answer: Removes duplicate values from the result set

    DISTINCT eliminates duplicate rows from a query result, returning only unique values for the selected columns.

  6. What is a primary key in a relational database?

    Answer: A column or combination of columns that uniquely identifies each row in a table

    A primary key uniquely identifies each record in a table and cannot contain NULL values, ensuring data integrity.