Below is the use case for a Recipes database, which is used by restaurant owners
ID: 3732718 • Letter: B
Question
Below is the use case for a Recipes database, which is used by restaurant owners to record recipes . Information about ingredients used are stored in the database, including the name and Information is stored about recipes, including the name of the recipe, the author of the The ingredients required for each recipe are also stored, including the quantity of each and their ingredients. price per kilogram of each ingredient. Because some ingredients have the same or similar names, a description of each ingredient is also included ingredient used in the recipe. Each recipe may contain many ingredients, and an ingredient is listed only once for each recipe How many of each of the following are there in the relational schema? Attributes that cannot be NULL as they participate in a Primary Key ' Attributes that are subject to a Referential Integrity ConstraintExplanation / Answer
Answer is as follows:
a) The attributes that cannot be null treated as Primary Keys , In given sceraio the Primary keys are
Recipe Name for recipe table.
Combined Key (Name,Description) of the ingrediant table becasue Name can be similar but including with description of corresponding ingrediant it defines uniquely.
So there are two priamry keys 1 is unique attribute and other is combined primary key with 2 attributes.
Somehow it can also be call as there are 3 priamry keys.
b) Referential Intigrity Constraints are also known as Foriegn key constraint.
There is only one foriegn key in Recipe table i.e. Ingrediant name to define which ingrediants are used in the particular recipe.
So
there is only one foriegn key i.e. Ingrediant name in recipe table.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.