To calculate ROI for a specific marketing campaign we need to know 2 numbers:
- total spend. We’d need to apply grouping and summing in marketing_spends table
- total earnings. We’d need to look at users who were attributed to this campaign and calculate the sum of their purchases. Wow, that’s even more tricky – users and purchases are 2 different tables
The solution to this problem and many more data problems is joining two or more tables.
Joining tables is basically forming a new table which is the combination of two or more tables. Once...