In this article, I am going to discuss the most expected questions IP class 12. Informatics Practices with subject code 065 is one of the popular subjects of the CBSE curriculum for the senior secondary school certificate exam. This subject is mostly given to commerce students.
Topics Covered
Most expected questions IP Class 12
This article mainly covers the Most expected questions in IP Class 12 for CBSE board exam. The topics which are covered in this subject are as follows:
- Unit 1 Data Handling using Pandas – I
- Introduction to Python Libraries – Pandas, Matploltib
- Data structures in Pandas – Series and Data Frames
- Series: Creation of Series from – ndarray, dictionary, scalar value; mathematical operations; Head and Tail functions; Selection, Indexing and Slicing
- Data Frames: creation – from the dictionary of Series, list of dictionaries, Text/CSV files; display; iteration; Operations on rows and columns: add, select, delete, rename; Head and Tail functions; Indexing using Labels, Boolean Indexing
- Importing/Exporting Data between CSV files and Data Frames
- Data Visualization
- Purpose of plotting; drawing and saving following types of plots using Matplotlib – line plot, bar graph, histogram
- Customizing plots: adding labels, titles, and legends in plots.
- Unit 2: Database Query using SQL
- Math functions: power(), round(), mod()
- Text Functions: UCASE ()/UPPER (), LCASE ()/LOWER (), MID ()/SUBSTRING ()/SUBSTR (), LENGTH (), LEFT (), RIGHT (), INSTR (), LTRIM (), RTRIM (), TRIM ()
- Date Functions: NOW (), DATE (), MONTH (), MONTHNAME (), YEAR (), DAY (), DAYNAME ()
- Aggregate Functions: MAX (), MIN (), AVG (), SUM (), COUNT (); using COUNT (*)
- Querying and manipulating data using Group by, Having, Order by
- Introduction to Computer networks
- Introduction to Networks, Types of network: LAN, MAN, WAN
- Network Devices: modem, hub, switch, repeater, router, gateway
- Network Topologies: Star, Bus, Tree, Mesh
- Introduction to Internet, URL, WWW and its applications- Web, email, Chat, VoIP
- Website: Introduction, the difference between a website and webpage, static vs dynamic web page, web server and hosting of a website
- Web Browsers: Introduction, commonly used browsers, browser settings, add-ons and plug-ins, cookies
Unit 1 Data handling using pandas
So let us start the article Most expected questions IP Class 12 with a Unit 1 data handling using pandas. Here we go!
Important Data handling using pandas MCQ Questions
[1] Which of the following statement will install pandas library in python?
a) Pip install pand as pd
b) pip install pandas as pd
c) pip install pandas.pd
d) pip install pandas
Ans.: d) pip install pandas
Explanation: The pip command follows this syntax:
pip install module_name
Hence here pandas is module name. So the correct option is d
[2] Given a Pandas series called HEAD, the command that will display the first 3 rows is ______.
a) print(HEAD.head(3))
b) print(HEAD.Heads(3))
c) print(HEAD.heads(3))
d) print(head.HEAD(3))
Ans.: a) print(HEAD.head(3))
Explanation: The HEAD is dataframe name and head() is function that is used to display top n rows from the dataframe. So according to this option a is correcet answer. Rest all are incorrect.
[3] We can create dataframe from:
a) Series
b) Numpy arrays
c) List of Dictionaries
d) All of the above
Ans. d) All of these
Explanation: you can create a daraframe using any sequence or collection in python. All the given options are collections of python.
[4] To create an empty Series object, you can use:
a) pd.Series(empty)
b) pd.Series( )
c) pd.Series(np.NaN)
d) pd.Series(None)
Ans.: b) pd.Series()
Explanation: While creating an empty series in python, Series() function without any parameter is used.
[5] Assertion (A):- While creating a dataframe with a nested or 2D dictionary, Python interprets the outer dict keys as the columns and the inner keys as the row indices.
Reasoning (R):- A column can be deleted using the remove command.
Ans.: c) A is true but R is False
Explanation: To delete a column drop() or del can be used.
[6] Assertion (A): DataFrame has both a row and column index.
Reasoning (R): .loc() is a label-based data selecting method to select a specific row(s) or column(s) that we want to select.
Ans.: a) Both A abd R are True and R is correct explanation of A
[7] Assertion (A) : Pandas is an open-source Python library that offers high-performance, easy-to-use data structures and data analysis tools.
Reason (R) : Professionals and developers are using the pandas library in data science and machine learning.
Ans.: a) Both A and R are True and R is correct explanation of A
[8] Assertion (A): – When DataFrame is created by using Dictionary, keys of dictionary are set as columns of DataFrame.
Reasoning (R):- Boolean Indexing helps us to select the data from the DataFrames using a boolean vector.
Ans.: b) Both A and R are true but R is not correct explanation of A
[9] To display First 15 rows of a series object ‘Ser1’, you may write:
a) Ser1.tail(15)
b) Ser1.head()
c) Ser1.head(15)
d) Ser1.tail()
Ans.: c) Ser1.head(15)
[10] Given a Pandas series called p_series, the command which will display the last 4 rows is ________
a) print (p_series.Tail(4))
b) print (p_series.Tails(4))
c) print (p_series.tail(4))
d) print (p_series.Tails(4))
Ans.: c) print(p_series.tail(4))
[11] In Pandas which of the following dataframe attribute can be used to know the number of rows and columns in a dataframe?
a) size
b) index
c) count
d) shape
Ans.: d) shape
Explanation: The size attribute returns product of rows and comlumns, index property will return index, count function used to count the frequency of particular item in dataframe.
[12] Consider the below-given series, named Batsman, which command will be used to print 6 as output?
| a | WD Parnell |
| b | David Warner |
| c | RG Sharma |
| d | KL Rahul |
| e | Baber Azam |
| f | Ross Taylor |
dtype: object
a) Batsman .index
b) Batsman .length
c) Batsman .values
d) Batsman .size
Ans.: d) Batsman.size
[13] When a DataFrame is created from List of Dictionaries, then dictionary keys will become ______
a) Column labels
b) Row labels
c) Both of the above
d) None of the above
Ans.: a) Column labels
Explanation: The dictionary keys are placed as column labels in the dataframe.
[14] Assertion (A):- DataFrame has both a row and column index.
Reasoning (R): – A DataFrame is a two-dimensional labeled data structure like a table of MySQL.
Ans.: a) Both A and R are true and R is correct explanation of A
[15] Consider the following code and identify the error:
import pandas as pd
s=pd.Series([1,9,6,4],index=['a','b','c'])
print(s)
a) ValueError
b) TypeError
c) IndexError
d) SyntaxError
Ans.: a) ValueError
Data handling using pandas 2 Marks Questions
[1] What do you mean by python libraries? Illustrate your answer with an example.
Ans.: A collection of built in modules that allows to peform many tasks with optimized program codes. Each library in python contains a large number of modules that one can imort and uses.
Numpy, Pandas and Martplotlb are three well established python librries for scientific and analytical use. These libraries also used to manipulate, trasnform and visualize data easily and efficiently.
[2] NumPy stands for what? What is used for?
Ans.:
NumPy stands for Numerical Python.
It is a python pakacge used for numerical data analysis and scientific computing.
It uses multidimensional array object and have tools and functions working with arrays.
[3] What do you mean by Pandas? What are three important data structures of pandas?
Ans.: Pandas Stand for Panel Data System. It is a high-level data manipulation tool used for data analysis. Pandas library contains a rich set of functions for data analysis work.
Three important data structure of pandas are as follows:
1] Series
2] DataFrame
3] Panel
[4] What do you mean by data structure?
Ans.:
A data structure is a special format of data that allows to organize, process, retrieve and store data in systematic manner. It make it easy for users to access and work with data and presents them in human readable form.
[5] What is Matplolib library? Explain in short.
Ans.:
The Matplotlib library in Python is used for plotting graphs and visualisation. Using Matplotlib, with just a few lines of code we can generate publication quality plots, histograms, bar charts, scatterplots, etc. It is also built on Numpy, and is designed to work well with
Numpy and Pandas.
[6] Differentiate between NumPy and Pandas.
Ans.:
| NumPy | Pandas | |
| Developer | Travis Oliphant | Wes McKinney |
| Requires | Homogenous Data | Heterogeneous data |
| Applications | Useful in calculations | Useful in data processing applications |
| Data format | Used where data is available in Tabular format | Used for numeric-based data manipulations |
| Dataset | handles small dataset | handles large dataset |
| Tools | NumPy works on Arrays | Pandas works on Series and DataFrame |
| Speed | Fast in processing compared to Pandas | Slow in processing compared to NumPy |
[7] Samira wants to install python pandas on her laptop. She is not aware of the prerequisite for the same and commands to install it. Help her to understand her requirements and complete her task.
Ans.: She needs to download and install python 3.5.3 and above version.
To install python pandas following command is used:
pip install pandas
To get the version information of pandas use this command in python:
pd.show_versions()
Consider pandas is imported as import pandas as pd
[8] Krish wants to store an individual score of players 34,56,78,23 with appropriate data labels. Which Pandas data structure is used for this purpose? Write a short code to store the values with data labels as names of players.
Ans.: Kirsh can use series data structure.
Code:
import pandas as pd
s=pd.Series([34,56,78,23],index=[‘Virat’,’Rohit’,’Surya’,’Rahul’])
[9] Lax is confused to understand what is series and how it is helpful in data analysis? Illustrate the answer in short and help him.
Ans.: A series is a one-dimensional array containing a sequence of values of any data type having numeric data labels starting with 0 by default. The associated labels with each value is known as index. These index can be assigned with other values as well. It represents the values in single column.
[10] Shiv wants to know various ways to create a series. Suggest any four ways to create a series for him.
Ans.: The following ways are as follows for Shiv:
1) From scalar values
2) From NumPy arrays
3) From dictionaries
4) From lists/tuples/sets
[11] Identify the error from below given code, rectify errors and rewrite the correct code:
import panda as pd
s=pd.series([99,999,9999],index=1,2,3)
print s
Ans.:
import pandas as pd
s=pd.Series([99,999,9999],index=[1,2,3])
print(s)
[12] Adnan has been given a task to create an empty series. But he is confused about what it is and how to create it. Suggest to him the way to create it and understand what is empty series?
Ans. An empty series is a series object created using python pandas without any value. To create an empty series Adnan has to write the following code:
import pandas as pd
s=pd.Series()
[13] Krushn has given the task to create an empty series with default data type float. Write code for the same and display series.
Ans.:
import pandas as pd
s=pd.Series(dtype=float)
print(s)
[14] What are the various ways of accessing series elements?
Ans. There are three ways to access pandas series elements. They are:
1) loc: It is a label based indexing.
2) Labels List: List of labels given inside loc.
3) Slicing : It extracts subset of series elements as start, stop and step value
4) iloc: Ineteger based indexing by position
5) direct indexing with []: Specifying the index value in square brackets
[15] What do you mean by slicing? How to access series elements using slicing? Explain in short.
Ans.: Slicing refers to extract part of series by sepcifying the start and end parameters. The positional indices are used to slice. The value at the endindex will be exculded.
For example:
s[1:4] will return 3 elements with the positional index 1,2, and 3.
[16] Consider the following code and fill in the gaps to get the given output:
import _____________ as pd
s=pd.Series(______,_______)
print(____)
| 1 | 3 |
| 2 | 3 |
| 3 | 3 |
| 4 | 3 |
Ans.:
import pandas as pd
s=pd.Series(3,index=[1,2,3,4])
print(s)
[17] Consider the following series and write code to get the given output:
| Shikhar | 23 |
| Virat | 78 |
| Rohit | 53 |
| Rahul | 40 |
| Hardik | 37 |
| Surya | 85 |
Output 1:
| Shikhar | 23 |
| Rohit | 53 |
| Hardik | 37 |
Output 2:
| Virat | 78 |
| Rahul | 53 |
| Surya | 85 |
Ans.:
print(s[::2])
print(s[1::2])
[18] Consider the above data frame and write output for the following code:
print(s[-3:])
print(s[:-3])
Ans.:
Output 1:
| Rahul | 40 |
| Hardik | 37 |
| Surya | 85 |
Output 2:
| Surya | 23 |
| Virat | 78 |
| Rohit | 53 |
[19] Consider the above data frame and write code for the following:
i) Display the records of batsmen who scored more than 50.
ii) Display the runs of Rohit.
Ans.:
i) print(s[s>50])
ii) print(s[‘Rohit’])
[20] What will be the output of the following:
import pandas as pd
s=pd.Series([[34,56,78],[4,3,2]])
print(s)
Ans.:
0 [34, 56, 78]
1 [4, 3, 2]
dtype: object
[21] Consider a given Series , M1. Write a program in Python Pandas to create the series.
| Marks | |
| PT1 | 23 |
| WT2 | 19 |
| PT2 | 58 |
| WT2 | 21 |
Ans.:
import pandas as pd
M1=pd.Series([23,19,58,21],index=['PT1','WT1','PT2','WT2'])
print(M1)
[22] Given two series S1 and S2
| S1 | |
| P | 23 |
| Q | 14 |
| R | 19 |
| S | 24 |
| S2 | |
| P | 17 |
| Q | 17 |
| T | 17 |
| U | 17 |
Find the output for the following python pandas statements.
a. S1[ : 2]*100
b. S1 * S2
Ans.:
a)
Steps:
- S1[:2] returns the values at 0 and 1 index – 23 and 14.
- Now its multiplies by 100.
- So the final values are 2300 and 1400
Output:
P 2300
Q 1400
dtype: int64
b) It performs multiplication with matched values and the rest will be shown NaN.
Output:
P 230.0
Q 140.0
R NaN
S NaN
T NaN
U NaN
dtype: float64
[23] Carefully observe the following code:
import pandas as pd
L=[[1,'Adnan',68],[2,'Krish',56],[3,'Krishn',55],[4,'Laksh',45],[5,'Shiv',52]]
df=pd.DataFrame (L, columns=['Rno','Name','Marks'])
print(df)
i. Write the statement to print shape of dataframe df
ii. Write statement to print the index and column names of dataframe df
Ans:
i. df.shape
ii. df.index, df.columns
[24] Write a program to create a series objects using a dictionary that stores the number of cities in district of your state.
Note: Assume some districts like Ahmedabad, Baroda, and Bharuch have 44,32,12 cities respectively and the pandas library has been imported as pd_district_cities.
Ans.:
import pandas as pd_district_cities
dis={'Ahmedabad':44,'Baroda':32,'Bharuch':12}
s=pd_district_cities.Series(dis)
[25] Write a program to create a series object using a dictionary that stores the number of students in each section of class XII.
Note: Assume four sections as ‘XII A’, ‘XII B’, ‘ XII C’ and ‘XII D’ with 40, 38, 40, 26 students respectively.
Ans.:
import pandas as pd
d={'XII A':40,'XII B':38,'XII C':40,'XII D':26}
s=pd.Series(d)
[26] Consider the commands below:
import pandas as pd
lst=[10,20]
ds=pd.Series([10,20])
Here lst is a list and ds is a series. Both have same values 10 and 20. What will be the output of the following commands? Justify your answer.
a. print ( lst * 2 )
b. print ( ds * 2 )
Ans.:
a) [10,20,10,20]
b) 0 20
1 40
[27] What will be the output of the following code:
import pandas as pd
mydata=pd.Series( [‘Delhi’, ‘Mumbai’, ‘Kolkata’, ‘Ahmedabad’] )
print(mydata < ‘Baroda’ )
Ans.:
0 False
1 False
2 False
3 True
dtype: bool
[28] Carefully observe the following code:
import pandas as pd
xiic = {'Arnavee':[34,59], 'Samira':[27,38], 'Ayush':[37,55]}
df = pd.DataFrame(xiic,index=['PT1','PT2'])
print(df)
What will be the output of following:
i) print(df.dtypes)
ii) print(df.axes)
Ans.:
i)
Arnavee int64
Samira int64
Ayush int64
dtype: object
ii) [Index(['PT1', 'PT2'], dtype='object'),
Index(['Arnavee', 'Samira', 'Ayush'],
dtype='object')]
[29 ]Consider the following DataFrame, DF
| Rollno | Name | Class | Section | CGPA | |
| St1 | 1 | Aman | IX | E | 8.7 |
| St2 | 2 | Preeti | X | F | 8.9 |
| St3 | 3 | Kartikey | IX | D | 9.2 |
| St4 | 4 | Lakshay | X | A | 9.4 |
Write commands to :
i. Write a statement to print the dimensions of given dataframe
ii. Write a statement to print the number of elements of given dataframe
Ans.:
i) DF.ndim
ii) DF.size or DF.shape[0]*DF.shape[1]
[30] Carefully observe the following code:
import pandas as pd
L=[['XIIC01','Nishtha',65,67],['XIIC02','Rohit',56,54],['XIID04','Laksh',37,43],['XIID05','Krishn',45,48]]
df=pd.DataFrame (L, columns=['ID','Name','PB1','PB2'])
print(df)
i. Write a statement to display the average of Preboard 1 and Preboard 2 marks
ii. Write a statement to display the difference between Preboard 1 and Preboard 2 marks
Ans.:
i. (df.PB1+df.PB2)/2 or (df['PB1']+df['PB2'])/2
ii. df.PB1-df.PB2 or df['PB1']-df['PB2']
Python Pandas 3 marks Questions
Let us begin python pandas 3 marks questions for most expected class IP class 12. Here we go!
[1] Write a Python code to create a DataFrame with appropriate column headings from the list given below:
[[1,’GT vs CSK’,’2023-03-31’], [2,’KEP vs KKE’,’2023-01-04’],
[3,’LSG vs DC’ , ‘2023-01-04], [4,’SRH vs RR’,’2023-04-02’]]
[2] Write a Python code to create a DataFrame with appropriate column headings and serial numbers as index from starting 1 from the list given below:
[[’Puzzle’,21.8],[’Casino’,18.9],[’Strategy’,17.17]]
[3] Consider the given DataFrame ‘Student’:
| Name | Percentage | |
| 0 | Parth | 71.55 |
| 1 | Dhananjaya | 83.25 |
| 2 | Kauntey | 68.69 |
| 3 | Arjun | 54.35 |
Write suitable Python statements for the following:
- Add a column called grade with the given data: [‘B1’,’A2’,’C2’,’D1’].
- Add a new Student named ‘Parantap’ having Percentage 80.5.
- Remove the column grade.
[3] Write a Python code to create a DataFrame from the dictionary given below and write the output also:
d={‘Rollno’:[11,23,34],’Names’:(‘Ankit’,’Dhaval’,’Marvin’),’Fees’:[2000,2100,1800]}
[4] Consider the given DataFrame ‘IPL_AUC’:
| TeamName | Spent | Available | |
| 0 | RCB | 93.25 Cr | 1.75 Cr |
| 1 | KKR | 93.35 Cr | 1.65 Cr |
| 2 | CSK | 9.50 Cr | 1.50 Cr |
Write suitable Python statements for the following:
- Write code to create the above dataframe.
- Write code to create a series with index as column TeamName and spent amount as data.
[5] Consider the given DataFrame ‘Stock’:
| Name | Price | Quantity | |
| 0 | Pen | 15 | 40 |
| 1 | Pencil | 10 | 25 |
| 2 | Erasers | 10 | 25 |
| 3 | Scale | 10 | 40 |
Write suitable Python statements for the following:
- Display first 3 rows
- Display last 2 rows
- Display name and price only
[6] Consider the following DataFrame:
| City | BusTerminals | RailwayStations | |
| 0 | Ahmedabad | 198 | 24 |
| 1 | Baroda | 145 | 18 |
| 2 | Surat | 98 | 12 |
| 3 | Bhavnagar | 74 | 7 |
Write appropriate statements for the following:
i) Display the first two rows only with city and railwaystations
ii) Administrator has written the following code to display data for the last 2 rows and city along with busterminals but not getting the proper results:
df.tail(2,columns=['city','bustermminals'])
Write correct statements to get the desired output.
iii) Write statement to display only column names
[7] DataFrame ‘STU_DF’:
| Rollno | Name | Marks | |
| 0 | 11 | Priya | 97.5 |
| 1 | 36 | Rishi | 98.0 |
| 2 | 7 | Preet | 98.5 |
| 3 | 4 | Vansh | 98.0 |
Perform the following operations on the DataFrame stuDF:
i. Iterate dataframe by rows and make sum of marks
ii. Transpose the dataframe
iii. Display the number of rows and columns in tuple form
[8] Consider the following dataframe ndf as shown below :
| C1 | C2 | C3 | C4 | |
| R1 | A | 151.2533 | True | 20 |
| R2 | B | 131.5241 | False | 25 |
| R3 | C | 165.3214 | True | 15 |
| R4 | D | 187.452 | None | 28 |
What will be the output produced by the following statements :-
a. print( ndf.loc [ : , ’C3’ : ] )
b. print( ndf.iloc[2 : , : 3] )
c. print( ndf.iloc [ 1:3 , 2:3 ])
Watch this video to get the answers to above 8 questions:
Python Pandas 4 Marks Important Questions
[1] Vishvesh, a data analyst has designed the DataFrame df that contains data about inter house competition with ‘P01’, ‘P02’, ‘P03’, ‘P04’, ‘P05, and ‘P06’ as indexes shown below. Answer the following questions:
| School | participants | merit | demerit | |
| P01 | ABPS | 160 | 5 | 155 |
| P02 | LMJ | 120 | 8 | 112 |
| P03 | JKLU | 45 | 6 | 39 |
| P04 | Anandalaya | 80 | 12 | 68 |
| P05 | RPS | 190 | 20 | 170 |
| P06 | Podar | 160 | 63 | 223 |
i) Predict the output of the following python statement:
A) df.shape
B) df[2:4]
ii) Write a Python statement to display the data of the demerit column of indexes P03 to P05.
OR (Option for part ii only)
Write a Python statement to compute and display the product of data of the participants column and merit column of the above given DataFrame.
Ans.:
i)
a) (6,4)
b)
| School | participants | merit | demerit | |
| P03 | JKLU | 45 | 6 | 39 |
| P04 | Anandalaya | 80 | 12 | 68 |
ii) print(df.loc[‘P03′:’P05′,’demerit’])
OR
print(df.participants*df.merit) or print(df[‘participants’]*df[‘merit’])
[2] Consider the following DataFrame, DFCL with row index S1,S2,S3,S4
| Rollno | Name | Class | Section | CGPA | Stream | |
| S1 | 1201 | Aditya | XII | D | 8.7 | Science |
| S2 | 1202 | Dev | XI | B | 8.9 | Humanities |
| S3 | 1203 | Kavya | XI | D | 9.2 | Science |
| S4 | 1204 | Suresh | X | E | 9.4 | Commerce |
Based on the above dataframe answer the following:
A. Predict the output
i. DFCL.T
ii. DFCL.ndim
B.
i. Write a python statement to print no. of columns present in data frame
ii. Write a python statement to print no. rows present in dataframe
OR
Write a python Statement to print the list of rows
Ans.:
A.
i)
| S1 | S2 | S3 | S4 | |
| Rollno | 1201 | 1202 | 1203 | 1204 |
| Name | Aditya | Dev | Kavya | Suresh |
| Class | XII | XI | XI | X |
| Section | D | B | D | E |
| CGPA | 8.7 | 8.9 | 9.2 | 9.4 |
| Stream | Science | Humanities | Science | Commerce |
ii) 2
B.
i)
print(DFCL.shape[1])
#or
print(len(DFCL.columns))
#or
r,c=DFCL.shape
print(c)
#or
print(len(DFCL.axes[1]))
ii)
print(DFCL.shape[0])
#Or
print(len(DFCL))
#Or
r,c=DFCL.shape
print(r)
#Or
print(len(DFCL.axes[0]))
OR
print(DFCL.to_string(index=False,header=False))
#OR
l=[]
for i,r in DFCL.iterrows():
lr=[r.Rollno,r.Name,r.Class]
l.append(lr)
for i in l:
print(i)
[3] Mr. Kaushik, a data analyst has designed the dataframe DF that contains data about punching time as shown below:
| name | time_in | time_out | |
| E001 | Akash | 7:39 AM | 1:45 PM |
| E002 | Nisha | 7:42 AM | 1:45 PM |
| E003 | Disha | 7:45 AM | 2:00 PM |
| E004 | Manisha | 7:32 AM | 1:45 PM |
| E005 | Mehul | 7:40 AM | 1:46 PM |
Answer the following questions:
A. Predict the output of the following python statement:
i) print(DF.iloc[3: ])
ii) print(list(DF.index))
B.
i) Write a python statement to print data types used in each column
ii) Write a python statement to check whether data type is empty or not
OR (for option B only)
Write a python Statement to print the all the values column wise
Ans.:
A.
i)
| Name | time_in | time_out | |
| E004 | Manisha | 7:32 AM | 1:45 PM |
| E005 | Mehul | 7:40 AM | 1:46 PM |
ii) [‘E001′,’E002′,’E003′,’E004′,’E005’]
B.
i) print(DF.dtypes)
ii) print(DF.empty)
or
for i,c in df.iteritems():
print(c)
[4] Bhargav, a data analyst has designed a series df that contains data about score made by 4 batters in a match as shown below.
| Rohit Sharma | 101 |
| Shubman Gill | 112 |
| Virat Kohli | 36 |
| Ishan Kishan | 17 |
Answer the following questions:
A. Predict the output of the following python statement:
i) print(s.shape)
ii) print(s*3)
iii) Write a python statement to divide runs by 5 (exclude decimals) for each player individually.
OR (For Part (iii) only)
Write a python statement to display names of players’ index containing ‘sh’.
iv) Write a statement to produce the following output: (Displaying boolean value for players made century)
| Rohit Sharma | True |
| Shubman Gill | True |
| Virat Kohli | False |
| Ishan Kishan | False |
Ans.:
i) (4,)
ii)
| Rohit Sharma | 303 |
| Shubman Gill | 336 |
| Virat Kohli | 108 |
| Ishan Kishan | 51 |
iii) print(s//3)
OR
for i in s.index:
if 'sh' in i.lower():
print(i)
iv) print(s>=100)
[5] Consider the following dataframe:

Write code to do the following: (1 + 1 + 2)
a) Display categories from dataframe
b) Display Appname, Category, and Rating for app having a rating more than 4
c) Display AppName and installs for sports category apps
OR (Only for c)
Display the dimensions and shape of given dataframe
Ans.:
a) print(df.Category) or print(df[‘Category’])
b)
d1=df[df['Rating']>4] or d1=df[df.Rating>4] or d1=df[df.loc[:,'Rating']>4]
print(d1.loc[:,['AppName','Category','Rating']])
c)
d1=df[df['Category']=='Sports'] or d1=df[df.Category=='Sports'] or d1=df[df.loc[:,'Category']=='Sports']
print(d1.loc[:,['App','Installs']])
OR
d=df.ndim
s=df.shape
print(d,s)
Data Visualization
In this section, I will cover data visualization’s most important questions for informatics practices class 12. Here we go!
Most important questions Data Visualization 5 Marks
As per sample paper 2023, 5 marks questions will be asked from the topic data visualization. In this section, we will see a few questions from the data visualization chapter for informatics practices class 12. So here we go!
[1] Write python code to plot a bar chart for India’s runs in T20 World cup as shown below:

Apply appropriate labels to the chart and x and y axis.
Ans.:
import matplotlib.pyplot as plt
teams=["Pakistan","Netherlands","South
Africa","Bangladesh","Zimbabwe","England"]
runs=[160,179,137,184,186,168]
plt.bar(teams,runs,color=['r','g','b','c','m','k'])
plt.title("India's T20W Cup 2022")
plt.xlabel("Teams")
plt.ylabel("Runs")
plt.show()
[2] Write python code to depict the data of India/England semi-final runs by over on line chart. The data is as follows:
| Overs | 5 | 10 | 15 |
| India | 31 | 62 | 100 |
| England | 52 | 98 | 156 |
- Display the overs as same as given here on x-axis.
- Apply the line colours as – India : Blue, England: Red
- Apply appropriate labels
- Apply chart label – T20W Cup 2022 : Semi-final 2
Ans.:
import matplotlib.pyplot as plt
overs=[5,10,15]
ind=[31,62,100]
eng=[52,98,156]
plt.plot(overs,ind,'b')
plt.plot(overs,eng,'r')
plt.title("T20W Cup Semi-final 2")
plt.xlabel("Overs")
plt.xticks(overs)
plt.ylabel("Runs")
plt.show()
[3] Write python code to plot a bar chart for Library Books as shown below:

Also give suitable python statement to save this chart.
Ans.:
import matplotlib.pyplot as plt
book=['Maths','IP','Accounts']
qty=[60,40,72]
plt.bar(book,qty)
plt.title("Books in library")
plt.xlabel("Books")
plt.ylabel("Number of Books")
plt.savefig("Books.jpg")
plt.show()
[4] Write a program to plot a line chart based on the given data to depict the runs scored by a batsman in 5 innings.
Innings = [1,2,3,4,5]
Runs = [102,88,98,146,52]
Ans.:
import matplotlib.pyplot as plt
Innings = [1,2,3,4,5]
Runs = [102,88,98,146,52]
plt.plot(Innings,Runs)
plt.show()
[5] Write a python code to draw a histogram of runs scored by 10 players in previous innings. Apply following customizations:
- Take bins as 7
- Apply title “Player Performance”
- Show histogram cumulatively
- Apply bar color – red
Ans.:
import matplotlib.pyplot as plt
dt=[34,56,28,89,75,33,45,68,23,90]
plt.hist(dt,7,color='red',cumulative=-1)
plt.title("Player Performance")
plt.show()
[6] Observe the following figure. Write code for same:

import matplotlib.pyplot as plt
city=['Ahmedabad','Vadodara','Surat','Patan','Bharuch']
max_temp=[32,28,39,31,27]
min_temp=[25,22,30,24,20]
plt.plot(city,max_temp,color='red')
plt.plot(city,min_temp,color='blue')
plt.xlabel("City")
plt.ylabel("temperature")
plt.title("Temprature")
plt.yticks([20,25,30,35,40])
plt.show()
[7] Observe the following chart and write code for the following:

import matplotlib.pyplot as plt
virat=[80,65,34,42,55]
rohit=[55,35,88,78,42]
x1=[0.25,1.25,2.25,3.25,4.25]
x2=[.75,1.75,2.75,3.75,4.75]
plt.bar(x1,virat,label='Virat Kohli',width=0.5,color='red')
plt.bar(x2,rohit,label='Rohit Sharma',width=0.5,color='blue')
plt.xlabel("Macthes")
plt.ylabel("Runs")
plt.title("Player Stats")
plt.xticks([1,2,3,4,5])
plt.show()
[8] Mrs. Namrata is a coordinator in the senior section school. She represented data on number of students who passed the exam on line chart as follows:

import matplotlib.pyplot as plt
classes=["X A","X B","XI A","XI B","XII A","XII B"]
no_of_boys=[23,22,20,26,33,30]
no_of_girls=[17,10,20,12,5,8]
plt.line(classes,no_of_boys) #Statement 1
plt.line(classes,no_of_girls) #Statement 2
plt.xtitle("No of Stduents") #Statement 3
plt.ytitle("Classes") #Statement 4
plt.show()
i) What will be the correct code for Statement 1 and Statement 2?
ii) What is the correct function name for Statement 3 and Statement 4?
iii) Write a method and parameter required to display legends?
iv) Name the parameter and values used to apply the marker as given in the output.
v) Name the parameter and values used to apply linestyle as given in the output.
vi) How to apply the line colours as given in the figure?
vii) Write to save the figure as image.
Ans:
i) The code for statement 1 and statement 2 is as follows:
- Statement 1: plt.plot(classes,no_of_boys)
- Statement 2:plt.plot(classes,no_of_girls)
ii) The correct code for statement 3 and statement 4 is as follows:
- plt.xlabel(‘classes’)
- plt.ylabel(‘No of stduents’)
iii) To display the legend she need to add label parameter in the plot method as following:
- plt.plot(classes,no_of_boys,label=’Boys’)
- plt.plot(classes,no_of_girls,label=’Girls’)
To display legend she need to write this function:
plt.legend()
iv) To apply the marker as given in the figure she needs to write the code as follows:
plt.plot(classes,no_of_boys,marker='D')
plt.plot(classes,no_of_girls,marker='o')
To display legend she need to write this function:
plt.legend()
iv) To apply the marker as given in the figure she needs to write the code as follows:
plt.plot(classes,no_of_boys,marker='D')
plt.plot(classes,no_of_girls,marker='o')
v) To apply the lines styles she needs to use a parameter linestyle or ls with the values ‘dashed’ and ‘dotted’ respectively as follows:
plt.plot(classes,no_of_boys,ls='dashed')
plt.plot(classes,no_of_girls,ls='dotted')
vi) She can use color parameter to apply colours as follows:
plt.plot(classes,no_of_boys,color='m')
plt.plot(classes,no_of_girls,color='pink')
vii) To save the figure as image she needs to use savefig() method as follows:
plt.savefig('boygirlspass.jpg')
Follow this link for more questions:
Unit 2 Database Query using SQL
In this section of Most expected questions IP Class 12 I am going to cover MCQs from MySQL. Here we go!
Important MySQL MCQs/1 Mark Questions
[1] Identify the data type returned by the following query:
Select length(“LENGTH”) ;
a) Numeric value
b) Text value
c) Null value
d) Float value
Ans.: a) Numeric Value
Explanation: The length() function in mysql returns total number of characters from the specified text.
[2] If column “SCORE” of table PLAYER contains the data set (45,80, 35,15, 7) , what will be the output after execution of the following query?
SELECT MAX(SCORE) – MIN(SCORE) FROM PLAYER;
a) 38
b) 73
c) 8
d) 35
Ans.: b) 73
Explanation: The max() function returns 80 and the min() function returns 7. The difference between these values are : 80-7=73
[3] If column “temp” of the weather table contains the data set (45, 35, 35, 28, 28), what will be the output after the execution of the given query?
SELECT AVG (DISTINCT temp) FROM weather;
a) 34.2
b) 21.6
c) 38.33
d) 36
Ans. d) 36
[4] Ravi is class 12 student. He is learning MySQL functions. He wants to know the category of mid() function. Select an appropriate category to help him to understand well.
a) Math function
b) Text function
c) Date Function
d) Aggregate Function
Ans.: b) Text Function
Explanation: mid() function extract the word from specified character to number of characters in MySQL function.
[5] What will be the output of the following SQL command?
SELECT round(155.9772,-1);
a) 155
b) 156
c) 160
d) 156
Ans. c) 160
Explanation: The round function returns the number upto specified digits by rounding upto nearest integer. The negative value rounding up the number before decimal places starting with -1 as one’s place.
[6] Consider the string “TutorialAICSIP.com is best”, Which among the following SQL command(s) will give the output as – best?
(i) SELECT right(“Tutorialaicsip.com is best”,4);
(ii) SELECT left(“Tutorialaicsip.com is best”,4);
(iii) SELECT substr(“Tutorialaicsip.com is best”,23,4);
(iv) SELECT substr(“Tutorialaicsip.com is best”,-4)
a) option (i)
b) option (i) and (iii)
c) option (i) and (iv)
d) option (i), (iii), and (iv)
Ans. : d) option(i), (iii) and (iv)
[7] If column “venue” of table matches contains the data set (‘Ahmedabad’, ‘Baroda’, ‘Ahmedabad’, ‘Anand’, ‘Baroda’) , what will be the output after execution of the following query?
SELECT COUNT(DISTINCT venue) FROM matches ;
a) 5
b) 3
c) 2
d) 4
Ans. b) 3
Explanation: The distinict keyword eliminates dupliate records from the set of values.
[8] The correct SQL form below to find the temperature in increasing order of all cities
a) SELECT city FROM weather order by temperature ;
b) SELECT city, temperature FROM weather ;
c) SELECT city, temperature FROM weather ORDER BY temperature ;
d) SELECT city, temperature FROM weather ORDER BY city ;
Ans. : d) select city,temprature from weather order by city;
[9] Which one of the following is an aggregate function(s)?
i) min()
ii) max()
iii) power()
iv) now()
a) Only (i)
b) (i) and (ii)
c) (i) , (ii) and (iii)
d) (i), (iii) and (iv)
Ans.: b) (i) and (ii)
Explanation: miin() and max() are aggregate function where as power() is numeric function and now() is datetime function.
[10] Observe this statement and select appropriate option: “Where and Having clauses can be used interchangeably in SELECT queries“.
a) True
b) False
c) Only in views
d) With order by
Ans.: b) False
Explanation: Where and having both are used to filter records but where is used with select and having is used with group by.
[11] Sohail is confused about which function returns the time when the function executes. Help him by selecting the correct option out of the following:
a) SYSDATE()
b) NOW()
c) CURRENT()
d) TIME()
Ans. a) sysdate()
[12] Prakash has been given a task to select a function used to display the current date and time. Select an appropriate function for same.
a) Date( )
b) Time( )
c) Current( )
d) Now( )
Ans. b) now()
Explanation:
[13] Find the output for the below SQL statement:
Select substr(“BoardExam@2023”, -1, 7);
a )3
b) am@2023
c) BoardEx
d) 3202@ma
Ans.: a) 3
[14] What is the output of following?
Select Round(9999.299,2);
a) 9999.30
b) 10000.29
c) 19999.00
d) 10000.30
Ans. a) 9999.30
[15] What is the use of a desc word along with order by clause?
a) Display the result with all rows
b) Display results with in descriptive format
c) Display distinct rows
d) Display results in descending order
Ans.: d) Display results in descending order
Most expected questions IP Class 12 – 2 Marks Questions
In the first section of Most expected questions IP Class 12 we will cover the questions from my SQL functions.
[1] In a table employee, a column occupation contains many duplicate values. Which keyword would you use if wish to list of only different values?
Ans.Distinct keyword is used to ignore the duplicate values and display a list of different values.
[2] Define and Identify Single Row functions of MySQL amongst the following :
TRIM(), MAX(), COUNT(*), ROUND()
Ans. Single row functions are those functions of mysql which operates on single row and returns a single value per row as output. The functions are : trim() & round()
[3] Given the table ‘Player’ with the following columns :
| Pcode | Points |
| P001 | 25 |
| P002 | 36 |
| P003 | 12 |
| P004 | NULL |
| P005 | 42 |
Write the output of the following queries:
- SELECT ROUND(AVG(POINTS)) FROM Player;
- Select COUNT(POINTS) FROM Player;
Ans.
ROUND(AVG(POINTS))
——————–
29
COUNT(POINTS)
———————
4
[4] Name SQL Single Row functions (for each of the following) that
- returns total no. of letters of the given text
- returns text into lowercase letters
- returns names of days, For example : ‘‘Monday’’, ‘‘Tuesday’’
- returns month number from the given date
Ans.:
1. length()
2. lcase()/lower()
3. dayname()
4. month()
[5] Name two Aggregate (Group) functions of SQL and explain them with example.
Ans.:
1. Max(): It is used to return maximum value from given set of values.
Example: select max(salary) from emp;
Assume that salary is one of the columns of emp table.
Output:
max (salary)
—————————-
55000
2. Min(): It returns minimum value from the given set of values.
Example: select min(salary) from emp;
Output:
min(salary)
—————
15000
[6] Consider the table ‘Hotel’ given below:
| Empid | Category | Salaray | |
| 101 | Regular | 25300 | |
| 102 | Probation | 18500 | |
| 103 | Regular | 20000 | |
| 104 | Regular | 12000 | |
| 105 | Probation | 8000 |
Mr. Vinay wanted to display average salary of each Category. He entered the following SQL statement. Identify error(s) and Rewrite the correct SQL statement.
SELECT Category, Salary FROM Hotel GROUP BY Category;
Ans.: Mr. Winay missed the aggergate function in the query. The function he needs to write is avg(salary). The correct statement is:
select category, avg(salary) from hotel group by category
[7] Write the output of the following SQL queries :
- SELECT MID(‘BoardExamination’,2,4);
- SELECT ROUND(67.246,2);
- SELECT INSTR(‘INFORMATION FORM’,‘FOR’);
- SELECT LEFT(‘2022-06-13’,4);
Ans.
1. MID(‘Board Examination’,2,4)
———————————
oard
2. ROUND(67.246,2)
——————————–
67.25
3. INSTR(‘INFORMATION FORM’,’FOR’)
————————————–
3
4. LEFT(‘2022-06-13’,4)
————————-
2022
[8] Distinguish between Single Row and Aggregate functions of MySQL. Write one example of each.
Ans.:
Single row functions:
It operates on a single row
It displays result per row
It can be used within select, where and order by clause
Examples: math, string, date etc.
Aggregate functions
It operates on multiple rows
It displays one result for set of rows
It can be used only in select clause
Examples: min, max, avg, sum etc.
[9] Consider the following table :
| studentid | name | examid | score |
| 101 | Mohit | 111345 | 95 |
| 102 | Sagar | 111348 | 98 |
| 101 | Manish | 111586 | 87 |
| 102 | Jayesh | 111745 | 75 |
Abhay wants to know the number of students who took the test. He writes the following SQL statement to count STUDENTID without duplicates. However the statement is not correct. Rewrite the correct statement.
SELECT DISTINCT(COUNT STUDENTID) FROM RESULTS;
Ans.: the distinct keyword is used to display the unique values from a column. It must be written before column name only. So the correct statement is:
select count(distinct studentid) from results;
[10] Aman has used the following SQL command to create a table ‘stu’ :
CREATE TABLE stu ( id INTEGER, name VARCHAR(100) );
Then, Aman enters the following SQL statements to enter 3 rows :
INSERT INTO stu VALUES (1, “abc”);
INSERT INTO stu VALUES (2, “abc”);
INSERT INTO stu VALUES (3, “bcd”);
Write the output that will be produced by the following SQL statement :
SELECT name, Count(*) FROM stu GROUP BY name;
Ans.:
name count(*)
——– ————–
abc 2
bcd 1
[11] Table Student has the columns RNO and SCORE. It has 3 rows in it. Following two SQL statements were entered that produced the output (AVG(SCORE)) as 45 and COUNT(SCORE) as 2). Data in SCORE column is same in two rows. What data is present in the SCORE column in the three rows?
Ans.: Data for student table is as follows:
RNO Score
1 45
2 NULL
3 45
[12] Consider the following table – activity
| activitycode | activityname | points | |
| A001 | Skating | 120 | |
| A001 | Karate | 105 | |
| A002 | Judo | 110 | |
| A002 | Boxing | 115 | |
| A003 | Swimming | 107 | |
| A004 | Archery | 135 |
- Write query to display Activity Code along with total points of each activity (Activity Code wise) from the table Participant.
- To display Activity Code, Activity Name in alphabetic ascending order of names of activityname.
Ans.
1. select activitycode, sum(points) from activity group by acitivitycode;
2. select activitycode,activityname from activity order by activityname;
[13] Consider the following table: results
| studentid | name | examid | score | ||
| 1 | Ankit | 1010 | 98 | ||
| 2 | Bhavik | 1011 | 95 | ||
| 3 | Suman | 1010 | 85 | ||
| 4 | Sachin | 1011 | 75 |
Write the outputs that the following SQL statements will generate :
- SELECT AVG(SCORE) FROM RESULTS WHERE EXAMID = 1010;
- SELECT EXAMID, AVG(SCORE) FROM RESULTS GROUP BY EXAMID;
Ans.:
1. AVG(SCORE)
—————
91.5
2. EXAMID AVG(SCORE)
————- —————
1010 91.5
1011 85
[14] Consider the following table: item
| Ino | Iname | Price | |
| 1 | Pencil | 10 | |
| 2 | Sketch Pens | 40 | |
| 3 | Ball Pens | 18 | |
| 4 | Gel Pens | 20 | |
| 5 | Eraser | 8 |
Write queries to
- To display Names of Items and Price of all the items in descending order of their Price.
- To display Minimum and Maximum Price of each item from the table item for pens and pencil)
Ans.:
1. select iname,price from item order by price desc;
2. select mini(price), max(price) from item where iname like ‘%pen%’;
[15] Write the output of the following queries:
- select mod(-23,2);
- select right(lower(‘Class XII Term 2 Exam’),4);
- select month(‘2022-04-03’);
- select pow(day(‘2022-05-03’),-2);
Ans.
1. mod(-23,2)
————–
-1
2. right(lower(‘Class XII Term 2 Exam’),4)
——————————————
exam
3. month(‘2022-04-03’)
————————-
4
4. pow(day(‘2022-05-03’),-2)
—————————–
0.11
[16] Consider the following table game:
| GNO | GNAME | FEES |
| G001 | Cricket | 2200 |
| G002 | Volleyball | 2100 |
| G003 | Football | 2500 |
| G004 | Basketball | 2300 |
| G005 | HandBall | 1700 |
- Write a query to display the maximum, and minimum fees of grames.
- Write a query to display the average fees of game number G001,G003,G004 and G005.
Ans.
1. select max(fees), min(fees) from game;
2. select avg(fees) from game where gno in (‘G001′,’G003′,’G004′,’G005’)
OR
seelct avg(fees) from game where gno =’G001′ or gno=’G003′ or gno=’G004′ or gno=’G005′;
[17] What will be the output of the following queries:
- select length(substring(‘SSC Exam 2022’),10,4);
- select dayname(‘2022-06-13’);
- select trim(‘ Term 2 Examination ‘);
- select UCASE(‘IP XII’);
Ans.:
1. length(substring(‘SSC Exam 2022’),10,4);
———————————————
4
2. dayname(‘2022-06-13’)
——————————–
Monday
3. trim(‘ Term 2 Examination ‘)
———————————–
Term 2 Examination
4. UCASE(‘XII IP’)
———————-
XII IP
[18] Differentiate between order by clause and group by clause.
Ans.:
The order by clause is used to display the content in ascending or descending order to the specific column.
The group by clause is used to combine or group the values of given column and apply a group function to the group.
[19] Differentiate between where and having clause.
Ans.: The where clause is used to filter the query result according to specific criteria using with select clause. The having clause is used to filter the reults fetched by group by clause.
[20] Ankur has written the following commands with respect to a table employee having fields empno, name, department, and commission.
Command 1 – select count(*) from employee;
Command 2 – select count(commission) from employee;
She gets the output as 6 for the first command but gets 4 rows for the second command. Explain the output with justification.
Ans.: This is due to column commission contains 2 records with null values. As count(commission) do not take the null values into the account. So command 1 returns records including null values whereas command 2 ignore the null values into the column commission.
[21] Roshan, is a student of class 12 learning MySQL, he wants to remove leading and trailing spaces from ‘#####LEARNING###MYSQL####’ (#denotes a blank space) and also wants to know the output. Write the output and explain how these spaces are removed?
Ans.: To remove leading and trailing spaces from ‘#####LEARNING###MYSQL####’ Roshan hsa to use the function trim().
The query will be:
select trim(‘ LEARNING MYSQL ‘);
The output will be:
trim(‘LEARNING MYSQL’)
——————————-
LEARNING MYSQL
[22] Mr. Kalpesh is Admin Manager in Krishna Hospital. He created the following table named doctor to store records of doctors.
| ID | DNAME | DEPARTMENT | SALARY |
| 1 | Anmol | Admin | 25000 |
| 2 | Kalpesh | Admin | 35000 |
| 3 | Jasmin | Orthopaedics | 45000 |
| 4 | James | Surgery | 55000 |
| 5 | Sonia | Oncology | 52000 |
| 6 | Rani | Orthopaedics | 48000 |
| 7 | Kapil | Surgery | 50000 |
| 8 | Moksh | Orthopaedics | 57000 |
Write output of the following queries:
i) select SUM(Salary) from Doctor where Department =’Surgery’;
ii) select Department, Count(*) from Doctor Group By Department;
Ans.
i. sum(Salary)
————————-
105000
ii. department count(*)
—————- —————-
Admin 2
Orthopaedics 3
Surgery 2
Oncology 1
[22] Based on the table given above, help Mr. Kalpesh write queries for the following task:
i) To display the names and salaries of doctors in descending order of salaries.
ii) To display the unique departments from the doctor table.
Ans.
1. select dname, salary from doctor order by salary desc;
2. select distinct department from doctor;
[23] Gopal is using a table EMPLOYEE. It has the following columns: He wants to display the maximum salary Department wise.
Table Fields – Code, Name, Salary, Deptcode
He wrote the following query:
SELECT Deptcode, Max(Salary) FROM EMPLOYEE order by deptcode;
But he did not get desired result. Rewrite the above query with necessary changes to help him get the desired output. and also write the category of a query and function of this command.
Ans.: The correct query is:
select deptcode, max(salary) from employee group by deptcode;
The category of command is DML (Data Manipulation Language) command or DQL (Data a Query Language) and the function max is aggregate function or multiple row function.
[24] Write the name of the functions to perform the following operations and write an example:
1. To display the day, from the date when the constitution of India came into effect.
2. To display the position of India from the given string – ‘Republic India’.
Ans.
1. day()
select day(‘1950-01-26’);
2. instr()
select instr(‘Republic India’,’India’)
[25] Predict the output:
- select power(3,0);
- select round(125.7654,-2)
Ans.
1. power(3,0)
—————-
1
2. round(125.7654,-2)
——————-
100
Database Query Using SQL 3 Marks Most expected questions IP Class 12
[1] Predict the output of the following:
i. select instr(‘Term 2 Boardexams @2022′,’@’);
ii. select mid(‘Term 2 Boardexams @2022’,8,5);
iii. select left(‘Term 2 Boardexams @2022’,6);
Ans.
1. instr(‘Term 2 Boardexams @2022′,’@’)
——————————————–
19
2. mid(‘Term 2 Boardexams @2022’,8,5)
——————————————–
Board
3. left(‘Term 2 Boardexams @2022’,6)
——————————————
Term 2
[2] Consider the following table ‘Prepaid’ and write queries given below:
| CustID | CustName | Plan | Company | |
| 1 | Bhavin | 399 | Jio | |
| 2 | Milan | 699 | Vodafone | |
| 3 | Kashish | 599 | Airtel | |
| 4 | Hetvi | 799 | Jio | |
| 5 | Rushi | 499 | BSNL | |
| 6 | Preet | 599 | Vodafone |
- To fetch the First 5 characters of customer’s name
- To display the company names is longer than 4 characters
- To display the customer name in capitals
Ans.
1. select left(custname,5) from prepaid;
2. select company from prepaid where length(company)>4;
3. select upper(company) from prepaid;
[3] Raj is working with functions of MySQL. Suggest a query to him for the following:
- To display the name of the month of the today
- To remove spaces from the beginning and end of the string “ Popular ”
- To compute the remainder of the division between two numbers 5 and 7
Ans.:
1. select monthname(now());
2. select trim(‘ Popular ‘);
3. select mod(5,7)
[4] Consider the following table – ‘Garment’
| GCODE | GNAME | SIZE | COLOUR | Price | |
| G001 | T-shirt | XL | Red | 1499 | |
| G002 | Jeans | L | Blue | 1749 | |
| G003 | Skirt | M | Gray | 1845 | |
| G004 | Shirt | L | White | 1475 | |
| G005 | Ladies Top | L | Yellow | 780 | |
| G006 | Cotton Jeans | XL | Black | 1249 |
Write the following queries in some other methods or ways:
- select sum(price) from garment where price>=1300 and price<=1800
- select max(price) from garment where size = ‘XL’ or size=’L’
- select sum(price)/count(price) from garment;
Ans.
1. select sum(price) from garment where price between 1300 and price 1800;
2. select max(price) from garment where size in (‘XL’,’L’);
3. select avg(price) from garment;
[5] Consider the table – Garment and write the following queries:
- Display the Minimum price of the Garment.
- Count and display the number of GARMENT from each SIZE where number of GARMENTS are more than 1.
- Display the sum of price of each color garment
Ans.
1. select min(price) from garment;
2. select count(*) from garment group by size having count(*)>1;
3. select sum(price) from garment group by colour;
[6] Write output of the following:
- select power(length(substr(“Salam India”,-5)),0);
- select round(power(instr(“Informatics Practices”,’for’),-3),2);
- select mod(length(“Jai Hind”),9);
Ans.:
1. power(length(substr(“Salam India”,-5)),0)
———————————————
1
2. round(power(instr(“Informatics Practices”,’for’),-3),2)
———————————————————-
0.04
3. mod(length(“Jai Hind”),9);
———————————-
8
[7] Consider the table – friends
| ID | Salary | Designation | Subject | School |
| 1 | 95000 | PGT | Physics | Delhi Public School |
| 2 | 75000 | TGT | Maths | Army Public School |
| 3 | 65000 | PGT | Chemistry | Jawahar Navodaya Vidyalaya |
| 4 | 80000 | PGT | Maths | Delhi Public School |
| 5 | 50000 | TGT | Maths | Jawahar Navodaya Vidyalaya |
| 6 | 45000 | TGT | Science | Army Public School |
| 7 | 48000 | TGT | Maths | Jawahar Navodaya Vidyalaya |
- Display the total salary received by each designation.
- Display the Maximum Salary of Maths subject friends
- Display the Total Number of freinds working in Army public school
Ans.
1. select designation,sum(salary) from friends group by designation;
2. select max(salary) from friends where subject=’Maths’;
3. select count(designation) from friends where school=’Army Public School’;
[8] Name the SQL command used for the following:
- To add new record
- To remove a record
- To change the name of a column
- To change the database
- To display records
- To edit records
Ans.:
1. insert into
2. delete from
3. alter table
4. use
5. select
6. update
[9] Explain the difference between each and justify using an example for each.
- DAY() and DAYNAME()
- MONTH() and MONTHNAME()
- INSTR() and SUBSTR()
Ans.:
1. The day() function returns day part of the given date where dayname() returns name of day like Sunday or Monday etc.
2. The month() returns the month number from where as monthname() returns the name of month like January, February etc.
3. Instr() returns the position of the given text into the original text where substr() display the text from given text from specific characters to specified number of characters.
[10] Binal has joined as a trainee in a database company. While working with real-time data, he has few queries: As a senior, help him name the functions to clear his queries and explain the difference among them:
- A function that returns a constant time that indicate’s the time at which the statement began to execute
- A function that returns exact time at which it executes.
- A function that returns the current date only and not the time.
Ans.
1. now()
2. sysdate()
3. current_date() or curdate()
[11] Sanjana is executing the following queries:
- Select length(trim(“##CBSE Term 2 Exam##“));
- Select length(ltrim(“##CBSE Term 2 Exam###“));
- Select length(rtrim(“###CBSE Term 2 Exam##“));
The # sign is used to denotes the space. He got the output for the commands are as follows:
- Predict the output for above queries
- Explain the reason for above output to Sanjana
Ans.:
1. Command 1 will give the output as 16, where as Command 2 and Command 3 as as 19.
2. The trim function ignores the spaces from the beginning and end of the specified text. Ltrim removes leading spaces from the text where as rtrim function removes the trailing spaces.
[12] Consider “Winners never quit”. Write the queries for the following tasks.
- Write a command to display “quit”.
- Write a command to display number of characters in the string.
- Write a command to check the first occurrence of letter ‘n’
Ans.:
1. select substr(“Winners never quit”,-4);
OR
select substr(“Winners never quit”,14);
You can also use mid function as well.
2. select length(“Winners never quit”)
3. select instr(“Winners never quit”,’n’)
[13] What will be the output of the following queries?
- SELECT UPPER(‘winners never quit’);
- SELECT substr(‘winners never quit’,-9,4);
- SELECT Right(‘winners never quit’,4);
Ans.:
1. UPPER(‘winners never quit’)
——————————-
WINNERS NEVER QUIT
2. substr(‘winners never quit’,-9,4)
————————————-
ever
3. Right(‘winners never quit’,4)
——————————–
quit
[14] Consider the following table stduent and write answer of the following questions:
| No | Name | Age | Department | Dateofadm | Fees | Gender |
| 1 | Bhumin | 16 | Computer | 2006/06/01 | 35000 | M |
| 2 | Selina | 15 | Commerce | 2008/04/02 | 25000 | F |
| 3 | Deep | 15 | Commerce | 2010/03/23 | 45000 | M |
| 4 | Santosh | 17 | Physics | 2006/07/04 | 38000 | M |
| 5 | Rutu | 15 | Biology | 2009/05/25 | 23000 | F |
| 6 | Dharti | 17 | Fine Arts | 2008/04/20 | 27000 | F |
| 7 | Veer | 16 | Computer | 2007/06/15 | 25000 | M |
[1] Display square of age that got admission in the month of June.
Ans.: select power(age,2) from student where month(dateofadm)=6;
OR
select power(age,2) from stduent where dateofadm like ‘%/06/%’;
[2] Divide age the by 2 and display the output with 2 decimal places along with name and department.
Ans. select name, department, round(age/2) from student;
[3] Display unique departments in capital letters.
Ans. select upper(distinct(department)) from student;
[4] Display the name from 3rd letter to 6th letter along with age and department who admitted after 1997.
Ans. select substr(name,3,4),age,department from student where year(dateofadm)>1997;
[5] Display the name, admission date and fees whose name is 6 letters long.
Ans. select name,dateofadm,fees from student where name like ‘______’;
OR
select name,dateofadm,fees from student where length(name)=6;
[6] Display the total number of years for all students from the table and rename the heading as years in school.
Ans. select 2022-year(dateofadm) “Years in school” from student;
[7] Display name, department and month name in which they got admission for all students.
Ans. select name,department, monthname(dateofadm) from student;
[8] Display name and subtract today’s day from date of admission day.
Ans. select name, day(now())-day(dateofadm) from student;
[9] Display no, name, and day name for students whose name contains ‘ha’.
Ans. select no,name,dayname(dateofadm) from student where name like ‘%ha%’;
[10] Display the most senior student and most junior student’ age.
Ans. select max(age), min(age) from student’
[11] Display maximum age for each department.
Ans. select max(age) from student group by deparment;
[12] Display young age for each gender.
Ans. select gender,min(age) from student group by gender;
[13] Display total number of student for each department and display the report where no. of students are more than 2.
Ans. select department, count(no) from student group by deprtment having count(no)>2;
[14] Display the details of students in descending order of age.
Ans. select * from student order by age desc;
[15] Display the details of students according to youngest to oldest.
Ans. select * from student order by age;
Watch this video for more understanding:
Unit 3 Introduction to Computer Network
In this section, you will find important questions from Introduction to a computer network for Informatics practices 065 class 12. Here we go!
MCQs Introduction to Computer Networks Class 12 IP
So let us begin with MCQs for the topic Introduction to Computer networks Class 12 IP.
[1] A computer network created by connecting the computers of your school’s computer lab is an example of
a) LAN
b) MAN
c) WAN
d) PAN
Ans. a) LAN
[2] If different branches of a hospital in different state capitals are connected together, which type of network it forms?
a) LAN
b) MAN
c) WAN
d) None of the above
Ans. c) WAN
[3[ Which of the following covers a geographical area like a city or town?
a) LAN
b) MAN
c) WAN
d) PAN
Ans. b) MAN
[4] The Internet is an example of
a) LAN
b) MAN
c) WAN
d) PAN
Ans.: c) WAN
[5] Nishtha is preparing for her IP board exams. She is confused about the types of URL. Select the appropriate option and help her to understand.
a) Absolute & Relative
b) Static & Dynamic
c) Absolute & Dynamic
d) Physical & Relative
Ans. a) Absolute & Relative
[6] Rajesh is working as a lab technician in a school. He needs to install a web browser in school computers. Help him in choosing the best browser for computers:
a) Google Chrome
b) Apple Safari
c) Opera Mini
d) UC Browser
Ans.: a) Google Chrome
[7] Assertion (A): Each website has a unique address called URL.
Reasoning (R): It is Unified Resource Locator and a correct example is
https://ncert.nic.in/textbook.php?leip1=5-7
Ans.: c) A is True , R is False
[8] Jyoti is searching for a device that is used to regenerate the signals over long-distance data transmission:
a) switch
b) modem
c) Repeater
d) None of the above
Ans.: c) Repeater
[9] Suhas wants to make video and voice calls to his clients staying abroad. Which protocol help him to accomplish his task?
a) HTTP
b) VoIP
c) Video Chat
d) SMTP
Ans.: b) VoIP
[10] Udit is attempting an online test where he has been given a question URL that stands for what? Select an appropriate option and help him.
a) Universal Resource Locator
b) Uniform Resource Locator
c) Universal Range Limit
d) None of the above
Ans.: b) Uniform Resource Locator
[11] The device used to connect two networks using different protocols is:
a) Router
b) Repeater
c) Gateway
d) Hub
Ans.: c) Gateway
[12] Which one is incorrect about MAC address?
a) It is the Physical Address of any device connected to the internet.
b) Anyone can change the MAC address of a device.
c) It is the address of the NIC card installed in the network device.
d) It is used to track the user over the Internet
Ans.: b) Anyone can change the MAC address of a device
[13] Assertion (A):- VoIP makes audio and video calls possible from any internet-connected device having a microphone and speakers.
Reasoning (R):- VoIP is possible if both caller and receiver have the right software and hardware to speak to one another.
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) A is True but R is False
d) A is false but R is True
Ans.: a) Both A and R are true and R is the correct explanation for A
[14] Ankit is preparing for a network engineer interview. He asked his friend to make questions for him. His friend asked him which of the following is not network topology.
a) Star
b) Mesh
c) Firewall
d) Tree
Ans.: c) Firewall
[15] Ram is a network analyst in a multination company. His boss asked him to prepare a network layout that uses fewer wires. Suggest to him the best topology to accomplish this task.
a) Bus
b) Star
c) Ring
d) Hybrid
Ans.: a) Bus
[16] A group of two or more similar things or people interconnected with each other is called _________
a) Group
b) Community
c) Collection
d) Network
Ans.: a) Network
[17] Which of the following is not a benefit of a network?
a) Sharing information
b) Sharing resources
c) Sharing Usernames and Passwords
d) Communication
Ans.: c) Sharing Usernames and Passwords
[18] Apart from computers networks include
a) Office Staff
b) Networking devices like a switch, routers, modem
c) Packets
d) Sockets
Ans.: b) Networking devices like switch, routers, modem
[19] In network communications packets refers to ______________
a) layout of the network
b) set of rules to establish the network
c) media used in the network
d) data divided into small chunks
Ans.d) data divided into small chunks
[20] In a communication network, each device that is part of a network and that can receive, create, store, or sends data to do different network routes is called ____________
a) Network Path
b) URL
c) Node
d) Communication Media
Ans.: c) Node
[21] Which of the following cannot be a node in the network?
a) WiMAX
b) Hub
c) Router
d) Server
Ans.: a) WiMAX
[22] Which of the following is comparatively secure network access among all kinds of networks?
a) WAN
b) MAN
c) LAN
d) None
Ans.: c) LAN
[23] The data transfer in LAN generally ranges from
a) 10 to 50 Mbps
b) 10 to 100 Mbps
c) 10 to 500 Mbps
d) 10 to 1 Gbps
Ans.d) 10 to 1 Gbps
[24] Mbps stands for
a) Megabits Per Second
b) Mega Bytes Per Second
c) Mega Binary Per Second
d) Mega Billion Per Second
Ans.: a) Megabits Per Second
[25] ______________ is a set of rules that decides how computers and other devices connect with each other through cables in a local area network or LAN.
a) Communication
b) Topology
c) Ethernet
d) Firewall
Ans.: c) Ethernet
[26] State True or False – “Data transfer rate in MAN network is high as compared to MAN network. “
Ans.: False
[27] Modem Stands for ________________
a) Modulate Demodulate
b) Modulator Demodulator
c) Modulation Demodulation
d) Modules Demodules
Ans.: b) Modulatoe Demodulator
[28] The modulator connected to sender’s end acts as
a) Client
b) Server
c) demodulator
d) modulator
Ans.: d) modulator
[29] The modem at the receiver’s end acts as a
a) Client
b) Server
c) demodulator
d) modulator
Ans.: c) demodulator
[29] Mehul wants to connect his personal computer with his office LAN. He is confused about which device is used to set up a wired network from his computer, help him to do the same.
a) HDD
b) NIC
c) RAM
d) CPU
Ans.: c) demodulator
[30] Select the correct statements about NIC:
i) Can act as an interface between computer and network
ii) It is a circuit board mounted on the motherboard
iii) Coaxial/Ethernet cable directly connects to NIC
iv) Each NIC has its unique Address
a) Only i
b) i), ii) and iii)
c) i) and ii)
d) All of the above
Ans.: d) All of the above
[31] In general network, signals can travel up to _______________
a) 1m
b) 10m
c) 100m
d) 500m
Ans.: c) 100m
[32] Select correct statements for the hub
a) It extracts the destination address from data packet
b) It sends signal to only the intended node
c) It drops the noisy or corrupted signals
d) If data from two devices come across they will collide
Ans.: d) If data from two devices come across they will collide
[33] Nirali wants to connect a local area network to the internet. Suggest her best device out of the following:
a) bridge
b) router
c) switch
d) repeater
Ans.: b) router
[34] The gateway has _________________, usually integrated with it.
a) firewall
b) router
c) Internal modem
d) router
Ans.: b) firewall
[35] To build a fully connected mesh topology of n nodes, how many wires are required?
a) n
b) n-1
c) n(n-1)
d) n(n-1)/2
Ans.: d) n(n-1)/2
[36] Arjun wants to connect 10 computers with fully connected mesh topology, how many wires are required?
a) 45
b) 50
c) 55
d) 100
Ans.: a) 45
[37] In which of the following topology the link is unidirectional?
a) star
b) bus
c) ring
d) mesh
Ans.: c) ring
[38] Which of the following is not an application of the internet?
a) WWW
b) Email
c) Chat
d) Firewall
Ans.: d) Firewall
[39] Which of the following statements correct about WWW
a) It is an ocean of information
b) Firewall must be required to access information
c) A browser is a part of WWW
d) It was invented by Brett Lee
Ans.: a) it is an ocean of information
[40] Which of the following is not a fundamental technology that led to the creation of the web?
a) HTML
b) URI
c) Email
d) HTTP
Ans.: c) Email
[41] Which of the following is not a popular search engine?
a) Google
b) Facebook
c) Yahoo
d) Bing
Ans.: b) Facebook
[42] Which of the following is the most popular email service provider?
a) gmail
b) facebook
c) linkedin
d) ChatGPT
Ans.: a) gmail
[43] Which of the following is the more popular chat application?
a) ChatGPT
b) Slack
c) Google Map
d) None
Ans.: b) Slack
[44] _____ will be displayed when the website is launched.
a) Startup Page
b) Splash Screen
c) Home Page
d) Front Page
Ans.: c) Home Page
[45] Nishant has started a business. Now he wants to sell his products online. Which of the following is helpful for him with his own online infrastructure?
a) Website
b) Network
c) Selling on social media
d) Selling on Amazon
Ans.: a) Website
[45] State True or False – “A website design should be user-friendly and provide information to users with minimum effort.”
Ans.: True
[46] Basic structure of web site is created using
a) MS Word
b) C++
c) HTML and CSS
d) MS Excel
Ans.: c) HTML and CSS
[47] CSS stands for ____________________
a) Character Style Sheet
b) Cascading Style Sheet
c) Cross Style Sheet
d) Core Style Sheet
Ans.: b) Cascading Style Sheet
[48] Which of the most popular and commonly used scripting languages?
a) Python Script
b) Web Script
c) Java Script
d) C++ Script
Ans.: c) Java Script
[49] A web page can be ________________ or _____________
a) Absolute, Relative
b) Static, Dynamic
c) Absolute, Dynamic
d) Physical, Relative
Ans.: b) Static, Dynamic
[50] Select the correct statement about static webpage:
a) Webpage can be different for different users
b) Server may perform some additional information
c) They are more complex
d) Static web pages are generally written in HTML, JavaScript or CSS
Ans.: d) Static web pages are generally written in HTML, JavaScript or CSS
[51] A ________________ is used to store and deliver the contents of a website to clients such as a browser that requests it.
a) Web Page
b) Home Page
c) Web Server
d) WebSite
Ans.: c) Web server
[52] When the web server is not able to locate the page, it sends a page containing an error message. Identify this error:
a) 400 Bad Syntax
b) 404 Not Found
c) 408 Request Timed out
d) 410 Gone
Ans.: b) 404 Not Found
[53] _______ is a service that allows us to put a website or a web page onto the Internet, and make it a part of the World Wide Web.
a) web browser
b) web server
c) word wide web
d) web hosting
Ans.: d) web hosting
[54] __________ is a service that does the mapping between domain name and IP address.
a) Domain Name System (DNS)
b) Top Level Domain
c) Protocol
d) Absolute/Relative Path
Ans.: d) web hosting
[55] A ____________ is a software application that helps us to view the web page(s).
a) Web hosting
b) Web Browser
c) Web Server
d) Web Page
Ans.: b) Web Browser
[56] Which was the first web browser?
a) Mosaic
b) Opera
c) Apple Safari
d) Google Chrome
Ans.: a) Mosaic
[57] A _____________ is a complete program or may be a third-party software.
a) Add on
b) Extension
c) Plug in
d) App
Ans.: c) Plug in
[58] Add-on is also referred as
a) Plug in
b) App
c) Adware
d) Extension
Ans.: d) Extension
[59] Which of the following is a text file, containing a string of information, which is transferred by the website to the browser when we browse it?
a) cookies
b) script
c) program
d) session
Ans.: a) coockeis
[60] State True or False – “Cookies are usually harmful.”
Ans.: False
Introduction to Computer Networks Class XII IP 2 Marks Questions
[1] A school with 20 stand-alone computers is considering networking them together and adding a server. State 2 advantages of doing this.
Ans.:
1. Sharing resources
2. Sharing of internet
3. Cost Factor
4. Security
[2] Distinguish between LAN and WAN.
Ans.:
Local Area Network (LAN) : It covers limited geographical area such one building, single floor, single room etc. The connectivity is done wires or wireless. Data transfer is quite high in LAN.
Wide Area Network (WAN): It covers wide range of geographical area around the world such as country or countries. It can connect LAN to other LANs. It used by large business, educational and government organizations connect their different branches. It connects billions of computers. smartphones and millions of LANs from different countinents.
[3] What is the purpose of Modem in network ?
Ans. : Modem is used to connect the stand alone computer to internet through telephone line. It converts analog signals to digital signals and vice versa.
[4] Define ‘Domain Name Resolution’.
Ans.: Domain Name Resolution refers to the process of mapping IP address to domain name. In other words the task of converting domain names into corrersponding IP address is known as Domain Name Resolution.
[5] Illustrate the layout for connecting 5 computers in a Bus and a Star topology of Networks.
Star Topology


[6] State one way with which an online shopper can be sure that he/she is using a secure website.
Ans.: There are two ways where Online shopper can ensure that he/she is using a secure website:
1. A lock icon before the URL in address
2. URL starts with https
[7] Expand:
(i) POP3 (ii) SMTP (iii) VolP (iv) HTTP
Ans.
(i) POP3: Post Office Protocol
(ii) SMTP: Simple Mail Transfer Protocol
(iii) VoIP: Voice Over Internet Protocol
(iv) HTTP: Hyper Text Transfer Protocol
[8] A CEO of a car manufacturing company ElectroCars Ltd. located at Mumbai wants to have an annual meeting with his counterparts located at Delhi and Chennai where he would like to show as well as see and discuss the presentations prepared at the three locations for the financial year. Which communication technology out of the following is best suited for taking such an online demonstration ?
(i) Chat (ii) Teleconferencing (iii) Video Conferencing
Ans.
(iii) Video Conferencing
[9] What kind of data gets stored in cookies and how is it useful?
Ans.:
A cookie generally contains 2 bits of data: ID for every user, and a website name.
Cookies alter websites to retrieve this information after you return them, in order that they’ll keep in mind you and your preferences and tailor page content for you supported this information.
[10] State the reason why star topology requires more cable length than bus topology.
Ans.:
Star topology requires more cable length than bus topology because in bus topology all devices are connected with a single line cable where as in star topology each device is connected with central device with different cables. So more cables requried to connect them all.
[11] Seema needs a network device that should regenerate the signal over the same network before the signal becomes too weak or corrupted. Amit needs a network device to connect two different networks together that work upon different networking models so that two networks can communicate properly.
Ans.:
Seema can use repeater and Amit can use gateway
[12] How is the domain name related to IP address?
Ans.:
IP address is a logical numerical address for a website. It is very difficult to remember numbers for users. Where as domain names consists of letters and symbols which is easy to remember for users. Every domain name can only be resolved to one IP address.
[13] What happens to the Network with Star topology if the following happens :
- One of the computers on the network fails?
- The central hub or switch to which all computers are connected, fails ?
Ans.:
1. If one of the computers on the network falls in Star topology then it doesn’t affect that much except that computer which fails didnot respond.
2. If the central hub or switch fails in star topology then it affects the entire network and entire network fails.
[14] Write the purpose of HTTP.
Ans.:
This protocol is designed to transfer information between computers over WWW. It transfer the information like document, file, image, video between computers over internet.
[15] Write the purpose of the following devices : Router, Modem
Ans.:
A router forms networks and manages the flow of data within and between those networks, while a modem connects those networks to the Internet. Modems forge a connection to the Internet by converting signals from an ISP into a digital signal that can be interpreted by any connected device.
[16] Name any two private Internet Service Providers (company) in India.
Ans.:
1 Jio
2 Vodafone (Vi)
[17] Pratima is an IT expert and a freelancer. She undertakes those jobs, which are related to setting up security software/tools and managing networks in various companies. If we name her role in these companies, what it will be out of the following and justify the reason:
(i) Cracker (ii) Network Admin (iii) Hacker (iv) Operator
Ans.:
(ii) Network Admin
Network Admin is responsible for setting u software/tools and managing networks and cofigure all the devices used in the network. In addition to this network admin also configures the roles of users in the network and server control.
[18] Kamakshi Ltd. Company wants to link its computers in the Head office in New Delhi to its office in Sydney. Name the type of Network that will be formed. Which device should be used to form this Network ?
Ans.:
The network that will be formed is WAN.
To form this network router can should be used.
[19] Name the devices :
- This device constantly looks at all the data entering and exiting your connection. It can block or reject data in response to an established rule.
- This device connects multiple nodes to form a network. It redirects the received information only to the intended node(s).
Ans.:
1. Firewall
2. Switch
[20] Differentiate between Bus Topology and Star Topology of Networks. What are the advantages and disadvantages of Star Topology over Bus Topology ?
Ans.:
In bus topology all the devices are connected through a single cable where as in star topology all the devices are connected with a central device such as hub or switch.
Advantages:
(i) Easy fault detection
(ii) If one system fails doen’t affect the network
Disadvantages:
(i) Requires more cable length
(ii) If hub or switch or server fails, entire network fails
[21] Atul is learning the topic of types of networks. He is confused about which type of network formed by the following:
- A network formed between computers across the continent
- A network formed between computers on the university campus
Ans.:
1. WAN
2. LAN/CAN
[22] Identify the smallest and largest network out of these and write an example of each of them:
LAN, MAN, WAN, PAN, CAN
Ans.:
Smallest Network: PAN, Example: Two teachers are sharing marking scheme using bluetooth by their mobiles.
Largest Network: WAN, A company transer important files between two countries offices
[23] Match the following devices functions:
| 1 | Modem | A | Connect the different networks together that work upon different networking models | ||
| 2 | Gateway | B | Regenerate the signal over the same network before the signal becomes too weak or corrupted | ||
| 3 | Repeater | C | Converts analogue signals to digital signals and vice versa | ||
| 4 | Hub | D | Connect multiple devices in a network and send information to all nodes |
Ans. :
1 – C
2 – A
3 – B
4 – D
[24] Parul is learning topic network topologies. Identify the following topologies:
- All devices are connected with the same cable
- A central device is connected with all devices
- Every node has a dedicated point-to-point link to every other node
- A topology which is a combination of star and bus topology
Ans.:
1. Bus
2. Star
3. Mesh
4. Tree
[25] Arun is going to select a network topology for his company. Suggest him the topology from the following hints:
(i) He needs to maximise the speed maximise the speeds and make each computer independent.
(ii) A topology which contains a backbone cable running through the whole length.
Ans.:
(i) Star Topology
(ii) Bus Topology
[26] Bhumin wants to know about the hub. Explain the device with its type to him in short.
Ans.:
Hub is a central devices which connects multiple nodes into the same network. It is boradcasted device which sends the information to all the connected devices in the network hence generate more traffic. There are two types of network:
1. Active Hub: Amplifies the signal from device to device like repeater
2. Passive Hub: Passes the signal from one device to another
[27] Explain the types of repeaters in short.
Ans.:
1. Amplifier: It amplifies or boost the incoming signal and any concurrent noise.
2. Signal Repeater: It only amplifies the signal and filter out the noise signals and enhance the signal clarity to the reciever end.
Unit 3 Introduction to computer networks 5 marks questions
[1] Biswas Enterprise is starting its first regional office in Baroda, Gujarat. And a branch office in Bhruch. Bharuch office has three units Admin, HR and Sales in the 2 Km Area. As a network admin, you need to suggest the network plan as per (i) to (iv) to the leaders keeping in mind the distances and other parameters:

The approximate distance between these units are as follows:
| HR to Admin | 70 M | ||
| HR to Sales | 50 M | ||
| Admin to Sales | 100 M | ||
| Baroda Office to Bharuch Office | 95 KM |
The number of computers installed in each unit are:
| HR | 30 |
| Admin | 50 |
| Sales | 20 |
| Baroda | 10 |
(i) Suggest the best suitable cable layout for the given case to connect each unit of the Bharuch office.
(ii) Suggest the most suitable place to install the server and specify the reason.
(iii) Which device is out of the following to be installed in each unit of the Bharuch office?
Router, Repeater, Swich, Modem
(iv) Which topology is best for each unit of the Bharuch Office?
Bus, Star, Tree, Mesh
(v) Which type of network is formed between the following:
(a) HR to Admin Unit
(b) Baroda office to Bharuch Office
(vi) Suggest a suitable technology to access the internet at various units of Bharuch Office.
(vii) Suggest the best option to connect the Baroda office with the Bharuch office’s units.
(viii) Suggest a device/software to provide security for the entire network of Bharuch Office.
(ix) Company wants to arrange online meetings frequently throughout the year. Suggest anyone online video conferencing software/app and protocol used for the software.
(x) Company has launched its R & D department office in USA. They want to connect this office network with Baroda office. Suggest the best way to connect them.
(xi) Which device is used to share dedicated bandwidth in LAN?
(xii) Company want to add one more unit at the Bharuch office. This unit is away from Admin unit and the cables can be spread through the Narmada River. Suggest best options for :
(a) Cables to connect these units across the river Narmada
(b) Device to extend the network
(c) In this unit they want to connect the internet line with their telephone. Suggest a device which can be used to establish an internet connection through telephone.
Answers:
(i)

(ii) Admin unit is the most suitable place to install a server as it has a maximum number of computers.
(iii) Switch can be used to connect all the devices of the Bharuch office.
(iv) Star topology is best for each unit of the Bharuch Office.
(v) (a) LAN (b) WAN
(vi) Broadband
(vii) Sattelite is the best option to connect Baroda office and Bharuch office units.
(viii) Firewall
(ix) Software: Skype, Zoom, Google Meet, Webex & Protocol : VoIP
(x) Satellite
(xi) Switch
(xii) (a) Fibre Optic Cables
(b) Repeater
(c) Modem
Unit 4 Societal Impacts
In the next section of Most expected questions IP Class 12 we will see questions from Unit 4 Societal Impacts. So let us begin!
MCQs Societal Impacts Class 12
In this section of Most expected questions IP Class 12, we will discuss questions from Unit 4 Societal Impacts. Let us begin with 1 mark MCQs.
[1] Parul is surfing the Internet using smartphones where she left a trail of data reflecting the activities performed by her online. This trail of data is known as ______________
a) Data print
b) Digital Activity
c) Digital footprint
d) Digital print
Ans.: c) Digital Footprint
[2] Stealing someone’s intellectual work and representing it as another person’s work is known as _____.
a) Phishing
b) Spamming
c) plagiarism
d) hacking
Ans.: c) plagiarism
[3] Free software provides
a) Freedom to run the program for any purpose
b) Freedom to study and adapt its needs
c) Freedom to redistribute and improve the program
d) All of the these
Ans.: d) All of these
[4] Observe the given options and identify the option which violates IPR:
a) Licensing
b) Digital Footprint
c) GPL
d) Plagiarism
Ans.: d Plagiarism
[5] Unsolicited commercial emails is known as …………..
a) Spam
b) Malware
c) Virus
d) Worms
Ans.: a) Spam
[6] Identify the organization responsible for E-Waste management in India
a) NITI Aayog
b) Ministry of Commerce
c) Central Pollution Control Board
d) National Green Tribunal
Ans. : c) Central Pollution Control Board
[7] Which of the following is not protected by copyright and available to everyone is categorized as:
a) Proprietary
b) Open Source
c) Patent
d) Plagiarism
Ans.: b) Open Source
[8] Which of the following is not a cybercrime?
a) Unauthorized account access
b) Mass attack using Trojans as botnets
c) Email spoofing and spamming
d) Report vulnerability in any system
Ans.: d) Report vulnerability in any system
[9] What is meant by the term ‘cyber crime’?
a) Any crime that uses computers to jeopardize or attempt to jeopardize national security
b) The use of computer networks to commit financial or identity fraud
c) The theft of digital information
d) Any crime that involves computers and networks
Ans.:d) Any crime that involves computers and networks
[10] Ankit is working in an organization that purchases new computers every year and dumps the old ones into the local dumping yard. Select an appropriate category of waste created, out of the following options:
a) Artificial waste
b) Computerized waste
c) E-waste
d) Natural Waste
Ans.: c) E-Waste
[11] ______ are the attempts by individuals to obtain confidential information from you through a clone or similar kind of interface of website and URL.
a) Pharming
b) Cloning
c) Spamming
d) Phishing
Ans.: d) Phishing
[12] Karishma sets up her own company to sell her own range of clothes on social media platforms. What type of intellectual property can she use to show that the clothes are made by her company only?
a) Patents
b) Copyright
c) Trademark
d) Design
Ans.: c) Trademark
[13] Some etiquettes followed while using the internet is called Net Etiquette. Which of the following is/are Net Etiquette(s)?
a) Be Ethical
b) Be Responsible
c) Be Respectful
d) All of these
Ans.: d) All of these
[14] Akshat is fraudulently acquiring someone’s personal and private information, such as online account names, login information, and password, Here Akshat is doing
a) Phishing
b) Identity Theft
c) Plagiarism
d) all the above
Ans.: b) Identity Theft
[15] Purva got a link in a WhatsApp group that diverts her to a bogus site. This type of activity is known as _______
a) Phishing
b) Spoofing
c) Eavesdropping
d) Pharming
Ans.: d) Pharming
[16] Assertion (A): – E-waste cause of Damage to the immune system, Skin disease, Multi ailments and Skin problems.
Reasoning (R):- Mostly all electronic waste comprises of toxic chemicals such as lead, beryllium, mercury etc.
Ans.: a) Both A and R are True and R is correct explanation for A
[17] Assertion(A): Digital footprint is the trail of data we leave behind when we visit any website (or use any online application or portal) to fill-in data or perform any transaction.
Reason(R): While online, all of us need to be aware of how to conduct ourselves, how best to relate with others and what ethics, morals and values to maintain.
Ans.: b) Both A and R are true but R is not correct explanation for A
[18] The information/art/work that exists in digital form is called________.
a) job work
b) computerized property
c) digital property
d) e-property
Ans.: c) digital property
[19] Legal term to describe the right of creator of original creative or artistic work is called_____.
a) Copyright
b) Copyleft
c) GPL
d) Trademark
[20] Rajesh received an email warning him of closure of his bank accounts if he did not update his banking information as soon as possible. He clicked the link in the email and entered his banking information. Next he got to know that he was duped. This is an example of __________ .
a) Online Fraud
b) Identity Theft
c) Plagiarism
d) Phishing
[21] Assertion (A):- VoIP makes audio and video calls possible from any internet connected device having a microphone and speakers.
Reasoning (R):- VoIP is possible if both caller and receiver have the right software and hardware to speak to one another
[22] An online activity that enables us to publish website or web application on the internet
a) Web server
b) Web Browser
c) Web Hosting
d) None
[23] Violating the intellectual property rights of a copyright holder is known as
a) Encryption
b) Digital footprint
c) Offline phishing
d) Copyright infringement
[24] Which of the following activity is an example for Active digital footprint?
a) Surfing internet
b) Apps and websites that use geolocation to pinpoint your location
c) Agreeing to install cookies on your devices when prompted by the browser d) None of the above
[25] Assertion(A) : Incognito browsing opens up a version of the browser that will track your activity
Reasoning(R) : Incognito browsing is useful when entering sensitive data
[26] State TRUE or FALSE against the following statement –
“Cyber-laws are incorporated for punishing all criminals only.”
[27] Which of the following is an example of e-waste?
a) empty soda can
b) Old clothes
c) an old computer
d) a ripened banana
[28] Online textual talk is called ______________
a) Video Conference
b) Chat
c) Text Phone
d) Telephony
I hope this article will help you to prepare for the CBSE informatics practices board exam. If you have doubts or queries related to any topic feel free to ask in the comment section.
Thank you for visiting my blog.