Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Need help with the following questions. Consider the following database schema, in which the keys of each relation are underlined- Restaurant(rname, address, phone, stars) Chef

Need help with the following questions.

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Ehs 2.0 Revolutionizing The Future Of Safety With Digital Technology

Authors: Tony Mudd

1st Edition

B0CN69B3HW, 979-8867463663

More Books

Students also viewed these Databases questions

Question

Explain what Behavioral Finance assumes?

Answered: 1 week ago

Question

6. Does your speech have a clear and logical structure?

Answered: 1 week ago