SQL Server: Default Constraint

Level : Beginner
Mentor: Shailendra Chauhan
Type : GuidedLab
Points : 10
Duration : 00:15:00

Lab Details

Description

A DEFAULT constraint specifies a default column value if no value is specified. The default value also applies to UPDATEs when no value exists or is specified. This constraint only applies if no value is specified. Any other value is acceptable.

In this lab, you will learn how to add a DEFAULT Constraint to a table in SQL Server.


Based on this Customer and Supplier Schema, generate the solutions to the respective queries listed below:

  1. Create a customer table and set a default value for Country as ‘UK’.
  2. Add a Default Constraint to the ‘City’ Column in an existing Customer table.

Lab Objective

Upon completion of this lab, you will be able to:

  • Gain Hands-On Experience on SQL Server DEFAULT Constraint.

Prerequisites

  • You should have a conceptual understanding of Constraints.
  • You must have SQL Server Installed on your systems.


Self-paced Membership
  • 22+ Video Courses
  • 800+ Hands-On Labs
  • 400+ Quick Notes
  • 55+ Skill Tests
  • 45+ Interview Q&A Courses
  • 10+ Real-world Projects
  • Career Coaching Sessions
  • Email Support
Upto 60% OFF
Know More
Still have some questions? Let's discuss.
CONTACT US
Accept cookies & close this