SCD Type 1 and Type 2 using SQL | Implementation of Slowly Changing Dimensions

  Рет қаралды 22,174

Ankit Bansal

Ankit Bansal

Күн бұрын

Пікірлер: 52
@macx8360
@macx8360 9 ай бұрын
you wont believe ,i was just learning the same concept from your python course today itself in the morning
@Nalaka-Wanniarachchi
@Nalaka-Wanniarachchi 9 ай бұрын
Great stuff.Must learn one by every data enthusiast.
@RoamingSoming
@RoamingSoming 9 ай бұрын
Great way of explaining SCD types
@subhajitdey6806
@subhajitdey6806 9 ай бұрын
great video ! need more data modelling and data engineering videos man !
@shanthiprabhu2100
@shanthiprabhu2100 6 ай бұрын
Great Ankit, thanks. I am completely new to this concept and its very useful
@ashanair5909
@ashanair5909 5 ай бұрын
If there was a way to love your videos and not just like.. Learning a lot Ankit. Thanks
@ankitbansal6
@ankitbansal6 5 ай бұрын
Cheers 🥂
@sravankumar1767
@sravankumar1767 9 ай бұрын
Superb explanation 👌 👏 👍
@Sachin_Sambare
@Sachin_Sambare Ай бұрын
you are too good..very very nice explanation
@ankitbansal6
@ankitbansal6 Ай бұрын
Thank you for the appreciation
@ankitbhangdia3931
@ankitbhangdia3931 7 ай бұрын
@ankit bansal: Great job on explaining the concept. qq: Instead of making the end date as forever, will it make sense to keep it as NULL & include another column such as is_current_value which would be a boolean field. When someone wants to track the history in the report, an analyst can simply put the condition for start_date, end_date IS NULL and is_current_value = 'n' to take a look at the previous record or they could query on the start_date, end_date IS NOT NULL and is_current_value ='y'. You could even use an OR operator in the query with the structure I'm proposing. Using forever as the end_date is frowned upon in the data warehousing world IMHO.
@JuanHernandez-pf6yg
@JuanHernandez-pf6yg 3 ай бұрын
Very useful. Thank you!
@deepakj6717
@deepakj6717 9 ай бұрын
Best video.. Thanks !! If possible pls make videos on SQL performance tuning or launch course.
@uditkapadia7104
@uditkapadia7104 7 ай бұрын
Great Explanation !
@meropahad7537
@meropahad7537 9 ай бұрын
Thanks for the video Ankit
@apexemperor
@apexemperor 9 ай бұрын
Needed this video but 6months ago... Bt we did it together in office with a friend that time 😀😺 using sql
@yuvrajyuvas4730
@yuvrajyuvas4730 6 ай бұрын
Awesome Bro..
@pradeepyogesh4481
@pradeepyogesh4481 9 ай бұрын
Very good information and thanks for the content. How to create staging tables in the first place?
@aadil8409
@aadil8409 5 ай бұрын
sir, can we implement scd-1 via merge statement. i mean to ask is merge statement is nothing but the scd-1 only?
@Ironsouljourney
@Ironsouljourney 8 ай бұрын
my question is if we connect the data in power bi desktop so we need to manually do this scd 2 or it will automatically updated
@vamsivamsi2029
@vamsivamsi2029 9 ай бұрын
Thanks @ankit
@chaitanyanagare757
@chaitanyanagare757 4 ай бұрын
In SCD1 when first insert is completed we emptied the stg table.. How can we do changed to update dim without empty the stg after first insert
@milindzuge906
@milindzuge906 9 ай бұрын
Thank you so much Ankit ❤😊
@ankitbansal6
@ankitbansal6 9 ай бұрын
My pleasure 😊
@srinubathina7191
@srinubathina7191 9 ай бұрын
Thank you Ankit Bro
@typing07
@typing07 6 ай бұрын
@ankit Bhaiya, Instead of doing manual work by query, We can create insert update trigger also, that will be a good automation work. What you say brother.☺
@ankitbansal6
@ankitbansal6 6 ай бұрын
That will be too much load because it will trigger for each row.
@nehashahpatel1741
@nehashahpatel1741 8 ай бұрын
Million Thanks
@anikethdeshpande8336
@anikethdeshpande8336 7 ай бұрын
Hi Ankit, great explanation, how to handle scenario in scd2 type two, when there are insert, update and delete all together in staging for the same record. Assuming we are using cdc to keep track of changes and using cdc info to update the dim tables
@sandeepguptha6440
@sandeepguptha6440 7 ай бұрын
then you need to create one more temp_table while running script by keeping where timestamp in stg_table > max(timestamp) in dim_table to get the only changed records to temp_stg table now data is in temp_table (which has only latest records) dim_table has old records as of now (we did not performed any transformations yet) now follow anikt procedure to keep history track
@chinmayaMuduli-kf3dd
@chinmayaMuduli-kf3dd 9 ай бұрын
Hi Ankit sir will you start any data engineering course ?
@007SAMRATROY
@007SAMRATROY 9 ай бұрын
Can't we use merge to perform the SCD2 implementation?
@ankitbansal6
@ankitbansal6 9 ай бұрын
Performance is not good with merge.
@anudipray4492
@anudipray4492 5 ай бұрын
1ST TABLE IS UPSERT NOT TRANCATE LOAD RIGHT?
@veereshk6065
@veereshk6065 9 ай бұрын
Thank you for creating such quality content. I have a question, is it possible to implement such SCD2 using merge ? (where update and insert are involved to maintain history, same example as described in video). Thanks in advance.
@ankitbansal6
@ankitbansal6 9 ай бұрын
It can be done but merge operation can have performance issues.
@HumansofChn
@HumansofChn 9 ай бұрын
Can't we implement it using Merge statemnet
@techmania979
@techmania979 9 ай бұрын
Can’t we use merge statement instead of using two separate insert and update statements???
@ankitbansal6
@ankitbansal6 9 ай бұрын
Performance not good with merge
@vijiinfo
@vijiinfo 7 ай бұрын
❤❤❤
@vilasshrirame6868
@vilasshrirame6868 2 ай бұрын
ELT and ETL approaches are different in operations
@sowjanyamasna3313
@sowjanyamasna3313 9 ай бұрын
Sir which one is first video I learn to this course I start my career plz help me
@ankitbansal6
@ankitbansal6 9 ай бұрын
kzbin.info/www/bejne/m5vHepqPhcuWjJY
@TheSanket148
@TheSanket148 9 ай бұрын
What if same record comes in staging table,how to handle it?@ankit
@ankitbansal6
@ankitbansal6 9 ай бұрын
That is the case of copy records. We can check if the key and value are the same then ignore them
@prashantmhatre9225
@prashantmhatre9225 6 ай бұрын
Not sure what you have not implemented by using merge statement
@wizard5828
@wizard5828 Ай бұрын
How we can have data till last three change of id … suppose if id 1 iPhone12 40000 Changes to id 1 iphone12 30000 Changes to Id 1 iphone12 25000 Changes to id 1 iphone12 20000 I want in the final table last 3 changes only that means dont want first change that means when prize was 40000 .. this first record will be ignore give me explanation Output data 20k 25k 30k
@nupoornawathey100
@nupoornawathey100 9 ай бұрын
for mysql query is slightly changed: set @updated_date='2024-01-20'; UPDATE product_type1_dim a, product_stg b SET a.price = b.price, a.last_update = @updated_date WHERE a.product_id = b.product_id ;
@abdul-l4j
@abdul-l4j 9 ай бұрын
bro keep the pace slow. You speak too fast
@ankitbansal6
@ankitbansal6 9 ай бұрын
Ok next time. You can reduce speed from settings.
@9940114158
@9940114158 9 ай бұрын
Thank you Ankit
Мясо вегана? 🧐 @Whatthefshow
01:01
История одного вокалиста
Рет қаралды 7 МЛН
Quando eu quero Sushi (sem desperdiçar) 🍣
00:26
Los Wagners
Рет қаралды 15 МЛН
Support each other🤝
00:31
ISSEI / いっせい
Рет қаралды 81 МЛН
SCD: Slowly changing dimensions explained with real examples
25:43
How to Implement SCD Type 2 Using Azure Data Factory: Best Practices
29:02
Data World Solution
Рет қаралды 1,6 М.
All About SQL Aggregations | SQL Advance | Zero to Hero
17:43
Ankit Bansal
Рет қаралды 64 М.
61. Databricks | Pyspark | Delta Lake : Slowly Changing Dimension (SCD Type2)
20:03
Cracked Myntra as Data Analyst with 1 Year Experience
13:56
Ankit Bansal
Рет қаралды 23 М.
Мясо вегана? 🧐 @Whatthefshow
01:01
История одного вокалиста
Рет қаралды 7 МЛН