School Revise · Class 12 Information Practices · Chapter 1
Code 065, Class 12. SQL functions summarise and shape the data in a table. Here we use aggregate, text, number and date functions, and group rows with GROUP BY.
|
|
Functions in SQL work on the data in a table. Some summarise many rows into one value, and others change text, numbers or dates. GROUP BY makes summaries per group.
These summarise a column: COUNT counts rows, SUM adds, AVG averages, and MAX and MIN find the largest and smallest.
|
SELECT AVG(salary) FROM EMP; (shows the average of the salary column) |
Text: UCASE and LCASE change case, LENGTH counts characters, MID takes part of a string. Number: ROUND, POWER, MOD. Date: NOW, YEAR, MONTH, DAY.
GROUP BY makes one summary row per group, for example the average salary in each department. HAVING filters those groups, like a WHERE for groups.
Explore the idea by tapping. The interactive opens right here in the lesson.
Type each one into the code lab above, then open the card to see the worked solution and its output.
SOLUTION
OUTPUT
SOLUTION
OUTPUT
SOLUTION
OUTPUT
SOLUTION
OUTPUT
SOLUTION
OUTPUT
SOLUTION
OUTPUT
SOLUTION
OUTPUT
SOLUTION
OUTPUT
SOLUTION
OUTPUT
SOLUTION
OUTPUT
COUNT.
GROUP BY.
UCASE (or UPPER).
HAVING.
|
SQL functions work on table data. Aggregate functions COUNT, SUM, AVG, MAX and MIN summarise a column. Text functions (UCASE, LCASE, LENGTH, MID), number functions (ROUND, POWER, MOD) and date functions (NOW, YEAR, MONTH) shape single values. GROUP BY makes one summary per group, and HAVING filters those groups. |
| Open the Virtual Lab |
These free Class 12 Informatics Practices notes explain SQL functions, aggregate functions COUNT SUM AVG MAX and MIN, text number and date functions, and GROUP BY with HAVING with worked examples and practice, for CBSE students across India and the Gulf including the UAE, Saudi Arabia, Qatar, Oman, Kuwait and Bahrain.
© 2026 School Revise. All rights reserved. Original content aligned to the CBSE and NCERT Class 12 Informatics Practices syllabus. Unauthorised copying is not permitted.