0% found this document useful (0 votes)
51 views

Practice 1,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)
51 views

Practice 1,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/ 8

Practice-1

I.
A) Write a program in Python Pandas to create the following DataFrame Stationary:
[8]
(Use dict of list method)and perform the following operations on the DataFrame :

a. Transfer the Dataframe to a csv file named “final.csv”.


b. Add a column discount with value of 5% for all items in the DataFrame at the
Position1.
c. Display the products details which is more than 100 rupees

B) Mr. Vijay is working in the mobile app development industry and When he
was comparing some playstore APPs based on the ratings, please help him to
visualize that comparison as a barchart.Here are those apps and their
appropriate ratings
"Arogya Setu","WPS Office","Cam
Scanner","WhatsApp","Telegram"
3.9,4.5,4.6,4.2,4.3
II.Consider thegiven table Faculty, write suitable SQL queries for the following: 7

Faculty_Id First_name Last_name Hire_date Salary location

101 Sarika Mishra 12-10-1997 25000 Jammu

102 Naveen Sharma 23-12-1994 18000 Newdelhi


103 Rakesh Vyas 25-08-2003 32000 Ranji

104 Rashmi Malhotra 18-09-2004 21000 Jammu


105 Amit Srivastava 05-06-2007 2800 Newdelhi

WriteSQLcommandsto:

a.Create the above given table Faculty ,insert the given data
b. Display all records in descending order of Hire_date.
c. Find the maximum and minimum salary.
d. Display the day(ie:Monady ,Tuesday)of Hire date
e. To display details of those faculty members whose First_name ends with‘t’.
f. Find faculty’s average salary for location wise
—-----------------------------------------------------------------------------------------
Practice-2
I. A) Create the following dataframe df and do the given commands:

HouseName First Second Third

0 Chenab 5 7 6

1 Ganges 10 5 4

2 Jamuna 12 13 15

3 Jhelum 8 9 12

4 Ravi 5 11 10

5 Satluj 10 5 3

i.Display the house names where the number of Second Prizes are in the range of
12 to 20
ii. Display all the records in the reverse order.
iii. Display the bottom 3 records.
iv. Create the another row with this values(‘Tedd’,2,5,12)

B) ‘Techknow’ institute wants to represent the students attendance for the month
january to june in line chart,those months respective attendance are
30,50,50,30,30,60. Save the output as pdf and add title ,labels for the graph:

II.
[7]
i. Create the above table and insert the following data
ii. Count the total number of employees working in each department.
iii. Display all the details of the employees in the descending order of their
salaries.
iv. Find the position of character ‘r’ in designation
v. Increase the salary 20% for programmers
vi. Display the name and designation of employees whose name ends with
‘Kumar’
—---------------------------------------------------------------------------------------------------
Practice-3
I. Mr. Karambir is working as Examinor In-Charge in school, and he has provided some
data. On which he wants to do some operations, but he is facing some problem, help
him:
Roll Name marks
0 1 a 87
1 2 b 45
2 3 c 67
3 4 d 39
4 5 e 78
i)Display all records having rollno more than 3
ii)Add a new column ‘Grade’, with the values, ‘ A’, ‘B’, ‘A’, ‘B’, ‘A’ to the DataFrame
iii)Write a code to display the following output:

Name marks
0 a 87
1 b 45
iv)Delete the column “Name”

B) Write code to plot a line chart to depict the run rate of T20 match from given data:

Overs Runs

5 45

10 79

15 145

20 234
II.Consider thegiven table Faculty, write suitable SQL queries for the following:
[7]

Faculty_Id First_name Last_name Hire_date Salary location

101 Sarika Mishra 12-10-1997 25000 Jammu

102 Naveen Sharma 23-12-1994 18000 Newdelhi


103 Rakesh Vyas 25-08-2003 32000 Ranji

104 Rashmi Malhotra 18-09-2004 21000 Jammu


105 Amit Srivastava 05-06-2007 2800 Newdelhi

WriteSQLcommandsto:

a.Create the above given table Faculty ,insert the given data
b. Display all records in descending order of salary.
c. Find the number of unique locations
d. Display the first 3 characters of firstname column
e. Change the salary as 30000 who joined before 2000
f. Find faculty’s average salary for location wise
—---------------------------------—------------------------------------------------------------------------------
Practice-4

I. create the following dataframe and do the following commands

A)

(i) To display the ‘Names’ and ‘Marks’ columns from the DataFrame.
(ii) to change the ‘Marks’ in the 4th row (i.e. for index 3) to 91.5
(iii) to display the rows where number of ‘Trials’ in the examination is less than 2 and ‘Marks’ is
greater than 95

B) The table below shows the Marks of two students for the four unit tests for academic session
2019-2020. Plot the given data as line graph add legends and labels
(i) To display names of stores along with Sales Amount of those stores that are
located in Mumbai.

(ii) To display the details of store in alphabetical order of name.

(iii) To display the City and the number of storeslocated in that City, only if
number of stores is more than 2.

Find output:

(iv) SELECT MIN(DateOpen) FROM Store;

(v) SELECT COUNT(StoreId), NoOfEmp FROM Store

GROUP BY NoOfEmp HAVING MAX(SalesAmt)<60000;

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy