← All DA Flashcard Decks

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
  1. Which SQL function returns the current date and time?

    Answer: NOW()

    NOW() returns the current date and time in most SQL dialects, including MySQL and PostgreSQL.

  2. What is a subquery in SQL?

    Answer: A query nested inside another query

    A subquery is a query embedded within another SQL query, often in the WHERE, FROM, or SELECT clause.

  3. What does the GROUP BY clause do in SQL?

    Answer: Aggregates rows sharing the same value in specified columns

    GROUP BY collapses rows that have the same value in the specified column(s) so aggregate functions like SUM or COUNT apply per group.

  4. Which SQL join returns only the rows where there is a match in both tables?

    Answer: INNER JOIN

    INNER JOIN returns only rows that have matching values in both tables based on the join condition.

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

    Answer: Speed up data retrieval operations

    An index creates a data structure that allows the database engine to locate rows faster without scanning the entire table.

  6. Which SQL function calculates a running total within a window of rows?

    Answer: SUM() OVER ()

    SUM() OVER () is a window function that computes a cumulative sum across a defined partition or ordered window of rows.