100% found this document useful (2 votes)
1K views45 pages

CS - MOCK TEST PAPER - Term II 2022 - V4

Cs mock test and sample papers
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
100% found this document useful (2 votes)
1K views45 pages

CS - MOCK TEST PAPER - Term II 2022 - V4

Cs mock test and sample papers
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/ 45

®

MOCK TEST-2022
COMPUTER
SCIENCE
WITH CBSE SAMPLE PAPER
As per the CBSE Revised Rationalized Curriculum of Computer Science code (083)
and Circular No. Acad-51 Dt. 5.7.2021, Acad-53 Dt. 22.7.2021 &
Circular no. Acad-07/2022 Dt. 14-01-22 for session 2021-2022

Author
l CBSE Sample Paper 2021-2022
HARPREET MALVAI
(Term– 2) M.Sc, MCA
l CBSE Marking Scheme
FOR CBSE
l Practice Paper(Solved) (1-3)
Mock Test (I & II)
XII
l

Term–2
Mock Test Based on
CBSE Sample Paper Term–2
issued by CBSE on Dt. 14.01.2022

PUBLISHED BY

Chandigarh–Bengaluru–Delhi–Guwahati–Hyderabad–Indore
Jammu–Jaipur–Kolkata–Lucknow–Mumbai–Patna–Ranchi
COMPLIMENTARY COPY
COMPUTER SCIENCE (083) CLASS-XII

l CBSE Sample Paper 2021-22 (Term-II)

l CBSE Marking Scheme

l Sample Paper 2021-22 (1-3)

l Mock Test (I & II)

l Answers of Mock Test will be discussed by


the author 10 days before the examination
through the Webinar.

PUBLISHED BY

H.O. : 576, INDUSTRIAL AREA, PHASE-9, MOHALI-160062 (Chandigarh)


PHONES : 0172- 3590239 (M) 7347029576, 9216629576
E-mail : vishvasbooks@yahoo.co.in; vishvasbooks@gmail.com
SALES OFFICES
DELHI : 9818270717 LUCKNOW : 9216520167 KOLKATA : 9331003099
MUMBAI : 9216629576 JAMMU : 9216521167 HYDERABAD : 9216520167
BENGALURU : 7347029576 RANCHI : 7347029576 PATNA : 8146242167
INDORE : 8146242167 GUWAHATI : 9256657505 JAIPUR : 9216521167

All rights reserved. No part of this publication may be reproduced, stored in a retrieval system or
transmitted, in any form or by any means, electronic, mechanical, photocopying, recording or
otherwise, without the prior permission of the Publisher.
E-mail : info@vishvasbook.com
In spite of our sincere efforts, there might have crept in some
deficiencies in the preparation of this book for which the Authors and
Publisher should not be held responsible. However, constructive © Copyright Reserved
suggestions for further improvement of this book will be highly
appreciated and looked forward in our subsequent editions. For latest Printed at :
update in syllabus and marking scheme visit : www.cbse.nic.in PRINTOMEX PRINTERS
MOHALI – 160062
Curriculum
Computer Science
CLASS-XII (083) 2021-22(Term-II)
1. Prerequisites
Computer Science- Class XI

2. Learning Outcomes
Student should be able to
a) apply the concept of function.
b) explain and use the concept of file handling.
c) use basic data structure: Stacks.
d) explain basics of computer networks.
e) use Database concepts, SQL along with connectivity between Python and SQL.

3. Distribution of Marks:

Unit Unit Name Marks Period


No.
Theory Practical
I Computational Thinking and Programming - 2 40 50 25
II Computer Networks 10 10 –
III Database Management 20 20 15

Total 70 80 40

Unit Unit Name Term–1 Term–2


I Computational Thinking and Programming - 2 35 5
II Computer Networks – 10
III Database Management – 20

Total 35 35

4. Unit wise Syllabus


TERM 2:
Unit I: Computational Thinking and Programming – 2
l Data Structure: Stack, operations on stack (push & pop), implementation of stack using list.

III
Unit II: Computer Networks
l Evolution of networking: introduction to computer networks, evolution of networking
(ARPANET, NSFNET, INTERNET)
l Data communication terminologies: concept of communication, components of data
communication (sender, receiver, message, communication media, protocols), measuring
capacity of communication media (bandwidth, data transfer rate), IP address, switching
techniques (Circuit switching, Packet switching)
l Transmission media: Wired communication media (Twisted pair cable, Co-axial cable, Fiber-
optic cable), Wireless media (Radio waves, Micro waves, Infrared waves.
l Network devices (Modem, Ethernet card, RJ45, Repeater, Hub, Switch, Router, Gateway,
WIFI card)
l Network topologies and Network types: types of networks (PAN, LAN, MAN, WAN),
networking topologies (Bus, Star, Tree)
l Network protocol: HTTP, FTP, PPP, SMTP, TCP/IP, POP3, HTTPS, TELNET, VoIP
l Introduction to web services: WWW, Hyper Text Markup Language (HTML), Extensible
Markup Language (XML), domain names, URL, website, web browser, web servers, web
hosting

Unit III: Database Management


l Database concepts: introduction to database concepts and its need
l Relational data model: relation, attribute, tuple, domain, degree, cardinality, keys
(candidate key, primary key, alternate key, foreign key)
l Structured Query Language: introduction, Data Definition Language and Data Manipulation
Language, data type (char(n), varchar(n), int, float, date), constraints (not null, unique,
primary key), create database, use database, show databases, drop database, show tables,
create table, describe table, alter table (add and remove an attribute, add and remove
primary key), drop table, insert, delete, select, operators (mathematical, relational and
logical), aliasing, distinct clause, where clause, in, between, order by, meaning of null, is
null, is not null, like, update command, delete command
l Aggregate functions (max, min, avg, sum, count), group by, having clause, joins : Cartesian
product on two tables, equi-join and natural join
l Interface of python with an SQL database: connecting SQL with Python, performing insert,
update, delete queries using cursor, display data by using fetchone(), fetchall(), rowcount,
creating database connectivity applications

IV
5. Practical

S. Marks Term-1 Term-2


No (Total 30) (15 Marks) (15 Marks)

1 Lab Test: 8 6 2
1. Python program
2. 3 SQL Queries based on one/two table(s), 2 output 4 – 4
questions based on SQL queries
2 Report file: 7 4 3
Term – 1 : Minimum 15 Python programs based on
Term – 1 Syllabus
Term – 2 :
l Minimum 3 Python programs based on Term-2
Syllabus
l SQL Queries – Minimum 5 sets using one table /
two tables.
l Minimum 2 programs based on Python - SQL
connectivity.

3 Project (using concepts learnt in Classes 11 and 12) 8 3 5


Term – 1 : Synopsis of the project to be submitted by
the students (documentation only, may not submit the
code during Term - 1)
Term - 2 : Final coding + Viva voce
(Student will be allowed to modify their Term 1
document and submit the final executable code.)
4 Viva voce 3 2 1

6. Suggested Practical List:


Term-2
Python Programming
l Write a Python program to implement a stack using list.

Database Management
l Create a student table and insert data. Implement the following SQL commands on the
student table:
o ALTER table to add new attributes / modify data type / drop attribute
o UPDATE table to modify data
o ORDER By to display data in ascending / descending order
o DELETE to remove tuple(s)

V
o GROUP BY and find the min, max, sum, count and average
o Joining of two tables.
l Similar exercise may be framed for other cases.
l Integrate SQL with Python by importing suitable module.

PROJECT
The aim of the class project is to create something that is tangible and useful using Python file
handling/ Python-SQL connectivity. This should be done in groups of two to three students and
should be started by students at least 6 months before the submission deadline. The aim here is
to find a real world problem that is worthwhile to solve.
Students are encouraged to visit local businesses and ask them about the problems that they
are facing.
For example, if a business is finding it hard to create invoices for filing GST claims, then students
can do a project that takes the raw data (list of transactions), groups the transactions by
category, accounts for the GST tax rates, and creates invoices in the appropriate format.
Students can be extremely creative here. They can use a wide variety of Python libraries to
create user friendly applications such as games, software for their school, software for their
disabled fellow students, and mobile applications, of course to do some of these projects, some
additional learning is required; this should be encouraged. Students should know how to teach
themselves.
The students should be sensitised to avoid plagiarism and violations of copyright issues while
working on projects. Teachers should take necessary measures for this.

VI
ABOUT THE AUTHOR
Harpreet Malvai has been teaching Computer Science for more than
two decades in some of the top schools in India, including Maharani
Gayatri Devi School, Jaipur and Carmel Convent School, Chandigarh. She
is MSc, M.C.A and honours graduate from the Advanced Centre for
Mathema cs, Panjab University, Chandigarh. She has done
specializa on courses in 'Data Science in Python' and 'Applied Data
Visualiza on in Python' from University of Michigan (USA). She has also
done 'Python for Data Science, Ar ficial Intelligence and
Development' and 'What is Data Science?' from IBM. Along with these
technical courses she has successfully done a course in wri ng from
University of California, Berkeley (USA).
She is the director of a founda on for inclusivity in educa on and has been felicitated by the
CBSE for her contribu on to educa on through outreach programmes. In her teaching
career the endeavour has been to reach to all levels of learners at their level and her students
have performed well consistently. Some of her students have topped the CBSE board in her
subject, in fact one year, two toppers out of the five toppers of the board were her students.

ABOUT THE BOOKS


THE TEXTBOOK OF COMPUTER SCIENCE(083) FOR CLASS XI AND XII
BY HARPREET MALVAI
The two books are published based on the latest complete syllabus of Computer Science
with Python (Code No. 083) issued by the Central Board of Secondary Education for Classes
XI and XII.
The books will make the subject really easy and fun to learn.
The highlights of class XII book:
l All concepts are explained in a simple language, in
detail and with examples.
l All questions are answered, program codes are
worked out.
l There are case studies which are also explained and
program codes are given.
l The book provides QR codes and links for programs so
you can use your phone to check and execute the
program code without downloading any software.
l The book is also complemented by QR code which
features the chapters from the book in 15-18-minute
videos.
l The book has complete projects with working codes.

VII
MOCK TEST-2022 COMPUTER SCIENCE 8

CBSE SAMPLE QUESTION PAPER


COMPUTER SCIENCE (083) SESSION 2021-22
Class XII (TERM-II)
Time allowed: 2 hours Maximum Marks: 35
General instructions:
l The question paper is divided into 3 sections – A, B and C
l Section A, consists of 7 questions (1-7). Each question carries 2 marks.
l Section B, consists of 3 questions (8-10). Each question carries 3 marks.
l Section C, consists of 3 questions (11-13). Each question carries 4 marks.
l Internal choices have been given for question numbers 7, 8 and 12.

(SECTION A)
Each question carries 2 marks

Q1. Give any two characteristics of stacks. (2)


Q2. (i) Expand the following: (1)
SMTP, XML
(ii) Out of the following, which is the fastest wired and wireless medium of transmission? (1)
Infrared, coaxial cable, optical fibre, microwave, Ethernet cable
Q3. Differentiate between char(n) and varchar(n) data types with respect to databases. (2)
Q4. A resultset is extracted from the database using the cursor object (that has been already created)
by giving the following statement. (2)
Mydata=cursor.fetchone()
(a) How many records will be returned by fetchone() method?
(b) What will be the datatype of Mydata object after the given command is executed?
Q5. Write the output of the queries (a) to (d) based on the table, Furniture given below: (2)
Table: FURNITURE
FID NAME DATEOFPURCHASE COST DISCOUNT
B001 Double Bed 03-Jan-2018 45000 10
T010 Dining Table 10-Mar-2020 51000 5
B004 Single Bed 19-Jul-2021 22000 0
C003 Long Back Chair 30-Dec-2016 12000 3
T006 Console Table 17-Nov-2019 15000 12
B006 Bunk Bed 01-Jan-2021 28000 14
9 CBSE SAMPLE QUESTION PAPER – XII

(a) SELECT SUM(DISCOUNT) FROM FURNITURE WHERE COST>15000;


(b) SELECT MAX(DATEOFPURCHASE) FROM FURNITURE;
(c) SELECT * FROM FURNITURE WHERE DISCOUNT>5 AND FID LIKE "T%";
(d) SELECT DATEOFPURCHASE FROM FURNITURE WHERE NAME IN ("Dining Table",
"Console Table");
Q6. (i) Which command is used to view the list of tables in a database? (1)
(ii) Give one point of difference between an equi-join and a natural join. (1)
Q7. Consider the table, MOVIEDETAILS given below: (2)
Table: MOVIEDETAILS
MOVIEID TITLE LANGUAGE RATING PLATFORM

M001 Minari Korean 5 Netflix

M004 MGR Magan Tamil 4 Hotstar

M010 Kaagaz Hindi 3 Zee5

M011 Harry Potter and the Chamber of Secrets English 4 Prime Video

M015 Uri Hindi 5 Zee5

M020 Avengers: Endgame English 4 Hotstar

(a) Identify the degree and cardinality of the table.


(b) Which field should be made the primary key? Justify your answer.
OR
(a) Identify the candidate key(s) from the table MOVIEDETAILS.
(b) Consider the table SCHEDULE given below:
Table: SCHEDULE

SLOTID MOVIEID TIMESLOT


S001 M010 10 AM to 12 PM
S002 M020 2 PM to 5 PM
S003 M010 6 PM to 8 PM
S004 M011 9 PM to 11 PM

Which field will be considered as the foreign key if the tables MOVIEDETAILS and SCHEDULE are
related in a database?
MOCK TEST-2022 COMPUTER SCIENCE 10

(SECTION B)
Each question carries 3 marks

Q8. Julie has created a dictionary containing names and marks as key value pairs of 6 students. Write a
program, with separate user defined functions to perform the following operations: (3)
l Push the keys (name of the student) of the dictionary into a stack, where the corresponding
value (marks) is greater than 75.
l Pop and display the content of the stack.
For example:
If the sample content of the dictionary is as follows:
R={"OM":76, "JAI":45, "BOB":89, "ALI":65, "ANU":90, "TOM":82}
The output from the program should be:
TOM ANU BOB OM
OR
Alam has a list containing 10 integers. You need to help him create a program with separate user
defined functions to perform the following operations based on this list.
l Traverse the content of the list and push the even numbers into a stack.
l Pop and display the content of the stack.
For Example:
If the sample Content of the list is as follows:
N=[12, 13, 34, 56, 21, 79, 98, 22, 35, 38]

Sample Output of the code should be:


38 22 98 56 34 12
Q9. (i) A table, ITEM has been created in a database with the following fields: (1)
ITEMCODE, ITEMNAME, QTY, PRICE
Give the SQL command to add a new field, DISCOUNT (of type Integer) to the ITEM table.
(ii) Categorize following commands into DDL and DML commands? (2)
INSERT INTO, DROP TABLE, ALTER TABLE, UPDATE...SET
Q10. Charu has to create a database named MYEARTH in MYSQL. She now needs to create a table named
CITY in the database to store the records of various cities across the globe. The table CITY has the
following structure: (3)
11 CBSE SAMPLE QUESTION PAPER – XII

Table: CITY

FIELD NAME DATA TYPE REMARKS


CITYCODE CHAR(5) Primary Key
CITYNAME CHAR(30)
SIZE INTEGER
AVGTEMP INTEGER
POLLUTIONRATE INTEGER
POPULATION INTEGER

Help her to complete the task by suggesting appropriate SQL commands.

(SECTION C)
Each question carries 4 marks
Q11. Write queries (a) to (d) based on the tables EMPLOYEE and DEPARTMENT given below: (4)
Table: EMPLOYEE

EMPID NAME DOB DEPTID DESIG SALARY

120 Alisha 23-Jan-1978 D001 Manager 75000

123 Nitin 10-Oct-1977 D002 AO 59000

129 Navjot 12-Jul-1971 D003 Supervisor 40000

130 Jimmy 30-Dec-1980 D004 Sales Rep

131 Faiz 06-Apr-1984 D001 Dep Manager 65000

Table: DEPARTMENT

DEPTID DEPTNAME FLOORNO

D001 Personal 4

D002 Admin 10

D003 Production 1

D004 Sales 3
MOCK TEST-2022 COMPUTER SCIENCE 12

(a) To display the average salary of all employees, department wise.


(b) To display name and respective department name of each employee whose salary is more than
50000.
(c) To display the names of employees whose salary is not known, in alphabetical order.
(d) To display DEPTID from the table EMPLOYEE without repetition.
Q12. (i) Give two advantages and two disadvantages of star topology (2)
OR
Define the following terms:
www , web hosting
(ii) How is packet switching different from circuit switching? (2)
Q13. BeHappy Corporation has set up its new centre at Noida, Uttar Pradesh for its office and web-based
activities. It has 4 blocks of buildings. (4)
Distance between the various blocks is as follows:
BeHappy Corporation
A to B 40 m
B to C 120m Block B
C to D 100m Block A
A to D 170m
B to D 150m
A to C 70m
Numbers of computers in each block Block D
Block C
Block A - 25
Block B - 50
Block C - 125
Block D - 10
(a) Suggest and draw the cable layout to efficiently connect various blocks of buildings within the
Noida centre for connecting the digital devices.
(b) Suggest the placement of the following device with justification
i. Repeater
ii. Hub/Switch
(c) Which kind of network (PAN/LAN/WAN) will be formed if the Noida office is connected to its head
office in Mumbai?
(d) Which fast and very effective wireless transmission medium should preferably be used to connect
the head office at Mumbai with the centre at Noida?
13 MARKING SCHEME – XII

MARKING SCHEME
COMPUTER SCIENCE (CODE-083)
CLASS XII TERM-II SESSION 2021-22
Time allowed: 2 hours Maximum Marks: 35

General instructions:
l The question paper is divided into 3 sections – A, B and C

l Section A, consists of 7 questions (1-7). Each question carries 2 marks.


l Section B, consists of 3 questions (8-10). Each question carries 3 marks.
l Section C, consists of 3 questions (11-13). Each question carries 4 marks.
l Internal choices have been given for question numbers 7, 8 and 12.

Section -A
Each question carries 2 marks
Q. Part Question Marking Marks
No No. Instructions

1. Characteristics of Stacks: 1 mark for each (2)


l It is a LIFO data structure point
l The insertion and deletion happens at one end i.e. from the
top of the stack
2. (i) SMTP : Simple Mail Transfer Protocol ½ mark for each (1)
XML: Extensible Mark Up Language correct expansion
(ii) Wired- optical fibre ½ mark for each (1)
Wireless – microwave correct answer
3. char(n): 1 mark for each (2)
l stores a fixed length string between 1 and 255 correct difference
l if the value is of smaller length, adds blank spaces (minimum 2
l some space is wasted differences to be
varchar(n) : given)
l stores a variable length string
l no blanks are added even if value is of smaller length
l no wastage of space

4. (a) One record 1 mark for each (2)


(b) tuple correct answer
MOCK TEST-2022 COMPUTER SCIENCE 14

5. (a) 29 ½ mark for each (2)


(b) 19-Jul-2021 correct output
(c) T006 Console Table 17-Nov-2019 15000 12
(d) 10-Mar- 2020 17-Nov-2019
6. (i) SHOW TABLES; 1 mark for correct (1)
answer
(ii) Equi- join: 1 mark for correct (1)
l The join in which columns from two tables are compared for difference (Any
equality one point may be
l Duplicate columns are shown given)
Natural Join
l The join in which only one of the identical columns existing in
both tables is present
l No duplication of columns

7. (a) Degree: 5 ½ mark each for


Cardinality: 6 correct degree and
cardinality

(b) MOVIEID should be made the primary key as it uniquely ½ mark for correct (2)
identifies each record of the table. field and ½ mark
for justification
OR

(a) MOVIEID and TITLE ½ mark for each


correct field name

(b) MOVIEID 1 mark for correct


answer

SECTION – B
Each question carries 3 marks

8. # Question No 8 (first option) 1 mark for correct


R={"OM":76, "JAI":45, "BOB":89, PUSH operation
"ALI":65, "ANU":90, "TOM":82}
def PUSH(S,N):
S.append(N)
def POP(S):
if S!=[]:
return S.pop()
else:
15 MARKING SCHEME – XII

return None 1 mark for correct


ST=[] POP operation
for k in R:
if R[k]>=75:
PUSH(ST,k) 1 mark for correct
while True: function calls and
if ST!=[]: displaying the
print(POP(ST),end=" ") output (3)
else:
break
OR
1 mark for correct
# Question No 8 (second option)
PUSH operation
N=[12, 13, 34, 56, 21, 79, 98, 22, 35, 38]
def PUSH(S,N):
1 mark for correct
S.append(N)
POP operation
def POP(S):
if S!=[]:
return S.pop()
else: 1 mark for correct
return None function calls and
ST=[] displaying the
for k in N: output
if k%2==0:
PUSH(ST,k)
while True:
if ST!=[]:
print(POP(ST),end=" ")
else:
break
Note: Marks to be
awarded for any
other correct logic
given by the
student

9. (i) ALTER TABLE Item 1 mark for correct (1)


ADD (Discount INT); command

(ii) DDL: DROP TABLE, ALTER TABLE ½ mark for each (2)
DML: INSERT INTO, UPDATE...SET correct command
identified
MOCK TEST-2022 COMPUTER SCIENCE 16

CREATE DATABASE MYEARTH; 1 mark for


correctly creating
CREATE TABLE CITY database.
(
CITYCODE CHAR(5)PRIMARY KEY,
CITYNAME CHAR(30), 2 marks for (3)
SIZE INT, correctly creating
AVGTEMP INT, the table.
POPULATIONRATE INT,
POPULATION INT,
);
SECTION – C
Each question carries 4 marks

11. (a) SELECT AVG(SALARY) 1 mark for each (4)


FROM EMPLOYEE GROUP BY DEPTID; correct query
(b) SELECT NAME, DEPTNAME
FROM EMPLOYEE, DEPARTMENT
WHERE
EMPLOYEE.DEPTID=
DEPARTMENT.DEPTID
AND SALARY>50000;
(c) SELECT NAME FROM EMPLOYEE
WHERE SALARY IS NULL
ORDER BY NAME;
(d) SELECT DISTINCT DEPTID
FROM EMPLOYEE;
12. (i) Advantages ½ mark for each
l Ease of service correct advantage /
l Centralized control disadvantage
l Easy to diagnose faults
l One device per connection

Disadvantages
l long cable length
l difficult to expand (2)
l central node dependency

OR
www: a set of protocols that allow you to access any document
on the internet through the naming systems based on URLs 1 mark for each
Web hosting: Web hosting is a service that allows correct definition
organizations and individuals to post a website or web page onto
the server, which can be viewed by everyone on the Internet.
17 MARKING SCHEME – XII

(ii) Packet switching: 1 mark for each


l uses store and forward concept to send messages correct difference
l no physical path is actually establishes (minimum two
l message is divided into smaller parts, known as packets and points should be
then sent forward given)
l tight upper limit on block size
l Each data unit knows only the final receiver’s address (2)

Circuit switching
l physical connection is established between sender and
receiver
l Each data unit knows the entire path from sender to receiver
l It does not follow store and forward concept

13. (a) 1 mark for each


BeHappy Corporation correct answer
Block B
Block A

Block D (4)
Block C

(b) Repeater : between C and D as the distance between them is


100 mts.
Hub/ Switch : in each block as they help to share data packets
within the devices of the network in each block
(c) WAN.
(d) Satellite
MOCK TEST-2022 COMPUTER SCIENCE 18

PRACTICE PAPER–1(SOLVED)
COMPUTER SCIENCE (083)
Time allowed: 2 hours Maximum Marks: 35
General instructions:
l The question paper is divided into 3 sections – A, B and C
l Section A, consists of 7 questions (1-7). Each question carries 2 marks.
l Section B, consists of 3 questions (8-10). Each question carries 3 marks.
l Section C, consists of 3 questions (11-13). Each question carries 4 marks.
l Internal choices have been given for question numbers 7, 8 and 12.

(SECTION A)
Each question carries 2 marks

Q1. Give any two characteristics of queues. (2)


Ans. Characteristics of queues:
l It is a FIFO data structure
l The insertion takes place at the end and using append( ) and deletion takes place from the
first/beginning of the queue using pop(0).
Q2. (i) Expand the following: (1)
PPP , POP3
(ii) Out of the following, which is the fastest wired and wireless medium of transmission? (1)
Twisted Pair Cable, Coaxial cable, opticalfibre, Radio wave,
Ethernet cable.
Ans. (i) Point to Point Protocol, Post Office Protocol 3
(ii) Cheapest Transmission medium: Twisted Pair Cable
Fastest Transmission medium : Radio wave
Q3. Name 4 Data types used to store Numeric data in Databases? (1)
Ans. INT/INTEGER, SMALLINT, DEC/DECIMAL, FLOAT
Q4. A resultset is extracted from the Customer table using the cursor object (that has been already
created) by giving the following statement.
Rec_Data=cursor.fetchall()
(a) How many records of the table will be returned by fetchall() method?
(b) What will be the datatype of Rec_Data object after the given command is executed?
Ans. (a) In case the table has records then all the records will be returned as a list of tuples, otherwise it will
return an empty list.
(b) List of tuples
Q5. Write the output of the queries (a) to (d) based on the table Sportstars, given below: (2)
19 SAMPLE QUESTION PAPER-1(SOLVED) – XII

Table: Sportstars
Admn_No Name DOB Sport Medals Class
V1237 Vanshika 2005-02-19 Tennis 3 11
S1432 Ruhaani 2005-09-11 Football 5 12
SM1781 Aalam 2005-07-01 Cricket 4 11
V1935 Manan 2005-04-07 Football 6 11
S1276 Aarav 2005-10-06 Tennis 4 12
SM1872 Rehaan 2004-12-11 Football 3 12

a) SELECT COUNT(*) FROM Sportstars WHERE Medals>=4;


b) SELECT SUM(Medals) FROM Sportstars WHERE Class=12;
c) SELECT MAX(DOB) FROM Sportstars;
d) SELECT DOB FROM Sportstars WHERE Admn_No LIKE "SM%”
2005-07-01
Ans. a) 4 b) 12 c) 2005-10-06 d)
2005-04-07

Q6. (i) Which command deletes an entire table, a view of a table or other objects in the database? (1)
(ii)What are SQL Joins? (1)
Ans. (i) DROP TABLE tablename
(ii)The SQL Joins are used to combine records from two or more tables in a database. A JOIN is a
means for combining fields from two tables by using values common to each.
Q7. Consider the Table Customers given below: (2)
ID Name Age City Salary
1 Kashika 37 Jammu 80000.00
2 Anupriya 35 Shimla 75000.00
3 Vijayan 36 Hyderabad 65000.00
4 Krishnan 35 Chennai 55000.00
5 Harsh 37 Gandhinagar 85000.00
6 Raisa 32 Mumbai 45000.00
8 Clifford 36 Chennai 65000.00
9 Jaisha 36 Mumbai 85000.00
10 Aseem 37 Hyderabad 75000.00
11 Shona 35 Hyderabad 65000.00
12 Manan 38 Jammu 60000.00

(a) Identify the degree and cardinality of the table.


MOCK TEST-2022 COMPUTER SCIENCE 20

(b) Which field should be made the primary key? Justify your answer.
Ans. (a) Degree: 5 Cardinality: 11
(b) The field ID should be made the primary key as it uniquely identifies each record of the table.

SECTION – B
Each question carries 3 marks
Q.8 Write a function in Python ENQ(Evenlist), where Evenlist is a list of numbers, from which we will
enqueue all the even numbers into a queue implemented by using a list. Display the queue if it has at
least one element, otherwise display appropriate error message. (3)
Ans. def ENQ(Evenlist):
qlist=[]
for element in Evenlist:
if element%2==0:
qlist.append(element)
if len(qlist)>0:
return qlist
else:
return "Underflow Error:Stack is Empty”
Q9. (i) A table, SPORTSTARS has been created in a database with the following fields: (3)
Admn_No, Name, DOB, Sport, Medals, Class
Give the SQL command to rename the field Class to Grade in this table.
(ii) Which of the following is a DDL command?
DELETE FROM, DROP TABLE, CREATE TABLE, INSERT INTO
Ans. (i) ALTER TABLE sportstars RENAME COLUMN Class TO Grade;
(ii) DDL: DROP TABLE, CREATE TABLE
Q10. Golden Tulips is using MySQL to create a database called STUDENTDETAILS with a table Student
which the following structure. Write the SQL commands for doing the same. (3)
Field Data Type Remarks NULL
StudentID char(10) Primary Key NO
NAME varchar(30) NO
DOB date NO
CITY varchar(30) YES
MARKS int YES
Email varchar(30) YES
Ans. The SQL commands are:
CREATE DATABASE STUDENTDETAILS;
CREATE TABLE Student(StudentID CHAR(10) PRIMARY KEY,NAME VARCHAR(30)
NOT NULL,DOB date NOT NULL, CITY VARCHAR(30),MARKS INTEGER);
21 SAMPLE QUESTION PAPER-1(SOLVED) – XII

(SECTION C)
Each question carries 4 marks

Q11. Write SQL commands for the queries (a)-(d) based on the two tables TAXITYPE and TRAVEL (4)
TABLE: TAXITYPE

TAXI_CODE TAXITYPE PERKM


T01 TEMPO TRAVELLER 40

T02 AC INNOVA 20
T03 AC ERTIGA 15

T04 AC HATCHBACK 10

T05 AC SEDAN 10

TABLE: TRAVEL

CNO CNAME TRAVELDATE KM TAXI_CODE NOP


101 Randeep Singh 2018-11-07 200 T01 12
102 Sharad Bali 2018-12-21 120 T04 4
105 Sangeeta M 2019-04-25 450 T01 15
103 Manish Nagpal 2019-01-29 280 T02 5
107 Veronica Masih 2019-03-12 365 T04 2
104 Dinesh Hoon 2019-10-28 290 T05 4
106 Ramita Malik 2019-04-06 100 T01 20

a) To display CNO, CNAME, TRAVELDATE from the table TRAVEL in descending order of CNO.
b) To display the CNAME of all customers from the table TRAVEL who are travelling by vehicle with
code T01 or T02
c) To display the CNO and CNAME of those customers from the table TRAVEL who travelled between
'2019-01-06' and '2019-05-01'.
d) To display all the details from table TRAVEL for the customers, who have travel distance more than
250 KM in ascending order of NOP (Number of Passengers)
Ans. a) SELECT CNO, CNAME, TRAVELDATE FROM TRAVEL ORDER BY CNO DESC;
b) SELECT CNAME FROM TRAVEL WHERE TAXI_CODE= 'T01' OR TAXI_CODE = 'T02';
OR
SELECT CNAME FROM TRAVEL TAXI_CODE IN ( 'T01', 'T02');
MOCK TEST-2022 COMPUTER SCIENCE 22

c) SELEC T CNO, CNAME from TRAVEL WHERE TRAVELDATE >='2019-01-06' AND


TRAVELDATE<='2019-05-01';
OR
SELECT CNO, CNAME FROM TRAVEL. WHERE TRAVEL DATE BETWEEN '2019-01-06' AND
2019-05-01':
d) SELECT* FROM TRAVEL WHERE KM >250 ORDER BY NOP;
Q12. (i) Give two advantages and two disadvantages of bus topology (4)
OR
Define the following terms:
Bandwidth, IP address
(ii) How are Radio Waves and Microwaves different?
Ans. (i)
Bus Topology

Advantages Disadvantages
1. Easy to install and is used for small 1. Fails if central line fails.
networks. 2. Single communication channel can slow
2. Media requirements low. down the access time.
3. One node failing does not affect the 3. High network traffic can slow down the
network functioning. speed.

OR
Bandwidth: The amount of data that can be transferred over a network in a specific amount of
time is termed as Bandwidth. It is expressed as a bitrate and measured in bits per second (bps),
Mbps and Gbps.
IP address (internet protocol address) is a standard numerical representation that uniquely
identifies a specific interface on the network. An IP address is, generally represented as 4 octets of
numbers from 0-255. The IP address has two parts- the network part and the host part. The first
part of the IP address represents the network and the rest will specify the host including the
individual device.
(ii) Radio Waves Microwaves
Frequency range of Radio Waves is 3 KHz and Frequency range of Microwaves is 1 GHz to
1 GHz 300 Ghz

These are Omni- directional These are Uni- directional


Used for Broadcast and one-to-one Used for one-to-one communication between
communication sender and receiver.
23 SAMPLE QUESTION PAPER-1(SOLVED) – XII

Q13. Ishana Electronics Company headquaters has four blocks of buildings as shown: (4)

Center to center distance between various blocks


B3 TO B1-50 M B1 TO B2-60 M B2 TO B4-25 M
B4 TO B3-170 M B3 TO B2-125 M B1 TO B4-90 M
Number of computers in each block :
B1-150 B2-15
B3-15 B4-25
The computers in each block are already networked, however the company now wants to connect the
blocks.
i. Suggest the most appropriate topology for the connections between the blocks.
a. Ring topology b. Star topology
c. Mesh topology d. Bus topology
ii. The company wants internet accessibility in all the blocks. The suitable and cost-effective
technology for that would be:
a. Satellite b. Lease line
c. Telephone line d. Broadband
iii. The company is planning to link its head office situated in New Delhi with the offices in hilly areas.
Suggest a way to connect it economically:
a. Micro waves b. Coaxial cable
c. Fibre optic d. Radio waves
iv. Suggest the most appropriate location of the server and why?
a. BLOCK B2 b. BLOCK B1
c. BLOCK B4 d. BLOCK B3
Ans. (i) b. Star topology (ii) d. Broadband
(iii) d. Radio waves (iv) b. BLOCK B1 since it has the maximum number of
computers.
MOCK TEST-2022 COMPUTER SCIENCE 24

PRACTICE PAPER–2(SOLVED)
COMPUTER SCIENCE (083)
Time allowed: 2 hours Maximum Marks: 35
General instructions:
l The question paper is divided into 3 sections – A, B and C
l Section A, consists of 7 questions (1-7). Each question carries 2 marks.
l Section B, consists of 3 questions (8-10). Each question carries 3 marks.
l Section C, consists of 3 questions (11-13). Each question carries 4 marks.
l Internal choices have been given for question numbers 7, 8 and 12.

(SECTION A)
Each question carries 2 marks

Q1. Differentiate between queues and stacks (2)


Ans. Stacks Queues
A Stack is a data structure that follows the LIFO
A Queue follows the FIFO(First in First Out)
(Last In First Out) principle. principle.
We can add and remove an element from the It is open from both the ends hence we can easily
top/last place only add elements to the back and can remove/delete
elements from the front.
We use append ( ) to add an element at the We use append ( ) to add an element at the
top/last place and pop( ) to remove the element top/last place and pop(0) to remove the element
from the top/last from the first place.

Q2. (i) Expand the following: (1)


HTTP,FTP
(ii) You want to share some audio files from your friend's laptop using Bluetooth what kind of
network is this? (1)
Ans. (i) Hyper Text Transfer Protocol, File Transfer Protocol
(ii) PAN-Personal Area Network
Q3. (i) Which constraint specifies the values in the column must be unique?
(ii) Which constraint specified with a column uniquely identifies each row in a table? (2)
Ans. (i) UNIQUE (ii) PRIMARY KEY
Q4. Differentiate between fetchone( ) and fetchall( ) (2)
Ans. fetchall( ) : Whenever we execute the SELECT query using the cursor.execute() method the
cursor.fetchall() method extracts a result set of all the rows. It returns these rows as a list of tuples. An
empty list is returned if there is no record to fetch.
fetchone( ): Whenever we execute the SELECT query using the cursor.execute() method it creates a
cursor object. The cursor.fetchone() method returns a single record as a tuple and it returns None if no
rows are available.
25 SAMPLE QUESTION PAPER-2(SOLVED) – XII

Q5. Write the output of the queries (a) to (d) based on the table SMARTWATCH, given below: (2)
Table: SMARTWATCH
WATCHID NAME PRICE QTY_STORE
W1 Fitbit Versa 21000 100
W2 Apple Watch 55000 150
W3 Garmin Fenix 75000 50
W4 Fitbit Versa 21000 100
W5 Samsung Galaxy 27000 200
W6 Amazfit Watch 17000 100
W7 Fossil Hybrid 15000 50

a) SELECT * FROM SMARTWATCH WHERE PRICE>=21000 AND QTY_STORE>100


b) SELECT SUM(QTY_STORE) FROM SMARTWATCH WHERE NAME IN ("Fitbit Versa", "Fossil Hybrid");
c) SELECT MAX(PRICE)+ MIN(PRICE) FROM SMARTWATCH;
d) SELECT AVG(PRICE) FROM SMARTWATCH
Ans. a) b) 250
W2 Apple Watch 55000 150
W5 Samsung Galaxy 27000 200

c) 90000 d) 33000
Q6. (i) Which command is used to see the table structure (1)
(ii) What is a Cartesian join or product on two tables? (1)
Ans. (i) DESC tablename or DESCRIBE tablename
(ii) The Cartesian join is used to generate a paired combination of each row of the first table with each
row of the second table. This join type is also known as cross join. The resultant rows are a product
of the number of rows in each table.
Q7. In the table Loan below (2)
(a) Identify the candidate key(s) from the table Loan.
(b) Which field will be considered as the foreign key if the tables Customers and Loan are related in a
database?
Table Loan
LoanID LoanDate ID EMI Years
1101 2021-03-01 5 20000 4
1102 2021-02-06 3 10000 2
1103 2021-04-12 4 10000 3
1104 2021-05-15 5 5000 3
MOCK TEST-2022 COMPUTER SCIENCE 26

Table Customers:

ID Name Age City Salary


1 Kashika 37 Jammu 80000.00
2 Anupriya 35 Shimla 75000.00

3 Vijayan 36 Hyderabad 65000.00


4 Krishnan 35 Chennai 55000.00
5 Harsh 37 Gandhinagar 85000.00

6 Raisa 32 Mumbai 45000.00

Ans. a) LoanID and LoanDate b) ID is the foreign key

(SECTION B)
Each question carries 3 marks

Q8. Coach Abhishek stores the races and participants in a dictionary. Write a program, with separate
user defined functions to perform the following operations: (3)
l Push the names of the participants of the dictionary onto a stack, where the distance is more
than 100.
l Pop and display the content of the stack. For example:
If the sample content of the dictionary is as follows:
Races ={100:'Varnika', 200 :'Jugal', 400:'Kushal', 800:'Minisha'}}
The output from the program should be:
Minisha Kushal Jugal
Ans. Races ={100:'Varnika',200:'Jugal', 400:'Kushal',800:'Minisha'}
def PUSH(Stk,N):
Stk.append(N)
def POP(Stk):
if Stk!=[]:
return Stk.pop()
else:
return None
stack1=[]
for i in Races:
if i>=200:
PUSH(stack1,Races[i])
27 SAMPLE QUESTION PAPER-2(SOLVED) – XII

while True:
if stack1!=[]:
print(POP(stack1),end=" ")
else:
break
Q9. (i) A table, Students has been created in a database with the following fields: (3)
StudentID, NAME, DOB, CITY, MARKS
Give the SQL command to change the datatype of CITY from Varchar(30) to Char(30).
(ii) Which of the following is a DML command?
SELECT…FROM, CREATE TABLE, INSERT, UPDATE
Ans. (i) ALTER TABLE Students MODIFY COLUMN CITY char(30);
(ii) DML: SELECT…FROM, INSERT INTO, UPDATE...SET
Q10. Maniklal Fabrics is creating a database called Stores with a table called City_Store. Write the SQL
commands for doing the same. (3)
Store_id INT Primary Key
Manager Varchar(20)
Address Varchar(30)
City Varchar(20)
City_Code Char(5)
Last_update Date

Ans. The SQL commands are:


CREATE DATABASE STORES;
CREATE TABLE City_Store (Store_id INT PRIMARY KEY, Manager VARCHAR(20),
Address VARCHAR(30), City VARCHAR(20), City_Code CHAR(5), Last_update date );

(SECTION C)
Each question carries 4 marks

Q11. A database called ecompany has two tables COMPANY and CUSTOMER with the following records.
Write SQL commands for the queries (a)-(d) based on the two tables COMPANY and CUSTOMER
(4)
COMPANY
PID NAME CITY PRODUCTNAME

2101 APPLE DELHI WATCH


MOCK TEST-2022 COMPUTER SCIENCE 28

2102 SAMSUNG BANGALORE MOBILE

2103 PANASONIC DELHI TV

2104 SONY MUMBAI MOBILE

2105 LENOVO INDORE TABLET

2106 DELL MUMBAI LAPTOP

COUSTMER
CUSTID NAME UNITPRICE QTY PID
101 REENA SONI 60,000 10 2102
102 MICHAEL PAUL 50,000 20 2106
103 MEETALI SINGH 70,000 15 2101
104 PARUL SOHAL 55,000 3 2103
105 RAJESH DESWAL 45,000 7 2104

a) Write an SQL statement to display the name of the companies in reverse alphabetical order.
b) To add one more column to the table customer called TOTAL_PRICE which can have up to two
decimal places.
c) Write an SQL statement to count the products city wise.
d) Write an SQL statement to display the customer name, product of the unit price and quantity,
product name where the name of the city is Mumbai.
Ans. a) SELECT NAME FROM COMPANY ORDER BY NAME DESC;
b) ALTER TABLE CUSTOMER ADD TOTAL_PRICE DECIMAL(10,2);
c) SELECT COUNT(*), CITY FROM COMPANY GROUP BY CITY;
d) SELECT CUSTOMER.NAME, UNITPRICE*QTY, PRODUCTNAME FROM COMPANY,
CUSTOMER WHERE COMPANY.PID=CUSTOMER.PID AND CITY= 'MUMBAI';
Q12. (i) Give two advantages and two disadvantages of ring topology. (4)
OR
Define the following terms:
Web Browser, Web server
(ii) Differentiate between wired and wireless Transmission Media.
Ans. (i) Ring Topology
Advantages Disadvantages
This arrangement prevents collisions. Needs more cable than bus.
29 SAMPLE QUESTION PAPER-2(SOLVED) – XII

Data packets travel at greater speeds. Any snag in the cable ring crashes the
network.
Any problems with device and cable can be The network activity is disturbed when adding
easily located. or removing a node.

OR
Web Browser: This is an application software used to view or browse web pages from a web server.
Have to type the exact URL to view the web page to request for a web page. This has no database.
Google Chrome, Safari, Mozilla Firefox, Microsoft Edge are some popular web browsers.
Web Server: This is a technologically advanced machine that stores all the files containing the web
pages which can be viewed by the web browser. Web Servers store, process and deliver web pages
to the users when they receive a request from a browser. The Web Server provides the storage
space for website files. Apache Server is the most popular server.
(ii) Wired Transmission Media: Wired transmission media are the cables that are used in networking.
Popular wired transmission media are twisted pair cable, co-axial cable and fiber optical cable.
Each of them has its own characteristics like transmission speed, effect of noise, physical
appearance, cost etc.
Wireless Transmission Media: Wireless transmission media are the ways of transmitting data
without using any cables. Nowadays wireless communication is becoming popular as it is not
bounded by physical geography. This transmission uses Microwave, Radio wave, Infrared or a
combination of these.
Q13. Jeevan CareGivers Company has set up its head office with 4 blocks of buildings named Block A, Block
B, Block C and Block D. (4)
The number of computers in each block are:
Block A-25 Block B-50
Block C-125 Block D-10
Shortest distances between various Blocks in meters:
Block A to Block B-60 m Block B to Block C-40 m
Block C to Block A-30 m Block D to Block C-50 m
(i) Suggest the most suitable place (i.e. block) to house the server of this company with a suitable
reason.
(ii) Suggest the type of network to connect all the blocks with suitable reason.
(iii) The company is planning to link all the blocks through a secure and high speed wired medium.
Suggest a way to connect all the blocks.
(iv) Suggest the most suitable wired medium for efficiently connecting each computer installed in
every block out of the following network cables:
• Coaxial Cable • Ethernet Cable • Single Pair Telephone Cable.
Ans. (i) Block C , It has maximum number of computer.
(ii) Since the distance between the blocks is less than 1 Km and LAN can be upto 10 Km
(iii) Star topology (iv) Ethernet Cable
MOCK TEST-2022 COMPUTER SCIENCE 30

PRACTICE PAPER–3(SOLVED)
COMPUTER SCIENCE (083)
Time allowed: 2 hours Maximum Marks: 35
General instructions:
l The question paper is divided into 3 sections – A, B and C
l Section A, consists of 7 questions (1-7). Each question carries 2 marks.
l Section B, consists of 3 questions (8-10). Each question carries 3 marks.
l Section C, consists of 3 questions (11-13). Each question carries 4 marks.
l Internal choices have been given for question numbers 7, 8 and 12.

(SECTION A)
Each question carries 2 marks

Q1. Differentiate between enqueue and dequeue. (2)


Ans.
Enqueue Dequeue
This adds an element to the end of the queue and This removes or deletes the element from the
we can use append( ) to add element at the end or beginning of the queue. We use pop(0) to remove
rear of the queue. element from the first place.

Q2. (i) Expand the following: (1)


HTML, URL
(ii) Which is the transmission medium for TV remotes? (1)
Infrared, Coaxial cable, Optical fibre, Microwave, Ethernet cable.
Ans. (i) Hyper Text Markup Language, Uniform Resource Locator
(ii) Infrared
Q3. (i) Which SQL logical operator is used to compare a value with a NULL value? (2)
(ii) Which SQL logical operator is used to search for the presence of a row in a specified table that
meets a certain criterion?
Ans. (i) IS NULL (ii) EXISTS
Q4. How can one create a cursor object? Which property can be used to output the number of rows
resulting from the SQL Query? (2)
Ans. You can create cursor object using the cursor() method of the Connection object/class. The rowcount
property is used to output the number of rows resulted from the SQL query.
Q5. Write the output of the queries (a) to (d) based on the table store_items, given below: (2)
31 SAMPLE QUESTION PAPER-3(SOLVED) – XII

Item_Id Item_Name Item_Brand GST Price Unit


1001 Milk Verka Cat1 25 litre
1002 Curd Verka Cat1 50 kg
1003 Lassi Verka Cat1 30 litre
1004 Chaach Amul Cat1 20 litre
1005 Unpacked Paneer None Cat1 100 kg
1006 Eggs None Cat2 48 dozen
1007 Gur None Cat3 40 kg
1008 Honey None Cat3 200 litre
1009 Salt Tata Cat4 21 kg
1010 Sugar None Cat7 60 kg
1011 Tea Tata Cat8 370 kg
1012 Edible Oils Various Brands Cat13 100 litre
1013 Roasted Coffee Beans Bru Cat8 100 kg

a) SELECT Sum(Price) FROM store_items WHERE GST in ("Cat1", "Cat2");


b) SELECT count(Distinct Item_Brand) FROM store_items;
c) SELECT Item_Name FROM store_items where Unit Like "d%";
d) SELECT * FROM store_items WHERE Price>=200 AND Item_Brand!="None";
Ans. a) 273 b) 6
c) Eggs d) 1011 Tea Tata Cat8 370 kg
Q6. (i) Which clause limits the returned data to a row count? (2)
(ii) What is an equi join?
Ans. (i) LIMIT <number of rows>
(ii) Equi Join
SQL EQUI JOIN performs a JOIN against equality or matching column(s) values of the associated
tables. In this join columns from two tables are compared for equality using an equal sign (=) as
comparison operator in the WHERE clause to refer equality. The equi join results in duplicate
columns.
Syntax
SELECT column_list FROM table1, table2 WHERE table1.column_name
=table2.column_name;
Q7. Consider the table, Store_Items given below: (2)
MOCK TEST-2022 COMPUTER SCIENCE 32

Table Store_Items:
Item_Id Item_Name Item_Brand CategoryID Price Unit
1010 Milk Verka Cat1 20 litre
1012 Curd Amul Cat1 50 kg
1003 Lassi Vita Cat1 30 litre
1024 Chaach Amul Cat1 20 litre
1006 Eggs None Cat2 48 dozen
1007 Gur None Cat3 40 kg
1008 Honey None Cat3 200 litre

1009 Salt None Cat4 21 kg

(a) Identify the candidate keys of the table.


(b) Which field should be made the primary key? Justify your answer.
Ans. (a) Item_Id and Item_Name are the candidate keys
(b) Item_Id should be made the primary key as it uniquely identifies each record of the table.

(SECTION B)
Each question carries 3 marks

Q8. Create a function enqueue( ) to add multiples of 3 up to 30 to a queue. Then dequeue all the items
of this queue using dequeue( ), this function returns the deleted item each time or otherwise it
displays an appropriate error message. Display the numbers from the queue in a single line. (3)
Ans. #Adding elements to the queue
def enqueue(data):
queue.append(data)
#Removing elements from the queue
def dequeue():
if len(queue)>0:
return queue.pop(0)
return ("Queue Empty!")
# executable code
queue=[]
for x in range(3,30,3):
enqueue(x)
for i in range(len(queue)):
print(dequeue(),end=" ")
33 SAMPLE QUESTION PAPER-3(SOLVED) – XII

Q9. (i) Write the SQL statement to change the Price of Milk from 25 to 30 in the table STORE_ITEMS
given below. (3)
Item_Id Item_Name Item_Brand Item_Category Price Unit
1001 Milk Verka Cat1 25 litre
1002 Curd Amul Cat1 50 kg
1003 Lassi Vita Cat1 30 litre
1004 Chaach Amul Cat1 20 litre

(ii) Write the category DDL, DML or DCL for the following commands
GRANT, DROP TABLE, INSERT INTO, UPDATE…SET, REVOKE
Ans. (i) UPDATE STORE_ITEMS SET Price=25 WHERE Item_Id='1001';
(ii) DDL: DROP TABLE
DML: INSERT INTO, UPDATE. ..SET
DCL: GRANT, REVOKE
Q10. Ravish is a Database Admin who joins a Technology company DataSys. The company has a database
to which Ravish wants to add another table. What will be the SQL commands for creating the table
while checking whether the table COUNTRIES already exists. (3)
The following are the details of the table structure:

COUNTRY_ID CHAR(5) PRIMARY KEY


COUNTRY_NAME VARCHAR(20)
ADDRESS VARCHAR(30)
CITY VARCHAR(20)

CITY_CODE CHAR(5)
CURRENCY DECIMAL(10,0)

Ans. The SQL commands are:


CREATE TABLE IF NOT EXISTS COUNTRIES (
COUNTRY_ID CHAR(5) PRIMARY KEY,
COUNTRY_NAME VARCHAR(20),
ADDRESS VARCHAR(20),
CITY VARCHAR(20),
CITY CODE CHAR(5),
CURRENCY DECIMAL(10,0));
MOCK TEST-2022 COMPUTER SCIENCE 34

(SECTION C)
Each question carries 4 marks

Q11. Write the SQL statement to display all the information asked in queries (a-d) based on the tables
below: (4)
SALESPERSON TABLE
salesperson_id name city incentive
1001 Nitin Jairam Delhi 0.12
1002 Gaurav Jha Kolkata 0.13
1007 Vinita S Hyderabad 0.11
1003 Jockim Lobo Bangalore 0.15
1005 Arun Mehta Bhopal 0.14
1006 Vinny Noom Mumbai 0.12

ORDER TABLE

order_No purch_amt order_date customer_id sales person_id

30001 1500 2019-10-15 2002 1003

30002 2400 2019-09-05 2005 1002


30003 2100 2019-11-25 2001 1007
30004 3200 2019-10-07 2006 1003
30005 3520 2019-08-12 2003 1005
30006 2600 2019-03-01 2004 1007
30007 2100 2019-11-25 2007 1001
30008 3200 2019-10-07 2006 1003
30009 3520 2019-08-12 2003 1005
30010 2600 2019-03-01 2001 1007

a) Delete the record from order table where order number is 30009
b) Write an SQL statement to display customer_id and salesperson_id from order table where
purch_amount is between 1000 and 2500.
c) Write a query to display all the columns from salesperson sort the result in an ascending order by
the name and incentive.
35 SAMPLE QUESTION PAPER-3(SOLVED) – XII

d) Write an SQL statement to display salesperson_id and sum of purch_amount from order table
grouped by customer_id.
Ans. a) DELETE FROM order WHERE order_no=30009;
b) SELECT customer_id, salesperson_id FROM order WHERE purch_amount
BETWEEN 1000 AND 2500;
c) SELECT * FROM salesperson ORDER BY name, incentive;
d) SELECT salesperson_id, SUM(purch_amt) FROM order GROUP BY
customer_id;
Q12. What is network Topology, explain with examples of topologies. (4)
Ans. Network Topology is the geographical, physical or logical arrangement of computer networking
devices. Topology is the way in which the various nodes or computers of a network are linked together
or the actual layout of the computer network hardware.
Some Network Topologies are: Bus Topology, Ring Topology, Star Topology, Mesh Topology and Tree
Topology.
Q13. National Skill Training Academy has for wings A, B, C, D (4)
Distance between various wings are given below:
Wing A to Wing B-100m Wing A to Wing C-200m
Wing A to Wing D-400m Wing B to Wing C-300m
Wing B to Wing D-100m Wing C to Wing D-450m
Number of Computers installed at various wings are as follows:
Wing A-20 Wing B-150
Wing C-50 Wing D-25
(i) Suggest the best wired medium and the cable layout to efficiently connect various wings of
National Skill Training Academy.
(ii) Name the most suitable wing where the Server should be installed.Justify your answer.
(iii) Suggest a device/software and its placement that would provide data security for the Academy.
(iv) What will be needed to provide wireless Internet access to all smartphone/laptop users in the
Academy.
Ans. (i) Optic Fibre and Star Topology.
(ii) Wing B as it has the maximum number of computers
(iii) Firewall with the server in Wing B.
(iv) A High bandwidth Broadband Connection and Wi-Fi Router.
MOCK TEST-2022 COMPUTER SCIENCE 36

MOCK TEST–I
COMPUTER SCIENCE (083)
Time allowed: 2 hours Maximum Marks: 35
General instructions:
l The question paper is divided into 3 sections – A, B and C
l Section A, consists of 7 questions (1-7). Each question carries 2 marks.
l Section B, consists of 3 questions (8-10). Each question carries 3 marks.
l Section C, consists of 3 questions (11-13). Each question carries 4 marks.
l Internal choices have been given for question numbers 7, 8 and 12.

(SECTION A)
Each question carries 2 marks

Q1. Differentiate between push and pop in stacks. (2)


Q2. (i) Expand the following: (1)
FTP, TCP/IP
(ii) What is the approximate bandwidth of a typical voice signal? (1)
Q3. Which SQL logical operator allows the existence of multiple conditions in an SQL statement's WHERE
clause?
Which SQL logical operator is used to compare a value to any applicable value in the list as per the
condition? (2)
Q4. Which method of the Cursor Class is used to execute an SQL statement? What does the cursor( ) do?
(2)
Q5. Write the output of the queries (a) to (d) based on the table SCHOOLADMIN, given below: (2)

ADMNO NAME STREAM DOB PHONE SECTION

101 Srishti B Business Admin 2005-05-12 1234322934 NULL

102 Aman Pratap Sciences 2005-11-02 671343224 B

103 Shivam Sciences 2006-01-23 511343224 A

104 Banita Business Admin 2005-10-12 132412934 NULL

105 Myra Fine Arts 2005-07-01 124455931 C

106 Raghav Humanities 2005-06-05 42155931 D

107 Medini Fine Arts 2005-09-05 512155931 C


37 MOCK TEST–I – XII

108 Udai Veer Sciences 2006-11-25 551343224 B


109 Gaurav Legal Studies 2005-03-15 321155931 NULL

a) SELECT Max(DOB) FROM SCHOOLADMIN;


b) SELECT Name FROM SCHOOLADMIN WHERE STREAM!="Business Admin" AND SECTION IS NULL;
c) SELECT count(NAME) FROM SCHOOLADMIN WHERE SECTION IS NOT NULL;
d) SELECT count(NAME) FROM SCHOOLADMIN WHERE SECTION IS NOT NULL AND STREAM="FINE
ARTS";
Q6. (i) Which clause aggregates the base data? (2)
Which clause filters the aggregated data?
(ii) What is a natural join? (2)
Q7. Consider the tables GSTCategory and Store_Items given below:
(a) Table: GSTCategory

CategoryID Category_Name GST


Cat1 Fresh Dairy 0
Cat10 DryFruit Cat1 5
Cat11 DryFruit Cat2 5
Cat12 Spice Cat 2 5
Cat13 Packaged Fat 12
Cat14 Packaged Oil 12
Cat15 DryFruit Cat2 12

Table Store_Items:

Item_Id Item_Name Item_Brand CategoryID Price Unit


1010 Milk Verka Cat1 20 litre
1012 Curd Amul Cat1 50 kg
1003 Lassi Vita Cat1 30 litre
1024 Chaach Amul Cat1 20 litre
1006 Eggs None Cat2 48 dozen
1007 Gur None Cat3 40 kg
1008 Honey None Cat3 200 litre
1009 Salt None Cat4 21 kg
MOCK TEST-2022 COMPUTER SCIENCE 38

(a) Identify the degree and cardinality of the GSTCategory table.


(b) Which field will be considered the foreign key if the tables GSTCategory and Store_Items: are
related in a database?
(SECTION B)
Each question carries 3 marks

Q8. Competent Couriers take user input for the name, address and phone number of the receiver and
store these in a tuple which is then pushed to a stack called parcelstock. Write a program, with separate
user defined functions to perform the following operations: (3)
l Push the details(name, address, phone) into a stack using the function Push(parcelstock,details).
l Pop and display the content of the stack
Q9. (i) Write the SQL statement to add a field Country_Code(of type Integer) to the table Countries with
the following fields. Country_id, Country_name, Continent, Region_id
(ii) Which of the following is not a DML command?
DELETE FROM, DROP TABLE, CREATE TABLE, INSERT INTO
Q10. Sahil wants to create a database HARDWARE which has a table RENTAL. He wants to make sure that city
name is unique and no field is left empty in the table. Write the SQL commands for the fields given
below.

RENTAL_ID INT PRIMARY KEY


RENTAL_DATE DATETIME NOT NULL
INVENTORY_ID VARCHAR(6) NOT NULL
CUSTOMER_ID VARCHAR(6) NOT NULL
RETURN_DATE DATETIME NOT NULL
CITY VARCHAR(6) UNIQUE NOT NULL

(SECTION C)
Each question carries 4 marks

Q11. The table FLIGHT_BAGGAGE shows data about the number of baggage , total weight in kg for baggage
and cost per extra kg for different classes. The PASSENGER table shows the passengers with extra
baggage weight. Using the information given below write the SQL query for a)-d) (4)
TABLE FLIGHT_BAGGAGE

PAXCODE PAX_CLASS BA TKGA CPEKG


101 FIRST 3 90 300
102 BUSINESS 3 80 300
39 MOCK TEST–I – XII

103 ECOPLUS 2 50 400


104 ECONOMY 2 40 500
105 SPECIAL 4 100 400

TABLE PASSENGER

NO NAME TRAVELDATE EKG PAXCODE NOB


11 Ridhima Sen 2019-12-13 10 101 3
13 Gary Sandhu 2019-12-21 15 103 3
15 Ganesh V 2019-12-23 8 102 2
12 Salim Malik 2019-11-13 15 102 3
17 Geralene N 2019-12-10 11 104 2
14 Venkatesh 2019-11-28 8 105 4
16 Saed Bajwa 2019-11-06 20 101 3

EKG- Extra KG
BA-Bags Allowed
CPEKG- Cost per extra KG
TKGA- Total Kilograms Allowed
NOB- Number of Bags

a) Write an SQL statement to display NO,NAME,TRAVELDATE from the table PASSENGER in


descending order of NO.
b) Write an SQL statement to display all the classes from table FLIGHT_BAGGAGE where weight
allowed is more than 75 Kg
c) Write an SQL statement to display the PAXCODE and their number from PASSENGER table,
grouped by the PAXCODE more than 1 in number.
d) Write an SQL statement to display the PAXCODE, NAME, PAX_CLASS from both tables where Extra
KG is more than 10
Q12. (i) What are five Components of Data Communication? (4)
(ii) Differentiate between a Hub and a Switch.
Q13. National Centre for Indigineous Arts has just set up a new campus and they want to set up a Local area
network. (4)
MOCK TEST-2022 COMPUTER SCIENCE 40

Main
Admin Building

Finance Academic

The distances between various buildings of university are given as:-


Main to Admin 50mtr
Main to Finance 100 mtr
Main to Academic 70 mtr
Admin to Finance 50 mtr
Finance to Academic 70 mtr
Admin to Academic 60 mtr
Number of computers in each building:-
Main Building 150
Admin Building 75
Finance Building 50
Academic Building 60
As a network expert, you are required to give best possible solutions for the given queries of the
university administration:-
(a) Suggest cable layout for the connections between the various buildings,
(b) Suggest the most suitable building to house the server of the network of the university,
(c) Suggest the placement of following devices with justification:
1. Switch/Hub
2. Repeater
(d) Suggest the technology out of the following for setting-up very fast Internet connectivity among
buildings of the university
1. Optical Fibre
2. Coaxial cable
3. Ethernet Cable
41 MOCK TEST–II – XII

MOCK TEST–II
COMPUTER SCIENCE (083)
Time allowed: 2 hours Maximum Marks: 35
General instructions:
l The question paper is divided into 3 sections – A, B and C
l Section A, consists of 7 questions (1-7). Each question carries 2 marks.
l Section B, consists of 3 questions (8-10). Each question carries 3 marks.
l Section C, consists of 3 questions (11-13). Each question carries 4 marks.
l Internal choices have been given for question numbers 7, 8 and 12.

(SECTION A)
Each question carries 2 marks

Q1. Differentiate between underflow and overflow in queues and stacks (2)
Q2. (i) Expand the following: (1)
ARPANET, NSFNET
(ii) What will be units to measure the size of high quality digital photograph? (1)
Q3. Which SQL logical operator is used to compare a value to similar values using wildcard operators? (2)
Which SQL logical operator reverses the meaning of the logical operator with which it is used?
Q4. What is the datatype of the result set extracted from the database using the cursor object when we use
the following: (2)
a) fetchone( ) method b) fetchall( ) method
Q5. Write the output of the queries (a) to (d) based on the table country, given below: (2)

Code Name Continent Surface area Population Life expectancy

AFG Afghanistan Asia 652090 22720000 46

AGO Angola Africa 1246700 12878000 39

AIA Anguilla North America 96 8000 76

ALB Albania Europe 28748 3401200 72

AND Andorra Europe 468 78000 84

ARE United Arab Emirates Asia 83600 2441000 74

ARG Argentina South America 2780400 37032000 75


MOCK TEST-2022 COMPUTER SCIENCE 42

ARM Armenia Asia 29800 3520000 66

ASM American Samoa Oceania 199 68000 75

ATA Antarctica Antarctica 13120000 0 Null

a) SELECT min(Population) FROM country;


b) SELECT max(SurfaceArea) FROM country;
c) SELECT avg(LifeExpectancy) FROM country Where Name Like "Ang%";
d) SELECT Code FROM country Where country.Name=country.Continent;
Q6. (i) Which clause sorts the final data?
(ii) Write the Syntax for Equi- join and Natural Join
Q7. Consider the table Travel given below:
TABLE: TRAVEL

CNO CNAME TRAVELDATE KM TAXI_CODE NOP


101 Randeep Singh 2018-11-07 200 T01 12
102 Sharad Bali 2018-12-21 120 T04 4
105 Sangeeta M 2019-04-25 450 T01 15
103 Manish Nagpal 2019-01-29 280 T02 5
107 Veronica Masih 2019-03-12 365 T04 2
104 Dinesh Hoon 2019-10-28 200 T05 4
106 Ramita Malik 2019-03-12 100 T01 20

(a) Identify the degree and cardinality of the table.


(b) Which field should be made the primary key? Justify your answer.

SECTION – B
Each question carries 3 marks
Q8. Jiya has a list containing 8 integers. You need to help her create a program with two user defined
functions to perform the following operations based on this list.
l Traverse the content of the list and push those numbers into a stack which are divisible by both 5
and 3.
l Pop and display the content of the stack.
For example the following list:
[5,15,21,30,45,50,60,75]
And should display:
75 60 45 30 15
43 MOCK TEST–II – XII

Q9. (i) Write a SQL statement to rename the table Student to Student_new(considering this table does not
already exist in the database)
(ii) Differentiate between DDL and DML Commands.
Q10. The database MavenAdmin already has a table DEPARTMENTS, write the SQL statements to add a table
named HR_jobs with the following structure.

Field Data Type Remarks


JOB_ID VARCHAR(10) Primary Key

JOB_TITLE VARCHAR(35) Not Null


DEPARTMENT_ID VARCHAR(10) Foreign Key for
DEPARTMENT_ID in
DEPARTMENTS Table
EXPERIENCE INT
MIN_SALARY DECIMAL(6,0)
MAX_SALARY DECIMAL(6,0)

Section C
Each question carries 4 marks

Q11. Golden Rainbow school has a Schooladmin Database with the following Tables. Using the information
given in the 2 tables write the SQL query for a)-d)
Table: Students

StudentID Name DOB City Sport Email


1211 Anvi 2005-10-06 Chandigarh Tennis anvi@csmail.com
1212 Ananya 2005-09-11 Panchkula TT ana@csmail.com
1213 Bisman 2005-07-01 Mohali Cricket bisn@csmail.com
1214 Bani 2004-12-11 Chandigarh TT bani@csmail.com
1215 Brie 2005-03-16 Chandigarh Squash brie@csmail.com
1216 Diya 2006-07-11 Panchkula Tennis diya@csmail.com
1217 Fiza 2005-07-21 Mohali Cricket fiza@csmail.com
1218 Gauri 2004-12-30 Chandigarh TT Gari@csmail.com
MOCK TEST-2022 COMPUTER SCIENCE 44

Table: records

StudentID Unit1 Unit2 Term1 Term2


1211 23 24 37 39
1212 21 21 32 33
1213 25 24 38 39
1214 22 23 30 31
1215 21 24 37 39
1216 24 21 32 33
1217 23 24 38 39
1218 21 23 30 31

a) Write an SQL statement to display the StudentID, Name and Email of the students from Chandigarh
who play TT.
b) Write an SQL statement to display the Name and marks of Unit1 and Unit2 for those students who
scored above 44 marks after adding Unit1 and Unit2.
c) Write an SQL statement to display the Name and the total marks for the students from Mohali.
d) Write an SQL statement to display the average of the total marks of the students.
Q12. (i) Define the following terms: (4)
Web Browser, Web server
(ii) How is a Gateway different from a Repeater?
Q13. HerbalCity Pharma is a pharmaceutical company that has set up a new unit in Himachal Pradesh. They
have the following blocks on the campus. (4)

Research
Accounts
Lab

Packaging
Store
Unit
45 MOCK TEST–II – XII

The distance between various blocks is as follows:

Accounts to Research Lab 55 m


Accounts to Store 150 m
Store to Packaging Unit 160 m
Packaging Unit to Research Lab 60 m
Accounts to Packaging Unit 125 m

Store to Research Lab 180 m

Number of Computers

Accounts 35
Research Lab 110
Store 25
Packaging Unit 70

As a network expert, provide the best possible solutions for the following:
i) Suggest a cable layout of connections between the blocks.
ii) Suggest the most suitable block to house the server of this organization.
iii) Suggest the placement of the following device with justification:
a) Repeater b) Hub/Switch
iv) Suggest a system (hardware/software) to prevent unauthorized access to or from the network.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy