LeetCode Medium 1164 Amazon Interview SQL Question with Detailed Explanation

  Рет қаралды 8,159

Everyday Data Science

Everyday Data Science

Күн бұрын

Question: leetcode.com/p...
In this video I solve and explain a medium difficulty leetcode SQL question using MySQL query. This question has been asked in Apple, Facebook, Amazon, Google, Adobe, Microsoft, Adobe interviews or what we popularly call FAANG interviews.
I explain the related concept as well. This question includes points to keep in mind to develop SQL queries.
LeetCode is the best platform to help you enhance your skills, expand your knowledge and prepare for technical interviews.
If you found this helpful, Like and Subscribe to the channel for more content.
#LeetCodeSQL #FAANG #SQLinterviewQuestions

Пікірлер: 21
@saisushanthdurvasulabitsian
@saisushanthdurvasulabitsian 2 жыл бұрын
thank you so much , alternate way: with cte as ( select product_id , first_value(new_price) over (partition by product_id order by change_date desc) as price from Products where change_date
@nomalware2811
@nomalware2811 6 ай бұрын
same I generated...
@turyaganguly447
@turyaganguly447 Жыл бұрын
Your process of explaining is so good. Thanks for your videos. They are really helpful.
@sivasrimakurthi206
@sivasrimakurthi206 Жыл бұрын
@everyday Data Sceince - what an eye you got, everything you see in DATA lens .. loved the way, you conquer the problem statement.
@EverydayDataScience
@EverydayDataScience Жыл бұрын
Glad that you are enjoying the series so far 😊
@sivasrimakurthi206
@sivasrimakurthi206 Жыл бұрын
@@EverydayDataScience yes, I am watching the entire series. It is pure fun, going over each and every video and learning new stuff in each query, that is what amazed me how you have designed this series. Thanks for well thought series.
@anasalnaggar4838
@anasalnaggar4838 Жыл бұрын
thanks man , ur explanation is very good
@mickyman753
@mickyman753 Ай бұрын
# Write your MySQL query statement below with cte1 as ( select distinct product_id,first_value(new_price) over(partition by product_id order by change_date desc) as new_price from products where change_date
@sohailkan17
@sohailkan17 Жыл бұрын
I was stuck in joining the tables the cte with the Products table for id#3 but could not successfully retrieve the output data Thankyou i got to learn an alternative of join UNION set operators
@changkris2844
@changkris2844 9 ай бұрын
Thanks bro, really helpful
@EverydayDataScience
@EverydayDataScience 9 ай бұрын
Glad that you found the video useful 😊
@sauravchandra10
@sauravchandra10 Жыл бұрын
My approach: WITH cte2 AS( SELECT *, RANK() OVER(PARTITION BY product_id ORDER BY change_date DESC) AS change_no FROM Products HAVING change_date
@rupdeepthey
@rupdeepthey Жыл бұрын
Will this work if price of product id is changed more than once after the specified date? Won't it print duplicate ids in that case?
@vbmudalige
@vbmudalige Жыл бұрын
My solution: with cte as ( select product_id, last_value(new_price) over( partition by product_id order by change_date rows between current row and unbounded following ) as price from Products where change_date
@saurabhmahajan3385
@saurabhmahajan3385 Жыл бұрын
Hi Brother, Hope you doing good. Can you please solve 601. Human Traffic of Stadium? Thanks in Advance, Saurabh 😊
@shubhammishra2225
@shubhammishra2225 Жыл бұрын
Alternate way --- select product_id, max(case when change_date
@metricsview33
@metricsview33 Жыл бұрын
what if it is not neccessary that price will increase only with time, it can decrease too in big data, then max() will not work
@jatinyadav8960
@jatinyadav8960 2 жыл бұрын
great
@gxrvish
@gxrvish 4 ай бұрын
make it simple dude, you are making it more and more complicated...
@nomalware2811
@nomalware2811 6 ай бұрын
WITH CTE AS (SELECT DISTINCT product_id, FIRST_VALUE(new_price) OVER(PARTITION BY product_id ORDER BY change_date DESC) price FROM Products WHERE change_date
@HarshSharma-dm6yg
@HarshSharma-dm6yg Ай бұрын
solution without using subquerry: WITH mycte AS ( SELECT product_id, change_date, new_price, RANK() OVER(PARTITION BY product_id ORDER BY change_date DESC) as ranking FROM products WHERE change_date '2019-08-16'
LeetCode 1251 Interview SQL Question with Detailed Explanation | Practice SQL
17:11
LeetCode 1661: Average Time of Process per Machine [SQL]
8:16
Frederik Müller
Рет қаралды 10 М.
LeetCode Medium 1045 Amazon Interview SQL Question with Detailed Explanation
7:01
2nd Half - The Conclusion | Basics of Pandas and DataFrames | Python for Data Analysis | Jan 2025
32:35
Maximum Number of Fish in a Grid - Leetcode 2658
16:05
ThinkOutsideTheBox
Рет қаралды 30