In this video we will cover a real use case where we need to use dense rank over rank.
Zero to hero(Advance) SQL Aggregation:
• All About SQL Aggregations | SQL Adva...
Most Asked Join Based Interview Question:
• Most Asked SQL JOIN based Interview Q...
Solving 4 Trick SQL problems:
• Solving 4 Tricky SQL Problems
Data Analyst Spotify Case Study:
• Data Analyst Spotify Case Study | SQL...
Top 10 SQL interview Questions:
• Top 10 SQL interview Questions and An...
Interview Question based on FULL OUTER JOIN:
• SQL Interview Question Based on Full ...
Playlist to master SQL :
• Complex SQL Questions for Interview P...
Rank, Dense_Rank and Row_Number:
• RANK, DENSE_RANK, ROW_NUMBER SQL Anal...
script:
create table product_inventory_fact
(
product_id varchar(10),
quantity integer,
snapshot_date date
)
insert into product_inventory_fact
values ('ITEM1',10,'2022-08-01'),('ITEM2',14,'2022-08-01')
,('ITEM1',10,'2022-08-02'),('ITEM2',12,'2022-08-02')
,('ITEM1',5,'2022-08-03'),('ITEM2',6,'2022-08-03'),('ITEM3',6,'2022-08-03')
,('ITEM1',10,'2022-08-04'),('ITEM2',9,'2022-08-04'),('ITEM3',3,'2022-08-04'),('ITEM4',8,'2022-08-04')
#sql #dataengineer