Overview

Introduction

Welcome to the Modify Data Practice Lab. In this module, you will be provided with the instructions and devices needed to develop your hands-on skills.

Learning Outcomes

In this module, you will complete the following exercises:

  • Exercise 1. Modifying Data using INSERT, UPDATE, and DELETE Statements
  • Exercise 2. Performing Update Operations on Tables using T-SQL Statements
  • Exercise 3. Performing Delete Operations on Tables using T-SQL Statements

After completing this lab, you will be able to:

  • Use the INSERT statement
  • Modify a table using UPDATE
  • Modify a table using DELETE

Exam Objectives

The following exam objective is covered in this lab:

  • 5.3 Summarize methods used to interface with databases.

Lab Duration

It will take approximately 30 minutes to complete this lab.

Exercise 1 - Modifying Data using INSERT, UPDATE, and DELETE Statements

The INSERT statement is used to insert data into a table or a view. To insert data into a table, you need to specify the table into which the data is to be inserted and the values that are to be inserted. You can insert data into all the columns in the table or to specific columns. When you insert data into specific columns, the Database Engine inserts a NULL value or the default value, if specified, in the columns for which you have not specified any values.

Learning Outcomes

After completing this exercise, you will be able to:

  • Use the Insert statement

Exercise 2 - Performing Update Operations on Tables using T-SQL Statements

The UPDATE statement is used to change data in a column (or multiple columns) in a table or a view. A simple Update statement will contain the Update, Set, and Where clauses. The Update clause specifies the tables that are to be updated. The Set clause specifies the columns to be updated. The Set clause also specifies the value to be updated. You can specify the value directly or use an expression to specify the value. You can also use the Default keyword to assign the default value to a column

Learning Outcomes

After completing this exercise, you will be able to:

  • Modify a table using UPDATE

Exercise 3 - Performing Delete Operations on Tables using T-SQL Statements

The DELETE statement is used to delete one or two rows from a table or a view. To delete all the rows in a table, use the Delete statement followed by the name of the table. You can also use the From clause, which is optional, before the name of the table. If you want to delete specific rows from the table, you can use the Where clause to specify the condition that the rows should meet to be deleted. You can also use joins in the From or Where clause of the Delete statement

Learning Outcomes

After completing this exercise, you will be able to:

  • Modify a table using DELETE

Comprehensive Learning

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