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

IP Practice Questions

The document outlines a practice question set for Class 12 Informatics Practices, focusing on Python programming and SQL commands. It includes tasks to create and manipulate DataFrames, generate bar and line charts, and write SQL queries based on given tables. The exercises cover data handling, visualization, and database management skills essential for the practical exam.

Uploaded by

akashagarwal5680
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)
3 views3 pages

IP Practice Questions

The document outlines a practice question set for Class 12 Informatics Practices, focusing on Python programming and SQL commands. It includes tasks to create and manipulate DataFrames, generate bar and line charts, and write SQL queries based on given tables. The exercises cover data handling, visualization, and database management skills essential for the practical exam.

Uploaded by

akashagarwal5680
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

Practice Practical Question -2024

Class-12 Informatics Practices (065)

1. Write a program to create the given DataFrame ‘Items’:


Name Price Quantity
0 CPU 7750 15
1 Watch 475 50
2 Key Board 225 25
3 Mouse 150 20
Write suitable Python statements for the following:
i) Add a new item named “Printer” having price 8000 and Quantity as 10.
ii) Add a column called Sale Price which is Rs 100 decreased value of Price
iii) Rename column Name to ‘Item_Name’.
iv) Remove the column Quantity
# write python program to create dataframe.
Item.loc[4,:]=[‘Printer’,8000,10]
Item[‘Sale Price’]=Item.Price-100
Item.rename(columns={‘Name’:’Item_Name’},inplace=True)
del Item[‘Quantity’]

2. Write a Python code to get the following bar chart. Save the chart in png format.

Bharti a class XII (IP) student has to fill in the blanks in Python programs that generate a bar chart. This
bar chart calculates subject wise result analysis.

import _____________________ as plt #Statement-1


Subject=['ENGLISH','ACCOUNTS','BST','ECONOMICS','IP']
Percentage=[85,98,70,82,100]
plt.bar(________, Percentage) #Statement-2
plt.___________("SUBJECTS") #Statement-3
plt.ylabel("PERCENTAGE")
plt.title(‘___________________’) #Statement-4
plt.show()
plt.savefig('Result.png')
3. Write a program to create the given DataFrame ‘Temp’:

Write suitable Python statements for the following:


i) To print city with rainfall from DataFrame Temp.
ii) Add a new city named “jaipur” having maxtemp 52 , mintemp 12 and rainfall 38.50.
iii) To add New column AvgTemp i.e. (Maxtemp+Mintemp)/2
iv) Delete column AvgTemp.

# write python program to create dataframe.


print(Temp[[‘City’,’Rainfall’]])
Temp.loc[4,:]=[‘jaipur’,52,12,38.50]
Temp[‘AvgTemp’]=Temp.Maxtemp+Temp.Mintemp)/2
del Temp[‘AvgTemp’]

4. Write a Python code to get the following line chart. Save the chart in png format.

Bharti a class XII (IP) student has to fill in the blanks in Python programs that generate a line chart. This
line chart display day wise temperature of Delhi.

import _____________________ as plt #Statement-1


days=[2,4,6,8,10,12,14]
temperature=[35,38,42,46,40,44,47]
plt.bar(days,___________) #Statement-2
plt.___________("days") #Statement-3
plt.ylabel("temperature")
plt.title(‘___________________’) #Statement-4
plt.show()
plt.savefig('Result.png')
5. Create table and Write SQL commands on the basis of given table CLOTHS

i) To show all information of those clothes whose color either Gray or Blue.
ii) To list cloth name and price ascending order of price Name start with ‘T’.
iii) Write a query to display size-wise number of clothes.
iv) Write a query to set price as Rs 999 for CCode C003
v) Rename column DOP to Date_of_Purch date.
vi) Write SQL command to add primary key using alter table.
SELECT * FROM CLOTHS WHERE COLOR IN (‘GREY’,’BLUE’);
SELECT CNAME,PRICE FROM CLOTHS WHERE CNAME LIKE ‘T%’ ORDER BY PRICE;
SELECT SIZE,COUNT(*) FROM CLOTHS GROUP BY TYPE;
UPDATE CLOTHS SET PRICE=999 WHERE CCODE=’C003’;
ALTER TABLE CLOTHS CHANGE DOP Date_of_Purch date;
ALTER TABLE CLOTHS ADD PRIMARY KEY(CCODE);
6. Create table and Write SQL commands on the basis of given table BOOKING

i) To show all information of passenger whose destination either Delhi or Mumbai.


ii) To list passenger name and quantity descending order of quantity
iii) Write a query to display destination wise maximum prime from table booking.
iv) Write a query to increase 15% price for all.
v) Write command to rename column Price to Fair.
vi) Write command to delete command quantity.

SELECT * FROM BOOKING WHERE DESTINATION IN (‘DELHI’,’MUMBAI’);


SELECT PASSENGER, QUANTITY FROM BOOKING ORDER BY QUANTITY DESC;
SELECT DESTINATION,MAX(PRICE) FROM BOOKING GROUP BY DESTINATION;
UPDATE BOOKING SET PRICE=PRICE+(PRICE*0.15);
ALTER TABLE BOOKING CHANGE PRICE FAIR INT;
ALTER TABLE BOOKIN DROP QUANTITY;

NOTE: Practice Question for Practical Exam….

You might also like