Class XII CS Practical File Programs 2022-23
Class XII CS Practical File Programs 2022-23
14. for performing Push and Pop operations with a stack of List
containing integers.
Write a program to create a stack called student, to perform
the basic operations on stack using list. The list contains
two data values called roll number and name of
student. Notice that the data manipulation operations are
performed as per the rules of a stack. Write the
15.
following functions :
• PUSH ( ) - To push the data values (roll no. and
name) into the stack.
• POP() - To remove the data values from the stack.
• SHOW() - To display the data values from the stack.
ABC Infotech Pvt. Ltd. needs to store, retrieve and delete
the records of its employees. Develop an interface that
provides front-end interaction through Python, and stores
and updates records using MySQL.
(a) Write a UDF to create a table ‘EMPLOYEE’ through
MySQL- Python Connectivity.
(b) Write a UDF to add/insert employee data into the
‘EMPLOYEE’ table through MySQL-Python
16. Connectivity.
(c) Write a UDF to fetch and display all the records from
EMPLOYEE table .
(d) Write a UDF to update the records of employees by
increasing salary by 1000 of all those employees who
are getting less than 80000.
(e) Write a UDF to delete the record on the basis of
Employee eno.
Write a menu driven program to perform all operations.
SECTION –B (SQL)
Q1. Consider the tables EMPLOYEE and SALGRADE given below and answer (a) and
(b)parts of this question.
(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 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;
Q5. Given the following tables for a database FURNITURE and ARRIVALS.
Table: FURNITURE
NO ITEMNAME TYPE DATEOFSTOCK PRICE DISCOUNT
1 White lotus Double Bed 23/02/02 30000 25
2 Pink teather Baby cot 20/01/02 7000 20
3 Dolphin Baby cot 19/02/02 9500 20
4 Decent Office Table 01/01/02 25000 30
5 Comfort zone Double Bed 12/01/02 25000 25
6 Donald Baby cot 24/02/02 6500 15
7 Royal Finish Office Table 20/02/02 18000 30
8 Royal tiger Sofa 22/02/02 31000 30
9 Econo sitting Sofa 13/12/01 9500 25
10 Eating Paradise Dining Table 19/02/02 11500 25
Table : ARRIVALS
(a) To list the ITEMNAME which are priced at more than 15000 from the
FURNITURE table.
(b) To list ITEMNAME and TYPE of those items, in which DATEOFSTOCK is
before
22/01/02 from the FURNITURE table in descending order of ITEMNAME.
(c) To display ITEMNAME and DATEOFSTOCK of those items, in which the DIS-
COUNT
percentage is less than 25 from FURNITURE table.
(d) To count the number of items, whose TYPE is ‘Sofa’ from FURNITURE table.