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
CURRVAL and NEXTVAL The series is a schema object which generates the sequential numbers. Whenever you form a sequence, you can specify its primary value and an increment. T

I need SQL Data Base Project Description: Network SQL database and SQL Setup two 4 workstation Skills required are Data Entry, MySQL, SQL

Using Pragma RESTRICT_REFERENCES: The function called from the SQL statements should obey certain rules meant to control the side effects. To check for violation of the rules,

Deleting Objects You can use the DELETE statement to eradicate objects from an object table. To eradicate objects selectively, you use the WHERE clause, as shown below: BEG

ROWNUM The ROWNUM returns a number representing the order in which a row was selected from the table. The first row selected has a ROWNUM of 1; the second row has a ROWNUM of

THEO R Y OF ETERNITY OF LIFE (PRAYER - 1880) - The theory of eternity of life, also called the steady-state theory , states that life has ever been in existence as at presen

Autonomous versus Nested Transactions Though an autonomous transaction is started by the other transaction, it is not a nested transaction for the reasons shown below: (i)

Rollback Behavior When a FORALL statement fails, the database changes are rolled back to an implicit savepoint marked before each of the SQL statement execution. The Changes t

Example of WRAP Operator - SQL The effect of Example can be obtained in SQL but note that one needs to write down not only the names of the columns being wrapped but also the

Definition of CROSS JOIN - SQL Let s = t1 CROSS JOIN t2, where t1 and t2 are table expressions optionally accompanied by range variables. Then: Note: Here T denotes Table