Create the table that results from applying a UNION relational operator to the t
ID: 3749322 • Letter: C
Question
Create the table that results from applying a UNION relational operator to the tables shown in Figure Q3.13.
Create the table that results from applying an INTERSECT relational operator to the tables shown in Figure Q3.13.
Using the tables in Figure Q3.13, create the table that results from MACHINE DIFFERENCE BOOTH.
FIGURE Q3.13 THE CHO3_ VENDINGCO DATABASE TABLES Database name: Ch03_VendingCo Table name: MACHINE Table name: BOOTH BOOTH PRODUCT BOOTH PRICE Chips Cola Energy Drink MACHINE PRODUCT! MACHINE PRICE Chips Chocolate Bar Eneray Drink 1.25 1.25 2 2Explanation / Answer
If you have any doubts, please give me coment...
CREATE TABLE UNION_TABLE AS
SELECT BOOTH_PRODUCT AS Product, BOOTH_PRICE AS Price
FROM BOOTH_PRODUCT
UNION
SELECT MACHINE_PRODUCT AS Product, MACHINE_PRICE AS Price
FROM MACHINE_PRODUCT;
CREATE TABLE INSECTION_TABLE AS
SELECT BOOTH_PRODUCT AS Product, BOOTH_PRICE AS Price
FROM BOOTH_PRODUCT
INTERSECT
SELECT MACHINE_PRODUCT AS Product, MACHINE_PRICE AS Price
FROM MACHINE_PRODUCT;
CREATE TABLE DIFFERENCE_TABLE AS
SELECT MACHINE_PRODUCT AS Product, MACHINE_PRICE AS Price
FROM MACHINE_PRODUCT;
EXCEPT
SELECT BOOTH_PRODUCT AS Product, BOOTH_PRICE AS Price
FROM BOOTH_PRODUCT;