how to Create two or more MySQL VIEWS using the Pizza Store Database. Each of the Views must have a SELECT Query that contains two or more tables in the SELECT statements and the attributes of two more tables in the attribute list/projection of the Resultset. **THE REST OF THE CREATE TABLES CODE ARE IN THE PIC** **THE DB: DROP DATABASE IF EXISTS PizzaDelivery_BD; CREATE DATABASE IF NOT EXISTS PizzaDelivery_BD; USE PizzaDelivery_BD; CREATE TABLE IF NOT EXISTS PERSON ( pNum VARCHAR(10), pNume VARCHAR(50) NOT NULL, pAddress VARCHAR(50), isCustomer BOOLEAN, isDelivery BOOLEAN, isOrderStaff BOOLEAN, CONSTRAINT Person_PK PRIMARY KEY (pnum) ); CREATE TABLE IF NOT EXISTS Customer ( phone CHAR(10), email VARCHAR(50), pnum_FK VARCHAR(10), CONSTRAINT Customer_PK PRIMARY KEY (email,pnum_FK ), CONSTRAINT Customer_FK1 FOREIGN KEY (pnum_FK) REFERENCES Person(pnum) ); CREATE TABLE IF NOT EXISTS Order_Staff ( empID VARCHAR(5), pnum_FK VARCHAR(10), CONSTRAINT Order_Staff_PK PRIMARY KEY (empID, pNum_FK), CONSTRAINT Order_Staff_FK1 FOREIGN KEY (pnum_FK) REFERENCES Person(pnum) ); INSERT INTO Person (pnum, pname, paddress, iscustomer, isorderstaff, isdelivery) VALUES ("PID100", "James Kildare", "23 Shewbury court", 1,0,0), ("PID101", "Ben Casey", "281 s 52nd street", 1,0,0), ("PID102", "mARCUS Welby", "5808 Vine Street", 1,0,0), ("PID103", "Leonard Bones McCoy", "16 s. Bank Street", 1,0,0), ("PID104", "Hawkeye Pierce McCoy", "7311 Miller Avenue", 1,0,0), ("PID105", "pHILLIP cHANDLER", "206 Locust Street", 1,0,0), ("PID106", "HEATHCLIFF hUXTABLE", "6600 Broad Street", 1,0,0), ("PID107", "Greg House", "1920 Heather Circle", 0,1,0), ("PID108", "Derek Shepherd", "101 philadelphia Pike", 0,1,0), ("PID109", "Miranda Bailey", "1010 Flourence Circle", 0,1,0), ("PID110", "Barry Sanders", "100 Ering Lane", 0,0,1), ("PID111", "O.J. Simpson, ", "101 broad Street", 0,0,1), ("PID112", "LaDainian Tomlinson", "400 Picatoway Drive", 0,0,1), ("PID113", "Terry Bradshaw", "52 Cheese Head Road", 0,0,1) ; INSERT INTO Customer(pnum_FK, email, phone) VALUES ("PID100", "James@craigle.com", "2155551234"), ("PID101", "Ben@craigle.com", "2155559876"), ("PID102", "Marcus@craigle.com", "2155553456"), ("PID103", "Leonard@craigle.com", "2155558765"), ("PID104", "Hawk@craigle.com", "3025551234"), ("PID105", "Phillip@craigle.com", "2155559876"), ("PID106", "Heat@craigle.com", "3025554567") ; INSERT INTO Order_Staff (pnum_FK, empid) VALUES ("PID107", "T100"), ("PID108", "T200"), ("PID109", "T300") ; INSERT INTO Delivery_Person(pnum_FK, phone, model) VALUES ("PID110", "6105559876", "Civic"), ("PID111", "6105556789", "Beetle"), ("PID112", "6105556754", "F-150"), ("PID113", "2155556567", "Talon") ; INSERT INTO Pizza (item_num, size, price) VALUES ("1", "small",4.99 ), ("2", "medium",5.99 ), ("3", "large",6.99 ), ("4", "exlarge",7.99 ) ; INSERT INTO Topping (item_num, tname, price) VALUES ("10", "Sauge", 1.00), ("T11", "Mushrooms", .50), ("T12", "Onions", .50), ("T13", "Peppers", .50), ("T14", "Perperoni", 1.00), ("T15", "NONE", 0.00) ; INSERT INTO Pizza_order (order_num, odate, otype, empid_FK, cust_FK, deliveryPerson_FK) VALUES ("INV#0001", "2020/03/26", "Delivery", "T100", "PID100", "PID110"), ("INV#0002", "2020/03/26", "Delivery", "T200", "PID101", "PID111"), ("INV#0003", "2020/03/26", "Delivery", "T300", "PID102", "PID112"), ("INV#0004", "2020/03/27", "Delivery", "T100", "PID103", "PID113"), ("INV#0005", "2020/03/27", "Delivery", "T200", "PID104", "PID110"), ("INV#0006", "2020/03/27", "Delivery", "T300", "PID105", "PID111"), ("INV#0007", "2020/03/27", "Delivery", "T100", "PID106", "PID112"), ("INV#0008", "2020/03/28", "Delivery", "T200", "PID104", "PID113"), ("INV#0009", "2020/03/28", "Delivery", "T300", "PID105", "PID110"), ("INV#0010", "2020/03/28", "Delivery", "T300", "PID106", "PID111") ; INSERT INTO Order_Item ( order_num_FK, item_num_FK, autogen) VALUES ("INV#0001", "2", 1), ("INV#0001", "1", 2), ("INV#0002", "2", 3), ("INV#0003", "3", 4), ("INV#0004", "4", 5), ("INV#0005", "1", 6), ("INV#0006", "2", 7), ("INV#0007", "3", 8), ("INV#0008", "4", 9), ("INV#0009", "1", 10), ("INV#0010", "2", 11) ; INSERT INTO Pizza_Toppings (autogen_FK, item_num_FK) VALUES (1,"I10"), (1,"I12"), (2,"I14"), (3,"I11"), (3,"I12"), (3,"I13"), (4,"I12"), (4,"I13"), (5,"I14"), (6,"I14"), (7,"I10"), (8,"I10"), (9,"I10"), (10,"I10"), (10,"I11"), (10,"I12"), (10,"I13"), (10,"I14"), (11,"I15")
SQL
SQL stands for Structured Query Language, is a form of communication that uses queries structured in a specific format to store, manage & retrieve data from a relational database.
Queries
A query is a type of computer programming language that is used to retrieve data from a database. Databases are useful in a variety of ways. They enable the retrieval of records or parts of records, as well as the performance of various calculations prior to displaying the results. A search query is one type of query that many people perform several times per day. A search query is executed every time you use a search engine to find something. When you press the Enter key, the keywords are sent to the search engine, where they are processed by an algorithm that retrieves related results from the search index. Your query's results are displayed on a search engine results page, or SER.
how to Create two or more MySQL VIEWS using the Pizza Store
**THE REST OF THE CREATE TABLES CODE ARE IN THE PIC**
**THE DB:


Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 1 images









