Q. In a database there are two tables "Product" and "Client" as shown below:


Table: Product


P_ID

ProductName

Manufacture

Price

P001

Moisturiser

XYZ

40

P002

Sanitizer

LAC

35

P003

Bath Soap

COP

25

P004

Shampoo

TAP

95

P005

Lens Solution

COP

350


Table: Client


C_ID

ClientName

City

P_ID

01

Dreamz Disney

New Delhi

P002

05

Life Line Inc

Mumbai

P005

12

98.4

New Delhi

P001

15

Appolo

Bangalore

P003


Write the commands in SQL queries for the following:

(i) To display the details of Product whose Price is in the range of 40 and 120 (Both values included).

(ii) To display the ClientName, City from table Client and ProductName and Price from table Product, with their corresponding matching P_ID.

(iii) To increase the Price of all the Products by 20.


Answer :-

i = Select * from Product where Price between 40 and 120 ;

ii = ClientName, City , ProductName , Price from Product , client where product.P_ID  = Client.P_ID ;

iii = update Product set Price = Price + 20 ;

Post a Comment

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

Previous Post Next Post