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?
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.
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?
- A
Sum the order amount on every joined item row, then divide by the number of items.
- B
Use SELECT DISTINCT on the final result before summing all order amounts.
- C
Calculate order-level totals from the orders table or aggregate item data to the order level before joining.
- D
Remove orders that have more than one item before calculating the total.
Why can summing an order-level amount in the result of a one-to-many join overstate revenue?
- A
The order-level amount is repeated on each item row, so summing it across the joined rows can overstate revenue.
- B
The join automatically converts each order-level amount into an item-level amount.
- C
Every one-to-many join removes order-level amounts from the result.
- D
Repeated order-level amounts mean the join condition must be incorrect.
Before joining tables, how should you check whether a supposed key is unique at the intended level of detail?
- A
Check whether any displayed column contains repeated values.
- B
Count only the rows in the joined result.
- C
Check whether the left-side table has fewer rows than the right-side table.
- D
Test whether the column or combination of columns identifying a row at the intended grain is unique.
What can an increase in row count after a join indicate when the relationship is one-to-many?
- A
A join is incorrect whenever its output has more rows than either input.
- B
A join is correct only when its output row count matches the left input.
- C
A join can increase row count legitimately when a left-side row has multiple matching right-side rows.
- D
An increase in row count proves the left-side key is unique.
Which approach is supported for calculating order-level totals without summing repeated amounts across item rows?
- A
Sum the order amount once for each matching item row.
- B
Calculate order-level totals from the orders table before joining to detail.
- C
Keep only orders with exactly one item.
- D
Add the order amount to each item amount before grouping.
A table uses a composite key. What should you include when checking whether the key is unique?
- A
Group by every column that should jointly identify a row.
- B
Check each composite-key column separately and ignore their combination.
- C
Choose whichever composite-key column appears most often.
- D
Add the columns together and check whether the resulting values repeat.
Which operation can prevent an order-level amount from being overcounted when item details are joined to orders?
- A
Join each item to the order and sum the order amount once per resulting row.
- B
Discard every order that has more than one item.
- C
Replace the order amount with the item count.
- D
Aggregate the item data to the order level before joining.
When diagnosing apparent duplicates after a join, what does the intended row grain describe?
- A
The number of columns selected by the query.
- B
The database’s physical storage format for each table.
- C
What one row in the result is intended to represent.
- D
The total number of rows across all input tables.
How does a left join behave when a left-side row has multiple matching right-side rows?
- A
A left join removes every left-side row with no match and limits each remaining row to one result.
- B
A left join retains unmatched left-side rows and still produces multiple rows when there are multiple matches.
- C
A left join always produces the same number of rows as the left table.
- D
A left join removes repeated right-side matches automatically.
Related study packs and tools
1 Network Security Foundations and Threats
Learn how network security goals, threat modeling, identity and access controls, and layered defenses help protect connected systems and support recovery.
1 Network Troubleshooting Method
Learn a disciplined workflow for defining network problems, gathering evidence, testing likely causes, applying controlled fixes, and confirming and documenting the results.
1 Networking Fundamentals
A medium-difficulty quiz on networking fundamentals, including communication roles, protocol layers, data units, and network models.
2 Protocols and Ports
A medium-difficulty quiz on interpreting network protocols, ports, and common traffic patterns.
2 Virtual Machines
A medium-difficulty quiz on virtual machine architecture, provisioning, networking, storage, and operations.
4 Mobile Connectivity
A 14-question quiz on applying mobile connectivity concepts to common settings, usage, and troubleshooting situations.
5 Cloud Service Models
A medium-difficulty quiz on applying and distinguishing IaaS, PaaS, and SaaS, including their responsibilities, trade-offs, and appropriate uses.
5 Diagnosing Mobile Device Problems
Learn to diagnose mobile-device power, battery, touchscreen, connectivity, app, and operating-system problems using safe checks and a systematic process.
5 Network Operations and Reliability
A medium-difficulty quiz on network operations, monitoring, configuration management, resilience, and recovery planning.
6 Security Operations and Incident Response
Learn how security teams monitor activity, manage vulnerabilities, respond to incidents, preserve digital evidence, and restore services safely.
7 Integrated Troubleshooting Practice
A practical workflow for isolating mixed hardware, display, storage, mobile-device, and network problems, protecting data, and verifying repairs.
8 Comprehensive Security+ Practice and Review
A scenario-focused guide to Security+ SY0-701 concepts, emphasizing evidence-based incident response, access control, cryptography, vulnerability handling, recovery objectives, and risk governance.