SQL Mastery Quiz: Test Your Skills! Quiz

  1. Select Statement Basics

    Which SQL clause is used to specify the columns that should be returned in a query result?

    1. SELECT
    2. FROM
    3. OUTPUT
    4. CHOOSE
    5. RETURN
  2. Filtering Data

    If you want to retrieve only rows where the column 'status' has the value 'active', which clause should you use in your SQL query?

    1. WHERE
    2. WHEN
    3. HAVING
    4. IF
    5. WITH
  3. Sorting Results

    How can you sort query results by the 'created_at' column in descending order?

    1. ORDER BY created_at DESC
    2. SORT created_at DESCENDING
    3. GROUP BY created_at DESC
    4. ORDER IN created_at DOWN
    5. SORT BY created_at DOWN
  4. Aggregate Functions

    Which function in SQL returns the number of rows that matches a specified criterion?

    1. COUNT()
    2. SUM()
    3. TOTAL()
    4. AMOUNT()
    5. NUMBER()
  5. Grouping Data

    To group rows sharing the same values in specific columns, which SQL keyword is used?

    1. GROUP BY
    2. COLLECT BY
    3. SORT BY
    4. GATHER BY
    5. CLUSTER BY
  6. Updating Records

    Which SQL command changes existing data in a table?

    1. UPDATE
    2. CHANG
    3. MODIFY
    4. ALTER
    5. SETUP
  7. Joining Tables

    Which type of SQL join returns all records from the left table and the matched records from the right table?

    1. LEFT JOIN
    2. FULL JOIN
    3. INNER JOIN
    4. RIGHT JOIN
    5. LEFT INNER JOIN
  8. Limiting Results

    How do you restrict the number of rows returned by a SQL query to 10?

    1. LIMIT 10
    2. TOP 10
    3. ROWCOUNT 10
    4. SET 10
    5. MAX 10
  9. Deleting Data

    Which SQL statement deletes all rows from a table named 'users'?

    1. DELETE FROM users
    2. REMOVE users
    3. DROP TABLE users
    4. ERASE FROM users
    5. CLEAR users
  10. NULL Values

    Which SQL operator is used to test for empty values in a column?

    1. IS NULL
    2. = NULL
    3. EQUAL NULL
    4. IS BLANK
    5. IS EMPTY