PRACTICLE FILE
COMPUTER SCIENCE
SESSION 2022-23
NAME: Ronish Singh
CLASS: XII – B
ROLL NO: 30
SCHOOL: MAXFORT SCHOOL DWARKA, NEW
DELHI
Acknowledgement
I wish to express my great gratitude and sincere thanks to the
principal, Ms. Priyanka Bhatkoti for her encouragement and
all the facilities which were provided to complete the practical
file. I sincerely appreciate her efforts for taking me into her
fold for which I shall remain forever in debt.
I extend my heartiest thanks to Ms. Bhumika Dwivedi, our
Computer Science teacher, who guided me towards the
successful completion of this practical file. I take this
opportunity to express my sincere gratitude for her immense
guidance, constant encouragement, and motivation which has
sustained my efforts at all stages of this practical file.
I can't forget to offer my sincere thanks to my parents, team-
mates and friends who help me carry out this practical file
successfully.
Certificate
Name: Ronish Singh Class: XII-B
Roll No: 30
This is certified to be the bonafide work of the student
in the Computer Science Practical File during the
academic year 2022 – 2023
________________
Signature of Teacher
________________ ________________
Signature of Examiner Signature of
Principal
Date: ___________
S. No. Topic Date Sign
PYTHON
1. Searching element in a list and displaying
frequency and location 12-04-22
2. Program to find sum of elements of list
recursively 19-04-22
3. Program to pass list to a function and double
the odd values and half even values of a list 26-04-22
and display list element after changing
4. Input n numbers in tuple and pass it to
function to count how many even and odd 05-05-22
numbers are entered
5. Program to function for key and value, and
update value at that key in dictionary entered 05-05-22
by user
6. Pass a string to a function and count how
many vowels are present in the string 12-05-22
7. Program that generates random number
between 1 and 6 12-05-22
8. Program to read a string, count and display
the number of alphabets, digits, spaces and 19-05-22
special characters in the string.
9. Python function to covert decimal to binary.
19-05-22
10 Python function to find whether an entered
number is perfect or not. 26-05-22
11. Python function to check if the entered
number is Armstrong or not. 26-05-22
12. A menu-driven python program to implement
stack operation. 12-07-22
13. Python program to check whether a string is a
palindrome or not using stack. 12-07-22
14. Write a python program using function
PUSH(Arr), where Arr is a list of numbers.
From this list push all numbers divisible by 5
or 7 into a stack implemented by using a list. 19-07-22
Display the stack if it has at least one
element, otherwise display appropriate error
message.
15. Program to read and display a text file
content line by line with each word separated 15-08-22
by #
16. Program to remove all the lines that contain
character ‘a’ in a text file and write it to 15-08-22
another file.
17. Program to read characters one by one from
keyboard, all lower-case characters to be
stored in file ‘lower’ and all uppercase in file 22-08-22
‘upper’ while other characters should be
stored in file ‘others’
18. Create a CSV file by entering user-id and
password, read and search the password for
22-08-22
given user- id.
19. Create a binary file with roll no. and marks.
Search for a given roll number and update the 05-09-22
marks as per given by user.
20. Write a function RevText() to read a text file
“ Story.txt” and print only word starting with
‘I’ in reverse order . Example: If value in text 05-09-22
file is: INDIA IS MY COUNTRY Output
will be: AIDNI SI MY COUNTRY
21. ABC infotech Pvt Ltd. needs to create a
database for their digital account. Develop an
interface that provides front-end interaction
with Python. Write Python program with
separate user defined functions to perform the
following tasks: 08-11-22
1. Create a databse abc_office
2. Create a table Employees with fields
EmpId, Name, Age, Gender and Salary
3.Insert data into table
22. For ABC infotech create a function to
connect to the database and retrieves all
records and displays total number of records. 05-11-22
23. Write a program to read and fetch all the
records from employees table having salary
more than 30000. 05-11-22
24. Write a program to increase the salary by 5%
where employee if is 104. 05-11-22
MYSQL
1. Write SQL query to create and show a
database Employee. 04-10-22
2. Write SQL query to open database Employee.
04-10-22
3. Write SQL query to create following Table
name empl. 04-10-22
4. Write SQL query to show the structure of
table. 04-10-22
5. Write SQL query to Insert 10 records.
04-10-22
6. Write SQL query to display all the records
from table empl 11-10-22
7. Write SQL query to display EmpNo and
EName of all employees from the table empl 11-10-22
8. Display the details of employees whose name
have only four letters 11-10-22
9. Display the details of all employee whose
annual salary is between 25000 to 40000 11-10-22
10. Display name, job title and salary of
employee who do not have manager 11-10-22
11. Display the name of employee whose name
contains A as third letter 18-10-22
12. Display the name of employee whose name
contains L as any letter 18-10-22
13. Display the name of departments. Each
department should be displayed once 18-10-22
14. Queries for Aggregate functions- SUM( ),
AVG( ), MIN( ), MAX( ), COUNT( ) 25-10-22
15. Display the names of employees in lowercase
and uppercase 25-10-22
16. Display the position of the string 'LE' in the
field job of table empl 25-10-22
17. Display all data of empl according to salary
arranged in ascending order 01-11-22
18. Display department no., job and no. of
employees in a particular job grouped by 01-11-22
department no., job from empl
19. Display the jobs where the number of
employees is less than 3 01-11-22
Practical-1
Searching element in a list and displaying frequency
and location
Practical-2
Program to find sum of elements of list recursively
Program to pass list to a function and double the odd values and half even
values of a list and display list element after changing
Practical-3
Input n numbers in tuple and pass it to function to count how many even and
odd numbers are entered
Practical-4
Practical-5
Program to function for key and value, and update value at that key in
dictionary entered by user
Pass a string to a function and count how many vowels are present in the string
Practical-6
Program that generates random number between 1 and 6
Practical-7
Practical-8
Program to read a string, count and display the number of alphabets, digits,
spaces and special characters in the string
Practical-9
Python function to covert decimal to binary
Practical-10
Python function to find whether an entered number is perfect or not
Practical-11
Python function to check if the entered number is Armstrong or not
Practical-12
A menu-driven python program to implement stack operation
Practical-13
Python program to check whether a string is a palindrome or not using stack
Practical-14
Write a python program using function PUSH(Arr), where Arr is a list of
numbers. From this list push all numbers divisible by 5 or 7 into a stack
implemented by using a list. Display the stack if it has at least one element,
otherwise display appropriate error message.
Program to remove all the lines that contain character ‘a’ in a text file and write
it to another file.
Practical-15
Practical-16
Program to read and display a text file content line by line with each word
separated by #
Practical-17
Program to read characters one by one from keyboard, all lower-case characters
to be stored in file ‘lower’ and all uppercase in file ‘upper’ while other
characters should be stored in file ‘others’
Practical-18
Create a CSV file by entering user-id and password, read and search the
password for given user- id.
Practical-19
Create a binary file with roll no. and marks. Search for a given roll number and
update the marks as per given by user
Practical-20
Write a function RevText() to read a text file “ Story.txt” and print only word
starting with ‘I’ in reverse order . Example: If value in text file is: INDIA IS
MY COUNTRY Output will be: AIDNI SI MY COUNTRY
Practical-21
ABC infotech Pvt Ltd. Needs to create a database for their digital account.
Develop an interface that provides front-end interaction with Python. Write
Python program with separate user defined functions to perform the following
tasks:
1.Create a database abc_office
2.Create a table Employees with fields EmpId, Name, Age, Gender, and Salary
3.Insert data into table
Practical-22
For ABC infotech create a function to connect to the database and retrieve all
records and display total number of records
Practical-23
Write a program to read and fetch all the records from employees table having
salary more than 30000.
Practical-24
Write a program to increase the salary by 5% where employee id is 104.
SQL Practicals
Practical-1
Write SQL query to create and show a database Employee.
Practical-2
Write SQL query to open database Employee.
Practical-3
Write SQL query to create following Table name empl
Practical-4
Write SQL query to show the structure of the table.
Practical-5
Write SQL query to insert 10 records
Practical-6
Write SQL query to display all records from table empl.
Practical-7
Write SqL query to display EmpNo and Ename of all employees from the table
Practical-8
Display the details of employees whose name have only four letters
Practical-9
Display the details of all employees whose annual salary is between 25000 to
40000
Practical-10
Display name,job title and salary of employee who do not have manager
Practical-11
Display the name of employee whose name contains A as third letter
Practical-12
Display the name of employee whose name contains L as any letter
Practical-13
Display the name of departments. Each department should be displayed once
Practial-14
Queries for Aggregate functions- SUM(),AVG(),MIN(),MAX(),COUNT()
Practical-15
Display the names of employees in lowercase and uppercase
Practical-16
Display the position of the string ‘LE’ in the field job of table empl
Practical-17
Display all data of empl according to salary arrange in ascending order
Practical-18
Display department no., job and no. of employees in a particular job grouped by
department no., from empl
Practical-19
Display the jobs where the number of employees is less than 3