0% found this document useful (0 votes)
32 views3 pages

Xii -Cs Practice Codes for Practical (2024-25)

The document contains practice questions for a computer science practical exam, requiring students to bring their practical and project files. It includes programming tasks in Python related to file handling, data structures, and SQL queries based on given tables. Students are expected to complete various operations such as creating files, counting characters, and executing SQL commands.

Uploaded by

Sudhanshu Pandey
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)
32 views3 pages

Xii -Cs Practice Codes for Practical (2024-25)

The document contains practice questions for a computer science practical exam, requiring students to bring their practical and project files. It includes programming tasks in Python related to file handling, data structures, and SQL queries based on given tables. Students are expected to complete various operations such as creating files, counting characters, and executing SQL commands.

Uploaded by

Sudhanshu Pandey
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/ 3

COMPUTER SCIENCE-PRACTICE QUESTIONS For Practical Exam

❖ All students must bring practical file tomorrow (9/01/2025). In case it is incomplete bring A4 sheets for
printing remaining practical.
❖ Bring project file
QUESTION 1: (8 Marks)
1. Write a python program to create a text file “Notes.txt” and count number of alphabets , digits and special
symbols in it.
2. Write a python program to count and display number of lines that are starting with ‘T’ in a text file named “Exam.txt” .
3. Write a menu driven program to perform following operations into a binary file ‘EMP.DAT’ .
The file contains records : [id, name, job,sal] 1. Add record 2. Display All Records 3. Exit
4. Write a menu driven program to perform following operations into a binary file ‘EMP.DAT’
The file contains records : [id, name, job,sal] 1. Add record 2. Search by Id 3. Exit
5. Create a binary file “EMP.dat” having details empno, empname, designation and salary and write functions:
(a) to display all records having salary more than 50000
(b) name of all employees whose name start with ‘S’
6. Write a menu driven code to perform following operations on binary file
(a) Create a binary file with name and roll number.
(b) Search for a given roll number and display the name, if not found display appropriate message.
7. Create a CSV file to store details of 5 students (Rollno,name, class_sec,age) and display its contents.
8. Create a CSV file by entering user-id and password, read and search the password for given user- id.
9. Write a python program to implement push() , pop() and display() in stack.
10. Write a Menu driven python program using list to implement stack data structure and perform the
following operations: a. Push(), b. Pop(), c. Display() d. Exit
11. WAP in python to implement insert, select , update , delete and alter table commands using python –MySQL
connectivity.
QUESTION 2 (4 Marks) SQL queries (4 queries based on one or two tables)
Consider the following tables Stationary and Consumer. Write SQL commands for the statement (i) to (iv).
(i) To display the details of those consumers whose Address is Delhi.
(ii) To display the details of Stationary whose Price is in the range of 8 to 15. (Both Value included)
(iii) To display ConsumerName, Address, Company and Price from Stationary and Consumer with their
corresponding matching S_ID.
(iv) To increase the Price of all stationary by 2.
Q 2. Write the queries i) to iv) based on the table Customer given below:

Table : Customer

ID NAME AGE ADDRESS SALARY


1 Ramesh 32 Ahmadabad 2000
2 Khilan 25 Delhi 1500
3 Kaushik 23 Kota 2000
4 Chaitali 25 Mumbai 6500
5 Hardik 27 Bhopal 8500
6 Komal 22 MP 4500
7 Muffy 24 Indore 10000
i) To display all the records of table customer name wise.
ii)To display the maximum age.
iii)To display all the records of those Customers having salary greater than 6000.
iv) To increase the salary by 500 of all those whose name starts with " K ".
Q 3. Write the queries a) to d) based on the tables given below:
Table: CLIENT

C_ID C_NAME AGE


1 Ramesh 32
2 Khilan 25
3 Kaushik 23
4 Chaitali 25
Table : Client_data
C_ID ADDRESS COMMISION
1 Ahmadabad 2000
2 Delhi 1500
3 Kota 2000
4 Mumbai 6500
i) To display all the records of table client _data commission wise.
ii) To display the maximum age.
iii) To display C_NAME, AGE of those having commission greater than 6000.
iv) To increase the commission by 5000 of all those whose address starts with “A”.

You might also like