bing
Flat 10% & upto 50% off + Free additional Courses. Hurry up!

Constraints

 

Constraints are the rules applied on data columns on table. These are used to bound the type of data that can go into a table. This ensures the accuracy and consistency of the data. If there is any violation between the constraint and the data action, the action is aborted by the constraint

Constraints can be specified when the table is created or after the table is created.

Constraints could be column level or table level. Column level constraints are applied only to one column, whereas table level constraints are applied to the whole table.

The commonly used constraints are:

  • Not NULL
  • UNIQUE
  • PRIMARY KEY
  • FOREIGN KEY
  • CHECK
  • DEFAULT

 

  1. Not NULL:

It indicates that the column cannot have null value.

  1. UNIQUE:

It ensures that all the values in the column are unique.

  1. PRIMARY KEY:

It is a key which helps you to find the data from the table. It must be unique and not null.

  1. FOREGIN KEY

A foreign key is a field in a relational table that matches the primary key column of another table.

     5. CHECK

It checks whether all values meets the specific condition or not.

  1. DEFAULT

It provides the default value when the value is not specified.

Syntax:

CREATE TABLE table_name

(

Column1 datatype (size) constraint_name,

Column2 datatype (size) constraint_name,

Column3 datatype (size) constraint_name,

……….

);

"0 Responses on Constraints"

Training in Cities

Bangalore, Hyderabad, Chennai, Delhi, Kolkata, UK, London, Chicago, San Francisco, Dallas, Washington, New York, Orlando, Boston

100% Secure Payments. All major credit & debit cards accepted Or Pay by Paypal.

top

Sales Offer

  • To avail this offer, enroll before 05th December 2016.
  • This offer cannot be combined with any other offer.
  • This offer is valid on selected courses only.
  • Please use coupon codes mentioned below to avail the offer
offer-june

Sign Up or Login to view the Free Constraints.