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
Itemno | Iname | Price (₹) | Quantity |
---|---|---|---|
101 | Soap | 50 | 100 |
102 | Powder | 100 | 50 |
103 | Facecream | 150 | 25 |
104 | Pen | 50 | 200 |
105 | Soapbox | 20 | 100 |
(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