Overview

Introduction

The Modifying Data module provides you with the instructions and devices to develop your hands-on skills in the following topics.

  • Inserting new records in the table
  • Updating and deleting records from the table
  • Using OUTPUT clause with INSERT and DELETE statements

Lab time: It will take approximately 30 minutes to complete this lab.

Exam Objectives

The following exam objectives are covered in this lab:

  • Demonstrate how to insert new data into tables
  • Demonstrate how to update and delete existing records in tables
  • Demonstrate the use of OUTPUT clause with a simple INSERT and DELETE statements

Exercise 1 - Inserting New Records in the Table

You can use INSERT INTO statement to insert new records in the table. You can insert single or multiple records at a time into the table.

To insert one record at a time, you need to provide the list of fields in the INSERT INTO statement followed by the actual values for the field. To insert values into the field, you can use the VALUE clause with the INSERT INTO statement.

Exercise 2 - Updating and Deleting Data from the Table

The UPDATE statement updates the data in the table. You can update one or more records at a time, depending on the condition in WHERE clause.

Exercise 3 - Using OUTPUT Clause with INSERT and DELETE Statements

You can use the OUTPUT clause with INSERT and DELETE statements. The OUTPUT clause returns rows affected by the INSERT or DELETE statements in a table. The copy of the data returned by the OUTPUT clause can be stored in a table or table variable.

Comprehensive Learning

See the full benefits of our immersive learning experience with interactive courses and guided career paths.