1 Replies - 887 Views - Last Post: 13 October 2014 - 10:58 AM

#1 rnty  Icon User is offline

  • D.I.C Regular

Reputation: 19
  • View blog
  • Posts: 267
  • Joined: 14-August 12

Table and column level definition of constraints

Posted 12 October 2014 - 11:26 AM

Hi there

I wanted to understand all the cases which come under column level and table level definition of constraints.

Here I am taking the UNIQUE constraint

column level:
create table Student(s_id int UNIQUE, name varchar(10),age int);

table level:
alter table Student add UNIQUE(s_id);

My question is
Is there any other scenario which qualifies as column level and/or table level definition of constraint.

Thanks in advance

This post has been edited by rnty: 12 October 2014 - 11:27 AM


Is This A Good Question/Topic? 0
  • +

Replies To: Table and column level definition of constraints

#2 rnty  Icon User is offline

  • D.I.C Regular

Reputation: 19
  • View blog
  • Posts: 267
  • Joined: 14-August 12

Re: Table and column level definition of constraints

Posted 13 October 2014 - 10:58 AM

Got the answer to this question.
For all the people who might get directed to this link

The below link gives all the possible ways to define column and table level constraints
http://www.dbanotes....1g-constraints/

Another method to define a constraint(except NOT NULL because it is a column level only constraint) at table level is by using the ALTER table command.

Cheers

This post has been edited by rnty: 13 October 2014 - 10:58 AM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1