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

IP

The document contains exercises for Informatics Practices (065) focusing on Python programming with Pandas and data visualization using Matplotlib, as well as SQL queries for data manipulation. It includes tasks such as creating DataFrames, adding rows and columns, updating values, and generating plots, along with SQL commands to query and modify data in tables. Each question is structured to enhance understanding of data handling and visualization techniques.

Uploaded by

samikgautam5
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 views2 pages

IP

The document contains exercises for Informatics Practices (065) focusing on Python programming with Pandas and data visualization using Matplotlib, as well as SQL queries for data manipulation. It includes tasks such as creating DataFrames, adding rows and columns, updating values, and generating plots, along with SQL commands to query and modify data in tables. Each question is structured to enhance understanding of data handling and visualization techniques.

Uploaded by

samikgautam5
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/ 2

Informatics Practices (065) Set A

Q1. Write the code to create a DataFrame ‘df’ and answer the questions followed.
Maths Science SST
Amit 100 100 60
Mohan 95 50 57
Sudha 85 90 53

i) Write a command to add one row T5 with values 75, 98, 56


ii) Write a command to add one column Total = Maths + Science + SST
iii) Write a command to print Score of Maths and Science only.
iv) Write a command to update marks of Science of Sudha to 88

Q2 Write a python program to display a bar chart of the number of students in a school.
a) Sample data: Group I, II, III, IV and strength is 30, 40, 45, 49
b) Title for x axis should be ‘Groups’ and title for y axis should be ‘Number of students’
c) Title of the chart should be ‘Group wise students’.

Q3. Write the commands in SQL for (i) to (vi) and output for (vi) and (vii).
Table: Infant

ItemCode Item DatePurchase UnitPrice Discount

101 Frock 2016-01-23 700 11

102 Cot 2015-09-20 5000 25

103 Soft Toy 2016-06-17 800 10

104 Baby Socks 2014-10-16 100 07

105 Baby Suit 2015-09-20 500 05

(i) To list the names of items and their unit price that have unit price less than 1000.
(ii) To display the number of items that have more than 10% as a discount.
(iii) To display item code and unit price in decreasing order of unit price.
(iv) To increase the unit price of each item by 5% of their unit price.
(v) To display the highest unit price of items.
Write the Output of the following SQL queries:
(vi) SELECT MID (Item,1,2) FROM Infant;
(vii) SELECT AVG (UnitPrice) FROM Infant WHERE DATEPURCHASE is ‘2015–09–20’ ;
Informatics Practices (065) Set B

Q1 Write a program in Python Pandas to create the following DataFrame batsman from a
Dictionary:
Name Score1 Score2
1 Sunil 90 80
2 Gaurav 65 45
3 Piyush 70 90
4 Kartik 80 76

Perform the following operations on the DataFrame :


i) Add a row at the end with the following details:
Aman 90 95
ii) Add both the scores of a batsman and assign to column “Total”
iii) To update the Score1 of Sunil as 100.
iv) Display the details of Piyush.
Q2 Write a Python program using matplotlib to create a line plot with the following data:

X values: [1, 2, 3, 4, 5] Y values: [2, 4, 6, 8, 10]


a) Display the line plot.
b) Set the title of the graph to "Simple Line Plot".
c) Label the x-axis as "X Axis" and the y-axis as "Y Axis".

Q3 Consider the following table CARDEN. Write SQL commands for the following statements.
Ccode Carname Company Color Capacity Charges

510 A Star Suzuki Red 3 14

503 Indigo Tata Silver 3 12

502 Innova Toyota White 7 15

509 SX4 Suzuki Silver 4 14

510 Alto Maruti Silver 4 35

i) To display the names of all Silver colored Cars.


ii) To display name of car, Company and capacity of Cars in descending order of their seating
capacity.
iii) To display the highest charges at which a vehicle can be hired from Carden.
iv) To increase the charges by 5% for Suzuki company
v) Display CarName and Company of those cars who are having charges greater than 14.
Write output for the following MYSQL queries:-
(vi) SELECT MID(CarName, 2,3) FROM CARDEN;
(vii) SELECT POW(CAPACITY, 2) FROM CARDEN WHERE CHARGES IN (12,14);

You might also like