Write SQL commands for the following based on the given tables “Product”.
PRODUCT
_
TP01 FW05 BS01 SH06
TalcomPowder FaceWash BathSoap Shampoo
LAK ABC ABC XYZ
40 45 55 120
a) To display the details of those products whose price is greater than 45.
b) To decrease the Price of all Products by 5.
c) Arrange the whole table in the alphabetical order of ProductName.
d) To add a new field Quantity of type integer in table PRODUCT.
Answers
Answered by
1
Answer:
a) select * from product where price>45;
b) update product set price = price - 5;
c)Select * from product order by productname;
d) alter table product add type(int);
Explanation:
- SELELCT: chooses what to show on screen
- WHERE : applies condition filter.
- UPDATE: alters with table data.
- ORDER BY: Arranges the table as per command (ascending by default).
- ALTER TABLE: interferes with table structure.
- ADD: Adds column when used with ALTER.
Similar questions
Math,
1 month ago
English,
1 month ago
Math,
9 months ago
English,
9 months ago
Social Sciences,
9 months ago