0% found this document useful (0 votes)
13 views5 pages

XII_IP

The document is a question paper for the Half Yearly Examination in Informatics Practice for Class XII, covering various topics such as Python programming, SQL queries, and data analysis. It consists of five sections with a total of 70 marks, including multiple choice questions, short answer questions, and programming tasks. The exam tests students' understanding of data structures, database management, and programming concepts.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views5 pages

XII_IP

The document is a question paper for the Half Yearly Examination in Informatics Practice for Class XII, covering various topics such as Python programming, SQL queries, and data analysis. It consists of five sections with a total of 70 marks, including multiple choice questions, short answer questions, and programming tasks. The exam tests students' understanding of data structures, database management, and programming concepts.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

HALF YEARLY EXAMINATION (2024-25)

SUBJECT- INFORMATICS PRACTICE (065)


CLASS-XII
Time Allowed: 3 hours Maximum Marks: 70
General Instructions:
1. This question paper contains five sections, Section A to E.
2. All questions are compulsory.
3. Section A has 18 questions carrying 01 mark each.
4. Section B has 07 Very Short Answer type questions carrying 02 marks each.
5. Section C has 05 Short Answer type questions carrying 03 marks each.
6. Section D has 02 questions carrying 04 marks each.
7. Section E has 03 questions carrying 05 marks each.
8. All programming questions are to be answered using Python Language only.
Section – A
1. Which attribute is not used with dataframe?
i. Size iii. Empty
ii. Type iv. Columns
2. To get the number of dimensions of a series object. _____ attribute is displayed
i. Index iii. Itemsize
ii. Size iv. ndim
3. series1 = pd.Series ({'India' : 'New Delhi', 'UK' : 'London', 'Japan' : 'Tokyo'})
print(series1)
Above code is an example of
(a) creating series from dictionary (c) creating series from an array
(b) creating series from scalar values (d) creating series from tuple
4. Which SQL statement do we use to find out the total number of records present in the table ORDERS?

i. SELECT * FROM ORDERS;


ii. SELECT COUNT (*) FROM ORDERS;
iii. SELECT FIND (*) FROM ORDERS;
iv. SELECT SUM () FROM ORDERS;
5. Identify single-row functions of MySQL amongst the following
(a) TRIM() (c) ROUND()
(b) MAX() (d) Both (a) and (c)
6. Which of the following function is used to create DataFrame?
(a) DataFrame () (c) CreateDataFrame()
(b) NewFrame () (d) None of these
7. Which of the following is a DDL command?
i. SELECT iii. INSERT
ii. ALTER iv. UPDATE
8. Method or function to add a new row in a DataFrame is
(a) .loc() (c) join()
(b) .iloc() (d) add()
9. To display last five rows of a series object ‘S’, you may write:
i. S.Head() iii. S.Head(5)
ii. S.Tail(5) iv. S.tail()
10. Write the output of the following SQL command.
SELECT ROUND(47.89):
(a) 47.88 (c) 48.0
(b) 47.8 (d) 50
11. Which of the following can be used to specify the data while creating a DataFrame?
i. Series iii. Structured ndarray
ii. List of Dictionaries iv. All of these

12. Which function returns the length of the string in bytes?


(a) LENGTH ( ) (c) TIME ()
(b) DATE () (d) MATH ()
13. A software which is available for free and the code is open for all, it is called as
(a) Proprietary software (c) Free software
(b) Free and open source software (d) None of these
14. Consider a table DOCTOR(ID, DocName,Department, DOJ,Gender, Salary). Which of the following
query will display the names and salaries of doctors in descending order of salaries.
(a) SELECT DocName, Salary FROM (c) Salary FROM DOCTOR ORDER BY
DOCTOR ORDER BY Salary DESC; Salary ASC;
(b) Salary FROM DOCTOR WHERE (d) Salary FROM DOCTOR WHERE
ORDER BY Salary ASC; ORDER BY Salary DESC;
15. Which SQL clause is used to restrict the rows returned by a query?
(a) SELECT (c) WHERE
(b) ORDER BY (d) GROUP BY
16. Which of the following is not a Mathematical function?
(a) LENGTH() (c) MOD()
(b) POWER() (d) ROUND()
Directions (Q.No. 17-18) Assertion and Reason based Questions.
17. Assertion (A) A router is a network device that connects multiple networks together.
Reason (R) Routers operate at the network layer (Layer 3) of the OSI model and can forward data
packets based
on their IP addresses.
(a) Both A and R are true and R is the correct explanation of A.
(b) Both A and R are true and R is not the correct explanation of A.
(c) A is true but R is false.
(d) A is false but R is true.
18. Assertion (A) A Series is a one-dimensional array containing a sequence of values of any data type (int,
float, list, string, etc).
Reason (R) Pandas Series can be imagined as a column in a spreadsheet.
(a) Both A and R are true and R is the correct explanation of A.
(b) Both A and R are true but R is not the correct explanation of A.
(c) A is true but R is false.
(d) A is false but R is true.
Section – B
19. A list stores three dictionaries each storing details, (old price, new price, change). Write a program to
create a data frame from it.
20. Aditi is a travel agent, she has stored the data of all passengers in a table Travel(Pno, Pname,Tdate,
Km, Coach). She has given the following command to count the number of passengers in each coach
from Travel table.
SELECT PName, COUNT(Coach) FROM Travel ORDER BY Coach;
But she is not getting the desired result. Help her for identifying the reason of the error and write
the correct query by suggesting the possible correction(s).
21. State differences between date functions NOW() and CURDATE() of MySQL.
22. The Python code written below has syntactical errors. Rewrite the correct code and underline the
corrections made.
import Pandas as pd
data = {'A': 1, 'B'; 2. 'C': 3}
my_series = Pd.Series(data)
print(my_series)
23. What is digital property rights? Write the names of some digital property rights.

24. Write the output of the given code.


import pandas as pd
S1=pd.Series([5, 6, 7, 8, 10], index= ['V', 'W', ‘x’, ‘y', ‘z’])
l= [2, 6, 1, 4, 6]
S2=pd.Series(l.index= ['z', 'y', 'a', 'w', ‘v'])
print(S1 - S2)
25. Complete the given Python code to given two DataFrames ‘df1’ and ‘df2’, merge them on the ‘ID’
column to get a single DataFrame ‘merged_df’.
import ____ as pd
df1 = pd.DataFrame({'ID': [1, 2, 3], 'Name': ['Riya', 'Preeti', 'Neeta’]})
df2 = pd.DataFrame({'ID': [1, 2, 4], 'Age': [25, 30, 22]})
merged_df = pd.merge(dfl, df2, on=____)
print(merged_df)
Section – C
26. Consider the given SQL string:
“12#All the Best!”
Write suitable SQL queries for the following:
i. Returns the position of the first occurrence of the substring “the” in the given string.
ii. To extract last five characters from the string.
27. Mr. Ankit is working in an organisation 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.

Year Month Passengers

0 2010 Jan 25

1 2010 Mar 50

2 2012 Jan 35

3 2010 Dec 55

4 2012 Dec 65
Help him to write the Python code to create the above Dataframe.

28. Predict the output of the given Python code:

import pandas as pd
list1=[-10,-20,-30]
ser = pd.Series(list1*2)
print(ser)

29. Write MySQL statements for the following:


i. To create a database named FOOD.
ii. To create a table named Nutrients based on the following specification:
Column Name Data Type Constraints
Food_Item Varchar(20) Primary Key
Calorie Integer

Or

Explain the features of IT Act 2000.

30. Based on the SQL table CAR_SALES, write suitable queries for the following:
+ + + + + +
| NUMBER | SEGMENT | FUEL | QT1 | QT2 |
+ + + + + +
| 1 | Compact HatchBack | Petrol | 56000 | 70000 |
| 2 | Compact HatchBack | Diesel | 34000 | 40000 |
| 3 | MUV | Petrol | 33000 | 35000 |
| 4 | MUV | Diesel | 14000 | 15000 |
| 5 | SUV | Petrol | 27000 | 54000 |
| 6 | SUV | Diesel | 18000 | 30000 |
| 7 | Sedan | Petrol | 8000 | 10000 |
| 8 | Sedan | Diesel | 1000 | 5000 |
+ + + + + +
i. Display fuel wise average sales in the first quarter.
ii. Display segment wise highest sales in the second quarter.
iii. Display the records in the descending order of sales in the second quarter.
Or
Differentiate between COUNT () and COUNT (DISTINCT) functions. Explain with the help of example.
Section – D
31. Preeti manages database in a blockchain start-up. For business purposes, she created a table
named BLOCKCHAIN. Assist her by writing the following queries:
TABLE: BLOCKCHAIN

i. Write a query to display the year of oldest transaction.


ii. Write a query to display the month of most recent transaction.
iii. Write a query to display all the transactions done in the month of May.
iv. Write a query to count total number of transactions in the year 2022.

32. Naman has created the following DataFrame “Climate” to record the data about climatic conditions of
four years:
Year MaxTemp MinTemp Rainfall

2017 32 20 123

2018 33 22 140

2019 35 21 135

2020 34 23 160
(a) What will be the output of the following?
(i) Climate.iloc[1:3, 1:2]
(ii) print (Cimate.head(2))

(b) Write the Python code to display the temperature difference between MaxTemp and MinTemp for all
the rows in the DataFrame Climate.
(c) List 1st, 2nd and 3rd rows.
Or (Option for part (c) only)
The exact number of values in each column of the DataFrame?

Section – E
33. Write the output of following queries.
(i) SELECT POWER(9, 3);
(ii) SELECT MID(‘SHUCHI GOYAL’, 8, 5):
(iii) SELECT RIGHT(‘ Dushyant ’, 5);
(iv) SELECT INSTR(‘SQL FUNCTIONS’, ‘C’);
(v) SELECT LEFT(‘Arihant’,2);
34. WAP to take the marks of six subjects and display the total, percentage and also the display the
Grade according to the following condition.
Percentage Grade
>=90 A
<90 and >=75 B
<75 and >=50 C
<50 D
35. Write a program in python to check that given number is Armstrong number or not.
Note: 153=13+53+33 It is an arm strong number.

You might also like