Question: 6. Let's look at some schema info from the PRODUCT table: describe PRODUCT; Look at the column types, whether columns were PKS or Fks and





6. Let's look at some schema info from the PRODUCT table: describe PRODUCT; Look at the column types, whether columns were PKS or Fks and allowed to be null. Time to create some tables - but not in my database, please! Give the command use cs_YOU; where you is replaced by your mysql/UNB username Do a select command to see the PRODUCT table plus one new column, computed as p_min+1: SELECT *, p_min+1 from CS_owen.PRODUCT; Create a table as the result (see p 373 in the textbook): create table mytable as SELECT *, p_min+1 from cs_owen.PRODUCT; now use "describe" to see if the new table you have created has inherited the PK and FK. Also, what is the type of the new column? Screenshot. clean up the mess: DROP TABLE mytable; 615 V_CODE V NAME V_CONTACT V_AREACODE V_PHONE V_STATE V_ORDER 21225 Bryson, Inc Smithson 615 223-3234 TN Y 21226 Superloo, Inc. Fushing 904 2158995 R. N 21231 DE Supply Singh 615 225-3245 TN Y 21344 Gomer Bros. Ortega 889-2546 KY N 22567 Dome Supply Smith 901 678-1419 GA N 23119 Randsets Ltd. Anderson 901 678-3998 GA Y 24004 Bradman Bros. Browning 615 228-1410 TN N 24288 ORDVA, Inc. Hakford 615 898-1234 TN Y 25443 BBK, Inc. Smith 904 227-0093 F N 25501 Damal Supplies Smythe 615 890-3529 TN N 25595 Rubicon Systems Orton 904 456-0092 Y P_MIN P_QOH 8 32 5 18 15 23 15 12 8 5 5 8 6 5 P_CODE 11QER/31 13-02/P2 14-Q1/L3 1546-QQ2 1558-QW1 2232/QTY 2232/QWE 2238/QPD 23109-HB 23114-AA 54778-2T 89-WRE-Q PVC23DRT SM-18277 SW-23116 WR3/TT3 P_DESCRIPT P_INDATE Power painter, 15 psl., 3-nozzle 2017-11-03 00:00:00 7.25-in. pwr. saw blade 2017-12-13 00:00:00 9.00-in. pwr. saw blade 2017-11-13 00:00:00 Hrd. cloth, 1/4-in., 2x50 2018-01-15 00:00:00 Hrd. doth, 1/2-in., 3x50 2018-01-15 00:00:00 B&D jigsaw, 12-in. blade 2017-12-30 00:00:00 B&D jigsaw, 8-in. blade 2017-12-24 00:00:00 B&D cordless drill, 1/2-in. 2018-01-20 00:00:00 Claw hammer 2018-01-20 00:00:00 Sledge hammer, 12 lb. 2018-01-02 00:00:00 Rat-tail file, 1/8-in. fine 2017-12-15 00:00:00 Hicut chain saw, 16 in. 2018-02-07 00:00:00 PVC pipe, 3.5-in., 8-ft 2018-02-20 00:00:00 1.25-in. metal screw, 25 2018-03-01 00:00:00 2.5-in. wd. screw, 50 2018-02-24 00:00:00 Steel matting, 4x8x1/6, .5" m... 2018-01-17 00:00:00 12 5 P PRICE 109.99 14.99 17.49 39.95 43.99 109.92 99.87 38.95 9.95 14.40 4.99 256.99 5.87 6.99 8.45 119.95 P_DISCOUNT V_CODE 0.00 25595 0.05 21344 0.00 21344 0.00 23119 0.00 23119 0.05 24288 0.05 24288 0.05 25595 0.10 21225 0.05 NULL 0.00 21344 0.05 24288 0.00 NULL 0.00 21225 0.00 21231 0.10 25595 23 10 5 8 43 20 11 188 172 237 5 75 75 100 5 18 ATTRIBUTE NAME SAMPLE VALUE SAMPLE VALUE SAMPLE VALUE SAMPLE VALUE SAMPLE VALUE INV_NUM 211347 211347 211347 211348 211349 PROD_NUM AA-E3422QW QD-300932X RU-995748G AA-E3422QW GH-778345P SALE_DATE 15-Jan-2018 15-Jan-2018 15-Jan-2018 15-Jan-2018 16-Jan-2018 PROD_LABEL Rotary sander Band saw 0.25-in. drill bit Rotary sander Power drill VEND_CODE 211 211 309 211 157 VEND_NAME NeverFail, Inc. NeverFail, Inc. BeGood, Inc. NeverFail, Inc. ToughGo, Inc. QUANT_SOLD 1 8 1 2 1 PROD_PRICE $49.95 $3.45 $39.99 $49.95 $87.75 INV_NUMBER CUS_CODE 1001 10014 1002 10011 1003 10012 1004 10011 1005 10018 1006 10014 1007 10015 1008 10011 INV_DATE 2018-01-16 00:00:00 2018-01-16 00:00:00 2018-01-16 00:00:00 2018-01-17 00:00:00 2018-01-17 00:00:00 2018-01-17 00:00:00 2018-01-17 00:00:00 2018-01-17 00:00:00 NULL NULL NULL 6. Let's look at some schema info from the PRODUCT table: describe PRODUCT; Look at the column types, whether columns were PKS or Fks and allowed to be null. Time to create some tables - but not in my database, please! Give the command use cs_YOU; where you is replaced by your mysql/UNB username Do a select command to see the PRODUCT table plus one new column, computed as p_min+1: SELECT *, p_min+1 from CS_owen.PRODUCT; Create a table as the result (see p 373 in the textbook): create table mytable as SELECT *, p_min+1 from cs_owen.PRODUCT; now use "describe" to see if the new table you have created has inherited the PK and FK. Also, what is the type of the new column? Screenshot. clean up the mess: DROP TABLE mytable; 615 V_CODE V NAME V_CONTACT V_AREACODE V_PHONE V_STATE V_ORDER 21225 Bryson, Inc Smithson 615 223-3234 TN Y 21226 Superloo, Inc. Fushing 904 2158995 R. N 21231 DE Supply Singh 615 225-3245 TN Y 21344 Gomer Bros. Ortega 889-2546 KY N 22567 Dome Supply Smith 901 678-1419 GA N 23119 Randsets Ltd. Anderson 901 678-3998 GA Y 24004 Bradman Bros. Browning 615 228-1410 TN N 24288 ORDVA, Inc. Hakford 615 898-1234 TN Y 25443 BBK, Inc. Smith 904 227-0093 F N 25501 Damal Supplies Smythe 615 890-3529 TN N 25595 Rubicon Systems Orton 904 456-0092 Y P_MIN P_QOH 8 32 5 18 15 23 15 12 8 5 5 8 6 5 P_CODE 11QER/31 13-02/P2 14-Q1/L3 1546-QQ2 1558-QW1 2232/QTY 2232/QWE 2238/QPD 23109-HB 23114-AA 54778-2T 89-WRE-Q PVC23DRT SM-18277 SW-23116 WR3/TT3 P_DESCRIPT P_INDATE Power painter, 15 psl., 3-nozzle 2017-11-03 00:00:00 7.25-in. pwr. saw blade 2017-12-13 00:00:00 9.00-in. pwr. saw blade 2017-11-13 00:00:00 Hrd. cloth, 1/4-in., 2x50 2018-01-15 00:00:00 Hrd. doth, 1/2-in., 3x50 2018-01-15 00:00:00 B&D jigsaw, 12-in. blade 2017-12-30 00:00:00 B&D jigsaw, 8-in. blade 2017-12-24 00:00:00 B&D cordless drill, 1/2-in. 2018-01-20 00:00:00 Claw hammer 2018-01-20 00:00:00 Sledge hammer, 12 lb. 2018-01-02 00:00:00 Rat-tail file, 1/8-in. fine 2017-12-15 00:00:00 Hicut chain saw, 16 in. 2018-02-07 00:00:00 PVC pipe, 3.5-in., 8-ft 2018-02-20 00:00:00 1.25-in. metal screw, 25 2018-03-01 00:00:00 2.5-in. wd. screw, 50 2018-02-24 00:00:00 Steel matting, 4x8x1/6, .5" m... 2018-01-17 00:00:00 12 5 P PRICE 109.99 14.99 17.49 39.95 43.99 109.92 99.87 38.95 9.95 14.40 4.99 256.99 5.87 6.99 8.45 119.95 P_DISCOUNT V_CODE 0.00 25595 0.05 21344 0.00 21344 0.00 23119 0.00 23119 0.05 24288 0.05 24288 0.05 25595 0.10 21225 0.05 NULL 0.00 21344 0.05 24288 0.00 NULL 0.00 21225 0.00 21231 0.10 25595 23 10 5 8 43 20 11 188 172 237 5 75 75 100 5 18 ATTRIBUTE NAME SAMPLE VALUE SAMPLE VALUE SAMPLE VALUE SAMPLE VALUE SAMPLE VALUE INV_NUM 211347 211347 211347 211348 211349 PROD_NUM AA-E3422QW QD-300932X RU-995748G AA-E3422QW GH-778345P SALE_DATE 15-Jan-2018 15-Jan-2018 15-Jan-2018 15-Jan-2018 16-Jan-2018 PROD_LABEL Rotary sander Band saw 0.25-in. drill bit Rotary sander Power drill VEND_CODE 211 211 309 211 157 VEND_NAME NeverFail, Inc. NeverFail, Inc. BeGood, Inc. NeverFail, Inc. ToughGo, Inc. QUANT_SOLD 1 8 1 2 1 PROD_PRICE $49.95 $3.45 $39.99 $49.95 $87.75 INV_NUMBER CUS_CODE 1001 10014 1002 10011 1003 10012 1004 10011 1005 10018 1006 10014 1007 10015 1008 10011 INV_DATE 2018-01-16 00:00:00 2018-01-16 00:00:00 2018-01-16 00:00:00 2018-01-17 00:00:00 2018-01-17 00:00:00 2018-01-17 00:00:00 2018-01-17 00:00:00 2018-01-17 00:00:00 NULL NULL NULL
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
