Skip to content

Class XII – Computer Science – 1 – 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 pop() which remove name from stack named “MyStack”

def Pop(MyStack):

if len(MyStack) > 0:

MyStack.pop()

else:

print(“Stack is empty.”)

Q.2. i) Expand the following- HTTP, ARPANET

(i) HTTP – Hyper Text Transfer Protocol

(ii) ARPANET – Advanced Research Project Agency Network

ii) What is MAC address? Give example also.

The NIC manufacturer assign a unique physical address to each NIC cars, this physical address is known as MAC address. A MAC address is a 6-byye address with each byte separated by colon: example 10:BS:04:56:2E:FC

Q.3. What is the difference between Primary Key and Foreign Key?

i) Primary key is the key which uniquely identifies a tuple but foreign key is the key which takes reference from primary key

ii) There is only one primary key in a table but there can be multiple foreign key on a table

Q.4. Explain the following results retrieval methods with examples. fetchone () rowcount ().

fetchone() :- The fetchone() method will return only one row from the result set in the form of tuple containing a record.

(B) rowcount() :- cursor.rowcount() that always return how many records have been retrieved so for using any of the fetch..() methods

Q.5. Consider the following tables GAMES. Give outputs for SQL queries (i) to (iv). Table: GAMES

(i) SELECT COUNT(DISTINCT Number) FROM GAMES;

2

(ii) SELECT MAX(ScheduleDate),MIN(ScheduleDate) FROM GAMES;

19-Mar-2004                     12-Dec-2003

(iii) SELECT SUM(PrizeMoney) FROM GAMES;

59000

(iv) SELECT * FROM GAMES WHERE PrizeMoney>12000;

Q.6. i) Which keyword is used to remove duplicate records from relation.

distinct

ii) A table “Design” in a database has 5 columns and 2records. What is the degree and cardinality of this table?

Degree – 5 cardinality-12

Q.7. Write SQL query to create a table ‘Inventory’ with the following structure:

CREATE TABLE Inventory

(MaterialId INTEGER PRIMARY KEY,

Material Varchar(50)NOT NULL,

Category Char(2) DEFAULT=’E’,

DatePurchase Date);

OR

Observe the following table and answer the part (i) and (ii) accordingly

(i) Write the names of most appropriate columns, which can be considered as candidate keys.

Candidate Key: Pno, Name

(ii) What is the degree and cardinality of the above table?

Degree:4                              Cardinality:5

SECTION B

Q.8. Write a function in Python PUSH_IN(L), where L is a list of numbers. From this list, push all even numbers into a stack which is implemented by using another list.

top=-1

stk=[]

def PUSH_IN(L):                               # Allow additions to the stack

for i in L:

if i%2==0:

stk.append(i)

top=len(stk)-1

OR

Write a function in Python POP_OUT(Stk), where Stk is a stack implemented by a list of numbers. The function returns the value which is deleted/popped from the stack.

def isEmpty(stk):                              # checks whether the stack is empty or not

if stk==[]:

return True

else:

return False

def POP_OUT(stk):

if isEmpty(stk):                                 # verifies whether the stack is empty or not

print(“Stack Underflow”)

else:                                                      # Allow deletions from the stack

item=stk.pop()

if len(stk)==0:

top=-1

else:

top=len(stk)

return item

Q.9. i) Why is it not allowed to give string and date type argument for Sum() and Avg() functions?

String and dates are not real numbers that we calculate, so sum() or avg() functions are not valid for them

ii)There is column C1 in a table T1. The following two statements: select count(*) from T1; and select count(C1) from T1; are giving different output. What may be the possible reason?

There may be a Null value.

Q.10. i) Sanghi created two tables with City as Primary Key in Table1 and Foreign key in Table2 while inserting row in Table2 Mr Sanghi is not able to enter value in the column City. What is the possible reason for it?

Mr Sanghi was trying to enter the name of City in Table2 which is not present in Table1 i.e. Referential Integrity ensures that value must exist in referred table

ii)The Pincode column of table ‘Post’ is given below

Find the output

i) SELECT Pincode from Post where Pincode LIKE ” %1″ ;

100001

ii) SELECT Pincode from Post where Pincode LIKE ” 0%” ;

No output

SECTION C

Q. 11.

i) Display the Trainer Name, City & Salary in descending order of their Hiredate.

SELECT TNAME, CITY, SALARY FROM TRAINER ORDER BY HIREDATE;

ii) To display the TNAME and CITY of Trainer who joined the Institute in the month of December 2001.

SELECT TNAME, CITY FROM TRAINER WHERE HIREDATE BETWEEN ‘2001-12-01’ AND ‘2001- 12-31’;

iii) To display TNAME, HIREDATE, CNAME, STARTDATE from tables TRAINER and COURSE of all those courses whose FEES is less than or equal to 10000.

SELECT TNAME,HIREDATE,CNAME,STARTDATE FROM TRAINER, COURSE WHERE TRAINER.TID=COURSE.TID AND FEES<=10000;

iv) To display number of Trainers from each city.

SELECT CITY, COUNT(*) FROM TRAINER GROUP BY CITY;

Q.12. i) Identify the type of topology on the basis of the following:

a. Since every node is directly connected to the server, a large amount of cable is needed which increases the installation cost of the network.

Star Topology

b. It has a single common data path connecting all the nodes.

Bus Topology

ii) Define the following: (i) RJ-45

RJ-45: RJ45 is a standard type of connector for network cables and networks. It is an 8-pin connector usually used with Ethernet cables.

(ii) Ethernet

Ethernet: Ethernet is a LAN architecture developed by Xerox Corp along with DEC and Intel. It uses a Bus or Star topology and supports data transfer rates of up to 10 Mbps

OR

What is protocol? Name 2 commonly used protocols.

A protocol means the rules that are applicable for a network or we can say that the common set of rules used for communication in network. Different types of protocols are :

(i) HTTP : Hyper Text Transfer Protocol

(ii) FTP : File Transfer Protocol

(iii) SLIP : Serial Line Internet Protocol

(iv) PPP : Point to Point Protocol

(v) TCP/IP : Transmission Control Protocol/ Internet Protocol.

Q.13. Riana Medicos Centre has set up its new centre in Dubai. It has four buildings as shown in the diagram given below:

Distances between various buildings are as follows:

A network expert, provide the best possible answer for the following queries:

(i) Suggest the type of network established between the buildings.

LAN

(ii) Suggest the most suitable place (i.e., building) to house the server of this organization.

Research Lab

(iii) Suggest the placement of the following devices with justification: (a) Repeater (b) Hub/Switch

hub in each building

(iv) Suggest a system (hardware/software) to prevent unauthorized access to or from the network

Firewall