KnowledgeBoat Logo

Class - 12 CBSE Computer Science Important Output Questions 2025

Consider the table "Item" given below and give the outputs on the basis of it:

Table: ITEM

ItemnoInamePrice (₹)Quantity
101Soap50100
102Powder10050
103Facecream15025
104Pen50200
105Soapbox20100

(a) SELECT SUM(Price) FROM ITEM;

(b) SELECT AVG(Price) FROM ITEM;

(c) SELECT MIN(Price) FROM ITEM;

(d) SELECT MAX(Price) FROM ITEM;

(e) SELECT COUNT(Price) FROM ITEM;

(f) SELECT DISTINCT Price FROM ITEM;

(g) SELECT COUNT(DISTINCT Price) FROM ITEM;

(h) SELECT Iname, Price*Quantity FROM ITEM;

SQL Queries

1 Like

Answer

(a) SELECT SUM(Price) FROM ITEM;

Output
+------------+
| SUM(Price) |
+------------+
|        370 |
+------------+

(b) SELECT AVG(Price) FROM ITEM;

Output
+------------+
| AVG(Price) |
+------------+
|    74.0000 |
+------------+

(c) SELECT MIN(Price) FROM ITEM;

Output
+------------+
| MIN(Price) |
+------------+
|         20 |
+------------+

(d) SELECT MAX(Price) FROM ITEM;

Output
+------------+
| MAX(Price) |
+------------+
|        150 |
+------------+

(e) SELECT COUNT(Price) FROM ITEM;

Output
+--------------+
| COUNT(Price) |
+--------------+
|            5 |
+--------------+

(f) SELECT DISTINCT Price FROM ITEM;

Output
+-------+
| Price |
+-------+
|    50 |
|   100 |
|   150 |
|    20 |
+-------+

(g) SELECT COUNT(DISTINCT Price) FROM ITEM;

Output
+-----------------------+
| COUNT(DISTINCT Price) |
+-----------------------+
|                     4 |
+-----------------------+

(h) SELECT Iname, Price*Quantity FROM ITEM;

Output
+-----------+----------------+
| Iname     | Price*Quantity |
+-----------+----------------+
| SOAP      |           5000 |
| POWDER    |           5000 |
| FACECREAM |           3750 |
| PEN       |          10000 |
| SOAPBOX   |           2000 |
+-----------+----------------+

Answered By

2 Likes