Example of check constraints - sql, PL-SQL Programming

Example of Check Constraints

Example: Workaround for when subqueries not permitted in CHECK constraints

CREATE FUNCTION NO_MORE_THAN_20000_ENROLMENTS ( )

RETURNS BOOLEAN;

RETURN (SELECT COUNT (*) FROM IS_ENROLLED_ON) <= 20000;

ALTER TABLE IS_ENROLLED_ON

ADD CONSTRAINT MAX_ENROLMENTS

CHECK (NO_MORE_THAN_20000_ENROLMENTS ( ));

Posted Date: 1/18/2013 7:17:46 AM | Location : United States







Related Discussions:- Example of check constraints - sql, Assignment Help, Ask Question on Example of check constraints - sql, Get Answer, Expert's Help, Example of check constraints - sql Discussions

Write discussion on Example of check constraints - sql
Your posts are moderated
Related Questions
Components of an Object Type: An object type encapsulates the operations and data. Therefore, you can declare the methods and attributes in an object type specification, but no

Pl/sql Conditional Control: IF statements Frequently, it is necessary to take the alternative actions depending on the circumstances. The IF statement execute a series of statem

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

Error Handling The PL/SQL makes it easy to detect and process the predefined and user-defined error conditions known as exceptions. Whenever an error occurs, an exception is ra

Difference between 9i & 10G When Oracle releases any new databases then it are having some discrepancy with them. But 10G is having much difference than oracle 9i has. Oracle

I need SQL , WP SQL Expert Project Description: Expert required to modify WP SQL query. Skills required are MySQL, SQL, PHP, Wordpress

Row Counterparts of Table Operators SQL does not have counterparts tuple rename, tuple projection, tuple extension, tuple join and tuple compose. To obtain the same effects as

Important Distinctions The list of important distinctions are given below: Value versus variable Syntax versus semantics Variable versus variable reference

Example of WHEN or THEN Constraints A concrete example showing how SQL supports WHEN/THEN constraints CREATE TABLE SAL_HISTORY (EmpNo CHAR (6), Salary INTEGER NOT NULL,

PITS Depressions in secondary cell wall is called pit. A pit present on the free cell wall surface without its partner is called Blind pit. It consists of 2 parts -