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

preview_player
Показать описание
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.

______________________________________________________________________

______________________________________________________________________
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.

______________________________________________________________________
Contact:

If you have any questions, comments, or feedback, please leave them here!
______________________________________________________________________

#sql #datascience #sqlinterviews
Рекомендации по теме
Комментарии
Автор

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)

stratascratch
Автор

legit thought I sucked at SQL but doing some questions and reading deeper I was able to teach myself a lot of concepts just by practicing and seeing what I got wrong.... Thanks for the content Nate 👍

ProdbyTrehnt
Автор

2 months ago I was so afraid to even walk through an SQL video on Youtube. But look at me now! I am diving deeper and learning so much every day. Thankfully i didn't gave up!

mohitupadhayay
Автор

I get the overall gist of solving questions like this but breaking jt down so nicely like you is something I'm strugglong with. Got final interviews with Amazon coming up and just looking around

DaniMrtini
Автор

You're the best SQL/Data science Youtuber.

adhirajmajumder
Автор

Ok i write steps on my own by breaking down question. But how to implement it helped me. Also converting to float is learnt thanku

aashishmalhotra
Автор

Really heart touching .
With few seconds you will soled this query with beter understanding

AdvikSSC
Автор

This is amazing intro for windows function. Love the video.

For those who want to replicate his code, "order_cost" has been replaced with "total_rder_cost"

mercantilism
Автор

Very well explained. I am amazed how the difficult question seemed easy after the explanation!! 😁 I am going to try and use the approach you've used here. Thanks!!

ShivaniPandhare
Автор

That was really neat, i love the clear and concise train of thought before delving into code

alfredama
Автор

Great explanation of partition by. I was so lost before watching this video! Thank you!

angelomartinez
Автор

thanks a million, it helped me a lot with the understanding of Partition by clause!

marinamondadorigessinger
Автор

Very clean explanation. Short and sweet :-) Thanks a lot!

okygy
Автор

Simple and excellent explanation Nate! . Thank you

yasoram
Автор

Thank for your vid, I didn’t think about partitioning method, and intend to use sub query with group by id for calculate the percentage before selecting it

bachlam
Автор

Hi guy. Thanks you for this video. You have a new subscriber now. I am studying software engineering here in peru and I would like to have a master at data engineering or data scientist.

oscarherediamiranda
Автор

Very well explained.
Thank you for providing the great resource.

subhashgn
Автор

Very very good video and well explained. Thank you

jmmmmmmmmmk
Автор

very well-explained, Thank you and big subcribed

cabaymau
Автор

Really Good tutorial Nate!!! Thanks for uploading such a good content

madhurasawarkar