Professional Documents
Culture Documents
Informatics Practices Kolkata Code-065 Set 3 QP
Informatics Practices Kolkata Code-065 Set 3 QP
General Instructions:
1. This question paper contains two parts A and B. Each part is compulsory.
2. Both Part A and Part B have choices.
3. Part-A has 2 sections:
a. Section – I is short answer questions, to be answered in one word or one line.
b. Section – II has two case studies questions. Each case study has 4 case-based subparts. An
examinee is to attempt any 4 out of the 5 subparts.
4. Part - B is Descriptive Paper.
5. Part- B has three sections
a. Section-I is short answer questions of 2 marks each in which two questions have internal
options.
b. Section-II is long answer questions of 3 marks each in which two questions have internal
options.
c. Section-III is very long answer questions of 5 marks each in which one question has question
has internal option
Part - A
Section - I Attempt any 15 questions from questions 1 to 2 Mark
s
1 By default df.head() will display __________rows from the top. 1
2 To change the index of a Data Series we need to use ______ function. 1
3 Output of following program ___________________. 1
import numpy as np
d=np.array([10,20,30,40,50,60,70])
print(d[-5:])
4 Given a Pandas series called Sequences, the command which will display the first 4 rows is 1
__________________.
a. print(Sequences.head(4))
b. print(Sequences.Head(4))
c. print(Sequences.heads(4)
d. print(Sequences.Heads(4))
5 Result of ---- select power(2,3) is __________. 1
6 In a DataFrame axis=1 represents ________ 1
a. Columns b. Rows
7 For the following dataframe df, what will be the output of--- df.loc[2,'Age] 1
a. Write command to compute rename the indexes as code of the countries USA,
SPA, ITA, UK, FR, GER.
b. Add a column capital =['Washington', 'Madrid', 'Rome', 'Londan', 'Paris', 'Berlin']
c. Write command to compute median of the deaths Column.
d. Write command to print first three rows.
e. Write command to drop column Region
25 Write a code to plot a bar chart to depict the pass percentage of students in CBSE exams 2
for the years 2015 to 2018 as shown below—
OR
26 Consider the decimal number x with value 459.2654. Write commands in SQL to: 2
(i) round it off to a whole number
(ii) round it to 2 places before the decimal.
27 Shewani has recently started working in MySQL. Help her in understanding the difference 2
between the following :
(i) Where and having clause
(ii) Count(column_name) and count
28 Consider the following SQL string: “Preoccupied” 2
Write commands to display:
(i) “occupied”
(ii) “cup”
OR
(i) SELECT COUNT(*), City FROM STUDENT GROUP BY CITY HAVING COUNT(*)>1;
(ii) SELECT MAX(DOB),MIN(DOB) FROM STUDENT;
(iii) SELECT NAME,GENDER FROM STUDENT WHERE CITY=”Delhi”;
36 Consider the following dataframe, and answer the questions given below: 3
import pandas as pd
df = pd.DataFrame({“Quarter1":[2000, 4000, 5000, 4400, 10000], "Quarter2":[5800, 2500,
5400, 3000, 2900], "Quarter3":[20000, 16000, 7000, 3600, 8200], "Quarter4":[1400, 3700,
1700, 2000, 6000]})
(i) Write the code to find mean value from above dataframe df over the index and
column axis.
(ii) Use sum() function to find the sum of all the values over the index axis.
(iii) Find the median of the dataframe df
OR
Find the output of the following code:
import pandas as pd
data = [{'a': 10, 'b': 20},{'a': 6, 'b': 32, 'c': 22}]
#with two column indices, values same as dictionary keys
df1 = pd.DataFrame(data, index=['first', 'second'], columns=['a', 'b'])
#With two column indices with one index with other name
df2 = pd.DataFrame(data, index=['first', 'second'], columns=['a', 'b1'])
print(df1)
print(df2)
37 Write code to draw a histogram over the list of marks given to 20 students in a class out of 3
20. marks=[12,8,14,16,12,13,15,7,6,17,14,12,18,20,15,18,14,16,13]. Use label no of
students and marks.
Section –III
38 Write code to create the following dataframe having marks in 5 subjects for 3 students 5
using dictionary—
39 MyPace University is setting up its academic blocks at Naya Raipur and is planning to set up 5
a network. The University has 3 academic blocks and one Human Resource Center as
shown in the diagram below:
OR
Write SQL commands for the queries (i) to (iii) and output for (iv) & (v) based
on a table COMPANY and CUSTOMER .
COMPANY
CID NAME CITY PRODUCTNAME
111 SONY DELHI TV
222 NOKIA MUMBAI MOBILE
333 ONIDA DELHI TV
444 SONY MUMBAI MOBILE
555 BLACKBERRY MADRAS MOBILE
666 DELL DELHI LAPTOP
CUSTOMER
CUSTID NAME PRICE QTY CID
101 Rohan Sharma 70000 20 222
102 Deepak Kumar 50000 10 666
103 Mohan Kumar 30000 5 111
104 SahilBansal 35000 3 333
105 NehaSoni 25000 7 444
106 SonalAggarwal 20000 5 333
107 Arjun Singh 50000 15 666
a. To display those company name which are having price less than 30000.
b. To display the name of the companies in reverse alphabetical order.
c. To increase the price by 1000 for those customer whose name starts with ‘S’
d. SELECT PRODUCTNAME,CITY, PRICE FROM COMPANY,CUSTOMER
WHERE COMPANY.CID=CUSTOMER.CID AND PRODUCTNAME=”MOBILE”;
e. SELECT AVG(QTY) FROM CUSTOMER WHERE NAME LIKE “%r%;