Computer Science - Class 12
Solutions to CBSE Sample Paper - Computer Science Class 12

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.

Go Ad-free
Davneet Singh's photo - Co-founder, Teachoo

Made by

Davneet Singh

Davneet Singh has done his B.Tech from Indian Institute of Technology, Kanpur. He has been teaching from the past 14 years. He provides courses for Maths, Science and Computer Science at Teachoo