Oreilly - T-SQL Data Manipulation: Inserting, Updating, Deleting, and Merging in SQL Server
by John Deardurff | Released May 2019 | ISBN: 9781484249932
This video course teaches how to go beyond writing SELECT statements and to manipulate data within your database tables. You'll begin with an introduction to Data to Data Manipulation Language (DML) that covers the INSERT, UPDATE, and DELETE statements. You'll use these three statements most often, and they are the next most common three to use following the SELECT statement that has been covered earlier in this series. Watching the video, you'll learn how to use these three statements to insert new data into your database to tables, and to update data in place without having to bring it down to the client and push it back and forth network. You'll also learn to delete data when it's no longer needed.Also covered in the video is the MERGE statement. You'll learn how this little used but very useful statement works to make extract, transform, load (ETL) processes much more streamlined. You'll learn to throw large numbers of rows at your database, letting the MERGE statement sort out which rows represent new data to be inserted, and which represent updates to existing data. You'll be able to write cleaner load processes for data warehouses, data marts, and other reporting statements using your knowledge of MERGE.You'll also learn some fast ways to delete data from database tables. In addition to DELETE, you'll learn about DROP and TRUNCATE. These statements provide you with options for quickly deleting data. Each has their best use, and this video helps you to make the correct choices and avoid unwanted downtime in your production database environments. Finally, you'll learn about identity columns and sequences, using them to generate primary keys to uniquely identify new rows of data that you are storing in your database tables. Throughout this video you'll learn the gamut of data manipulation statements that SQL Server places at your disposal, and when each is best applied.What You Will LearnAdd data to your database using INSERT and MERGE statementsUpdate data in place without sending it back and forth over the networkChoose correctly from three possible ways of removing unwanted dataStreamline ETL process used to load data marts and data warehousesAutomatically generate primary keys to uniquely identify new recordsWho This Video Is ForFor business analysts, developers, and others whose career will benefit from a knowledge of the SQL language for accessing Microsoft SQL Server databases and manipulating the data they contain. Show and hide more
- Introduction 00:01:37
- What is Data Manipulation Language (DML) 00:02:24
- INSERT Records into a Table 00:04:56
- INSERT Records into an IDENITY field 00:04:56
- INSERT Records using Sequence Objects 00:02:52
- INSERT Records from Existing Tables 00:03:18
- UPDATE Records in a Table 00:03:39
- DELETE Records in a Table 00:02:35
- DELETE vs DROP vs TRUNCATE 00:03:05
- Using the Output Clause 00:03:19
- MERGE Records between Tables 00:07:09
- DML Wrap-Up 00:01:33
Show and hide more