School Revise · Class 12 Information Technology · Chapter 1
Code 802, Class 12. A relational database keeps data in linked tables, and SQL questions it. Here we revise the model and write richer queries.
|
|
An RDBMS stores data in tables that can be linked. SQL creates, changes and questions the data, including joining tables and summarising groups.
A relation is a table, a tuple a row and an attribute a column. A primary key identifies each row, and a foreign key links to another table.
SELECT reads data, WHERE filters, ORDER BY sorts. GROUP BY makes a summary per group and HAVING filters groups. Aggregate functions COUNT, SUM, AVG, MAX and MIN summarise.
|
SELECT dept, AVG(salary) FROM EMP GROUP BY dept; (shows the average salary in each department) |
A JOIN combines rows from two tables using a shared key, for example a student table joined to a class table, so one query can use data from both.
Explore the idea by tapping. The interactive opens right here in the lesson.
[sr_g12_it802 id=”g12-it802-ch1″]
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
JOIN.
GROUP BY.
HAVING.
A foreign key.
|
An RDBMS stores data in linked tables. A relation is a table, a tuple a row and an attribute a column; a primary key identifies each row and a foreign key links tables. SELECT reads, WHERE filters, ORDER BY sorts, GROUP BY summarises per group and HAVING filters groups. A JOIN combines rows from two tables using a shared key. |
| Open the Virtual Lab |
These free Class 12 Information Technology (Code 802) notes explain database concepts and the RDBMS tool, the relational model and keys, SQL queries, GROUP BY and HAVING, and JOIN 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 Information Technology syllabus. Unauthorised copying is not permitted.