1.

Consider the following table FITNESS with details about fitness products being sold in the store. Write command of SQL for (i) to (iv) and output for (v) to (viii).                             Table : FITNESSPCODEPNAMEPRICEMANUFACTURERP1Treadmill21000CoscoreP2Bike20000AoneP3Cross Tiainer14000ReliableP4Multi Gym34000CoscoreP5Massage Chair5500RegroseneP6Belly Vibrator Belt6500Ambaway(i) To display the names of all the products with price more than 20000.(ii) To display the names of all the products by the manufacturer "Aone".(iii) To change the price data of all the productsby applying 25% discount reduction.(iv) To add a new row for product with details: "P7","Vibro Exerciset", 28000,'Aone".(V) SELECT * FROM FITNESS WHERE MANUFACTURERNAME, LIKE " % e" .(vi) SELECT COUNT((DISTINCT)MANUFACTURER) FROM FITNESS.(vii) SELECT MAX(PRICE) FROM FITNESS.

Answer»

(i) SELECT PNAME, PRICE FROM FITNESS WHERE PRICE > 2000;

(ii) SELECT PNAME FROM FITNESS WHERE MANUFACTURER = "Aone";

(iii) UPDATE FITNESS SET PRICE=PRICE * (PRICE*0.25);

(iv) INSERT INTO FITNESS VALUES("P7", "Vibro Exerciser", 28000, "Aone");

(v) Error: There is no column MANUFACTURER NAME

PCODEPNAMEPRICEMANUFACTURER
P1Treadmill21000Coscore
P2Bike20000Aone
P3Cross Trainer14000Reliable
P4Multi Gym34000Coscore
P5Massage Chair5500Regrosene

(vi) COUNT(DISTINCT(MANUFACTURER)) 5

(vii) MAX(PRICE) 6500



Discussion

No Comment Found

Related InterviewSolutions