SQL & NoSQL Databases by Andreas Meier & Michael Kaufmann

SQL & NoSQL Databases by Andreas Meier & Michael Kaufmann

Author:Andreas Meier & Michael Kaufmann
Language: eng
Format: epub
ISBN: 9783658245498
Publisher: Springer Fachmedien Wiesbaden


will also return an error message: Department D7 is not yet listed in the referenced table DEPARTMENT, but due to the foreign key constraint, the DBMS checks whether the key D7 exists in the referenced table before the insertion.

Declarative, or static, integrity constraints can be defined during table generation (CREATE TABLE statement). On the other hand, procedural, or dynamic, integrity constraints compare database states before and after a change, i.e., they can only be checked during runtime. The triggers are an alternative to declarative integrity constraints because they initiate a sequence of procedural branches via instructions. Triggers are mostly defined by a trigger name, a database operation, and a list of subsequent actions:

CREATE TRIGGER NoCuts –– trigger name

BEFORE UPDATE ON Employee –– database operation

FOR EACH ROW BEGIN –– subsequent action

IF NEW.Salary  <  OLD.Salary

THEN set NEW.Salary  =  OLD.Salary

END IF;

END



Loading...
Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.