Skip to content

Class XII – Computer Science – 3 – 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 1, 3, 8 and 12.

SECTION A

Q.1 What is a stack? Write two operations that can be performed on the stack.

A stack is a basic data structure that follows the Last In First Out (LIFO) principle where insertion and deletion of data take place at one end called the top of the stack. The two operations that can be performed on the stack are:

(i) PUSH – to insert an element

(ii) POP – to delete an element from the stack.

Q.2. (i) Expand the following terms: (a) VoIP, (b) NIC.

VoIP: Voice over Internet Protocol

NIC: Network Interface Card

(ii) Which device is used to regenerate the weak signals for long-distance transmission?

Repeater

Q.3. Consider a table ‘Online_Class’ with the following structure:

(i) Identify the data types of Date_of_Class and Charges columns.

Date_of_Class – Date

Charges – Decimal

(ii) If a column ‘passcode’ contains only 4 letters password information like ‘1#a4’ then out of char or varchar,which data type is suitable for this column. Justify your answer.

We can use char (4) data type for the passcode column because the values in a column are of same length

Q.4. What are the different parameters in connect() function of mysql.connector?

There are four parameters in connect() function:

(i) host – It is the username on MySql.

(ii) password – It is the password of the user in MySql.

(iii) hostname – It is the hostname of the database server.

(iv) database – It is the database name of the MySql database.

Q.5. Write the output of the queries (i) to (iv) based on the table Product given below:

(i) Select P_Name, P_Price from Product Where P_Price>1500;

(ii) Select PId, P_Name, P_Price * P_Qty from Product Where P_Name Like ‘%e’;

(iii) Select Max(Date_Of_Purchase) from Product Where P_Price>500;

(iv) Select Sum(P_Price) from Product Where P_Price * P_Qty >3000;

Q.6. (i) Which command is used to create a database in SQL?

create database <database_name>;

(ii) How will you calculate columns and rows in a cross join?

The total number of columns in the resultant table is the sum of the number of columns and the total number of rows is the product of the number of rows in all tables

Q.7. Consider the table Employee with the following records:

(i) What could be the possible reason when inserting a new row using the following command gives an error? Justify your answer.

Insert Into Employee Values(‘E104’, ‘Jai Gupta’, ‘Manager’, 80000, ‘2020-12-10’);

Inserting a new row in the table Employee gives an error because we are trying to insert a duplicate value ‘E104’ in the column Emp_ID that is already present in the table and Emp_ID is the primary key of the table that cannot accept duplicate value for this column.

(ii) What would be the cardinality and degree of the table when 3 more rows are added to the table?

Cardinality -7

Degree – 5

OR

Consider the table PF_Details and answer the following questions:

(i) Identify the Primary and Foreign keys of table PF_Details if the Employee table given above is linked to this table.

The Primary key of the table PF_Details is PF_No and the Foreign key is Emp_ID.

(ii) Can we delete the record of any employee from the table PF_Details?

No, we cannot delete the record of any employee from the table because of referential integrity. In table PF_Details, the column Emp_ID is the Foreign key which is linked to the table Employee that rejects the deletion operation in the PF_Details table.

SECTION B

Q.8. Pankaj has to create a record of books containing BookNo, BookName and BookPrice. Write a userdefined function to create a stack and perform the following operations:

• Input the Book No, BookName and BookPrice from the user and Push into the stack.

• Display the status of stack after each insertion.

def Book(St):

bookid=input(‘Enter Book id’)

bookname=input(‘Enter book name’)

bookPrice=int(input(‘Enter book Price’))

st.append([bookid,bookname,bookPrice])

i=len(st-1)

while i>0:

print(st[i])

i-=1

OR

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

def PUSH(Arr):

s=[]

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

if Arr[x]%3==0:

s.append(Arr[x])

if len(s)==0:

print(“Empty Stack”)

else:

print(s)

Q.9 (i) A table Voter_list is created with the following columns: V_ID, V_Name, V_Address, V_Age, V_AreaCode, V_Gender, V_Phone_No Write an SQL command to delete column V_Phone_No from the table Voter_list.

Alter Table Voter_list

Drop V_Phone_No;

(ii) Differentiate between Alter and Update commands with the help of examples

Q.10. Rashmi has to create a table in SQL to store the records of students and their projects submission information. The structure of the table Project_Info is:

Help Rashmi to complete the following tasks:

(i) To create the table Project_Info.

Create Table Project_Info(

Stud_Roll_No integer(8),

Name varchar(30) NOT NULL,

Project_Name varchar(35),

No_of_Students integer(3));

(ii) She has forgotten to add the Primary key to this table. Write a command to add Primary key to column Stud_Roll_No

Alter Table Project_Info

Add Primary Key(Stud_Roll_No);

SECTION C

Q. 11. Consider the following tables Activity and Coach. Write SQL commands for the statements (i) to (iv).

(i) To display the name of all activities with their Acodes in descending order.

Select Activity_Name from Activity

Order by Acode Desc;

(ii) To display the sum of PrizeMoney for each of the number of participants group-wise.

Select Sum(Prize_Money) from Activity

Group By Participant_Num ;

(iii) To display the content of the Activity table where Scheduled_date is earlier than 2022-02-26 in ascending order of Participant_Num.

Select * from Activity

where Scheduled_Date > ‘2022-01-26’

Order By Participant_Num;

 (iv) To display Participant_Num from Activity table without repetition.

Select Distinct Participant_Num from Activity;

Q.12. (i) Differentiate between Bus topology and Star topology.

OR

Define the following terms: Web browser, Protocols.

Web Browser: A web browser is a software that is used for displaying the content on web page(s). It is used by the client to view websites. Examples of web browsers—Google Chrome, Firefox, Microsoft Edge, Safari, Opera, etc. Protocol: A protocol means the rules that are applicable for a network, or a common set of rules used for communication in the network. Some of the examples of protocols are FTP, SMTP, TCP/IP, etc.

(ii) Differentiate between Client-Server and Peer-to-Peer networks.

Client-Server networks: In Client-Server network, multiple clients, or workstations, are connected to at least one central server. A server is a powerful computer with all applications and hardware installed in it and a client is a computer which is seeking any resource from another computer. When clients need access to these resources, they access them from the server. This network is used for larger networks.

Peer-to-Peer networks: In Peer-to-Peer network, all nodes in the network have equivalent capability and function as both client and server. In this network, all workstations are connected together for sharing devices, information or data. This network is ideal for small networks where there is no need for dedicated servers.

Q.13. Bright Study University is setting up its academic centres in Gurugram and planning to set up a network. The university has 3 academic centres and one administration centre as shown in the diagram given below:  

(i) Suggest and draw a cable layout to efficiently connect various centres within the university.

The most suitable cable layout is:

(ii) Which device will you suggest to be placed/ installed in each of these centres to efficiently connect all the computers within the university?

Switch

(iii) Name the centre where the server is to be installed. Justify your answer.

Admin Centre because Admin Centre has the maximum number of computers, or Business Centre because it is closest to all other centres (minimum cable length required).

(iv) The university is planning to connect its admin office in the closest big city, which is more than 350 km from the university. Which type of network out of LAN, MAN or WAN will be formed? Justify your answer

WAN is the preferred network for this purpose because 350 km is more than the range of LAN and MAN.