Curriculum
Course: Grade XII IT (802)
Login
Text lesson

Ch-1 Database Concepts (RDBMS Tool)

School Revise · Class 12 Information Technology · Chapter 1

Database Concepts (RDBMS Tool)

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.

JOIN

links tables

GROUP BY

summarise groups

What this chapter is about

An RDBMS stores data in tables that can be linked. SQL creates, changes and questions the data, including joining tables and summarising groups.

1. The relational model

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.

2. Querying and grouping

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)

3. Joining tables

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.

Practise with the interactive

Explore the idea by tapping. The interactive opens right here in the lesson.

[sr_g12_it802 id=”g12-it802-ch1″]

Coding practice problems, with answers

Type each one into the code lab above, then open the card to see the worked solution and its output.

Problem 1. Show all rows.

SOLUTION

SELECT * FROM EMP;

OUTPUT

all rows and columns of EMP
Problem 2. Show employees earning above 50000.

SOLUTION

SELECT name FROM EMP WHERE salary > 50000;

OUTPUT

names earning above 50000
Problem 3. Sort by salary, highest first.

SOLUTION

SELECT * FROM EMP ORDER BY salary DESC;

OUTPUT

rows sorted by salary, largest first
Problem 4. Count the employees.

SOLUTION

SELECT COUNT(*) FROM EMP;

OUTPUT

the number of rows
Problem 5. Average salary per department.

SOLUTION

SELECT dept, AVG(salary) FROM EMP GROUP BY dept;

OUTPUT

one row per department with its average
Problem 6. Departments with average salary above 60000.

SOLUTION

SELECT dept FROM EMP GROUP BY dept HAVING AVG(salary) > 60000;

OUTPUT

groups meeting the condition
Problem 7. List each department once.

SOLUTION

SELECT DISTINCT dept FROM EMP;

OUTPUT

each department listed once
Problem 8. Names starting with A.

SOLUTION

SELECT name FROM EMP WHERE name LIKE “A%”;

OUTPUT

names beginning with A
Problem 9. Join two tables on a key.

SOLUTION

SELECT EMP.name, DEPT.dname FROM EMP JOIN DEPT ON EMP.deptid = DEPT.id;

OUTPUT

employee names with their department names
Problem 10. Update a salary.

SOLUTION

UPDATE EMP SET salary = 70000 WHERE id = 1;

OUTPUT

salary of employee 1 becomes 70000

Practice set A, multiple choice

1. Which command combines rows from two tables?

JOIN.

2. Which clause makes one summary per group?

GROUP BY.

3. Which filters groups?

HAVING.

4. Which key links two tables?

A foreign key.

Quick summary

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.

Layer 1
Login Categories