LoslegenKostenlos loslegen

Revenue per customer

You've been hired at Delivr as a data analyst! A customer just called Delivr's Customer Support team; she wants to double-check whether her receipts add up. Going by her receipts, she calculated that her total bill on Delivr is $271, and she wants to make sure of that. Her user ID is 15.

Help the Customer Support team by calculating her total bill! Sum up everything she's spent on Delivr orders; in other words, calculate the total revenue that Delivr has generated from her.

Diese Übung ist Teil des Kurses

Analyzing Business Data in SQL

Kurs anzeigen

Anleitung zur Übung

  • Write the expression for revenue.
  • Keep only the records of user ID 15.

Interaktive Übung

Vervollständige den Beispielcode, um diese Übung erfolgreich abzuschließen.

-- Calculate revenue
SELECT ___ AS revenue
  FROM meals
  JOIN orders ON meals.meal_id = orders.meal_id
-- Keep only the records of customer ID 15
WHERE ___;
Code bearbeiten und ausführen