GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Interview Questions  >  Oracle  >  SQL
Go To First  |  Previous Question  |  Next Question 
 SQL  |  Question 2 of 171    Print  
What are various constraints used in SQL?
  • NULL
  • NOT NULL
  • CHECK
  • DEFAULT



  
Total Answers and Comments: 8 Last Update: November 06, 2009   
  
 Sponsored Links

 
 Best Rated Answer
Submitted by: Durga Prasad
 

UNIQUE

PRIMARY KEY/FOREIGN KEY

REFERENTIAL INTEGRITY

NULL

NOT NULL

CHECK

DEFAULT



Above answer was rated as good by the following members:
kishorebabu.yenumula, kperumal75
August 24, 2005 22:30:14   #1  
pallavi        

RE: What are various constraints used in SQL?
There are five classes of constraints:

NOT NULL. Specifies that a column does not accept nulls.
PRIMARY KEY. Specifies the column or columns whose values uniquely identify a row in a table. Primary key columns are automatically NOT NULL.
UNIQUE. Specifies that a column has all unique values.
CHECK. Limits the domain of acceptable values for a column.

FOREIGN KEY. Aka a DRI constraint (Declarative Relational Integrity). Identifies relationships between tables. A foreign key in a table points to a candidate key (usu. a primary key) in another table. A table can have up to 253 FOREIGN KEY contraints

 
Is this answer useful? Yes | NoAnswer is useful 1   Answer is not useful 0Overall Rating: +1    
September 07, 2005 02:37:14   #2  
Jo        

RE: What are various constraints used in SQL?
NOT NULL is a check constraint
 
Is this answer useful? Yes | No
September 14, 2005 08:47:42   #3  
Durga Prasad        

RE: What are various constraints used in SQL?

UNIQUE

PRIMARY KEY/FOREIGN KEY

REFERENTIAL INTEGRITY

NULL

NOT NULL

CHECK

DEFAULT


 
Is this answer useful? Yes | NoAnswer is useful 2   Answer is not useful 0Overall Rating: +2    
September 30, 2005 07:18:48   #4  
V. Ramalingam        

RE: What are various constraints used in SQL?
Primary Constraint
 
Is this answer useful? Yes | No
October 04, 2005 01:19:21   #5  
anil        

RE: What are various constraints used in SQL?
Primary constraints foreign constrains not null constraint
 
Is this answer useful? Yes | No
October 15, 2005 04:32:02   #6  
annathurai        

RE: What are various constraints used in SQL?

constraints

there are two type of constraints

1) table level

2)column level

integrity constraints

primary key

foreign key

not null

check

default

unique


 
Is this answer useful? Yes | NoAnswer is useful 3   Answer is not useful 0Overall Rating: +3    
October 31, 2006 07:06:23   #7  
Suresh        

RE: What are various constraints used in SQL?

Primary Key

Foreign Key

Unique

Not Null

Check

Two types of constraints -Table level and Column level.

Except Not null all others can be defined as Both table and column level. But Not null as only column level.


 
Is this answer useful? Yes | NoAnswer is useful 2   Answer is not useful 0Overall Rating: +2    
November 06, 2009 10:11:10   #8  
orasuman9 Member Since: March 2009   Contribution: 1    

RE: What are various constraints used in SQL?
The Constraints are
Primary
Unique
Check
Null

 
Is this answer useful? Yes | No


 
Go To Top


 Sponsored Links

 
About Us -  Privacy Policy -  Terms and Conditions -  Contact -  Ask Question -  Propose Category -  Site Updates 

Copyright © 2005 - 2009 GeekInterview.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape