PracHub
QuestionsPremiumCoachesLearningGuidesInterview Prep

Quick Overview

This question evaluates proficiency in SQL data transformation and aggregation, specifically the ability to pivot row-level transactional revenue into a columnar monthly report and handle schema alignment for reporting.

  • Medium
  • Amazon
  • Data Manipulation (SQL/Python)
  • Business Intelligence Engineer

Create Monthly Revenue Report for Each Department

Company: Amazon

Role: Business Intelligence Engineer

Category: Data Manipulation (SQL/Python)

Difficulty: Medium

Interview Round: Onsite

DEPARTMENT_REVENUE +------------+---------+-------+ | Department | Revenue | Month | +------------+---------+-------+ | A | 8000 | Jan | | B | 9000 | Jan | | C | 10000 | Feb | | A | 7000 | Feb | | A | 6000 | Mar | +------------+---------+-------+ ##### Scenario Finance analytics team needs a report that shows each department in one row with separate revenue columns for every month of the year. ##### Question Given table DEPARTMENT_REVENUE(Department, Revenue, Month), write an SQL query that pivots the data so the output has one row per department and twelve columns: Jan_Revenue, Feb_Revenue, …, Dec_Revenue. ##### Hints Use conditional aggregation (CASE) or database-specific PIVOT operator.

Quick Answer: This question evaluates proficiency in SQL data transformation and aggregation, specifically the ability to pivot row-level transactional revenue into a columnar monthly report and handle schema alignment for reporting.

Last updated: Mar 29, 2026

Loading coding console...

PracHub

Master your tech interviews with 8,500+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities
  • Student Access

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.

Related Coding Questions

  • Find recommended friend pairs by shared songs - Amazon (medium)
  • Find recommended friend pairs by shared listening - Amazon (easy)
  • Write SQL window functions for D7 retention - Amazon (medium)
  • Find daily first-order merchants with SQL - Amazon (Medium)
  • Design student–course data models and SQL - Amazon (Medium)