Consider the table Product given below:
Table: Product
P_ID |
Name |
Category |
Price |
Discount |
P01 |
Pen |
Stationery |
10 |
0.1 |
P02 |
Book |
Stationery |
50 |
NULL |
P03 |
Shirt |
Clothing |
500 |
0.2 |
P04 |
Jeans |
Clothing |
800 |
NULL |
P05 |
Watch |
Accessories |
1000 |
0.15 |
Based on the given table, write SQL queries for the following:
(i) Increase the price by 20% of products whose discount is known.
Answer:
Answer by student
The SQL query to i ncrease the price by 20% of products whose discount is known is:
UPDATE Product SET Price = Price * 1.2 WHERE Discount IS NOT NULL;
Detailed answer by teachoo
The rest of the post is locked. Join Teachoo Black to see the full post.