Timedora
Free Practice Quiz Question List

SQL Joins, Row Grain, and Aggregation Online Quiz Questions

Use this free practice quiz with 10 questions to review SQL Joins, Row Grain, and Aggregation, test your knowledge, and prepare for your next test or exam.

10 questions
01
Choose one
1 point

A result contains one row per order, and the same customer name appears on two rows because that customer placed two orders. Which is the best way to decide whether these are duplicate records?

  1. A

    Count any repeated customer name as a duplicate record.

  2. B

    Compare rows using the intended row grain and its identifying key.

  3. C

    Use SELECT DISTINCT to remove repeated values before checking the join.

  4. D

    Treat every increase in joined row count as proof of a faulty join.

02
Choose one
1 point

After a one-to-many join from orders to items, each order-level amount is repeated across that order’s item rows. How should you avoid overstating revenue when calculating order-level totals?

  1. A

    Sum the order amount on every joined item row, then divide by the number of items.

  2. B

    Use SELECT DISTINCT on the final result before summing all order amounts.

  3. C

    Calculate order-level totals from the orders table or aggregate item data to the order level before joining.

  4. D

    Remove orders that have more than one item before calculating the total.

03
Choose one
1 point

Why can summing an order-level amount in the result of a one-to-many join overstate revenue?

  1. A

    The order-level amount is repeated on each item row, so summing it across the joined rows can overstate revenue.

  2. B

    The join automatically converts each order-level amount into an item-level amount.

  3. C

    Every one-to-many join removes order-level amounts from the result.

  4. D

    Repeated order-level amounts mean the join condition must be incorrect.

04
Choose one
1 point

Before joining tables, how should you check whether a supposed key is unique at the intended level of detail?

  1. A

    Check whether any displayed column contains repeated values.

  2. B

    Count only the rows in the joined result.

  3. C

    Check whether the left-side table has fewer rows than the right-side table.

  4. D

    Test whether the column or combination of columns identifying a row at the intended grain is unique.

05
Choose one
1 point

What can an increase in row count after a join indicate when the relationship is one-to-many?

  1. A

    A join is incorrect whenever its output has more rows than either input.

  2. B

    A join is correct only when its output row count matches the left input.

  3. C

    A join can increase row count legitimately when a left-side row has multiple matching right-side rows.

  4. D

    An increase in row count proves the left-side key is unique.

06
Choose one
1 point

Which approach is supported for calculating order-level totals without summing repeated amounts across item rows?

  1. A

    Sum the order amount once for each matching item row.

  2. B

    Calculate order-level totals from the orders table before joining to detail.

  3. C

    Keep only orders with exactly one item.

  4. D

    Add the order amount to each item amount before grouping.

07
Choose one
1 point

A table uses a composite key. What should you include when checking whether the key is unique?

  1. A

    Group by every column that should jointly identify a row.

  2. B

    Check each composite-key column separately and ignore their combination.

  3. C

    Choose whichever composite-key column appears most often.

  4. D

    Add the columns together and check whether the resulting values repeat.

08
Choose one
1 point

Which operation can prevent an order-level amount from being overcounted when item details are joined to orders?

  1. A

    Join each item to the order and sum the order amount once per resulting row.

  2. B

    Discard every order that has more than one item.

  3. C

    Replace the order amount with the item count.

  4. D

    Aggregate the item data to the order level before joining.

09
Choose one
1 point

When diagnosing apparent duplicates after a join, what does the intended row grain describe?

  1. A

    The number of columns selected by the query.

  2. B

    The database’s physical storage format for each table.

  3. C

    What one row in the result is intended to represent.

  4. D

    The total number of rows across all input tables.

10
Choose one
1 point

How does a left join behave when a left-side row has multiple matching right-side rows?

  1. A

    A left join removes every left-side row with no match and limits each remaining row to one result.

  2. B

    A left join retains unmatched left-side rows and still produces multiple rows when there are multiple matches.

  3. C

    A left join always produces the same number of rows as the left table.

  4. D

    A left join removes repeated right-side matches automatically.