Example of alternative formulation as a table constraint, PL-SQL Programming

Example of Alternative formulation as a table constraint

Example: Alternative formulation as a table constraint

ALTER TABLE EXAM_MARK

ADD CONSTRAINT Must_be_enrolled_to_take_exam_alternative2

CHECK (EXISTS (SELECT StudentId, CourseId

FROM IS_ENROLLED_ON

WHERE StudentId = EXAM_MARK.StudentId

AND CourseId = EXAM_MARK.CourseId)

) ;

In Example, note the use of the table name, EXAM_MARK, as a range variable to qualify references to columns of that table. As always, the condition given as the operand of CHECK is one that would be legal as a WHERE condition following a FROM clause specifying just the table to which the constraint applies (viz., FROM EXAM_MARK in the case at hand).

Posted Date: 1/18/2013 7:43:54 AM | Location : United States







Related Discussions:- Example of alternative formulation as a table constraint, Assignment Help, Ask Question on Example of alternative formulation as a table constraint, Get Answer, Expert's Help, Example of alternative formulation as a table constraint Discussions

Write discussion on Example of alternative formulation as a table constraint
Your posts are moderated
Related Questions
Methods: In normal, a method is a subprogram declared in an object type specification using the keyword MEMBER or STATIC. The method cannot have similar name as the object typ

EXECUTE IMMEDIATE Statement   The EXECUTE IMMEDIATE statement prepare (parses) and instantly executes a dynamic SQL statement or an anonymous PL/SQL block. Syntax:

INSERT Command in SQL Loosely speaking, INSERT takes the rows of a given source table and adds them to the specified target table, retaining all the existing rows in the targ

Develop Data Business Intelligence Project Project Description: We are linking our Microsoft SQL Database to GoodData Business Intelligence. We are seeking somebody who has e

Extension and AND in SQL The theory book gives the following simple example of relational extension in Tutorial D: EXTEND IS_CALLED ADD ( FirstLetter ( Name ) AS Initial )

%NOTFOUND The %NOTFOUND is the logical opposite of the %FOUND. The %NOTFOUND yields TRUE when an INSERT, UPDATE, or DELETE statement affected no rows, or the SELECT INTO state

Pl/SQL Expressions The Expressions are constructed by using the operands and operators. An operand is a constant, literal, variable, or function call which contributes a value

DELETE Statement The DELETE statement eliminates whole rows of data from the specified table or view. Syntax:

Scope Rules You cannot declare an exception twice in the similar block. Though, you can, declare the similar exception in 2 different blocks. The Exceptions declared in a bloc

Magento change address format depending on store Project Description: What I need is that depending on the store in which the customer bought the address should change the fo