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

Ip Practice Questions Class 12

Uploaded by

15099
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)
666 views5 pages

Ip Practice Questions Class 12

Uploaded by

15099
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

IP Practical Practice Questions

Pr1.

Q1. Problem Solving using PYTHON [5 + 3 = 8]


a) Write the code to create the series ‘serObj’ and answer the questions followed.
(5)
Jan 31
Feb 28
Mar 31
Apr 30
i) Write the command to add one row: ‘May’ – 31
ii) Write the command to update Feb to 29
iii) Write the command to change index to 1, 2,3,4,5 in place of Jan, Feb, Mar, Apr and May.
iv) Write a command to print a month name having number of days less than 31.
v) Write the output:
(a) print(serObj < 30)
(b) print(serObj + 3)

b) Write a Python program to display a BAR CHART of the number of students in a school. (3)
(i) Use different colors for each bar.
(ii) Title for x axis should be ‘Groups’ and title for y axis should be ‘Number of
Students’
(iii) Ensure the title of chart is “Group wise Students” and grid line must be shown.
Sample data: Group: I, II, III, IV and Strength: 38, 30, 45, 49

Q2. SQL Queries: [2+5=7]

a) Create a table DRUGDB with the fields given in below table and assuming data type of your
own.
b) Consider the table DRUGDB. Write the SQL commands for queries given below:
(i) To increase the price of “Paracetamol” by 35.
(ii) To display the drugid, Rxid and pharmacy name of all records in descending order of their price.
(iii) Display all the details of the drugs where name starts with ‘C’ and has ‘sh’ somewhere in the name.
(iv) Display the drug name in lower case along with price rounded off to nearest interger.
(v) Delete the field name loc from drugdb table.
Pr2.

Q1. Problem Solving using PANDAS & MATPLOTLIB [5 + 3 = 8]


a) Write the code to create a DataFrame ‘df’ and answer the questions followed. (5)
Maths Science SST
Amit 100 100.0 60.0
Mohan 95 50.0 57.48
Sudha 85 90.0 53.58

i) Write a command to add one row ‘Chris’ with values 75.6, 98.6, 56.0
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 85.0
v) Write a command to delete a row - Mohan
b) Write a Python program to display the given Result using a BAR CHART (3)
Maths Science SST
Amit 100 100.0 60.0
Mohan 95 100.0 57.48
Sudha 85 100.0 53.58
(i) Set the title of graph is “Result Analysis”
(ii) Display the legends.
(iii) Display the label of x axis to “Name” and y axis to “Score”
Q2 SQL Queries: [7]

Write the commands in SQL for (i) to (vi) and output for (vii) and (viii).
(i) To list the names of items and their unit price that have unit price less than 800 and discount
more than 5%.
(ii) To display the number of items that have more than 10% as 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 10% of their unit price.
(v) To display the highest unit price of items.
(vi) To display the names of items that has ‘Baby’ anywhere in their item names.
Find Output :
(vii) SELECT MID (Item,1,2) FROM Infant;
(viii) SELECT AVG(UnitPrice) FROM Infant WHERE DATEofPURCHASE > '2015-01-01';
Pr.3
Q1. Problem Solving using PANDAS & MATPLOTLIB [5 + 3 = 8]
a) Write the code to create a DataFrame ‘RESULT’ and answer the questions followed.
(5)
Col1 Col2 Col3
T1 100.0 100.0 60.0
T2 95.8 100.0 57.48
T3 NaN 100.0 53.58
T4 82.0 85.4 49.20
i) Write a command to add one row T5 with values 75.6, 98.6, 56.0 , 92.5
ii) Write a command to add one column Total = col1+col2+col3
iii) Write a command to change the column names Col1 to Maths, Col2 to Science, Col3 to SST.
iv) Write a command to print Score of Maths and Science only.
v) Write a command to update a value of T3 Row and Col1 / update NaN to 85.0
b) Write a Python program to display the given below data using a LINE PLOT (3)
Maths Science SST
Amit 100 100.0 60.0
Mohan 95 100.0 57.48
Sudha 85 100.0 53.58
(i) Set the title of graph is “Result Analysis”
(ii) Display the legends.
(iii) Display the label of x axis to “Name” and y axis to “Score”
Q2. SQL Queries:- 7

Consider the following tables CARDEN. Write SQL commands for the following
statements.

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


b) To display name of car, Company and capacity of Cars in descending order of their seating
capacity
c) To display the highest charges at which a vehicle can be hired from Carden.
d) To increase the charges by 5% for Suzuki company
e) Write a SQL query to display CarName and Company together of those cars which name are
having 'n' at anywhere or charges greater than 14
f) Write output for the following MYSQL queries:-
(i) SELECT LEFT(CarName, 3) FROM CARDEN;
(ii) SELECT MID(CarName, 2,3) FROM CARDEN;
(iii) SELECT POW(CAPACITY, 2) FROM CARDEN WHERE CHARGES IN (12,14);
(iv) SELECT MAX(CHARGES), COMPANY FROM CARDEN GROUP BY COMPANY;
Pr. 4.
Q1. Problem Solving using PANDAS & MATPLOTLIB [5 + 3 = 8]
A. Consider the following DataFrame df and answer the given questions (i) - (v)

i. Write the command in python to extract data from ‘Air india’ to ‘Indigo’ for all
columns.
ii. Write the command in python to extract the details of ‘Indigo’ flight.
iii. Write the command in python to extract the number of passengers in all flights.
iv. Write the command in python to extract all the details for all flights.
v. Write the command in python to extract data of Kuwait Airways, no. of passengers
using ‘at’.

B. Draw the following Line graph representing the percentage of marks for each person.

(i) Set the appropriate label to x-axis and y-axis.


(ii) Set the title of Graph “Percentage Comparison”

Q2. SQL Queries:-

Write the SQL Commands to perform the following:- [7]


i. Create a Hospital table with the P id, name, age, department, charges and gender as
attributes where PID is the primary key.(Insert 5 rows)
ii. Insert the details of a new patient in the above table. (6th row)
iii. Delete the details of a patient whose age is greater than 60 in the above table.
iv. Use the select command to get the details of the patients with charges more than 250.
v. Find the min, max, sum, and average of the charges in the Hospital table.
vi. Find the total number of patients in each department in the HOSPITAL.
vii. Write a SQL query to arrange the patients in descending order of Gender.

**********************************************

You might also like