Thought Sharing

Wednesday, December 5, 2012

Database Constraints


Database Constraints


Constraints are the rules which are applied to a table to filter out data during insert or update operations. Constraints can be added at the time of creating a table or altering a table. Constraints are the conditions which should be satisfied by insert or update query. There are 2 types of constraints:
1)      Input output (I/O) constraints:
a.       These are of following types:
                                                               i.      Primary Key
                                                             ii.      Foreign Key
                                                            iii.      Unique Key
2)      Check (Business Rules) constraints:
a.       These are defined at 2 levels
                                                               i.      Table Level
                                                             ii.      Column Level