Question: Use the following database schema for the problems below. Product(model, manufacturer, type) PC(model, speed, ram, hd, rd, price) Laptop(model, speed, ram, hd, screen, price) Problem

 Use the following database schema for the problems below. Product(model, manufacturer,

Use the following database schema for the problems below. Product(model, manufacturer, type) PC(model, speed, ram, hd, rd, price) Laptop(model, speed, ram, hd, screen, price) Problem 1. Constraints Specification in SQL [25 pts] 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. a) Add a constraint to the Product table to enforce that the type of the product must either be 'PC' or 'Laptop'. b) Add an additional constraint that the price of any Laptop must be at least 500. c) Add the constraint that a laptop with a larger model number must also have a higher price than one with a lower model number. d) Add the constraint that any PC and Laptop corresponds to a model number that also exists in the Product table. e) 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!