SQLQuokka
Start practicing
QuestionsLearnSandboxFeaturesRoadmapFAQ
SQL Study Plan

SQL GROUP BY and Aggregation Interview Questions

Most analytics questions boil down to grouping rows and summarising them. Practise COUNT, SUM and AVG, filtering groups with HAVING, counting distinct values and building ratios with conditional aggregation.

20 questions · 8 Easy · 8 Medium · 4 Hard · about 3 hours · MySQL & PostgreSQL

What you'll practise

  • GROUP BY on one or more columns
  • HAVING vs WHERE
  • COUNT DISTINCT
  • Conditional aggregation with CASE
  • Percentages and ratios
  • Pivoting rows into columns

Learn the concepts first

Questions in this plan

  1. Multilingual Language Speakers

    Identify users who speak at least two distinct target languages ('English', 'Spanish', 'German') from skill profile records.

    Easy✓ Solved
  2. Daily Active Users (DAU)

    Compute the daily count of unique active users from raw product activity event timestamps.

    Easy✓ Solved
  3. Ad Click-Through Rate (CTR)

    Calculate the percentage CTR per ad campaign rounded to 2 decimals, safely handling campaigns with zero impressions.

    Easy✓ Solved
  4. Play Store: Top Rated App Categories

    Find categories with at least 3 apps rated 4.0 or higher, returning the category, app count, and average rating rounded to 2 decimals.

    Easy✓ Solved
  5. Google Maps: High-Impact Local Guides

    Find verified reviewers who submitted at least 2 photo reviews in San Francisco or Mountain View.

    Easy✓ Solved
  6. Google Drive: External Sensitive File Shares

    Audit sensitive files shared with non-Google email addresses to identify potential data exposure risks.

    Easy✓ Solved
  7. Find Duplicate Emails

    Report all duplicate emails present in the Person table using aggregate grouping.

    Easy✓ Solved
  8. Cities With Most Loyal Customers

    Group users by metropolitan territory and rank locations by repeat checkout count over 90 days.

    Easy✓ Solved
  9. Google Workspace: Storage Quota Alerts

    Calculate total Drive storage per organization and return those exceeding their quota, showing total used and excess GB.

    Medium✓ Solved
  10. YouTube: Breakout Videos Dominating Channels

    Find videos that account for at least 50% of their channel total views, calculating each video view percentage.

    Medium✓ Solved
  11. Google Play: High-Value Repeat Spenders

    Identify key monetization users in target regions who executed 3+ in-app purchases totaling over $100.

    Medium✓ Solved
  12. Month-over-Month Revenue Growth

    Compute monthly successful payment volume and its percentage change versus the prior month.

    Medium✓ Solved
  13. Restaurants With Most Orders

    Aggregate total order volume per merchant and return the top 5 partner restaurants.

    Medium✓ Solved
  14. Amazon: Repeat Purchase Rate

    Calculate the percentage of all registered customers who have placed two or more orders, rounded to 2 decimal places.

    Medium✓ Solved
  15. Amazon: Monthly Category Revenue Pivot

    Pivot monthly product category sales into dedicated columns for Electronics, Apparel, and Home merchandise.

    Medium✓ Solved
  16. Amazon: Marketplace Seller Return Rate

    Identify marketplace merchants with at least 5 fulfilled orders whose customer return rate exceeds 10%.

    Medium✓ Solved
  17. Trips and Users Cancellation Rate

    Calculate unbanned driver and client cancellation rate during peak holiday weekend dates.

    Hard✓ Solved
  18. Amazon: Frequently Bought Together

    Identify product pairs purchased together in the same order at least 3 times without duplicate pairs or reflexive matches.

    Hard✓ Solved
  19. Amazon: Prime Monthly Churn Rate

    Calculate monthly Prime subscriber churn rates using calendar intervals and conditional status aggregations.

    Hard✓ Solved
  20. Monthly Net Revenue by Customer

    Net payments, refunds and chargebacks into the month each money movement happened.

    Hard✓ Solved