0% found this document useful (0 votes)
114 views10 pages

Behenchod

Tudisbdhx

Uploaded by

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

Behenchod

Tudisbdhx

Uploaded by

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

INFORMATICS PRACTICES (065)

GRADE : XII Max Marks: 70


Time : 3 Hours

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.

Q No. Section-A (21 x 1 = 21 Marks) Marks


1 Which of the following is not a category of MySQL functions?
1
a) Text Functions
b) Mathematical Functions
c) Statistical Group Functions
d) Memory Handling Functions
2 To display Third Element of a Series object S, you will write :

a) S[:3] b) S[2] c)S[3] d) S[:2]


1

3 Which of the following is a 2-dimensional array containing a sequence of values in


Python?

(a)Relation (b)DataFrame (c)Series (d) Square


1

4 Which function extracts the year value from a date in MySql.

(a) CURRENT( ) (b) DAY-YEAR( ) (c) YEAR( ) (d) MONTH( ) 1


5 Which of the following SQL function does NOT belong to the Math function category?
1
a) POWER() (b)ROUND() (c)LENGTH() (d)MOD()

6 For which of the command the output will be 69.77 ?


(a) Select round(69.7654,3) (b) Select truncate(69.7654,3) 1
(c) Select round(69.7654,2) (d)Select truncate(69.7654,2)

7 Which of the following is not the attribute of DataFrame? 1


(a)empty (b)size (c)type (d)columns

8 ----------------- clause is used with SELECT statement to display data in a sorted form
with respect to a specified column

(a) WHERE (b)ORDER BY (c) HAVING (d) DISTINCT


1

9 ---------- function of the pyplot module is used to create a graph/figure/chart.


(a)show() (b)ploting (c) plot (d)plots
1
10 Find the output for the below sql statement: Select substr(“BoardExam@2021”, 4, 7);
(A) ardExam (B) dExam@2 (C) rdExam (D) rdExam@2 1

11 To open a file c:\scores.csv for reading, we use _ command.

(A) infile = open(“c:\scores.csv”, “r”)

(B) infile = open(“c:\\scores.csv”, “r”) 1


(C) infile = open(file = “c:\scores.csv”, “r”)
(D) infile = open(file = “c:\\scores.csv”, “r”)

12 Given a Pandas series called p_series, the command which will display the last 4 rows is 1

(a)print (p_series.Tail(4)) (b) print (p_series.Tails(4))


(c) print (p_series.tail(4)) (d) print (p_series.Tails(4))

13 Which of the following function is the correct syntax of LCASE() function?


(a) LCASE(row_name) (b) LCE(column_name)
1
(c) LCASE(str/column_name) (d) None of the above
14 A Database Administrator needs to display the average pay of workers from each
departments with more than five employees. Which SQL query is correct for this task?

(a) SELECT DEPT, AVG(SAL) FROM EMP WHERE COUNT(*) > 5 1


GROUP BYDEPT;

(b) SELECT DEPT, AVG(SAL) FROM EMP GROUP BY DEPT WHERE


COUNT(*) >5;

(c) SELECT DEPT, AVG(SAL) FROM EMP HAVING COUNT(*) > 5


GROUP By DEPT;

(d) SELECT DEPT,AVG(SAL) FROM EMP GROUP BY DEPT HAVING


COUNT(*) > 5 ;
15 Predict the output of following query: Select mod(12,3);
(a) 2 b) 4 (c) 0 (d) The query will produce error 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()

17 What does CSV stand for in the context of data storage?


a) Column Separated Value (b)Class Separated Value
c) Comma Separated Value (d) Comma Segregated Value
1

18 In a table SHOP, column “Margin” contains the dataset


(2.00,2.00,NULL,4.00,NULL,3.00,3.00).

What will be the output after the execution of the query given below?
SELECT AVG(Margin) FROM SHOP; 1

(a) 2.9 (b) 2.8 (c)2.00 d) None of these


19 Which type of values will not be considered by SQL while executing the following
statement? 1
SELECT COUNT(column name) FROM STOCK;

(a)Null value (b)Text value (c)Numeric value (d)Date value


Q-20 and Q-21 are Assertion (A) and Reason (R) Type questions. Choose the correct
option as:

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

20 Assertion( A): drop() function removes data from a Dataframe temporarily. 1


Reasoning(R): Axis parameter is not compulsory with drop() function.

21 Assertion (A): import matplotlib.pyplot as plt is used to import pyplot module.

Reasoning (R): Matplotlib is a Python library and pyplot is a module that contains
1
functions to create various plots.

Q No. Section-B (7 x 2 = 14 Marks) Marks

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?

23 What will be the output of the following code:


import pandas as pd 2
nums=pd.Series([9,8,7,6,5],index=range(0,10,2))
print(nums.iloc[1:3])

24 Consider the given SQL string:


“Informatics Practices Exam”
Write suitable SQL queries for the following: 2
(i).Returns the position of the first occurrence of the substring “mat” in the given string.
(ii). To extract last six characters from the string

25 (A) What is the purpose of color attribute of plot() function ?


OR
(B) 2
What is the purpose of legend in a graph/chart ?
26 Predict the output of python code based on series
2
import pandas as pd

temp = pd.Series([28, 32, 29, 35, 30, 31, 33])

ft = temp[temp > 30]

print(ft)

27 Answer the following questions based on the code given below : - 2


… ................................ #Statment 1
Ld=[{'a':10,'b':20},{'a':5,'b':10,'c':20}]
df=pd.DataFrame(Ld)
print(df)

(a) Write the statement 1 in the above code.


(b) How many columns will be there in the dataframe.

What is aggregate functions in MySql ? write examples ? 2


28

Q No. Section-C (4 x 3 = 12 Marks) Marks

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

Write SQL queries to perform the following operations.


(i) Display Agent name and bonus after rounding off to zero decimal places.
(ii) Display the month name of the date of join (DOJ) of all the agents who have
nobonus.
(iii) Display the minimum salary of all the agents.
OR
What is the purpose of GROUP BY clause in MySQL? How is it different from ORDER
BY clause?

30 Consider the given DataFrame ‘Items’:


Name Price Quantity
0 CPU 7750 15
1 Watch 475 50
2 Key Board 225 25 3
3 Mouse 150 20
Write suitable Python statements for the following:
i) Add a column called Sale_Price which is 10% decreased value of Price
ii) Add a new item named “Printer” having price 8000 and Quantity as 10
31 Create a DataFrame in Python from the given list:

[[‘Kavya’,250],[‘Ananya’,150],[‘Malini’,185],[‘Raja’,320]]

Also give appropriate column headings as shown below:


3
Name Wages
0 Kavya 250
1 Ananya 150
2 Malini 185
3 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

Q No. Section-D (2 x 4 = 8 Marks) Marks

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

year month Passenger


0 2010 Jan 25
1 2010 Mar 50
2 2012 Jan 35
3 2010 Dec 55
4 2012 Dec 65
Code to create the above data frame:

import pandas as ___________ #Statement 1


data={"Year":[2010,2010,2012,2010,2012],"Month":["Jan","Mar","Jan","Dec",
"Dec"],"Passengers":[25,50,35,55,65]}
df=pd ____________________ (data) #Statement 2
print(df)

i) Choose the right code from the following for statement 1.


(a) pd (b) df (c)data (d)p

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

Choose the correct option:


1. Both Query i) and iv) will display the desired data.
2. Both Query i) and ii) will display the desired data.
3. Both Query iii) and iv) will display the desired data.
4. Both Query ii) and iii) will display the desired data.

(b)The Primary Key for StuLibrary Table is/are …….

i.BookID ii.BookID,StuID iii.BookID,Issued_date iv.Issued_date

(c )Which of the following SQL Query will fetch ID of those issued books which have
not been returned?

i. SELECT BookID from StuLibrary where BookID is NULL


ii. SELECT BookID from StuLibrary where StuID is NULL;
iii. SELECT BookID from StuLibrary where Issued_date is NULL;
iv. SELECT BookID from StuLibrary where Return_date is NULL;

(d)The Alternate Key for Student Table will be ……….


a.StuName b.StuContact c.StuAadhar d. StuClass

Q.No Section-D (3 x 5 = 15 Marks) Marks


Write suitable SQL query for the following:
35
(a) Display 7 characters extracted from 7th left character onwards from the string
‘INDIA SHINING’.
5
(b) Display the position of occurrence of string ‘COME’ in the string ‘WELCOME
WORLD’.

(c) Round off the value 78.779 to 2nd decimal place.

(c) Display the remainder of 149 divided by 6.

(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.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy