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

Python Programs for File and Database Management

Uploaded by

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

Python Programs for File and Database Management

Uploaded by

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

INDEX

S.N TOPIC SIGN


O
1 Write a random number generator that generates random numbers between 1 and
6
2 Write a python program for user defined import modules Module :-Area
3 Write a python program for user defined import Packages/Libraries.
4 Read a text file line by line and display each word separated by a ‘#’.
5 Write a Python program with function to count the number of lines in a text file ‘
[Link]’ which is starting with an alphabet ‘A’ or ‘a’.
6 Write a Python program with method/function DISPLAYWORDS() to read lines from
a text file [Link], and display those words, which are less than 4 characters.
7 Remove all the lines that contain the character `a’ in a file and write it to another
file.
8 Read a text file and display the number of vowels/consonants/uppercase/
lowercase characters in the file.
9 Create a binary file with name and roll [Link] for a given roll number and
display the name, if not found. display appropriate message.
10 Create a binary file with roll number, name and marks. Input a roll number and
update the marks.
11 Text files Menu driven program:-
Choice = 1. Read a text file line by line and display each word separated by a #.
Choice = [Link] program with function to count the number of line in a text file
‘[Link]’ which is starting with an alphabet ‘A’ or ’a’.
Choice= 3. Python program with method/function DISPLAYWORDS() to read lines
from a text file [Link], and display those words, which are less than 4
characters.
12 Text File Menu driven Program:-
Choice= 1. Remove all the lines that contain the character `a’ in a file and write it
to another file.
Choice= 2. Read a text file and display the number of vowels/ consonants/
uppercase/ lowercase characters in the file.
13 Write a Python program to implement a stack using a list data-structure.

PYTHON INTERFACE THROUGH MYSQL


1 Making Connection between Python And Mysql.
2 Creating Database Sports through python interface to the mysql.
3 Creating Table Records through python interface to the mysql.
4 Inserting Data in records through python interface to the mysql.
5 Fetchall () all the data from records through python interface to the mysql .
6 Fetch all the data through python interface to the mysql using fetchall().
7 Fetch the data through python interface to the mysql using Fetchone().
8 Fetch many data through python interface to the mysql using Fetchmany().
9 Fetch all the data and count the no. of rows through python interface to the mysql
using rowcount().
10 Update Table records through python interface to the mysql.
11 Applying Aggregate Function in records through python interface to the mysql.
12 Appling Group By in records through python interface to the mysql.
DATABASE MANAGEMENT SYSTEM
1 Write a query to create new database in the name of “SCHOOL”
2 Write a Query to Open the database
3 Write a Query to Create the above table called :Info
4 Write a Query to list all the existing database names.
5 Write a Query to List all the tables that exists the the current database
6 Write a Query to insert all the rows of above table Info table.
7 Write a Query to display all the details of the Employees from the above
table ‘INFO’.
8 Write a Query to Display Employees’ name and City from the above table.
9 Write a Query to Display all details of Employees who are living in Chennai
10 Write a Query to get the name and salary of the employee whose salary is
above 15000 and gender is not male.
11 Write a query to update increase 10% Salary of an employee whose City is
'CHENNAI' and Gender is 'MALE'.
12 Write a Query to Delete the details of Employee Id 6.
13 Write a Query to list names of Employees in Desecending order.
14 Write a Query to find a total salary of all employees.
15 Write a Query to display maximum salary and minimum salary of employees.
16 Write a Query to count the number of employees earning more than 25000.
17 Write a query to display sum of salary of the employees grouped by
department wise.
18 Write a query to display the department names where number of employees
are greater than or equal to 2.

You might also like