[go: up one dir, main page]

0% found this document useful (0 votes)
231 views11 pages

XII Practical List Programs

The document contains a practical list with 24 questions related to Python programming, SQL queries, and data analysis using Pandas library. The questions cover topics like creating Series and DataFrames, manipulating data, plotting charts, writing SQL queries, and more. The last question asks to delete an entire table from a database.

Uploaded by

vikas_2
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)
231 views11 pages

XII Practical List Programs

The document contains a practical list with 24 questions related to Python programming, SQL queries, and data analysis using Pandas library. The questions cover topics like creating Series and DataFrames, manipulating data, plotting charts, writing SQL queries, and more. The last question asks to delete an entire table from a database.

Uploaded by

vikas_2
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/ 11

K.V.

NEPANAGAR

Practical List Class XII-IP 2020-21

1. Write a program to create a Series object using an Nd-array that has 10


elements at equal distance in the range 100 to 200?

2. Write a program to create a Series object using a dictionary that stores the
number of students in each section of class 12 in your school?

3. Consider the series object S that stores the contribution of each section, as
shown below:

Write code to modify the amount of section ‘A’ as 3400 and for section ‘C’ and ‘D’ as
5000. Print the changed object.
4. Write a program to create a Data Frame Quarterly Sales where each row
contains the Quarterly Sales of TV, Freeze and AC. Show the DataFrame after
deleting details of Freeze.

5. Write a program to create a DataFrame to store Roll Number, Name and Marks
of five students. Print the DataFrame and its transpose.

6. Write a program to create a DataFrame from a CSV file. Display the shape
(Number of rows and columns) of the CSV file.
7. Name, Height and Weight of 05 students. Create a CSV file using this
DataFrame.

8. Given the school result data, analyses the performance of the students in
Accountancy and Business studies using bar graph.
9. Given datasets population of India and Pakistan in the given years. Show the
population of India and Pakistan using line chart with title and labels of both
axis.

10. Write a program to plot a bar chart from the medals won by four
countries. Make sure that bars are separately visible.
11. A survey gathers height and weight of 60 participants and recorded the
Participants’ ages as:
Ages = [1,1,2,3,5,7,8,9,10,10,11,13,13,15,16,17,18,19,20,21,21,23,24,24,24,25,25,
25,25,26,26,26,27,27,27,27,27,29,30,30,30,30,31,33,34,34,34,35,36,36,37,37,37,
8,38,39,40,40,41,41]
Write a program to plot a histogram from above data with 20 bins.

12. Write a program to create data series and then change the indexes of the
Series object in any random order.
13. In an online contest, two 2-player teams’ point in 4 rounds are stored in
two DataFrames as shown below:

Write a program to calculate total points earned by both the teams in each
round.

14. Write a program to create a DataFrame with two columns name and age.
Add a new column Updated Age that contains age increased by 10 years.
15. Given a DataFrame ( df ) as under:

Write a program to print DataFrame one row at a time. Also display first two rows of
City column and last two rows of Schools column.
16. Write a program to plot a horizontal bar chart from heights of some
students.

Consider below dataframe and answer question 17 to 22

17. Create above dataframe name it df1


18. Add a new column birthrate with all values 5
19. Add a new row with label BIKANER with all value 5
20. Delete column population and grade
21. Delete row UDR and MUMBAI
22. Update population of UDR from 3000 to 1111
23. Write SQL commands on the basis of the following tables.

1) Display details of those products whose manufacturere is “ABC”.


2) Display details of Products whose price is in range of 50 to 100.
3) Display Product Name and Price from table Product where product name starts
with “B”.
4) Increase the price of all products by 10.
5) Display details of products in ascending order of price.

24. Consider the following tables HOSPITAL. Write SQL commands for (i) to
(vi) and give outputs for SQL queries (vii) to (x).

(i) To show all information about the patients whose names are having six characters
only.
(ii) To reduce Rs. 200 from the charge of female patients who are in Cardiology
department.
(iii) To insert a new row in the above table with the following data :
11, ‘Rakesh’, 45, ‘ENT’, {08/08/08}, 1200, ‘M’
(iv) To remove the rows from the above table where age of the patient > 60.
(v) fetch department wise number of patients.
(vi) fetch total male patients in surgery and cardiology department.
(vii) Select SUM(Charge) from HOSPITAL where Sex=’F’;
(vii) Select COUNT(DISTINCT Department ) from HOSPITAL;
(ix) Select Department, SUM(Charge) from HOSPITAL group by Department;
(x) Select Name from HOSPITAL where Sex=’F’ AND Age > 20;

25. Consider below table and answer

i. Display the AccNo, Cust_Name, and Loan_Amount of all the loans.


ii. Display the AccNo and Loan_Amount of all the loans started before 01-04-2009.
iii. Display the details of all the loans with less than 40 instalments.
iv. Display the details of all the loans whose rate of interest is NULL.
v. Display the details of all the loans whose rate of interest is not NULL.
vi. Display the amounts of various loans from the table Loan_Accounts. A loan amount should
appear only once.
vii. Display the details of all the loans started after 31-12-2008 for which the number of instalments
are more than 36.
viii. Display the Cust_Name and Loan_Amount for all the loans which do not have number
of instalments 36.
ix. Display the details of all the loans which started in the year 2009.
x. Display the details of all the loans whose Loan_Amount is in the range 400000 to
500000.
xi. Display the Cust_Name and Loan_Amount for all the loans for which the number of
instalments are 24, 36, or 48. (Using IN operator)
xii. Display the AccNo, Cust_Name, and Loan_Amount for all the loans for which the
Cust_Name ends with 'Sharma'.
xiii. Display the AccNo, Cust_Name, and Loan_Amount for all the loans for which the
Cust_Name does not contain 'P'.
xiv. Display the AccNo, Cust_Name, and Loan_Amount for all the loans for which the
Cust_Name contains 'a' as the second last character.
xv. Display the details of all the loans in the descending order of their Start_Date.
xvi. Display the details of all the loans in the ascending order of their Loan_Amount and within
Loan_Amount in the descending order of their Start_Date.
xvii. Increase the interest rate by 0.5% for all the loans for which the loan amount is more than
400000.
xviii. Delete the records of all the loans whose start date is before 2007.
xix. Delete entire table Loan_Accounts.

You might also like