MySQL Functions Practical File Questions
MySQL Functions Practical File Questions
MySQL
Sno Questions
1.
1 i. Create the table Product with appropriate data types and constraints
1 ii. List the Product Code, Product name and price in descending order
of their product name. If PName is the same then display the data in
ascending order of price
1 iii. Add a new column Discount to the table Product.
1 iv. Calculate the value of the discount in the table Product as 10 per
cent of the UPrice for all those products where the UPrice is more than
100, otherwise the discount will be 0.
1 v. Increase the price by 12 per cent for all the products manufactured
by Dove.
1 vi.Display the total number of products manufactured by each
manufacturer.
1 b) Write the output(s) produced by executing the following queries on
the basis of the information given above in the table Product:
1 i. SELECT PName, Average(UPrice) FROM Product GROUP BY
Pname;
1 ii. SELECT DISTINCT Manufacturer FROM Product;
1 iii. SELECT COUNT(DISTINCT PName) FROM Product;
1 iv. SELECT PName, MAX(UPrice), MIN(UPrice) FROM Product
GROUP BY PName;
Sn Questions
o
2.
-----------------------------------------------------------------------------------------------------------
5.