Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribedPlease 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 SPP

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

Put Your Data To Work 52 Tips And Techniques For Effectively Managing Your Database

Authors: Wes Trochlil

1st Edition

0880343079, 978-0880343077

More Books

Students also viewed these Databases questions

Question

Be familiar with the five basic ways to manage demand.

Answered: 1 week ago