Q. Write SQL queries to perform the following based on the table PRODUCT having fields as (prod_id, prod_name, quantity, unit_rate, price, city)


(i) Display those records from table PRODUCT where prod_id is more than 100.

(ii) List records from table PRODUCT where prod_name is ‘Almirah’

(iii) List all those records whose price is between 200 and 500.

(iv) Display the product names whose price is less than the average of price.

(v) Show the total number of records in the table PRODUCT.


Answer :-

(i) Select * from product where pro_id > 100 ;
(ii) Select * from product where pro_name = “Almirah” ;
(iii) Select * from product where price between 200 and 500 ;
(iv) Select name from product where ( select avg ( price ) from product ) > price ;
(v) Select count (*) from product ;

Post a Comment

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

Previous Post Next Post