0% found this document useful (0 votes)
20 views

MySQL Functions Practical File Questions

sql
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views

MySQL Functions Practical File Questions

sql
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

4.

MySQL
Sno Questions
1.

Consider the following table named “Product”, showing details of


products being sold in a grocery shop.
1 a) Write SQL queries for the following:

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.

(i) To display the list of foreigner friends in descending order of their


name.
(ii) To count the number of friends who have an email ID on Gmail.
(iii) To count the number of friends in each country having number of
friends more than 2.
(iv) To count the total number of countries (no duplicate value) having
friends.
(v) To display the age of youngest friend in each country.
(vi) To display the position of occurrence of string “@” in each email
ID.
(vii) To delete all records of the friends whose age is either 12 or 14 or
15.
3.
4.

-----------------------------------------------------------------------------------------------------------

5.

You might also like