When or then key constraints, PL-SQL Programming

WHEN or THEN Key Constraints

Suppose a table has two columns representing a period of time throughout which the information conveyed by the other columns is recorded as having been the case. A salary history table for employees, with columns From and To for dates defining the applicable time periods, would be a good example.

A constraint is needed to avoid the possibility of an employee being shown as having two different salaries on the same day, which could happen if two rows for the same employee have overlapping periods indicated by their From and To dates. The term "WHEN/THEN constraint" appeals to the notion of "unpacking" the table so that each row is replaced by one or more rows, one for each date contained in its from-to period: when the relation is unpacked, then the given key constraint (e.g., on employee number and date) is to hold.

Posted Date: 1/18/2013 11:34:02 PM | Location : United States







Related Discussions:- When or then key constraints, Assignment Help, Ask Question on When or then key constraints, Get Answer, Expert's Help, When or then key constraints Discussions

Write discussion on When or then key constraints
Your posts are moderated
Related Questions
The Package Specification The package specifications contain the public declarations. The scopes of these declarations are local to your database representation and global to t

Variable Declaration - SQL SQL's support for variables is very similar to Tutorial D's, except that the syntax for creating persistent  variables-base tables-is quite differen

Problem: (a) Define the following terms: (i) data mining. (ii) OLAP. (b) Differentiate between snowflake schema and star schema. Support your answer with appropriate

Question 1 . Compare SQL and PL/SQL Question 2 . Write a database trigger to implement the following check condition                          Given the following table

Use of Table Expressions - Expressing Constraint Conditions With the exception of key constraints, the examples in the theory book all explicitly reference at least one relvar

Object Type: The object type is a user-defined composite datatype which encapsulates a data structure along with the functions and procedures required to manipulate the data

UNION without CORRESPONDING - SQL The use of UNION without CORRESPONDING. Example is merely by omitting CORRESPONDING, but only because the operands have identical SELECT clau

DBMS: The answer to this question is of course given in of the theory book. This book is concerned with SQL DBMSs and SQL databases in particular. Soon we will be looking a

Blocks: The fundamental program unit in the PL/SQL is the block. The PL/SQL block is defined by the keywords BEGIN, DECLARE, EXCEPTION, and END. These keywords partition the b

which operation is used if we are interested in only certain columns of a table?