Can I please have help with these questions? QUESTION 6: Below is a partially co
ID: 3886263 • Letter: C
Question
Can I please have help with these questions?
QUESTION 6:
Below is a partially complete CREATE TABLE statement for the Orders table in the Clothing Store database. Consider it in conjunction with the Customers table in the same database you constructed in the previous question.
Fill in the blank below to add a foreign key constraint on the customerID attribute which links it to the appropriate attribute in the Customers table. There is a blank in the query, and you should enter the required text in the box below. Do not include ON UPDATE and ON DELETE clauses. Your answer will be marked incorrect if there is a spelling mistake, missing spaces, or unnecessary spaces.
CREATE TABLE Orders (
orderID int,
productID int,
customerID int,
storeID int,
PRIMARY KEY (orderID, productID),
FOREIGN KEY (productID) REFERENCES Products (productID),
FOREIGN KEY (storeID) REFERENCES Stores (ID),
___________________________________________________
);
QUESTION 16:
Consider the relational algebra expression below
Complete the two blanks in the following SQL query to return the same information as the relational algebra expression above. Your answer will be marked incorrect if there is a spelling mistake, missing spaces, or unnecessary spaces.
Balow is a partially complsto CREATE TABLE statement for the Orders table in the clathing Stare databasa. Consider it in canjunction with the Custamers rable in tha sarno database yu constructed in tho pravious question. Fill inthe blank belw to edd a foreign key constthecustomerlD etibtewhch links it to the epproprie elibute in the Customers leble. Thereis e blenk in the query, and you should enter the required text in the box below. De not include ON UPDATE and ON DELETE dauses. Your answer wil be marked incorrect if there is e spelling mistake, missing speces, or unnecessary spaces. CREATE TABLE Orders [ orderlD in product D Int oustomerlo Int, torelD Int PRIMARY KEY (orderiD, productiD FOREIGN KEYIprouctiD) RFFERENCFS Praducts (productiDi R)REIGN KEY(Store! RFFFRENCES Stores (l ,Explanation / Answer
Question 6:
FOREIGN KEY (customerID) REFERENCES Customers(CustomerID)
The above query creates a FOREIGN KEY on the "customerID" column of table "Orders" when the "Orders" table is created. This constraint prevents the invalid customerID if inserted into the table.
Question 16:
1st blank:
UNION
2nd blank:
firstName,lastName FROM Employees
So whole query will be:
SELECT firstName,lastName FROM Customers WHERE age>20
UNION
SELECT firstName,lastName FROM Employees WHERE age>20
Description:
SELECT firstName,lastName FROM Customers WHERE age>20
This query will extract firstName and lastName values from Customers table where age column value is more than 20.
SELECT firstName,lastName FROM Employees WHERE age>20
This query will extract firstName and lastName values from Employees table where age column value is more than 20.
and
UNION
this union will extract entries that are common in both above extracted values from both tables. i.e. it will filter out those values in which firstName and lastName values are present in both of the tables of same corresponding rows and also age column values are more than 20(may be different value but more than 20 in both the tables).
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.