Create and modify constraints

Practice Labs Module
Time
40 minutes
Difficulty
Intermediate

The "Create and Modify Constraints" module provides you with the instruction and server hardware to develop your hands on skills in the defined topics. This module includes the following exercises: Working with Constraints, Adding DEFAULT Definitions.

Join over 3 million cybersecurity professionals advancing their career
Sign up with
or

Already have an account? Sign In »

Overview

Introduction

The Create and Modify Constraints module provides you with the instruction and server hardware to develop your hands on skills in the defined topics. This module includes the following exercises:

  • Working with Constraints
  • Adding DEFAULT Definitions

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

Exercise 1 - Working with Constraints

In this exercise, you will learn the following:

  • Adding Primary Key constraint
  • Adding Foreign Key constraint
  • Adding Unique constraint
  • Adding Default definition
  • Deleting constraints

Exercise 2 - Adding DEFAULT Definitions

DEFAULT Definitions are used to specify a default value for a column. In case, when inserting data in the table, no data has been specified for the column that has an associated DEFAULT definition, the Database Engine will add the specified default value instead of a null value into the column. DEFAULT definitions can be added when creating a new table or to an existing table. When creating a DEFAULT definition, remember that the default value specified should match with the data type of the column to which the definition is applied.

Learning Partner
Comprehensive Learning

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