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
EXECUTE Privilege To call an invoker-rights routine straightforwardly, the users should have the EXECUTE privilege on that routine. By yielding the privilege, you permit a user

TYPES OF EVOLUTION - Sequential evolution                  :                    Minor changes in the gene pool of a population from one generation to the next, with the resul

Project Description: I am looking to change FullCalendar to add/delete sql server data when events are removed or dropped from Calendar. Events should only be included by dra

Negation (NOT, ¬) - SQL There are three rows instead of just two. As you can see, ¬ p is defined as in two-valued logic (2VL) when p is either true or false, but ¬ (unknown) i

MAX and MIN operator in SQL Example: (SELECT MAX (Mark) FROM EXAM_MARK WHERE StudentId = 'S1') (SELECT MIN (Mark) FROM EXAM_MARK WHERE StudentId = 'S1') Example

Conditionals - SQL At first sight SQL does not appear to have a single operator for expressing logical implication. In this respect it would be in common with most programming

MECHANISTI S THEORY-HAECKEL (1866) - Haeckel stating that after each catalysm, some new organism suddenly forms as a chance event in one stride from inanimate matter and sub

What Is a Package? The package is a schema object that group logically related PL/SQL items, types, and subprograms. The Packages usually have 2 parts, a specification & a bo

Manipulating Objects: You can use an object type in the CREATE TABLE statement to indicate the datatype of a column. When the table is created once, you can use the SQL statem

Description: Demonstrate your knowledge of PL/SQL programming by writing and thoroughly testing triggers and stored procedures associated with an e-commerce application that pr