0% found this document useful (0 votes)
143 views13 pages

Sample Question Paper 1: Class Xii Computer Science (083) Term Ii

This document contains a sample question paper for Class XII Computer Science with questions in three sections - A, B and C. Section A contains 7 multiple choice questions with 2 marks each about concepts like stacks, database tables, SQL queries. Section B has 3 questions with 3 marks each about creating functions to perform stack operations and pushing elements into a stack. Section C has 3 descriptive questions with 4 marks each about creating classes, inheritance and exception handling. The paper provides instructions about number of questions, marks division and internal choices for some questions.

Uploaded by

Harpreet Kaur
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
143 views13 pages

Sample Question Paper 1: Class Xii Computer Science (083) Term Ii

This document contains a sample question paper for Class XII Computer Science with questions in three sections - A, B and C. Section A contains 7 multiple choice questions with 2 marks each about concepts like stacks, database tables, SQL queries. Section B has 3 questions with 3 marks each about creating functions to perform stack operations and pushing elements into a stack. Section C has 3 descriptive questions with 4 marks each about creating classes, inheritance and exception handling. The paper provides instructions about number of questions, marks division and internal choices for some questions.

Uploaded by

Harpreet Kaur
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 13

SAMPLE QUESTION PAPER 1

CLASS XII
COMPUTER SCIENCE (083)
TERM II
Maximum Marks: 35 Time Allowed: 2 Hours

General Instructions:
1. The question paper is divided into 3 sections – A, B and C.
2. Section A consists of 7 questions (1–7). Each question carries 2 marks.
3. Section B consists of 3 questions (8–10). Each question carries 3 marks.
4. Section C consists of 3 questions (11–13). Each question carries 4 marks.
5. Internal choices have been given for question numbers 1, 3, 8 and 12.

Section A
Each question carries 2 marks
1. What is a stack? Write two operations that can be performed on the stack. 2
Ans. 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.
2. (i) Expand the following terms: 1
VoIP, NIC
Ans. VoIP: Voice over Internet Protocol
NIC: Network Interface Card
(ii) Which device is used to regenerate the weak signals for long-distance transmission? 1
Ans. Repeater
3. Consider a table ‘Online_Class’ with the following structure: 2
Meeting_Id Date_of_Class Student_Name Charges
121100991 2022-01-12 Kavya Sethi 500.00

(i) Identify the data types of Date_of_Class and Charges columns.
(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.
Sample Question Paper 1 Term II

Ans. (i) Date_of_Class – Date


Charges – Decimal
(ii) We can use char (4) data type for the passcode column because the values in a column are of same
length.
4. What are the different parameters in connect() function of mysql.connector? 2
Ans. 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.

A.1
5. Write the output of the queries (i) to (iv) based on the table Product given below: 2
PId P_Name P_Price P_Qty Date_Of_Purchase
P001 Keyboard 800 3 2022-01-01
P002 Mouse 380 6 2021-12-23
P003 Speaker 1800 3 2022-01-01
P004 Headphone 1000 6 2021-10-02
P005 Stylus 3000 2 2022-01-19
(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;
Ans. (i)
P_Name Price
Speaker 1800
Stylus 3000
(ii)
PID P_Name P_Price * P_Qty
P002 Mouse 2280
P004 Headphone 6000
(iii)
Max(Date_Of_Purchase)
2022-01-19
(iv)
Sum(P_Price)
5800
6. (i) Which command is used to create a database in SQL? 1
Ans. create database <database_name>;
(ii) How will you calculate columns and rows in a cross join? 1
Ans. 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.
7. Consider the table Employee with the following records: 2
Emp_ID Emp_Name Designation Salary Date_of_Joining
E101 Kanishk Arya Manager 80000 2010-09-01
Computer Science with Python–XII

E102 Shuchi Sharma Marketing Head 75000 2012-10-10


E103 Simran Gupta Accounts Head 72000 2015-03-05
E104 Deepak Malhotra Sales Head 55000 2018-02-09
(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’);
(ii) What would be the cardinality and degree of the table when 3 more rows are added to the table?
OR

A.2
Consider the table PF_Details and answer the following questions:
PF_No Date_of_Birth email-id Emp_ID
12255 1990-09-09 [email protected] E101
13366 1991-10-08 [email protected] E102
11188 1994-01-02 [email protected] E103
55599 1997-02-09 [email protected] E104
(i) Identify the Primary and Foreign keys of table PF_Details if the Employee table given above is linked to
this table.
(ii) Can we delete the record of any employee from the table PF_Details?
Ans. (i) 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) Cardinality -7
Degree – 5
OR
(i) The Primary key of the table PF_Details is PF_No and the Foreign key is Emp_ID.
(ii) 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
Each question carries 3 marks
8. Pankaj has to create a record of books containing BookNo, BookName and BookPrice. Write a user-
defined function to create a stack and perform the following operations: 3
• Input the Book No, BookName and BookPrice from the user and Push into the stack.
• Display the status of stack after each insertion.
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.
Ans. 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:
Sample Question Paper 1 Term II

print(st[i])
i-=1
OR
Ans.
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:
A.3
print(s)
9. (i) A table Voter_list is created with the following columns: 1
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.
Ans. Alter Table Voter_list
Drop V_Phone_No;
(ii) Differentiate between Alter and Update commands with the help of examples. 2
Ans.
Alter Command Update Command
(i) It is used to change the columns of the (i) It is used to change the records of the table
existing table such as: adding a new specified by a condition.
column, deleting a column, renaming
a column name and changing the data
type of the column.
(ii) It is a DDL command. (ii) It is a DML command.
(iii) For example, to add a new column (iii) For example, to change the records of student
in a table, Update Student
Alter table student Set Marks=Marks+5;
Add Contact_No Varchar (20);
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: 3
Table: Project_Info
Field Name Data Type Size Remarks
Stud_Roll_No Integer 8
Name Varchar 30 NOT NULL
Project_Name Varchar 35
No_of_Students Integer 3
Help Rashmi to complete the following tasks:
(i) To create the table Project_Info.
(ii) She has forgotten to add the Primary key to this table. Write a command to add Primary key to column
Stud_Roll_No.
Ans. (ii) Create Table Project_Info(
Stud_Roll_No integer(8),
Name varchar(30) NOT NULL,
Project_Name varchar(35),
No_of_Students integer(3));
(ii) Alter Table Project_Info
Computer Science with Python–XII

Add Primary Key(Stud_Roll_No);


Section C
Each question carries 4 marks
11. Consider the following tables Activity and Coach. Write SQL commands for the statements (i) to (iv). 4
Table : Activity
ACode Activity_Name Participant_Num Prize_Money Scheduled_date
1001 Relay 100x 4 16 10000 2022-01-23
1002 High Jump 10 12000 2022-01-24
1003 Shot Put 12 8000 2022-01-25
1005 Long Jump 12 9000 2022-01-27
1008 Discus Throw 10 15000 2022-01-29
A.4
Table: Coach
PCode Name ACode
1 Varun Kumar 1001
2 Sreeja Gupta 1008
3 Praveen Kumar 1001
4 Suman Kumari 1003
(i) To display the name of all activities with their Acodes in descending order.
(ii) To display the sum of PrizeMoney for each of the number of participants group-wise.
(iii) To display the content of the Activity table where Scheduled_date is earlier than 2021-01-26 in
ascending order of Participant_Num.
(iv) To display Participant_Num from Activity table without repetition.
Ans. (i) Select Activity_Name from Activity
Order by Acode Desc;
(ii) Select Sum(Prize_Money) from Activity
Group By Participant_Num ;
(iii) Select * from Activity
where Scheduled_Date < ‘2022-01-26’
Order By Participant_Num;
(iv) Select Distinct Participant_Num from Activity;
12. (i) Differentiate between Star topology and Bus topology. 2
OR
Define the following terms:
Web browser, Protocols
Ans.
Star topology Bus topology
In star topology, a central hub is required to In a bus topology, a long cable is known as a
connect all computers with each other. backbone which is used to connect all computers
with each other.
The data is transmitted from the sender to the The data is transmitted through a long cable
receiver by passing through the hub. from the sender to the receiver.
No collision takes place through transmission of A collision can take place as the data can be
data. transmitted from both ends at the same time.
If the central hub fails, the entire network shuts If there is a break in a cable, no transmission
down. takes place.
OR

Web Browser: A web browser is a software that is used for displaying the content on web page(s). It
Sample Question Paper 1 Term II

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. 2
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.

A.5

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.
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: 4

Business Centre Technology Centre

Law Centre Admin Centre



Distance between various centres:
Business Centre Law Centre 60 m
Law Centre Technology Centre 90 m
Law Centre Admin Centre 115 m
Business Centre Technology Centre 40 m
Business Centre Admin Centre 45 m
Technology Centre Admin Centre 25 m
The number of computers in each block is as follows:
Business Centre 25
Technology Centre 55
Admin Centre 130
Law Centre 35
(i) Suggest and draw a cable layout to efficiently connect various centres within the university.
(ii) Which device will you suggest to be placed/ installed in each of these centres to efficiently connect all
the computers within the university?
(iii) Name the centre where the server is to be installed. Justify your answer.
(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.
Ans. (i) The most suitable cable layout is:

Business Centre Technology Centre


Computer Science with Python–XII

Law Centre Admin Centre



(ii) Switch
(iii) 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) WAN is the preferred network for this purpose because 350 km is more than the range of LAN and
MAN.

A.6
SAMPLE QUESTION PAPER 2
CLASS XII
COMPUTER SCIENCE (083)
TERM II
Maximum Marks: 35 Time Allowed: 2 Hours

General Instructions:
1. The question paper is divided into 3 sections – A, B and C.
2. Section A consists of 7 questions (1-7). Each question carries 2 marks.
3. Section B consists of 3 questions (8-10). Each question carries 3 marks.
4. Section C consists of 3 questions( 11-13). Each question carries 4 marks.
5. Internal choices have been given for question numbers – 1, 3, 8 and 12.

Section A
1. Write the name of the operations that can be applied on stacks. Also write the name of functions that
are used to perform the task. 2
Ans. In stack, inserting an element is known as Pushing which is done by append() function and deleting an
element is known as Popping which is accomplished by pop() or del function.
2. (i) Expand the following terms: 1
MAC, TCP/IP
Ans. MAC: Media Access Control
TCP/IP: Transmission Control Protocol/Internet Protocol
(ii) Which device is used to convert the analog signal into digital and vice versa? 1
Ans. MODEM (Modulator-Demodulator)
3. Differentiate between Primary and Foreign key. 2
Ans. Primary Key: A primary key is a set of one or more attributes/fields which uniquely identifies a tuple/row
in a table. It does not allow duplicate values in a relation.
It cannot be re-declared or left null. One table can have only one primary key; however, primary key can
be a combination of more than one field.

Foreign Key: A foreign key is a non-key attribute whose value is derived from the primary key of another
table; in other words, a primary key in some other table having relationship with the current or original
table.
4. Explain any two methods through which we can extract records from a resultset? 2
Ans. fetchone(): It fetches the next row from the active result set.

fetchall(): It fetches all the rows in a result set and returns a list of tuples. If some rows have already
Sample Question Paper 2 Term II

been extracted from the result set, then it retrieves the remaining rows. If no more rows are available,
it returns an empty list.
5. Write the output of the queries (i) to (iv) based on the table Employee given below: 2
Ecode Name Salary Job City
E1 Ritu Jain 50000 Manager Delhi
E2 Vikas Verma 45000 Executive Jaipur
E3 Rajat Chaudhary 30000 Clerk Delhi
E4 Leena Arora 45000 Manager Bangalore
E5 Shikha Sharma 50000 Accountant Kanpur

A.1
(i) Select Ecode, Name, Max(Salary) from Employee Where City=’Delhi’;
(ii) Select Name, job from Employee Where Salary Between 40000 and 50000 ;
(iii) Select AVG(Salary) from Employee Where Job In (‘Manager’,‘Executive’, ’Clerk’);
(iv) Select Sum(Salary) from Employee Where Name Like ‘%a’;
Ans. (i)
Ecode Name Max(Salary)
E1 Ritu Jain 50000
(ii)
Name Job
Ritu Jain Manager
Vikas Verma Executive
Leena Arora Manager
Shika Sharma Accountant
(iii)
AVG(Salary)
42500.0
(iv)
Sum(Salary)
140000
6. (i) Write a command to delete all rows from the table ‘Student’. 1
Ans. Delete from Student;
(ii) Which type of join is depicted in the following SQL statement? 1
Select P.PNo, P.Product_Name, Pr.P_Price
From Product P, Price Pr
Where P.PNo=Pr.PNo;
Ans. The join depicted in the SQL statement is equi join.
7. Consider the table Employee with the following records: 2
Table: Employee
ECODE NAME DESIG SGRADE DOJ DOB
101 Sneha EXECUTIVE S01 2003-03-23 1980-01-13
Bhardwaj
102 Ravi Chander HEAD-IT S02 2010-02-12 1987-07-22
103 Sunita Kumari RECEPTIONIST S03 2009-06-20 1983-02-24
Computer Science with Python–XII

108 Ravi Kumar GM S04 2006-08-11 1984-03-03


107 Priyam Sen Head-IT S05 2004-12-29 1984-03-03
(i) In table Employee, identify which of the two columns are uniquely identified each row? Which key
can be made with these columns?
(ii) What is the cardinality and degree of the Employee table?
OR
Consider the table Salary and answer the following questions:
SNO SGRADE SALARY
1 S01 28000
2 S02 45000
3 S03 25000
4 S04 90000
A.2
5 S05 50000
(i) How can we access records from both the tables Employee and Salary?
(ii) How many rows and columns will be there after the cartesian product of these two tables?
Ans. (i) In the table Employee, the columns which are uniquely identified and each row are ECODE and
SGRADE. These columns can be made the Primary key of the table.
(ii) The cardinality of the table is 5 and the degree of the table is 6.
OR
(i) We can access records from both tables by creating a Foreign key that can join both tables through
common columns.
(ii) The rows will be 5 * 5= 25 and columns will be 6 + 3 = 9 after the cartesian product of two tables.

Section – B
Each question carries 3 marks
8. Shruti has created a dictionary that stores Product names as key and price as values. Write a user-defined
function to perform the following operations: 3
• Push the values into the stack if the price of products is greater than 100.
• Pop and display the contents of the stack.
For example, if the content of the dictionary is as follows:
product={‘Book’:250, ‘Pen’:120, ‘Pencil’:50, ‘Notebook’:400, ‘Register’:480}
The elements of the stack should be:
[250, 120, 400, 480]
OR
Prateek has created a list arr with some elements. Help him to create a user-defined function to perform
the following tasks:
• Create a stack after checking the elements if it is even then multiply by 2 and if the element is odd, then
multiply it by 3.
• Pop and display the contents of the stack.
Sample Input Data of the list arr = [2,3,4,5,6,7,8,9,10]
Output stack: NewSt = [4, 9, 8, 15,12, 21, 16, 27,20]
Ans. product={'Book':250, 'Pen':120, 'Pencil':50, 'Notebook':400, 'Register':480}
def push(st,a):
st.append(a)
print(st)
def pop(st):
if st==[]:
print('Underflow')
Sample Question Paper 2 Term II

else:
print(st.pop(0))
st=[]
for i,j in product.items():
if j>100:
push(st,j)
while True:
if st!=[]:
print(pop(st),end=" ")
else:
break A.3
OR
Ans. def push(NewSt,arr):
for i in arr:
if i%2==0:
NewSt.append(i*2)
else:
NewSt.append(i*3)
print(NewSt)
def pop(st):
if st==[]:
print('Underflow')
else:
print(st.pop(0))
arr=[2,3,4,5,6,7,8,9,10]
NewSt=[]
push(NewSt,arr)
while True:
if NewSt!=[]:
print(pop(NewSt),end=" ")
else:
break
9. (i) A table Transport is created with the following columns: 1
Bus_No, Bus_route, Area, No_of_students, Helper_Name, Charges

Write an SQL command to increase the Bus charges by 12% for all students.
Ans. Update Transport
Set Charges = Charges*0.12;
(ii) Identify the commands and categorize them into DDL and DDL commands. 2
(i) To add a new row into the table.
(ii) To modify the datatype of the column of a table.
Ans. (i) Insert Into command – DML command
Computer Science with Python–XII

(ii) Alter table …. Modify – DDL command


10. Ms Swati has created a database MySchool and wants to create a table in SQL to store the records of
students. The structure of the table Student is given below: 3
Table: Student
ColumnName Data type size Constraint
RollNo Integer 4 Primary Key
Sname Varchar 25 Not Null
Gender Char 1 Not Null
DOB Date Not Null
Fees Integer 4 Not Null
Hobby Varchar 15 Null

A.4
(i) Write SQL command to create table Student.
(ii) Write SQL command to delete column Hobby.
Ans. (i) Create Table Student(
RollNo integer(4) Primary Key,
SName varchar(25) NOT NULL,
Gender char(1)NOT NULL,
DOB Date NOT NULL,
Fees integer(4) NOT NULL,
Hobby varchar(15) Null);
(ii) Alter Table Student
Drop Hobby;
SECTION C
Each question carries 4 marks
11. Consider the following tables Product and Client. Write SQL commands for the statements (i) to (iv). 4
Table: Product
P_ID ProductName Manufacturer Price Discount
TP01 Talcum Powder LAK 40 NULL
FW05 Face Wash ABC 45 5
BS01 Bath Soap ABC 55 NULL
SH06 Shampoo XYZ 120 10
FW12 Face Wash XYZ 95 NULL
Table: Client
C_ID ClientName City P_ID
01 Cosmetic Shop Delhi TP01
02 Total Health Mumbai FW05
03 Live Life Delhi BS01
04 Pretty Woman Delhi SH06
05 Dreams Delhi FW12
(i) To display ProductName, Price and ClientName city-wise.
(ii) To display the sum of the price of all products where there is no discount.
(iii) To display the name of products with the maximum price manufacturer-wise.
(iv) To count the total number of different manufacturers.
Ans. (i) Select P.ProductName, P.Price, C.ClientName from Product P, Client C Where
P.P_ID = C.P_ID Group By City;
(ii) Select Sum(Price) from Product Where Discount=NULL;
Sample Question Paper 2 Term II

(iii) Select ProductName, Max(Price) from Product Group By Manufacturer;


(iv) Select Count (Distinct Manufacturer) from Product;
12. (i) Give one advantage of bus topology. Also, draw how four computers can be connected with each other
in the star topology. 2
OR
Define the following terms:
Wi-Fi, FTP
Ans. In a bus topology, the workstations can easily be extended or removed.
In star topology, four computers can be connected with each other through a central device—hub or
switch.

A.5
Hub/Switch

Star topology
OR

Wi-fi: Wi-Fi is the wireless technology used to connect computers, tablets, smartphones and other devices
to the internet wirelessly using microwaves.
FTP: FTP stands for File Transfer Protocol. It is a network protocol for transmitting files between computers
over Transmission Control Protocol/Internet Protocol (TCP/IP) connections. It is also used to download
new applications via web browsers.
(ii) Differentiate between Router and Gateway. 2
Router: Routers operate in the physical, data link and network layers of the OSI model. They decide the
path a packet should take. A router is a networking device whose software and hardware are usually
tailored to the tasks of routing and forwarding data packets across the network.
Gateway: A gateway operates on all the seven layers of the OSI model. A network gateway is a computer
that has internet-working capability of joining together two networks that use different base
protocols. The gateway converts one protocol to another and can, therefore, connect two dissimilar
networks.
13. The University of Correspondence in Allahabad is setting up a network between its different wings. There
are 4 wings named Science (S), Journalism (J), Arts (A) and Home Science (H). 4

Science Journalism

Arts Home Science

Distance between various wings:



Wing A to Wing S 100 m
Computer Science with Python–XII

Wing A to Wing J 200 m


Wing A to Wing H 400 m
Wing S to Wing J 300 m
Wing S to Wing H 100 m
Wing J to Wing H 450 m
Number of Computers:
Wing A 150
Wing S 10
Wing J 5
Wing H 50

A.6
(a) Suggest and draw a cable layout to efficiently connect various wings of the building within the university.
(b) Name the wing where the Server is to be installed. Justify your answer.
(c) Suggest the placement of the Repeater in the network.
(d) The university is planning to establish the online classes. Name two applications that can be used to
schedule and manage online classes.
Ans. (a) The most suitable cable layout is:

Science (S) Journalism (J)

Arts (A) Home Science (H)

(b) The Server should be installed in Wing A (Arts) as Wing A has the maximum number of computers and
installing the server in this wing will help reduce the network traffic.
(c) Repeater will be required in all the wings as the distance between each wing is equal to and greater
than 100.
(d) (i) Microsoft Teams
(ii) Zoom Meeting

Sample Question Paper 2 Term II

A.7

You might also like