Skip to main content

Posts

Showing posts from July, 2009

Database Knowledge for a Tester Part III

1. CONSTRAINT CONCEPTS 1.1. Data Constraints Business Rules, which are enforced on data being stored in a table, are called Constraints. It super control the data being entered into a table for permanent storage. If constrains fails during insertion or updation of records, then entire record will be rejected and Insert or Update operation failed. There are 2 types of data constraints which can be further classified as described in below sections. Input/Output Constraints The Primary Key Constraint The Foreign Key Constraint The Unique Key Constraint Business Rule Constraints CHECK Constraints 1.2. Input/Output Data Constraints 1.2.1. Primary Key Constraint Primary Key Constraint defined at Column Level Normally used, to define a single primary key in a table. SYNTAX: [COLUMN NAME] [DATATYPE] ([SIZE]) PRIMARY KEY E.g. CREATE TABLE employee (employee_no varchar2 (10) PRIMARY KEY, employee_name varchar2 (25)); Primary Key Con