Skip to content

Class XII – Computer Science – 2 – MS

SAMPLE QUESTION PAPER (2021-22)

COMPUTER SCIENCE (083)

TERM II

CLASS 12

Time: 2 Hrs                                                                                                                            Max. Marks: 35

GENERAL INSTRUCTIONS

Programming language is Python.

• This question paper is divided into 3 sections A, B and C.

• Section A has 7 Questions (1-7). Each question carries 2 marks.

• Section B has 3 Questions (8-10). Each question carries 3 marks.

• Section C has 3 case-based Questions (11-13). Each question carries 4 marks.

• Internal choices have been given for question numbers 7, 8 and 12.

SECTION A

Q.1 Write a function Push() which takes number as argument and add in a stack “MyValue”

MyValue=[]

def Push(value):

MyValue.append(value)

Q.2. Write two advantages and two disadvantages of network.

Advantages of network:

(a) We can share resources such as printers and scanners.

(b) We can share data and access files from any computer.

Disadvantages of network:

(a) If there is any problem in the server, then no communication can take place.

(b) Network faults can cause loss of data.

(c) If there is no privacy mechanism used then the entire network can be accessed by an unauthorized person.

Q.3. What is the difference between where and having clause in SQL

Where is used with single row function where as having is used with group row function. example- select designation,sum(salary) from desig group by designation having count(*) < 3; select sum(benefits) from workers where designation = ‘salesman’;

Q.4. Write a small python program to insert a record in the table books with attributes (title,isbn).

import mysql.connector as Sqlator

conn =sqlator.connect(host=”localhost”,user=”root”,passwd=””,database=”test”) cursor=con.cursor()

query=”INSERT into books(title,isbn) values(‘{}’{})”.format(‘Neelesh’,’5143’)

cursor.execute(query)

con.close()

Q.5. Consider the following tables FACULTY and COURSES. Write SQL commands for the statements (i) to (ii) and give outputs for SQL queries (iii) to (iv).

i) To display the details of courses whose fees is in the range of 15000 to 50000 (both values included).

Select * from Courses.where fees between 15000 and 50000;

ii) To increase the fees of all courses by 500 of “System Design” Course.

Update courses set fees = fees + 500 where Cname = “System Design”;

iii) Select COUNT(DISTINCT F_ID) from COURSES;

4

iv) Select Fname,Cname from FACULTY,COURSE where COURSE.F_ID=FACULTY.F.ID;

Q.6. i) What is constraint?

A constraint is a condition or check application on a field or set of fields. Example: NOT NULL (ensure that column con not have null value), CHECK (make sure that all value satisfy certain criteria), UNIQUE (ensure that all values in a column are different) etc.

ii) What are single row functions?

Single Row Function work with a single row at a time. A single row function returns a result for every row of a quired table.

Examples of Single row functions are Sqrt(), Concat(), Lcase(), Upper(), Day(), etc.

Q.7. Make difference between DELETE and DROP command. Explain with suitable examples of each.

DELETE is DML command while DROP is a DDL command. Delete is used to delete rows from a table while DROP is used to remove the entire table from the database.

OR

Differentiate between Alter and Update Command

Alter command in DDL command but update command is DML Command. Alter command is used to add, modify and delete a column from the table and update command is used to make changes in the record of the table

SECTION B

Q.8. Write a function in Python PUSH(Arr), where Arr is a list of numbers. From this list push all numbers divisible by 5 into a stack implemented by using a list. Display the stack if it has at least one element, otherwise display appropriate error message.

def PUSH(Arr,value):

s=[]

for x in range(0,len(Arr)):

if Arr[x]%5==0:

s.append(Arr[x])

if len(s)==0:

print(“Empty Stack”)

else:

print(s)

OR

Write a function in Python POP(Arr), where Arr is a stack implemented by list of numbers. The function returns the value deleted from the stack.

def popStack(st) :

# If stack is empty

if len(st)==0:

print(“Underflow”)

else:

L = len(st)

val=st[L-1]

print(val)

st.pop(L-1)

Q.9 Define degree and cardinality. Based upon given table write degree and cardinality

No of attributes called degree and no. of tuples called cardinality.

4 degree, 5 cardinality

Q.10. In a database there are two tables ‘LOAN’ and ‘BORROWER’ as shown below:

(i) Write Degree and Cardinality of LOAN table.

Degree: 3 Cardinality: 2

(ii) Identify the Primary Key column in the LOAN table.

Loan_Number

(iii) How many rows and columns will be there in the natural join of these two tables?

Rows: 6 Columns: 5

SECTION C

Q. 11. Consider the following table WORKERS and DESIG. Write SQL commands for the statements (i) to (iv).

(i) To display W_ID Firstname, Address and city of all employees living in New York from the table WORKERS.

SELECT W_ID, Firstname, Address, City FROM workers WHERE City = ‘New York’;

(ii) To Display the content of WORKERS table in ascending order of LASTNAME.

SELECT * FROM Workers ORDER BY LASTNAME;

(iii) To display the Firstname, Lastname and Total Salary of all Clerks from the tables WORKERS and DESIG, Where Total Salary is calculated as a Salary +Benefits.

SELECT Firstname,Lastname, Salary + Benefits “Total Salary” FROM Workers,Desig WHERE Workers.W_ID = Desig.W_ID AND Designation = ‘Clerk’;

(iv) To display the Minimum salary among Managers and Clerks from the table DESIG.

SELECT Designation, Min(salary) FROM Desig GROUP BY Designation HAVING Designation IN (‘Manager’,’Clerk’);

Q.12. i) Define the following data communicating devices:

(a) Repeater (b) Gateway

(a) Repeater: Itis a device that amplifies and restores the signal before it gets degraded and transmits the original signal back to the destination. A repeater is a regenerator and not an amplifier.

(b) Gateway: A gateway operates on all the seven layers of OSI model. A network gateway is a computer which has internet-working capability of joining together two networks that use different base protocols. Gateway converts one protocol to another and can, therefore, connect two dissimilar networks

ii) Write the two advantages and two disadvantages of Bus Topology in network.

Advantage:

Easy to connect a computer or peripheral to a linear bus.

Requires less cable length than a star topology.

Disadvantage :

Slower as compared to tree and star topologies of network.

Breakage of wire at any point disturbs the entire

OR

Define the following: (i)3G (ii)SMS.

3G: 3G (Third Generation) mobile communication technology is a broadband, packet-based transmission of text, digitized voice, video and multimedia at data rates up to 2 mbps, offering a consistent set of services to mobile computer and phone users no matter where they are located in the world.

SMS: SMS (Short Message Service) is the transmission of short text messages to and from a mobile phone, fax machine and IP address.

Q.13. Multipurpose Public School, Bengaluru is Setting up the network between its Different Wings of school campus. There are 4 wings named as SENIOR(S), JUNIOR(J), ADMIN(A) and HOSTEL(H).

Distance between various wings are given below:

Wing A to Wing S 100m

Wing A to Wing J 200m

Wing A to Wing H 400m

Wing S to Wing J 300m

Wing S to Wing H 100m

Wing J to Wing H 450m

Number of Computers installed at various wings are as follows:

Wings              Number of Computers

Wing A                       20

Wing S                        150

Wing J                         50

Wing H                       25

a. Suggest the best wired medium and draw the cable layout to efficiently connect various wings of Multipurpose Public School, Bengaluru.

b. Name the most suitable wing where the Server should be installed. Justify your answer.

The server should be installed at Wing S(Senior) as per 80-20 rule i.e. maximum traffic should be local and minimum traffic should pass over backbone

c. Suggest a device/software and its placement that would provide data security for the entire network of the School.

Firewall

d. Suggest a device and the protocol that shall be needed to provide wireless Internet access to all smartphone/laptop users in the campus of Multipurpose Public School, Bengaluru.

Device: Wireless Access Point or Router or WiFi hotspot device or Wifi Dongle Protocol: IEEE 802.11x or TCP/IP