Multiple assignment - sql, PL-SQL Programming

Multiple Assignment- SQL

SQL supports multiple assignment to local variables and also applies multiple assignment semantics in SET clauses of UPDATE statements, but does not support multiple assignment in connection with updates on table targets. Thus, SQL has no counterpart to the theory book's Example, simultaneously deleting from both COURSE and IS_ENROLLED_ON. If we assume that there must be at least one enrolment for each course, and that students can enroll only on existing courses, deferred constraint checking has to be used, as shown in Example here.

Example: Withdrawing course C3 and deleting any enrolments on C3

Assume the definition of IS_ENROLLED_ON includes

CONSTRAINT Course_must_exist_for_enrolment

FOREIGN KEY (CourseId) REFERENCES COURSE ON DELETE NO ACTION

and the definition of COURSE includes

CONSTRAINT Enrolment_must_exist_for_course

CHECK ( CourseId IN (SELECT CourseId FROM IS_ENROLLED_ON)

Posted Date: 1/18/2013 11:41:29 PM | Location : United States







Related Discussions:- Multiple assignment - sql, Assignment Help, Ask Question on Multiple assignment - sql, Get Answer, Expert's Help, Multiple assignment - sql Discussions

Write discussion on Multiple assignment - sql
Your posts are moderated
Related Questions
Hi,am developing a library system and relating all the table is somehow complex,could you kindly assist me

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

Some Varray Examples In SQL Plus, assume that you define an object type Project, as described below: SQL> CREATE TYPE Project AS OBJECT ( 2 project_no NUMBER(2), 3 title VARCHA

Tautology - Equivalences Rules: If there Tautologies are not all the time as much easy to note as the one above so than we can use these truth tables to be definite that a sta

Initializing and Referencing Collections Until you initialize a collection, a nested table or varray is automatically null (i.e. the collection itself is null, not its elements)

Data Types in SQL - Character CHARACTER or, synonymously, CHAR, for character strings. When this type is to be the declared type of something (e.g., a column), the permissible

what is the use of declare keyword

Keyword and Parameter Description: table_reference: This specifies a table or view that should be accessible when you execute the DELETE statement, and for that you must

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

Updating by replacement Syntax: UPDATE ENROLMENT SET Name = 'Ann' WHERE StudentId = SID ('S1'); Note the use of SET, as already noted in connection with direct a