โ† All SQL Flashcard Decks

General Concepts Flashcards

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

Read the first 7 General Concepts flashcards as text
  1. Which type of JOIN returns only rows with matching values in both tables?

    Answer: INNER JOIN

    An INNER JOIN returns only rows where the join condition matches in both tables.

  2. What does a foreign key establish?

    Answer: A link between two tables

    A foreign key references a primary key in another table, enforcing referential integrity.

  3. Which aggregate function counts the number of rows?

    Answer: COUNT()

    COUNT() returns the number of rows matching the query.

  4. What does the GROUP BY clause do?

    Answer: Groups rows sharing a value for aggregation

    GROUP BY groups rows with the same values so aggregate functions can summarize them.

  5. Which clause filters results after aggregation?

    Answer: HAVING

    HAVING filters groups after aggregation, unlike WHERE which filters rows before.

  6. What is the purpose of an index in a database?

    Answer: To speed up data retrieval

    An index improves query performance by allowing faster lookups.

  7. Which keyword removes duplicate rows from a result set?

    Answer: DISTINCT

    DISTINCT eliminates duplicate rows from the query output.

General Concepts Flashcards โ€” SQL Study Cards with Answers