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

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

Most Asked Join Based Interview Question:

Solving 4 Trick SQL problems:

Data Analyst Spotify Case Study:

Top 10 SQL interview Questions:

Interview Question based on FULL OUTER JOIN:

Playlist to master SQL :

Rank, Dense_Rank and Row_Number:

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

This was asked to me in a recent interview, Thanks for clearing the concept.

sakshijain
Автор

yrrr you are a gem the kind of explanation you give😀

pranaykukadkar
Автор

Thank you so much Brother for the Kind Explanation..

FazalAnsari-juzs
Автор

Learnt something new today thank you Ankit for making these kind of videos 🙏🏻

dasoumya
Автор

I learned something new today. Thank you so much for sharing such insightful content.😊

snehakulkarni
Автор

Totally new concept for me, thanks for sharing

ayushmial
Автор

Thank you so much Ankit for such a beautiful content ❤❤

milindzuge
Автор

Very helpful. Whats the realtime application of this statement?

thotakurapavanika
Автор

Thanks for this but merge into can handle many other scenarios and it can get tricky

AAMIRKHAN
Автор

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

Apna_tahlka_
Автор

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

sureshraina