I just need the SQL statements for these problems: 2. Insert into the NONGAME th
ID: 3827891 • Letter: I
Question
I just need the SQL statements for these problems:
2. Insert into the NONGAME the item number, description, number of units on hand, category, and unit price from the ITEM table for each item that is not in category GME. 3. In the ME table, change the description of item number DL51 to "Classic Train Set." 4. In the NONGAME table, increase the price of each item in category TOY by two percent. (Hint: Multiply each price by 1.02.) 5. Add the following item to the NONGAME table: item number: TL92, description: Dump Truck, number of units on hand: 10, category: TOY; and price: 59.95.Explanation / Answer
1. CREATE TABLE NONGAME --To create table NONGAME
(
ITEM_NUM CHAR(4) NOT NULL,
DESCRIPTION CHAR(30),
ON_HAND DECIMAL (4,0),
CATEGORY CHAR(3),
PRICE DECIMAL (6,2),
PRIMARY KEY (ITEM_NUM));
SELECT * FROM NONGAME; --To see the values
2. INSERT INTO NONGAME (ITEM_NUM,DESCRIPTION,ON_HAND,CATEGORY,PRICE)
VALUES
('DL51','','1.0','TOY','4.8');-- ASSUMING ALREADY THIS RECORD EXISTS-Instering the records into the table
3. UPDATE NONGAME
SET DESCRIPTION='CLASSIC TRAIN SET' WHERE ITEM_NUM='DL51';--changing the item description of DL51.
4. UPDATE NONGAME
SET PRICE=(PRICE*1.02) WHERE CATEGORY ='TOY';
--updating the price of each item by 2%
5. INSERT INTO NONGAME (ITEM_NUM,DESCRIPTION,ON_HAND,CATEGORY,PRICE)
VALUES
('TL92','DUMP TRUCK','10','TOY','59.95');
--Instering values into table