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
Ещё видео!