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.
2. Structure of the Practical File
A standard practical file is organised in this order:
Cover page: student name, roll number, school, subject, and session.
Index / Table of contents: list of programs with page numbers.
Python section: at least eight programs on Series, DataFrame, data handling, and visualization.
MySQL section: programs on database and table creation, data insertion, and queries.
Project: title page, aim, tools used, data description, program listing, sample outputs, and conclusion.
Viva and certificates: record of the practical examination and student declaration.
Each individual program inside the file follows the same pattern:
Problem statement: what the program does.
Code: the source program with correct indentation.
Output: the result of running the program, pasted or captured as an image.
Conclusion: one or two lines on what the program demonstrated.
3. Python Practical Programs
The Python section must demonstrate the whole Pandas syllabus. Typical programs are:
Create a Series from a list with a custom index and display its values, index, and data type.
Create a Series from a dictionary and perform arithmetic on it.
Create a DataFrame from a dictionary of lists and display its shape, columns, and first few rows.
Read a CSV file, display the top rows, and print statistical summary.
Handle missing values using isnull, dropna, and fillna.
Compute new columns and use groupby to produce per-category summaries.
Create line, bar, and pie charts from a DataFrame.
Use pivot_table to summarise data by two categories.
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.
4. MySQL Practical Programs
The MySQL section covers the complete command vocabulary. Typical programs are:
Create a database, use it, create a table with appropriate data types and constraints, and describe it.
Insert five or more records into the table.
Run SELECT queries with WHERE, ORDER BY, and LIKE.
Use string, numeric, and date functions in SELECT.
Use aggregate functions with GROUP BY and HAVING.
Alter the table to add a column, then update values.
4.1 Worked Example: Creating the Database
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;
4.2 Worked Example: Querying with Functions and Grouping
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.
5. The Project
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:
Store the data in a MySQL table using CREATE, INSERT, and UPDATE.
Read the data into a DataFrame with a query or a CSV export.
Clean the data, compute derived columns, and group the results.
Present the findings using at least two charts.
Document everything with screenshots of both the MySQL results and the Python outputs.
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.
6. Viva Preparation
The viva tests conceptual understanding. Questions commonly asked include:
What is the difference between a Series and a DataFrame?
Why is loc used instead of iloc, and which is label based?
What happens to NULL values when AVG and COUNT are used?
How is WHERE different from HAVING?
What does the "%" wildcard match in a LIKE pattern?
Which function is used to read a CSV file and how are blank cells handled?
What does groupby do, and which aggregation did you use in your project?
Why is HTTPS preferred over HTTP for sensitive data?
What is the difference between a hub and a switch, or a LAN and a WAN?
Each answer should be short, precise, and, wherever possible, tied to a program already present in the file.
7. Tips for Writing Clean Code in the Practical Exam
Always begin with the two import lines import pandas as pd and import matplotlib.pyplot as plt where needed.
Use meaningful variable names and consistent indentation so the program is readable.
Print each intermediate result so the examiner can follow the logic.
In MySQL, always write USE database; after creating the database and end every statement with a semicolon.
Test the program once, fix errors, and then paste the final version and its output into the file.
Keep a printed copy of the algorithm or a short comment about each program in the file.
Quick Revision Tables
Table 1: Suggested Python Practicals Checklist
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
Table 2: Suggested MySQL Practicals Checklist
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
Mind Map
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"]
Important Diagrams (SVG)
Diagram 1: Layout of a Practical File Entry
Diagram 2: Combining Pandas and MySQL in the Project
Common Mistakes
Writing programs without the required import lines, so the practical file code fails when retested.
Forgetting USE database; in every MySQL program, causing "No database selected" errors.
Omitting semicolons at the end of MySQL statements.
Including programs in the file that were never run, so the printed output does not match the code.
Using loc when iloc is meant, or mixing label and position based selection in one program.
Forgetting to add index=False in to_csv, producing an unwanted first column in exported data.
Making the project a mere collection of programs without a clear problem, data, and conclusion.
Not documenting outputs with screenshots, which reduces the marks awarded for presentation.
Confusing the MySQL output with the Python output in the file, making the record unclear.
Exam Tips
Maintain the file incrementally after every lab session instead of writing it all at once before the deadline.
Run every program once more before submission so the code and output always match.
Keep a short revision sheet of viva answers inside the file for quick reference.
Practise one complete project flow end to end: MySQL create and insert, Pandas read and groupby, and two charts.
In the practical examination, print intermediate results to make the program logic visible to the examiner.
Memorise the exact spellings of read_csv, groupby, pivot_table, matplotlib.pyplot, and DESC for error-free typing.
Prepare one-sentence answers for the classic viva questions about Series versus DataFrame, loc versus iloc, WHERE versus HAVING, and NULL handling in aggregates.
Conclusion
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.