QB Ip 12-1
QB Ip 12-1
CLASS-XII
1 mark questions
1.
42. Which of the following keywords will you use in the following query to display all the records of
students whose name start with S?
Ans: SELECT * from student where name like “S%”.
43. ________________________ is any information about you or created by you that exists in digital
form, either online or on an electronic storage device.
Ans: Digital Property
46. Online personal accounts like Paytm account, Phonepe account etc. are examples of ______.
Ans: Digital Wallets
49. Name the type of Network that is limited to the proximity of an individual and covers a range up to
10-20 meter of distance.
Ans: PAN
50. Which laws have been incorporated for punishing all types of crimes that are done on
Computer/phones or over internet?
Ans: Cyber laws
56. Rohan wants to print the row labels of the dataframe. He should use the __________ attribute of
a dataframe.
Ans: Index
57. _______ websites are ones that are fixed and display the same content for every user, usually
written exclusively in HTML.
Ans: Static
58. Which of the network topology can be a preferred for a company that would like to keep
adding more and more computers to the topology economically as they grow?
Ans: Tree/Star.
59. What is the maximum number of years that a patent would be valid in India?
Ans: 20 years.
60. The networking device that forwards data packets between computer network is
__________.
Ans: Router
61. Write the expansion of the following terms
(a) HTTP (b) URL
Ans. a.) Hyper Text Transfer Protocol b.) Uniform Resource Locator
62. Give any two examples of e-waste.
Ans: telecommunications and TV equipment. - Computers. - Laptops. - Printers. - Mobile phones. -
Televisions.(any two)
63. A mail or message sent to a large number of people indiscriminately without their consent is
called ______________
Ans. Spam
64. Plagiarism is a cybercrime under Indian IT Act. (True / False)
Ans: False
65. Write the command to delete all the data of the table ‘activity’ retaining only structure.
Ans: Delete from activity;
66. Which networking device with similar functionality can be used to replace a hub?
Ans: Switch
67. Give one disadvantage of Open Source Software.
Ans: 1. Some open source applications may be tricky to set up
2.Compatibility issues - Many types of proprietary hardware need specialised drivers to run
open source programs, which are often only available from the equipment .
68. Statement import pyplot.matplotlib is a valid statement for working on pyplot functions. (True /
False).
Ans: False
69. State whether True or False:
a. A worm is a self-replicating program.
b. Firewall can be implemented in software as well as in hardware.
Ans: a.) True
b.) True
72. Given a Pandas series called Sequences, the command which will display the last 7 rows is
_______________.
Ans: print(Sequences.tail(7)).
74. In Pandas, _________ function will return the total number of rows in a dataframe.
Ans: len()
77. Write the SQL command that removes leading and trailing spaces from a given string.
Ans: Select Trim()
78. The _______ topology has a central controller.
Ans: Star
80. For web pages where the information is changed frequently, for example, stock prices, weather
information which out of the following options would you advise?
a) Static web page
b) Dynamic web page
Ans: Dynamic web page
82 Using Python Matplotlib histograms can be used to count how many values fall into each
interval. Each interval is known as
a. hist
b. class
c. bin
d. label
Ans: bin
85. The _______ module of Pyplot lets you draw box plots.
Ans: boxplot()
90. A DataFrame called Grade. Write a command to delete the 3rd and 5th rows of Grade.
Ans. Gr= pd.DataFrame(Grade)
Gr.drop([2,4])
91. Hitesh wants to display the last four rows of the dataframe df and has written the following code:
df.tail()
But last 5 rows are being displayed. Identify the error and rewrite the correct code so that last 4 rows
get displayed.
Ans: df.tail(4)
92. By default ORDER BY clause sorts the result set in descending order.
Ans: False
Write the output of the following SQL queries from Qus 95 to 109.
Ans.
95. 1
96. NEST
97. ATICS
98. January
99. 6
100. 10
101. 600
102. 30
103. 2345
104. fg
105. 50
106. 11
107. 4
108. INGGOOD
109. 14
111. Storing following percentages of 5 students stored in the form of a list with indexes from 1 to 5.
OUTPUT
Ajay Pass and Promoted
Vikash Pass and Promoted
Sunesh Pass and Promoted
Rita Pass and Promoted
Ramya Pass and Promoted
114. Storing numbers from 1 to 5 as indexes and their square values as data.
124. Create a series from the above dictionary and write Python statements for the following:
states={'A':'Andra pradesh','B':'Bihar','D':'Delhi',
'k':'keerla','R':'Rajasthan','T':'Tamil'}
s=pd.Series(states)
states={'A':'Andra pradesh','B':'Bihar','D':'Delhi',
'k':'keerla','R':'Rajasthan','T':'Tamil'}
s=pd.Series(states)
print(s[[0,2,4]])
OUTPUT
A Andra pradesh
D Delhi
R Rajasthan
126. To display all elements from 2nd to 5th present in the series.
states={'A':'Andra pradesh','B':'Bihar','D':'Delhi',
'k':'keerla','R':'Rajasthan','T':'Tamil'}
s=pd.Series(states)
print(s[2:])
OUTPUT
D Delhi
K Keerla
R Rajasthan
T Tamil
states={'A':'Andra pradesh','B':'Bihar','D':'Delhi',
'k':'keerla','R':'Rajasthan','T':'Tamil'}
s=pd.Series(states)
s[[2,5]]='My pride'
print(s)
OUTPUT
A Andra pradesh
B bihar
D My pride
K keerla
R rajasthan
T My pride
i. Write down the command that will give the following output.
EmpNo 5
Name Ram
Quarter1 10000
Quarter2 5800
Quarter3 20000
Quarter4 6000
dtype:object
a. print(df.max)
b. print(df.max())
c. print(df.max(axis=1))
d. print(df.max, axis=1)
ii. The Employer needs to know the Quarterly Revenue by Employee with Emp No -4. Help Employer
to identify the correct set of statement/s from the given options :
a. df1=df[df[‘EmpNo’]==4]
print(df1)
b. df1=df[EmpNo ==4]
print(df1)
c. df1=df[df. EmpNo =4]
print(df1)
d. df1=df[df. EmpNo =4]
print(df1)
iii Which of the following statement(s) will give the exact number of values in each column of the
dataframe?
i. print(df.count()) ii. print(df.count(0))
iii. print(df.count) iv. print(df.count(axis=’index’))
Choose the correct option:
a. both (i) and (ii)
b. only (ii)
c. (i), (ii) and (iii)
d. (i), (ii) and (iv)
iv. Which of the following command will display the column labels of the DataFrame?
a. print(df.columns())
b. print(df.column())
c. print(df.column)
d. print(df.columns)
v. HR wants to add a new column, the scores of APR Grade with the values, ‘ A’, ‘B’, ‘A’, ‘A’, ‘B’ ,to the
DataFrame. Help HR to choose the command to do so:
a. df.column=*’A’,’B’,’A’,’A’,’B’,’A’+
b. df [‘Grade’]=[’A’,’B’,’A’,’A’,’B’,’A’]
c. df.loc*‘Grade’+= *’A’,’B’,’A’,’A’,’B’,’A’+
d. Both (b) and (c) are correct
133. Write down the command that will give the following output.
Empno 5
Name Rohan Malik
Dept HR
Salary 20000
Experience 6
dtype: object
a. print(emp.max)
b. print(emp.max())
c. print(emp.max(axis=1))
d. print(emp.max,axis=1)
Ans. b
134. The CEO needs to know the salary of the employee with empno 4. Help him to
identify the correct set of statement/s from the given options:
a. emp1=emp*emp*‘empno’+==4+
print(emp1)
b. emp1=emp[emp]
print(emp1)
c. emp1=emp[emp.empno=4]
print(emp1)
d. emp1=emp[emp.empno==4]
print(emp1)
Ans a and d
135. Which of the following statement/s will give the exact number of values in each column of
the dataframe?
i. print(emp.count())
ii. print(emp.count(0))
iii. print(emp.count)
iv. print(emp.count(axis=’index’))
136. Which of the following command will display the column labels of the DataFrame?
a. print(emp.columns())
b. print(emp.column())
c. print(emp.column)
d. print(emp.columns)
Consider the following DataFrame df and answer any four questions from (i)- (v)
EmpNo Name Quarter1 Quarter2 Quarter3 Quarter4
EmpNo 5
Name Ram
Quarter1 10000
Quarter2 5800
Quarter3 20000
Quarter4 6000
dtype:object
a. print(df.max)
b. print(df.max())
c. print(df.max(axis=1))
d. print(df.max, axis=1)
138. The Employer needs to know the Quarterly Revenue by Employee with Emp No -4. Help Employer
to identify the correct set of statement/s from the given options :
a. df1=df[df[‘EmpNo’]==4]
print(df1)
b. df1=df[EmpNo ==4]
print(df1)
c. df1=df[df. EmpNo =4]
print(df1)
d. df1=df[df. EmpNo =4]
print(df1)
139. Which of the following statement(s) will give the exact number of values in each column of the
dataframe?
i. print(df.count()) ii. print(df.count(0))
iii. print(df.count) iv. print(df.count(axis=’index’))
Choose the correct option:
a. both (i) and (ii)
b. only (ii)
c. (i), (ii) and (iii)
d. (i), (ii) and (iv)
140. Which of the following command will display the column labels of the DataFrame?
a. print(df.columns())
b. print(df.column())
c. print(df.column)
d. print(df.columns)
141. HR wants to add a new column, the scores of APR Grade with the values, ‘ A’, ‘B’, ‘A’, ‘A’, ‘B’ ,to
the DataFrame. Help HR to choose the command to do so:
a. df.column=*’A’,’B’,’A’,’A’,’B’,’A’+
b. df [‘Grade’]=[’A’,’B’,’A’,’A’,’B’,’A’]
c. df.loc*‘Grade’+= *’A’,’B’,’A’,’A’,’B’,’A’+
d. Both (b) and (c) are correct
a. b.
c. d.
144. Ram has given the following command to obtain the unique (list of destinations) destination from
Flight table .
Select count(DESTINATION) from FLIGHT ; but he is not getting the desired result. Help him by writing
the correct command.
a. Select DESTINATION from FLIGHT ;
b. Select MAX(DESTINATION) from FLIGHT ;
c. Select distinct(DESTINATION) from FLIGHT ;
145. State the command to Count and display number of flights reaching at each destination.
a. select FLCODE ,DESTINATION,NO_FLIGHTS from FLIGHT order by DESTINATION;
b. select count(FLCODE),DESTINATION,NO_FLIGHTS from FLIGHT
c. select count(FLCODE),DESTINATION,NO_FLIGHTS from FLIGHT group by NO_FLIGHTS;
146. Help Ram to write the command to display the maximum no of stops from FLIGHT table.
(iv)69 85
(v) What will be the output produced by following statements?
>>>print(df.iloc[::2,0::4])
(i) name total
T1 kushagra 235
T2 naresh 221
(ii) name total
T2 naresh 221
T4 trapti 242
(iii) name total
T1 kushagra 235
T3 prakhar 241
(iii) name total
T3 prakhar 241
T4 trapti 242
(iii) name total
T1 kushagra 235
T3 prakhar 241
158. Consider the table “ITEM” created in MySQL and given below:
(ii)
15 EARPHONE 399 5 BoAT
9 EARPHONE 750 5 JBL
11 HEADPHONE 700 5 JBL
14 MOBILESTAND 499 5 Lenovo
13 COLLERMIC 288 5 Mi
(iii) Nishuhasgiventhefollowingcommandtoobtainthehighestrateofeveryitem.
Select max(rate)from item where group by name;
But she is not getting the desired result. Help her by writing the correct command.
(i)select name, max(rate)from item where group by name;
(ii)select name, max(rate)from item group by name;
(iii)select max(rate)from item group by model;
(iv)select name, max(rate)from item order by name;
Ans. (ii)select name, max(rate)from item group by name;
(iv) State the command to display the model and the total quantity of every model
Whose total quantity is greater than10is:
a)select name, sum(qty)from item group by model having sum(qty)>10
b)select model, sum(qty)from item group by name havings um(qty)>10
c)select model ,sum(qty)from item group by model having sum(qty)>10
d)select model, sum(qty)from item where qty>10group by model
Choose the correct option:
(i) Both(b)and(c)
(ii) Any of the option(a),(b),and(d)
(iii) Only(c)
(iv) Both(a)and(d)
Ans: (iii)
(v) Help Alankar to write the command to display the name of the headphone of JBL
company:
(i) select*from item where name='%phone' and model='JBL';
(ii) select*from item where name='headphone' and model='JBL';
(iii) select*from item where name like' headphone';
(iv) select*from item where name like '%phone' and model='JBL';
Ans (ii)
159.
(i) Complete the following command to display first five rows of the above Dataframe.
print(happy_df.iloc[_____ : _____]
(ii) Write the command to display number of rows and columns of the above Dataframe.
(a) print(happy_df.row,happy_df.columns)
(b) print(happy_df.shape())
(c) print(happy_df.shape)
(iii) Which command(s) of the following would display only Region column of the above
Dataframe.
(a) print(happy_df.Region)
(b) print(happy_df.iloc*,’Region’+
(c) print(happy_df.iloc* : ,’Region’+
(d) print(happy_df.iloc[:,1])
(iv) What will be the output of the following command?
print(happy_df.loc[4:6,'Country'])
(v) Which of the following commands would display maximum value of every column?
(a) print(happy_df.max)
(b) print(happy_df.max())
(c) print(happy_df.max(axis=1))
(d) print(happy_df.max, axis=1)
Ans: (i) print(happy_df.iloc[0 : 5 ]
(ii) print(df.shape)
(iii) (a) print(happy_df.Region) and (d) print(happy_df.iloc[:,1])
(iv) 4 Canada
5 Finland
6 Netherlands
Name: Country, dtype: object
(v) (b) print(happy_df.max())
160.
(i) Which of the following command will give the latest date for which data is available in
the above table?
(a) SELECT MAX(ODate) FROM cityair;
(b) SELECT MIN(ODate) FROM cityair;
(c) SELECT COUNT(ODate) FROM cityair;
(ii) Which of the following commands will display ‘Mar’ for Date column?
(a) SELECT MONTH(ODate) FROM cityair;
(b) SELECT MONTHNAME(ODate) FROM cityair;
(c) SELECT DATE(ODate) from cityair;
(v) Write a command to delete the data of 1st Mar 2019 in the table.
2 marks questions
161. Write a program to create a Series having 10 random numbers in the range of 10 and
20.
162. What is importance of primary key in a table? How many primary keys can be there for a
table?
166. Explain the working of ORDER BY clause of SELECT query with proper example.
167. Consider a string “AS YOU know MORE”
Write the queries for the following tasks.
(i) Write a command to display “know”.
(ii) Write a command to display number of characters in the string.
168. Consider a string “You Grow more” stored in a column str.
What will be the output of the following queries?
(i) SELECT UPPER(str);
(ii) SELECT substr(str,-9,4);
169. Given here is a Dataframe of Sales data of four months stored with name sales_df.
Ans 163.
TRIM () function is used to remove leading and trailing spaces from a string a table. It
can TRIM () function is used to remove leading and trailing spaces from a string a table. It
can be used as
TRIM(String)
For example;
SELECT TRIM(' bar ');be used as
TRIM(String)
For example;
SELECT TRIM(' bar ');
Ans 164.
(i) Gender column datatype char(1) as all the possible values can be accommodated and
it will be space efficient.
(ii) INSERT INTO Student (Rollno, Sname, Subject, Marks) VALUES (“003”,
”SUMAN”, “IP”, 75);
Ans. 165
(i) s1 = s + 1
print(s1)
(ii) s.add(1,fill_value=0)
print(s)
Ans. 166
The ORDER BY keyword is used to sort the result-set in ascending or descending order.
The ORDER BY keyword sorts the records in ascending order by default. To sort the records in
descending order, use the DESC keyword.
Ans. 167
(i) select mid(“AS YOU know MORE”,8,4);
(ii) select length(“AS YOU know MORE”);
Ans. 168
(i) YOU GROW MORE
(ii) Grow
Ans. 169.
(i) print(sales_df.sum().loc*‘July’+)
(ii) sales_df.insert(4,column="August",value=[70,94,80,93] )
Ans. 170
Advantages of Star Topology
Easy to install and wire.
No disruptions to the network when connecting or removing devices.
Requires more cable length than a linear bus topology.
If the connecting network device (network switch) fails, nodes attached are disabled and cannot
participate in computer network communication.
Ans. 171
Use Respectful Language
Share With Discretion.
Don't Exclude Others.
Choose Friends Wisely.
Don't Email Large Files.
Respect People's Privacy.
Fact Check Before Reposting.
Ans. 172
Cyberbullying is bullying with the use of digital technologies. It can take place on social media,
messaging platforms, gaming platforms and mobile phones. It is repeated behaviour, aimed at scaring,
angering or shaming those who are targeted.
Qus 173
Ans. 173.
Import pandas as pd
S1=pd.Series(*5000,6000,8000,5500+,index=*'UP','MP’,'Gujarat','Delhi'+)
Q. 174
State any two differences between single row functions and multiple row functions.
Ans. Differences between single row functions and multiple row functions.
(i)Single row functions work on one row only where as multiple row functions group rows
(ii)Single row functions return one output per row where as multiple row
Functions return only one output for a specified group of rows.
Q 175. What is the difference between the order by and group by clause? Explain with an example.
Ans.
Group by statement is used to group the rows that have the same value. Whereas Order by
statement sort the result-set either in ascending or in descending order.
Ans 177
i. print(S[S>250])
ii. S.name='Item'
Q 178.
Shailly writes the following commands with respect to a table Employee Having fields,empno,
Name ,department, commission.
Command1:SELECT COUNT(*) FROM EMPLOYEE;
Command2:SELECT COUNT(COMMISSION) FROM EMPLOYEE;
She gets the output as7 for the first command but gets an output 5 for the second command.
Explain the output with justification.
Ans; This is because the column commission contains a NULL value and the Aggregate
functions do not take into account NULL values. Thus Command1 Returns the total number
of records in the table where as Command2 returns The total number of non NULL values
in the column commission.
Q180. Priyansha writes the following commands with respect to a table ‘CABs’ having fields:
Cabno, CabName, Color, Capacity, Charges.
Command1: SELECT COUNT(COLOR) FROM CABS;
Command2: SELECT COUNT(DISTINCT COLOR) FROM CABS;
She gets the output as 4 for the first command but gets an output 3 for the second command.
Explain the output with justification.
Ans: The reason to get the different outputs in both the commands is that the column ‘COLOR’
in the table ‘CABS’ has a duplicate value.
Q186.
Consider a given Series , Subject:
INDEX MARKS
ENGLISH 75
HINDI 78
MATHS 82
SCIENCE 86
Write a program in Python Pandas to create this series.
Q187. What is the difference between the where and having clause when used
along with the select statement? Explain with an example.
Ans.
WHERE Clause:
WHERE Clause is used to filter the records from the table or used while joining more than one
table.Only those records will be extracted who are satisfying the specified condition in WHERE
clause. It can be used with SELECT, UPDATE, DELETE statements
Ans. CHAR is fixed length and VARCHAR is variable length. CHAR always uses the same
amount of storage space per entry, while VARCHAR only uses the amount necessary to
store the actual text. The char is a fixed-length character data type, the varchar is a variable-
length character data type.
Q189. Consider the decimal number x with value 3875.4897. Write commands in SQL to:
Q190. Consider the following Series object, “company” and its profit in Crores.
TCS 300
RELIANCE 200
L&T 800
WIPRO 150
i. Write the command which will display the name of the company having profit>250.
ii. Write the command to name the series as Profit.
Ans. i. print(company[company>250])
ii company.name= 'Profit'
Q191. Mr. Sharma writes the following commands with respect to a table department having
fields, deptno, dept_name, head_of_department, manager.
Command1 : Select count(*) from department;
Command2: Select count(manager) from department;
He gets the output as 8 for the first command but gets an output 6 for the second command.
Explain the output with justification
Ans. This is because the column manager contains a NULL value and the aggregate functions do
not take into account NULL values. Thus Command1 returns the total number of records in the
table whereas Command2 returns the total number of non NULL values in the column manager.
Q192. Consider the following SQL string: “Informatics Practices” Write commands to display
a. “Practices”
b. “matics
Ans.
a. PPP: Point to Point Protocol
b. HTTPs: Hyper Text Transfer Protocol secured
c. VoIP: Voice over Internet Protocol
d. PAN: Personal Area Network
Q194. Mr. Amit Mishra is using his internet connection for checking the online account of
company’s admin without his knowledge. What do we call this type of activity? What are the ways
by which we can avoid such type of activities?
Ans. We call this type of activity as Eavesdropping Precautions we can take in this :
a. Alert employees
b. Round the clock control over physical access by outsiders to the area to be protected
c. Continuous supervision/observation of all service personnel allowed into the area for repairs or
to make alterations
d. Thorough inspection by a qualified technical counter measures specialist of all new furnishings,
decorations, or equipment brought into the area.
Q195. Find out the error in the following SQL command and correct the same.
Select * from employee group by dept where sum(salary) > 2000000
Ans. instead of where having clause.
Q196. There is a table student having total number of rows /records is 50. The following command
giving 48 as output. What is the reason behind this? Explain
Select count(commission) from employee
Ans. Total record is 50. But commission field is having 48 values. Two values are NULL values.
Hence result is showing 48.
Ans. i) print(s['IP'])
ii) s=s+10
print(s)
Q198. Jeet has to prepare a project on “Swachh Bharat Abhiyan”. He decides to gather
information from the internet He downloads three Web pages (Webpage1, Webpage2,
Webpage3) containing information on Swachh Bharat Mission. Answer the following
questions in relation to this
A. What kind of Cyber Crime can it be considered?
B. Which step should Jeet have avoided doing to avoid committing a Cyber Crime?
Ans. a. Plagiarism
b Either he should not have copied as it is or he could have given reference of the specific
webpages from where he copied.
Q199. Rakesh went to an ATM Machine to withdraw some cash. He noticed a suspicious person
standing right behind him. Answer the following questions in relation to this.
Q200. Consider the string STR with value as “KENDRIYA VIDYALAYA”. Write command in
SQL to:
a. Print the last 4 characters of the string STR.
b. Display the count of characters in the string STR
OR
a. . SELECT LCASE(STR) or SELECT LOWER(STR)
b. SELECT INSTR(STR,’RIYA’);
Q201 Consider the string STR with value as “KENDRIYA VIDYALAYA”. Write command in
SQL to:
a. Convert the complete string into lower case.
b. Find the Position of the word “RIYA” in the string.
3 MARKS QUESTIONS
Q202. Consider the following graph. Write a program in python to draw it along with proper
labeling of X-axis, Y-axis and Title for the line Chart of your choice
Ans.
import numpy as np
import matplotlib.pyplot as plt
x=np.linspace(-2, 2,50)
y=x*x
plt.plot( x,y)
plt.title(“Y = x * x”)
plt.xlabel(“X-Axis”)
plt.ylabel(“Y-Axis”)
plt.show()
Q203. Consider the following graph. Write a program in python to draw it. (Height of Bars are
10,1,0,33,6,8)
Ans. import numpy as np
import matplotlib.pyplot at plt
plt.hist([0,10,20,30,40,50],bins=[0,10,20,30,40,50,60],
weights=*10,1,0,33,6,8+,color=;red’, edgecolor=’yellow’)
plt.title(“Histogram of Student Data’)
plt.xlabel(“value”)
plt.ylabel(“Frequency”)
plt.show()
Ans. a. Print(ABC[-2 : ])
b.
b 23
d 61
f 93
c. print(ABC[-1: :-1])
Q205. Sudhir once opened an unknown website and entered his personal details such as Email
ID, Password, Bank Account Number etc. Now he has noticed his Email Inbox being flooded
with useless mails from that Site. In relation to this, answer the following questions:
a. What kind of Cyber Threat is this?
b. Give justification to your answer in part-1.
Ans. a. Spamming
b. It is because, the spammers where he entered his personal email IDs and credentials are
now flooding his mail box with useless or spam files.
Q206. Mandeep has received a phone call from a company, named XYZ Ltd. claiming that
Mandeep has won Rs. 10 lakhs in a lottery. The other person is seeking some security
questions from Mandeep for his verification, like his name, date of birth, account number,
IFSC Code, Phone number, OTP etc. In relation to this, kindly answer the following
questions:
a. Should Mandeep give his details being asked?
b. Give reasons for your answer in part-1
Ans. a. No
b. The other person is trying to ask credential information like OTP etc, which should never be
shared with anyone.
Q207.
Q208. What do you mean by Plagiarism? Explain with the help of an example?
Q210. What do you mean by Phishing? Explain with the help of an example.
Ans. Phishing is a type of social engineering attack often used to steal user data, including
login credentials and credit card numbers.
Example:
URGENT REQUEST (Email Impersonation)
These are targeted and simple forms of phishing emails designed to get victims to purchase
gift cards, or to give up personal email or phone numbers. The "email compromise" gets its
name because the attacker mimics the email of a known sender.
Q211. List any two health hazards related to excessive use of Technology.
Ans. The continuous use of devices like smartphones, computer desktop, laptops, head
phones etc cause a lot of health hazards if not addressed. These are:
i. Impact on bones and joints: wrong posture or long hours of sitting in an uncomfortable
position can cause muscle or bone injury.
ii. Impact on hearing: using headphones or earphones for a prolonged time and on high
volume can cause hearing problems and in severe cases hearing impairments.
iii. Impact on eyes: This is the most common form of health hazard as prolonged hours of
screen time can lead to extreme strain in the eyes.
iv. Sleep problem: Bright light from computer devices block a hormone called melatonin which
helps us sleep. Thus we can experience sleep disorders leading to short sleep cycles
Q212. Consider the following graph. Write the code to plot it.
Q213. Write code to draw the following bar graph representing the number of
students in each class.
Ans.
a. select company, avg(Price) from toys group by company having Qty>15;
b. select Company, count(distinct name) from toys group by Company;
c. Select name, sum(Price* Qty) from toys;
Q216.
Ans. x = emp_df['Name']
y = emp_df['Age']
pl.plot(x,y)
pl.xlabel("Name")
pl.ylabel("Age")
pl.title("Name vs Age")
pl.show()
Qus 217. Write a Python code to display a bar graph with names on x-axis and salary on y-axis.
Give appropriate names for axis and title for the graph.
Ans. x = emp_df['Name']
y = emp_df['Salary']
pl.bar(x,y)
pl.xlabel("Name")
pl.ylabel("Salary")
pl.title("Name vs Salary")
pl.show()
Qus 218.
Ans.
Q 220. 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 )
Q 221.
What do you mean by Digital property Rights? How can digital property rights be threatened.
Ans. Digital property rights represent the next generation of intellectual property rights,
which puts them on the same playing field as patents, copyrights and trademark brands.
... Digital property rights disputes arise when some form of counterfeiting or piracy occurs
between companies.
Q222. What is Online fraud? Give some measures to stop online frauds.
Ans.
internet fraud or online fraud is a type of cybercrime fraud or deception which makes use of
the Internet and could involve hiding of information or providing incorrect information
Do not open unsolicited attachments, they can be phishing emails.
Keep pass-phrases instead of passwords. ...
Do have an eye on headers of the email to see if the email is coming from any non-genuine
domain.
Q223. Write a code to plot the Monthly Attendance of students in class as shown in the
figure given below:
Ans.
import matplotlib.pyplot as plt
months = *‘jan’,’feb’,’mar’,’apr’,’may’,’jun’+
attd=[30,50,50,30,30,60]
plt.plot(attd,months)
plt.title(‘Monthly Attendance’)
plt.show()
Q 224.
Draw a bar chart as below representing the number of students in each class.
Student Strength
5 MARKS QUESTIONS
Qus 225.
Consider the following two series:
ser1=pd.Series([2,5,7,9,6], index=['A','B','C','D','E'])
ser2=pd.Series([8,2,6,3,9], index=['A','K','D','M','E'])
Q227. Write the SQL functions which will perform the following operations
i) To display the name of the day of the current date.
ii) To remove spaces from the beginning of a string, “ Python”.
iii) To display the name of the month eg, January or February from your date of birth.
iv)To display the starting position of word “Information” from
v)To compute the power of two numbers a and b
Ans.
i) dayname(date(curdate()))
ii) ltrim(“ Python“)
iii) monthname(date(dob))
iv) instr(“Information
Technology”,”information”)
v) pow(a,b)
Q228.
Ans. i) Select ename, round(bonus,0) from employee;
ii) Select instr(ename, “ee”) from employee;
iii)Select mid(ename,2,4) from employee;
or
iii) Select Substring(ename,2,4) from employee;
iv) Select dayname(DateofJoin) from employee;
v) Select monthname(DateofJoin) from employee;
Qus. 229. company in Cyntel Enterprises has 4 departments of buildings as shown in the
diagram :
Research
Research
Computers in each department are networked but departments are not networked
The company has now decided to connect the departments also.
Q230.
Write a program in Python Pandas to create the following DataFrame Stationary from
Series:
Write the SQL functions which will perform the following operations:
Display the string “chest” from the string “ Manchester United”
Display the word “hello” from the string “$$$$$$$hello$$$$$$$$”.
To display the name of the month eg, January or February from the current
date.
Write the Output that will be generated by the SQL commands:
SELECT SYSDATE();
SELECT INSTR(“HELLO WORLD”, “he”)
Ans.
i. SELECT SUBSTRING(“ Manchester United”, 4,5) or any other valid syntax
ii. SELECT TRIM (BOTH ‘$’ FROM “$$$$$$$hello$$$$$$$$”)
iii. SELECT MONTHNAME(NOW()) or any other valid syntax
iv. Todays Data and Time in ‘YYYY-MM-DD HH:MM:SS’ format
v. 1
Q 232.
Ans.
a) SELECT PNAME, PRICE FROM CLOTHING WHERE BRAND=”RAYMOND”;
b) SELECT SUM(QUANTITY) FROM CLOTHING WHERE PNAME=’REGULAR SHIRT’;
c) SELECT MAX(PRICE), MIN(PRICE) FROM CLOTHING;
d) SELECT COUNT(*) FROM CLOTHING GROUP BY BRAND HAVNING COUNT(*)>10;
e) SELECT * FROM CLOTHING ORDER BY PRICE DSC;
Q233.
Ans.
i. If star then keeping IT Block as Hub and if LAN then ADM->IT->HR->ACCTS or any
other feasible and economical
ii. IT Block as it has maximum number of computer
iii. a) Repeater : In between all blocks which have distance over 100 Meter
b) Hub / switch : In all blocks as to connect all systems to the main line of network
iv. Firewall
v. Radio waves can be used in hilly regions as they can travel through obstacles.
Q234.
Ans.
import pandas as pd
d1={'DeptId':[10,20,30,40],'DeptName':['Sales','Purchase','Personnel','Research'],
'Income':[85660,86780,87600,89990],'Location':['New Delhi','Kolkata','Haryana','Begaluru']}
DEPT=pd.DataFrame(d1)
print('Highest salary ',max(DEPT.Income))
DEPT['Commission']=DEPT.Income * 0.15
print(DEPT)
Qus 235.
Ans.
a. SELECT * FROM STORE ORDER BY LASTBUY;
b. SELECT ITEMNO, ITEMNAME FROM STORE WHERE RATE > 15;
c. SELECT * FROM STORE WHERE SCODE=22 OR QTY > 110;
d. SELECT SCODE, MIN(RATE) FROM STORE GROUP BY SCODE;
e. UPDATE STORE SET RATE=RATE+10;
Qus 236.
Qus 237. Write the name of the SQL functions which will perform the following operations :-
i. To display the current system Date.
ii. To display the year of a given date.
iii. To extract the substring from a given string.
iv. To calculate the power of a number
v. To combine two strings
Ans.
i. Select now();
ii. Select date of year(date);
iii. Select mid or substr(“string”);
iv. Select pow();
v. Select concat(“string”)
Qus 238.
Qus 239.
As a network expert, provide the best possible answer for the following queries:
i Suggest a cable layout of connections between the buildings.
ii Suggest the most suitable place (i.e. buildings) to house the server of this organization.
iii) Suggest the placement of the following device with justification:
a) Repeater b) Hub/Switch
iv) Suggest a system (hardware/software) to prevent unauthorized access to or from the
network.
v) The company is planning to link its head office situated in Delhi with the offices in hilly
areas. Suggest a way to connect it economically.
Ans.
i.) Any best layout
ii.) Research Lab
iii.) a. Not required b. Reasearch Lab
iv.) Firewall
v.) WAN/ Satellite
Qus 240. Consider the following table automobile and answer the follwing
Qus 241. Write the SQL functions which will perform the following operations
Q243. Consider the following table BOOKS and ISSUED and answers the following.
Ans. (i) Select Book_Name from Books where Type = “Text”;
(ii) Select Book_Name, Price from Books order by Price;
(iii) Update Books set price = price+50 where publishers = “EPB”;
(iv) Select Book_Name, Book_ID, Quantity Issued from Books, Issued where
Books.Book_ID=
Issued.Book_ID;
(v) Insert into issued values(“F0003”,1);
Qus 245.
Ans.
Ans. import pandas as pd
housing_df = pd.read_csv("housing.csv")
print(housing_df)
print(housing_df[housing_df.loc[:,'bath']==2])
print(housing_df.loc[:,'price']*100000)
print(housing_df.head(3))
Q 248.
Write a program in Python Pandas to create the following DataFrame batsman from a
Dictionary:
B_NO Name Scorel Score2
I Sunil Pillai 90 8O
2 Gaurav Sharma 65 45
3 Piyush Goel 70 90
4 Kartik Thakur 80 76
Perform the following operations of the DataFrame:
(a) Add both the scores of a batsman and assign to column "Total".
(b) Display the highest score in both Scorel and Score2 of the DataFrame.
(c) Display the DataFrame.
Q250. Give the SQL functions which will perform the following operations:
(a) To display the year of the current date.
(b) To display the ASCII value of "DELHI".
(c) To display the middle name from your full name (NAME). For example: ("ANIL KUMAR
SINGH". "KUMAR").
(d) To display the position of your last name(LNAME) from your whole name (name).
(e) To display the average marks which are up to 2 decimal places as a whole number.
(average marks can be of any value)
MR PAWAN KAPOR
PGT & HOD COMPUTER
VARDHMAN ACADEMY
RAILWAY ROAD MEERUT