Data Mgmt Lab_Part_21 - SQL: Queries, Constraints, Triggers...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
SQL: Queries, Constraints, Triggers 61 (l) The number of distinct courses in which CS majors are enrolled is greater than the number of distinct courses in which Math majors are enrolled. (m) The total enrollment in courses taught by faculty in the department with deptid=33 is greater than the number of Math majors. (n) There must be at least one CS major if there are any students whatsoever. (o) Faculty members from di±erent departments cannot teach in the same room. Answer 5.8 Answer omitted. Exercise 5.9 Discuss the strengths and weaknesses of the trigger mechanism. Con- trast triggers with other integrity constraints supported by SQL. Answer 5.9 A trigger is a procedure that is automatically invoked in response to a speci²ed change to the database. The advantages of the trigger mechanism include the ability to perform an action based on the result of a query condition. The set of actions that can be taken is a superset of the actions that integrity constraints can take (i.e. report an error). Actions can include invoking new update, delete, or insert queries, perform data de²nition statements to create new tables or views, or alter security policies. Triggers can also be executed before or after a change is made to the
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 01/17/2012 for the course EGN 4302 taught by Professor Dr.vishak during the Fall '12 term at University of Central Florida.

Page1 / 3

Data Mgmt Lab_Part_21 - SQL: Queries, Constraints, Triggers...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online