0% found this document useful (0 votes)
3 views2 pages

Data File and MySQL Handling Guide

The document outlines various programming tasks related to data file handling, including operations for text, binary, and CSV files, such as creating, reading, updating, and deleting records. It also covers MySQL database operations, including creating databases and tables, inserting and displaying records, and performing queries. Additionally, it includes database connectivity programs for integrating Python with MySQL for data management tasks.

Uploaded by

rafiwap630
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views2 pages

Data File and MySQL Handling Guide

The document outlines various programming tasks related to data file handling, including operations for text, binary, and CSV files, such as creating, reading, updating, and deleting records. It also covers MySQL database operations, including creating databases and tables, inserting and displaying records, and performing queries. Additionally, it includes database connectivity programs for integrating Python with MySQL for data management tasks.

Uploaded by

rafiwap630
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

A.

DATA FILE HANDLING


🔹 Text File Programs

1. Create a text file and write student details into it


2. Read contents of a text file line by line
3. Count number of lines, words, and characters in a text file
4. Display all lines starting with a vowel from a text file
5. Count frequency of a specific word in a text file
6. Copy contents from one text file to another
7. Remove blank lines from a text file
8. Display only those lines that contain the word “Python”
9. Count number of uppercase and lowercase characters
10. Read a text file and display only even-numbered lines

🔹 Binary File Programs (Using pickle)

11. Create a binary file to store student records (roll no, name, marks)
12. Display all records from a binary file
13. Search a student record by roll number
14. Update marks of a student in a binary file
15. Delete a record from a binary file
16. Count total number of records in a binary file
17. Display students scoring more than 75 marks
18. Append new student records to an existing binary file
19. Read binary file and display records in formatted form
20. Copy records from one binary file to another

CSV File Handling

21. Create a CSV file and write student records


22. Read and display all records from a CSV file
23. Append new records to an existing CSV file
24. Display CSV file records in tabular format
25. Search a student record by Roll Number
26. Display students scoring more than 75 marks
27. Display students from a specific city
28. Search students whose names start with a given letter
29. Update marks of a student in a CSV file
30. Count total number of records in CSV file
B. MySQL DATABASE
1. Create a database named School.
2. Select the database School.
3. Create a table STUDENT with appropriate data types.
4. Display the structure of the STUDENT table.
5. Insert one record into the STUDENT table.
6. Insert multiple records into the STUDENT table.
7. Display all records from the STUDENT table.
8. Display only Name and Marks of all students.
9. Display details of students studying in Class 12.
10. Display students who scored more than 80 marks.
11. Display students belonging to Delhi city.
12. Display students whose marks are between 70 and 90.
13. Display students whose names start with the letter A.
14. Display students who do not belong to Delhi.
15. Update the marks of a student whose RollNo is given.

🔹 Database Connectivity Programs

16. Connect Python with MySQL database


17. Create a database using Python
18. Create a table (Student / Employee) using Python
19. Insert records into a MySQL table
20. Display all records from a table
21. Search record using primary key
22. Update a record in the table
23. Delete a record from the table
24. Count total number of records in a table
25. Display records in ascending order of marks

26. Display students with marks greater than a given value


27. Display records using LIKE clause
28. Display records using BETWEEN condition
29. Sort records using ORDER BY
30. Use aggregate functions (SUM, AVG, MAX, MIN)
31. Commit and rollback transactions
32. Menu-driven program for Student Database
33. Menu-driven program for Employee Management
34. Insert multiple records at once
35. Python program using parameterized queries

You might also like