Question

Question from book - Database systems the complete book (second edition) by hector Garcia-molina Jeffery D....

Question from book - Database systems the complete book (second edition) by hector Garcia-molina Jeffery D. Ullman Jennifer Widom

Exercise 7.5.2: Write the following as triggers. In each case, disallow or undo the modification if it does not satisfy the stated constraint. The database scheme is from the "PC" example of Exercise 2.4.1:
Product(maker, model, type)
PC(model, speed, ram, hd, price)
Laptop(model, speed, ram, hd, screen, price)
Printer(model, color, type, price)

A) When updating the price of a PC, check that there is no lower priced PC with the same speed.

B) When inserting a new printer, check that the model number exists in Product.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

SOLUTION:-The Required triggers are given below:-

(A) AFTER UPCING OL (A) CREATE TRIGGER CheckLower Price AFTER UPDATE OF price ON PC REFERENCING OLD ROW AS OldTuple NEW ROW A

(B) CREATE TRIGGER CheckModel Number AFTER INSERT on Printer REFERENCING new row as newrow for each row when model not in (se

====================================================================================

Add a comment
Know the answer?
Add Answer to:
Question from book - Database systems the complete book (second edition) by hector Garcia-molina Jeffery D....
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Database Systems: The Complete Book (2nd Edition), by Hector Garcia-Molina Jeffrey D. Ullman Jennifer Widom Department...

    Database Systems: The Complete Book (2nd Edition), by Hector Garcia-Molina Jeffrey D. Ullman Jennifer Widom Department of Computer Science Stanford University Exercise 14.3.3: The material of this section assumes that search keys are unique. However, only small modifications are needed to allow the techniques to work for search keys with duplicates. Describe the necessary changes to insertion, deletion, and lookup algorithms, and suggest the major problems that arise when there are duplicates in each of the following kinds of hash...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT