Subhash Sharma

Subhash Sharma
Subhash Sharma

This is Subhash Sharma(Software Engineer) Blog

Welcome to this blog and find every solution.............

Search This Blog

Software Engineer(Subhash Sharma)

Software Engineer(Subhash Sharma)
Software Engineer

Friday, March 26, 2010

What are constraints? Explain different types of constraints

...Constraints enable the RDBMS enforce the integrity of the database automatically, without needing you to create triggers, rule or defaults. Types of constraints: NOT NULL, CHECK, UNIQUE, PRIMARY KEY, FOREIGN KEY.

2 comments:

  1. There are 6 types of Constrains:
    NOT NULL
    CHECK
    UNIQUE
    PRIMARY KEY
    FOREIGN KEY
    DEFAULT = The DEFAULT constraint provides a default value to a column when the INSERT INTO statement does not provide a specific value. For example, if we create a table as below:

    CREATE TABLE Student
    (
    Student_ID int,
    Last_Name varchar (30),
    First_Name varchar (30),
    Score DEFAULT 80
    )

    Regards,
    Lata Negi

    ReplyDelete
  2. CREATE TABLE Student
    (
    Student_ID int,
    Last_Name varchar (30),
    First_Name varchar (30),
    Score int DEFAULT 80
    )

    give the data type of score field......

    insert into student(student_id,last_name,first_name) values(1,'sdf','sdfsd')

    write this query and solve the problem ...

    Thanks and Regards
    Subhash Sharma

    ReplyDelete