BaşlayınÜcretsiz Başlayın

Functions & Grouping

You're examining pizza order details at Pissa. The team is interested in investigating revenue generated by different pizza sizes per month.

Complete the query using your knowledge of aggregate functions, sorting, and grouping to support the team with their analysis.

Bu egzersiz

Introduction to Snowflake SQL

kursunun bir parçasıdır
Kursu Görüntüle

Egzersiz talimatları

  • Get the month from the order_date column.
  • Use appropriate Snowflake SQL keywords to group the query results.
  • Arrange your results by revenue in descending sequence.

Uygulamalı interaktif egzersiz

Bu örnek kodu tamamlayarak bu egzersizi bitirin.

-- Get the month from order_date
SELECT ___(___ FROM ___) AS order_month, 
    p.pizza_size, 
    -- Calculate revenue
    ___(p.price * od.quantity) AS revenue
FROM orders o
INNER JOIN order_details od USING(order_id)
INNER JOIN pizzas p USING(pizza_id)
-- Appropriately group the query
___
-- Sort by revenue in descending order
___
Kodu Düzenle ve Çalıştır