SQL Coding Interview Question Using A Window Function (PARTITION BY) | Data Science Interviews @stratascratch
SQL Coding Interview Question Using A Window Function (PARTITION BY) | Data Science Interviews  @stratascratch
Uploaded November 2020 | Updated September 2026, 2 hours ago
In this video, I'll walk you through a common SQL coding interview question that is asked in many data science interviews. This SQL question tests your knowledge of SQL window functions, specifically using a PARTITION BY. I'd consider this a simple SQL window function so let's test your knowledge on this question before diving into more complicated problems. Follow along with me and head to the question below.

Link to the question: platform.stratascratch.com/coding/9899-percentage-of-total-spend?python=&utm_source=youtube&utm_medium=click&utm_campaign=YT+description+link

______________________________________________________________________

This series is for both beginner and intermediate data scientists and analysts interested in learning how to solve common data science interview questions in SQL. These are real data science interview questions. For some background context and an intro about what this series is about: bit.ly/36kKbxG

πŸ‘‰ Subscribe to my channel: bit.ly/2GsFxmA
πŸ‘‰ Playlist for more data science interview questions and answers: bit.ly/3jifw81
πŸ‘‰ Playlist for data science interview tips: bit.ly/2G5hNoJ
πŸ‘‰ Practice more real data science interview questions: platform.stratascratch.com/coding?utm_source=youtube&utm_medium=click&utm_campaign=YT+description+link

______________________________________________________________________
Timestamps:

Intro: (0:00)
Interview Question: (0:11)
Explore the Dataset: (0:38)
Solution Approach: (1:27)
Coding - JOIN The Tables: (3:05)
Coding - Explanation of the SQL Window Function: (4:22)
Coding - Finishing up the Solution: (6:37)

______________________________________________________________________
About The Platform:

I'm using StrataScratch, a platform that allows you to practice real data science interview questions. There are over 1000+ interview questions that cover coding (SQL and python), statistics, probability, product sense, and business cases.

I created this platform because I wanted to build a resource to specifically help prepare data scientists for their technical interviews and to generally improve their analytical skills. Over my career as a data scientist, I never was able to find a dedicated platform for data science interview prep. LeetCode and HackerRank were the closest but these platforms specifically serve the computer developer community so their questions focus more on algorithms that working with data.

So, if you want more interview practice with real data science interview questions, visit platform.stratascratch.com/coding?utm_source=youtube&utm_medium=click&utm_campaign=YT+description+link. All questions are free and you can even execute SQL and python code in the IDE, but if you want to check out the solutions from me or from other users, you can use ss15 for a 15% discount on the premium plans.

______________________________________________________________________
Contact:

If you have any questions, comments, or feedback, please leave them here!
Feel free to also email me at nathan@stratascratch.com
______________________________________________________________________

#sql #datascience #sqlinterviews
SQL Coding Interview Question Using A Window Function (PARTITION BY) | Data Science InterviewsGod-Tier Data Science Frameworks… or Total Flops? #coding #frameworks #technologyHow the YouTube Algorithm REALLY Works 2026How to Build a DoorDash Prediction Model with PythonMultiple Approaches for Solving a Twitter Data Scientist Interview QuestionShort Primer on Tree-Based Machine Learning ModelsMultiple Solutions to Data Scientist Interview Question From Amazon [Rolling Average]Analyzing Datasets with Window Functions: First Value Syntax and ExamplesSolving an Airbnb Data Science Coding Interview Question | SQL Interview  [Fav Host Nationality]Sorting and Ranking Data in Python: An Overview of the Rank() Function[Part 2]: Exploring Decision Tree Classifiers For A Facebook Data Science Project of Movie Ratings[Part 3]: Random Forest Classifier For A Facebook Data Science Project of Movie Ratings
StrataScratch |

SQL Coding Interview Question Using A Window Function (PARTITION BY) | Data Science Interviews

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER