CBSE Class 12 Informatics Practices
Chapters: 4
1. Data Handling using Pandas and Data Visualization
Pandas Series · DataFrames · Data visualization
- Pandas Series: One Labelled Column of Data – Pandas is a Python library for working with data in tables, and Matplotlib is a library for drawing charts. A Series is one column of values where every value has a label called its index. You can make a Series from a list or NumPy array, from a dictionary or from a single scalar value. Maths between two Series matches labels, and a label present in only one gives NaN. head() and tail() show the first or last rows, and you can pick values by label, by position, by slice or by a condition.
- Pandas DataFrame: Working with a Whole Table – A DataFrame is a two-dimensional table in pandas, with labelled rows (the index) and labelled columns. Every column is a Series. You can build one from a dictionary of Series, from a list of dictionaries or by reading a CSV file. You can display it, walk through it row by row or column by column, add, select, delete and rename rows and columns, pick data with loc, iloc or a condition, and save it back to a CSV file.
- Graphical Representation of Data (Class 12 Geography Practical) – Graphs, diagrams and thematic maps turn tables into pictures, so patterns jump out. Line graphs and polygraphs show change over time. Bar diagrams (simple, multiple, compound) compare items. A pie diagram shows parts of a whole using angles. Flow maps show movement, with arrow width to scale. Thematic maps show one theme over an area: dot maps (1 dot = a fixed number), choropleth maps (areas shaded by value) and isopleth maps (lines joining equal values).
- Data Visualization with Matplotlib: Line, Bar and Histogram – Data visualization means showing data as pictures such as charts, so that patterns are easy to see. In Python we use the pyplot module of Matplotlib, imported as plt. A line plot shows change over time, a bar graph compares separate groups and a histogram shows how values are spread over ranges called bins. A chart becomes clear with a title, axis labels and a legend, and plt.savefig() saves it as an image file.
2. Database Query using SQL
SQL functions · Aggregates and grouping
- SQL for Class 12: Build Tables, Ask Questions, Join Tables – SQL is the language used to create and query relational databases. DDL commands (CREATE, ALTER, DROP) build structure; DML commands (INSERT, UPDATE, DELETE) change rows; SELECT reads data. Columns get data types (CHAR, VARCHAR, INT, FLOAT, DATE) and constraints (NOT NULL, UNIQUE, PRIMARY KEY, DEFAULT, FOREIGN KEY). SELECT can use aliases, DISTINCT, WHERE with relational and logical operators, IN, BETWEEN, LIKE and IS NULL, and ORDER BY. Aggregate functions (MAX, MIN, AVG, SUM, COUNT) summarise many rows; GROUP BY makes groups and HAVING filters groups. A Cartesian product pairs every row of one table with every row of another; an equi-join keeps only pairs whose common column matches; a natural join does the same and shows the common column once.
- SQL Single-Row Functions: Maths, Text and Date – A single-row function takes one value from a row and returns one value, so a column of n rows gives n answers. Maths functions: POWER, ROUND and MOD. Text (string) functions: UPPER, LOWER, LENGTH, LEFT, RIGHT, SUBSTR, INSTR and TRIM. Date functions: NOW, DATE, MONTH, MONTHNAME, YEAR, DAY and DAYNAME. They are used inside SELECT, WHERE and ORDER BY.
- SQL Aggregates, GROUP BY, HAVING, ORDER BY and Equi-Join – Aggregate (multi-row) functions take many rows and return one value: MAX, MIN, SUM, AVG and COUNT. They skip NULL values, except COUNT(*), which counts every row. GROUP BY splits rows into groups with the same value so an aggregate runs once per group. HAVING filters those groups, while WHERE filters single rows before grouping. ORDER BY sorts the output in ascending or descending order. An equi-join combines two tables by matching rows where a common column is equal.
3. Introduction to Computer Networks
Networks, devices and topologies · Internet and web
- Computer Networks and How the Internet Works – A network is a group of devices linked to share data. Each device has an IP address. Data is cut into numbered packets. Routers pass each packet hop by hop towards its address, and TCP puts the packets back in order. DNS turns a website name into an IP address. Clients ask, servers answer. Firewalls, passwords, updates and encryption keep a network safe.
- How Networks Grew and How Data Travels – A computer network is a group of connected devices that share data. Networking began with ARPANET (1969), grew into NSFNET (1980s) for universities, and joined with other networks to become the Internet, a network of networks. Every data communication has five parts: sender, receiver, message, communication media and protocol. Bandwidth is the range of frequencies a channel can carry (in Hz); data rate is how many bits travel per second (bps). Every device on a network has an IP address. Data can move by circuit switching (a fixed path is booked first) or packet switching (data is cut into packets that travel on their own).
- Computer Networks: Types, Devices and Topologies – A computer network is a group of devices connected to share data and resources. By area, networks are PAN, LAN, MAN and WAN. Devices do different jobs: a modem converts digital and analog signals, a repeater boosts a weak signal, a hub sends data to all ports, a switch sends it only to the right device, a router joins networks and chooses a path, and a gateway joins networks that use different protocols. Topology is the layout of connections: star, bus, tree and mesh, each with its own strengths and weaknesses.
- Internet and Web: URL, Services, Websites, Hosting and Browsers – The Internet is a worldwide network of networks. The World Wide Web is the collection of web pages on it, linked by hyperlinks, and each page has an address called a URL. The Internet also carries email, chat and VoIP. A website is a group of related web pages; pages can be static (same for everyone) or dynamic (built for each visitor). A web server stores and sends pages, and web hosting keeps a site online. A browser displays pages, and its settings, add-ons, plug-ins and cookies change how it works.
- Web Services: What Happens When You Open a Website – The World Wide Web (WWW) is a system of linked web pages that live on the Internet and are reached with a browser. Web pages are written in HTML, which uses fixed tags to show content; XML uses tags you make yourself to store and carry data. Every website has a domain name, like example.org, which DNS turns into an IP address. A URL is the full address of one resource: protocol, domain and path. A website is a set of related web pages. A web browser asks for pages and shows them; a web server stores them and sends them; web hosting is renting space on such a server so your site is online all the time.
4. Societal Impacts
Digital footprint and ethics · Cyber crime and laws · E-waste and health
- Digital Footprint, Net Etiquette, IPR and FOSS – Everything we do online leaves a digital footprint. Good citizens follow net etiquette, protect personal data and respect other people's intellectual property. Copying without credit is plagiarism. Licences decide how we may use software and content; FOSS gives the freedom to use, study, change and share.
- Cyber Crime and the Indian IT Act – Cyber crime is any crime that uses a computer, phone or the internet. Common ones are hacking, phishing, cyber bullying, identity theft and ransomware. India's Information Technology Act, 2000 (amended in 2008) gives legal punishment for them. Victims can report at cybercrime.gov.in or call 1930.
- E-waste and the Health Effects of Technology – E-waste is discarded electronic equipment. It contains toxic metals like lead, mercury and cadmium that harm soil, water, air and people when dumped or burnt. We manage it by Reduce, Reuse and Recycle through authorised recyclers, backed by India's E-Waste (Management) Rules. Using devices too long also harms eyes, posture, wrists, sleep and mood; good ergonomics and breaks keep us healthy.