0% found this document useful (0 votes)
12 views31 pages

Doc1cs1213 1

The document outlines the practical work for the Computer Science subject by Kashish Chauhan, a 12th-grade student at PM SHRI KENDRIYA VIDYALAYA for the academic year 2024-25. It includes a list of programming tasks and SQL queries that the student is required to complete, covering topics such as prime number generation, file handling, and database management. Each task is accompanied by a date and space for teacher's signatures, indicating the completion of each practical assignment.

Uploaded by

anshmahar98
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)
12 views31 pages

Doc1cs1213 1

The document outlines the practical work for the Computer Science subject by Kashish Chauhan, a 12th-grade student at PM SHRI KENDRIYA VIDYALAYA for the academic year 2024-25. It includes a list of programming tasks and SQL queries that the student is required to complete, covering topics such as prime number generation, file handling, and database management. Each task is accompanied by a date and space for teacher's signatures, indicating the completion of each practical assignment.

Uploaded by

anshmahar98
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/ 31

PM SHRI KENDRIYA

VIDHAYALAYA 9BRD

COMPUTER SCIENCE PRACTICALS 2024-25

NAME: KASHISH CHAUHAN


CLASS: 12TH A
ROLL NO: _____________
CERTIFICATE
This is to certify that this bonafide
practical work in the subject of
COMPUTER SCIENCE has been done by
KASHISH CHAUHAN of class 12th A in the
academic year 2024-25 and submitted to
AISSCE practical examination conducted
by CBSE at PM SHRI KENDRIYA VIDYALAYA

SIGNATURE OF EXTERNAL SIGNATURE OF INTERNAL

SIGNATURE OF PRINCIPAL
Index
TABLE OF CONTENT
S NO. CONTENT DATE TEACHERS’S
SIGNATURE
1. Write a program to generate a prime number of 03/07/24
a given range

2. Write a python program that takes a list of words 07/07/24


and returns a new list containing only words that
start with a vowel

3. Write a python function that takes two strings 12/07/24


and check whether they are anagrams of each
other

4. Write a python function that generates a random 12/07/24


list and fine maximum and minimum number
without built in functions like max() and min()
5. Write a menu-based Python program that allows 20/07/24
you to manage a simple student grades system
using Dictionary. Your program should perform
the following tasks: 1. Add few student with their
name and marks for three subjects (CS,IP,AI). 2.
Display all students and their marks. 3. For each
student, calculate and display their average
marks. 4. Allow the user to update the marks for
a particular student. 5. Allow the user to remove
a student from the system. 6. Allow the user to
exit the program.

6. Create a binary file with roll number, name and 26/07/24


class and insert 3 records in it in the format [roll-
no, name, class]. Search for a given roll number
and display the name, if not found display
appropriate message.
7. Create a binary file with book,shelf_no and 30/07/24
author. Insert 3 values- {“Harry Potter”:[1, “J.K.
Rowling”]}, {“Sherlock Holmes”:[2, “Conan
Doyle”]}, {“Time Machine”:[1, “H.G. Wells”]}.
The program should display all the book names
to the user and prompt them to enter the name
of a book they wish to delete. After that, the
program should ask the user to modify the
details of one of the remaining book entries.
8. Create a CSV file (login.csv) by entering user-id 4/08/24
and password and write a menubased python
program to perform the following task. Read-
Read and search the password for given user-id.
Update- The program asks the user to modify
the details of the given user-id. Delete- Prompt
user to enter the user-id they wish to delete
9. Write a Python program that reads a text file 8/08/24
and counts the number of lines, words, and
characters in the file. Display the counts in the
following format: Lines: X, Words: Y, Characters:
Z
10. Write a menu-based python program to perform 16/08/24
the following questions. Write the definition of
a user-defined function ‘push_even(N)’ which
accepts a list of integers in a parameter ‘N’ and
pushes all those integers which are even from
the list ‘N’ into a Stack named ‘EvenNumbers’
Write function pop_even() to pop the topmost
number from the stack and returns it. If the
stack is already empty, the function should
display "Underflow". Write function disp_even()
to display all element of the stack without
deleting them. If the stack is empty, the function
should display 'Empty Stack’
11. Perform the following SQL queries i. Write a SQL 28/08/24
query to create a table named Library with
columns BookID, Title, Author, Genre,
PublishedYear, and CopiesAvailable and. And
perform the following questions ii. Write SQL
queries to insert at least three records into the
Library table. iii. Write a SQL query to update
the number of available copies of a specific
book (e.g., increase by 2). iv. Write a SQL query
to delete a book record from the Library table
where the BookID is a specific value.
12. Perform the following SQL queries i. Create two 29/08/24
tables: Students (with columns StudentID,
Name, Age, Class) and Marks (with columns
StudentID, Subject, Score). Ensure that
StudentID in Marks references StudentID in
Students. ii. Write SQL queries to insert at least
three records into both the Students and Marks
tables. iii. Write a SQL query to find the average
score of each student across all subjects and
display the results with student names. iv. Write
a SQL query to delete a record from the Marks
table for a student who has withdrawn from a
subject. v. Write a SQL query to count the total
number of students in each class
13. Create the table ORDERS as given below and 02/09/24
perform the following queries: (I) Display the
total Quantity for each Product, excluding
Products with total Quantity less than 2. (II)
Display the orders table sorted by total price in
descending order. (III) Display the distinct
customer names from the Orders table. (IV)
Display the sum of Price of all the orders for
which the quantity is less than
14. Karan has been entrusted with the management 06/09/24
of Law University Database. He needs to access
some information from FACULTY and COURSES
tables for a survey analysis. Create both the
tables and help him extract the following
information by performing the desired SQL
queries as mentioned below. (I) To display
complete details (from both the tables) of those
Faculties whose salary is less than 12000. (II) To
display the details of courses whose fees is in
the range of 20000 to 50000 (both values
included). (III) To increase the fees of all courses
by 500 which have "Computer" in their Course
names. (IV) To display names (FName and
LName) of faculty taking System Design.
15. Create the table and , write SQL queries for the 18/09/24
following (i) Set P_ID as Primary key. (ii) Write a
SQL statement to change the data type of the
salary column in the employees table from INT
to DECIMAL(10, 2). (iii) Write a statement to add
a new column named date_of_birth of type
DATE
16. Write a Python program to connect to a MySQL 22/09/24
database named SchoolDB

17. Write a SQL query to create a table named 22/09/24


Students with the following columns: StudentID,
Name, Age, and Class. Execute this query using a
Python script.
18. Create a Python program that retrieves all 22/09/24
records from the Students table and displays
them in a formatted manner
19. Write a Python program that updates the age of 22/09/24
a specific student in the Students table based on
StudentID
20. Write a Python program that deletes a record 22/09/24
from the Students table where the StudentID is
a specific value

1. Write a program to generate a prime number


Output 1
2. Write a python program that takes a list of words
and returns a new list containing only words that
start with a vowel

Output 2
3. Write a python function that takes two strings
and check whether they are anagrams of each
other

Output 3
4. Write a python function that generates a random
list and fine maximum and minimum number
without built in functions like max() and min()

Output 4
5. Write a menu-based Python program that allows you to manage a simple student grades
system using Dictionary. Your program should perform the following tasks: 1. Add few
student with their name and marks for three subjects (CS,IP,AI). 2. Display all students and
their marks. 3. For each student, calculate and display their average marks. 4. Allow the
user to update the marks for a particular student. 5. Allow the user to remove a student
from the system. 6. Allow the user to exit the program.
Output 5
6. Create a binary file with roll number, name and class and insert 3
records in it in the format [roll-no, name, class]. Search for a given roll
number and display the name, if not found display appropriate
message.

Output 6
7. Create a binary file with book, shelf_no and author. Insert 3 values-
{“Harry Potter”:[1, “J.K. Rowling”]}, {“Sherlock Holmes”:[2, “Conan
Doyle”]}, {“Time Machine”:[1, “H.G. Wells”]}. The program should
display all the book names to the user and prompt them to enter the
name of a book they wish to delete. After that, the program should ask
the user to modify the details of one of the remaining book entries.
Output 7
8. Create a CSV file (login.csv) by entering user-id and password and write
a menubased python program to perform the following task. Read-
Read and search the password for given user-id. Update- The program
asks the user to modify the details of the given user-id. Delete- Prompt
user to enter the user-id they wish to delete.
Output 8
9. Write a Python program that reads a text file and counts the number of
lines, words, and characters in the file. Display the counts in the
following format: Lines: X, Words: Y, Characters: Z.

Output
10. Write a menu-based python program to perform the following questions. Write the
definition of a user-defined function ‘push_even(N)’ which accepts a list of integers
in a parameter ‘N’ and pushes all those integers which are even from the list ‘N’
into a Stack named ‘EvenNumbers’. Write function pop_even() to pop the topmost
number from the stack and returns it. If the stack is already empty, the function
should display "Underflow". Write function disp_even() to display all element of
the stack without deleting them. If the stack is empty, the function should display
'Empty Stack’
Output 10
Q11. Perform the following SQL queries
i. Write a SQL query to create a table named Library with columns BookID,
Title, Author, Genre, PublishedYear, and CopiesAvailable and. And perform
the following questions
ii. Write SQL queries to insert at least three records into the Library table.

iii. Write a SQL query to update the number of available copies of a specific
book (e.g., increase by 2).
iv. Write a SQL query to delete a book record from the Library table where the
BookID is a specific value.
Q12. Perform the following SQL queries i. Create two tables: Students (with
columns StudentID, Name, Age, Class) and Marks (with columns StudentID,
Subject, Score). Ensure that StudentID in Marks references StudentID in
Students.

I. Write SQL queries to insert at least three records into both the Students and
Marks tables.
II. Write a SQL query to find the average score of each student across all
subjects and display the results with student names.

III. Write a SQL query to delete a record from the Marks table for a student
who has withdrawn from a subject.

IV. Write a SQL query to count the total number of students in each class.
Q 13. Create the table ORDERS as given below and perform the following queries:

(I) Display the total Quantity for each Product, excluding Products with total
Quantity less than 2
(II) Display the orders table sorted by total price in descending order.
(III) Display the distinct customer names from the Orders table.
(IV) Display the sum of Price of all the orders for which the quantity is less than 2.
Q 14. Karan has been entrusted with the management of Law University Database. He
needs to access some information from FACULTY and COURSES tables for a survey
analysis. Create both the tables and help him extract the following information by
performing the desired SQL queries as mentioned below

I. To display complete details (from both the tables) of those Faculties whose
salary is less than 12000.
II. To display the details of courses whose fees is in the range of 20000 to 50000
(both values included).

III. To increase the fees of all courses by 500 which have "Computer" in their
Course names

IV. To display names (FName and LName) of faculty taking System Design.
Q15. Create the table and , write SQL queries for the following

I. Set P_ID as Primary key

II. Write a SQL statement to change the data type of the salary column in the
employees table from INT to DECIMAL(10, 2).
III. Write a statement to add a new column named date_of_birth of type DATE.
Write a menu based program to perform the tasks given in the following questions(Q16-
Q20).
Q16.Write a Python program to connect to a MySQL database named SchoolDB.
Q17. Write a SQL query to create a table named Students with the following columns:
StudentID, Name, Age, and Class. Execute this query using a Python script.
Q18. Create a Python program that retrieves all records from the Students table and
displays them in a formatted manner.
Q19. Write a Python program that updates the age of a specific student in the Students
table based on StudentID.
Q20. Write a Python program that deletes a record from the Students table where the
StudentID is a specific value
Output

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy