PracHub
QuestionsPremiumLearningGuidesCheatsheetNEWCoaches

Quick Overview

This question evaluates proficiency in data manipulation and SQL querying, focusing on aggregation, date-based filtering, joins, and set-difference logic across transactional and catalog tables.

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

Analyze Top Book Sales and Unique Customer Purchases

Company: Amazon

Role: Business Intelligence Engineer

Category: Data Manipulation (SQL/Python)

Difficulty: Medium

Interview Round: Onsite

BOOK_TRANSACTION +---------------+------------+-------------+------+----------+ | MARKETPLACE_ID| TXN_DAY | CUSTOMER_ID | ASIN | QUANTITY | +---------------+------------+-------------+------+----------+ | 1 | 2025-06-01 | 10 | B001 | 2 | | 1 | 2025-06-02 | 11 | B002 | 5 | +---------------+------------+-------------+------+----------+ ​ CATALOG +---------------+------+--------------+ | MARKETPLACE_ID| ASIN | TITLE_NAME | +---------------+------+--------------+ | 1 | B001 | Sample Book | | 1 | B002 | Another Book | +---------------+------+--------------+ ​ MAGAZINE_TRANSACTION +---------------+------------+-------------+------+----------+ | MARKETPLACE_ID| TXN_DAY | CUSTOMER_ID | ASIN | QUANTITY | +---------------+------------+-------------+------+----------+ | 1 | 2025-06-01 | 12 | M001 | 1 | +---------------+------------+-------------+------+----------+ ##### Scenario E-commerce marketplace wants sales insights from book and magazine transactions. ##### Question Write an SQL query to return the top 100 books (by total QUANTITY) sold in the current calendar month across all marketplaces. Write an SQL query to list CUSTOMER_IDs that purchased at least one book but zero magazines in the entire dataset. ##### Hints Use DATE_TRUNC or YEAR/MONTH filters; GROUP BY ASIN with SUM; use LEFT JOIN or NOT EXISTS between book and magazine customer sets.

Quick Answer: This question evaluates proficiency in data manipulation and SQL querying, focusing on aggregation, date-based filtering, joins, and set-difference logic across transactional and catalog tables.

Last updated: Mar 29, 2026

Loading coding console...

PracHub

Master your tech interviews with 7,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)