PracHub
QuestionsPremiumLearningGuidesCheatsheetNEWCoaches

Quick Overview

This question evaluates SQL data manipulation competencies, including aggregation, grouping vs HAVING for filtered aggregations, and conditional classification using CASE WHEN on transactional data.

  • Medium
  • PayPal
  • Data Manipulation (SQL/Python)
  • Data Scientist

Analyze Transactions and Classify by Amount in SQL

Company: PayPal

Role: Data Scientist

Category: Data Manipulation (SQL/Python)

Difficulty: Medium

Interview Round: Onsite

transactions +---------------+---------+--------+---------+---------------------+-----------------+ | transaction_id| user_id | amount | status | ts | payment_country | +---------------+---------+--------+---------+---------------------+-----------------+ | 101 | 1 | 120.50 | success | 2023-04-01 10:00:00 | US | | 102 | 2 | 980.00 | fraud | 2023-04-02 11:30:00 | CN | | 103 | 1 | 250.00 | success | 2023-04-03 09:45:00 | UK | | 104 | 3 | 1500.00| success | 2023-04-03 12:05:00 | US | +---------------+---------+--------+---------+---------------------+-----------------+ ##### Scenario You are asked to explore the transactions table and answer ad-hoc SQL questions during a live interview. ##### Question Return each user_id and the total amount of their successful transactions. 2) Add a column that classifies each transaction as 'small' (< 100), 'medium' (100- 999), or 'large' (>= 1000) using CASE WHEN. 3) List users whose total successful transaction amount exceeds 1,000; use an aggregation in the HAVING clause. ##### Hints Be explicit with CASE syntax, GROUP BY vs HAVING, and mention dialect differences if relevant.

Quick Answer: This question evaluates SQL data manipulation competencies, including aggregation, grouping vs HAVING for filtered aggregations, and conditional classification using CASE WHEN on transactional data.

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

  • Write SQL using HAVING and window functions - PayPal (easy)
  • Write SQL for top drivers and cancellation rates - PayPal (easy)
  • Compute top orders and cancellation rate - PayPal (easy)
  • Write SQL to flag Venmo ATO - PayPal (Medium)
  • Write conditional aggregation SQL queries - PayPal (Medium)