set1-6

Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

SET-1

1 a) Write python code for the following (3M)


Term1 45
Term2 24
Term3 50
Term4 34

i. Write a python code to create above Series


ii. Add new value 50 with index ‘term5’
iii. Delete value whose index is 2.

1 b) Write program in python to create a line chart with the given data and also set the name to x-axis, y-
axis and title. Also save graph name as simple.pdf. (5M)
ename = ['Hari', 'Riya', 'Chandhan', 'Joe', 'Mita']
sal = [4000, 6000, 5000, 3500, 8000]

1 c) Consider the following two tables Employee and Department, and write SQL commands to the
following: (7M)

i. Create Department table as per above given data by applying primary key
on deptno column.
ii. Create Employee table as per above given data by applying primary on eno
column and foreign key on deptno column with reference to Department
table deptno column.
iii. Insert above data into Department table.
iv. Insert above data into Employee table.
v. Display Employee names and their Department name.
vi. Display Employee and their HOD name.
vii. Display Employee and their HOD name who are working in CS department.
SET-2

2a)Write python code for the following (3M)

ROXX 15.2
PUNCH 18.8
CRETA 17.4
XUV700 17.0
NEXON 17.4

i. Create series called mileage using list


ii. Add 19.1 with index as ‘ALTROZ’
iii. Display first 2 rows

2 b) Write program in python to create a line chart with the given data and also set the name
to x-axis, y-axis and title. Also save graph name as simple.pdf. (5M)
years=[2020,2021,2022,2023,2024]
pass=[95,94,900,95,98]
2c) Consider the following two tables Employee and Department, and write SQL commands to the
following: (7M)

i. Create Department table as per above given data by applying primary key
on deptno column.
ii. Create Employee table as per above given data by applying primary on eno
column and foreign key on deptno column with reference to Department
table deptno column.
iii. Insert above data into Department table.
iv. Insert above data into Employee table.
v. Display Employee names and their Department name.
vi. Display Employee and their HOD name.
vii. Display Employee and their HOD name who are working in CS department.
SET-3
3a) Consider the following Series Class and answer the questions. 3M
A 45
B 36
C 27
D 35
(i) Write python code to create above series Class using list
(ii) Write a statement to delete element whose index is ‘B’
(iii) Write a statement to add one element with 54 as value and index as ‘E’

3b) Write program in python to create a line chart with the given data and also set the name
to x-axis, y- axis and title. Also save graph as simple.pdf. 5M
ename=[‘Hari’,’Riya’,’Chandhan’,’Joe’,’Mita’]
sal=[4000,6000,5000,3500,8000]

3c) Consider the following two tables Employee and Department, and write SQL commands to
the following.

7M

i. Create Department table as per above given data by applying primary key on Deptno
column.
ii. Create Employee table as per above given data by applying primary on eno column and
foreign key on deptno column with reference to Department table deptno column.
iii. Insert above data into Department table.
iv. Insert above data into Employee table.
v. Display Employee names and their Department name.
vi. Display Employee and their HOD name.
vii. Display Employee and their HOD name who are working in CS department.
SET - 4

4a) Write python code for the following (3M)

i. Create Dataframe using List of dictionaries


ii. Add new column ‘Price’ with values 100000, 160000,180000 & 500000
iii. Display last 3 rows
4b) Write program in python to create a histogram that represents runs of batman in
different matches in the form of ranges, and also set the name to x-axis, y-axis and title.
Also save graph as simple.pdf (5M)
runs=[81,85,65,42,57,72,85,99,94,72,66,67,76]
bins=[50,60,70,80,90,100]
4c) Consider the following table and write SQL commands for all the questions 7M

TableName:STUDENT
ROLLNO NAME DOB CITY STREAM FEE
1 Srinath 2015-11-05 Bangalore Science 2344.75
2 Supriya 2016-09-25 Nagpur Humanities 5454.50
3 Chandhan 2018-12-18 Delhi NCR Arts 1234.56
4 Giri 2012-12-12 Hyderabad Science 8746.89
5 Kaveri 2015-02-18 Chennai Science 8746.89

i. Create above table by applying primary key on Rollno column.

ii. Insert above data to the table.

iii. Display details of all the students based on stream

iv. Display total number of students in each stream.

v. Display student names who born in the year 2015.

vi. Display 4 characters starts from 3 rd character in all student names.

vii. Display sum of fees of all the students.


SET-5
5a) Write python code to create the following DataFrame emp , and write python
statements to answer the questions from (i) to (iii). 3M

(i) Add a new column called Dept with values ['Maths','Phy','Chem','Comp','Phy']


(ii) Add a new column called HRA (HRA is 10% of Salary)
(iii) Delete a column called Total.

5b) Write program in python to create a line chart with the given data and also set the name to
x-axis, y- axis and title. Also save graph name as simple.pdf. 5M
ename=[‘Hari’,’Riya’,’Chandhan’,’Joe’,’Mita’]
sal=[4000,6000,5000,3500,8000]

5c) Consider the following table and write SQL commands for all the questions 7M
Table Name: STUDENT
ROLLNO NAME DOB CITY STREAM FEE
1 Srinath 2015-11-05 Bangalore Science 2344.75
2 Supriya 2016-09-25 Nagpur Humanities 5454.50
3 Chandhan 2018-12-18 Delhi NCR Arts 1234.56
4 Giri 2012-12-12 Hyderabad Science 8746.89
5 Kaveri 2015-02-18 Chennai Science 8746.89

i. Create above table by applying primary key on Rollno column.


ii. Insert above data to the table.
iii. Display details of all the students based on stream.
iv. Display total price of all Science stream students.
v. Display student names and city who born in December month.
vi. Display last two characters in every Student name.
vii. Round Off Fees without decimal digits.
SET-6
6.a) Write python code to create the following DataFrame marks, and write python statements
to answer the question from (i) to (iii) 3M

(i)Display first two rows.


(ii) Display last two rows.
(iii) Add a new column called Total which is sum of all Tests.

6.b) Write program in python to create a bar chart that represents pass percentage of your
school from 2020 to 2024(including both the years) and also set the name to x-axis, y-axis
and title. Also save graph as simple.pdf. 5M
years=[2020,2021,2022,2023,2024]
pass=[95,94,900,95,98]
6.c) Consider the following table and write SQL commands for all the questions 7M
Table Name: STUDENT
ROLLNO NAME DOB CITY STREAM FEE
1 Srinath 2015-11-05 Bangalore Science 2344.75
2 Supriya 2016-09-25 Nagpur Humanities 5454.50
3 Chandhan 2018-12-18 Delhi NCR Arts 1234.56
4 Giri 2012-12-12 Hyderabad Science 8746.89
5 Kaveri 2015-02-18 Chennai Science 8746.89

i. Create above table by applying primary key on Rollno column.


ii. Insert above data to the table.
iii. Display the details of all the students based on city.
iv. Display the number of students in each stream.
v. Display student names and city who born in November month.
vi. Display first two characters in every Student name.
vii. Delete the details of all the students who belongs to city Nagpur.

You might also like