Current Affairs updated daily
KalviGavaniKalviGavani

Tamil Nadu Class 12 Informatics Practices Complete Guide — Samacheer Kalvi

Complete TN Board Class 12 Informatics Practices guide — Python with Pandas, Data Visualisation, Database SQL, Networking, Cybersecurity. Notes, important questions, and exam tips.

Updated 17 June 20268 min read

Class 12 Informatics Practices — Tamil Nadu State Board

Total Marks: Theory 70 + Practical 30 = 100


Syllabus Overview

UnitTopicKey Content
1Python RevisionFunctions, modules, file handling
2Data Handling — Pandas ISeries, DataFrame, operations
3Data Handling — Pandas IIMerging, groupby, pivot
4Data VisualisationMatplotlib — line, bar, histogram, pie
5Database ConceptsDBMS, relational model, keys
6SQLDDL, DML, aggregate functions, joins
7Computer NetworksTypes, topology, protocols
8CybersecurityThreats, safety practices

Unit 1 — Python Revision

Key Concepts

Functions:

def greet(name):
    return "Hello, " + name

result = greet("Tamil")
print(result)

File Handling:

# Writing to file
f = open("data.txt", "w")
f.write("Hello")
f.close()

# Reading from file
f = open("data.txt", "r")
print(f.read())
f.close()

Modules:

  • import math — mathematical functions
  • import random — random numbers
  • import datetime — date/time

List Comprehension:

squares = [x**2 for x in range(1, 6)]
# Output: [1, 4, 9, 16, 25]

Unit 2 — Data Handling with Pandas I

Series

A one-dimensional labelled array.

import pandas as pd

s = pd.Series([10, 20, 30, 40], index=['a', 'b', 'c', 'd'])
print(s)
print(s['b'])      # Access by label: 20
print(s[1])        # Access by position: 20

DataFrame

A two-dimensional labelled data structure.

data = {
    'Name': ['Anitha', 'Bala', 'Chitra'],
    'Marks': [85, 92, 78],
    'City': ['Chennai', 'Madurai', 'Coimbatore']
}
df = pd.DataFrame(data)
print(df)
print(df['Name'])           # Column access
print(df.iloc[1])           # Row by position
print(df.loc[0, 'Marks'])   # Specific cell

DataFrame Operations

df.head()         # First 5 rows
df.tail()         # Last 5 rows
df.shape          # (rows, columns)
df.info()         # Column types
df.describe()     # Statistics
df.isnull().sum() # Count missing values
df.dropna()       # Remove missing rows
df.fillna(0)      # Fill missing with 0

Filtering

# Rows where Marks > 80
filtered = df[df['Marks'] > 80]

# Multiple conditions
filtered = df[(df['Marks'] > 80) & (df['City'] == 'Chennai')]

Unit 3 — Data Handling with Pandas II

Groupby

# Average marks by city
grouped = df.groupby('City')['Marks'].mean()
print(grouped)

# Multiple aggregations
result = df.groupby('City')['Marks'].agg(['mean', 'max', 'min'])

Merging DataFrames

df1 = pd.DataFrame({'ID': [1, 2, 3], 'Name': ['A', 'B', 'C']})
df2 = pd.DataFrame({'ID': [1, 2, 4], 'Score': [90, 85, 70]})

# Inner join (common rows)
merged = pd.merge(df1, df2, on='ID', how='inner')

# Left join (all from left)
merged = pd.merge(df1, df2, on='ID', how='left')

Sorting

df.sort_values('Marks', ascending=False)   # Descending
df.sort_values(['City', 'Marks'])           # Multiple columns

Unit 4 — Data Visualisation with Matplotlib

import matplotlib.pyplot as plt

Line Chart

x = [1, 2, 3, 4, 5]
y = [10, 25, 15, 30, 20]
plt.plot(x, y, color='blue', marker='o', linestyle='--')
plt.title("Sales Trend")
plt.xlabel("Month")
plt.ylabel("Sales")
plt.show()

Bar Chart

subjects = ['Tamil', 'English', 'Maths', 'Science']
marks = [85, 78, 92, 88]
plt.bar(subjects, marks, color='green')
plt.title("Student Marks")
plt.show()

Histogram

data = [55, 60, 65, 70, 75, 80, 85, 90]
plt.hist(data, bins=5, color='orange', edgecolor='black')
plt.title("Marks Distribution")
plt.show()

Pie Chart

sizes = [30, 20, 25, 25]
labels = ['Tamil', 'English', 'Maths', 'Science']
plt.pie(sizes, labels=labels, autopct='%1.1f%%')
plt.title("Subject Marks Share")
plt.show()

Unit 5 — Database Concepts

Key Terms

TermDefinition
DBMSDatabase Management System — software to store, retrieve, manage data
RelationTable in a relational database
TupleRow in a table
AttributeColumn in a table
DomainSet of valid values for an attribute
Primary KeyUnique identifier for each row — not null, unique
Foreign KeyLinks to primary key of another table
Candidate KeyAll minimal superkeys
Composite KeyPrimary key made of two or more attributes

Relational Model Concepts

  • Entity: Real-world object (Student, Book)
  • Entity-Relationship (ER) Diagram: Visual representation of entities and relationships
  • Normalisation: Reducing redundancy — 1NF, 2NF, 3NF
  • ACID properties: Atomicity, Consistency, Isolation, Durability

Unit 6 — SQL

DDL Commands (Data Definition Language)

-- Create table
CREATE TABLE Student (
    Roll_No INT PRIMARY KEY,
    Name VARCHAR(50),
    Marks INT,
    City VARCHAR(30)
);

-- Add column
ALTER TABLE Student ADD Grade CHAR(2);

-- Remove column
ALTER TABLE Student DROP COLUMN Grade;

-- Delete table structure
DROP TABLE Student;

-- Remove all records (keep structure)
TRUNCATE TABLE Student;

DML Commands (Data Manipulation Language)

-- Insert data
INSERT INTO Student VALUES (101, 'Anitha', 85, 'Chennai');

-- Update data
UPDATE Student SET Marks = 90 WHERE Roll_No = 101;

-- Delete rows
DELETE FROM Student WHERE Marks < 40;

-- Select all
SELECT * FROM Student;

-- Select specific columns
SELECT Name, Marks FROM Student;

-- Condition
SELECT * FROM Student WHERE City = 'Chennai';

-- Sorting
SELECT * FROM Student ORDER BY Marks DESC;

-- Pattern matching
SELECT * FROM Student WHERE Name LIKE 'A%';

Aggregate Functions

SELECT COUNT(*) FROM Student;              -- Number of rows
SELECT SUM(Marks) FROM Student;            -- Total marks
SELECT AVG(Marks) FROM Student;            -- Average
SELECT MAX(Marks) FROM Student;            -- Highest mark
SELECT MIN(Marks) FROM Student;            -- Lowest mark

-- Group by city
SELECT City, AVG(Marks) FROM Student GROUP BY City;

-- Having (filter after GROUP BY)
SELECT City, AVG(Marks) FROM Student 
GROUP BY City HAVING AVG(Marks) > 75;

Joins

-- INNER JOIN (matching rows only)
SELECT S.Name, C.Course_Name
FROM Student S
INNER JOIN Course C ON S.Roll_No = C.Roll_No;

-- LEFT JOIN (all from left, matching from right)
SELECT S.Name, C.Course_Name
FROM Student S
LEFT JOIN Course C ON S.Roll_No = C.Roll_No;

Unit 7 — Computer Networks

Types of Networks

TypeFull FormRange
LANLocal Area NetworkBuilding/campus
MANMetropolitan Area NetworkCity
WANWide Area NetworkCountry/global
PANPersonal Area Network~10 metres

Network Topologies

  • Bus: All connected to one cable. Simple, single point of failure.
  • Star: All connected to central hub/switch. Most common. Hub failure = network down.
  • Ring: Each device connected to two others in loop. Token passing.
  • Mesh: Every device connected to every other. Highly reliable, costly.

Protocols

ProtocolPurpose
HTTP/HTTPSWeb browsing
FTPFile transfer
SMTPSending email
POP3/IMAPReceiving email
DNSDomain name to IP resolution
DHCPAutomatic IP assignment
TCP/IPCore internet protocol

Network Devices

  • Hub: Broadcasts to all — obsolete
  • Switch: Sends to specific device — efficient
  • Router: Connects different networks, routes packets
  • Modem: Converts digital ↔ analogue

Unit 8 — Cybersecurity

Common Threats

ThreatDescription
MalwareSoftware designed to damage (virus, worm, trojan, spyware)
PhishingFake emails/sites to steal credentials
RansomwareEncrypts files, demands payment
DoS/DDoSOverwhelming a server with traffic
SQL InjectionInserting malicious SQL in input fields
Man-in-the-MiddleIntercepting communication
KeyloggerRecords keystrokes to steal passwords

Safety Practices

  • Use strong passwords (8+ chars, upper/lower/numbers/symbols)
  • Enable two-factor authentication (2FA)
  • Keep software updated (patches fix vulnerabilities)
  • Use antivirus and firewall
  • Avoid clicking unknown links (phishing)
  • Use HTTPS websites only for sensitive data
  • Regular data backup
  • Use VPN on public networks

Cybersecurity Laws in India

  • IT Act 2000: First cyber law — data protection, hacking penalty
  • IT Amendment Act 2008: Cyberterrorism, identity theft provisions
  • CERT-In: Indian Computer Emergency Response Team

Exam Tips

  • SQL questions: Always write column names correctly; semicolon at end; use caps for SQL keywords
  • Pandas questions: Show imports (import pandas as pd); print output where asked
  • Matplotlib: Always include plt.show() at end
  • Theory questions: Use table format for comparisons (types of networks, SQL commands)
  • Practical exam: Practice at least 10 complete programs before exam day

Frequently Asked Questions

Python programming review, Data handling with Pandas, Data Visualisation with Matplotlib, Database concepts and SQL, Networking basics, and Cybersecurity are the main topics.