Computer Science, asked by rajat5476, 4 months ago

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 allysia
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