SQL interview questions · By company
Walmart SQL interview questions
For data analyst roles: what candidates report, and how to practice for it.
SQLRep isn't affiliated with or endorsed by Walmart. This guide summarizes public candidate reports and prep guides (sources below, checked November 2026). The practice questions are original, written in the reported style; they aren't Walmart's actual questions. Processes change, so confirm details with your recruiter.
What candidates report about the process
- Guides describe the technical round as SQL-heavy, and possibly the most important technical signal in the loop.
- Efficiency matters as well as accuracy, since queries run on very large retail tables.
SQL topics that come up
- Sales comparisons: year over year, by region and by store
- Top stores or products per group
- Running totals and inventory levels
Practice the reported patterns
Each one runs in real PostgreSQL in your browser, with feedback on what's wrong.
- Region sales, 2024 next to 2023Return region, sales_2023, sales_2024 and growth_pct (100 * (sales_2024 - sales_2023) / sales_2023, rounded to 1 decimal), one row per region. Sort by growth_pct descending, then region.Pattern: Conditional SUM · FILTER · growth %EasyPro
- Top store in each region, ties includedReturn region, store_name and sales_2024 (the store's total sales across 2024's quarters) for the store or stores with the highest 2024 sales in each region. Sort by region, then store_name.Pattern: RANK over a grouped total · year filterMediumPro
- Weekly sales with a year-to-date running totalFor every store and week in rt_weekly_dept_sales, return store_name, week_start, weekly_sales (all departments added) and ytd_sales (the store's running total of weekly_sales within week_start's calendar year, in week order). Sort by store_name, then week_start.Pattern: Aggregate, then window · SUM(SUM()) OVER · PARTITION BY yearMediumPro
- Year-over-year growth by quarterFor each region's 2024 quarters, return region, quarter, revenue, prev_year_revenue (same region and quarter in 2023, NULL if none) and yoy_pct (percent change from prev_year_revenue, rounded to 1 decimal, NULL if no prior year). Sort by region, quarter.Pattern: Self-join on period · YoY %HardPro
- Category revenue by quarterUsing completed orders (order lines without a product are ignored), return category, q3_2024, q4_2024 and q1_2025: the category's revenue (quantity * unit_price) in July-September 2024, October-December 2024 and January-March 2025. Show 0, not NULL, for a quarter with no sales. One row per category with at least one completed sale, sorted by category.Pattern: Pivot with SUM FILTER · COALESCE · quarter boundariesMediumPro
- Running revenue totalFor completed orders, return order_date, amount and running_total (cumulative sum of amount by order_date, rounded to 2 decimals), oldest first.Pattern: SUM() OVER · running totalsMediumPro
- Customer share of country revenueUsing completed orders, return country, name, revenue (that customer's completed total) and pct_of_country (revenue as a percentage of their country's completed revenue, rounded to 1 decimal). Sort by country, then pct_of_country highest first.Pattern: SUM() OVER (PARTITION BY) · percent of groupHardPro
- Days of inventory remainingUse the 28 days from 2025-03-04 to 2025-03-31 (both included) and completed orders only. For every product in shop_products, return product (name), on_hand, units_28d (units sold in that window, 0 if none) and days_remaining (on_hand divided by average daily units, i.e. on_hand * 28 / units_28d, rounded to 1 decimal; NULL if nothing sold). Sort by days_remaining (lowest first, NULLs last), then product.Pattern: Sales velocity · LEFT JOIN · fixed date windowMediumPro
- Reorder alerts with supplier lead timesUsing only the 2025-05-09 snapshot, return sku, product (name), on_hand (total across warehouses, 0 if the SKU has no stock rows), reorder_point, supplier (name), lead_time_days and expected_arrival (2025-05-09 plus lead_time_days) for every SKU whose on_hand is below its reorder_point. Sort by expected_arrival, then sku.Pattern: Latest snapshot · SUM across locations · LEFT JOINMediumPro
Tip: Be ready to explain how your query would behave on billions of rows, not just whether it returns the right answer.
Sources
Walmart is a trademark of its owner, used here only to identify the company the reports are about.