Question: Can someone help me with question c,d and e. Consider the following database schema, in which the keys of each relation are underlined- Restaurant(rname, address,

Can someone help me with question c,d and e.

Can someone help me with question c,d and e. Consider the following

Consider the following database schema, in which the keys of each relation are underlined- Restaurant(rname, address, phone, stars) Chef cname, specialdish, rating) CooksFor(cname.rname, salary) Offers(rname dishname, price) For each of the following general constraints, create CHECK constraints, assertions or triggers (as appropriate) to ensure that the constraint holds. Note: in the case of CHECK constraints, you do not nend to nroxide the emtire set of statementsetle,just the CHECK constraint itself. ) 2 marks] Write a CHECK constraint to ensure that every restaurant has between 0 and 5 stars (inclusive). b) [2 marks] Write a CHECK constraint to ensure that no restaurant offers a dish that costs less c) [3 marks] Write an assertion to ensure that every restaurant must have at least one chef. d) [3 marks] Write an assertion to ensure that for every dish, there is at least one chef for whom that is their special dish. [5 marks] When the number of stars assigned to a restaurant increases, then all chefs who cook for that restaurant must receive a l 0% raise. Write a trigger that will modify salary accordingly e) Consider the following database schema, in which the keys of each relation are underlined- Restaurant(rname, address, phone, stars) Chef cname, specialdish, rating) CooksFor(cname.rname, salary) Offers(rname dishname, price) For each of the following general constraints, create CHECK constraints, assertions or triggers (as appropriate) to ensure that the constraint holds. Note: in the case of CHECK constraints, you do not nend to nroxide the emtire set of statementsetle,just the CHECK constraint itself. ) 2 marks] Write a CHECK constraint to ensure that every restaurant has between 0 and 5 stars (inclusive). b) [2 marks] Write a CHECK constraint to ensure that no restaurant offers a dish that costs less c) [3 marks] Write an assertion to ensure that every restaurant must have at least one chef. d) [3 marks] Write an assertion to ensure that for every dish, there is at least one chef for whom that is their special dish. [5 marks] When the number of stars assigned to a restaurant increases, then all chefs who cook for that restaurant must receive a l 0% raise. Write a trigger that will modify salary accordingly e)

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!