Computer Science - Informatics Practices Class XI/XII MySQL Test Series Part 12

Computer Science - Informatics Practices Class XI/XII MySQL Test Series Part 12


Q1. Write the output of the following on the basis of given table : Product

  


1. Select max(price) from product;

2. Select avg(price) from product;

3. Select min(qty) from product;

4. Select count(*) from product;

5. Select count(Qty) from product;

6. Select distinct(price) from product;

7. Select count(distinct(price)) from product;

8. Select price * Qty from product;

9. Select sum(price) from product;

10. Select sum(price) where Qty > 30;


 SOLUTIONS

Q1. Write the output of the following on the basis of given table : Product

  


1. Select max(price) from product;

Ans. 320

2. Select avg(price) from product;

Ans. 218

3. Select min(qty) from product;

Ans. 17

4. Select count(*) from product;

Ans. 5

5. Select count(Qty) from product;

Ans. 5

6. Select distinct(price) from product;

Ans. 

240

300

320

130

100

7. Select count(distinct(price)) from product;

Ans. 5

8. Select price * Qty from product;

Ans. 

5520

7200

13760

4160

1700

9. Select sum(price) from product;

Ans. 1090

10. Select sum(price) where Qty > 30;

Ans. Error



No comments:

Post a Comment

Most Recently Published

File Handling Test 6

 File Handling Test 6 Q1 . Do we need to use the close() function when we use 'with' statement to open a file? Q2. Which mode you wi...

CS - IP Assignment/Worksheet