CBSE Class 12 Information Technology (802) Unit 1 Notes - Database Concepts – RDBMS Tool | Complete SQL Notes 2026-27

 

CBSE Class 12 Information Technology Unit 1: Database Concepts – RDBMS Tool

Complete RDBMS & SQL Notes | Easy Explanation | PYQs with Answers | Exam Tricks


CBSE Class 12 Information Technology (802) students often find Database Management and SQL confusing because of commands, syntax and different types of queries.

Don't worry! These notes explain RDBMS and SQL in very simple, student-friendly language, with examples that are useful for CBSE Board Exams, school exams, practicals and viva.


📚 Unit 1: Database Concepts – RDBMS Tool

Topics Covered

  1. Basics of RDBMS

  2. SQL – Creating and Opening Database

  3. Creating and Populating Tables

  4. Modifying the Content and Structure of Table

  5. Ordering and Grouping

  6. Operating with Multiple Tables

  7. Important SQL Commands

  8. CBSE Exam Tricks

  9. PYQ / Board-Style Questions with Answers

  10. Quick Revision Sheet

  11. Frequently Asked Questions


1. Basics of RDBMS

What is a Database?

A database is an organised collection of related data.

Example:

Suppose a school stores information about students:

Roll No.NameClassMarks
101RahulXII85
102PriyaXII91
103AmanXII78

This collection of student information can be stored in a database.


What is DBMS?

DBMS = Database Management System

A DBMS is software used to create, store, manage, update and retrieve data from a database.

Examples of DBMS

  • MySQL

  • Oracle

  • MS Access

  • PostgreSQL

  • SQLite


2. What is RDBMS?

RDBMS = Relational Database Management System

An RDBMS stores data in the form of tables.

A table consists of:

  • Rows

  • Columns

Example

STUDENT

RollNoNameClassMarks
1RaviXII80
2NehaXII92
3AmanXII75

Here:

  • Table → STUDENT

  • Columns / Fields → RollNo, Name, Class, Marks

  • Rows / Records → Individual student details

Easy Trick

Column = Field = Attribute
Row = Record = Tuple

Remember:

F-A-R-T

Field → Attribute → Record → Tuple



3. Important Terms in RDBMS

Table

A table stores related data in rows and columns.

Field

A field represents a particular type of information.

Example:

Name, Age, Marks

Record

A complete row of information is called a record.

Primary Key

A Primary Key is a field or combination of fields that uniquely identifies each record in a table.

Example:

RollNo INT PRIMARY KEY

If RollNo is unique for every student, it can be used as a Primary Key.

Properties of Primary Key

  • It must contain unique values.

  • It cannot contain NULL values.

  • A table generally has one primary key constraint.

  • It uniquely identifies records.

Exam Trick

Primary Key = Unique Identity of a Record


4. What is SQL?

SQL = Structured Query Language

SQL is used to communicate with a relational database.

We can use SQL to:

  • Create a database

  • Create tables

  • Insert data

  • Retrieve data

  • Update data

  • Delete data

  • Modify table structure

  • Sort records

  • Group records

  • Work with multiple tables


5. SQL Commands – Basic Categories

Some commonly used SQL commands are:

CategoryMeaningExamples
DDLData Definition LanguageCREATE, ALTER, DROP
DMLData Manipulation LanguageINSERT, UPDATE, DELETE
DQLData Query LanguageSELECT

Easy Memory Trick

DDL = Design
DML = Modify Data
DQL = Query Data



6. Creating a Database

The CREATE DATABASE command is used to create a new database.

Syntax

CREATE DATABASE database_name;

Example

CREATE DATABASE SCHOOL;

This creates a database named SCHOOL.


7. Opening / Selecting a Database

In MySQL, the USE command is used to select a database.

Syntax

USE database_name;

Example

USE SCHOOL;

Now SQL commands will operate on the selected SCHOOL database.

Exam Trick

CREATE = Create database
USE = Select/Open database for use


8. Creating a Table

The CREATE TABLE command is used to create a table.

Syntax

CREATE TABLE table_name
(
column1 datatype,
column2 datatype,
column3 datatype
);

Example

CREATE TABLE STUDENT
(
RollNo INT PRIMARY KEY,
Name VARCHAR(30),
Class INT,
Marks INT
);

9. Common SQL Data Types

Data TypeUse
INTWhole numbers
DECIMALDecimal numbers
CHAR(n)Fixed-length characters
VARCHAR(n)Variable-length characters
DATEDate values
TIMETime values

Example

Name VARCHAR(30)

This means the Name field can store character data up to 30 characters.


10. Populating a Table

Populating means adding records/data to a table.

The INSERT INTO command is used to insert records.

Syntax

INSERT INTO table_name
VALUES (value1, value2, value3);

Example

INSERT INTO STUDENT
VALUES (101, 'Rahul', 12, 85);

Another record:

INSERT INTO STUDENT
VALUES (102, 'Priya', 12, 91);

Inserting Data into Selected Columns

INSERT INTO STUDENT (RollNo, Name, Marks)
VALUES (103, 'Aman', 78);

Only the specified columns receive values; other columns depend on their definitions/defaults.


11. Displaying Records

The SELECT command is used to retrieve data.

Display all columns

SELECT * FROM STUDENT;

* means all columns.

Display selected columns

SELECT Name, Marks
FROM STUDENT;

This displays only Name and Marks.

Exam Trick

SELECT * = Show everything


12. WHERE Clause

The WHERE clause is used to specify a condition.

Example

SELECT * FROM STUDENT
WHERE Marks > 80;

This displays students whose marks are greater than 80.

Other Operators

OperatorMeaning
=Equal to
>Greater than
<Less than
>=Greater than or equal to
<=Less than or equal to
<> / !=Not equal to

13. Logical Operators

SQL commonly uses:

  • AND

  • OR

  • NOT

AND

Both conditions must be true.

SELECT * FROM STUDENT
WHERE Marks > 80 AND Class = 12;

OR

At least one condition should be true.

SELECT * FROM STUDENT
WHERE Marks > 90 OR Class = 12;

NOT

Negates a condition.

SELECT * FROM STUDENT
WHERE NOT Class = 11;

14. Modifying the Content of a Table

The UPDATE command is used to change existing data.

Syntax

UPDATE table_name
SET column_name = new_value
WHERE condition;

Example

Suppose Rahul's marks were entered as 85 but should be 88.

UPDATE STUDENT
SET Marks = 88
WHERE RollNo = 101;

⚠️ Important Exam Point

Always be careful with the WHERE clause.

UPDATE STUDENT
SET Marks = 88;

This can update Marks for all records because there is no WHERE condition.

Trick

UPDATE without WHERE = Think Twice!


15. Deleting Records

The DELETE command removes records from a table.

Syntax

DELETE FROM table_name
WHERE condition;

Example

DELETE FROM STUDENT
WHERE RollNo = 103;

This deletes the record whose RollNo is 103.

Important Difference

DELETE FROM STUDENT;

removes all records from the table, but the table structure remains.


16. Modifying the Structure of a Table

The ALTER TABLE command is used to modify the structure of an existing table.

You can use it to:

  • Add a column

  • Modify a column

  • Drop a column

  • Add/modify constraints, depending on the SQL system


Adding a Column

Syntax

ALTER TABLE table_name
ADD column_name datatype;

Example

ALTER TABLE STUDENT
ADD City VARCHAR(30);

A new City column is added.


Modifying a Column

The exact syntax can vary with the database system.

For MySQL, for example:

ALTER TABLE STUDENT
MODIFY Name VARCHAR(50);

This changes the size of the Name column.


Removing a Column

ALTER TABLE STUDENT
DROP COLUMN City;

This removes the City column.

Memory Trick

ALTER = Change the table structure


17. ORDER BY – Ordering Records

ORDER BY is used to arrange records in ascending or descending order.

Ascending Order

SELECT * FROM STUDENT
ORDER BY Marks ASC;

ASC means ascending.

Descending Order

SELECT * FROM STUDENT
ORDER BY Marks DESC;

DESC means descending.

Easy Trick

ASC = A to Z / Small to Big
DESC = Z to A / Big to Small


18. GROUP BY – Grouping Records

GROUP BY is used to group rows having the same value in a column.

It is commonly used with aggregate functions such as:

  • COUNT()

  • SUM()

  • AVG()

  • MAX()

  • MIN()

Example Table: SALES

ProductCityAmount
PenRajkot100
BookRajkot300
PenAhmedabad200
BookAhmedabad400

To calculate total sales city-wise:

SELECT City, SUM(Amount)
FROM SALES
GROUP BY City;

This groups records according to City and calculates the total amount for each city.


19. Aggregate Functions

Aggregate functions perform calculations on a group of records.

FunctionMeaning
COUNT()Counts records/values
SUM()Calculates total
AVG()Calculates average
MAX()Finds maximum
MIN()Finds minimum

Examples

SELECT COUNT(*) FROM STUDENT;

Counts all records.

SELECT MAX(Marks) FROM STUDENT;

Finds the highest marks.

SELECT MIN(Marks) FROM STUDENT;

Finds the lowest marks.

SELECT AVG(Marks) FROM STUDENT;

Calculates average marks.

SELECT SUM(Marks) FROM STUDENT;

Calculates total marks.


20. GROUP BY with Aggregate Function

Suppose we have:

EMPLOYEE

EmpIDNameDepartmentSalary
1ASales30000
2BHR35000
3CSales40000
4DHR45000

To calculate department-wise average salary:

SELECT Department, AVG(Salary)
FROM EMPLOYEE
GROUP BY Department;

21. HAVING Clause

HAVING is generally used to apply a condition on groups created using GROUP BY.

Example

SELECT Department, AVG(Salary)
FROM EMPLOYEE
GROUP BY Department
HAVING AVG(Salary) > 35000;

This displays only those departments whose average salary is greater than 35000.

Very Important Difference

WHERE → condition on individual rows before grouping.

HAVING → condition on groups after grouping.

Exam Trick

WHERE → Rows
HAVING → Groups



22. Operating with Multiple Tables

In a relational database, information is often divided into multiple related tables.

For example:

STUDENT

RollNoNameClass
1RahulXII
2PriyaXII

MARKS

RollNoSubjectMarks
1Accountancy85
2Accountancy91

The common field is:

RollNo

This field can be used to connect the tables.


23. Primary Key and Foreign Key

Primary Key

Uniquely identifies a record in its own table.

Example:

RollNo INT PRIMARY KEY

Foreign Key

A Foreign Key is a field that refers to a key in another table and helps establish a relationship between tables.

Example

In the STUDENT table:

RollNo → Primary Key

In the MARKS table:

RollNo → Foreign Key

Easy Trick

Primary Key = Own Identity
Foreign Key = Connects Tables

 


24. JOIN – Working with Multiple Tables

A JOIN combines related data from two or more tables.

Example

SELECT STUDENT.Name, MARKS.Subject, MARKS.Marks
FROM STUDENT
INNER JOIN MARKS
ON STUDENT.RollNo = MARKS.RollNo;

This combines student information with marks information using RollNo.


25. INNER JOIN

INNER JOIN returns records where matching values exist in both tables.

Syntax

SELECT column_names
FROM Table1
INNER JOIN Table2
ON Table1.common_field = Table2.common_field;

Example

SELECT STUDENT.Name, MARKS.Marks
FROM STUDENT
INNER JOIN MARKS
ON STUDENT.RollNo = MARKS.RollNo;

26. SQL Query Order – Important Trick

When writing a query containing several clauses, remember this general order:

SELECT
FROM
WHERE
GROUP BY
HAVING
ORDER BY

Super Trick

Remember:

S F W G H O

You can remember it as:

"Students Find What Groups Have Order."

Not every query requires all these clauses.


27. Common SQL Commands – Quick Revision

Purpose            Command
Create database            CREATE DATABASE
Select database            USE
Create table            CREATE TABLE
Insert records            INSERT INTO
Display records            SELECT
Change records            UPDATE
Delete records            DELETE
Change table structure            ALTER TABLE
Sort records            ORDER BY
Group records                    GROUP BY
Filter rows            WHERE
Filter groups            HAVING
Combine tables            JOIN

⭐ CBSE EXAM TRICKS

Trick 1 – CREATE vs INSERT

CREATE creates the structure.

INSERT adds data.

CREATE = Structure
INSERT = Records


Trick 2 – UPDATE vs ALTER

UPDATE changes data.

ALTER changes table structure.

UPDATE →






📚 Also Read - Important for 2026:
👉 Class 12 All Chapters Notes
👉 Class 11 Commerce Notes
🚀 Join CommerceWallah12 Family - Free Notes Daily!

▶️ YouTube: Subscribe Now - CommerceWallah12
📸 Instagram: Follow on Instagram
💬 WhatsApp Channel: Join WhatsApp Channel for MCQs
📱 Direct Help: 9664795023

Disclaimer: Ye notes NCERT & CBSE pattern par banaye gaye hai. Koi doubt ho to Contact Us par message karein.

Comments

Popular posts from this blog

CBSE Class 12 Business Studies: 50 MCQs with Answers | Chapters 1–4

CBSE Class 12 Accountancy Unit 1 Notes | Accounting for Partnership Firms

CBSE Class 12 Business Studies Chapter 2 Notes – Principles of Management