SQL Joins u0026 Aggregations Fundamentals Quiz Quiz

Test your foundational knowledge of SQL joins, including INNER and LEFT joins, and key aggregation concepts like GROUP BY and HAVING. This quiz helps reinforce essential SQL techniques for querying and summarizing relational data.

  1. Identifying INNER JOIN results

    Given two tables 'students' and 'scores', which SQL join returns only the rows where there are matching student IDs in both tables?

    1. INNER JOIN
    2. LEFT JOIN
    3. FULL JOIN
    4. CROSS JOIN
  2. LEFT JOIN explanation

    Which SQL JOIN will include all rows from the left table and matching rows from the right table, filling with NULLs when no match exists?

    1. SELF JOIN
    2. INNER JOIN
    3. RIGHT JOIN
    4. LEFT JOIN
  3. Basic GROUP BY usage

    Which SQL clause is necessary when you want to aggregate data, for example, finding the total sales per region from a 'sales' table?

    1. JOIN
    2. ORDER BY
    3. GROUP BY
    4. WHERE
  4. Aggregating with COUNT

    If you want to count the number of employees in each department using a 'department' column, which aggregate function do you use?

    1. SUM()
    2. COUNT()
    3. MIN()
    4. AVG()
  5. Filtering groups with HAVING

    Which clause is used to filter groups created by the GROUP BY clause, such as keeping only groups where the total is greater than 100?

    1. WHERE
    2. HAVING
    3. SELECT
    4. ORDER BY
  6. Result of unmatched LEFT JOIN rows

    What value will appear in the joined columns from the right table when a LEFT JOIN finds no matching row?

    1. NULL
    2. 0
    3. BLANK
    4. N/A
  7. Order of SQL clauses

    Which comes first in SQL syntax: the GROUP BY clause or the HAVING clause?

    1. ORDER BY
    2. GROUP BY
    3. HAVING
    4. SELECT
  8. Typical INNER JOIN scenario

    If you want to list only customers who have at least one order in an 'orders' table, which type of join should be used between 'customers' and 'orders'?

    1. CROSS JOIN
    2. LEFT JOIN
    3. OUTER JOIN
    4. INNER JOIN
  9. Syntax for joining tables

    Which keyword should be placed between two table names in an SQL statement to perform a LEFT JOIN?

    1. LEFT JOIN
    2. MERGE
    3. AGGREGATE
    4. LINK
  10. Purpose of GROUP BY

    What is the main use of the GROUP BY clause when working with aggregate functions in SQL?

    1. To group rows with the same value in specified columns
    2. To join tables on a key
    3. To filter individual rows
    4. To sort the final result set