Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I need help with this, please using myphpadmin Here's the database. Thank you! -- Create schema Premiere; Use Premiere; CREATE TABLE REP (REP_NUM CHAR(2) PRIMARY
I need help with this, please using myphpadmin
Here's the database. Thank you!
-- Create schema Premiere; Use Premiere; CREATE TABLE REP (REP_NUM CHAR(2) PRIMARY KEY, LAST_NAME CHAR(15), FIRST_NAME CHAR(15), STREET CHAR(15), CITY CHAR(15), STATE CHAR(2), ZIP CHAR(5), COMMISSION DECIMAL(7,2), RATE DECIMAL(3,2) ); CREATE TABLE CUSTOMER (CUSTOMER_NUM CHAR(3) PRIMARY KEY, CUSTOMER_NAME CHAR(35) NOT NULL, STREET CHAR(15), CITY CHAR(15), STATE CHAR(2), ZIP CHAR(5), BALANCE DECIMAL(8,2), CREDIT_LIMIT DECIMAL(8,2), REP_NUM CHAR(2) ); CREATE TABLE ORDERS (ORDER_NUM CHAR(5) PRIMARY KEY, ORDER_DATE VARCHAR(10), CUSTOMER_NUM CHAR(3) ); CREATE TABLE PART (PART_NUM CHAR(4) PRIMARY KEY, DESCRIPTION CHAR(15), ON_HAND DECIMAL(4,0), CLASS CHAR(2), WAREHOUSE CHAR(1), PRICE DECIMAL(6,2) ); CREATE TABLE ORDER_LINE (ORDER_NUM CHAR(5), PART_NUM CHAR(4), NUM_ORDERED DECIMAL(3,0), QUOTED_PRICE DECIMAL(6,2), PRIMARY KEY (ORDER_NUM, PART_NUM) ); INSERT INTO REP VALUES ('20','Kaiser','Valerie','624 Randall','Grove','FL','33321',20542.50,0.05); INSERT INTO REP VALUES ('35','Hull','Richard','532 Jackson','Sheldon','FL','33553',39216.00,0.07); INSERT INTO REP VALUES ('65','Perez','Juan','1626 Taylor','Fillmore','FL','33336',23487.00,0.05); INSERT INTO REP VALUES ('80','Saito','Tom','1626 Taylor','Fillmore','FL','33336',23487.00,0.05); INSERT INTO REP VALUES ('90','Chun','Kayli','1626 Taylor','Fillmore','FL','33336',23487.00,0.05); INSERT INTO CUSTOMER VALUES ('148','Al''s Appliance and Sport','2837 Greenway','Fillmore','FL','33336',6550.00,7500.00,'20'); INSERT INTO CUSTOMER VALUES ('282','Brookings Direct','3827 Devon','Grove','FL','33321',431.50,10000.00,'35'); INSERT INTO CUSTOMER VALUES ('356','Ferguson''s','382 Wildwood','Northfield','FL','33146',5785.00,7500.00,'65'); INSERT INTO CUSTOMER VALUES ('408','The Everything Shop','1828 Raven','Crystal','FL','33503',5285.25,5000.00,'35'); INSERT INTO CUSTOMER VALUES ('462','Bargains Galore','3829 Central','Grove','FL','33321',3412.00,10000.00,'65'); INSERT INTO CUSTOMER VALUES ('524','Kline''s','838 Ridgeland','Fillmore','FL','33336',12762.00,15000.00,'20'); INSERT INTO CUSTOMER VALUES ('608','Johnson''s Department Store','372 Oxford','Sheldon','FL','33553',2106.00,10000.00,'65'); INSERT INTO CUSTOMER VALUES ('687','Lee''s Sport and Appliance','282 Evergreen','Altonville','FL','32543',2851.00,5000.00,'35'); INSERT INTO CUSTOMER VALUES ('725','Deerfield''s Four Seasons','282 Columbia','Sheldon','FL','33553',248.00,7500.00,'35'); INSERT INTO CUSTOMER VALUES ('842','All Season','28 Lakeview','Grove','FL','33321',8221.00,7500.00,'20'); INSERT INTO ORDERS VALUES ('21608','10-20-2010','148'); INSERT INTO ORDERS VALUES ('21610','10-20-2010','356'); INSERT INTO ORDERS VALUES ('21613','10-21-2010','408'); INSERT INTO ORDERS VALUES ('21614','10-21-2010','282'); INSERT INTO ORDERS VALUES ('21617','10-23-2010','608'); INSERT INTO ORDERS VALUES ('21619','10-23-2010','148'); INSERT INTO ORDERS VALUES ('21623','10-23-2010','608'); INSERT INTO PART VALUES ('AT94','Iron',50,'HW','3',24.95); INSERT INTO PART VALUES ('BV06','Home Gym',45,'SG','2',794.95); INSERT INTO PART VALUES ('CD52','Microwave Oven',32,'AP','1',165.00); INSERT INTO PART VALUES ('DL71','Cordless Drill',21,'HW','3',129.95); INSERT INTO PART VALUES ('DR93','Gas Range',8,'AP','2',495.00); INSERT INTO PART VALUES ('DW11','Washer',12,'AP','3',399.99); INSERT INTO PART VALUES ('FD21','Stand Mixer',22,'HW','3',159.95); INSERT INTO PART VALUES ('KL62','Dryer',12,'AP','1',349.95); INSERT INTO PART VALUES ('KT03','Dishwasher',8,'AP','3',595.00); INSERT INTO PART VALUES ('KV29','Treadmill',9,'SG','2',1390.00); INSERT INTO ORDER_LINE VALUES ('21608','AT94',11,21.95); INSERT INTO ORDER_LINE VALUES ('21610','DR93',1,495.00); INSERT INTO ORDER_LINE VALUES ('21610','DW11',1,399.99); INSERT INTO ORDER_LINE VALUES ('21613','KL62',4,329.95); INSERT INTO ORDER_LINE VALUES ('21614','KT03',2,595.00); INSERT INTO ORDER_LINE VALUES ('21617','BV06',2,794.95); INSERT INTO ORDER_LINE VALUES ('21617','CD52',4,150.00); INSERT INTO ORDER_LINE VALUES ('21619','DR93',1,495.00); INSERT INTO ORDER_LINE VALUES ('21623','KV29',2,1290.00);Please type in the appropriate question number and list the query below it. Please do not print or screen capture your output. Just the code please! 1. List the part numbers of all parts where the class is 'AP'. Your answer should look like: SELECT part_num FROM part WHERE class = 'AP'; 2. USE the IN operator to display all Order Numbers where parts CD52, DR93, DW11, KL62, or KT03 were ordered. 3. USE the IN operator to display all customers (Name) where the rep is either 20 or 35. 4. USE the IN operator WITH A Nested Query to display the first and last names of reps living in the city of Grove. 5. USE the IN operator WITH A Nested Query to display the description and part number of all having a cost of greater than 200 dollars. 6. USE the IN operator WITH A Nested Query to display the order number and order date of all orders having the part number DR93.Your answer should look like: SELECT order_num, order_date FROM orders WHERE order_num IN (SELECT order_num FROM order_line WHERE part_num ='DR93'); 7. USE the EXISTS operator to display the same information listed in question \#6. 8. USE the EXISTS operator to display all of the customers (name) who placed an order on 2010-10-23. HINT: date fields require a ' before and after the values. '2010-10-23' SELFJOIN 9. List all pairs of parts with the same class. SELECT a.description, a.class, b.description, b.class FROM part AS a, part AS b WHERE a.class=b.class; -- AND a.on_hand>b.on_hand (these lines are optional but help to make look better. -- ORDER BY a.class; 10. List all pairs of customers with the same rep
Step 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