DAV Centenary Public School, Chander Nagar
Practical File Programs -2025-26
Class XII-CS (083)
General Instruction :
1. Each program should be started from new page.
2. Be careful for indentation and do proper documentations
SECTION – A ( PYTHON )
Q1. WAP a program to input marks of 5 subjects, calculate and display total
marks and average marks of a student.
Q2. WAP to input total units which was consumed by a customer , calculate
and display total charged to be paid by the customer .Electric Bill charges
will calculate as per following condition.
No. of units Rate(in Rs)
First 100 Units 1 Rs per unit.
Next200 Units 2 Rs per unit.
Above300 Units 4 Rs per unit.
Q3. Write a menu driven program to
calculate: Area of circle[A=πr2]
Area of squire [A=a*a]
Area of
rectangle[A=l*b]
Q4. Write a program to check whether the entered number if prime or not.
Q5. WAP to input a number, calculate and display sum of each digit of that
given number. For example: number is 456, Sum is 4+5+6= 15
Q6. WAP to calculate and display sum of the following
series: X+X2/!2 +X3/!3+ n terms.
Q7. Write a program in python ,count and display the number of
vowels, consonants , uppercase, lowercase characters in string.
Q7. Write a UDF in python, it will take three arguments list(sequence of
elements), its size and finding element . Function search and return 1 if
element is present in the given list otherwise return -1 .
Q9. Write a program in python , to input a string check and display given string
is a palindrome or not.
Q10. Write a program in python, to create a number list. Search and display largest
and smallest number present in a list . Without using built-in function.
Q11. Write a program in python, to create a number list. Calculate and display
sum of those elements whose last digit is 5.
Q12. Write a program in python, to create two number lists a and b . Swap and
display all elements of both lists.
Page 1
Q13. Write a UDF in python, it will take two arguments list(sequence of elements)
and its size . Replace and display first half elements with second half
elements of a list.
For example: list elements are : 1 2 3 4 5
Output is : 4 5 3 1 2
Q14. Write a UDF in python, it will take two arguments list(sequence of
elements) and its size. Function arrange and display elements in
ascending order.
Q15. Write a function in PYTHON that counts the number of “Me” or “My” words
present in a text file “[Link]”. If the “[Link]” contents are as
follows:
My first book was Me and My
Family. It gave me chance to
be Known to the world.
The output of the function should be:
Count of Me/My in file: 4
Q16. Write a function in PYTHON to read the contents of a text file “[Link]” and
display all those lines on screen which are either starting with ‘P’ or with ‘S’.
Q17. Write a function EUCount() in PYTHON, which should read each character of a
text file [Link], should count and display the occurrences of alphabets E
and U (including small cases e and u too).
Q18. Write a function in PYTHON to search for a BookNo from a binary file
“[Link]”, assuming the binary file is containing the records of the
following type: ("BookNo", "Book_name"). Assume that BookNo is an integer.
Q19. Write a function in Python for PushS(List) and for PopS(List) for performing Push
and Pop operations with a stack of List containing integers.
Q20. Write a menu-driven program implementing user-defined functions to perform
different functions on a csv file “student” such as:
(a) Write a single record to csv.
(b) Write all the records in one single go onto the csv.
(c) Display the contents of the csv file.
SECTION –B (SQL)
Page 2
Q1. Consider the tables EMPLOYEE and SALGRADE given below and answer (a) and
(b)parts of this question.
(a) Write SQL commands for the following statements:
(i) To display the details of all EMPLOYEEs in descending order of DOJ.
(ii) To display NAME and DESIG of those EMPLOYEEs whose SALGRADE is either S02 or S03.
(iii) To display the content of the entire EMPLOYEEs table, whose DOJ is in between ‘09-
Feb- 2006’ and ‘08-Aug-2009’.
(iv) To add a new row with the following content:
109,‘Harish Roy’,‘HEAD-IT’,‘S02’,‘9-Sep-2007’,‘21-Apr-1983’
(b) Give the output of the following SQL queries:
(i) SELECT COUNT(SGRADE),SGRADE FROM EMPLOYEE GROUP BY SGRADE;
(ii) SELECT MIN(DOB),MAX(DOJ) FROM EMPLOYEE;
(iii) SELECT SGRADE, SALARY+HRA FROM SALGRADE WHERE SGRADE =’S02’;
Q2. Study the following table and write SQL queries for questions (i) to (iv) and output for
(v) and (vi).
Page 3
(i) Write SQL query to display Pname, Quantity and Rate for all the orders that are
either Pencil or Pen.
(ii) Write SQL query to display the orders which are not getting any Discount.
(iii) Write SQL query to display the Pname, Quantity and Sale_date for all the orders
whose total cost (Quantity * Rate) is greater than 500.
(iv) Write SQL query to display the orders whose Rate is in the range 20 to 100.
(v) SELECT Pname, Quantity from Orders WHERE Pname LIKE(‘_e%’);
(vi) SELECT Pname, Quantity, Rate FROM Orders Order BY Quantity DESC;
Q3. Write SQL commands for (i) to (vi) on the basis of relations given
below:
(i) To show the books of FIRST PUBL. Publishers written by P. Purohit.
(ii) To display cost of all the books published for FIRST PUBL.
(iii) Depreciate the price of all books of EPB publishers by 5%.
(iv) To display the BOOK_NAME and price of the books, more than 3 copies of which
have been issued.
(v) To show total cost of books of each type.
(vi) To show the details of the costliest book.
Page 4
Q4. Consider the given table and answer the questions.
(i) To show all information of students where capacity is more than the no. of students
in order of rtno.
(ii) To show area_covered for buses covering more than 20 km., but charges less
than 80000.
(iii) To show transporter-wise total no. of students travelling.
(iv) To show rtno, area_covered and average cost per student for all routes where average
cost per student is—charges/noofstudents.
(v) Add a new record with the following data:
(11, “Motibagh”,35,32,10, “kisan tours”, 35000)
(vi) Give the output considering the original relation as given:
(a) select sum(distance) from schoolbus where transporter= “Yadav travels”;
(b) select min(noofstudents) from schoolbus;
(c) select avg(charges) from schoolbus where transporter= “Anand travels”;
(d) select distinct transporter from schoolbus;
Page 5