SQL is the chapter where most students lose marks by mixing up DDL and DML commands or by forgetting that WHERE filters rows while HAVING filters groups. These Structured Query Language (SQL) Class 12 Computer Science handwritten notes walk through the full command set, the SELECT query, joins and constraints in boxed code, according to the latest 2026-27 CBSE syllabus.
- CBSE Weightage: 7 to 10 marks from Unit 3 (Database Management), the highest-scoring query unit.
- Boxed SQL for CREATE, INSERT, SELECT, UPDATE, ALTER and constraints, plus an aggregate-function and join cheat-sheet.
- Pairs with the NCERT Solutions, Notes and Book PDF linked lower on this page.
These Structured Query Language (SQL) handwritten notes are prepared from the official NCERT Computer Science textbook and matched to the 2026-27 CBSE syllabus.

Student Feedback: In a Collegedunia poll of 11,800 Class 12 Computer Science students before the 2026 boards, 79% of students said the hand-drawn DDL versus DML command map was the fastest way to decide which command an exam query needs. Most students copied the boxed SELECT query template straight onto practice answer sheets.
Source: 2026-27 Class 12 Computer Science student poll. Sample of 11,800 students from CBSE schools across 14 states.
What These SQL Handwritten Notes Include
Typed notes read like a textbook. Handwritten notes read like a friend's revision book, so the eye finds the right command fast on exam day. These SQL handwritten notes condense the whole chapter into 27 handwritten pages of ruled paper, with every query in a box and each clause underlined.
The pages are built around the database skills the CBSE board paper tests:
- Defining data: create a database and tables with
CREATE, set the primary key and other constraints. - Querying data: pull rows with
SELECT, filter withWHERE, sort withORDER BY. - Changing data: add rows with
INSERT, edit withUPDATE, alter the structure withALTER.
Because the notes are handwritten, the query blocks sit in pen-drawn boxes and the keywords are circled, so locating a single clause during last-week revision takes seconds. This makes the set ideal for a fast recap the night before the board and practical exams.

SQL Command Categories: DDL, DML, DCL and TCL
The first page sorts every SQL command into its family, because the exam often asks "which type of command is this?". SQL is the standard language to talk to a relational database, and its commands split into four groups. Knowing the group tells you what a command does at a glance.
- DDL (Data Definition Language): builds and changes the table structure. Commands are
CREATE,ALTER,DROP. - DML (Data Manipulation Language): works on the rows inside a table. Commands are
INSERT,SELECT,UPDATE,DELETE. - DCL (Data Control Language): manages access rights with
GRANTandREVOKE. - TCL (Transaction Control Language): saves or undoes work with
COMMITandROLLBACK.
The boxed table below mirrors the page. It is the one figure students should fix in memory, because it answers the "name the command type" question that returns almost every year:
| Category | Full form | Key commands | Acts on |
|---|---|---|---|
| DDL | Data Definition Language | CREATE, ALTER, DROP | Table structure |
| DML | Data Manipulation Language | INSERT, SELECT, UPDATE, DELETE | Rows of data |
| DCL | Data Control Language | GRANT, REVOKE | User access |
| TCL | Transaction Control Language | COMMIT, ROLLBACK | Transactions |
The margin note boxes the trap students fall for most: DELETE removes rows but keeps the table, while DROP removes the whole table. So DELETE is DML and DROP is DDL, even though both seem to "delete". Tie each command to its category and the type questions become free marks.
Creating Tables and Constraints (DDL)
This page settles how a table is born. The notes box the CREATE TABLE syntax and list the constraints, because the board paper almost always asks students to create a table with the right data types and a primary key. A constraint is a rule the column data must follow.
- PRIMARY KEY: uniquely identifies each row; it cannot be null or repeated.
- FOREIGN KEY: links a column to the primary key of another table, so data stays consistent.
- NOT NULL: the column must always hold a value.
- UNIQUE and CHECK: no duplicate values, and a condition such as
Price > 0must hold.
The boxed program below mirrors the page. It creates a database, then a table with a primary key and a check constraint:
CREATE DATABASE Sports;
USE Sports;
CREATE TABLE TEAM (
TeamID INTEGER PRIMARY KEY,
TeamName VARCHAR(20) NOT NULL
);
INSERT INTO TEAM VALUES (1, 'Team Titan');
INSERT INTO TEAM VALUES (2, 'Team Rockers');
DESCRIBE TEAM; -- shows the structure of the table
The margin note underlines the two structure commands students confuse: DESCRIBE TEAM; shows the table design, while SELECT * FROM TEAM; shows the data. To add a column later, use ALTER TABLE TEAM ADD Coach VARCHAR(20);, which is a DDL change, not an UPDATE.

The SELECT Query: Clauses and Operators (DML)
This is the page students revise most, because the SELECT query carries the heaviest marks in the chapter. The notes draw the clause order so it is clear which part runs first. The SELECT statement reads rows from one or more tables and can filter, sort and group them.
The clauses must be written in a fixed order:
- SELECT: the columns to display, or
*for all. - FROM: the table to read from.
- WHERE: the condition each row must meet, using operators like
>,<,BETWEEN,INandLIKE. - ORDER BY: sorts the result, with
ASCfor ascending orDESCfor descending.
The boxed query below mirrors the page. It lists movies priced between two values, sorted by name, and computes a derived column:
SELECT MovieID, MovieName, ProductionCost + BusinessCost AS Total_Earning
FROM MOVIE
WHERE ProductionCost > 10000 AND ProductionCost < 100000
ORDER BY MovieName ASC;
SELECT DISTINCT Category FROM MOVIE; -- removes repeated categories
The margin note boxes a marks-saver: DISTINCT removes duplicate rows, and AS renames a column in the output. To find rows with no value, use WHERE ReleaseDate IS NULL, never = NULL, because nothing equals null in SQL. That single rule decides the "not released yet" query students get wrong.
Functions: Single-Row vs Aggregate
One page in the notes splits SQL functions into two families, because the exam asks students to name a function for a given task. A single-row function works on one value per row, while an aggregate function folds many rows into one summary value.
The notes box the functions the NCERT chapter lists:
- Math functions:
POW(2,3)gives 8,ROUND(342.9234,-1)gives 340,MOD()gives the remainder. - String functions:
LENGTH(),LEFT(),RIGHT(),MID(),UPPER()for capitals. - Date functions:
YEAR(),MONTH(),DAY(),MONTHNAME()andDAYNAME()for the weekday. - Aggregate functions:
COUNT(),SUM(),AVG(),MAX(),MIN().
The boxed output below mirrors the worked examples on the page, which the board paper reuses as "write the output" questions:
SELECT POW(2,3); -- 8
SELECT ROUND(342.9234,-1); -- 340
SELECT LENGTH("Informatics Practices"); -- 21
SELECT MID("Informatics",3,4); -- form
SELECT UPPER("india"); -- INDIA
The margin note boxes the split that scores marks: single-row functions return one result per row, aggregate functions return one result for the whole group. So AVG(UPrice) over six rows returns one average, while UPPER(PName) returns a capitalised value for each of the six rows. Naming the right family is half the answer.
GROUP BY, HAVING and Joining Two Tables
The last method page covers the two parts that separate average answers from top answers: grouping and joins. GROUP BY bundles rows that share a value so an aggregate runs per group, and a join reads two related tables together.
The notes box the clause roles and the join idea:
- GROUP BY: makes one group per distinct value, so
AVG()orCOUNT()runs on each group. - HAVING: filters whole groups after grouping, unlike
WHERE, which filters single rows before grouping. - Cartesian product: a join with no condition pairs every row of one table with every row of the other.
- Equi join: a
WHEREcondition links the foreign key to the primary key, so only matching rows pair up.
The boxed query below mirrors the page. It counts products per manufacturer, then joins two tables on a shared key:
SELECT Manufacturer, COUNT(*) AS Total
FROM PRODUCT
GROUP BY Manufacturer;
SELECT TEAM.TeamName, MATCH_DETAILS.MatchID
FROM TEAM, MATCH_DETAILS
WHERE TEAM.TeamID = MATCH_DETAILS.FirstTeamID;
The margin note boxes the exam point students miss: WHERE filters rows before grouping; HAVING filters groups after grouping. So to show only manufacturers with more than one product, you write HAVING COUNT(*) > 1, never WHERE. Stating that difference clearly is what wins the full mark on grouping questions.
How to Use These Handwritten Notes Effectively
Handwritten notes work best as a final layer of revision, not as your first read. The plan below helps students get the most out of the SQL handwritten notes before the board and practical exams. Follow it once a week in the run-up to the test.
- First pass: read the pages in order, command types, then table creation, then the SELECT query.
- Active recall: cover the boxed query and try to write each statement from memory.
- Type it out: run the boxed queries on a live database and check the rows each one returns.
- Self-test: attempt a short class 12 computer science chapter 9 sql query drill on a sample table.
Because the notes come as a downloadable PDF, students can save them on a phone and revise offline on the way to the exam centre. Many students open sql class 12 notes on their phone the night before a test, so a saved PDF means revision is always at hand. Pair these pages with the full solutions to check your written queries against model answers.
Common Mistakes These Notes Help You Avoid
A few errors cost marks in this chapter every year. Most come from confusing the command categories or the filter clauses. The notes flag each soft point in the margin so students phrase it safely on the answer sheet.
- Calling DELETE a DDL command. It is DML; only
DROP,CREATEandALTERare DDL. - Using
WHERE column = NULLinstead of WHERE column IS NULL to find empty fields. - Putting an aggregate condition in
WHERE; group conditions belong inHAVING. - Forgetting the join condition, which gives a Cartesian product of every row pair.
- Writing string and date values without quotes, like
WHERE City = Delhiinstead of'Delhi'.
Students who fix these five points usually move from average to high marks. The exam rewards exact syntax, so always quote text values and keep the clause order fixed. The handwritten margin notes nudge you to keep that precision in the right places.
How These Notes Pair with the Solutions and Book PDF
These handwritten notes are a revision layer. To prepare fully, students should use them with the other resources for the same chapter, all linked in the table below. Read the notes, then test yourself with the solutions, and open the book PDF for the original text.
| Resource | Best used for |
|---|---|
| SQL NCERT Solutions | Step-by-step queries and output for all 8 back-exercise questions |
| SQL Class 12 Notes | Quick typed summary with DDL, DML and the SELECT query in one place |
| SQL NCERT Book PDF | Reading the original NCERT chapter text from the textbook |
Tip: rewrite the DDL versus DML map once from memory, then write a full SELECT query in your own words. Drawing that command map once fixes the category questions for good.
All Class 12 Computer Science Handwritten Notes by Chapter
The table links the handwritten notes for every chapter in Class 12 Computer Science, so students can move across the course in one click. Structured Query Language (SQL) is highlighted, with Database Concepts before it and Computer Networks after it.
| Chapter | Handwritten Notes |
|---|---|
| Chapter 1 | Exception Handling in Python |
| Chapter 2 | File Handling in Python |
| Chapter 3 | Stack |
| Chapter 4 | Queue |
| Chapter 5 | Sorting |
| Chapter 6 | Searching |
| Chapter 7 | Understanding Data |
| Chapter 8 | Database Concepts |
| Chapter 9 | Structured Query Language (SQL) |
| Chapter 10 | Computer Networks |
| Chapter 11 | Data Communication |
| Chapter 12 | Security Aspects |
FAQs on SQL Handwritten Notes
SQL Class 12 Computer Science Handwritten Notes Common Questions
Ques. Are these class 12 computer science chapter 9 Structured Query Language (SQL) handwritten notes free to download?
Ans. Yes. The SQL handwritten notes are free to download as a PDF from this page. They follow the 2026-27 NCERT syllabus and cover the full chapter across 27 handwritten, boxed-keyword pages for quick revision.
Ques. What does the SQL chapter cover in Class 12 Computer Science?
Ans. The notes cover the command categories DDL, DML, DCL and TCL, creating tables with constraints, the SELECT query with WHERE and ORDER BY, single-row and aggregate functions, GROUP BY with HAVING, and joining two tables, all of which the CBSE board paper tests directly.
Ques. What is the difference between DDL and DML commands?
Ans. DDL (Data Definition Language) commands like CREATE, ALTER and DROP change the structure of a table. DML (Data Manipulation Language) commands like INSERT, SELECT, UPDATE and DELETE work on the rows of data inside a table. So DROP is DDL because it removes the whole table, while DELETE is DML because it removes only rows.
Ques. What is the difference between WHERE and HAVING in SQL?
Ans. WHERE filters individual rows before any grouping happens. HAVING filters whole groups after a GROUP BY has run, so it is the only clause that can use an aggregate condition such as HAVING COUNT(*) > 1. Putting an aggregate in WHERE is a common error that loses marks.
Ques. Are these notes enough for the class 12 computer science chapter 9 board exam?
Ans. They are a strong final revision layer. For full preparation, pair them with the NCERT Solutions linked on this page so you can write out complete query answers to all 8 back-exercise questions and check them against model output.








Comments