CBSE Class 12 Informatics Practices
Question 59 of 79
Database Query using SQL — Question 17
Back to all questions 17
Question Consider the table Product shown below:
Table: PRODUCT
| P_ID | ProductName | Manufacturer | Price |
|---|---|---|---|
| P001 | Moisturizer | XYZ | 40 |
| P002 | Sanitizer | LAC | 35 |
| P003 | Bath Soap | COP | 25 |
| P004 | Shampoo | TAP | 95 |
| P005 | Lens Solution | COP | 350 |
Write the commands in SQL queries for the following:
(a) To display the details of product whose price is in the range of 40 and 120 (both values included).
(b) To increase the price of all the products by 20.
(a)
SELECT *
FROM PRODUCT
WHERE PRICE BETWEEN 40 AND 120;+------+-------------+--------------+-------+
| P_ID | ProductName | Manufacturer | Price |
+------+-------------+--------------+-------+
| P001 | MOISTURISER | XYZ | 40 |
| P004 | SHAMPOO | TAP | 95 |
+------+-------------+--------------+-------+
(b)
UPDATE PRODUCT
SET PRICE = PRICE + 20;