A retailer records each completed sale exactly once in Sales. Campaign placements lists the channels in which each product is advertised; it does not identify which campaign generated a sale.
Sales
Sale ID
Product ID
Sales amount (USD)
T81
J4
80
T82
120
T83
K2
60
Campaign placements
Channel
Email
App
Store
An analyst performs an inner join using Product ID alone. Every sales record is paired with every campaign-placement record having the same Product ID. No rows are removed afterward.
Find the number of merged rows, the sum of Sales amount across those merged rows, and the amount by which that sum exceeds the original Sales total. Give the row count as an exact integer and both monetary answers in USD to the nearest whole dollar.
Unlock full course notes by signing up
Preserving zero and missing values
A warehouse records every expected product-week combination. Its report contains the following row, where missing means the count has not been reported:
The report must become one row per product and week without changing its information. How should these entries appear?
Comparing which records a merge retains
A purchasing analyst merges the following datasets using Supplier ID. Purchases is the left dataset, and Suppliers is the right dataset. Every supplier ID in Suppliers occurs exactly once. Each matching purchase produces its own output row.
Purchases
Suppliers
Resolving ambiguous output cells
A store's sales records are shown below. Revenue is measured in CAD, and the records contain no duplicate Store-Month-Channel combinations.
An analyst attempts to create one row per store, with August and September as revenue columns. The reshaping tool reports multiple source values for each monthly cell. The analyst must retain separate channel revenues and be able to reconstruct the original records. Which revision meets those requirements?
Auditing an information-preserving reshape
A distribution manager receives this complete report for warehouse W06. Every expected Warehouse-Week-Carrier combination in the reporting period is present. Missing means a count has not been reported; both measurements are counts of boxes.
The manager wants carrier columns side by side for each warehouse and week, retaining both measurements so that the source records can be reconstructed.
A colleague proposes using only Warehouse to identify output rows, using Carrier for column headings, and using Dispatched boxes for cell values. When several values target the same cell, the colleague keeps the first. The colleague also replaces missing entries with zero.