Question: Problem 1. Constraints Specification in SQL [25 pts] Product(model, manufacturer, type) PC(model, speed, ram, hd, rd, price) Laptop(model, speed, ram, hd, screen, price) Assume no

Problem 1. Constraints Specification in SQL [25 pts]

Product(model, manufacturer, type)

PC(model, speed, ram, hd, rd, price)

Laptop(model, speed, ram, hd, screen, price)

Assume no primary keys, nor foreign key constraints have been defined on this schema yet. Write SQL DDL statements to add the constraints below whenever possible. Do not use triggers! Please REVIEW the supplementary Integrity Constraints Slides Attached to this homework to learn about Check constraints. Demonstrate that your solution works. If you cannot enforce the constraints through DDL statements explain why.

3. Add the constraint that a laptop with a larger model number must also have a higher price than one with a lower model number.

4. Add the constraint that any PC and Laptop corresponds to a model number that also exists in the Product table.

5. Add the constraint that in our product database table we only maintain products from at most 5 different manufacturers (so to assure that the quality we offer is high).

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!