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

Practical File Class XII-2022-23 A

The document outlines practical exercises for Class XII Python Programming, including defining functions for managing student and flight data, file handling tasks, data structure operations, and SQL commands for various tables. It covers operations such as reading, displaying, searching, and modifying data, as well as implementing stacks and queues. Additionally, it includes SQL queries for retrieving and manipulating data from multiple tables related to senders, recipients, products, clients, consignors, and stationary items.

Uploaded by

7x8bqbhqv4
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 views5 pages

Practical File Class XII-2022-23 A

The document outlines practical exercises for Class XII Python Programming, including defining functions for managing student and flight data, file handling tasks, data structure operations, and SQL commands for various tables. It covers operations such as reading, displaying, searching, and modifying data, as well as implementing stacks and queues. Additionally, it includes SQL queries for retrieving and manipulating data from multiple tables related to senders, recipients, products, clients, consignors, and stationary items.

Uploaded by

7x8bqbhqv4
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/ 5

Practical List Class XII 2023-24

Class XII
Python Programming
Revision Tour

1. Define a functions with the following descriptions:


Global Variables:
AD_NO integer (Ranges 10 - 20)
NAME and CLASS as String , FEES Float
Functions:
• Function Read_Data ( ) to read an object of ADMISSION type
• Function Display( ) to display the details of an object
• Function Draw_Nos ( ) to choose 2 students randomly and display the details.
Use random function to generate admission nos to match with AD_NO.

2. Define functions with following description:


Global Variables :
• A data member Flight number of type integer
• A data member Destination of type string
• A data member Distance of type float
• A data member Fuel of type float
Functions:
1. A member function CALFUEL() to calculate the value of Fuel as per the
following criteria:
Distance Fuel
<=1000 500
more than 1000 and <=2000 1100
More than 2000 2200
2. A function FEEDINFO() to enter info.
3. A function Display() –To display information and call CALFUEL()

3.Write a Program to inset ,Delete and search data in a Queue and stack of employee
data.

4. Write a Program to inset ,Delete and search data in a Queue and stack of students
data as name, roll no. and class.

File Handling
1. Write a program to add the data in file named STU.DAT which contains Roll
No, Name & Marks.
2. Write a program to add a string in a file named STORY.DAT , read the string
and display no. of upper case and lower case letters.

3. Write a program to add a string in sequential file named Music.DAT , read the
string and display no. of characters, spaces and digits .

4. Write a program to add records in a binary file “Library.dat” and write functions
to display and search records.
5. Assume a text file “coordinate.txt” is already created. Using this file create a
function to count the number of words having first character capital.
Example: Do less Thinking and pay more attention to your heart. Do Less
Acquiring and pay more Attention to what you already have. Do Less Complaining and
pay more Attention to giving. Do Less criticizing and pay more Attention to
Complementing. Do less talking and pay more attention to SILENCE. Output will be :
Total words are 16.
6. Write a programme to store data in a csv file and display the same.
Data Structure
1. Write functions to Add ,Delete and Search element in a Stack implemented through
List.
2. Create a List of books using Stack and write functions to Insert Records in a List and
Delete record as per user’s choice.
SQL+Python

1. Design a menu driven python application to read, display, search delete and
modify data of student table stored as a sql table.

2. Design a menu driven python application for dynamic searching of data of


student table stored as a sql table.
3. Write a programe for password protection using python SQL Connectivity.

SQL
1. Write the SQL commands and output of the following:

Table: SENDER
SenderID SenderName SenderAddress SenderCity
ND01 R Jain 2,ABC Appts New Dehi
MU02 H Sinha 12 , Newtown Mumbai
MU15 S Jha 27/A , Park Street Mumbai
MD50 T Prasad 122-K, SDA New Delhi

Table: RECIPIENT
RecID SenderID RecName RecAddress RecCity
KD05 ND01 R Bajpayee 5, Central Avenue Kolkata
ND08 MU02 S Mahajan 116, A Vihar New Delhi
MU19 ND01 H Singh 2A, Andheri East Mumbai
MU32 MU15 P K Swamy B5, CS Terminus Mumbai
ND45 ND50 S Tripathi 13,BID, Mayur Vihar New Delhi
i) To display the name of all senders from Mumbai.
ii) To display the RecID, SenderName , SenderAddress , RescName , RecAddress
for every recipient.
iii) To display recipient details in ascending order of RecName.
iv) To display Number of Recipients from each city.
v) SELECT DISTINCT SenderCity FROM SENDER;
2. Write the SQL commands and output of the following:
Table: PRODUCT
P_ID ProductName ManufacturerName Price
TP 01 Talcom Powder LAK 40
FW 05 Face Wash ABC 45
BS 01 Bath Soap ABC 55
SH 06 Shampoo XYZ 120
FW 12 Face Wash XYZ 95

Table: CLIENT
C_ID ClientName City P_ID
01 Cosmetic Shop Delhi FW05
06 Total Health Mumbai BS01
12 Live Life Delhi Sh06
15 Pretty Woman Delhi FW12
16 Dreams Bengluru TP01

i) To display the details of those clients whose City is Delhi.


ii) To display the details of product whose Price is in the range of 50 to 100
(both values included).
iii) To display the ClientName, City from table CLIENT and ProductName and
Price from table PRODUCT, with their corresponding matching P_ID .
iv) To increase the price of all product by 10.
v) SELECT DISTINCT City FROM CLIENT;

3. Write the SQL commands and output of the following:


Table: CONSIGNOR
CnorID CnorName CnorAddress City
ND01 R Singhal 24, ABC Enclave New Delhi
ND02 Amit Kumar 123, Palm Avenue New Delhi
MU15 R Kohli 5 / A , South Street Mumbai
MU50 S Kaur 27 - K, Westend Mumbai

Table: CONSIGNEE
CneeID CnorID CneeName CneeAddress CneeCity
MU05 ND01 Rahul Kishore 5, Park Avenue Mumbai
ND08 ND02 P Dhingra 16 / J , Moore Enclave New Delhi
KO19 MU15 AP Roy 2A, Central Avenue Kolkata
MU32 ND02 S Mittal P 245, AB Colony Mumbai
ND48 MU50 BP Jain 13, Block DA Vihar New Delhi

i) To display all consignors from Mumbai.


ii) To display the CneeID , CnorName , CnorAddress , CneeName , CneeAddress
for every consignee.
iii) To display consignee details in ascending order of CneeName .
iv) To display number of consignors from each city.
v) SELECT CneeName,CneeAddress FROM CONSIGNEE WHERE CneeCity NOT IN
(“Mumbai”,”Kolkata”);
4. Write the SQL commands and output of the following:
Table: FURNITURE
No ItemName Type DateOfStock Price Discount
1 White lotus Double Bed 23/02/02 30000 25
2 Pink feather 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
No ItemName Type DateOfStock Price Discount
11 Wood Comfort Double Bed 23/03/03 25000 25
12 Old Fox Sofa 20/02/03 17000 20
13 Micky Baby Cot 21/02/03 7500 15
i) To list the ItemName which are priced at more than 15000 from the
FURNITURE table.
ii) To display ItemName,Type,DateOfStock of those items, in which DISCOUNT
percentage is more than 28 from the FURNITURE table.
iii) To count the number of items whose type is “Baby Cot” from FURNITURE
table .
iv) To insert a new row in the ARRIVALS table with the following data:
14,”Velvet touch”,”Sofa”,{26/03/05},15000,20
v) SELECT MAX(Discount) FROM FURNITURE,ARRIVALS;

5. Write the SQL commands and output of the following:


Table: STATIONARY
ItemNo Item Scode Qty Rate
1001 Ball Pen 11 20 10
1002 Eraser 11 10 5
1003 Pencil 12 30 2
1004 Notebook 13 25 20
1005 Sharpener 12 15 2
1006 Colors 11 5 15

Table: SUPPLIERS
Scode Sname
11 Rotomac
12 Nataraj
13 Rainbow

i) To display detail of all the items in the table STATIONARY in ascending order
of Qty.
ii) To display ItemNo,Item name of those items from table STATIONARY whose
Rate is more than 15.
iii) To display detail of those items whose Scode is 12 or Qty in Stationary is
more than 10 from the table STATIONARY.
iv) To display minimum Rate of items for each supplier individually as per Scode
from the table STATIONARY:
v) SELECT Rate*Qty FROM STATIONARY WHERE ItemNo = 1001;

***********

You might also like