0% found this document useful (0 votes)
1 views3 pages

final practical questions

The document outlines programming tasks using Pandas and Matplotlib, including creating and manipulating DataFrames, printing specific rows, transposing data, filtering records, and plotting charts. It also includes SQL queries for creating tables, performing operations like displaying total cars sold, calculating average prices, and querying employee data. The tasks are structured in a question format, detailing specific requirements for both Python and SQL programming.

Uploaded by

breezys.town99
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
1 views3 pages

final practical questions

The document outlines programming tasks using Pandas and Matplotlib, including creating and manipulating DataFrames, printing specific rows, transposing data, filtering records, and plotting charts. It also includes SQL queries for creating tables, performing operations like displaying total cars sold, calculating average prices, and querying employee data. The tasks are structured in a question format, detailing specific requirements for both Python and SQL programming.

Uploaded by

breezys.town99
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Q1.

Program using Pandas and Matplotlib :

a. Write the Python code for following :


i. To make following DataFrame DF in Python:

Name Degre Marks


e
S1 Ravi MCA 90
S2 Amita BA 85
S3 Rohan MBA 73
S4 Sumit BE 81
ii. To print the first, third and forth row respectively using 1 print statement.

iii. To display the DataFrame records in transposed form.


iv. To display the records of those students who have scored more than 85.

v. To remove the Degree column.

b. Write the Python code to plot a line chart with the DataFrame DF created in
previous
question where names and marks should be plotted on x and y axis
respectively. Also
add appropriate title of the chart, title of x and y axis respectively.

Q2. SQL Queries.

CarId CarName Price Model


D001 Car1 5800000 LXI
D002 Car1 6700000 VXI
B001 Car2 5600000 Sigma1.
2
B002 Car2 6400000 Delta1.2
E001 Car3 3500000 CARE
E002 Car3 5100000 LXI
a. Create a table Inventory with the fields given in the above table, assuming
datatype of
your own. Also set any appropriate field as a Primary Key of the table.
b. Consider the Inventory table given above, write the queries to perform
following operations:
i. To display total number of cars sold.
ii. To display the average price of cars having model as LXI.

iii. To display CarId and its price increased by 30%.

iv. To display the highest price of the car.

v. To display the records of all cars in ascending order of price..

Q3. Program using Pandas and Matplotlib :

c. Write the Python code for following :


vi. To make following DataFrame DF in Python:

Name Score
0 Manish 35.5
1 Dheeraj 58.5
2 Ravi 89
3 Shyam 73
vii. To change the dataframe index from 0,1,2,3 to ‘S1’,’S2’,’S3’,’S4’
respectively.
viii. To print first three rows of DataFrame DF.

ix. To add a new column percentage with values 6.25, 5.50, 10.25, 9.50
respectively.
x. To remove the Score column.

d. Write the Python code to plot a bar chart with the DataFrame DF created in
previous
question where names and score should be plotted on x and y axis
respectively. Also
add appropriate title of the chart, title of x and y axis respectively.

Q4. SQL Queries.

EmpNo Ename Post Salary Bonus


102 Kirti Manager 60000 323
110 Tanya Accountant 50000 267
106 Sandhya Manager 48000 450
103 Gurpreet Executive 42000 NULL
109 Aliya Executive 34000 200
105 Josphin Clerk 19000 NULL
108 Hina Peon 12000 180
c. Create a table Employee with the fields given in the above table, assuming
datatype of
your own. Also set any appropriate field as a Primary Key of the table.
d. Consider the Employee table given above, write the queries to perform
following operations:
vi. To display the name of Employees who have salary between 40000 and
50000.
vii. To display the employee id and name of the employees who din’t get any
bonus.
viii. To display the average salary of the employees post wise who are having
post as
Manager or Clerk.

ix. To display minimum and maximum salary given to the employees.

x. To drop the column bonus.

You might also like