โ† All Online Coding Lessons Flashcard Decks

SQL and Database Basics Flashcards

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

Read the first 7 SQL and Database Basics flashcards as text
  1. Which SQL keyword removes duplicate rows from a SELECT result?

    Answer: DISTINCT

    The DISTINCT keyword, used right after SELECT, eliminates duplicate rows so each value appears only once in the results.

  2. What SQL clause is used to combine rows from two or more tables based on a related column?

    Answer: JOIN

    The JOIN clause is used to combine rows from two or more tables based on a related (usually matching) column between them.

  3. Which SQL aggregate function returns the total number of rows in a result set?

    Answer: COUNT()

    COUNT() is an aggregate function that returns the number of rows that match a specified condition.

  4. What does the UPDATE command do in SQL?

    Answer: Changes existing data in one or more rows

    The UPDATE statement modifies the values of existing records in a table, usually with a WHERE clause to target specific rows.

  5. In SQL, what does the wildcard character % represent when used with the LIKE operator?

    Answer: Any sequence of zero or more characters

    The % wildcard in a LIKE pattern matches any sequence of zero or more characters, making it useful for partial-text searches.

  6. Which SQL command is used to create a new database table?

    Answer: CREATE TABLE

    CREATE TABLE is the SQL DDL command used to define and create a new table with specified columns and data types.

  7. What is the purpose of the GROUP BY clause in SQL?

    Answer: Groups rows sharing the same value for use with aggregate functions

    GROUP BY groups rows with the same values in specified columns so aggregate functions like SUM() or COUNT() can be applied to each group.