RUVIDEO
Поделитесь видео 🙏

Updating Tables Using SELECT - (JOINS, Merge, Sub Query) - SQL Beginner Tutorial

Here I show you 4 ways to Update Tables From Another Table in SQL Server. We use Sub Queries, Select Statements, JOINS and what I call the 'popular method' (you see it all over forums)

Gathering The Data

In this part of the video I run through what data we are going to update and which tables we are using. We need to alter the foreign key constraint at first in order to do the lesson so I show you how to do that here. I also query the source and target table to show which table we are going to update

We use the AdventureWorks2019 database which is a free download from Microsoft (or you can watch my tutorial on setting it up).

Select and Update in One Query

My personal favourite method for quick easy updates. This suits smaller updates and rather that use the IN Operator we reference the values that we need to update and is the perfect example of having select and update in one query. Its a nice beginner method if you are learning SQL Server

Update Using Merge

This is slightly tougher, only because a Merge Statement isn't as easy to write as a sub query, but when checking the execution plan it can be far more efficient in this case so for bigger update statements it's well worth considering especially if you intend on running this query on a regular basis, maybe via SQL Agent

Update With a JOIN

Often a popular question, I guess because we use JOINS so often when querying SQL Server that we want to know up to update the table we have just joined! Here I show you a way to turn your JOIN query into an update. A very basic thing which you will find helpful.

The Popular Method

This is always a suggestion on forums and blogs so I had to include it. Personally it isn't my favourite but it's personal preference. Let me know what you think

Content

00:00 Intro
00:49 Gathering the data
02:30 Update Using a Sub Query
04:02 Update Using Merge
05:05 Update With a Join
06:04 The popular method
07:17 Lesson Summary

Что делает видео по-настоящему запоминающимся? Наверное, та самая атмосфера, которая заставляет забыть о времени. Когда вы заходите на RUVIDEO, чтобы посмотреть онлайн «Updating Tables Using SELECT - (JOINS, Merge, Sub Query) - SQL Beginner Tutorial», вы рассчитываете на нечто большее, чем просто загрузку плеера. И мы это понимаем. Контент такого уровня заслуживает того, чтобы его смотрели в HD 1080, без дрожания картинки и бесконечного буферизации.

Честно говоря, Rutube сегодня — это кладезь уникальных находок, которые часто теряются в общем шуме. Мы же вытаскиваем на поверхность самое интересное. Будь то динамичный экшн, глубокий разбор темы от любимого автора или просто уютное видео для настроения — всё это доступно здесь бесплатно и без лишних формальностей. Никаких «заполните анкету, чтобы продолжить». Только вы, ваш экран и качественный поток.

Если вас зацепило это видео, не забудьте взглянуть на похожие материалы в блоке справа. Мы откалибровали наши алгоритмы так, чтобы они подбирали контент не просто «по тегам», а по настроению и смыслу. Ведь в конечном итоге, онлайн-кинотеатр — это не склад файлов, а место, где каждый вечер можно найти свою историю. Приятного вам отдыха на RUVIDEO!

Видео взято из открытых источников Rutube. Если вы правообладатель, обратитесь к первоисточнику.