0% found this document useful (0 votes)
37 views

Miet Public School Class 12 Computer Science Program List For Practical File

The document provides a list of 16 programming tasks for students in Class 12 Computer Science. The tasks cover topics like Python programming, file handling, SQL queries, database connectivity etc. Some key tasks include: 1) Writing Python programs to analyze text, manipulate lists/tuples/dictionaries, check for palindromes, reverse strings etc. 2) Performing SQL queries on tables like insert, update, delete and commit changes. 3) Creating CSV files and writing data in binary files using Python. 4) Connecting to a MySQL database and fetching data from tables using PyMySQL.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
37 views

Miet Public School Class 12 Computer Science Program List For Practical File

The document provides a list of 16 programming tasks for students in Class 12 Computer Science. The tasks cover topics like Python programming, file handling, SQL queries, database connectivity etc. Some key tasks include: 1) Writing Python programs to analyze text, manipulate lists/tuples/dictionaries, check for palindromes, reverse strings etc. 2) Performing SQL queries on tables like insert, update, delete and commit changes. 3) Creating CSV files and writing data in binary files using Python. 4) Connecting to a MySQL database and fetching data from tables using PyMySQL.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Miet Public School

Class 12th Computer Science Program List for Practical File

Term 1:-

1. Write a program in python script that reads a line and print its statistics like:
Number of uppercase letters:
Number of lowercase letters:
Number of alphabets:
Number of digits:
2. Write a program to prepare a list in python & the data should be like :
[‘Student Name’, Student Age, ‘Student Address’]
Append an element Student RollNo in the list and also insert Student class after Student Age.
3. Given three lists as list1=[‘a’,’b’,’c’], list2=[‘h’,’i’,’t’] and list3=[‘0’,’1’,’2’]. Write a program that
adds individual elements of list2 and list3 to list1. The resultant should be in the order of
elements of list3,elements of list1, elements of list2.
4. Write a program that checks for the presence of a value inside a dictionary and print its key.
5. Write a code to find a factorial of a given number. Input should be taken by user.
6. Create a binary file with RollNo,Name,and Marks. Input a RollNo and update the marks.
7. Read a text file and display the numbers of vowels,constants,uppercase,lowercase characters in
the file.
8. Write a program that finds an element’s index/position in a Tuple without using index().
9. Write a program to check whether the given number is palindrome or not.
10. Write a program in python to print the reverse of a given string.
11. Write a program that receives two numbers in a function and returns the results of all
Arithmetic opertaors i.e. (+,-,*,/,%) on these numbers.
12. Write a python program to print the table of a given number using for loop.
13. Write a program to display the number of lines in the text file.
14. Write a program to get the RollNo,Names,&Marks of the given Student in a class(get from user)
& store these details in a text file “Marks.txt”
15. Write a program to a binary file calles “emp.dat”and write into it the employee details of some
employees, available in the form of dictionaries.
16. Write a program to create a csv file “employee.csv” by suppressing the EOL translation .
Data contained in the file should be:-
[‘EmpNo’:1001, ‘Name’:’Ishika’, ‘Designation’:’Manager’,’Salary’:56000
‘EmpNo’:1002, ‘Name’:’Kush’, ‘Designation’:’Team lead’,’Salary’:95000
‘EmpNo’:1003, ‘Name’:’Madhur’, ‘Designation’:’Project Head’,’Salary’:100000
‘EmpNo’:1004, ‘Name’:’Kavyansh’, ‘Designation’:’Project Manager’,’Salary’:70000
‘EmpNo’:1005, ‘Name’:’Ishita’, ‘Designation’:’Relational Manager’,’Salary’:60000]
Term 2:-

17. Create the table Customer as per following Table Instance Chart:-

ColumnNam Cust_ID Cust_Name Cust_Address1 Cust_Address Pincode Cust_Phone


e 2
Datatype NUMBER VARCHAR VARCHAR VARCHAR NUMBER NUMBER
Length 7 30 20 30 7 1O

Now perform the following queries in Sql according to the above table:-

1. Make Cust_ID a primary key that should not be NULL .


2. Add one Column of Customer_Email of datatype VARCHAR and size 30 to the table
Customer.
3. Add one more column of Customer_Income of dataype VARCHAR.
4. Insert atleast 5 records with relevant information in the table Customer.
5. Update atleast 2 records with Cust_Name and Cust_Pincode.
6. Delete the 2 records in the table.
7. Show all the data available in the table now and perform 'commit' at the end.

18. Create the table Employee and insert the data as per following Table Instance Chart:-

ID First_Name Last_Name User_ID Salary


1 Dim Joseph Jdim 50000
2 Jagannath Mishra Jnmishra 40000
3 Siddharth Mishra Smishra 80000
4 Shankar Giri Sgiri 70000
5 Gautam Buddha Bgautam 100000

Now Perform the following operations:-

1. Make UserID a primary key that should not be NULL.


2. Add one more column Months after Salary and insert '12 months' in first 3 rows and
'24 months' in last two rows.
3. Select the Name of Employees whose salary is greater than or equals to 50000.
4. Update first 2 rows likewise Dim will become Dimmy and Jaggannath will become
Jaggy.
5. Delete Column ' ID' from table Employee.
6. Show all the updated data present in the table now.
Programs for Databse Connectivity with MySql:-

19. Write a program that displays first 3 rows fetched from table Student of MySql Database "test".

Note:- username is "learner" and password is "fast".

20. Write a program that displays first 5 rows fetched from table Employee of MySql database "test".
Use pymsql to connect with the database

You might also like