Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Appendix A: Suggested Practical List

This section details the practical programming assignments as suggested by the CBSE syllabus. These practicals are crucial for the Lab Test portion of the exam (12 marks) and the Report File (7 marks).

A.1 Python Programming (Minimum 15 Programs)

Your report file should include at least 15 Python programs covering the concepts learned in Class XI and XII.

Fundamental Logic & Strings/Lists

  1. Read a text file line by line and display each word separated by a #.
  2. Read a text file and display the number of vowels, consonants, uppercase, and lowercase characters in the file.
  3. Remove all the lines that contain the character ‘a’ in a file and write the remaining lines to another file.
  4. Write a random number generator that generates random numbers between 1 and 6 (simulating a dice roll).

Stacks

  1. Write a Python program to implement a stack using a list. (Include push, pop, display, and peek operations).

Binary File Handling

  1. Create a binary file with user records (Name and Roll Number). Search for a given roll number and display the name; if not found, display an appropriate message.
  2. Create a binary file with RollNo, Name, and Marks. Input a roll number from the user and update the marks for that student.

CSV File Handling

  1. Create a CSV file by entering user_id and password. Write a script to read and search for a password given a specific user_id.

(Add 7 more programs of similar complexity involving functions, complex lists/dictionaries manipulation, and basic algorithms like linear search or bubble sort to fulfill the minimum requirement of 15).


A.2 SQL Queries (Minimum 5 Sets)

Your report file should include basic to advanced SQL operations. For example, create a target database like “SchoolManagement” or “InventorySystem”.

Set 1: Basic DDL and DML

  1. Create a STUDENT table with attributes like RollNo, Name, Class, DOB, Gender, City, Marks.
  2. Insert at least 5 rows of sample data.
  3. Display all records from the table.

Set 2: Modifying Structure and Data 4. Use ALTER TABLE to add a new attribute (e.g., Email). 5. Use UPDATE to modify the marks of a specific student. 6. Use DELETE to remove a student’s record based on their RollNo.

Set 3: Filtering and Sorting 7. Display names of students belonging to a specific city. 8. Use ORDER BY to display data sorted by their marks in descending order.

Set 4: Aggregate Functions and Grouping 9. Find the minimum, maximum, and average marks of the class. 10. Use GROUP BY to find the count of male and female students separately.

Set 5: Specific Constraints 11. Write an ALTER TABLE query to drop an attribute. 12. Modify the table to change the data type of an existing attribute.


A.3 Python - SQL Connectivity (Minimum 4 Programs)

These programs demonstrate the integration of the database backend with the Python frontend application.

  1. Read: Write a Python program to connect to your SQL database, execute a SELECT * query on a table, and print all the fetched records in a formatted way.
  2. Insert: Write a Python program that takes user input (using input()) for a new record and inserts it into an SQL table using parameterized queries (%s).
  3. Update: Write a Python script that takes a specific ID (like RollNo or EmployeeID) from the user and a new value (like updated marks or salary), and executes an UPDATE query.
  4. Delete: Write a script to prompt the user for an ID and safely execute a DELETE command to remove that specific record from the SQL table. Ensure the script reports how many rows were affected.