0% found this document useful (0 votes)
28 views3 pages

HEALTHCARE

This document outlines the mid-term examination for Informatics Practices for class XII at Brightland School, Ghaziabad, covering various topics such as Pandas, SQL, and data visualization. It includes multiple-choice questions, very short answer questions, short answer questions, and long answer questions, totaling 50 marks. The exam assesses students' understanding of data manipulation, analysis, and visualization using Python and SQL.

Uploaded by

nirdosh
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)
28 views3 pages

HEALTHCARE

This document outlines the mid-term examination for Informatics Practices for class XII at Brightland School, Ghaziabad, covering various topics such as Pandas, SQL, and data visualization. It includes multiple-choice questions, very short answer questions, short answer questions, and long answer questions, totaling 50 marks. The exam assesses students' understanding of data manipulation, analysis, and visualization using Python and SQL.

Uploaded by

nirdosh
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/ 3

BRIGHTLAND SCHOOL, GHAZIABAD

MID-TERM (2025-26)
SUBJECT: INFORMATICS PRAC. (065)
CLASS: XII
Time Allowed: 2 hr. Maximum Marks-
50

Section A: Multiple Choice Questions (MCQ) - 1 Mark Each (Total: 8 Marks)


1. Consider a Pandas Series S = pd.Series([10, 20, 30, 40], index=['A', 'B', 'C', 'D']). What would be the output of
S[S > 25]?
a) C 30, D 40
b) C 30, D 40 (with index labels)
c) 30, 40
d) An error, as boolean indexing requires numerical index.
2. You are given a DataFrame df with columns 'Name', 'Physics', 'Chemistry'. If you execute df.drop('Chemistry',
axis=1, inplace=True), what will be the state of df after this operation?
a) A new DataFrame will be returned without 'Chemistry'.
b) The 'Chemistry' column will be permanently removed from df.
c) An error will occur as inplace=True is not allowed for column deletion.
d) The 'Chemistry' column will be temporarily removed, but can be restored.
3. Which of the following SQL queries would correctly identify and return the employee names whose date of
joining falls in the current year, assuming DOJ is a DATE type column?
a) SELECT EmpName FROM Employee WHERE YEAR(DOJ) = YEAR(NOW());
b) SELECT EmpName FROM Employee WHERE DOJ LIKE '%2024%';
c) SELECT EmpName FROM Employee WHERE DATE_FORMAT(DOJ, '%Y') = YEAR(CURDATE());
d) SELECT EmpName FROM Employee WHERE YEAR(DOJ) = GETDATE();
4. A histogram is chosen over a bar graph when:
a) Comparing discrete categories.
b) Showing changes over time for specific data points.
c) Visualizing the distribution of a continuous variable.
d) Displaying proportions of a whole.
5. If a Pandas DataFrame df is created from a dictionary of Series, what must be true about the indices of the Series
used?
a) They must all be identical.
b) They must all be unique.
c) They can be different, but missing values will appear as NaN.
d) They must be numerical.
Directions: In the following questions, a statement of Assertion (A) is followed by a statement of Reason (R).
Choose the correct option.
a)1 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.
6. Assertion (A): Iterating directly over a Pandas DataFrame using a for loop (e.g., for col in df:) provides column
labels.
Reason (R): DataFrames are fundamentally column-oriented structures, and direct iteration is optimized for
column access.
7. Assertion (A): The LENGTH() function in SQL can be used to find the number of characters in a string,
including leading/trailing spaces.
Reason (R): TRIM() function should be used before LENGTH() if leading/trailing spaces are to be ignored for
an accurate character count.
pg. 1
BLS/SW/EDU/2025-26/MIDTERM/INFORMATICS PRAC.
8. Match the following scenarios with the most appropriate SQL function to achieve the desired result:
| Column A (Scenario) | Column B (Best SQL Function) |
| :--------------------------------------------------------------- | :--------------------------- |
i) Extracting the initial 'XYZ' from XYZ Corp p) MONTHNAME() |
ii) Finding the position of the first occurrence of 'a' in 'banana' q) INSTR() |
iii) Converting 'Hello World' to 'hello world'| r) LEFT() |
iv) Displaying 'February' for a date 2024-02-15 s) LCASE() |
|v) Calculating the number of years since '2020-01-01' up to today's date t) YEAR() |
a) i-r, ii-q, iii-s, iv-p, v-t
b) i-r, ii-p, iii-s, iv-q, v-t
c) i-s, ii-q, iii-r, iv-p, v-t
d) i-r, ii-q, iii-p, iv-s, v-t
Section B: Very Short Answer Questions - 2 Marks Each (Total: 8 Marks)
9. You have a Series S = pd.Series([10, 20, 30, 40, 50]). Explain the difference in output between S.head(2) and
S.tail(2).
10. A CSV file contains student data. If a column named 'Marks' has some missing entries, how would Pandas
represent these missing values when the CSV is loaded into a DataFrame? What is a common method to handle
such missing values for mathematical operations?
11. Why is it generally recommended to import Pandas as pd and Matplotlib's pyplot as plt? Explain the benefit of
using such aliases.
12. Sneha is writing a Python program to create a DataFrame using a list of dictionaries. However, her code
contains some mistakes. Identify the errors, rewrite the correct code, and underline the corrections made.
import Pandas as pd
D1 = {'Name': 'Rakshit', 'Age': 25}
D2 = {'Name': 'Paul', 'Age': 30}
D3 = {'Name': 'Ayesha", 'Age': 28}
data = [D1,D2,D3)
df = pd.Dataframe(data)
print(df)
Section C: Short Answer Questions - 3 Marks Each (Total: 12 Marks)
13. You need to create a Pandas DataFrame df_products to store product IDs, names, and prices. The data for IDs is
[101, 102, 103], names are ['Laptop', 'Mouse', 'Keyboard'], and prices are [50000, 800, 2500]. Write Python code
to create this DataFrame using a suitable dictionary of Series.
14. Given a DataFrame df_sales with columns 'Product', 'Quantity', 'Price'. Write a SQL query to calculate the
Total_Revenue for each product (Quantity * Price) and display only products where Total_Revenue is greater
than 10000.
15. A Pandas Series temperature_data stores daily temperatures. Explain how you would perform element-wise
subtraction to convert these temperatures from Celsius to Fahrenheit (formula: F = C * 1.8 + 32) and update the
Series in-place.
16. Write a Python program to create the following DataFrame using a list of dictionaries.
Product Price
0 Laptop 60000
1 Desktop 45000
2 Monitor 15000
3 Tablet 30000
Section D: Short Answer Questions - 4 Marks Each (Total: 12 Marks)
17. You have a DataFrame df_employees with columns 'EmpID', 'Name', 'Department', 'Salary'. Write Python code
to: a) Rename the column 'Name' to 'Employee_Name'. b) Select and display only the 'Employee_Name' and
'Salary' for employees belonging to the 'IT' department.

pg. 2
BLS/SW/EDU/2025-26/MIDTERM/INFORMATICS PRAC.
18. Explain the purpose of a histogram and when it is preferred over a simple bar graph. Describe how you would
create a histogram for 'Marks' from a Pandas Series student_marks using Matplotlib, including a suitable title
and x-axis label.
19. Consider the DataFrame df shown below.
MovieID Title Year Rating
01 LAGAAN 2001 8.4
12 TAARE ZAMEEN PAR 2007 8.5
23 3 IDIOTS 2009 8.4
34 DANGAL 2016 8.4
45 ANDHADHUN 2018 8.3
Write Python statements for the DataFrame df to:
I. Print the first two rows of the DataFrame df.
II. Display titles of all the movies.
III. Remove the column rating.
IV. Display the data of the 'Title' column from indexes 2 to 4 (both included)

Section E: Long Answer Questions - 6 Marks Each (Total: 6 Marks)


20. Describe the process of importing data from a CSV file into a Pandas DataFrame and then exporting a modified
DataFrame back to a new CSV file. Illustrate with Python code, considering a scenario where you import
data.csv, add a new column 'Status' with a default value, and then save the modified DataFrame to
updated_data.csv.
OR

Discuss the concept of 'Indexing' in Pandas DataFrames. Explain the difference between label-based indexing
(.loc[]) and integer-position based indexing (.iloc[]) with clear examples for both single selection and slicing of
rows/columns.
Section F: Case Study Based Question - 4 Marks
21. A small online store MyStore uses a Pandas DataFrame df_orders to manage customer orders. The DataFrame
has columns OrderID, CustomerID, Item, Quantity, UnitPrice, OrderDate.
Consider the following snippet of df_orders:
OrderID CustomerID Item Quantity UnitPrice OrderDate
0 101 C01 Laptop 1 50000.0 2024-03-10
1 102 C02 Mouse 2 800.0 2024-03-11
2 103 C01 Keyboard 1 2500.0 2024-03-10
3 104 C03 Headphones 1 1500.0 2024-03-12
4 105 C02 Laptop 1 50000.0 2024-03-11

Based on this, answer the following questions:


a) MyStore wants to calculate the TotalAmount for each order. Write a Python command to add a new column
'TotalAmount' to df_orders where TotalAmount = Quantity * UnitPrice. (1 Mark)
b) The store manager wants to see the details of all orders placed by 'CustomerID' 'C01'. Write a Pandas
command to display these rows. (1 Mark)
c) What SQL query would you use to find the COUNT of distinct Items ordered on '2024-03-11'? (1 Mark)
d) If MyStore wants to analyze sales based on the month of the OrderDate, which SQL function would be most
appropriate to extract the month number from the OrderDate column? (1 Mark)

pg. 3
BLS/SW/EDU/2025-26/MIDTERM/INFORMATICS PRAC.

You might also like