MySQL Database Question Table Vendor: | V CODE V NAME V CONTACT V AREACODE V PHO
ID: 3727485 • Letter: M
Question
MySQL Database Question
Table Vendor: | V CODE V NAME V CONTACT V AREACODE V PHONE V STATE V ORDER 21225 | Bryson, Inc. Smithon 615 | 21226 SuperLoo, Inc. Flushing 904 l Singh 615 l Ortega 615 | 22567 | Dome Supply Smith 901 23119 | Randsets Ltd. Anderson 901 |24004 Brackman Bros. Browning 615 | Hakford 615 I Smith 904 25501 Damal Supplies Smythe 615 25595 | Rubicon Systems Orton 904 | 223-3234 | TN | 215-8995 | FL | 228-3245 | TN | 889-2546 | KY | 678-1419 | GA 678-3998 | GA | 228-1410 | TN | 898-1234 TN |227-0093 | FL 890-3529 TN | 456-0092 | FL 21231 D&E; Supply 21344 | Gomez Bros. |24288 | ORDVA, Inc. 25443 | B&K;, Inc. Given the table Vendor, write a MySQL query to do the following: In VENDOR table, set V_ORDER to 'Y' (if it is not) to the vendors whose V CONTACT start with 'Smith, and V STATE is one of 'TN'·'KY', and 'FL' Examine the change. . . Restore the content of VENDOR. Examine the content of VENDOR;Explanation / Answer
Solution:
UPDATE VENDOR
SET V_ORDER = 'Y'
WHERE V_CONTACT='Smith' AND (V_STATE = 'TN' OR V_STATE ='KY' OR V_STATE = 'FL'
The updated table will have the changed column V-ORDER AS:
I hope this helps if you find any problem. Please comment below. Don't forget to give a thumbs up if you liked it. :)
V_ORDER Y N Y N N Y N Y Y N YRelated Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.