0% found this document useful (0 votes)
17 views8 pages

D.A.V. Institutions, Chhattisgarh: Compulsory

Uploaded by

tradexakku012
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)
17 views8 pages

D.A.V. Institutions, Chhattisgarh: Compulsory

Uploaded by

tradexakku012
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/ 8

Sub.

Code: 065

Please check that this question paper


Roll No. 12)) contains 35 Questions and has 08 Printed
pages.

D.A.V. INSTITUTIONS, CHHATTISGARH


HALF YEARLY EXAMINATION-2024-25
CLASS - XII
SUBJECT: INFORMATICS PRACTICES
Time Allow ed: 3 Hours Maximum Marks: 70

General Instructions:
This question papercontains five sections, Section Ato E.
2. Allquestions are compulsory.
Section A has 18 questions carrying 0l mark each.
Section B has 07 Very Short Answer type questions carrying 02 marks each.
Section Chas 0s Short Answer type questions carrying 03 marks each.
Section Dhas 02 questions carrying 04 markS each.
Section E has 03 questions carrying 0S marks each.
All programming questions are to be answered using Python Language only.

SECTION A
1. How manv elements will be there in the series named 'S|?
SI =pd.Series(range(5))
print(Sl )
a) 5 b) 4
c)6 None of the above
2. Which method/command is used to delete row or column in a DataFrame ?

(a)delete( ) (b)del

( drop) (d) None of the given

3. Which of the following is not avalid data type of My SQ1.?


(a) varchar (ý date
(C) primary key (d) integer

4. Initially in a relation there are 4 tuples and 7 attributes. Ater adding a new revord what will be the
cardinality of that relation
e. 5
b. 8
C

d. 7
1
S. Which of the following SQI. functions is not belong to the multi row functions category?
a) l.ENGTHO b) AVG()
)SUM) d) MIN)

6. To check ifthe Series object contains NaN values. which attribute is used?
(a) hasnan (b) nbytes
(c) ndim (d) hasnans

7.CSV stands for:


a) Column Separated Value
b) Class Separated Value
ck Comma Separated Value
d) Comma Segregated Value
8. You have given a database table: staff after exccuting the given SQL
command. what output it will print.
select count(designation) from staff;
Name Age Designation
RAJIV 26 CLERK
SAMEER 35 NULL
KAPIL 45 ACCOUNTANT
ANKITA 28 NULL
PAYAL 37 MANAGER
a) 5
b) 2
c) 4
dy3
9. Predict the output of the
following query:
SELECT LEFT(UPPER('Vande Matram"), 5);
a) Atram b VANDE
C) ATRAM d) vande
10. To displav first five rows ofa Series object Sr.
which is correct statement
(a) Sr.head ) () Sr.head( 5) (c) botha & b (d) Sr.tail(3)
|1. Which SQL command is correct to display those
employee records of table Emp whose salarv is more
than 15000 but less than 40000
select * fromemp where salary is between |5000 to 40000;
þ. select * from emp where salary between 15000and 40000;
C select * from emp where salary between 15000 & 40000:
d. select * from emp where salary in between l5000 to 40000:

12. 1fa Dataframe is created using a 2D dictionary. then the indexes/row labels are formed from

(3) dictionary's values (b) inner dictionary's keys


(c) outer dictionary's keys (d) none of these
2
I3. Which of the following can be used to specify the data
while creating a datatrame?

b
Series
List of Dictionaries
d.
Structured Ndarray
Al of these
|4. In SQIL, the domain which is not vet assigned is
a. null
represented by ?
b
empty
dummy value
d. 7ero0)
IS, What is the minimun number of
a. 1
arguments required for plot) function in matplotlib?
b. 2
C. 3
d. 4

16. Consider the


following Series object named OS:
Linux
Windows
Ubuntu
Mac
5 Android
Write the command that generates the
output as:
Linux
3 Ubuntu
(a) OS[0:4] (b) OS[1:3:2] (c) OS[:4:2]
17. Assertion (A):- DataFrame has both a row and column index.
Reasoning (R): - ADatalrame is a two-dimensional labelled data
structure like a table of MySQL.
a. Both A and R are true and R is the correct explanation for A
b. Both A and R are true and R is not the correct explanation for A
C. Ais True but R is False
d A is false but R is True

18. Assertion (A): Insert, Update, Delete, Select are the DMI. commands.
Reason (R): The DMI. commands manipulate the data stored in the database tables.

a. Both A and R are true and R is the correct explanation for A


b. Both Aand R are true and R is not the correct explanation tor A
C. A is True but R is False )
d. Ais false but R is True

3
SECTION-B

19. What output the statementl and statement2 will give:

import pandas as pd
SI-pd.Series(data |35,45,5S,40|)
print( SI<45) # statement1

S2-pd.Series( |2.4.6.8]. indeN-|'c, 'd. "b, "r| )


print(S2) # statement2

OR

Sarvani,aData Analy st with a multinational brand has designed the DatalFrame df that contains the
four quarter' s sales data of different stores as shown below:
Store Qtrl Qtr2 Qtr3 Qtr4
Storel 700 300 4S0 200
Store2 9s0 400 500 300
Store3 650 800 100 400
Predict the output of the following python statement:
a.
print(df.iloc[ 1:2.1:3|)
b.
print(df.loc|1,Qtrl )
20. Consider the given SQL. string:

S=" portable transport


Write suitable SQIL. queries for the following:
i) To return the length of the given string.
ii) To return the position of the first occurrence of the
substring "po" in the given string.
21. Write aPvthon code to create aDataFrame with appropriate column
headings
from the list given below:
||101.Gurman'.,981,| 102.'Rajveer'.95],[ 103, 'Samar ,96],[104.Yuvraj'.88]|
22. Write difference between the Drop Table and Alter Table commands.

23. Consider the tollowing data frame 'emp' and answer the following
ImpName Salary
Rohit S0000
Vinay 43000
Sahil 70000
Kailash 55000
4 Dipika 35000
a) Write pvthon statement to delete first two records of dataframe.
b) Write python statement to renameSalary' column of dataframe with Wages'.

4
24. Predict the output ofthe given P'ython code: 2
import pandas as pd
Sl-pd.Series( data |10,70)
S2-pd.Series Sl+S)
print(S2)
print(S2*3)
25. What wil be the output of the 2
following code?
import pandas as pd
A-pd.Series(|23.79.53,91,20.65)
print(A.sort aluesascending False))
prnt(s.ndim)

SECTION C

26. Consider the following Table: ITEM


Table: ITEM

ID INAME PRICE QTY Stock date


PI001 Sketch Pen 20.50 5 2020-04-21
Pl002 Roller Ball Pen 55.00 2019-03-06
PI003 Gel Pen 25.10 3 2019-01-10
PI004 Notebook 75.80 2020-10-18
Pl005 Pencil NULL NULL 2021-05-25

Find the output of the following SQI. queries : 3

a) SELECT UCASE(INAME), ROUND(PRICE,0) FROM ITEM WHERE OTY >2:


b) SELECT SUM(PRICE*OTY) AS *TOTAL COST" FROM ITEM WHERE INAME
IN CRoller Ball Pen', Notebook`);
c) SELECT INAME FROM ITEM WHERE RIGIIT(UD,)=3 OR MONTIH( Stock date)=3:

OR(Option for part a, b and c)

i. SLECT MID(INAME,4.3) FROM ITEM WIERE MONTHNAME(Stockdate) IN ("March", "January":


ii. SELECTMAX(Stockdate) from ITEM where StockDate is not null;
iii. SLHCTSUM(QTY) FROM ITEM WIIERE price >50;

27. Write suitablePython code to create 'Favourite |lobby' Bar Chart based on the given data with
following specifications
X-axis label - hobbies' y-axis label number of' people'
llobbies =|Dance', "Music', "Painting', 'Games' ]|
People |300,400,1 00,500|
Alsogive suitable python statement to save this chart.
5
28. Write M\ SQl statements for the following: 3

lo display list of alltables.


i. Tocreate atable named 'donor bascd on the following specification
Column Name Data Type Constraints
donor name Varchar( 25) Primary Key
age Integer
hlood grp Varchar( 3)
29. Write output of follow ing sql commands 3

i. select truncate(7892.126.-)
i. selcct round( 390S.618,2)
sclect pow(sqrt(l00),2)
OR
You have given a Dataframe df,Write Python command to
The indexes of the Dataframe.
print:
ii. The column names of Dataframe.
The last 3 rows of the Dataframe

30. Consider the following DataFrame, Student and Write


commands to 3
Name Age Marks Place
Amit 23 88 Delhi
Binu 43 99 Mumbai
Girish 12 95 Chennai

(a) Adda new column 'percentage' to the data frame with given
values.
98, 97, 84
(b) Add a new row with values -.
*Gauri', 23, 88, 'Mumbai'
(c) Rename the column Place' with Address'.

SECTIOND
31. ldentify and write answers of the following

a)It isa type of key constraint that follows referential integrity rule.
b) It is total number of tuples in a relation.

c) This clause is used to fetch non-duplicate values from acolunnofthetable.


d) This tunction is used to display the month name of given date value.

6
that contains data about Computer Olympiad
T: Som, a data analyst hasdesioned the Data Erame df
Answer the following questions: 4
.CO2*, CO3', CO4. 'COS' as indeses shown below.

School Tot students Topper First Runnerup


COT 8
PPS 32
18
12
JPS 30
CO3 GPS 2
20 18
CO4 MPS 10
8
18
COS BPS 20 8
28

(i) Predict the output ofthe following python df.shape


statement:
")Wnte Python statement to display the data ofTopper column of indexes C02 to C4.
(iii) Display the school name(s) where Tot students > 25
(iv) Delete the column Fist
Runnerup' permanently.
OR

(Option for part iv only)


Wite Python statement to createadata frame named sports from an existing csv file Athelatics.csv'.

SECTION E

33. Write suitable SQL queries for the following:


i.
Todisplay 4 characters extracted from 3rd character onwards from the string 'HelloWorld'.
i. To obtain only vear part from current date.
iii. To display the remainder of 100 divided by 9.
iv. To remove all the leading and trailing spaces from acolumn e_id of the table 'emp'.
V To display current date and time.
OR
Ritik has created following table named: Coaching:
Teacherld Department Periods
TI01 SCIENCE 32
TI02 NULL. 20
TI03 MATHEMATICS 34

Helphim in writing SQl. queries to the perform the following task:


Insert a new record in the table having following values:
|TIOS. CS. 25]
To decrease number of' periods by 5, whose department name ends with letter S

iii. To remove the records of'those departments whose periods are less than 20.
iv. To add a new column duration of suitable datatype.
To display record of teacher with id as TI0.
34. Answer the following
) What is CSV? Name the detault delimiter character ofCSV files?
ii) What do you understand bv Boolean indexing?
ii) Out of Series and Dataframc, Which Pandas Objcct cannot grow n SI7e:

5
35. Given the following set of data ie. Weish measurements for I6 small orders of Irench-tries
Weigh(in grams) |78 72 69 81636765 75 79 74 71 8371 79 80 69|
Write suitable Pthon code to gCnerate a histogram based on the given data. along witn an
appropriate chart title and both axis labels. Also give suitable python statement to save this cnart.

OR
Consider the tollow ing graph. Write the code to plot it. Label the X and Y axis.

19

18
Marks
sccured
17

16

151

14
A 13
12
1-0 1-5 2-0 2-5 3-0 3-5 4-0 4-5 5-0
Tests
Also give suitable python statement to save this chart as pdf.

2 |

2.S.
2^
| -

You might also like