Популярное

Музыка Кино и Анимация Автомобили Животные Спорт Путешествия Игры Юмор

Интересные видео

2025 Сериалы Трейлеры Новости Как сделать Видеоуроки Diy своими руками

Топ запросов

смотреть а4 schoolboy runaway турецкий сериал смотреть мультфильмы эдисон
dTub
Скачать

SQL Tutorial - How to update data using joins in SQL

Автор: BeardedDev

Загружено: 2022-08-18

Просмотров: 5926

Описание:

Learn how to update data using joins in SQL and much more, in this video we will cover how to perform updates using joins in SQL, how to update multiple columns at the same time, how to update data using CTEs and how to update data within a transaction, we will also cover what sanity checks need to carried when out when performing updates.

#beardeddev #sql #data #dataengineering #dataanalysis

To follow along with the video you can use the code below:
IF OBJECT_ID(N'dbo.Product', N'U') IS NOT NULL
DROP TABLE dbo.Product;

CREATE TABLE dbo.Product
(
ProductKey INT IDENTITY(1, 1) NOT NULL
CONSTRAINT PK_Product_ProductKey PRIMARY KEY (ProductKey),
Code CHAR(8) NOT NULL
CONSTRAINT UN_Product_Code UNIQUE (Code),
[Name] VARCHAR(50) NOT NULL,
Category VARCHAR(50) NOT NULL,
Price DECIMAL(6, 2) NOT NULL,
CreatedDate DATETIME2 NOT NULL
CONSTRAINT DF_Product_CreatedDate DEFAULT (CURRENT_TIMESTAMP),
ModifiedDate DATETIME2 NOT NULL
CONSTRAINT DF_Product_ModifiedDate DEFAULT (CURRENT_TIMESTAMP)
);

INSERT INTO dbo.Product (Code, [Name], Category, Price)
VALUES
('CMP76460', 'Laptop', 'Computing', 399.99),
('CMP73900', 'Monitor', 'Computing', 189.99),
('CMP68194', 'PC', 'Computing', 749.99),
('APP16830', 'Washing Machine', 'Appliances', 519.99),
('APP14936', 'Refridgerator', 'Appliances', 329.99),
('APP19364', 'Cooker', 'Appliances', 689.99),
('TVA50385', 'Television', 'TV & Audio', 179.99),
('TVA50275', 'Projector', 'TV & Audio', 249.99);

IF OBJECT_ID(N'dbo.ProductStaging', N'U') IS NOT NULL
DROP TABLE dbo.ProductStaging;

CREATE TABLE dbo.ProductStaging
(
Code CHAR(8) NOT NULL,
[Name] VARCHAR(50) NOT NULL,
Category VARCHAR(50) NOT NULL,
Price DECIMAL(6, 2) NOT NULL
);

INSERT INTO dbo.ProductStaging (Code, [Name], Category, Price)
VALUES
('CMP76460', 'Laptop', 'Computing', 479.99),
('CMP73900', 'Monitor', 'Computing', 209.99),
('CMP68194', 'PC', 'Computing', 749.99),
('APP16830', 'Washing Machine', 'Appliances', 519.99),
('APP14936', 'Refridgerator', 'Appliances', 349.99),
('APP19364', 'Cooker', 'Appliances', 689.99),
('TVA50385', 'Television', 'TV & Audio', 199.99),
('TVA50275', 'Projector', 'TV & Audio', 249.99);

SQL Tutorial - How to update data using joins in SQL

Поделиться в:

Доступные форматы для скачивания:

Скачать видео mp4

  • Информация по загрузке:

Скачать аудио mp3

Похожие видео

SQL Tutorial - How to change data in a View

SQL Tutorial - How to change data in a View

Вся база SQL для начинающих за 1 час

Вся база SQL для начинающих за 1 час

Master SQL UPDATE Statement | SQL UPDATE A-Z Tutorial | SQL Update with JOIN

Master SQL UPDATE Statement | SQL UPDATE A-Z Tutorial | SQL Update with JOIN

SQL Tutorial - Difference between CTEs and Derived Tables

SQL Tutorial - Difference between CTEs and Derived Tables

SQL Server Profiler in ONE Hour

SQL Server Profiler in ONE Hour

T-SQL Tutorial - Aggregate Window Functions Performance

T-SQL Tutorial - Aggregate Window Functions Performance

7 простых приемов, которые мгновенно улучшат ваши SQL-запросы

7 простых приемов, которые мгновенно улучшат ваши SQL-запросы

SQL TUTORIAL - How to create a Stored Procedure

SQL TUTORIAL - How to create a Stored Procedure

6 SQL-соединений, которые вы ОБЯЗАТЕЛЬНО должны знать! (Анимация + Практика)

6 SQL-соединений, которые вы ОБЯЗАТЕЛЬНО должны знать! (Анимация + Практика)

#13 | Micro Partitions & Data Clustering In Snowflake  | Snowflake Hands-on Tutorial

#13 | Micro Partitions & Data Clustering In Snowflake | Snowflake Hands-on Tutorial

SQL Tutorial - How to use NTILE in SQL Server

SQL Tutorial - How to use NTILE in SQL Server

SQL Tutorial - How to create a Dynamic Pivot in SQL Part 1

SQL Tutorial - How to create a Dynamic Pivot in SQL Part 1

SQL Tutorial - How to compare multiple columns in SQL

SQL Tutorial - How to compare multiple columns in SQL

SQL Basics - Querying (learn how to write queries in 30 minutes)

SQL Basics - Querying (learn how to write queries in 30 minutes)

SQL Stored Procedures - What They Are, Best Practices, Security, and More...

SQL Stored Procedures - What They Are, Best Practices, Security, and More...

SQL Tutorial - EXISTS

SQL Tutorial - EXISTS

T-SQL Tutorial - PIVOTing Made Easy

T-SQL Tutorial - PIVOTing Made Easy

SQL Server Insert, Delete and Update Triggers

SQL Server Insert, Delete and Update Triggers

Проверьте свои навыки SQL с помощью этих реальных вопросов для собеседования!

Проверьте свои навыки SQL с помощью этих реальных вопросов для собеседования!

Инкрементная загрузка данных SQL | 3 способа выполнить Upsert | Update else Insert | EXISTS | ROW...

Инкрементная загрузка данных SQL | 3 способа выполнить Upsert | Update else Insert | EXISTS | ROW...

© 2025 dtub. Все права защищены.



  • Контакты
  • О нас
  • Политика конфиденциальности



Контакты для правообладателей: infodtube@gmail.com