Behenchod
Behenchod
General Instructions:
● Please check this question paper contains 37 questions.
● All questions are compulsory. However, internal choices have been provided in
some questions. Attempt only one of the choices in such questions
● The paper is divided into 5 Sections- A, B, C, D and E.
● Section A consists of 21 questions (1 to 21). Each question carries 1 Mark.
● Section B consists of 7 questions (22 to 28). Each question carries 2 Marks.
● Section C consists of 4 questions (29 to 32). Each question carries 3 Marks.
● Section D consists of 2 case study type questions (33 to 34). Each question
carries 4 Marks.
● Section E consists of 3 questions (35 to 37). Each question carries 5 Marks.
● All programming questions are to be answered using Python Language only.
● In case of MCQ, text of the correct answer should also be written.
8 ----------------- clause is used with SELECT statement to display data in a sorted form
with respect to a specified column
12 Given a Pandas series called p_series, the command which will display the last 4 rows is 1
16 Imagine you work as a data analyst for a retail company. The company provides you
with a large dataset of sales transactions in a CSV file. Your task is to import this data
and perform various data manipulation and analysis operations. Which Pandas method
should you use to read this CSV file and load it into a DataFrame for your analysis?
1
a) Read_CSV() b) import_data()
c) load_csv() d) read_csv()
What will be the output after the execution of the query given below?
SELECT AVG(Margin) FROM SHOP; 1
1
(A) Both Assertion (A) and Reason (R) are true, and Reason (R) is the correct
explanation of Assertion (A)
(B) Both Assertion (A) and Reason (R) are true, but Reason (R) is not the correct
explanation of Assertion (A)
(C) Assertion (A) is True, but Reason (R) is False
(D) Assertion (A) is False, but Reason (R) is True
Reasoning (R): Matplotlib is a Python library and pyplot is a module that contains
1
functions to create various plots.
22 (A) What is a Series in Python Pandas? Also, give a suitable example to support your
answer.
OR
What is NULL ? How it is different from Zero ? How are NULL values treated
(B) 2
by aggregate functions?
print(ft)
29
Consider a table “AGENT” with the following data:Table : AGENT
3
SNO ANAME SALARY BONUS DOJ
A01 Beena Mehta 30000 45.23 29-10-2019
A02 K.L. Sahay 50000 25.34 13-03-2018
B03 Nisha Thakkar 30000 35.00 18-03-2017
B04 Leela Yadav 80000 NULL 31-12-2018
C05 Gautam Gola 20000 NULL 23-01-1989
[[‘Kavya’,250],[‘Ananya’,150],[‘Malini’,185],[‘Raja’,320]]
32
Based on table Employee given above, write suitable SQL queries for the following:
i. Display gender wise average salary. 3
ii. Display designation wise maximum salary.
iii. Dislay total number of employees in each Dep
33 Mr. Ankit is working in an organization as data analyst. He uses Python Pandas and
Matplotlib for the same. He got a dataset of the passengers for the year 2010 to 2012 for
January, March and December. His manager wants certain information from him, but he
is facing some problems. Help him by answering few questions given below: 4
ii) Choose the right code from the following for the statement 2.
a) Dataframe b) DataFrame c) Series d) Dictionary
iii) Choose the correct statement/ method for the required output: (5,3)
(a) df.index (b) df.shape() (c) df.shape (d) df.size
iv) He wants to print the details of "January" month along with the number of
passengers, Identify the correct statement:
MONTH PASSENGERS
0 Jan 25
2 Jan 35
(a) df.loc[['Month','Passengers']][df['Month']=='Jan']
(b) df[['Month','Passengers']][df['Month']=='Jan']
(c) df.iloc[['Month','Passengers']][df['Month']=='Jan']
(d) df(['Month','Passengers']][df['Month']=='Jan')
34
A School in Delhi uses database management system to store student details. The school
maintains a
database 'school_record' under which there are two tables.
4
Student Table : Maintains general details about every student enrolled in school.
StuLibrary Table : To store details of issued books. BookID is the unique identification
number issued to
each book. Minimum issue duration of a book is one Day.
Student StuLibrary
Field Type
Field Type
StuID Numeric
StuAddress Varchar(20) BookId numeric
StuFatherName Varchar(20) StuID numeric
StuContact numeric Issued_date Date
StuAadhar numeric
StuClass Varchar(5) Return_date Date
StuSection Varchar(1)
(a)Identify the SQL Query which displays the data of StuLibrary table in ascending order
of Student ID.
i) Select * from StuLibrary Order By BookID
ii) Select * from StuLibrary Order By StuID
iii) Select * from StuLibrary Order By StuID ASC
iv) Select * from StuLibrary Order By StuID DESC
(c )Which of the following SQL Query will fetch ID of those issued books which have
not been returned?
(d) Remove all the expected leading and trailing spaces from a column userid of the
table ‘USERS’ and convert to lowercase.
OR
Explain the following SQL functions using suitable examples.
(a) LENGTH()
(b) NOW()
(c )DAYNAME()
(d) POWER()
(e) RTRIM()
36. 5
Write a python program to plot a line chart based on the given data to depict the pass
percentage of students in CBSE exams for the years 2015 to 2018 as shown below.
Year=[2015,2016,2017,2018]
Pass_Percentage=[82,83,85,90]
37 Given the following Series1
5
A 100
B 200
C 300
D 400
E 500
Write the command to create above Series and then double the value in series and store in
another series named Series2.