Search ⌘K
Practice Workspace

Practice with the full bank, then narrow into a path.

Your active path is foundations track, but the catalog stays broad by default so you can spot harder reps, switch contexts quickly, and still return to the path that best matches your current goal. Starter includes 160 free problems and marks 94 Pro-only problems before you open a gate.

254 problems
160 free
94 Pro
393 company scenarios
34 hard reps visible
160 runnable on starter
0 solved so far
Start broad, then focus when you want structure.

Company labels help frame practice in a familiar business context. They are directional study aids, not official interview guidance from the companies listed. We keep all paths visible first so hard questions do not disappear.

254 visible
Hard 32
Medium 86
Easy 136
160 free problems

· 94 Pro problems · Filter:

Company
Difficulty
Path
Suggested path: Foundations Track
Pro feature
Free questions stay open
Browse first, then sign in when you want to run SQL.

Free problems open for practice. Pro unlocks the full bank, study plan, and mock interviews.

IshaSQL Pro — 30-day pass
₹999

30 days of Pro access. Renew or extend anytime; extra time stacks from your current end date.

IshaSQL Pro — annual pass
Best value
₹7,999

365 days of Pro access. Renew or extend anytime; extra time stacks from your current end date.

8+ months free vs buying 30-day passes.

Tesla
Tesla

Foundations Track

Easy
15 min
Recommended next
Weekly Queue Ratings

Customer support reviews are logged by queue. For reviews submitted in March 2024, return the week_start date, queue_name, and average satisfaction_score rou...

Foundations Track
query basics
aggregation
LinkedIn
LinkedIn

Foundations Track

Easy
15 min
Trainer Certification Coverage

The operations team needs trainers who can cover every required warehouse course. Return the trainer_id values for trainers who hold all three certifications...

Foundations Track
query basics
aggregation
Spotify
Spotify

Foundations Track

+1 more companies
Easy
15 min
Sponsor Payback Ratio

Finance wants a simple efficiency metric for podcast sponsors. For each sponsor_id, return the ratio of total attributed_revenue to total media_spend rounded...

Foundations Track
query basics
aggregation
DoorDash
DoorDash

Foundations Track

Easy
15 min
Stockout Days by Warehouse

The inventory team wants to know which warehouses experienced stockouts in July 2024. Return warehouse_id and the number of stockout_days where units_on_hand...

Foundations Track
query basics
aggregation
LinkedIn
LinkedIn

Foundations Track

Easy
15 min
Tutor Utilization by Subject

Learning ops wants a utilization view for tutoring capacity. Return each subject and the utilization_pct rounded to two decimals, calculated as total booked_...

Foundations Track
query basics
aggregation
Salesforce
Salesforce

Foundations Track

Easy
15 min
Partner Contracts Expiring Soon

Partnership ops wants a list of non-renewing contracts that are about to end. Using 2024-11-01 as the reference date, return partner_id, region, and end_date...

Foundations Track
query basics
filtering
DoorDash
DoorDash

Foundations Track

Easy
15 min
Duplicate Delivery Role Posts

Delivery operations wants a monthly cleanup report for employers that recycled the same role posting. Looking only at April 2024, return one value named empl...

Foundations Track
query basics
aggregation
PayPal
PayPal

Foundations Track

Easy
15 min
Final Wallet Balance

For each account_id, calculate the final wallet balance. Credits add to the balance and debits subtract from it. Return account_id and final_balance ordered ...

Foundations Track
query basics
aggregation
Netflix
Netflix

Foundations Track

Easy
15 min
Streaming Device View Mix

The streaming analytics team wants a one-row device-family snapshot for recent viewing traffic. Count laptop events separately, roll phone and tablet into a ...

Foundations Track
query basics
aggregation
Airbnb
Airbnb

Foundations Track

Easy
15 min
Top Rated Venues

Return the top two venue_id values with the highest average star rating, considering only venues that have at least three reviews. Output venue_id and avg_st...

Foundations Track
query basics
aggregation
Google
Google

Foundations Track

Easy
15 min
Advertiser Health Status

Classify each advertiser based on month-over-month spend. Return advertiser_id and status using these rules: New if previous_month_spend is 0 and current_mon...

Foundations Track
query basics
filtering
Wayfair
Wayfair

Foundations Track

+3 more companies
Easy
15 min
Complete Skill Coverage

At Wayfair, analysts are preparing a scorecard focused on complete skill coverage. Return the candidate_id values for candidates who have all three required ...

Foundations Track
query basics
Salesforce
Salesforce

Foundations Track

Easy
15 min
Alternating Measurement Totals

Salesforce wants a scorecard for alternating measurement totals. Return separate totals for odd-numbered and even-numbered measurement days. Return two colum...

Foundations Track
query basics
Wayfair
Wayfair

Foundations Track

Easy
15 min
Pages Without Followers

At Wayfair, analysts are preparing a scorecard focused on pages without followers. Return every page_id that has no follower rows. Sort by page_id.

Foundations Track
query basics
Netflix
Netflix

Foundations Track

+1 more companies
Easy
15 min
Device View Mix

Netflix is reviewing device view mix through a scorecard. Count how many views came from laptop devices and how many came from mobile devices. Treat phone an...

Foundations Track
query basics
Meta
Meta

Foundations Track

Easy
15 min
Third Customer Transaction

Meta wants a scorecard for third customer transaction. Return each user_id and transaction_date for the third transaction made by that user. Sort by user_id.

Foundations Track
query basics
Amazon
Amazon

Foundations Track

+6 more companies
Easy
15 min
Departments Above Average Pay

Use this Amazon scorecard to work on departments above average pay. Return each department_id whose average salary exceeds the company average salary for Mar...

Foundations Track
query basics
filtering
Databricks
Databricks

Foundations Track

+2 more companies
Easy
15 min
Most Frequent Item Counts

Databricks wants a scorecard for most frequent item counts. Return the item_count value or values with the highest order_occurrences. Sort by item_count.

Foundations Track
query basics
TikTok
TikTok

Foundations Track

Easy
15 min
First Customer Transaction

TikTok is reviewing first customer transaction through a scorecard. Return each user_id and transaction_date for the first transaction made by that user. Sor...

Foundations Track
query basics
Snowflake
Snowflake

Foundations Track

+6 more companies
Easy
15 min
Late Shipment Rate By Carrier

Snowflake is reviewing late shipment rate by carrier through a scorecard. Return the percentage of shipments that arrived late by carrier_name. Output carrie...

Foundations Track
query basics
Pinterest
Pinterest

Foundations Track

+18 more companies
Easy
15 min
Creators With Multiple 2024 Posts

Use this Pinterest scorecard to work on creators with multiple 2024 posts. Return each creator_id that posted at least two items in 2024. Sort by creator_id.

Foundations Track
query basics
TikTok
TikTok

Foundations Track

+19 more companies
Easy
15 min
2024 App Click Volume

TikTok wants a scorecard for 2024 app click volume. Return each app_id and the total number of click events recorded in 2024. Sort by app_id.

Foundations Track
query basics
Apple
Apple

Foundations Track

+3 more companies
Easy
15 min
Duplicate Job Posts

Apple wants a scorecard for duplicate job posts. Return the number of employers that posted the same role_name in the same city more than once during April 2...

Foundations Track
query basics
filtering
Salesforce
Salesforce

Foundations Track

Easy
15 min
Customers Sharing Same

Salesforce is reviewing customers sharing same through a scorecard. Return each customer pair that purchased the same order on the same day. Output customer_...

Foundations Track
query basics
Visa
Visa

Foundations Track

Easy
15 min
Median Google Search Frequency

At Visa, analysts are preparing a scorecard focused on median google search frequency. Return the weighted median number of searches from the compressed sear...

Foundations Track
query basics
TikTok
TikTok

Foundations Track

+19 more companies
Easy
15 min
Frequent Support Callers

Use this TikTok scorecard to work on frequent support callers. Return the distinct policy_holder_id values for members who made at least 3 calls. Sort by pol...

Foundations Track
query basics
LinkedIn
LinkedIn

Foundations Track

Easy
15 min
Highest Profit Drugs

LinkedIn wants a scorecard for highest profit drugs. Return the top 3 drugs by total profit. Output drug and total_profit sorted from highest to lowest profit.

Foundations Track
query basics
Tesla
Tesla

Foundations Track

Easy
15 min
Manufacturer Sales In Millions

At Tesla, analysts are preparing a scorecard focused on manufacturer sales in millions. Return the total sales per manufacturer rounded to the nearest millio...

Foundations Track
query basics
Tesla
Tesla

Foundations Track

+5 more companies
Easy
15 min
Top Product By Category

Tesla is reviewing top product by category through a trend check. Return the highest-grossing product_id in each category during June 2024 along with categor...

Foundations Track
query basics
Visa
Visa

Foundations Track

+3 more companies
Easy
15 min
Bidirectional Transfer Pairs

Visa is reviewing bidirectional transfer pairs through a trend check. Count unique transfer relationships regardless of direction. Return relationship_count.

Foundations Track
query basics
Alibaba
Alibaba

Foundations Track

+10 more companies
Easy
15 min
Second-highest Salary

Alibaba wants a readout for second-highest salary. Return the second-highest salary amount in the table as second_highest_salary.

Foundations Track
query basics
Wayfair
Wayfair

Foundations Track

+5 more companies
Easy
15 min
Signup Confirmation Rate

At Wayfair, analysts are preparing a operations review focused on signup confirmation rate. Calculate the confirmation rate as the percentage of signups that...

Foundations Track
query basics
Stripe
Stripe

Foundations Track

+5 more companies
Easy
15 min
Top Sellers By Gross Sales

Stripe is reviewing top sellers by gross sales through a operations review. Return the top 3 sellers by total_gross_sales. Output seller_id and total_gross_s...

Foundations Track
query basics
Wayfair
Wayfair

Foundations Track

Easy
15 min
Weighted Search Median

Use this Wayfair operations review to work on weighted search median. Return the weighted median number of searches from the compressed search frequency table.

Foundations Track
query basics
Pinterest
Pinterest

Foundations Track

Easy
15 min
Customer Who Visited But Did Not Make Any Transactions

Pinterest is reviewing customer who visited but did not make any transactions through a finance summary. Return the distinct policy_holder_id values for memb...

Foundations Track
query basics
Wayfair
Wayfair

Foundations Track

+2 more companies
Easy
15 min
Employee Id And Whether The Employee Met Quota Using Values Yes Or No

Use this Wayfair scorecard to work on employee id and whether the employee met quota using values yes or no. Return each employee_id and whether the employee...

Foundations Track
query basics
Stripe
Stripe

Foundations Track

Easy
15 min
Pages With No Likes

Use this Stripe operations review to work on pages with no likes. Return every page_id that has no follower rows. Sort by page_id.

Foundations Track
query basics
Robinhood
Robinhood

Foundations Track

Easy
15 min
FAANG Underperforming Stocks (part 3)

Robinhood wants a analysis pass for faang underperforming stocks (part 3). Return the distinct policy_holder_id values for members who made at least 3 calls....

Foundations Track
query basics
Airbnb
Airbnb

Foundations Track

Easy
15 min
Find Total Time Spent By Each Employee

Use this Airbnb weekly brief to work on find total time spent by each employee. Return each app_id and the total number of click events recorded in 2024. Sor...

Foundations Track
query basics
Amazon
Amazon

Foundations Track

Easy
15 min
Number Of Unique Subjects Taught By Each Teacher

Amazon is reviewing number of unique subjects taught by each teacher through a diagnostic pass. Return each app_id and the total number of click events recor...

Foundations Track
query basics
Amazon
Amazon

Foundations Track

Easy
15 min
Odd And Even Transactions

Amazon wants a operations review for odd and even transactions. Return separate totals for odd-numbered and even-numbered measurement days. Return two column...

Foundations Track
query basics
Airbnb
Airbnb

Foundations Track

Easy
15 min
Page Recommendation

Airbnb is reviewing page recommendation through a trend check. Return every page_id that has no follower rows. Sort by page_id.

Foundations Track
query basics
Salesforce
Salesforce

Foundations Track

Easy
15 min
Patient Support Analysis (part 3)

At Salesforce, analysts are preparing a weekly brief focused on patient support analysis (part 3). Return the distinct policy_holder_id values for members wh...

Foundations Track
query basics
Amazon
Amazon

Foundations Track

+1 more companies
Easy
15 min
Loss-Making Drug Totals

Amazon is reviewing loss-making drug totals through a scorecard. Return each manufacturer with the number of loss-making drugs and the total absolute loss. S...

Foundations Track
query basics
TikTok
TikTok

Foundations Track

Easy
15 min
Primary Department For Each Employee

At TikTok, analysts are preparing a operations review focused on primary department for each employee. Return each employee_id and whether the employee met q...

Foundations Track
query basics
Uber
Uber

Foundations Track

+2 more companies
Easy
15 min
Year-on-year Product Spend Growth

Use this Uber trend check to work on year-on-year product spend growth. Calculate the year-on-year growth rate for each product_id. Return report_year, produ...

Foundations Track
query basics
Robinhood
Robinhood

Foundations Track

Easy
15 min
Total Traveled Distance

Robinhood is reviewing total traveled distance through a performance check. Return each app_id and the total number of click events recorded in 2024. Sort by...

Foundations Track
query basics
Apple
Apple

Foundations Track

Easy
15 min
Heavy

At Apple, analysts are preparing a readiness review focused on heavy. Return the distinct policy_holder_id values for members who made at least 3 calls. Sort...

Foundations Track
query basics
Tesla
Tesla

Foundations Track

Easy
15 min
Quota Attainment Status

At Tesla, analysts are preparing a planning note focused on quota attainment status. Return each employee_id and whether the employee met quota as made_quota...

Foundations Track
query basics
Robinhood
Robinhood

Foundations Track

Easy
15 min
Consistent Creator Activity

Robinhood wants a diagnostic pass for consistent creator activity. Return each creator_id that posted at least two items in 2024. Sort by creator_id.

Foundations Track
query basics
Alibaba
Alibaba

Foundations Track

Easy
15 min
Alibaba Compressed Mode

You're given a table containing the item count for each order on Alibaba, along with the frequency of orders that have the same item count. Write a query to ...

Foundations Track
filtering
aggregation
I
IshaSQL

Foundations Track

Easy
15 min
DNA Pattern Recognition

Table: Samples +----------------+---------+ | Column Name | Type | +----------------+---------+ | sample_id | int | | dna_sequence | varchar | | species | va...

Foundations Track
filtering
I
IshaSQL

Foundations Track

Easy
15 min
Odd and Even Transactions

Table: transactions +------------------+------+ | Column Name | Type | +------------------+------+ | transaction_id | int | | amount | int | | transaction_da...

Foundations Track
aggregation
filtering
I
IshaSQL

Foundations Track

Easy
15 min
Employees Whose Manager Left the Company

Table: Employees +-------------+----------+ | Column Name | Type | +-------------+----------+ | employee_id | int | | name | varchar | | manager_id | int | |...

Foundations Track
filtering
I
IshaSQL

Foundations Track

Easy
15 min
Employees With Missing Information

Table: Employees +-------------+---------+ | Column Name | Type | +-------------+---------+ | employee_id | int | | name | varchar | +-------------+---------...

Foundations Track
filtering
I
IshaSQL

Foundations Track

Easy
15 min
Count Salary Categories

Table: Accounts +-------------+------+ | Column Name | Type | +-------------+------+ | account_id | int | | income | int | +-------------+------+ account_id ...

Foundations Track
aggregation
filtering
I
IshaSQL

Foundations Track

Easy
15 min
The Latest Login in 2020

Table: Logins +----------------+----------+ | Column Name | Type | +----------------+----------+ | user_id | int | | time_stamp | datetime | +---------------...

Foundations Track
aggregation
filtering
I
IshaSQL

Foundations Track

Easy
15 min
Rearrange Products Table

Table: Products +-------------+---------+ | Column Name | Type | +-------------+---------+ | product_id | int | | store1 | int | | store2 | int | | store3 | ...

Foundations Track
filtering
I
IshaSQL

Foundations Track

Easy
15 min
Primary Department for Each Employee

Table: Employee +---------------+---------+ | Column Name | Type | +---------------+---------+ | employee_id | int | | department_id | int | | primary_flag |...

Foundations Track
filtering
I
IshaSQL

Foundations Track

Easy
15 min
Recyclable and Low Fat Products

Table: Products +-------------+---------+ | Column Name | Type | +-------------+---------+ | product_id | int | | low_fats | enum | | recyclable | enum | +--...

Foundations Track
filtering
I
IshaSQL

Foundations Track

Easy
15 min
Find Total Time Spent by Each Employee

Table: Employees +-------------+------+ | Column Name | Type | +-------------+------+ | emp_id | int | | event_day | date | | in_time | int | | out_time | in...

Foundations Track
aggregation
I
IshaSQL

Foundations Track

Easy
15 min
The Number of Employees Which Report to Each Employee

Table: Employees +-------------+----------+ | Column Name | Type | +-------------+----------+ | employee_id | int | | name | varchar | | reports_to | int | |...

Foundations Track
aggregation
I
IshaSQL

Foundations Track

Easy
15 min
Find Followers Count

Table: Followers +-------------+------+ | Column Name | Type | +-------------+------+ | user_id | int | | follower_id | int | +-------------+------+ (user_id...

Foundations Track
aggregation
I
IshaSQL

Foundations Track

Easy
15 min
Daily Leads and Partners

Table: DailySales +-------------+---------+ | Column Name | Type | +-------------+---------+ | date_id | date | | make_name | varchar | | lead_id | int | | p...

Foundations Track
aggregation
I
IshaSQL

Foundations Track

Easy
15 min
Invalid Tweets

Table: Tweets +----------------+---------+ | Column Name | Type | +----------------+---------+ | tweet_id | int | | content | varchar | +----------------+---...

Foundations Track
filtering
I
IshaSQL

Foundations Track

Easy
15 min
Fix Names in a Table

Table: Users +----------------+---------+ | Column Name | Type | +----------------+---------+ | user_id | int | | name | varchar | +----------------+--------...

Foundations Track
filtering
I
IshaSQL

Foundations Track

Easy
15 min
Average Time of Process per Machine

Table: Activity +----------------+---------+ | Column Name | Type | +----------------+---------+ | machine_id | int | | process_id | int | | activity_type | ...

Foundations Track
aggregation
I
IshaSQL

Foundations Track

Easy
15 min
Patients With a Condition

Table: Patients +--------------+---------+ | Column Name | Type | +--------------+---------+ | patient_id | int | | patient_name | varchar | | conditions | v...

Foundations Track
filtering
I
IshaSQL

Foundations Track

Easy
15 min
Capital Gain/Loss

Table: Stocks +---------------+---------+ | Column Name | Type | +---------------+---------+ | stock_name | varchar | | operation | enum | | operation_day | ...

Foundations Track
aggregation
I
IshaSQL

Foundations Track

Easy
15 min
Queries Quality and Percentage

Table: Queries +-------------+---------+ | Column Name | Type | +-------------+---------+ | query_name | varchar | | result | varchar | | position | int | | ...

Foundations Track
aggregation
filtering
I
IshaSQL

Foundations Track

Easy
15 min
Article Views I

Table: Views +---------------+---------+ | Column Name | Type | +---------------+---------+ | article_id | int | | author_id | int | | viewer_id | int | | vi...

Foundations Track
filtering
I
IshaSQL

Foundations Track

Easy
15 min
First Login Date

Table: Activity +--------------+---------+ | Column Name | Type | +--------------+---------+ | player_id | int | | device_id | int | | event_date | date | | ...

Foundations Track
aggregation
I
IshaSQL

Foundations Track

Easy
15 min
Actors and Directors Who Cooperated At Least Three Times

Table: ActorDirector +-------------+---------+ | Column Name | Type | +-------------+---------+ | actor_id | int | | director_id | int | | timestamp | int | ...

Foundations Track
aggregation
filtering
I
IshaSQL

Foundations Track

Easy
15 min
Not Boring Movies

Table: Cinema +----------------+----------+ | Column Name | Type | +----------------+----------+ | id | int | | movie | varchar | | description | varchar | |...

Foundations Track
filtering
I
IshaSQL

Foundations Track

Easy
15 min
Classes With at Least 5 Students

Table: Courses +-------------+---------+ | Column Name | Type | +-------------+---------+ | student | varchar | | class | varchar | +-------------+---------+...

Foundations Track
aggregation
filtering
I
IshaSQL

Foundations Track

Easy
15 min
Big Countries

Table: World +-------------+---------+ | Column Name | Type | +-------------+---------+ | name | varchar | | continent | varchar | | area | int | | populatio...

Foundations Track
filtering
I
IshaSQL

Foundations Track

Easy
15 min
Customer Placing the Largest Number of Orders

Table: Orders +-----------------+----------+ | Column Name | Type | +-----------------+----------+ | order_number | int | | customer_number | int | +--------...

Foundations Track
aggregation
I
IshaSQL

Foundations Track

Easy
15 min
Find Customer Referee

Table: Customer +-------------+---------+ | Column Name | Type | +-------------+---------+ | id | int | | name | varchar | | referee_id | int | +------------...

Foundations Track
filtering
I
IshaSQL

Foundations Track

Easy
15 min
Rising Temperature

Table: Weather +---------------+---------+ | Column Name | Type | +---------------+---------+ | id | int | | recordDate | date | | temperature | int | +-----...

Foundations Track
date functions
filtering
I
IshaSQL

Foundations Track

Easy
15 min
Duplicate Emails

Table: Person +-------------+---------+ | Column Name | Type | +-------------+---------+ | id | int | | email | varchar | +-------------+---------+ id is the...

Foundations Track
aggregation
filtering
I
IshaSQL

Foundations Track

Easy
15 min
Employees Earning More Than Their Managers

Table: Employee +-------------+---------+ | Column Name | Type | +-------------+---------+ | id | int | | name | varchar | | salary | int | | managerId | int...

Foundations Track
filtering
Airbnb
Airbnb

Foundations Track

Easy
15 min
3. What does the keyword DISTINCT do

The DISTINCT keyword removes duplicates from a SELECT query. Suppose you had a table of Airbnb customers, and wanted to figure out which cities the customers...

Foundations Track
filtering
Airbnb
Airbnb

Foundations Track

Easy
15 min
10. What's the SQL command INTERSECT do, and when would you use it

The SQL command INTERSECT merges the results of multiple SELECT statements and keeps only those rows that are present in all sets. For example, say you were ...

Foundations Track
filtering
Netflix
Netflix

Foundations Track

Easy
15 min
2. Analyzing Ratings For Netflix Shows

Given a table of user ratings for Netflix shows, **calculate the average rating for each show within a given month.** Assume that there is a column for user ...

Foundations Track
aggregation
date functions
O
Oracle

Foundations Track

Easy
15 min
6. Average Sales Revenue by Product Category for Oracle

As a tech company, Oracle offers a diverse range of products including databases, cloud solutions, and other software services. The company would likely be i...

Foundations Track
aggregation
date functions
F
Facebook

Foundations Track

Easy
15 min
10. Difference between BETWEEN and IN operators

BETWEEN is used to select rows that match a range of values, whereas the IN operator checks for values in a specified list of values. For example, to find ca...

Foundations Track
filtering
Apple
Apple

Foundations Track

Easy
15 min
Apple Multimedia Active Users

SELECT COUNT(distinct user_id) as distinct_user_count FROM fct_multimedia_usage WHERE usage_date='2024-07-31'

Foundations Track
aggregation
filtering
Google
Google

Foundations Track

Easy
15 min
Google Pay Transaction Outcomes

For January 2024, what are the total counts of successful and failed transactions in each merchant category? This analysis will help the Google Pay security ...

Foundations Track
aggregation
filtering
Alibaba
Alibaba

Foundations Track

Easy
15 min
15 Compressed Mean

-- You're trying to find the mean number of items per order on Alibaba, rounded to 1 decimal place using tables which includes information on the count of it...

Foundations Track
aggregation
PayPal
PayPal

Foundations Track

Easy
15 min
9. Filter PayPal Customer Records Based on Email Domain

As a PayPal data analyst, you are tasked with identifying user profiles that were created with corporate email addresses, specifically those that end with '@...

Foundations Track
filtering
W
Walmart

Foundations Track

Easy
15 min
List of Questions + Solutions

A. Generic Questions 1. How many unique cities does the data have? SELECT DISTINCT city FROM wm_sales_data **Result Set :** city_name ----------- Yangon Nayp...

Foundations Track
filtering
F
Facebook

Foundations Track

Easy
15 min
9790 Number Of Processed Complaints

SELECT type, COUNT(complaint_id) FILTER(WHERE processed='TRUE') AS processed_complaints, COUNT(complaint_id) FILTER(WHERE processed='FALSE') AS non_processed...

Foundations Track
aggregation
filtering
Airbnb
Airbnb

Foundations Track

Easy
15 min
9629 Find The Count Of Verified And Non Verified Airbnb Hosts

SELECT host_identity_verified, COUNT(id) as n_hosts FROM airbnb_search_details GROUP BY host_identity_verified -- NOTE: very easy; shouldn't be in the Medium...

Foundations Track
aggregation
F
Facebook

Foundations Track

Easy
15 min
9789 Find The Total Number Of Approved Friendship Requests In January And February

SELECT COUNT(*) as n_approved FROM facebook_friendship_requests WHERE date_approved BETWEEN '2019-01-01' and '2019-02-28' -- NOTE: solved on first attempt

Foundations Track
aggregation
filtering
Amazon
Amazon

Foundations Track

Easy
15 min
04 Easy Amazon Purchasing Activity By Product Type

-- purchasing activity by product type -- SELECT t1.order_date, t1.product_type, ( SELECT SUM(quantity) FROM total_trans AS t2 WHERE t2.order_date <= t1.orde...

Foundations Track
aggregation
Salesforce
Salesforce

Foundations Track

Easy
15 min
15 Easy Salesforce Average Deal Size Part 1

--Average Deal Size-- select round(avg(num_seats * yearly_seat_cost),2) as average_deal_size from contracts

Foundations Track
aggregation
Amazon
Amazon

Foundations Track

Easy
15 min
09. Average Review Ratings [Amazon Interview]

/* Given the reviews table, write a query to get the average stars for each product every month. The output should include the month in numerical value, prod...

Foundations Track
aggregation
date functions
I
IshaSQL

Foundations Track

Easy
15 min
Calculate Special Bonus

Table: Employees +-------------+---------+ | Column Name | Type | +-------------+---------+ | employee_id | int | | name | varchar | | salary | int | +------...

Foundations Track
filtering
I
IshaSQL

Foundations Track

Easy
15 min
Percentage of Users Attended a Contest

Table: Users +-------------+---------+ | Column Name | Type | +-------------+---------+ | user_id | int | | user_name | varchar | +-------------+---------+ u...

Foundations Track
aggregation
I
IshaSQL

Foundations Track

Easy
15 min
Game Play Analysis I

IshaSQL is reviewing game play analysis i through a scorecard. Table: Activity +--------------+---------+ | Column Name | Type | +--------------+---------+ |...

Foundations Track
aggregation
Amazon
Amazon

Foundations Track

Easy
15 min
Average Product Review Ratings

Amazon is reviewing average product review ratings through a scorecard. The product quality team wants monthly review score reporting. For each product and m...

Foundations Track
aggregation
date functions
F
Facebook

Foundations Track

Easy
15 min
Closed Account Ratio

Use this Facebook scorecard to work on closed account ratio. The account integrity team wants the share of accounts that were closed on 2020-01-10. Return on...

Foundations Track
aggregation
filtering
Pinterest
Pinterest

Foundations Track

Medium
25 min
Cross-Region Sellers

Commerce wants to identify sellers with broad geographic reach. Return seller_id and total_gross_sales for sellers that sold in at least three distinct regio...

Foundations Track
query basics
aggregation
Amazon
Amazon

Foundations Track

Medium
25 min
Category Revenue Leaders

During June 2024, each category had multiple products generating revenue. Return the highest-grossing product_id in each category along with category and tot...

Foundations Track
Pro
query basics
aggregation
Target
Target

Foundations Track

Medium
25 min
Top Purchase per Customer

Return each user_id with the purchase_id and amount of that user’s most expensive purchase. If two purchases tie on amount, keep the earlier purchased_at row...

Foundations Track
query basics
filtering
Microsoft
Microsoft

Foundations Track

Medium
25 min
Highest

Microsoft is reviewing highest through a scorecard. Return the highest-grossing product_id in each category during June 2024 along with category and total_re...

Foundations Track
query basics
aggregation
Uber
Uber

Foundations Track

Medium
25 min
Purchase Frequency Histogram

Use this Uber scorecard to work on purchase frequency histogram. Show how many users placed each number of purchases. Return purchase_count and user_count, s...

Foundations Track
Pro
query basics
aggregation
Snowflake
Snowflake

Foundations Track

+6 more companies
Medium
25 min
April Webinar Share

Use this Snowflake scorecard to work on april webinar share. Return the percentage of marketing touches that were webinars in April 2024, rounded to the near...

Foundations Track
query basics
aggregation
Meta
Meta

Foundations Track

Medium
25 min
Final Account Balance

At Meta, analysts are preparing a scorecard focused on final account balance. Calculate the final balance per account_id. Credits add to the balance and debi...

Foundations Track
Pro
query basics
aggregation
Google
Google

Foundations Track

Medium
25 min
Employee Query Activity Histogram

At Google, analysts are preparing a scorecard focused on employee query activity histogram. Return the number of employees who issued 0 queries, 1 query, 2 q...

Foundations Track
Pro
query basics
aggregation
Meta
Meta

Foundations Track

Medium
25 min
Tax Product Filing Mix

Use this Meta scorecard to work on tax product filing mix. The total number of TurboTax filings and QuickBooks filings. Return turbotax_total and quickbooks_...

Foundations Track
Pro
query basics
aggregation
Wayfair
Wayfair

Foundations Track

+3 more companies
Medium
25 min
Queue Satisfaction Averages

Wayfair wants a scorecard for queue satisfaction averages. Return queue_name and average satisfaction_score rounded to two decimals. Sort by queue_name.

Foundations Track
Pro
query basics
aggregation
Airbnb
Airbnb

Foundations Track

Medium
25 min
Average Annual Deal Size

Airbnb is reviewing average annual deal size through a scorecard. Return the average annual deal size across all customers rounded to two decimals.

Foundations Track
Pro
query basics
aggregation
Wayfair
Wayfair

Foundations Track

+1 more companies
Medium
25 min
Average Annual Deal Size Across All Customers

Wayfair wants a operations review for average annual deal size across all customers. Return the average annual deal size across all customers rounded to two ...

Foundations Track
Pro
query basics
aggregation
Meta
Meta

Foundations Track

Medium
25 min
Laptop Vs. Mobile Viewership (2)

At Meta, analysts are preparing a operations review focused on laptop vs. mobile viewership (2). Count how many views came from laptop devices and how many c...

Foundations Track
Pro
query basics
aggregation
Google
Google

Foundations Track

Medium
25 min
The Number Of Employees Which Report To Each Employee

Google is reviewing the number of employees which report to each employee through a performance snapshot. Return each department_id whose average salary exce...

Foundations Track
Pro
query basics
T
Twitter

Foundations Track

Medium
25 min
Histogram of Tweets by Posting Frequency

Assume you're given a table Twitter tweet data, write a query to obtain a histogram of tweets posted per user in 2022. Output the tweet count per user as the...

Foundations Track
aggregation
I
IshaSQL

Foundations Track

Medium
25 min
Find Users with High Token Usage

Table: prompts +-------------+---------+ | Column Name | Type | +-------------+---------+ | user_id | int | | prompt | varchar | | tokens | int | +----------...

Foundations Track
Pro
aggregation
filtering
I
IshaSQL

Foundations Track

Medium
25 min
Find Loyal Customers

Table: customer_transactions +------------------+---------+ | Column Name | Type | +------------------+---------+ | transaction_id | int | | customer_id | in...

Foundations Track
Pro
aggregation
filtering
I
IshaSQL

Foundations Track

Medium
25 min
Last Person to Fit in the Bus

Table: Queue +-------------+---------+ | Column Name | Type | +-------------+---------+ | person_id | int | | person_name | varchar | | weight | int | | turn...

Foundations Track
Pro
filtering
I
IshaSQL

Foundations Track

Medium
25 min
Reformat Department Table

Table: Department +-------------+---------+ | Column Name | Type | +-------------+---------+ | id | int | | revenue | int | | month | varchar | +------------...

Foundations Track
Pro
aggregation
I
IshaSQL

Foundations Track

Medium
25 min
Immediate Food Delivery II

Table: Delivery +-----------------------------+---------+ | Column Name | Type | +-----------------------------+---------+ | delivery_id | int | | customer_i...

Foundations Track
Pro
aggregation
filtering
I
IshaSQL

Foundations Track

Medium
25 min
Customers Who Bought All Products

Table: Customer +-------------+---------+ | Column Name | Type | +-------------+---------+ | customer_id | int | | product_key | int | +-------------+-------...

Foundations Track
Pro
aggregation
filtering
I
IshaSQL

Foundations Track

Medium
25 min
Swap Consecutive Students

Table: Seat +-------------+---------+ | Column Name | Type | +-------------+---------+ | id | int | | student | varchar | +-------------+---------+ id is the...

Foundations Track
Pro
filtering
I
IshaSQL

Foundations Track

Medium
25 min
Tree Node

Table: Tree +-------------+------+ | Column Name | Type | +-------------+------+ | id | int | | p_id | int | +-------------+------+ id is the column with uni...

Foundations Track
Pro
aggregation
filtering
I
IshaSQL

Foundations Track

Medium
25 min
Investments in 2016

Table: Insurance +-------------+-------+ | Column Name | Type | +-------------+-------+ | pid | int | | tiv_2015 | float | | tiv_2016 | float | | lat | float...

Foundations Track
Pro
filtering
aggregation
I
IshaSQL

Foundations Track

Medium
25 min
Rank Scores

Table: Scores +-------------+---------+ | Column Name | Type | +-------------+---------+ | id | int | | score | decimal | +-------------+---------+ id is the...

Foundations Track
Pro
aggregation
filtering
Apple
Apple

Foundations Track

Medium
25 min
19 Apple Pay Volume

SELECT merchant_id, SUM(CASE WHEN LOWER(payment_method) = 'apple pay' THEN transaction_amount ELSE 0 END) AS volume FROM transactions GROUP BY 1 ORDER BY 2 D...

Foundations Track
Pro
aggregation
filtering
F
Facebook

Foundations Track

Medium
25 min
34 Email Table Transformation

-- Each Facebook user can designate a personal email address, a business email address, and a recovery email address. -- Unfortunately, the table is currentl...

Foundations Track
Pro
aggregation
Alibaba
Alibaba

Foundations Track

Medium
25 min
07. Compressed Mode [Alibaba Interview]

/*Level: MEDIUM You are trying to find the most common (aka the mode) number of items bought per order on Alibaba. However, instead of doing analytics on all...

Foundations Track
Pro
filtering
aggregation
Shopify
Shopify

Foundations Track

Medium
25 min
6. What is the percentage of sales for Retail vs Shopify for each month

WITH monthly_sales AS ( SELECT month_number, CASE WHEN platform = 'Retail' THEN sales ELSE 0 END AS retail_sales, CASE WHEN platform = 'Shopify' THEN sales E...

Foundations Track
Pro
aggregation
F
Facebook

Foundations Track

Medium
25 min
01 Active User Retention

-- Assume you're given a table containing information on Facebook user actions. Write a query to obtain number of monthly active users (MAUs) in July 2022, i...

Foundations Track
Pro
aggregation
filtering
Google
Google

Foundations Track

Medium
25 min
2078 From Microsoft To Google

WITH employers_cte AS ( SELECT *, LEAD(employer) OVER(PARTITION BY user_id ORDER BY start_date) as next_employer FROM linkedin_users ) SELECT COUNT(DISTINCT ...

Foundations Track
Pro
filtering
aggregation
Google
Google

Foundations Track

Medium
25 min
9822 Average Number Of Friends

SELECT AVG(t2.num_friends) as avg_num_friends_per_user FROM ( SELECT t1.user, COUNT(friend) as num_friends FROM ( SELECT user_id as user, friend_id as friend...

Foundations Track
Pro
aggregation
Airbnb
Airbnb

Foundations Track

Medium
25 min
10159 Ranking Most Active Guests

SELECT id_guest, SUM(n_messages) as sum_n_messages, DENSE_RANK() OVER(ORDER BY SUM(n_messages) desc) as ranking FROM airbnb_contacts GROUP BY id_guest ORDER ...

Foundations Track
Pro
aggregation
Airbnb
Airbnb

Foundations Track

Medium
25 min
10161 Ranking Hosts By Beds

SELECT host_id, SUM(n_beds) as number_of_beds, DENSE_RANK() OVER(ORDER BY SUM(n_beds) desc) as rank FROM airbnb_apartments GROUP BY host_id ORDER BY number_o...

Foundations Track
Pro
aggregation
Google
Google

Foundations Track

Medium
25 min
9811 Find The Minimal Adwords Earnings For Each Business Type

WITH ranked_earnings as ( SELECT business_type, adwords_earnings, RANK() OVER(PARTITION BY business_type ORDER BY adwords_earnings) as rn FROM google_adwords...

Foundations Track
Pro
filtering
Target
Target

Foundations Track

Medium
25 min
9904 Highest Target

WITH ranked_targets as ( SELECT first_name, target, bonus, DENSE_RANK() OVER(ORDER BY target desc) as rn FROM employee ) SELECT first_name, target, bonus FRO...

Foundations Track
Pro
aggregation
filtering
T
Twitter

Foundations Track

Medium
25 min
02 Medium Twitter Tweets Rolling Averages

-- tweets rolling average -- WITH tweet_posts AS ( SELECT user_id, tweet_date, COUNT(tweet_id) AS tweet_count FROM tweets GROUP BY user_id, tweet_date ) SELE...

Foundations Track
Pro
aggregation
Amazon
Amazon

Foundations Track

Medium
25 min
05 Medium Amazon Highest Grossing Items

-- highest grossing items -- WITH top_sales AS ( SELECT category, product, SUM(spend) AS total_spend FROM product_spend WHERE DATE_PART('year', transaction_d...

Foundations Track
Pro
aggregation
Google
Google

Foundations Track

Medium
25 min
14 Medium Google Invalid Search Results

-- invalid search results -- WITH search_details AS ( SELECT country, SUM(num_search) AS total_search, SUM(num_search * (invalid_result_pct/100)) AS invalid_...

Foundations Track
Pro
aggregation
filtering
I
IshaSQL

Foundations Track

Medium
25 min
Exchange Seats

Use this IshaSQL scorecard to work on exchange seats. Table: Seat +-------------+---------+ | Column Name | Type | +-------------+---------+ | id | int | | s...

Foundations Track
Pro
filtering
I
IshaSQL

Foundations Track

Medium
25 min
Friend Requests II: Who Has The Most Friends

IshaSQL wants a scorecard for friend requests ii: who has the most friends. Table: RequestAccepted +----------------+---------+ | Column Name | Type | +-----...

Foundations Track
Pro
aggregation
Google
Google

Foundations Track

Medium
25 min
Bull And Bear Word Frequency

Google is reviewing bull and bear word frequency through a scorecard. The market content team wants to count occurrences of the words bull and bear in stored...

Foundations Track
Pro
aggregation
filtering
Meta
Meta

Interview Core Track

+4 more companies
Hard
35 min
Monthly Reactivated Users

Meta wants a scorecard for monthly reactivated users. Count how many users logged in during a month after being inactive in the previous month. Return login_...

Interview Core Track
Pro
query basics
aggregation
Visa
Visa

Interview Core Track

Easy
15 min
Dormant Promo Codes

Marketing launched several promo codes in Q1 2024 and wants to retire the unused ones. Return the promo_code values for codes created between 2024-01-01 and ...

Interview Core Track
query basics
filtering
Airbnb
Airbnb

Interview Core Track

Easy
15 min
Waitlist Fill Rate

Marketplace ops wants to see how efficiently waitlists are being cleared. Return each city, the total number of waitlist requests, and the percentage of fulf...

Interview Core Track
query basics
aggregation
PayPal
PayPal

Interview Core Track

Easy
15 min
Churned Merchants with Pending Payouts

Risk ops needs a cleanup list for merchants who have already churned but still have money waiting to be disbursed. Return the merchant_id values for churned ...

Interview Core Track
query basics
filtering
CVS Health
CVS Health

Interview Core Track

Easy
15 min
Weekend Staffing Gaps

Regional ops wants to find stores with no staffing at all during the weekend of 2024-08-17 and 2024-08-18. Return store_id and city for stores that had zero ...

Interview Core Track
query basics
filtering
Meta
Meta

Interview Core Track

Easy
15 min
Interest Pages Without Followers

The community team wants the page_id values for interest pages that never picked up a follower. Return the page IDs in ascending order.

Interview Core Track
query basics
joins
LinkedIn
LinkedIn

Interview Core Track

Easy
15 min
Most Attended Webinar Sessions

Marketing wants the three webinar sessions with the largest verified audiences. Return webinar_id, topic, and attendee_count, ordered by attendee_count desce...

Interview Core Track
query basics
joins
F
Facebook

Interview Core Track

Easy
15 min
Facebook Pages and Likes Analysis

Assume you're given two tables containing data about Facebook Pages and their respective likes (as in "Like a Facebook Page"). Write a query to return the ID...

Interview Core Track
joins
filtering
I
IshaSQL

Interview Core Track

Easy
15 min
Bank Account Summary II

Table: Users +--------------+---------+ | Column Name | Type | +--------------+---------+ | account | int | | name | varchar | +--------------+---------+ acc...

Interview Core Track
joins
aggregation
I
IshaSQL

Interview Core Track

Easy
15 min
Customer Who Visited but Did Not Make Any Transactions

Table: Visits +-------------+---------+ | Column Name | Type | +-------------+---------+ | visit_id | int | | customer_id | int | +-------------+---------+ v...

Interview Core Track
joins
filtering
I
IshaSQL

Interview Core Track

Easy
15 min
Top Travellers

Table: Users +---------------+---------+ | Column Name | Type | +---------------+---------+ | id | int | | name | varchar | +---------------+---------+ id is...

Interview Core Track
joins
aggregation
I
IshaSQL

Interview Core Track

Easy
15 min
Replace Employee ID With The Unique Identifier

Table: Employees +---------------+---------+ | Column Name | Type | +---------------+---------+ | id | int | | name | varchar | +---------------+---------+ i...

Interview Core Track
joins
I
IshaSQL

Interview Core Track

Easy
15 min
List the Products Ordered in a Period

Table: Products +------------------+---------+ | Column Name | Type | +------------------+---------+ | product_id | int | | product_name | varchar | | produc...

Interview Core Track
joins
aggregation
I
IshaSQL

Interview Core Track

Easy
15 min
Project Employees I

Table: Project +-------------+---------+ | Column Name | Type | +-------------+---------+ | project_id | int | | employee_id | int | +-------------+---------...

Interview Core Track
joins
aggregation
I
IshaSQL

Interview Core Track

Easy
15 min
Sales Person

Table: SalesPerson +-----------------+---------+ | Column Name | Type | +-----------------+---------+ | sales_id | int | | name | varchar | | salary | int | ...

Interview Core Track
joins
filtering
I
IshaSQL

Interview Core Track

Easy
15 min
Customers Who Never Order

Table: Customers +-------------+---------+ | Column Name | Type | +-------------+---------+ | id | int | | name | varchar | +-------------+---------+ id is t...

Interview Core Track
joins
filtering
Databricks
Databricks

Interview Core Track

Easy
15 min
3. How do you identify records in one table that aren't in another

To discover records in one table that are not present in another, you can utilize a LEFT JOIN and filter out any NULL values in the right-side table. For exa...

Interview Core Track
joins
filtering
Netflix
Netflix

Interview Core Track

Easy
15 min
8. Analyzing Netflix User Behavior and Content Ratings

You're a Data Analyst at Netflix, you have been asked to analyze customer behavior and their content ratings. You have the following two tables: A users tabl...

Interview Core Track
joins
aggregation
Salesforce
Salesforce

Interview Core Track

Easy
15 min
7. What's the difference between an inner and a full outer join

A **full outer join** returns all rows from both tables, including any unmatched rows, whereas an **inner join** only returns rows that match the join condit...

Interview Core Track
joins
Spotify
Spotify

Interview Core Track

Easy
15 min
3. What distinguishes an inner join from a full outer join

A full outer join returns all rows from both tables, including any unmatched rows, whereas an inner join only returns rows that match the join condition betw...

Interview Core Track
joins
Tesla
Tesla

Interview Core Track

Easy
15 min
11. Tesla Fleet Efficiency Analysis

You are a data analyst at Tesla and the company is focused on improving the efficiency of its vehicle fleet. Based on service data, the Company would like to...

Interview Core Track
joins
aggregation
Meta
Meta

Interview Core Track

Easy
15 min
Meta AR Filter Engagements

Which AR filters have generated user interactions in July 2024? List the filters by name.

Interview Core Track
joins
filtering
Netflix
Netflix

Interview Core Track

Easy
15 min
Netflix Country Marketing Spend

SELECT c.country_name, SUM(ms.amount_spent) as total_marketing_budget FROM fact_marketing_spend AS ms JOIN dimension_country AS c ON ms.country_id=c.country_...

Interview Core Track
joins
aggregation
Airbnb
Airbnb

Interview Core Track

Easy
15 min
6. Find the Average Number of Guests per Booking in Each City for Airbnb

As an analyst at Airbnb, one of the most useful insights you could provide would be to understand the average number of guests per booking across locations. ...

Interview Core Track
joins
aggregation
O
Oracle

Interview Core Track

Easy
15 min
10. Determine Records in One Table Not Present in Another

To find records in one table that aren't in another, you can use a LEFT JOIN and check for NULL values in the right-side table. Here is an example using two ...

Interview Core Track
joins
filtering
Pinterest
Pinterest

Interview Core Track

Easy
15 min
4. Pinterest's Popular Boards

Pinterest users can create and share content in the form of personal "boards". Each board is categorized under a specific theme, such as "Home Decor" or "Tra...

Interview Core Track
joins
filtering
Pinterest
Pinterest

Interview Core Track

Easy
15 min
5. Finding Records in One Table Not Present in Another

To find records in one table that aren't in another, you can use a LEFT JOIN and check for NULL values in the right-side table. Here's an example using two t...

Interview Core Track
joins
filtering
Google
Google

Interview Core Track

Easy
15 min
10070 Deepmind Employment Competition

SELECT p.team_id, AVG(s.member_score) as team_score FROM google_competition_participants p JOIN google_competition_scores s ON p.member_id = s.member_id GROU...

Interview Core Track
joins
aggregation
Airbnb
Airbnb

Interview Core Track

Easy
15 min
10078 Find Matching Hosts And Guests In A Way That They Are Both Of The Same Gender And Nationality

SELECT distinct h.host_id, g.guest_id FROM airbnb_hosts h JOIN airbnb_guests g ON h.nationality=g.nationality and h.gender = g.gender

Interview Core Track
joins
filtering
F
Facebook

Interview Core Track

Easy
15 min
10088 Liked Posts

SELECT COUNT(DISTINCT p.post_id) as n_posts_with_a_like FROM facebook_posts p JOIN facebook_reactions r ON p.post_id = r.post_id and r.reaction = 'like'

Interview Core Track
joins
aggregation
Amazon
Amazon

Interview Core Track

Easy
15 min
2128 Book Sales

SELECT b.book_id, COALESCE(SUM(b.unit_price*od.quantity), 0) as total_sales FROM amazon_books b LEFT JOIN amazon_books_order_details od ON b.book_id=od.book_...

Interview Core Track
joins
aggregation
Robinhood
Robinhood

Interview Core Track

Easy
15 min
01 Easy Robinhood Cities With Completed Trades

-- clients with completed trades -- SELECT u.city, COUNT(t.order_id) AS total_orders FROM trades AS t INNER JOIN users AS u ON t.user_id = u.user_id WHERE t....

Interview Core Track
joins
aggregation
I
IshaSQL

Interview Core Track

Easy
15 min
Sales Analysis III

Table: Product +--------------+---------+ | Column Name | Type | +--------------+---------+ | product_id | int | | product_name | varchar | | unit_price | in...

Interview Core Track
joins
aggregation
F
Facebook

Interview Core Track

Easy
15 min
Average Employee Popularity By Location

Facebook wants a scorecard for average employee popularity by location. The workplace insights team wants to compare employee survey popularity by office loc...

Interview Core Track
joins
aggregation
F
Facebook

Interview Core Track

Easy
15 min
Posts With Heart Reactions

At Facebook, analysts are preparing a scorecard focused on posts with heart reactions. The engagement team wants the full post records for posts that receive...

Interview Core Track
joins
filtering
TikTok
TikTok

Analytics Reporting Track

Medium
25 min
Seven-Day Trial Conversion

The growth team wants to compare acquisition channels for January trial signups. For each acquisition_channel, return the number of users who converted withi...

Analytics Reporting Track
query basics
aggregation
Stripe
Stripe

Interview Core Track

Medium
25 min
Average Minutes to First Reply

Support leadership wants to compare response speed across inboxes. For conversations created in May 2024, return each inbox_name and the average number of mi...

Interview Core Track
query basics
aggregation
Amazon
Amazon

Interview Core Track

Medium
25 min
Store Refund Share

Retail finance wants to compare refund pressure by store for April 2024 orders. Return store_id, total_sales, refunded_amount, and refund_pct rounded to two ...

Interview Core Track
query basics
aggregation
Wayfair
Wayfair

Analytics Reporting Track

Medium
25 min
Carrier Late Shipment Rate

Operations wants to compare carrier reliability for June 2024 shipments. Return each carrier_name, total_shipments, and the late_shipment_pct rounded to two ...

Analytics Reporting Track
query basics
aggregation
CVS Health
CVS Health

Analytics Reporting Track

Medium
25 min
Vendor Delivery Gaps

The supply team wants to review long breaks between deliveries. For each vendor_id, return rows where the gap between one delivery and the previous delivery ...

Analytics Reporting Track
query basics
date functions
PayPal
PayPal

Analytics Reporting Track

Medium
25 min
First Purchase Revenue by Signup Month

Revenue planning wants to understand how much first-time purchase revenue is coming from each merchant signup cohort. Return signup_month and the total value...

Analytics Reporting Track
query basics
aggregation
Meta
Meta

Analytics Reporting Track

Medium
25 min
Severity-One Resolution Pace

Reliability engineering wants to compare how quickly teams resolve the most urgent incidents. Return team_name, critical_incidents, and avg_resolution_hours ...

Analytics Reporting Track
query basics
aggregation
Robinhood
Robinhood

Analytics Reporting Track

Medium
25 min
Backlog Older Than Three Days

Operations wants to compare teams based on how often tickets stay unresolved for more than three days. Return team_name, total_tickets, aged_tickets, and age...

Analytics Reporting Track
query basics
aggregation
Netflix
Netflix

Analytics Reporting Track

Medium
25 min
Quarterly Headcount Change

People analytics wants the most recent quarter-over-quarter headcount change for each team. Return team_name, current_headcount, prior_headcount, and headcou...

Analytics Reporting Track
query basics
date functions
Google
Google

Interview Core Track

Medium
25 min
Remaining Server Capacity

Each server has a total capacity and may have multiple workloads assigned. Return server_id and remaining_capacity for every server, including servers with n...

Interview Core Track
Pro
query basics
joins
Etsy
Etsy

Analytics Reporting Track

Medium
25 min
Same-Week Repeat Buyers

Count the number of users who placed at least two orders in the same calendar week. Return a single value named repeat_buyers.

Analytics Reporting Track
Pro
query basics
aggregation
Databricks
Databricks

Analytics Reporting Track

Medium
25 min
Second Customer Transaction

At Databricks, analysts are preparing a scorecard focused on second customer transaction. Return each user_id and transaction_date for the second transaction...

Analytics Reporting Track
Pro
query basics
date functions
Pinterest
Pinterest

Interview Core Track

Medium
25 min
Final Account Balances

Use this Pinterest operations review to work on final account balances. Calculate the final balance per account_id. Credits add to the balance and debits sub...

Interview Core Track
Pro
query basics
joins
Meta
Meta

Analytics Reporting Track

Medium
25 min
Rapid Repeat Payment Alerts

Meta is reviewing rapid repeat payment alerts through a scorecard. Count how many repeated payments happened within 10 minutes for the same merchant_id, cred...

Analytics Reporting Track
Pro
query basics
date functions
Pinterest
Pinterest

Interview Core Track

Medium
25 min
Unique Money Transfer Relationships

Use this Pinterest operations review to work on unique money transfer relationships. Count unique transfer relationships regardless of direction. Return rela...

Interview Core Track
Pro
query basics
joins
Meta
Meta

Analytics Reporting Track

+6 more companies
Medium
25 min
May Orders By Region

Use this Meta scorecard to work on may orders by region. Return each region and the number of orders placed during May 2024. Sort by region.

Analytics Reporting Track
Pro
query basics
date functions
Airbnb
Airbnb

Analytics Reporting Track

Medium
25 min
April Weekly Event Totals

Airbnb wants a scorecard for april weekly event totals. Return the week_start date and total_events for April 2024. Sort by week_start.

Analytics Reporting Track
Pro
query basics
date functions
Pinterest
Pinterest

Analytics Reporting Track

Medium
25 min
Unique Orders And Customers Per Month

Use this Pinterest performance snapshot to work on unique orders and customers per month. Return each region and the number of orders placed during May 2024....

Analytics Reporting Track
Pro
query basics
date functions
I
IshaSQL

Interview Core Track

Medium
25 min
Find COVID Recovery Patients

Table: patients +-------------+---------+ | Column Name | Type | +-------------+---------+ | patient_id | int | | patient_name| varchar | | age | int | +----...

Interview Core Track
Pro
joins
date functions
I
IshaSQL

Interview Core Track

Medium
25 min
Find Product Recommendation Pairs

Table: ProductPurchases +-------------+------+ | Column Name | Type | +-------------+------+ | user_id | int | | product_id | int | | quantity | int | +-----...

Interview Core Track
Pro
joins
aggregation
I
IshaSQL

Interview Core Track

Medium
25 min
Analyze Subscription Conversion

Table: UserActivity +------------------+---------+ | Column Name | Type | +------------------+---------+ | user_id | int | | activity_date | date | | activit...

Interview Core Track
Pro
joins
aggregation
I
IshaSQL

Interview Core Track

Medium
25 min
Confirmation Rate

Table: Signups +----------------+----------+ | Column Name | Type | +----------------+----------+ | user_id | int | | time_stamp | datetime | +--------------...

Interview Core Track
Pro
joins
aggregation
I
IshaSQL

Interview Core Track

Medium
25 min
Movie Rating

Table: Movies +---------------+---------+ | Column Name | Type | +---------------+---------+ | movie_id | int | | title | varchar | +---------------+--------...

Interview Core Track
Pro
aggregation
joins
I
IshaSQL

Interview Core Track

Medium
25 min
Students and Examinations

Table: Students +---------------+---------+ | Column Name | Type | +---------------+---------+ | student_id | int | | student_name | varchar | +-------------...

Interview Core Track
Pro
joins
aggregation
I
IshaSQL

Interview Core Track

Medium
25 min
Average Selling Price

Table: Prices +---------------+---------+ | Column Name | Type | +---------------+---------+ | product_id | int | | start_date | date | | end_date | date | |...

Interview Core Track
Pro
joins
aggregation
I
IshaSQL

Interview Core Track

Medium
25 min
2019 Buyer Orders

Table: Users +----------------+---------+ | Column Name | Type | +----------------+---------+ | user_id | int | | join_date | date | | favorite_brand | varch...

Interview Core Track
Pro
joins
aggregation
I
IshaSQL

Interview Core Track

Medium
25 min
Next Day Login Fraction

Table: Activity +--------------+---------+ | Column Name | Type | +--------------+---------+ | player_id | int | | device_id | int | | event_date | date | | ...

Interview Core Track
Pro
aggregation
joins
I
IshaSQL

Interview Core Track

Medium
25 min
Product Sales Analysis III

Table: Sales +-------------+-------+ | Column Name | Type | +-------------+-------+ | sale_id | int | | product_id | int | | year | int | | quantity | int | ...

Interview Core Track
Pro
joins
aggregation
I
IshaSQL

Interview Core Track

Medium
25 min
Department Highest Salary

Table: Employee +--------------+---------+ | Column Name | Type | +--------------+---------+ | id | int | | name | varchar | | salary | int | | departmentId ...

Interview Core Track
Pro
joins
filtering
Target
Target

Interview Core Track

Medium
25 min
Source Target ID Reconciliation

Given two tables source and target, identify the following: IDs present in the source table but not in the target table. IDs present in the target table but ...

Interview Core Track
Pro
joins
filtering
S
Snapchat

Interview Core Track

Medium
25 min
02 Sending Vs Opening Snaps

-- Assume you're given tables with information on Snapchat users, including their ages and time spent sending and opening snaps. -- Write a query to obtain a...

Interview Core Track
aggregation
joins
Microsoft
Microsoft

Interview Core Track

Medium
25 min
10 Supercloud Customer

-- A Microsoft Azure Supercloud customer is defined as a company that purchases at least one product from each product category. -- Write a query that effect...

Interview Core Track
Pro
aggregation
joins
Google
Google

Interview Core Track

Medium
25 min
4. Determine the Most Popular Google Search Category

For this scenario, assume that Google wants to analyze the top searched categories in their platform to optimize their search results. We have two tables, se...

Interview Core Track
Pro
joins
aggregation
O
Oracle

Interview Core Track

Medium
25 min
2. Designing Database for Oracle's Employee Training Program

Oracle is starting a new Employee Training Program and wants to keep track of each employee's progress. The program includes multiple courses, and each cours...

Interview Core Track
joins
aggregation
Spotify
Spotify

Interview Core Track

Medium
25 min
1. Identify Spotify's Most Frequent Listeners

Spotify wants to identify their 'whale users', these are users who listen to the most tracks every month. They are potential customers to involve in user fee...

Interview Core Track
Pro
joins
aggregation
Spotify
Spotify

Interview Core Track

Medium
25 min
8. Calculate the average listening duration for each music genre on Spotify

Suppose that Spotify would like to understand better the average listening duration for each genre of music on their platform. **Write a SQL query that calcu...

Interview Core Track
Pro
joins
aggregation
Uber
Uber

Interview Core Track

Medium
25 min
7. Could you describe a self-join and provide a scenario in which it would be used

A self-join is a type of join in which a table is joined to itself. To perform a self-join, you need to specify the table name twice in the FROM clause, and ...

Interview Core Track
Pro
filtering
joins
Airbnb
Airbnb

Interview Core Track

Medium
25 min
11. Analyze Host Listings and Booking Transactions

As an Airbnb data analyst, you have been asked to analyze the performance of hosts' listings in the past year. Your task is to **identify the top 10 listings...

Interview Core Track
Pro
joins
aggregation
Databricks
Databricks

Interview Core Track

Medium
25 min
1. Identifying Power Users for Databricks

As a Databricks data analyst, one of the most important tasks is identifying our power users. These are users who frequently use Databricks' tools and servic...

Interview Core Track
Pro
joins
aggregation
Airbnb
Airbnb

Interview Core Track

Medium
25 min
10074 Find The Average Age Of Guests Reviewed By Each Host

SELECT from_user, AVG(age) as average_age FROM airbnb_reviews r JOIN airbnb_guests g ON r.to_user = g.guest_id WHERE from_type = 'host' GROUP BY from_user

Interview Core Track
Pro
joins
aggregation
F
Facebook

Interview Core Track

Medium
25 min
2081 Recommendation System

-- Problem Statement: -- You are given the list of Facebook friends and the list of Facebook pages that users follow. Your task is to create a new recommenda...

Interview Core Track
Pro
joins
filtering
F
Facebook

Interview Core Track

Medium
25 min
9777 Successfully Sent Messages

WITH success_or_not as ( SELECT ms.message_id, CASE WHEN mr.message_id IS NOT NULL THEN 1 ELSE 0 END as receive_success FROM facebook_messages_sent ms LEFT J...

Interview Core Track
Pro
joins
aggregation
I
IshaSQL

Interview Core Track

Medium
25 min
Market Analysis I

IshaSQL wants a scorecard for market analysis i. Table: Users +----------------+---------+ | Column Name | Type | +----------------+---------+ | user_id | in...

Interview Core Track
Pro
joins
aggregation
I
IshaSQL

Interview Core Track

Medium
25 min
Game Play Analysis IV

At IshaSQL, analysts are preparing a scorecard focused on game play analysis iv. Table: Activity +--------------+---------+ | Column Name | Type | +---------...

Interview Core Track
Pro
aggregation
joins
TikTok
TikTok

Analytics Reporting Track

Hard
35 min
One-Month Creator Retention

Growth wants a basic cohort view for creator retention. For signup_month values from 2024-01-01 through 2024-03-01, return the cohort size, the number of cre...

Analytics Reporting Track
Pro
query basics
aggregation
Etsy
Etsy

Analytics Reporting Track

Hard
35 min
Revenue Rank Within Category

Merchandising wants the top products by revenue inside each category. Return the top two products per category with category, product_name, total_revenue, an...

Analytics Reporting Track
query basics
aggregation
Uber
Uber

Analytics Reporting Track

Hard
35 min
Consecutive Delay Streaks

Dispatch wants the longest streak of delayed service days for each driver. Return driver_id and longest_streak, where a streak counts consecutive trip_date v...

Analytics Reporting Track
query basics
aggregation
Google
Google

Analytics Reporting Track

Hard
35 min
Power Usage Outliers

Infrastructure wants to flag racks with unusual power spikes. Return rack_id, usage_date, kilowatt_hours, and the rack_average rounded to two decimals for ro...

Analytics Reporting Track
query basics
aggregation
Shopify
Shopify

Analytics Reporting Track

Hard
35 min
Rising Basket Buyers

The retention team wants to identify buyers whose first three orders show steadily larger baskets. Return buyer_id values where the first order total is less...

Analytics Reporting Track
query basics
aggregation
Shopify
Shopify

Interview Core Track

Hard
35 min
Running Spend by Product Line

For each product_line, return the cumulative revenue by order_date. Output order_date, product_line, and cumulative_revenue. Sort by product_line and order_d...

Interview Core Track
Pro
query basics
aggregation
Fitbit
Fitbit

Interview Core Track

Hard
35 min
Daily Alternating Measurement Totals

Operations needs a daily split between alternating sensor readings. For each day, order measurements by measured_at, add the 1st, 3rd, 5th, and later odd-pos...

Interview Core Track
query basics
aggregation
Stripe
Stripe

Interview Core Track

Hard
35 min
Rapid Repeat Card Payments

Risk operations wants to flag merchants that received back-to-back payments for the same amount within a ten-minute window. For each merchant_id, return repe...

Interview Core Track
Pro
query basics
filtering
Alibaba
Alibaba

Interview Core Track

+3 more companies
Hard
35 min
Rolling Three-day Earnings

At Alibaba, analysts are preparing a scorecard focused on rolling three-day earnings. Return each user_id, transaction_date, and rolling_3_day_earnings based...

Interview Core Track
query basics
aggregation
LinkedIn
LinkedIn

Interview Core Track

Hard
35 min
Rolling Three

Use this LinkedIn operations review to work on rolling three. Return each user_id, transaction_date, and rolling_3_day_earnings based on the current day plus...

Interview Core Track
Pro
query basics
filtering
Spotify
Spotify

Interview Core Track

Hard
35 min
Linkedin Power Creators (part 1)

Spotify wants a scorecard for linkedin power creators (part 1). Return each pair of products that were purchased together in the same order. Output product_i...

Interview Core Track
Pro
query basics
joins
Databricks
Databricks

Interview Core Track

+1 more companies
Hard
35 min
Customers Buying Every Category

Databricks wants a scorecard for customers buying every category. Return each customer_id that purchased at least one product in every product_category. Sort...

Interview Core Track
Pro
query basics
joins
Wayfair
Wayfair

Interview Core Track

Hard
35 min
Products Purchased Together

Use this Wayfair operations review to work on products purchased together. Return each pair of products that were purchased together in the same order. Outpu...

Interview Core Track
Pro
query basics
joins
Spotify
Spotify

Interview Core Track

Hard
35 min
Products Bought Together

Spotify is reviewing products bought together through a trend check. Return each pair of products that were purchased together in the same order. Output prod...

Interview Core Track
Pro
query basics
joins
I
IshaSQL

Interview Core Track

Hard
35 min
Find Emotionally Consistent Users

Table: reactions +--------------+---------+ | Column Name | Type | +--------------+---------+ | user_id | int | | content_id | int | | reaction | varchar | +...

Interview Core Track
aggregation
filtering
I
IshaSQL

Interview Core Track

Hard
35 min
Most Common Course Pairs

Table: course_completions +-------------------+---------+ | Column Name | Type | +-------------------+---------+ | user_id | int | | course_id | int | | cour...

Interview Core Track
Pro
filtering
aggregation
I
IshaSQL

Interview Core Track

Hard
35 min
Find Books with Polarized Opinions

Table: books +-------------+---------+ | Column Name | Type | +-------------+---------+ | book_id | int | | title | varchar | | author | varchar | | genre | ...

Interview Core Track
Pro
joins
aggregation
I
IshaSQL

Interview Core Track

Hard
35 min
Find Consistently Improving Employees

Table: employees +-------------+---------+ | Column Name | Type | +-------------+---------+ | employee_id | int | | name | varchar | +-------------+---------...

Interview Core Track
Pro
filtering
I
IshaSQL

Interview Core Track

Hard
35 min
Seasonal Sales Analysis

Table: sales +---------------+---------+ | Column Name | Type | +---------------+---------+ | sale_id | int | | product_id | int | | sale_date | date | | qua...

Interview Core Track
Pro
joins
aggregation
I
IshaSQL

Interview Core Track

Hard
35 min
Restaurant Growth

Table: Customer +---------------+---------+ | Column Name | Type | +---------------+---------+ | customer_id | int | | name | varchar | | visited_on | date |...

Interview Core Track
Pro
aggregation
I
IshaSQL

Interview Core Track

Hard
35 min
Human Traffic of Stadium

Table: Stadium +---------------+---------+ | Column Name | Type | +---------------+---------+ | id | int | | visit_date | date | | people | int | +----------...

Interview Core Track
Pro
filtering
I
IshaSQL

Interview Core Track

Hard
35 min
Trips and Users

Table: Trips +-------------+----------+ | Column Name | Type | +-------------+----------+ | id | int | | client_id | int | | driver_id | int | | city_id | in...

Interview Core Track
Pro
joins
aggregation
I
IshaSQL

Interview Core Track

Hard
35 min
Department Top Three Salaries

Table: Employee +--------------+---------+ | Column Name | Type | +--------------+---------+ | id | int | | name | varchar | | salary | int | | departmentId ...

Interview Core Track
Pro
joins
filtering
W
Walmart

Interview Core Track

Hard
35 min
12 Histogram Of Users And Purchases

-- Assume you're given a table on Walmart user transactions. Based on their most recent transaction date, write a query that retrieve the users along with th...

Interview Core Track
aggregation
Apple
Apple

Interview Core Track

Hard
35 min
9. Follow-Up AirPod Percentage

The Apple Customer Retention Data Science team needs your help to investigate buying patterns related to AirPods and iPhones. Write a SQL query to determine ...

Interview Core Track
Pro
aggregation
filtering
Google
Google

Interview Core Track

Hard
35 min
11 Odd And Even Measurements

-- Assume you're given a table with measurement values obtained from a Google sensor over multiple days with measurements taken multiple times within each da...

Interview Core Track
Pro
aggregation
date functions
F
Facebook

Interview Core Track

Hard
35 min
9793 Average Time Between Steps

WITH step_differences AS ( SELECT feature_id, user_id, step_reached, timestamp, LEAD(timestamp) OVER (PARTITION BY feature_id, user_id ORDER BY step_reached)...

Interview Core Track
Pro
aggregation
date functions
I
IshaSQL

Interview Core Track

Hard
35 min
Find Stores with Inventory Imbalance

Table: stores +-------------+---------+ | Column Name | Type | +-------------+---------+ | store_id | int | | store_name | varchar | | location | varchar | +...

Interview Core Track
Pro
aggregation
filtering
LinkedIn
LinkedIn

Interview Core Track

Hard
35 min
Linkedin Power Creators

At LinkedIn, analysts are preparing a scorecard focused on linkedin power creators. The creator analytics team wants to identify personal profiles that have ...

Interview Core Track
Pro
joins
aggregation
Google
Google

Interview Core Track

Hard
35 min
Handyman Earnings Per Employee Mode

Use this Google scorecard to work on handyman earnings per employee mode. The ads finance team wants the most common adwords earnings per employee value amon...

Interview Core Track
Pro
aggregation
filtering
T
Twitter

Interview Core Track

Hard
35 min
Top Department Salaries

Twitter wants a scorecard for top department salaries. The compensation team wants the top salary levels in each department. Rank salaries within each depart...

Interview Core Track
Pro
filtering