Ravindra BagaleCourses & study guides Track your progress

29. SQL for Excel Users (Term Map + Side-by-Side)

29.5 Practice: Same Questions in Excel and SQLite

Why. Same question in both tools proves you understood the map.

What. Practice twin tasks: filter sum, pivot by city, IF size label.

How. Do SQL here; optionally recreate in Excel on the CSV export.

Steps

  1. Pune sales SUM.
  2. Sales by city.
  3. Size CASE labels.

Examples

Example 1 · dataset: raja_coffee

SELECT ROUND(SUM(amount_inr),2) FROM orders WHERE city='Pune';

Output

ROUND(SUM(amount_inr),2)
9170.0

Meaning. Twin A: filtered sum.

Example 2 · dataset: raja_coffee

SELECT city, ROUND(SUM(amount_inr),2) AS sales_inr FROM orders GROUP BY city;

Output

citysales_inr
Goa1600.0
Kolhapur2410.0
Mumbai2490.0
Nashik2320.0
Pune9170.0
Solapur730.0

Meaning. Twin B: pivot.

Ravindra Bagale's Tip

Download orders.csv from datasets if you want the Excel side-by-side.