Constraint and Index

What is difference between constraint and index? How do use them in SQL query?

Questions by newqtp   answers by newqtp

Showing Answers 1 - 9 of 9 Answers

sandeepmesa

  • Jan 18th, 2008
 

constraint is of some condition giving to particular column ex: primary key,foriegn key
where as index is used for referencial purpose when u have large number of rows to get ecaxt of them u create some indexses .

  Was this answer useful?  Yes

Constraints are rules applied to Table/Columns of a table. Constraints are one type of restriction which are useful while data is manipulated.

Index are ordered list of rows of tables. Index are useful while faster retrival of data.

Hope this anwsers to your question.

Cheers,
Srini.

Constraint  is  used to restrict invalid and inconsistent data entry  into the table.
Index is used  for faster retrieval of data.

Both are entirely different concepts.


  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions