Comprehensive theory, key formulas, diagrams, and memory aids for Practical File Work.
The practical file is the record of the programming work performed throughout the year in the computer laboratory. For Class 12 Informatic Practices, it consists of a set of Python programs covering Series, DataFrames, data visualization, and data handling, together with a set of MySQL programs that create databases, build tables, insert data, and run queries using the functions and clauses learnt in the earlier chapters. In addition, students maintain a project that applies both Pandas and MySQL to a real problem, and they are examined through a practical test followed by a viva.
A good practical file is more than a collection of printed programs. Every entry must contain the problem statement, the algorithm or logic, the source code written neatly with proper indentation, the output (ideally a screenshot), and a short conclusion. This documentation discipline is itself worth marks, and it is exactly the standard that examiners look for when assessing the file. Working from a well-maintained file also makes the viva far easier, because the answers to most viva questions lie inside the programs you have already written.
This final chapter explains how to structure the practical file, lists the types of programs expected in each section, provides complete worked examples with their outputs, and offers guidance on the viva and the project. It serves as both a checklist and a revision summary for the practical examination.
A standard practical file is organised in this order:
Each individual program inside the file follows the same pattern:
The Python section must demonstrate the whole Pandas syllabus. Typical programs are:
import pandas as pd
marks = pd.Series([88, 92, 75, 68], index=["Ravi", "Simran", "Amit", "Neha"])
print("Values:", marks.values)
print("Index:", marks.index)
print("Dtype:", marks.dtype)
print("Mean:", marks.mean())
print("Sorted:", marks.sort_values())
Expected output:
Values: [88 92 75 68]
Index: Index(['Ravi', 'Simran', 'Amit', 'Neha'], dtype='object')
Dtype: int64
Mean: 80.75
Sorted: Neha 68
Amit 75
Ravi 88
Simran 92
dtype: int64
import pandas as pd
import matplotlib.pyplot as plt
data = {"City": ["Delhi", "Mumbai", "Pune"],
"Sales": [120, 150, 90]}
df = pd.DataFrame(data)
print(df)
plt.bar(df["City"], df["Sales"])
plt.title("City-wise Sales")
plt.xlabel("City")
plt.ylabel("Sales")
plt.show()
The program builds a DataFrame, prints it, and then draws a labelled bar chart of sales by city.
The MySQL section covers the complete command vocabulary. Typical programs are:
CREATE DATABASE school;
USE school;
CREATE TABLE student (
roll INT PRIMARY KEY,
name VARCHAR(30) NOT NULL,
city VARCHAR(20),
marks DECIMAL(5, 2)
);
DESC student;
INSERT INTO student VALUES
(101, 'Ravi', 'Delhi', 88.5),
(102, 'Simran', 'Mumbai', 92.0),
(103, 'Amit', 'Pune', 78.0);
SELECT * FROM student;
USE school;
SELECT name, UCASE(name) AS upper_name FROM student;
SELECT name, ROUND(marks, 1) FROM student WHERE marks > 80;
SELECT city, COUNT(*), AVG(marks) FROM student GROUP BY city;
SELECT city FROM student GROUP BY city HAVING AVG(marks) > 80;
SELECT name, marks FROM student ORDER BY marks DESC;
The first query demonstrates a string function, the second a numeric function, and the third and fourth show grouping with aggregates and the HAVING filter.
The project is a small application that combines Pandas and MySQL. A suitable project might analyse a school's marksheet, a shop's sales record, or a library's issue data. The standard workflow is:
A project is assessed on the quality of the data, the correctness of the code, the clarity of the outputs, and the completeness of the documentation, so the write-up matters as much as the program.
The viva tests conceptual understanding. Questions commonly asked include:
Each answer should be short, precise, and, wherever possible, tied to a program already present in the file.
import pandas as pd and import matplotlib.pyplot as plt where needed.USE database; after creating the database and end every statement with a semicolon.| Number | Program Topic |
|---|---|
| 1 | Series from list, dict, and scalar |
| 2 | DataFrame creation and attributes |
| 3 | Read CSV and describe data |
| 4 | Handle missing values |
| 5 | New columns and groupby |
| 6 | Line, bar, and pie charts |
| 7 | pivot_table summary |
| 8 | Merge two DataFrames |
| Number | Program Topic |
|---|---|
| 1 | Create database and table with constraints |
| 2 | Insert and update records |
| 3 | SELECT with WHERE, ORDER BY, LIKE |
| 4 | Numeric and string functions |
| 5 | Aggregate functions with GROUP BY and HAVING |
| 6 | ALTER TABLE operations |
graph TD
A["Practical File Work"] --> B["File Structure"]
A --> C["Python Programs"]
A --> D["MySQL Programs"]
A --> E["Project"]
A --> F["Viva"]
B --> B1["Cover page and index"]
B --> B2["Program format: statement, code, output"]
C --> C1["Series and DataFrame"]
C --> C2["CSV, missing data, groupby"]
C --> C3["Charts with matplotlib"]
D --> D1["CREATE, INSERT, UPDATE"]
D --> D2["Queries, functions, grouping"]
E --> E1["MySQL data + Pandas analysis"]
E --> E2["Charts and documentation"]
F --> F1["Series vs DataFrame"]
F --> F2["WHERE vs HAVING, NULL handling"]
USE database; in every MySQL program, causing "No database selected" errors.loc when iloc is meant, or mixing label and position based selection in one program.index=False in to_csv, producing an unwanted first column in exported data.Practical file work converts the theory of the entire course into working programs and a documented project. A well-structured file presents each program with a problem statement, readable code, matching output, and a brief conclusion, organised under Python and MySQL sections with a project that links the two. The Python programs exercise Series, DataFrame, CSV reading, missing data, grouping, and visualization, while the MySQL programs exercise database creation, data insertion, functions, and grouped queries. Together they give the student genuine experience of the full data-analysis pipeline and provide the confidence needed for the practical examination and its viva. This chapter, being the capstone of the syllabus, ties together every skill acquired in the preceding nine chapters.