Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Use sql to do the following question: Write the commands to modify table Product

ID: 3793106 • Letter: U

Question

Use sql to do the following question:

Write the commands to modify table Product_T so that it now has one new column called ProductPackagingId.

Now write the Update statement necessary to update the values of ProductPackagingId and set them according to these:

1.All Products tables, desks and dressers use Standard packaging

2.Chairs and nightstands use Crates

3.Clocks us Shock Mount packaging

4.Bookcases and Entertainment centers use standard packaging

5.Amoires use Preservation packaging

Here is what Product_T looks like:

PRODUCTID PRODUCTLINEID PRODUCTDESCRIPTION PRODUCTFINISH PRODUCTSTANDARDPRICE 1 1 END TABLE CHERRY 175

Explanation / Answer

Alter table Product_T ADD ProductPackagingId varchar(50);

1. Update Product_T set ProductPackagingId = 'Standard packaging' where ProductDescription like '%table%' or ProductDescription like '%desk%' or ProductDescription like '%dresser%' ;

2. Update Product_T set ProductPackagingId = 'Crates' where ProductDescription like '%Chair%' ;

3. Update Product_T set ProductPackagingId = 'Shock Mount packaging' where ProductDescription like '%Clock%' ;

4. Update Product_T set ProductPackagingId = 'standard packaging' where ProductDescription like '%Bookcases%' or ProductDescription like '%Entertainment centres%' ;

5. Update Product_T set ProductPackagingId = 'Preservation packaging' where ProductDescription like '%Amories%' ;