SQL Merge Statement Tutorial A-Z | How to use Merge in SQL step by step

  Рет қаралды 10,442

Ankit Bansal

Ankit Bansal

3 ай бұрын

In this video we will understand the SQL merge statement. Using merge statement we can insert , update and delete data in a single statement.
script:
CREATE TABLE SourceProducts(
ProductID INT,
ProductName VARCHAR(50),
Price DECIMAL(9,2)
);
CREATE TABLE TargetProducts(
ProductID INT,
ProductName VARCHAR(50),
Price DECIMAL(9,2)
);
delete from SourceProducts;
INSERT INTO SourceProducts VALUES(1,'Table',90),(3,'Chair',70)
delete from TargetProducts;
INSERT INTO TargetProducts VALUES(1,'Table',100),(2,'Desk',180)
Zero to hero(Advance) SQL Aggregation:
• All About SQL Aggregat...
Most Asked Join Based Interview Question:
• Most Asked SQL JOIN ba...
Solving 4 Trick SQL problems:
• Solving 4 Tricky SQL P...
Data Analyst Spotify Case Study:
• Data Analyst Spotify C...
Top 10 SQL interview Questions:
• Top 10 SQL interview Q...
Interview Question based on FULL OUTER JOIN:
• SQL Interview Question...
Playlist to master SQL :
• Complex SQL Questions ...
Rank, Dense_Rank and Row_Number:
• RANK, DENSE_RANK, ROW_...
#sql #merge

Пікірлер: 20
@sakshijain3534
@sakshijain3534 2 ай бұрын
This was asked to me in a recent interview, Thanks for clearing the concept.
@ankitbansal6
@ankitbansal6 2 ай бұрын
Excellent!
@pranaykukadkar7092
@pranaykukadkar7092 2 ай бұрын
yrrr you are a gem the kind of explanation you give😀
@dasoumya
@dasoumya 3 ай бұрын
Learnt something new today thank you Ankit for making these kind of videos 🙏🏻
@ayushmi77al
@ayushmi77al 3 ай бұрын
Totally new concept for me, thanks for sharing
@ravisaxena1599
@ravisaxena1599 3 ай бұрын
Nice 😊
@AhmedDayyan-ub8in
@AhmedDayyan-ub8in Ай бұрын
This is really helpful thank you
@snehakulkarni1870
@snehakulkarni1870 3 ай бұрын
I learned something new today. Thank you so much for sharing such insightful content.😊
@ankitbansal6
@ankitbansal6 3 ай бұрын
Glad it was helpful!🙏
@milindzuge906
@milindzuge906 3 ай бұрын
Thank you so much Ankit for such a beautiful content ❤❤
@ankitbansal6
@ankitbansal6 3 ай бұрын
Thank you so much 😀
@ppenumarti
@ppenumarti 3 ай бұрын
Thanks!
@ankitbansal6
@ankitbansal6 3 ай бұрын
Thank you 😊
@AAMIRKHAN1602
@AAMIRKHAN1602 Ай бұрын
Thanks for this but merge into can handle many other scenarios and it can get tricky
@Apna_tahlka_123
@Apna_tahlka_123 3 ай бұрын
Only if i learn sql can we got job reply jrur dena plj or plj video me thoda hindi me bhi smjhaya kro taki easily smjh aajae thanks i hope u reply soon
@sureshraina321
@sureshraina321 2 ай бұрын
can't we do something like this trunacte table target_table_name; insert into target_table select * from source_table; if we want to have all 3 features together. Seems weird but still asking
@aryabhatt5833
@aryabhatt5833 2 ай бұрын
Right. But, I think when we are dealing with tables having millions of records and only a hundreds need insert, update or delete, then merge makes more sense.
@thotakurapavanika7417
@thotakurapavanika7417 3 ай бұрын
Very helpful. Whats the realtime application of this statement?
@ankitbansal6
@ankitbansal6 3 ай бұрын
For implementing scd type 1, 2 and 3
@vijaypalmanit
@vijaypalmanit 3 ай бұрын
Very common in loading data while performing ETL
Мы никогда не были так напуганы!
00:15
Аришнев
Рет қаралды 6 МЛН
Did you believe it was real? #tiktok
00:25
Анастасия Тарасова
Рет қаралды 56 МЛН
Дарю Самокат Скейтеру !
00:42
Vlad Samokatchik
Рет қаралды 7 МЛН
Incredible magic 🤯✨
00:53
America's Got Talent
Рет қаралды 77 МЛН
SQL - Merge
10:35
James Oliver
Рет қаралды 34 М.
SQL Interview questions | Data Analyst | Part - 1
11:56
The ML Mine
Рет қаралды 3,7 М.
Advanced SQL Tutorial | Temp Tables
10:19
Alex The Analyst
Рет қаралды 247 М.
SQL Merge Statement in Hindi
11:35
Lotusamaze
Рет қаралды 17 М.
58 Merge Statement in SQL Server
11:14
Learn SSIS
Рет қаралды 3,9 М.
Мы никогда не были так напуганы!
00:15
Аришнев
Рет қаралды 6 МЛН