ClearStepsCLEARSTEPS AI
NCERT SolutionsClass 12 Computer Science
💻

NCERT Solutions
Class 12 Computer Science

8 chapters · 16 important questions · Updated 2025-26

Step-by-step Exercise SolutionsNEW
Ch 1

Exception Handling in Python

Covers types of errors (syntax, runtime, logical), exception handling using try-except-else-finally, and raising exceptions. Handling multiple exceptions and user-defined exceptions are included.

Key Topics

Types of errors: syntax, runtime (exceptions), logicaltry-except blockMultiple except clauseselse and finally in exception handlingraise statement for user-defined exceptions

Important Questions

Q1

What is the difference between a syntax error and a runtime error? Give one example of each.

Short Answer2M
Q2

Write a Python program that takes two numbers as input and raises an exception if the divisor is zero. Use try-except-else-finally.

Long Answer4M
Ch 2

File Handling in Python

Covers opening, reading, writing, and appending files in text and binary modes. CSV file handling is included. Functions: open(), read(), readline(), readlines(), write(), writelines(), seek(), tell().

Key Topics

Text files vs binary filesFile opening modes: r, w, a, r+, rb, wbReading: read(), readline(), readlines()Writing: write(), writelines()CSV file handling using csv module

Important Questions

Q1

Write a Python function to count the number of lines in a text file.

Long Answer3M
Q2

What is the difference between 'w' and 'a' mode in file handling?

Short Answer2M
Ch 3

Data Handling with Pandas — Series and DataFrame

Covers creation and operations on Series and DataFrame objects. Importing from CSV, selection using loc/iloc, filtering, groupby, and handling missing values are key topics.

Key Topics

Creating Series from lists and dictionariesCreating DataFrame from dictionary of listsImporting CSV using read_csv()Data selection: loc[], iloc[], Boolean indexingHandling missing data: isnull(), fillna(), dropna()GroupBy and aggregate operations

Important Questions

Q1

Write Python code to create a DataFrame from a dictionary and display only rows where marks > 80.

Long Answer3M
Q2

What are the parameters of read_csv()? Explain: filepath, sep, header, index_col.

Short Answer2M
Ch 4

Data Visualisation with Matplotlib

Covers creating line charts, bar charts, histograms, pie charts, and scatter plots using Matplotlib's pyplot interface. Customising plots with labels, title, legend, and colour.

Key Topics

Line chart: plt.plot()Bar chart: plt.bar() and plt.barh()Histogram: plt.hist()Pie chart: plt.pie()Customisation: xlabel, ylabel, title, legend, color, figsize

Important Questions

Q1

Write Python code to draw a bar chart showing the marks of 5 students using Matplotlib.

Long Answer3M
Q2

When would you choose a histogram over a bar chart? Give one example.

Short Answer2M
Ch 5

Computer Networks

Covers types of networks (LAN, MAN, WAN), topologies, the OSI model (7 layers), TCP/IP model (4 layers), network devices, and common protocols. Switching (circuit and packet) is included.

Key Topics

Network types: LAN, MAN, WANOSI model: 7 layers and their functionsTCP/IP model: 4 layersNetwork devices: hub, switch, router, modem, gateway, firewallProtocols: HTTP, FTP, SMTP, POP3, DNS, TCP/IP

Important Questions

Q1

Explain the OSI model. State the function of each layer.

Long Answer5M
Q2

Distinguish between a hub and a switch. Which is more efficient and why?

Short Answer2M
Ch 6

Database Concepts

Covers database terminology (table, record, field, primary key, foreign key, candidate key), types of databases, DBMS vs RDBMS, and ER model basics. Advantages of DBMS over file system are important.

Key Topics

Database terminology: table, record, fieldPrimary key, foreign key, candidate keyDBMS advantages over file systemRDBMS vs DBMSEntity-Relationship (ER) diagram basics

Important Questions

Q1

What is a primary key? How does it differ from a candidate key and a foreign key?

Long Answer3M
Q2

State four advantages of using a DBMS over a flat file system.

Short Answer2M
Ch 7

Structured Query Language (SQL)

Covers SQL commands: DDL (CREATE, ALTER, DROP), DML (INSERT, UPDATE, DELETE, SELECT). Complex SELECT queries with WHERE, ORDER BY, GROUP BY, HAVING, JOINs, and aggregate functions are key exam topics.

Key Topics

DDL: CREATE TABLE, ALTER TABLE, DROP TABLEDML: INSERT, UPDATE, DELETE, SELECTSELECT with WHERE, ORDER BY, GROUP BY, HAVINGAggregate functions: COUNT, SUM, AVG, MAX, MININNER JOIN and basic joins

Important Questions

Q1

Write SQL queries to: (a) Create a table Student(RollNo, Name, Marks, Grade) (b) Insert a row (c) Display students with Marks > 80 ordered by Name.

Long Answer4M
Q2

What is the difference between WHERE and HAVING clause in SQL?

Short Answer2M
Ch 8

Society, Law and Ethics in IT

Covers cybercrime types, the IT Act 2000, intellectual property rights, digital footprint, net neutrality, and ethical issues in computing like plagiarism and data privacy.

Key Topics

Types of cybercrimes: hacking, phishing, cyberbullying, ransomware, identity theftIT Act 2000: key provisions and offencesIntellectual property: copyright, patents, trademarks, open source licencesDigital footprint and online privacyNet neutrality, data privacy, e-waste, digital divide

Important Questions

Q1

What is phishing? How is it different from hacking? What are the precautions against each?

Long Answer3M
Q2

What is net neutrality? Why is it important for internet users?

Short Answer2M

Frequently Asked Questions

Is NCERT enough for CBSE Class 12 Computer Science board exam?

Yes. CBSE board exams are designed entirely around NCERT. 80–90% of questions in the Class 12 Computer Science paper are directly based on NCERT concepts — sometimes reworded, never from outside NCERT. Completing all 16 important questions listed here is the minimum you need.

How to study NCERT Class 12 Computer Science for board exams?

Go chapter-by-chapter. Read the chapter first, then attempt the important questions without looking at answers. Check your answer structure — CBSE gives marks per point, so structure matters as much as content. For 5-mark answers: brief intro + 4–5 numbered points with keywords + conclusion.

Which chapters are most important in Class 12 Computer Science for CBSE boards?

Chapters with the most long-answer (5-mark) important questions carry the most marks in the board paper. Look at which chapters here have the highest question count — those are the ones CBSE has historically focused on. Don't skip any chapter, but spend extra time on these.

How many questions come from NCERT in CBSE Class 12 Computer Science exam?

Nearly all 16 questions in the Class 12 Computer Science board paper are rooted in NCERT. The exact question may be reworded, but the concept, definition, or formula always comes from the NCERT textbook. Practicing these 16 important questions covers the vast majority of what can be asked.