G
Genelis
Login Start Learning
Board Exam Preparation · Class 12

Class 12 Computer Science 2026–27: Python, SQL, File Handling & Networks — Complete Preparation Guide

The CS board exam is pen-and-paper. Python is 57% of theory. Here's the complete guide to unit weightage, the trace-by-hand skill, and a full syntax reference.

Here's the fact about CBSE Class 12 Computer Science that changes how you should actually prepare for it: the 70-mark theory exam is written entirely on paper. No computer, no compiler, no IDE that highlights your syntax errors in red. You write Python functions, SQL queries, and network diagrams by hand, and the examiner reads your code the way you wrote it — indentation, syntax, and all. This means the core skill being tested isn't "can you build something" — it's "can you read and trace through code correctly, and write syntactically correct code from memory, without a computer checking your work."

This guide covers exactly where your marks come from, why tracing code by hand is the skill that actually decides your score, and a complete syntax reference across Python, SQL, and networking — the three units that make up your theory paper.

70 Marks Theory. 30 Marks Practical. Here's Exactly Where Every Mark Comes From.

70

Theory Examination

Pen-and-paper exam covering Python, Computer Networks, and Database Management

30

Practical Examination

Conducted at school with an external examiner — actual computer-based coding and queries

CBSE Class 12 Computer Science

Theory unit-wise marks distribution (70 marks) 2025–26

Computational Thinking & Programming-2
40 marks ★
Database Management
20 marks
Computer Networks
10 marks

Source: CBSE official 2025–26 curriculum (Code 083). Python-based programming alone accounts for over half the theory paper.

Typical practical exam breakdown (30 marks):

8
Python Program
4
SQL Queries
7
Practical File
8
Project Work
3
Viva Voce

The Skill Nobody Names Explicitly: Tracing Code by Hand

⚠️ You will not type or run a single line of code in your theory exam

Every Python question in the theory paper — predicting output, finding errors, completing a function — has to be solved by reading the code and mentally executing it, the same way a computer would, but without a computer. This is a genuinely distinct skill from writing code in an environment that catches your mistakes as you go, and it needs to be practised specifically, not assumed as a side effect of coding practice on a laptop.

The most reliable way to build this skill: for every Python program you study, close your laptop and trace through it on paper — write down the value of every variable after each line executes, exactly as the interpreter would. Do this for loops, recursive functions, and file operations specifically, since these are where hand-tracing errors happen most often. The same discipline applies to SQL — write the query from memory first, then check it against a working example, rather than always having autocomplete do the work for you.

Python (Computational Thinking & Programming-2) — 40 Marks, the Core of the Paper

This unit covers a revision of Class 11 fundamentals, functions (including recursion), exception handling, file handling across text, binary, and CSV files, and the Stack data structure implemented using Python lists.

File handling — the three modes you must be fluent in:

# Text file — read line by line
with open("data.txt", "r") as f:
    for line in f:
        print(line.strip())

# Binary file — write and read a record
import pickle
with open("records.dat", "ab") as f:
    pickle.dump(record, f)

# CSV file — reading rows
import csv
with open("data.csv", "r", newline="") as f:
    reader = csv.reader(f)
    for row in reader:
        print(row)

Stack using a Python list — the one data structure in scope:

def push(stack, item):
    stack.append(item)

def pop(stack):
    if not stack:
        return "Stack Empty"
    return stack.pop()
⚠️ The scope limit that matters: The syllabus covers Stack specifically, implemented using a Python list with push and pop — not queues, linked lists, or trees. Don't over-prepare data structures beyond what's actually in scope; that time is better spent on file handling and exception handling, which carry more consistent marks across papers.

Database Management — 20 Marks, SQL and Python-MySQL Connectivity

This unit tests your ability to write correct SQL syntax from memory, and increasingly, to connect Python programs to a MySQL database rather than treating the two as fully separate topics.

-- Basic SELECT with filtering and sorting
SELECT name, salary FROM employees
WHERE department = 'Sales'
ORDER BY salary DESC;

-- Aggregate functions with GROUP BY
SELECT department, AVG(salary) AS avg_salary
FROM employees
GROUP BY department
HAVING AVG(salary) > 50000;

-- Joining two tables
SELECT e.name, d.department_name
FROM employees e
JOIN departments d ON e.dept_id = d.id;

Python-MySQL connectivity — the integration pattern to know:

import mysql.connector
conn = mysql.connector.connect(
    host="localhost", user="root",
    password="pass", database="school"
)
cursor = conn.cursor()
cursor.execute("SELECT * FROM students")
for row in cursor.fetchall():
    print(row)

Practise SELECT queries with WHERE, ORDER BY, and GROUP BY clauses, all five common aggregate functions (SUM, AVG, COUNT, MIN, MAX), and at least basic joins between two tables — these cover the large majority of SQL questions that appear.

Computer Networks — 10 Marks, the Fastest to Revise

This is the lowest-weightage unit, and it's almost entirely definition and concept-based rather than requiring hands-on practice — making it the most time-efficient unit to secure fully in the final weeks before the exam.

Category Key terms to know cold
Network types PAN (Personal), LAN (Local), MAN (Metropolitan), WAN (Wide)
Topologies Star, Bus, Tree, Mesh — know the basic layout and one advantage/disadvantage of each
Wired transmission media Twisted pair cable, Coaxial cable, Fibre-optic cable
Wireless transmission media Radio waves, Microwaves, Infrared
Network devices NIC, Hub, Switch, Router, Gateway, Access Point — know the specific function of each
Protocols TCP/IP, DNS, HTTP, HTTPS, FTP, SMTP — know what each one is used for
Web basics World Wide Web (WWW) concept, basic HTML and XML structure
💡 Why this unit deserves full marks: Unlike Python or SQL questions, where a single syntax slip can lose you marks, Networks questions are almost entirely "define this" or "distinguish between these two." With focused, clear definitions memorised precisely, this 10-mark unit is one of the most reliably scorable sections in the entire paper.

Knowing Python Isn't the Same as Tracing Python Correctly Under Exam Conditions

A CS mock score of 48 out of 70 doesn't distinguish between a student who doesn't know file handling and a student who knows it perfectly but makes tracing errors when working through code by hand without a computer to check their work. These are different problems with different fixes.

Genelis Performance Map

What a Genelis weak area map looks like after a Class 12 CS practice session

Computer Networks — definitions
86%
SQL — SELECT with WHERE/ORDER BY
71%
Python — recursive function tracing
49%
Python — file handling (binary files)
33%

Next session: binary file handling (33%) — not Networks definitions (already 86%). Genelis builds this map automatically after every practice session.

Genelis is an AI-powered personalized learning platform built on Adaptive Personalized Intelligence. The Genelis learning system tracks your accuracy across Python, SQL, and Networking separately — distinguishing genuine concept gaps from hand-tracing errors under exam-style conditions. Every wrong answer is logged to your wrong-question notebook and queued for reattempt.

Step 1 Attempt CS practice set
Step 2 Unit-level gap detected
Step 3 AI notes for weak concept
Step 4 Wrong Qs auto-logged
Step 5 Reattempt those questions
Result Gap closed. Map updates. ✓
Start your personalised Class 12 Computer Science study plan on Genelis — free →

Quick Syntax Reference — Python & SQL

Python Essentials

40 marks unit

Exception handling

try:
    result = 10 / x
except ZeroDivisionError:
    print("Cannot divide by zero")
finally:
    print("Done")

Function with default argument

def greet(name, msg="Hello"):
    return f"{msg}, {name}"

Simple recursion

def factorial(n):
    if n == 0:
        return 1
    return n * factorial(n - 1)

Trace this by hand for n=4 before the exam — recursive tracing is one of the most common sources of errors.

SQL Essentials

20 marks unit

Aggregate functions

SUM(), AVG(), COUNT(), MIN(), MAX() — always used with GROUP BY when grouping by a column, or alone for a single overall value.

DDL vs DML commands

DDL (structure): CREATE, ALTER, DROP. DML (data): INSERT, UPDATE, DELETE, SELECT. This distinction is a common short-answer question.

Primary Key vs Foreign Key

Primary Key: uniquely identifies each row in its own table. Foreign Key: a column referencing the Primary Key of another table, used to link tables in a join.

💡 How to use this reference: Copy each syntax pattern by hand, not by typing — the exam is handwritten, so build that muscle memory directly. For every code block, trace through it with sample values before moving on, and write out what each line would output at that point in execution.
Genelis Learning Loop™

Learn smarter. Practice deeper. Improve continuously.

Genelis combines Adaptive Personalized Intelligence, AI-generated notes, targeted practice, mock tests, analytics, and personalised revision to help students improve every study session.

Frequently Asked Questions

Questions Students Commonly Ask

Quick answers to the most common questions related to this guide.

What is the unit-wise marks distribution for CBSE Class 12 Computer Science?

The theory paper carries 70 marks and practicals carry 30 marks, for a 100-mark total. Within theory: Unit I, Computational Thinking and Programming-2 (covering Python — functions, file handling, exception handling, and Stack data structure using lists), carries 40 marks, the highest weightage at roughly 57% of the theory paper. Unit II, Computer Networks, carries 10 marks. Unit III, Database Management (SQL and Python-MySQL connectivity), carries 20 marks.

Is the CBSE Class 12 Computer Science board exam done on a computer?

No. The 70-mark theory examination is a traditional pen-and-paper exam, where students write Python code, SQL queries, and network diagrams by hand rather than typing and running them. This means questions commonly test your ability to trace through code and predict its output, or write a query correctly from memory, rather than debugging in an actual coding environment. Only the separate 30-mark practical examination, conducted at school with an external examiner, involves an actual computer.

What topics does the Python unit cover in Class 12 Computer Science?

The Python unit (Computational Thinking and Programming-2) covers a revision of Class 11 basics (data types, operators, control structures), functions (including scope and recursion), exception handling, file handling across text files, binary files, and CSV files, and the Stack data structure implemented using Python lists (push and pop operations). This unit carries the highest weightage of any unit in the theory paper.

What is covered in the Computer Networks unit of Class 12 Computer Science?

The Computer Networks unit covers network types (PAN, LAN, MAN, WAN), network topologies (Star, Bus, Tree, Mesh), transmission media (wired: twisted pair, coaxial, fibre-optic; wireless: radio waves, microwaves, infrared), network devices (NIC, Hub, Switch, Router, Gateway, Access Point), and protocols including TCP/IP, DNS, HTTP, HTTPS, FTP, and SMTP, along with basic concepts of the World Wide Web and HTML/XML. This unit carries the lowest theory weightage of the three units but is almost entirely definition and concept-based, making it a reliable, fast-to-revise source of marks.

How should I prepare for the SQL and Database Management unit in Class 12 Computer Science?

Practise writing SQL queries by hand daily rather than only running them on a computer, since the board exam requires writing correct query syntax from memory. Focus on SELECT statements with WHERE, ORDER BY, and GROUP BY clauses, aggregate functions (SUM, AVG, COUNT, MIN, MAX), and joins between two tables. Also practise Python-MySQL connectivity using the mysql-connector module, since questions increasingly test the integration between the Python and Database units rather than treating them as fully separate topics.

← Previous Article The Complete CBSE Class 12 Board Exam Preparation Guide (2026–27) Next Article → Class 10 Social Science 2026–27: Chapter Strategy, Map Work & Answer-Writing Guide