0% found this document useful (0 votes)
149 views2 pages

Practical Sample Paper - B Informatics Practices

The document provides two questions involving data analysis and SQL queries using a teacher data set. Question 1 involves creating a DataFrame from teacher data, performing operations like filtering, adding columns, and plotting. Question 2 involves creating a SQL table from the DataFrame, performing queries like counting, aggregating, adding columns, updating data, and ordering results. The questions test skills with pandas and SQL on a sample teacher dataset.

Uploaded by

Soham D
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)
149 views2 pages

Practical Sample Paper - B Informatics Practices

The document provides two questions involving data analysis and SQL queries using a teacher data set. Question 1 involves creating a DataFrame from teacher data, performing operations like filtering, adding columns, and plotting. Question 2 involves creating a SQL table from the DataFrame, performing queries like counting, aggregating, adding columns, updating data, and ordering results. The questions test skills with pandas and SQL on a sample teacher dataset.

Uploaded by

Soham D
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/ 2

Practical sample paper ---B

INFORMATICS PRACTICES
Q1 . Write a program in python to create the following Data Frame named “df” storing the
following details:-

Tname Post Subject Salary Dt_join


101 Mr.R.K.Sharma TGT Science 45000 2018-04-01
102 Mr.Shiv Sahal TGT Hindi 43000 2018-04-01
103 Ms.Rama PRT English 35000 2018-08-11
104 Ms.Preeti PGT IP 76000 2018-01-07
105 Ms.Nidhi PGT IP 80000 2018-08-11
106 Mr P.K.Khanna TGT Science 45000 2018-01-07
Considering the above Data Frame answer the following queries by writing appropriate
commands in python pandas:- 2

a. Display Teacher name , subject and salary for all TGT Teachers 1
b. Add a row for a PRT Teacher.(take your own data), print the Data Frame now 1
c. Create a CSV file from the above data frame named Teacher.csv 1
d. Add a new column Bonus which is 15% of their Salary. Print the Data Frame now. 1
e. Now plot a multi line chart depicting the Teacher name on x-axis and their
corresponding salary and bonus on y-axis, with appropriate Graph title , x-axis title , y-
axis title , gridlines , legends and color etc 2
Total=8

Q2. Create the table Teacher with above data given in the above Data Frame and define first
column as Tid(which is row index label in the df) as primary key , (bonus column is not required
here).Feed all records in the Table from Tid 101 to 106. Now answer the following SQL queries:-

a. Count and display how many male teachers are there as TGT 1
b. Display number of teachers and their average salary for each post (but only for PGT and
TGT) 1
c. Add a new column as ‘contact_no’ in the table teacher 1
d. Increase the salary of PGT by 15% 1
e. Display details of Teachers seniority wise according to date of joining(Sr to Jr) 1

Table creation and data insertion is of 1 mark each 2

Total =7

You might also like