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

Computer Science Practical File 2024-25

The document contains an acknowledgment section expressing gratitude to teachers and family, a certificate confirming the completion of a practical file by Rahul Kumar for Computer Science, and a detailed table of contents listing various Python programs and SQL queries. The practical file includes programs for tasks such as checking prime numbers, file handling, stack operations, and MySQL database connectivity. Each section outlines specific programs and their functionalities, showcasing the student's work during the academic year 2024-2025.

Uploaded by

DINKAR Kumar
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)
11 views

Computer Science Practical File 2024-25

The document contains an acknowledgment section expressing gratitude to teachers and family, a certificate confirming the completion of a practical file by Rahul Kumar for Computer Science, and a detailed table of contents listing various Python programs and SQL queries. The practical file includes programs for tasks such as checking prime numbers, file handling, stack operations, and MySQL database connectivity. Each section outlines specific programs and their functionalities, showcasing the student's work during the academic year 2024-2025.

Uploaded by

DINKAR Kumar
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
You are on page 1/ 50

Acknowledgment

I am extremely grateful to my principal Mrs.


Priya Simon and Mrs. Reva Luthra, teacher of
department of Computer Science for the
valuable guidance and useful suggestions
which helped me in completing the practical
file in time.
Importantly, I would like to express my
heartfelt thanks to my beloved parents for
their blessings, my friends and classmates
for their help and wishes for the successful
completion of this practical file.

Name : Rahul Kumar


Roll No.:
Certificate
This is to certify that Rahul Kumar, student of
class XII-Humanities , of C. F. C. Public
School has successfully completed the
Practical file during the academic year 2024-
2025 towards partial fulfillment of credit for
the Computer Science practical evaluation of
CBSE and submitted satisfactory report as
compiled in the following pages , under my
supervision.

Internal Examiner External Examiner


( Mrs. Reva Luthra)
Table Of Content
S. Name of the program Page
No.
Python programs

1. Program to enter a number and check 1


whether it is prime or not.
2. Program to accept values from the user at 2
certain limit and add if it’s even.
3. Program to accept a number from user and 3
display its table.
4. Program to input integer in range 0 -999 and 4
then print if the entered integer is 1/2/3 digit.
5. Program to repeatedly ask from user some 5
numbers until string ‘done’ is typed and
display the sum of the numbers entered.
6. Program to read a line and print its statistics 6 -7
about the numbers of uppercase letter,
lowercase letter , alphabets and digits.
7. Program to finds an element’ s position in a 8
tuple Without using index( ).
8. Menu-driven program for arithmetic 9-10
operations on two numbers.
9. Program to input total number of sections 11-
and streams in CLASS XII and display all 12
information.
Python functions

10. Function to compute average of three user 13


Inputted number.
11. Function to pass a mutable type value to a 14
function and assigning parameter to new
variable/ value.
File Handling

12. Program to create a text file with some 15 -


names separated by newline characters 16
without using write() function.
13. Program to create a csv file by suppressing 17
the EOL translation.
Stack
14. Program to implement stack operations. 18-
20
15. Function to push the name of those items of 21
dictionary who have price more than user
defined price
SQL Queries

16. Query Set - 1 22-


24
17. Query Set - 2 25-
26
18. Query Set - 3 27-
28
19. Query Set - 4 29-
30
20. Query Set - 5 31-
32
Python MySQL Connectivity
21. Program to display first three rows fetched 33-
from staff table of database company. 34
22. Program to display records of staff whose 35
salary is more than 40,000.
23. Program to insert a record into table staff. 36
24. Program to update records of table staff. 37
Python Programs
Program 1

Input

Output
Program 2
Input

Output
Program 3
Input

Output
Program 4
Input

Output
Program 5
Input

Output
Program 6

Input
Output
Program 7
Input

Output
Program 8
Input
Output
Program 9
Input
Output
Code – 1
Input

Output
Code – 2
Input

Output
File Handling
Code - 1
Input

Run
Output
Code – 2
Input

Run

Output
Code – 1
Input
Output
Code – 2
Input

Output
SQL Query Set
Query Set – 1
a) Create a database “ class_XII”

b) Display all tables in database “ class_


XII”
c) Use database “ class_XII”

d) Create a table “ student” with the


following structure :
Roll no. Int Primary Key
Name Varchar(50) not null
Age Int (10)
Stream Char(25)
Marks Int(5)
e) Insert four records into “student” table

f) Display all records in table “ student”


Query Set – 2

a) Display name , age, marks/5 as


“percentage”

b) Display name, stream, marks of student


of commerce or arts
c) Display name and marks of those
student who don’t scored between 300
and 400

d) Display all details of students of arts


and non medical having age of 17
Query Set – 3

a) Display details of students whose name


starts with “a”

b) Display name , marks of student whose


marks is more than 400 in descending
order of their marks
c) Compute the average marks of all
students

d) Add up the marks of students


Query Set – 4

a) Create table ‘toppers’ from table


‘student' and show only name , stream
and marks of students who scored
atleast 400

b) Update the marks by 10 of those


student who scored less than 400 in
student table
c) Delete details of the students who
scored less than 400

d) Display the table content


Query Set – 5
a) Add column ' grade’ in the student table

b) Input values in attribute' grade'

c) Display table content


d) Display the details of students in
following way :
<Student name> obtained<marks>and
<marks/5>%

e) Drop table student from the database


class_XII
Python – MySQL
Connectivity
Code 1: program to display first three
rows fetched from staff table of
database company.
Staff table of database company

Input
Output
Code 2: program to display records of
table staff whose salary is more than
40,000.
Input

Output
Code 3: program to insert one record
into table staff.
Input

Output
Code 4: program to update records of
staff who have grade of A1 to A2.
Input

Output

You might also like