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
Anatomy of a Command Figure, showing a simple SQL command, is almost identical to its counterpart in the theory book. The only difference arises from the fact that SQL uses a

Read-Only Operator (+) - SQL The term read-only operator to the mathematical term function. Here I just need to add that the SQL standard reserves the term function for read-

Example of UNWRAP Operator - SQL Example here shows how unwrapping can be done in longhand in SQL. Example: Unwrapping in SQL Letting CONTACT_INFO_WRAPPED denote the res

Application to Export Excel Data to MSSQL Server table I am having a table available in excel format and features the subsequent: - Some text is in Arabic (e.g. UTF-8 encodin

Structure of an Object Type: Similar to package, an object type has 2 parts: the specification and the body. The specification is the interface to your applications; it declar

Example of Table Literal - SQL Example: A Table Literal (correct version) VALUES ('S1', 'C1', 'Anne'), ('S1', 'C2', 'Anne'), ('S2', 'C1', 'Boris'), ('S3', 'C3'

Relational Operators The relational operators permit you to compare randomly complex expressions. The list below provides the meaning of each operator:

How do I display usernames for students from a student table, assigning each student a username initials001 (initials is the actual student initials), and if the students initials

Short-Circuit Evaluation When computing a logical expression, the PL/SQL uses short-circuit evaluation. That is, the PL/SQL stops computing the expression as soon as the result

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