Ip Practical 2024 2025
Ip Practical 2024 2025
Ip Practical 2024 2025
8. Create a series that stores the area of some states in km2. Write code to find out the areas
that are more than 50000 km2. Also write program to sort the values of this series in descending
order of its indexes and store it into series object S3.
9. Write a code to create the dataframe from list of series which contains names, subjects
and mark. The program should display the complete dataframe and also add new column and
new row in a dataframe.
10. Create a dataframe mdf as shown below. Answer questions (a) to (d):
C1 C2 C3
0 13 23 37
1 19 20 21
2 11 12 13
3 13 14 15
a) Write code to create a new dataframe n1 that stores the values of dataframe mdf
b) Write code to add a column C4 in the dataframe n1 which stores the difference of
column C3 with column C2 from the dataframe n1.
c) Write code to drop the column C4 from the dataframe n1. The dataframe shouldbe
modified after this ststemnet.
d) Write code to drop the index 2 from the dataframe n1. The dataframe should be
modified after this ststemnet.
11. Create dataframe that will store name, age and weight of three persons. Print the
dataframe and also find out its transpose.
12. Create the following dataframe sales containing year wise sales figures for five sales
person in INR. Use the years as column labels and sales person names as row labels.
14.
Science 95 89 77
Arts 97 92 77
Commerce 93 90 75
0,1,1,2,3,5,8,13,21,34
78,72,69,81,63,67,65,75,79,74,71,83,71,79,80,69
Men:[113,85,90,150,149,88,93,115,135,80,77,82,119]
Wome :[67,98,89,120,133,150,84,69,89,79,120,112,100]
mu=100
sigma=15
x=mu+sigma*numpy.random.randn(10000)
y=mu+30*numpy.random.randn(10000)
23.
24. Create a CSV file Employee.csv that stores the data like
empname, empid, salary, designation of employees in any location
of your computer. Write a python program to create dataframe
from it but dataframe should not use file’s column header rather
should use own column numbers as 0, 1, 2 and so on. Use empid
column as index labels
Create a dataframe in python with above data. Now write the code to
store the data of df dataframe in a CSV file namely ‘product.csv’, with
NaN values sored as NULL and separator as ‘|’ .
SQL TABLES
1. Consider the table Doctor given below, write command in SQL for (1) to (4) and output for
(5) to (8).
Table : DOCTOR
(1) To display name of all doctors who are in Medicine having more than 10 years of
experience.
(2) To display the different departments.
(3) To display minimum consultation fee of female doctors
(4) To display name and department of male doctors who has no experience.
(5) SELECT AVG(ConstFee) FROM Doctor WHERE NOT Gender=’F’;
(6) SELECT Count(Experience) FROM Doctor;
(7) SELECT Name, Experience FROM Doctor WHERE id BETWEEN 100 AND 200;
(8) SELECT SUM(ConstFee),MAX( Experience) FROM Doctor;
2. Consider the following tables PRODUCT and answer (a) and (b) part of this
question
Table :PRODUCT
ii. To list the company which gives warranty for more than 2 years.
iii. To find stock value of the BPL company where stock value is sum of the
products of price andstock.
vi. To show the PRODUCT name which are within warranty as on date.
(a) Write the SQL command to create the table CLUB including the constraints.
(c) Write the SQL command to display the details of all the members whose type is
“Permanent” and fees is more than Rs. 5000.
(e) Change the fees rate by 10% if the membership is of type “Temp”
(f)Write The SQL command to display all the details of all the members whose age
is grater than eighteen.
4. Study the following table and then answer the given questions:
TEACHERS
5. Study the following table and then answer the given questions:
Table : SchoolBus
(a) To show all information of students where capacity is more than the no of student in
order of Rtno.
(b) To show area_covered for buses covering more than 20 km., but charges less then
80000.
(c) To show transporter wise total no. of students traveling.
(d) Add a new record with following data:
(11, “ Moti bagh”,35,32,10,” kisan tours “, 35000)
7.
8. Answer the following questions.
Table: bills Table: items
Table: Sports
Based on these tables write SQL statements for the following queries:
i) Display the lowest and highest classes from the table Students.
ii) Display the number of students in each class from the table students.
iii) Display the number of students in Class 10.
iv) Display details of students of Cricket team.
v) Display the Admission number, name, class, section and roll number of the students whose grade
in Sports table is “A”.
vi) Display the name and phone numbers of the students of class 12 who are play some game.
vii) Display the number of students with each coach.
viii) Display the names and phone numbers of the students whose grade is ‘A’ and whose coach is
‘Narendra’.