SolveItNCERT · CBSE Boards

CBSE 2026 · Central · Set 4 · Q32 · 4 marks

Abhishek has created a table, named STOCK, with a set of records to maintain the data of packaged milk in his shop. After creating the table, he entered the data and the table looked as follows:
CodeTypeVolumeQtyPrice
AF0.5F$\displaystyle 0.5$$\displaystyle 300$$\displaystyle 38.00$
MF0.5F$\displaystyle 0.5$$\displaystyle 250$$\displaystyle 36.50$
MT1.0T$\displaystyle 1.0$$\displaystyle 150$$\displaystyle 64.00$
AT1.0T$\displaystyle 1.0$$\displaystyle 100$$\displaystyle 66.00$
PD1.0D$\displaystyle 1.0$$\displaystyle 50$$\displaystyle 52.00$
PT0.5T$\displaystyle 0.5$$\displaystyle 78$$\displaystyle 30.00$
(a)
Based on the data given above, write the SQL queries for the following tasks :
(i)
To display Type and the maximum Price for each Type of milk.
(ii)
For each record, increase the Price by $\displaystyle 0.5$ where Type is 'F'.
(iii)
To display the total value of the stock (total of Qty × Price).
(iv)
To display the details of all records where Code starts with 'A'.
(b)
Considering the table STOCK as given above, write the output on execution of the following queries :
(i)
SELECT Volume, Qty, Price FROM STOCK WHERE Type IN ('F','D');
(ii)
SELECT Code, Qty FROM STOCK WHERE Price BETWEEN $\displaystyle 30$ AND $\displaystyle 50$;
(iii)
SELECT DISTINCT Type FROM STOCK;
(iv)
SELECT Volume, count(*) FROM STOCK GROUP BY Volume;

Structured Query LanguageGROUP BY and HAVINGApplycase_study

More from Structured Query Language

CBSE Class 12 Computer Science past-paper question from the 2026board exam, with the answer as CBSE’s own marking scheme gives it. Where our answers come from.