Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please answer the above two questions. Thanks 3. Suppose we start with the following relation-schema declaration: (1) (2) (3) (4) CREATE TABLE Emps ( id
Please answer the above two questions. Thanks
3. Suppose we start with the following relation-schema declaration: (1) (2) (3) (4) CREATE TABLE Emps ( id INT SSNO INT name CHAR (20) managerID INT The numbers (1) through (4) are not part of the declaration, but will be used to refer to certain lines. Our intent is that both id and ssNo are keys by themselves, and that the value of managerin must be one of the values that appears in the id attribute of the same relation Emps. Which of the following is not a legal addition of SQL standard key and/or foreign-key constraints? Note: the addition does not have to achieve all the goals stated; it must only result in legal SQL. O a) Add PRIMARY KEY just before the comma on line (1), and add , FOREIGN KEY (managerID) REFERENCES Emps (id) after line (4). b) Add UNIQUE just before the commas on lines (1) and (2). O c) Add , FOREIGN KEY (managerID) REFERENCES Emps (id) after line d) Add UNIQUE just before the comma on line (1), and add PRIMARY KEY just before the comma on line (2). 4. Relation SPP (supID, partID, projID. qty) is a relation whose tuples mean that supplier supID supplies part partID to project projID in quantity qty. Suppose that each of the four attributes are integers. Write a CREATE TABLE statement for relation SPP. Do not forget to declare that supID.partID, and projID together form the key, and that these are each foreign keys referencing the relations Suppliers, Parts, and Projects, respectively. Then, identify from the list below the element that would appear as part of the definition. a) PRIMARY KEY (supID) b) qty INTEGER C) FOREIGN KEY Suppliers REFERENCES supID d) CREATE SPPStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started