Computer Paper12
Computer Paper12
■ Section A
1. ………………. is a set of moral principles that governs the behaviour of a group or an individual
and regulates the use of computers. [1]
(a) Copyright (b) Computer ethics (c) Property rights (d) Privacy law
3. Pandas is a __________
(a) package (b) language (c) library (d) Software
10. If emp_id contain the following set {9, 7, 6, 4, 3, 1, 2}, what will be the output on execution of
the following MySQL statement? [1]
SELECT emp_id
FROM person ORDER BY emp_id
(a) {1, 2, 3, 4, 6, 7, 9} (b) {2, 1, 4, 3, 7, 9, 6} (c) {9, 7, 6, 4, 3, 1, 2} (d) None of these
11. Home page helps viewers to find-out what they can find on the particular site. Home page is
the [1]
(a) first page of a website (b) index page
(c) about page (d) None of these
(a) SELECT MIN( pub_date) FROM books GROUP BY category HAVING pub_id = 4;
(b) SELECT MIN( pub_date ) FROM books ORDER BY category = 'COOKING';
(c) SELECT COUNT(*) FROM orders WHERE customer* = 1005;
(d) SELECT MAX (COUNT( customer/I) ) FROM orders GROUP BY customer*;
Reason (R) Unlike a hub, a switch can send data packets directly to the intended recipient based
on the recipient's MAC address.
(a) Both A and R are true and R is the correct explanation of A.
(b) Both A and R are true and R is the not correct explanation of A.
(c) A is true but R is false.
(d) A is false but R is true.
18. Assertion (A) Data Frame. count() function will display the sum of the values from the data frame.
[1]
Reason (R) axis = 0, argument is to used to find sum column-wise.
(a) Both A and R are true and R is the correct explanation of A.
(b) Both A and R are true but R is not the correct explanation of A.
(c) A is true but R is false.
(d) A is false but R is true.
■ Section B
19. Sahil, a Class X student, has just started understanding the basics of Internet and web
technologies. He is a bit confused in between the terms "World Wide Web" and "Internet". Help
him in understanding both the terms with the help iof suitable examples of each.
[2]
Or
Ruhani wants to edit some privacy settings of her browses. How can she accomplish her task?
20. Shanya Khanna is using a, table EMPLOYEE. It has the following columns. [2]
Admno, Name, Agg, Stream [column Agg contains Aggregate marks]
She wants to display highest Agg obtained in each Stream.
She wrote the following statement:
SELECT Stream, MAX (Agg) FROM EMPLOYEE;
But she did not get the desired result. Rewrite the above query with necessary changes to help
her get the desired output.
21. What do you understand by degree and cardinality of a table? Give an example. [2]
22. The Python code written below has syntactical errors. Rewrite the correct code and underline
the corrections made. [2]
import pandas as Pd
data = [10. 20. 30, 40, 50]
myseries = pd.Series(data)
result = my series + 5
print()
26. Consider the following table GARMENT, write SQL commands for the statements (i) to (iii)
(i) To display GCODE and DESCRIPTION of each GARMENT in descending order of GCODE.
(ii) To display the details of all the GARMENT, which have READYDATE in between 08-DECz07 and 1
6-JUN-08 (inclusive if both the dates).
(iii) To display the average PRICE of all the GARMENT, which are made up of fabric with FCODE as F03.
Or
27. Given below is the data for Sales made in year 2000,2010,2015 and 2020 by three employees.[3]
Write a Python program to create a DataFrame for the above data by giving suitable column
headings.
28. Amit wants to create a DataFrame df whose columns store following data about his friends: [3]
Or
Define the content management system of digital property right. List three factors about the
reason behind plagiarism.
30. Consider the table PERSONS given below. Write output for queries (i) to (iii). [3]
Table : PERSONS
■ Section E
33. Akhilesh a clerical staff in a Doctor's Dispensary. He maintains records of visiting doctors in a table
Doctor. He wants to analyse some data and find some results such as total number of doctors of
certain departments average charges in some departments etc. Help him in writing proper queries
to get the results.
[5]
Table : Doctor
Table:CLUB
(i) Suggest the network type (out of LAN, MAN, WAN) for connecting each of the following set of the
their offices.
(a) Back Office and Work Office
(b) Back Office and South Office
(ii) Which device will you suggest to be procured by the company for connecting all the co cnputers
with each of their offices out of the following devices?
(a) Switch/Hub
(b) Modem
(iii) Suggest the cable/wiring layout for connecting the company's local offices located in New Delhi.
Also, suggest an effective method for connecting the company's regional offices East Office, West
Office and South Office with offices located in New Delhi.
(iv) Data is converted in a form so as to travel over telephone lines using this device.
(v) Network that sends the data over optimising paths through connected loop is
dfl df2
Mark1 Mark2 Mark1 Mark2
0 30 20 0 10 15
1 40 45 1 20 25
2 15 30 2 20 30
3 40 70 3 50 30
Write the commands to do the following operations on the dataframes given above:
1. (b) Computer ethics 2. (a) WEEE (Waste Electrical and Electronic Equipment)
3. (c) library 4. (c) stealing others E-mail password 5. (b) ADD()
6. (c) pandas 7. (a) copyright 8. (a) heterogeneous
9. (d) Internet facility are able to exchange information, access pictures, find diverse perspective on
issue from a glob audience.
10. (a) {-1. 2. 3. 4. 6. 7. 9}
11. (a) First page of a website
12. (a) SELECT MIN (pub_date) FROM books GROUP BY category HAVING pub_id = 4;
13. (d) Al! of these
14. (a) GROUP BY
15. (c) INSERI INTO Persons Values( 'xxxl ' , 'yyyl.);
16. (a) Group data by column values
17. (a) Both A and R are true and R is the correct explanation of A.
18. (c) The count() method counts the number of not ernor: values for each row, or column if you
specify the axis parameter as axis = 'columns', and returns a series object orrth tne result for each
row (or column).
19. World Wide Web (WWW) is a set of programs standards and protocols that allows the multimedia
and hypertext files to be created, displayed and linked on the Internet e g w.w. microsoft.com,
www.amazon.com, etc. Internet is a computer-based world 'mode commurbcatiors network,
which is composed of large number of smaller interconnected networks.e.g. Web. E-rnaLs. Social
media etc While Internet is a collection of computers or networking devices connected together.
WWW is a clylecton of documents. linked via special links called hyperlinks. WWW forms a large
part of Internet but is not the Internet
Or
She can accomplish her task by performing follow steps
Step 1 Open your web browser.
Step 2 Open browser settings.
Step 3 Look for Privacy and Security settings. if not directly fQund,/click on Advanced settings.
Step 4 After reaching Privacy and Security settings she can edit their setting.
20. SELECT Stream, MAX(Agg)
FROM EMPLOYEE
GROUP BY Stream;
21. Degree Number of columns/attnbutes,fieids in a table are called table's degree.
Cardinality Number of rows/tuples/records in a table are called table's cardinality. For example,
Bookno Name Author Price
B01 Good learning Xion Z. 220
B02 Srnre easy T Singh 350
B03 I to U S.Sandeep 250
Degree is 4 because it has 4 columns and cardinality is 3 because it has 3 rows.
22. import pandas as pd
data = [10, 20. 30, 40. 50]
my_series = pd.Series.(data)
result = my_series + 5
print(result)
23. Some disadvantages of e-Waste recycling are as follows
More Pollution and Energy Consumption It's contradicting, but the reality is that recycling tons
of garbage will require waste to be transported, sorted, cleaned and processed in separate
factories, all of which need energy and may result in by-products that can pollute air, water or soil
when more trucks are employed to pick up recyclable products.
Good Products are not Guaranteed Not all recycled items are of high quality or even safe to use.
As previously mentioned, recycled products may contain toxic chemicals that were previously
present with the original material.
Or
Software Piracy refers to the unauthorised duplication of computer software. The following are
the three types of law that can help to restrict software piracy:
(i) Copyright (ii) Patent (iii) Trademark
24. import pandas as pd
df = pd.DataFrame({'name' : ['Riya', 'Preeti , 'Neeta ], 'age' : [25, 30, 22], 'salary' : [50000, 60000,
45000]})
df = df.drop ('salary'.axis=1)
print(df.head(5))
25. (i) print(Numseries*2)
(ii) print(Numseries[Numseries%2!=0])
26. (i) SELECT GCODE, DESCRIPTION FROM GARMENT ORDER BY GCODE DESC;
(ii) SELECT * FROM GARMENT WHERE READYDATE BETWEEN '08-DEC-07' AND '16-JUN-08' ;
(iii) SELECT AVG (PRICE) FROM GARRINT WHERE FCODE = 'F03' ;
Or
Types of SQL commands are as follows:
(i) Data Definition Language (DDL) DDL changes the structure of the table like creating a table,
deleting a table, altering a table, etc. All the command of DDL are auto-committed that means it
permanently saves all the changes in the database. Here are some commands that come under
DDL:
CREATE
ALTER
DROP
(ii) Data Manipulation Language (DML) DML commands are used to modify the database. It is
responsible for all form of changes in the database. The command of DML is not auto-committed
that means it cannot permanently save all the changes in the database. They can be rollback.
Here are some commands that come under DML:
INSERT
UPDATE
DELETE
(iii) Data Control Language (DCL) DCL commands are used to grant and take back authority from
any database user. Here are some commands that come under DCL:
GRANT
REVOKE
27. import pandas as pd
data = {'2000' : [5,6,7], '2010' : [10,7,18], '2015' : [12,8,19], '2020' : [14,18,20]}
dt = pd.DataFrame (data, index = ['Ram', 'Shyam', 'Sita'])
print(df)
28. (i) df.loc[2,:]
(ii) df=dfC'Email','Name']
(iii) df.to_csv("friends.csv")
29. (i) Trademark
(ii) Plagiarism
(iii) (c) Copyright
Common Students got confused among trademark, patent and copyright and
Mistake they choose patent instead of copyright.
Or
Content management system is the back end of our website, check who has access to this section
of our website, and make sure that they don't have unrestricted access to the site.
Three major factors about the reasons behind plagiarism are
(i) Being lazy
(ii) Lack of enforcement
(iii) Fear of failure
30.
Or
Traindf.iloc[1:2] 33.
Or
34. (i) (a) The type of network between the Back Office and the Work Office is LAN (Local Area
Network).
(b) The type of network between the Back Office and the South Office is WAN (Wide Area
Network).
(ii) (a) The suitable device for connecting all the computers in each of their offices is switch/hub.
(iii) The suggested layout for connection is as follows:
(iv) Modem
import numpy as np
import pandas as pd
from pandas import Series, DataFrame
import matplotlib.pyplot as plt
data = [[30, 25, 50, 20, 23], [40, 23, 51, 17, 10]. [35, 22, 45. 19, 19]]
X = np.arange (5)
fig = plt.figure( )
plt = fig.add_axes ([0.0,1,1])
plt.bar (X + 0.00, data [0], color = 'b', width - 0.25)
plt.bar (X + 0.25, data [1], color = 'g'. width - 0.25)
plt.bar (X + 0.50. data [2], color = 'r', width = 0.25)