You are on page 1of 112

केन्द्रीय विद्यालय स

ं गठन, कोलकाता स
ं भाग

KENDRIYA VIDYALAYA SANGATHAN, KOLKATA REGION

सत्रांत परीक्षा (वितीय सत्र )

PRE BOARD EXAMINATION (TERM-II)

सत्र /SESSION: 2021-22

विषय : स
ं गणक विज्ञान / SUBJECT: COMPUTER SCIENCE (083)

कक्षा : बारहिीं /CLASS:XII

पू णांक / M.M. :35 समय : 2 घ


ं टे / TIME : 2 Hrs

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

SECTION-A
Each question carries 2 marks
Q. Part Question Marks
No. No.
1. Differentiate between push and pop in stacks. [2]

2. (i) Expand the following: [1]

ARPANET, TCP/IP
(ii) Which transmission medium is generally used in TV remotes? [1]

3. What is the difference between Primary key and Foreign key? [2]

4. What is the datatype of the result set extracted from the database [2]
using the cursor object when we use the following:

Page 1/5/(XIICS-PB TERM2-2021-22) |


(a) fetchone( ) method (b) fetchall( ) method

5. Write the output of the queries (a) to (d) based on the table [2]
Country, given below:

TABLE: COUNTRY
Code CName Continent Surface Population Life
Area Expectancy
AFG Afghanistan Asia 652090 22720000 46
AGO Angola Africa 1246700 12878000 39
AIA Anguilla North NULL 8000 76
America
ALB Albania Europe 28748 3401200 72
ARG Argentina South 2780400 37032000 75
America
ARM Armenia Asia 29800 3520000 NULL

(a) SELECT min(Population) FROM country;

(b) SELECT max(SurfaceArea) FROM country Where


Lifeexpectancy <50;

(c) SELECT avg(LifeExpectancy) FROM country Where CName


Like "%G%";

d) SELECT Count(Distinct Continent) FROM country;

OR

(a) Identify the candidate key(s) from the table Country.

(b) Consider the table CAPITAL given below:

TABLE: CAPITAL
Capital_Code Country_Code Capital_Name Area
KAB AFG Kabul 1028
LUA AGO Luanda 113
BUE ARG Buenos Aires 203
YER ARM YEREVAN 223

Which field will be considered as the foreign key if the tables


COUNTRY and CAPITAL are related in a database?

6. (i) Which clause sorts the final data? [1]

Page 2/5/(XIICS-PB TERM2-2021-22) |


(ii) Write the Syntax for Natural Join. [1]

7. Consider the table Travel given below: [2]

(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
8. Jiya has a list containing 8 integers. You need to help her create [3]
a program with two user defined functions to perform the following
operations based on this list.

● Traverse the content of the list and push those numbers


into a stack which are divisible by both 5 and 3.

● Pop and display the content of the stack.


For example:

If the sample Content of the list is as follows:


L=[5,15,21,30,45,50,60,75]

Sample Output of the code should be:


75 60 45 30 15
OR
Write a function in python, Push(Package) and Pop(Package) to
add details of employee contain information (Empid, Ename and
Salary) in the form of tuple in Package and delete a Package from
a List of Package Description, considering them to act as push
and pop operations of the Stack data structure.

9. (i) Write the SQL statement to add a field Country_Code (of type [1]
character) to the table Countries with the following fields:

Country_id, Country_name, Continent, Region_id

Page 3/5/(XIICS-PB TERM2-2021-22) |


(ii) Differentiate between ALTER and DELETE Commands with one [2]
example of each.

10. The database MavenAdmin already has a table DEPARTMENTS, [3]


write the SQL statements to add a table named HR_JOBS with
the following structure.

FIELD NAME 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 FLOAT(6,0)
MAX_SALARY FLOAT(6,0)
SECTION-C
Each question carries 4 marks
11. Golden Rainbow school has a Schooladmin Database with the [4]
following Tables. Using the information given in the 2 tables write
the SQL queries for (a) to (d):

Table: Students

Page 4/5/(XIICS-PB TERM2-2021-22) |


Table: Records

(a) Write an SQL statement to display the StudentID, Name and


Email of the students from Panchkula who play Tennis.

(b) Write an SQL statement to display the Name and marks of


Term1 and Term2 for those students who scored above 70 marks
after adding Term1 and Term2.

(c) Write an SQL statement to display the Sport and no. of


students who have opted the sport more than 2 from the Students
Table.

(d) Write an SQL statement to display the average of the total


marks of the students.

12. (i) Define the following terms: [2]


Web server, Web Hosting
OR
Give two advantages and two disadvantages of bus topology.

(ii) How is an IP address different from a MAC address? [2]

13. National Centre for Indigenous Arts has just set up a new Campus [4]
and they want to set up a Local area network.

Page 5/5/(XIICS-PB TERM2-2021-22) |


The distances between various buildings of university are
given as:-
Main to Admin 50 mtr
Main to Finance 100 mtr
Main to Academic 70 mtr
Admin to Finance 50 mtr
Finance to Academic70 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 and draw cable layout to efficiently connect various


buildings/blocks.

(b) Suggest the most suitable building to house the server of this
university with a suitable reason.

(c) Suggest the placement of following devices with justification:


1. Switch/Hub
2. Repeater
(d) Suggest the transmission medium out of the following for
setting-up very fast Internet connectivity among buildings of the
university
1. Optical Fiber
2. Coaxial cable
3. Ethernet Cable

_______________________________________________________________________

Page 6/5/(XIICS-PB TERM2-2021-22) |


केन्द्रीय विद्यालय स
ं गठन, कोलकाता स
ं भाग

KENDRIYA VIDYALAYA SANGATHAN, KOLKATA REGION

सत्रांत परीक्षा (वितीय सत्र )

PRE BOARD EXAMINATION (TERM-II)

सत्र /SESSION: 2021-22

विषय : स
ं गणक विज्ञान / SUBJECT: COMPUTER SCIENCE (083)

कक्षा : बारहिीं /CLASS:XII

पू णांक / M.M. :35 समय : 2 घ


ं टे / TIME : 2 Hrs

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

MARKING SCHEME
SECTION-A
Each question carries 2 marks
Q. Part Question Marks
No. No.
1. Push operation refers to inserting an element in the stack. Since there [2]
is only one position at which the new element can be inserted — Top of
the stack, the new element is inserted at the top of the stack. Pop
operation refers to the removal of an element from the Top. STACK
follows LIFO (Last In First Out).
2. (i) ARPANET:- Advanced Research Project Agency Network [1]
TCP/IP:- Transmission Control Protocol / Internet Protocol
(ii) Infrared [1]
3. Primary Key- A column/attribute or set of columns/attributes which [2]
uniquely identifies tuples in a relation. A table can have only one primary
key.
Foreign Key- A Non-key attribute whose values are derived from the
primary key of some other table is called foreign key in its current table.
Page 1/4/(XIICS-PB TERM2-MS-2021-22) |
A table can have multiple foreign keys. It maintains referential integrity
between two tables.
4. (a) fetchone( ):- it returns only one record/row from the result set. i.e. [2]
first time it will return first record, next time it will return second record
and so on. If no more record it will return None
(b) fetchall( ):- it will return all the records/rows from the result set in the
form of tuple.
5. TABLE: COUNTRY [2]
(a) 8000
(b) 1246700
(c) 59
d) 5
OR
(a) Candidate keys:- Code, CName, Population
(b) Country_Code
6. (i) ORDER BY [1]
(ii) Syntax for Natural Join: [1]
SELECT <Column-name1,column-name2,…> FROM TABLE1,TABLE2
WHERE <Table1.Common-Column>=<Table2.Common-Column>
OR
SELECT <column-name> from <Table1> NATURAL JOIN <Table2>;
OR
SELECT <column_list>
FROM table1 Join table2
USING (identical_column_name);
OR
Any other correct syntax
7. (a) Degree- 6, Cardinality-7 [2]
(b) Primary key- CNO, since it contains unique values and not null
values and further it will contain unique value.
SECTION-B
Each question carries 3 marks
8. def PUSH(Arr,value): [3]
s=[]
for x in range(0,len(Arr)):
if Arr[x]%5 and Arr[x]%3==0:
s.append(Arr[x])
if len(s)==0:
print("Empty Stack")
else:
print(s)
def popStack(st) :
if len(st)==0: # If stack is empty
print("Underflow")
else:
print(“Element deleted is”,st.pop( ))

ANY OTHER SYNTACTICALLY AND LOGICALLY WRITTEN


CORRECT CODE IS ACCEPTABLE.

Page 2/4/(XIICS-PB TERM2-MS-2021-22) |


OR
def Push(Package):
Empid=int(input(“Enter Id of Employee: "))
Ename=input(“Enter Name of employee”)
Salary= int(input(“Enter Salary of an employee”))
T=(Empid, Ename ,Salary)
Package.append(T)
def Pop(Package):
if (Package==[]):
print( "Stack empty")
else:
print ("Deleted element:",Package.pop())
ANY OTHER SYNTACTICALLY AND LOGICALLY WRITTEN
CORRECT CODE IS ACCEPTABLE.
9. (i) ALTER TABLE Countries ADD Country_Code varchar(10); [1]
(ii) ALTER TABLE:- Used to add/remove an attribute or to modify the [2]
datatype of an existing attribute or to add constraint in attribute. It is a
DDL command. -½ marks
Any correct example of Alter command. ½ marks
DELETE:- Used to delete/remove one or more records from a table. It is
a DML command. - ½ marks
Any correct example of Delete command. ½ marks
10. CREATE TABLE HR_JOBS [3]
(JOB_ID VARCHAR(10) PRIMARY KEY,
JOB_TITLE VARCHAR(35) NOT NULL,
DEPARTMENT_ID VARCHAR(10),
EXPERIENCE INT,
MIN_SALARY FLOAT(6,0),
MAX_SALARY FLOAT(6,0),
DEPARTMENT_ID REFERENCES
DEPARTMENTS(DEPARTMENT_ID));

OR
CREATE TABLE HR_JOBS
(JOB_ID VARCHAR(10) PRIMARY KEY,
JOB_TITLE VARCHAR(35) NOT NULL,
DEPARTMENT_ID VARCHAR(10) REFERENCES
DEPARTMENTS(DEPARTMENT_ID),
EXPERIENCE INT,
MIN_SALARY FLOAT(6,0),
MAX_SALARY FLOAT(6,0) );
SECTION-C
Each question carries 4 marks
11. (a) SELECT StudentID, Name, Email FROM Students WHERE [4]
City=’Panchkula’ and Sport=’Tennis’;
(b) SELECT Name, Term1, Term2 FROM Students, Records WHERE
Students.StudentID=Records.StudentID and (Term1+Term2)>70;
(c) SELECT Sport, Count(Sport) FROM Students Group By Sport
having count(*)>2;

Page 3/4/(XIICS-PB TERM2-MS-2021-22) |


(d) SELECT AVG(Unit1+Unit2+Term1+Term2) FROM Records;
12. (i) Web server:- A web server is a special computer system, running on [2]
HTTP through web pages. It is used to store and deliver the contents
of a website to clients such as a browser that request it.

Web Hosting:- Web hosting is a service that allows us to put a website


or a web page onto the Internet, and make it a part of the World Wide
Web so that users across the globe can access.
OR
Two advantages and two disadvantages of bus topology:
Advantages:
● It requires less cable length than a star topology.
● It is easy to implement and can be extended up to a certain
limit.

Disadvantages:
● If there is a fault or break in the main cable, the entire network
shuts down.
● Fault isolation is difficult to detect if the entire network shuts
down

(Any other relevant points are acceptable)

(ii) MAC address:- The MAC address, also known as the physical or [2]
hardware address, is a unique permanent value associated with a
network adapter called a NIC. It is used to physically to identify a
machine on the network. MAC address is fixed and assigned by the
manufacturer of the device.
Unlike MAC address, IP address is the logical address that identifies the
connection of a device on the Internet or a local network. IP address can
be changed depending upon the network environment.
ANY CORRECT ANSWER IS ACCEPTABLE.
13. (a) LAYOUT1 [4]
Star Topology

OR

LAYOUT2

Bus Topology
Page 4/4/(XIICS-PB TERM2-MS-2021-22) |
(b) Main building as contains maximum number of computers. As per
80-20 rule of networking it increases efficiency.

(c) 1. Switch/Hub - Every Building to connect computers


2. Repeater – Repeater may not be required as the distance is
not more than 100 mtr between any buildings.

(d) Optical Fiber

Page 5/4/(XIICS-PB TERM2-MS-2021-22) |


SET-1

KENDRIYA VIDYALAYA SANGATHAN AGRA REGION

Term-II Pre- Board Exam-2021-22

COMPUTER SCIENCE (083)

CLASS:XII

Maximum Marks: 35 Time Allowed: 2 Hours

General Instructions:

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

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

• Section B, consists of 3 questions (8-10). Each question carries 3 marks.

• Section C, consists of 3 questions (11-13). Each question carries 4 marks.

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

Marks
Q.No. Section -A
Allocated
1. What is Stack? Write any one application of Stack? 2
(i) Name the device used for security of a Network. 1
2.
(ii) Name the connector used to connect the computer with LAN. 1
Choose correct DDL,DML,DCL and TCL commands from the following:-
3. INSERT INTO, SELECT, COMMIT, GRANT, SAVEPOINT, REVOKE, ROLLBACK, 2
CREATE, UPDATE, DELETE,ALTER,ADD
4. Define Constraints in data base with suitable example. 2
Write SQL commands on the basis of table HOSPITAL
Table: HOSPITAL

P_No Name Age Department Dateofadmin Fee


5. 1256 Arpit 62 Surgery 21/01/06 300 2

8790 Zayana 18 ENT 12/12/05 250


1254 Kareem 68 Orthopaedic 19/02/06 450
1300 Abhilash 26 Surgery 24/11/06 300

Page 1 of 56
1824 Dhanya 24 ENT 20/10/06 350

(i) To add a new column as Address of type characters in table HOSPITAL.


(ii) Create a new table named PDATA having column Name, Age, Department and fee from
existing table HOSPITAL.

Arvind is learning MySQL for managing different databases and tables for his Python based
application/software. Tell him the SQL commands for the following:-
6. 2
(i) How to show pre-existing databases.
(ii) How to use a desired database.
Write the answers on the basis of table PRODUCT
Table: PRODUCT
Pno Pname Qty PurchaseDate
101 Pen 102 12-12-2011
102 Pencil 201 21-02-2013
103 Eraser 90 09-08-2010
109 Sharpener 90 31-08-2012
113 Clips 900 12-12-2011
(i) Write the names of most appropriate columns, which can be considered as Primary Key in
table PRODUCT and justify your answer.
(ii)What is the degree and cardinality of the table PRODUCT?
7. 2
OR
Table: SUPPLY
Cname Pno Qtysold
M/S Rajeev Enterprises 101 50
M/S Vinod Fittings 102 100
M/S Pooja Traders 103 30
M/S Jagat Suppliers 109 60
M/S New Raj Enterprises 113 630

(i) Write the names of most appropriate columns, which can be considered as Candidate Key
in table PRODUCT and justify your answer.
Page 2 of 56
(ii) Write the type of key which can be given for the identical columns in table PRODUCT
and SUPPLY.
Section-B
Avni is trying to connect Python with MySQL for her project. Help her to write the python
statement on the following:-
(i) Name the library, which should be imported to connect MySQL with Python.
(ii)Name the function, used to run SQL query in Python.
(iii) Write Python statement of connect function having the arguments values as :
Host name :192.168.11.111
User : root
Password: Admin
Database : MYPROJECT
8. 3
OR
(i) Raju’s tutor has given instructions to write a table in MySQL as given below. Help him to
get the solution.
• Name of the relation should be Employee
• Column name with data type as :
➢ Empid ,integer value and set constraint as Primary Key
➢ Empname, which can hold at least 20 characters
➢ Empdesig, which can hold at least 15 variable characters
➢ Empsal, which can hold decimal value in the format (4,2)
Write a function push (student) and pop (student) to add a new student name and remove a
9. student name from a list student, considering them to act as PUSH and POP operations of stack 3
Data Structure in Python.
Give the output of the following SQL statements using table CLUB.
Table : CLUB
CID CNAME AGE GENDER SPORTS PAY DOAPP
5246 AMRITA 35 FEMALE CHESS 900 27/03/2006
10. 3
4687 SHYAM 37 MALE CRICKET 1300 15/04/2004
1245 MEENA 23 FEMALE VOLLYBALL 1000 18/06/2007
1622 AMRIT 28 MALE KARATE 1000 05/09/2007
1256 KRISHNA 36 MALE CHESS 1100 15/08/2003

Page 3 of 56
1720 MANJU 33 FEMALE KARATE 1250 10/04/2004
2321 VIRAT 35 MALE CRICKET 1050 30/04/2005

(i) SELECT CNAME FROM CLUB WHERE SPORTS=”CHESS”;


(ii) SELECT NAME,AGE, FROM CLUB WHERE AGE BETWEEN 25 AND 35;
(iii) SELECT COUNT(DISTINCT SPORTS) FROM CLUB;
(iv) SELECT MIN(AGE) FROM CLUB WHERE GENDER=”FEMALE”;
(v) SELECT SUM(PAY) FROM CLUB WHERE DOAPP<”30/04/2005”;
(vi) SELECT CNAME,AGE FROM CLUB WHERE GENDER=”MALE” ORDER BY AGE
DESC;
Section- C
Consider the following tables BOOKS and ISSUED. Write SQL commands for the statements
(i) to (iv).
Table: BOOKS
BID BNAME AUNAME PUBNAME PRICE TYPE QTY
COMP11 LET US C YASHWANT ARIHANT 350 COMPUTER 15
INDIA
GEOG33 RANJEET P ATLAS 150 GEOGRAPHY 20
MAP
MODERN
HIST66 R BALA GAMMA 210 HISTORY 25
HISTORY
MY
COMP12 FIRST VINOD DUA WHITE BIRD 330 COMPUTER 18
11. 4
C++
MY
LITR88 ARVIND AD TIGERWOOD 470 NOBEL 24
DREAMS

Table: ISSUED
BID QTY_ISSUED
HIST66 10
COMP11 5
LITR88 15
(i) Display book name and author name and price of computer type books.
(ii) To increase the price of all computer books by 50.

Page 4 of 56
(iii) Show the details of all books in ascending order of their prices.
(iv) To display book id, book name and quantity issued for all books which have been issued.

(i) Name a network topology, which is used to maximize speed and make each computer
independent of network.
(ii) Suggest a switching technique in which the information is transferred using Store and
2
Forward mechanism.
OR
12. What is the difference between MAC and IP address?(any two on each)
(iii) Expand the following:-
(a) WLL
2
(b) ARPANET
(c) CSMA
(d) DNS
Polymath IT Infrastructure Limited has set up its new center in Dubai. It has four buildings as
shown in the diagram given below:

13. 4

Distances between various buildings are 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

Page 5 of 56
Number of Computers
Accounts 25
Research Lab 100
Store 15
Packaging Unit 60
As a network expert, provide the best possible answer for the following queries:

(i) Suggest a cable layout of connections between the buildings.

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

(iii) Suggest the placement of the following device with justification:

(a) Repeater (b) Hub/Switch

(iv) Which fast and very effective wire based transmission medium should preferably be used
to connect the buildings for their web-based activities?

*****END OF QUESTION PAPER*****

Page 6 of 56
SET-1

KENDRIYA VIDYALAYA SANGATHAN AGRA REGION

Term-II Pre- Board Exam-2021-22

COMPUTER SCIENCE (083)

CLASS:XII

Maximum Marks: 35 Time Allowed: 2 Hours

MARKING SCHEME
Marks
Q.N
Section -A Alloca
o.
ted
Stack is linear data structure. Stack uses LIFO (Last In First Out) algorithm. All operation
1. such as insertion (push) and deletion (pop) of element takes place from one end only. 1+1
Application of Stack:- Infix to Post conversion and Evaluation of postfix expression
(i) Firewall
2. 1X2
(ii) RJ45 (Registered Jockey-45)
DDL:CREATE,DROP,ALTER,DELETE
DML:INSERT INTO,SELECT,UPDATE
3. ½X4
DCL: GRANT,REVOKE
TCL:COMMIT,SAVEPOINT,ROLLBACK
Constraints are some special features which are applied on any column/attribute of a
4. relation. 1+1
For example : PRIMARY KEY, UNIQUE, CHECK, NOT NULL, DEFAULT
(i) ALTER TABLE HOSPITAL ADD (ADDRESS CHAR(20));
5. (ii) CREATE TABLE PDATA AS (SELECT NAME, AGE, DEPARTMENT, FEE 1X2
FROM HOSPITAL);
(i) show databases;
6. 1X2
(ii) use <database name>;
(i) Primary key Pno 1+½X2
(ii) Degree : 4 Cardinality : 5 OR
7.
OR
(i) Candidate Key : Pname 1X2

Page 7 of 56
(ii) Foreign Key (identical column in both table is Pno)
Section-B
(i) import mysql.connector 1X3
(ii) execute (<sql query >)
(iii)mysql.connector.connect(host=”192.168.11.111”,user=”root”,passwd=”Admin”,dat
8. abase=”MYPROJECT”)
OR
(i) create table employee(Empid int PRIMARY KEY, Empname char(20), Empdesig OR
varchar(20), Empsalary decimal(2,4) ); ½X6

stk=[ ]
def push(stk):
student_name=input("Enter name of student") 1½
stk.append(student_name)

9. def pop(stk):
if(stk==[]):
print("Stack is empty")
else: 1½
print("Deleted student name :",stk.pop())

(i)
CNAME
AMRITA
KRISHNA

(ii)
CNAME AGE
AMRITA 35
AMRIT 28
10. ½X6
MANJU 33
VIRAT 35

(iii) 4
(iv) 23
(v) 3650
(vi)
CNAME AGE
SHYAM 37

Page 8 of 56
KRISHNA 36
VIRAT 35
AMRIT 28
Section: C
(i)SELECT BNAME,AUNAME,PRICE FROM BOOKS WHERE
TYPE=”COMPUTER”;
(ii) UPDATE BOOKS SET PRICE=PRICE+50 WHERE TYPE=”COMPUTER”;
11. 1X4
(iii) SELECT * FROM BOOKS ORDER BY PRICE ASC;
(iv) SELECT BOOK.BID,BNAME,QTY_ISSUED FROM BOOKS,ISSUED WHERE
BOOKS.BID=ISSUED.BID;
(i) Star Topology
(ii) Message Switching 1X2
OR
Difference Between MAC and IP address. OR
MAC IP
MAC stands Media Access Control. IP stands Internet Protocol. 1X2
It is 48-bit address. It is 32-bit address
12.
It is a Physical address. It is a logical address.

(iii)
(a) Wireless Local Loop
(b) Advanced Research Projects Agency Network (ARPANET) ½X4
(c) Carrier Sense Multiple Access (CSMA)
(d) Domain Name Server (DNS)
(i) Layout-1

1X4
13.

Page 9 of 56
Layout-2

(ii) The most suitable place/ building to house the server of this organization would be
building Research Lab, as this building contains the maximum number of computers.

(iii) (a) For layout1, since the cabling distance between Accounts to Store is quite large,
so a repeater would ideally be needed along their path to avoid loss of signals during the
course of data flow in this route. For layout2, since the cabling distance between Store to
Research Lab is quite large, so a repeater would ideally be placed.

(b) In both the layouts, a Hub/Switch each would be needed in all the buildings to
interconnect the group of cables from the different computers in each building.

(iv) Broadband / Fiber Optics

*****END OF MARKING SCHEME *****

Page 10 of 56
KENDRIYA VIDYALAYA SANGATHAN : BHUBANESWAR REGION
TERM – 2 PRE BOARD EXAMINATION
COMPUTER SCIENCE – XII
MAX MARKS: 35 SET-01 DURATION: 2HOURS
Instructions
The question paper is divided into 3 sections – A, B and C
• Section A, consists of 7 questions (1-7). Each question carries 2 marks.
• Section B, consists of 3 questions (8-10). Each question carries 3 marks.
• Section C, consists of 3 questions (11-13). Each question carries 4 marks.
• Internal choices have been given for question numbers 7, 8 and 12.
• All questions are compulsory.
Section A (Each question carries 2 marks)
Q Part Question Marks
No No.
1. What is stack? Why it is called LIFO data structure? 2
2 (i) Which protocol is used to exchange files on Internet? 1
(ii) Expand the following Terms: 1
CDMA, URL

3 What do you mean by domain of an attribute in DBMS? Explain with an example. 2


4 Rohan Wants to delete a table “STUDENT” physically from the database “SCHOOL”, 2
based on the given code fill the statement 1 and statement 2:

import mysql.connector
mydb=mysql.connector.connect(host="localhost",user="root",passwd="12345",databa
se="SCHOOL")
mycursor=_______________ #statement 1
mycursor.execute(__________________) #statement 2
5 Write the output of the queries (a) to (d) based on the table, Mobile given below: 2
M_Id M_Company M_Name M_Price M_Mf_Date
MB001 Samsung Galaxy 15000 12-02-2013
MB003 Nokia N1100 12500 15-04-2011
MB004 Micromax Unite 3 5500 17-10-2016
MB005 Sony XperiaM 25000 20-11-2017
MB006 Oppo SelfieEx 18500 21-08-2010
a) SELECT MAX(M_Mf_Date), MIN(M_Mf_Date) FROM Mobile;
b) SELECT * FROM Mobile WHERE M_Price>15000 AND M_Company LIKE "S%";
c) SELECT M_Mf_Date FROM Mobile WHERE M_Name IN ("Galaxy", "Unite 3");
d) SELECT AVG(M_Price) FROM Mobile;
6 (i) What is the difference between where clause and having clause in SQL? 1
(ii) Write the output of the following SQL queries based on the Mobile table given in 1
Question No. 5 : select M_Price * 0.1 as discount FROM MOBILE;
7 Given the Table TRAINER 2
TID TNAME CITY HIREDATE SALARY

101 SUNAINA MUMBAI 1998-10-15 90000

102 ANAMIKA DELHI 1994-12-24 80000

103 DEEPTI CHANDIGARH 2001-12-21 82000

104 MEENAKSHI DELHI 2002-12-25 78000

105 RICHA MUMBAI 1996-01-12 95000

106 MANIPRABHA CHENNAI 2001-12-12 69000

Page 11 of 56
a. What is Degree and Cardinality of the above table?
b. Which field should be made as the primary key? Justify your answer
OR
What is the difference between candidate key and Alternate key? Explain with example.
Section B (Each question carries 3 marks)
8 Reva has created a dictionary containing Product names and prices as key value pairs 3
of 4 products. Write a user defined function for the following:
● PRODPUSH() which takes a list as stack and the above dictionary as the parameters.
Push the keys (Pname of the product) of the dictionary into a stack, where the
corresponding price of the products is less than 6000. Also write the statement to call
the above function.
For example: If Reva has created the dictionary is as follows:
Product={"TV":10000, "MOBILE":4500, "PC":12500, "FURNITURE":5500}
The output from the program should be: [ ‘FURNITURE’, ‘MOBILE’]
OR
Shaan has a list containing 14 integers. You need to help him create a program with
separate user defined function to perform the following operation based on this list.

● NUMUSH() which takes a list as stack and the above list of numbers as the
parameters. push the numbers of the list which are divisible by 5 into a stack. Also
write the statement to call the function.

For Example: If the sample Content of the list is as follows:


M=[2, 10,13,17,25,32,38,44, 56, 60,21, 74, 35,15]
Sample Output of the code should be: [10, 25, 60, 35, 15]
9 (i) Write the actual datatypes as per the following Structure requirement during creation 2
of a table:
Field Description Actual Datatype with
length
PID 11 digit number
ProdName Can be upto 25 characters
DateofManufacture Date of Manufacture
Price 7 digits number which includes
2 places after decimal point.

(ii) Vani created a table named Customer that have fields Cno, Custname, Address, 1
Amount. Now she wants to increase the width to 30 Characters of the column
“Address”. Write the SQL command for it.
10 a) “Zenith” Company conducts workshops for employees of organizations. The 3
company requires data for workshops that are organized. Write SQL query to create a
Database named as “Zenith” and create a table ‘Workshop’ with the following structure:
Field Type Constraint
Workshopid Integer Primary Key
Title Varchar(50)
DateWorkshop Date
NumSpeakers Integer

b) Zenith company wants to insert a row in the table ‘Workshop’. Write the command
for it.
Section C (Each question carries 4 marks)
11 Write queries for (i) to (iv) which are based on the tables. 4
Table: VEHICLE
VCODE VEHICLETYPE PERKM
V01 VOLVO BUS 150
V02 AC DELUX BUS 125
Page 12 of 56
V03 ORDINARY BUS 80
V05 SUV 30
V04 CAR 18

Table: TRAVEL
CNO CNAME TRAVELDATE KM VCODE NOP
101 K. Niwal 13-12-2015 200 V01 32
103 Adarsh Kumar 21-03-2016 120 V03 45
105 Shyam Sen 23-04-2016 450 V02 42
102 Ravi Kisan 13-01-2016 80 V02 40
107 John Malina 10-02-2015 65 V04 2
104 Sahanabhuti 28-01-2016 90 V05 4
106 Ramesh Jaya 06-04-2016 100 V01 25
Note:
• PERKM is Freight Charges per kilometre.
• KM is kilometres Travelled
• NOP is number of passengers travelled in vehicle.
i. To display CNO, CNAME, TRAVELDATE from the table TRAVEL in descending order
of CNO.
ii. To display the CNAME ,VEHICLETYPE of all customers who are travelling by
VEHICLE with code V03 or V05
iii. To display the CNO and CNAME of those customers from the table TRAVEL who
travelled between ’13-12-2015‘ and ’21-03-2016‘.
iv. To display the VCODE,CNAME,VEHICLETYPE from both the tables with distance
travelled (km) more than 100 Km.
12 (i) What is the difference between hub and switch? Which is more preferable in a large 2
network of computers and why?
(ii) Write two advantages of using an optical Fiber cable over an Twisted Pair cable to 2
connect two service stations which are 200m away from each other.
OR
Differentiate between Website and webpage. Write any two popular example of online
shopping.
13 NMS Training Institute is planning to set up its centre in Bhubaneswar with four 4
specialised blocks for Medicine, Management, Law courses along with an Admission
block in separate buildings. The physical distances between these blocks and the
number of computers to be installed in these blocks are given below. You as a network
expert have to answer the queries raised by their board of directors as given in (i) to
(iv).
Shortest distances between various locations in metres:
Admin Block to Management Block 50

Admin Block to Medicine Block 30

Admin Block to Law Block 65

Management Block to Medicine Block 40

Management Block to Law Block 125

Law Block to Medicine Block 35

Number of Computers installed at various locations are as follows:


Admin Block 250

Management Block 100

Page 13 of 56
Medicine Block 45

Law Block 95

(i). Suggest the most suitable location to install the main server of this institution to get
efficient connectivity.
(ii). Suggest by drawing the best cable layout for effective network connectivity of the
blocks having server with all the other blocks.
(iii). Suggest the device to be installed in each of these buildings for connecting
computers installed within the building.
(iv) Suggest the most suitable wired medium for efficiently connecting each computer
installed in every building out of the following network cables:
• Coaxial Cable
• Ethernet Cable
• Single Pair
• Telephone Cable.

- END -

Page 14 of 56
KENDRIYA VIDYALAYA SANGATHAN : BHUBANESWAR REGION
TERM – 2 Pre Board Examination
COMPUTER SCIENCE – XII
MARKING SCHEME [ SET-1 ]

Section A
Q No. Answers Marks to
No be
allotted
1. A stack is a linear data structure that follows the principle of Last In First Out (LIFO). 2
This means the last element inserted inside the stack is removed first.
Stack is a linear data structure in which the elements can be added or removed only
from one end known as “Top” of the stack. The discipline of Stack is LIFO (Last In
First Out) i.e. element inserted last will be removed first.
(1 marks for correct definition and 1 marks for correct reasons)
2 (i) FTP 1
(ii) Code Division Multiple Access 1
Uniform Resource Locator
(1/2 marks for each correct full forms)
3 Domain of an attribute is the set of values from which a value may come in a column. 2
E.g. Domain of section field may be (A,B,C,D).
(1 marks for correct definition and 1 marks for example)
4 statement 1-mydb.cursor() 2
statement 2-"DROP TABLE STUDENT"
(1 marks for each correct statement)
5 a) 20-11-2017, 21-08-2010 2
b) Sony
c) 12-02-2013
17-10-2016
d) 15300
(1/2 marks for each correct output)

6 (i) Correct difference 01 Mark 1


(ii) discount 1
1500
1250
550
2500
1850
7 a.Degree-5 2
Cardinality-6
b. Primary Key is TID, It is used to ensure data in the specific column is unique. It is
a column cannot have NULL values.

OR
Candidate key: Attribute / Attribute combinations in a relation that can serve as a
primary key. Example: In EMP table: Empno, Ename
Alternate Key: A candidate key that is not the primary key is called an alternate key.
Example: in EMP table Empno Primary key then Ename will be the alternate key.
Section B
8 Product={"TV":10000, "MOBILE":4500, "PC":12500, "FURNITURE":5500} 3
stack=[]
def PRODPUSH(stack, P): # [ 1 Mark ]

Page 15 of 56
for k in Product: # [1/2 Mark ]
if P[k]<6000: # [1/2 Mark ]
stack.append(k) # [1/2 Mark ]

PRODPUSH(stack, Product) # [1/2 Mark ]


print(stack)

OR
M=[2, 10,13,17,25,32,38,44, 56, 60,21, 74, 35,15]

stack=[]
def NUMPUSH(stack, P): # [ 1 Mark ]
for k in M: # [1/2 Mark ]
if k%5==0: # [1/2 Mark ]
stack.append(k) # [1/2 Mark ]
NUMPUSH(stack, M) # [1/2 Mark ]
print(stack)
9 (i) Field Data Type Actual Datatype with 2
length
PID Numeric length 11 int(11)
ProdName Variable Character length 10 varchar(10)
DateofManufacture Data type date
Price Floating 7 digits including 2 float(7,2)
decimal

ALTER TABLE Customer


ii) MODIFY Address(30); 1
10 a. CREATE DATABASE Zenith; 3
CREATE TABLE Workshop(Workshopid integer Primary Key,Title Varchar(50),
DateWorkshop date, NumSpeakers integer);
b. INSERT INTO Workshop(101,”CCT WORKSHOP”,’12-03-2019’,3);
1 mark for create database 1 mark for create table and 1 mark for insert command)
Section C
11 SELECT CNO, CNAME, TRAVELDATE FROM TRAVEL ORDER BY CNO DESC; 4
SELECT CNAME,VEHICLETYPE FROM TRAVEL T, VEHICLE V WHERE
T.VCODE=V.VCODE AND VCODE IN(’V03’,’V05’);
SELECT CNO, CNAME, TRAVELDATE FROM TRAVEL WHERE TRAVELDATE
BETWEEN ’13-12-2015‘ AND ’21-03-2016‘;
SELECT T.VCODE,CNAME,VEHICLETYPE FROM TRAVEL T, VEHICLE V
WHERE T.VCODE=V.VCODE AND KM> 100 ;
(1 marks for each correct command)
12 (i) Hub forwards the message to every node connected and create a huge traffic in the 2
network hence reduces efficiency whereas a Switch is also called intelligent hub
since it redirects the received information/ packet to the intended node(s). In a large
network a switch is preferred to reduce the unwanted traffic in the network which
may also reduce the bandwidth and cause network congestion.
(ii) Advantages of using an optical Fiber : 2
i. Faster speed than ethernet.
ii. Lower attenuation (Any Two Advantages )

OR
Web Page is a document or a page where there is information. We can see those
pages in the browser. Web Page is a single page with information. It can be in any
form like texts, images or videos. Whereas the Website is a collection of webpages.
The website has its own domain name which is unique throughout the world.

Page 16 of 56
Anything can be stored on a website like photos, videos, texts etc . Popular example
of online shopping : Amazon,Flipkart etc
13 i) Admin Block 4
(1 mark for correct answer)
(ii)

(1 mark for correct answer)


(iii) Modem or Switch or Router
(1 mark for correct answer)
(iv)Ethernet Cable
(1 mark for correct answer)

Page 17 of 56
KENDRIYA VIDYALAYA SANGATHAN, REGIONAL OFFICE BHOPAL
PRE TERM END EXAMINATION – 2022
CLASS - XII
Computer Science (083)
Max Marks:35 Time Allowed :120 mins
General Instructions:
➢ The question paper is divided into 3 sections – A, B and C
➢ Section A, consists of 7 questions (1-7). Each question carries 2 marks.
➢ Section B, consists of 3 questions (8-10). Each question carries 3 marks
➢ Section C, consists of 3 questions (11-13). Each question carries 4 marks
➢ Internal choices have been given for question numbers 7, 8 and 12.
SECTION – A
Each question carry 2 marks
1. Define stack. What is the significance of TOP in stack? 2
2. a) Expand the following term – ARPANET, GSM 2
b) What is MAC address? Also give the example?
3. What is a primary key? How many primary keys can be there in a table? 2
4. Write the code to create the connection in which database’s name is Python, name of 2
host, user and password can taken by user. Also, print that connection?
5. Write the output of the following on the basis of given 2
Table : Company
Cid C_name Price Qty
1 C1 680 23
2 C2 450 24
3 C3 245 43
4 C4 277 32
5 C5 389 17
a) Select max(price) from Company;
b) Select distinct(price) from Company;
c) Select sum(price) where Qty > 30;
d) Select count(distinct(price)) from Company;
6 i) Which keyword is used to perform pattern matching in MySQL? Explain it with example? 1
ii) A table "Employee" in a database has 10 columns and 5 records. What is the degree and 1
cardinality of this table?
7 Write SQL command to create a table name as Department with the following structure 2
Field Name Field Type Constraint
DEPTNO Integer PRIMARY KEY
DNAME Varchar(14) NOT NULL
LOC Varchar(13)
Salary Decimal
or
Table: student
AdmissionNo FirstName LastName DOB

012355 Rahul Singh 2005-05-16

012358 Mukesh Kumar 2004-09-15

012360 Pawan Verma 2004-03-03

a) Identify the attribute best suitable to be declared as Primary Key


Page 18 of 56
b) Insert the following data in table student:
AdmissionNo=012368 FirstName = Kamlesh
LastName = Sharma DOB =01 Jan 2004
Section – B
Each question carry 3 marks
8 Write a function in Python PUSH_IN(L), where L is a list of numbers. From this list, push all 3
even numbers into a stack which is implemented by using another list.
OR
Write a function in Python POP_OUT(Stk), where Stk is a stack implemented by a list of
numbers. The function returns the value which is deleted/popped from the stack.
9 Write a output for SQL queries (i) to (iii), which are based on the table: SCHOOL and ADMIN 3
given below:
TABLE: SCHOOL
CODE TEACHERNAME SUBJECT DOJ PERIO EXPERIENC
D E
1001 RAVI SHANKAR ENGLISH 12/03/2000 24 10
1009 PRIYA RAI PHYSICS 03/09/1998 26 12
1203 LISA ANAND ENGLISH 09/04/2000 27 5
1045 YASHRAJ MATHS 24/08/2000 24 15
1123 GANAN PHYSICS 16/07/1999 28 3
1167 HARISH B CHEMISTRY 19/10/1999 27 5
1215 UMESH PHYSICS 11/05/1998 22 16
TABLE: ADMIN
CODE GENDER DESIGNATION
1001 MALE VICE PRINCIPAL
1009 FEMALE COORDINATOR
1203 FEMALE COORDINATOR
1045 MALE HOD
1123 MALE SENIOR TEACHER
1167 MALE SENIOR TEACHER
1215 MALE HOD
a) SELECT SUM (PERIODS), SUBJECT FROM SCHOOL GROUP BY SUBJECT;
b) SELECT TEACHERNAME, GENDER FROM SCHOOL, ADMIN WHERE DESIGNATION =
‘COORDINATOR’ AND SCHOOL.CODE=ADMIN.CODE;
c) SELECT COUNT (DISTINCT SUBJECT) FROM SCHOOL;
10 a) Mr. Srinivasan is using a table with following columns: 1
Name, Class, Course_Id, Course_name
He needs to display names of students, who have not been assigned any stream or have
been assigned Course_name that ends with “economics”. He wrote the following
command, which did not give the desired result.
Page 19 of 56
SELECT Name, Class FROM Students WHREE Course_name=Null OR
Course_name=”%economics”;
Mr. Srinivasan to run the query by removing the error and write the correct query?
b) What is the difference between DDL and DML command? 2

Section – C
Each question carry 4 marks
11 Consider the following tables Sender and Recipient. Write SQL commands for the 4
statements (i) to (iv)
TABLE: SENDER
SenderID SenderName SenderAddress Sendercity
ND01 R Jain 2, ABC Appls New Delhi
MU02 H Sinha 12 Newtown Mumbai
MU15 S Jha 27/A, Park Street Mumbai
ND50 T Prasad 122-K,SDA New Delhi
TABLE: RECIPIENTS
RecID SenderID RecName RecAddress recCity

KO05 ND01 R Bajpayee 5, Central Avenue Kolkata

ND08 MU02 S Mahajan 116, A-Vihar New Delhi

MU19 ND01 H Singh 2A, Andheri East Mumbai

MU32 MU15 P K Swamy B5, C S Terminals Mumbai

ND48 ND50 S Tripathi 13, BI D Mayur Vihar New delhi

a) To display the names of all Senders from Mumbai.


b) To display the RecIC, Sendername, SenderAddress, RecName, RecAddress for every
Recipient.
c) To display Recipient details in ascending order of RecName.
d) To display number of Recipients from each city.
12 ABC company is planning to set up their new offices in India with its hub at Hyderabad . As
a Network advisor ,understand their requirements and suggest to them best solution.

Block to Block distance (in Meters):

Block From Block Distance


Human Resource Conference 60
Human Resource Finance 60
Conference Finance
Expected Number of Computer installed in each building block:

Page 20 of 56
Block Computer
Human Resource 125
Finance 25
Conference 60
1
a) Suggest a cable layout of connections between the buildings. 1
b) What is the most suitable block to install server? 1
c) What will be the best possible connectivity out of the following to connect its new office
in Bengaluru With its London-based office ?
i)Infrared ii)Satellite iii) Ethernet Cable
d) Which of the following devices will you suggest to connect each computer in each of the 1
above blocks?
i) Gateway ii) Switch iii) Modem
or
a) How many pair of wires are there in a twisted pair cable (Ethernet)? What is the name 1
of the port, which is used to connect Ethernet cable to a computer or a laptop?
b) A school with 20 stand-alone computers is considering networking them together and 1
adding a server. State 2 advantages of doing this.
c) Distinguish between LAN and WAN. 2
13 a) ………………….. is an example of cloud. 1
b) ………………….. is a network of physical objects embedded with electronics, software,
1
sensors and network connectivity.
c) ………………….. is a device to connect two dissimilar network. 1

d) ………………….. describes the measuring unit of data transfer rate . 1

**********************BEST OF LUCK**********************

Page 21 of 56
KENDRIYA VIDYALAYA SANGATHAN, REGIONAL OFFICE BHOPAL
PRE TERM END EXAMINATION – 2022
CLASS – XII
Computer Science (083)
MARKING SCHEME
Max Marks:35 Time Allowed :120 mins

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

INSTRUCTIONS
MARKING
PART NO.

MARKS
Q.NO.

QUESTION

1 A stack is an abstract data type and a linear or user defined data structure 1 mark each for 2
based on the principle of Last In First Out (LIFO). A stack is a list where def. of
Stack and
insertion and deletion can take place only at one end called Top. TOP.
2 a) Advanced Research Projects Agency Network 1/2 mark each for 1
Global System for Mobile Communications correct expansion
b) The NIC manufacturer assign a unique physical address to each NIC cars, 1 mark for correct 1
this physical address is known as MAC address.A MAC address is a 6-byye def.
address with each byte separated by colon : example 10:BS:04:56:2E:FC.
3 It is a combination of one or more fields in a table that can uniquely identify a 2 mark correct for 2
record. There can be only one primary key in a table. It plays an important role def.
in identifying the records, because it is the primary key who carries unique
values. The criteria for a field to become primary key is : It must be carrying
unique and NOT NULL values.
4 import mysql.connector ½ mark for 2
mycon = mysql.connector.connect( host = “localhost”, user = “root”, passwd = Import statement,
“tiger”, database = “Python”) ½ mark for printing
print(mycon) connection
object.1 mark for
correct
connection
5 a. 680 1/2 mark each for 2
b. correct answer
680
450
245
277
389
Page 22 of 56
c. Error
d. 5

1 mark for correct


Like
6 a) answer
b) Degree – 10, Cardinality – 5 1/2 mark for each
correct answer
7 create table department(DEPTNO
Integer PRIMARY KEY, DNAME
Varchar(14) NOT NULL, LOC Varchar(13), Salary Decimal);
or
a) AdmissionNo 1 mark for correct 1
answer

b) insert into student values(012368,’Kamlesh’,’Sharma’,’2004-01-01’) 1 mark for correct 1


answer

8 top=-1 ( ½ marks for 3


stk=[] correct function
def PUSH_IN(L): # Allow additions to the stack header)
for i in L: ( 1 mark for correct
accessing of list
if i%2==0:
elements)
stk.append(i) ( ½ mark for
top=len(stk)-1 correct condition
for even number)
( ½ mark for
applying append()
correctly)
( ½ mark for
OR assignment in
variable top)
def isEmpty(stk): # checks whether the stack is empty or not ( ½ marks for
if stk==[]: correct POP_OUT()
return True function header)
( ½ mark for
else:
checking empty
return False stack status)
def POP_OUT(stk): ( ½ mark for
if isEmpty(stk): # verifies whether the stack is empty or not removing item for
print(&quot;Stack Underflow&quot;) stack )
else: # Allow deletions from the stack ( 1 mark for
item=stk.pop() assignment in
variable top)
if len(stk)==0:
( ½ mark for
top=-1 returning the
else: deleted item)
top=len(stk)
return item
a) ENGLISH 51
9 PHYSICS 76
(1 mark for each
MATHS 24 correct answer)
CHEMISTRY 27 3
b) PRIYA RAI FEMALE
LISA ANAND FEMALE
c) 4

Page 23 of 56
10 a) SELECT Name, Class FROM Students WHERE Course_name IS NULL OR (1 marks for 3
Course_name LIKE ’%economics’; correct answer)
(2 mark for 2
b) Correct differentiation between DDL and DML command. correct difference)
11 a) SELECT sendername from Sender where sendercity=’Mumbai’; (1 mark for each 4
b) Select RecIC, Sendername, SenderAddress, RecName, RecAddress correct answer)
from Sender , Recepient where S.SenderID=R.SenderID ;

c) SELECT * from Recipent ORDER By RecName;


d) SELECT COUNT( *) from Recipient Group By RecCity;
12 a) Drawing of layout based on star or bus topology. (1 mark for each 4
b) Human Resource Block. correct answer)
c) Satellite.
d) Switch.
Or 1
a) TWO INSULATED COPPER WIRES , ETHERNET PORT.
b) Any two advantages. 1
c) Any two differentiation.
2
13 a) Google Drive or any other correct example. (1 mark for each 1
b) The internet of things OR Internet. correct answer) 1
c) Router. 1
d) megabit per second or any other correct unit. 1

Page 24 of 56
KENDRIYA VIDYALAYA SANGATHAN, CHENNAI REGION
REVISION TEST – TERM II – 2021 - 22
SUB: COMPUTER SCIENCE (083) MAX MARKS: 35
CLASS: XII TIME: 2 Hrs.

General Instructions

• The question paper is divided into 3 sections – A, B and C


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

Section - A
Each question carries 2 marks
Q. Part Question Marks
No. No
1. What do you mean by push and pop operations on stack? (2)
2. (i) Expand the following: (1)
FTP, TCP/IP
(ii) Arrange the following wired medium of transmission in the decreasing order (1)
of their speed:
Coaxial Cable, Twisted Pair Cable, Optical Fibre Cable.
3. Differentiate between delete and drop table Commands in SQL. (2)
4. Consider the SQL table Product given below, predict the output of the following (2)
code in Python:

Table: Product
pno pname price supid
101 pen 10 222
102 pencil 10 333
103 eraser 5 222

import mysql.connector as m
con=m.connect(host='localhost',user='root',passwd='kvcbe',database='12a')
cur=con.cursor()
cur.execute('select *from product')
d=cur.fetchmany(2)
print(d)
print(type(d))

25
5. Write the output of the queries (a) to (d) based on the table, Staff given below: (2)
Table: Staff
Id Name DOJ Dept Gender Exp
1 Aman 12-01-2006 Finance M 15
2 Dima 03-05-2016 Personnel F 5
3 Christina 15-11-2009 Sales F 12
4 Shem 20-12-2006 Sales M 15
5 Roshan 13-10-2013 Finance M 8
6 Danish 11-09-2013 Personnel M 8
7 Habeena 16-08-2011 Sales F 10

(a) Select avg(exp) from staff where gender = ‘F’;


(b) Select min(doj) from staff;
(c) Select *from staff where gender!=’M’ and dept like ‘_ _ _ _ _’;
(d) Select name, doj from staff where dept not in (‘Finance’,’Sales’);

6. (i) Give SQL Command to display the information about a table, like column (1)
names, data type and constraints on column name.
(ii) Give one point of difference between unique and primary key constraints. (1)
7. Consider the following tables: (2)

Table: Supplier

supid sname city


111 S and Co Mumbai
222 TTT Chennai
333 AAX Cbe

Table: Product

pno pname price supid


101 pen 10 222
102 pencil 10 333
103 eraser 5 222

(a) Find the Degree and Cardinality of the Cartesian product of the
Supplier and Product relations.
(b) Identify the foreign key in the given tables, also mention in which table
it is appearing as a foreign key?

OR
Find output:

(a) select *from product p, supplier s where p.supid=s.supid;


(b) select *from product natural join supplier;

26
Section - B
Each question carries 3 marks
8. Rajiv has created a dictionary containing employee names and their salaries as (3)
key value pairs of 6 employees.
Write a program, with separate user defined functions to perform the following
operations:
● Push the keys (employee name) of the dictionary into a stack, where the
corresponding value (salary) is less than 85000.
● Pop and display the content of the stack.
For example:
If the sample content of the dictionary is as follows:
Emp={"Ajay":76000, "Jyothi":150000, "David":89000, "Remya":65000,
"Karthika":90000, "Vijay":82000}
The output from the program should be:
Vijay Remya Ajay
OR
Aruna has a list containing temperatures of 10 cities. You need to help her create
a program with separate user defined functions to perform the following
operations based on this list.
● Traverse the content of the list and push the negative temperatures into a stack.
● Pop and display the content of the stack.

For Example:

If the sample Content of the list is as follows:


T=[-9, 3, 31, -6, 12, 19, -2, 15, -5, 38]
Sample Output of the code should be:
-5 -2 -6 -9
9. (i) A table, Book has been created in a database with the following fields: (1)
BookId, BookName, AuthorName, Price
Give the SQL command to add primary key constraint to the BookId field of
Book table.
(ii) Differentiate between DDL and DML commands. Give one example for each. (2)

27
10. Dileep has to create a database named Company in MYSQL. (3)
He now needs to create a table named Employee in the database to store the
records of employees in the company. The table Employee has the following
structure:
Table: Employee

Field Name Data type Remarks


Empid integer of size 5 Primary Key
Empname character of size 25 Not null
Design character of size 15 Unique
Salary floating point
DOB date

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

Section - C
Each question carries 4 marks
11. Write queries (a) to (d) based on the relations Car and Customer given below: (4)
Table: Car
Ccode Cname Manufacturer Colour Capacity Charges
201 Triber Renault Yellow 7 1000
203 Altroz Tata Black 5 1500
208 Innova Toyota Silver 8 3000
209 Harrier Tata White 6 2000
212 Duster Renault Red 6 2500
217 Ertiga Suzuki Grey 7 2300

Table: Customer
Custcode Custname Ccode
101 Gopinath 201
102 Ashok 203
103 Harshini 209
104 Vishnu 212
(a) To display the manufacturer and count of records under each
manufacturer where two or more records are there.
(b) To display the cname and respective custname of each car with seating
capacity is more than five.
(c) To display the car details in the decreasing order of their seating
capacity.
(d) To display the total number of manufacturers without duplicates.

28
12. (i) Give two advantages and two disadvantages of tree topology. (2)
OR
Define the following terms: website ,web browser
(ii) Explain any one switching technique. (2)

13. Excel Public School, Coimbatore is setting up the network between its different (4)
wings of school campus. There are 4 wings namely SENIOR(S), JUNIOR (J),
ADMIN (A) and HOSTEL (H).

Distances between various wings are given below:


Wing A to Wing S 100m
Wing A to Wing J 200m
Wing A to Wing H 400m
Wing S to Wing J 300m
Wing S to Wing H 100m
Wing J to Wing H 450m
Number of Computers installed at various wings are as follows:
Wings Number of Computers
Wing A 20
Wing S 150
Wing J 50
Wing H 25
(a) Suggest the best-wired medium and mention the topology or
layout to connect various wings of Excel Public School,
Coimbatore.
(b) Name the most suitable wing to house the server. Justify your
answer.
(c) Suggest placement of HUB/SWITCH in the network of the
School.

(d) Suggest a device that can provide wireless Internet access to all
smartphone/laptop users in the campus of Excel Public School,
Coimbatore.

29
30
KENDRIYA VIDYALAYA SANGATHAN, CHENNAI REGION
REVISION TEST – TERM II – 2021 - 22
SUB: COMPUTER SCIENCE (083) MAX MARKS: 35
CLASS: XII TIME: 2 Hrs.

General Instructions

• The question paper is divided into 3 sections – A, B and C


• Section A, consists of 7 questions (1-7). Each question carries 2 marks.
• Section B, consists of 3 questions (8-10). Each question carries 3 marks.
• Section C, consists of 3 questions (11-13). Each question carries 4 marks.
• Internal choices have been given for question numbers 7, 8 and 12
MARKING SCHEME
Section - A
Each question carries 2 marks
Q. Part Question Marks
No. No
1. What do you mean by push and pop operations on stack? (2)
Ans: Adding an item to a stack is called PUSH and removing an item from a
stack is called POP. Since stack is LIFO in nature, push and pop will be done at
the end of the stack.
(1 mark each for correct definition of PUSH and POP)
2. (i) Expand the following: (1)
FTP, TCP/IP
Ans:
FTP - File Transfer Protocol (½ mark)
TCP/IP - Transmission Control Protocol/Internet Protocol (½ mark)
(ii) Arrange the following wired medium of transmission in the decreasing order (1)
of their speed:
Coaxial Cable, Twisted Pair Cable, Optical Fibre Cable.
Ans:
Optical Fibre, Coaxial Cable, Twisted Pair Cable
(1 mark for correct order)
3. Differentiate between delete and drop table Commands in SQL. (2)
Ans:
(i) Delete is a DML command whereas drop table is a DDL command.
(ii) Delete command removes data from the relation whereas drop table
removes the table from the database.
(1 mark for each correct difference)

4. Consider the SQL table Product given below, predict the output of the following (2)
code in Python:

31
Table: Product
pno pname price supid
101 pen 10 222
102 pencil 10 333
103 eraser 5 222

import mysql.connector as m
con=m.connect(host='localhost',user='root',passwd='kvcbe',database='12a')
cur=con.cursor()
cur.execute('select *from product')
d=cur.fetchmany(2)
print(d)
print(type(d))
Ans:
[(101, 'Pen', 10.0, 222), (102, 'Pencil', 10.0, 333)] (1 mark)
<class 'list'> (1 mark)

5. Write the output of the queries (a) to (d) based on the table, Staff given below: (2)
Table: Staff
Id Name DOJ Dept Gender Exp
1 Aman 12-01-2006 Finance M 15
2 Dima 03-05-2016 Personnel F 5
3 Christina 15-11-2009 Sales F 12
4 Shem 20-12-2006 Sales M 15
5 Roshan 13-10-2013 Finance M 8
6 Danish 11-09-2013 Personnel M 8
7 Habeena 16-08-2011 Sales F 10

(e) Select avg(exp) from staff where gender = ‘F’;


(f) Select min(doj) from staff;
(g) Select *from staff where gender!=’M’ and dept like ‘_ _ _ _ _’;
(h) Select name, doj from staff where dept not in (‘Finance’,’Sales’);

Ans:
(a)
Avg(exp)

(b)
Min(doj)

2006-01-12

(c)
Id Name Doj Dept Gender Exp
3 Christina 2009-11-15 Sales F 12
7 Habeena 2011-08-16 Sales F 10

32
(d)
Name Doj
Dima 2016-05-03
Danish 2013-09-11

(½ mark for each correct output)

6. (i) Give SQL Command to display the information about a table, like column (1)
names, data type and constraints on column name.
Ans:
Describe or desc (1 mark for correct command)
(ii) Give one point of difference between unique and primary key constraints. (1)
Ans:
Primary key constraint - Null and duplicate values are not allowed
Unique key constraint – accepts null values but duplicate values are not
allowed.
(1 mark for correct difference)
7. Consider the following tables: (2)

Table: Supplier

supid sname city


111 S and Co Mumbai
222 TTT Chennai
333 AAX Cbe

Table: Product

pno pname price supid


101 pen 10 222
102 pencil 10 333
103 eraser 5 222

(c) Find the Degree and Cardinality of the Cartesian product of the
Supplier and Product relations.
(d) Identify the foreign key in the given tables, also mention in which table
it is appearing as a foreign key?

Ans:
(a) Degree – 7 (½ mark), Cardinality – 9 (½ mark)
(b) Supid is the foreign key (½ mark).
It is appearing as a foreign key in the product table (½ mark).

33
OR
Find output:

(c) select *from product p, supplier s where p.supid=s.supid;


(d) select *from product natural join supplier;

Ans:
(a)

(b)

(1 mark for each correct output)

Section - B
Each question carries 3 marks
8. Rajiv has created a dictionary containing employee names and their salaries as (3)
key value pairs of 6 employees.
Write a program, with separate user defined functions to perform the following
operations:
● Push the keys (employee name) of the dictionary into a stack, where the
corresponding value (salary) is less than 85000.
● Pop and display the content of the stack.
For example:
If the sample content of the dictionary is as follows:
Emp={"Ajay":76000, "Jyothi":150000, "David":89000, "Remya":65000,
"Karthika":90000, "Vijay":82000}
The output from the program should be:
Vijay Remya Ajay

Ans:

Emp={"Ajay":76000, "Jyothi":150000, "David":89000, "Remya":65000,


"Karthika":90000, "Vijay":82000}
def push(E,k):
E.append(k)

34
def pop(E):
if E != []:
return E.pop()
else:
return None
E = []
for i in Emp:
if Emp[i]<85000:
push(E,i)
while True:
if E != []:
print(pop(E), end=" ")
else:
break
(1 mark for correct PUSH operation 1 mark for correct POP operation 1
mark for correct function calls and displaying the output.)
OR
Aruna has a list containing temperatures of 10 cities. You need to help her create
a program with separate user defined functions to perform the following
operations based on this list.
● Traverse the content of the list and push the negative temperatures into a stack.
● Pop and display the content of the stack.

For Example:

If the sample Content of the list is as follows:


T=[-9, 3, 31, -6, 12, 19, -2, 15, -5, 38]
Sample Output of the code should be:
-5 -2 -6 -9
Ans:
T=[-9, 3, 31, -6, 12, 19, -2, 15, -5, 38]
def push(tp,k):
tp.append(k)
def pop(tp):
if tp != []:
return tp.pop()
else:
return None
tp = []
for i in T:
if i<0:
push(tp,i)
while True:
if tp != []:
print(pop(tp), end=" ")
else:
break
(1 mark for correct PUSH operation 1 mark for correct POP operation 1
mark for correct function calls and displaying the output.)

35
9. (i) A table, Book has been created in a database with the following fields: (1)
BookId, BookName, AuthorName, Price
Give the SQL command to add primary key constraint to the BookId field of
Book table.
Ans:
Alter table book add primary key(bookid);
(1 mark for correct command)
(ii) Differentiate between DDL and DML commands. Give one example for each. (2)
Ans:
DDL (Data Definition Language) commands deal with the structure of the
table.
Example: create table/alter table/drop table..
DML (Data Manipulation Language) commands deal with the records (data) in
the table.
Example: insert into/delete/update…
(1 mark for correct difference, ½ mark each for correct example)
10. Dileep has to create a database named Company in MYSQL. (3)
He now needs to create a table named Employee in the database to store the
records of employees in the company. The table Employee has the following
structure:
Table: Employee

Field Name Data type Remarks


Empid integer of size 5 Primary Key
Empname character of size 25 Not null
Design character of size 15 Unique
Salary floating point
DOB date

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


Ans:

Create database company; (½ mark)


Use company; (½ mark)

Create table Employee


(Empid int(5) primary key,
Empname varchar(25) not null, o
Design varchar(15) unique,
Salary float, DOB date); (2 marks)

Section C
Each question carries 4 marks

36
11. Write queries (a) to (d) based on the relations Car and Customer given below: (4)
Table: Car
Ccode Cname Manufacturer Colour Capacity Charges
201 Triber Renault Yellow 7 1000
203 Altroz Tata Black 5 1500
208 Innova Toyota Silver 8 3000
209 Harrier Tata White 6 2000
212 Duster Renault Red 6 2500
217 Ertiga Suzuki Grey 7 2300

Table: Customer
Custcode Custname Ccode
101 Gopinath 201
102 Ashok 203
103 Harshini 209
104 Vishnu 212
(e) To display the manufacturer and count of records under each
manufacturer where two or more records are there.
(f) To display the cname and respective custname of each car with seating
capacity more than five.
(g) To display the car details in the decreasing order of their seating
capacity.
(h) To display the total number of manufacturers without duplicates.
Ans:
(a) select manufacturer, count(*) from car group by manufacturer having
count(*)>=2;
(b) select cname, custname from car, customer where
car.ccode=customer.ccode and capacity>5;
(c) select * from car order by capacity desc;
(d) select count(distinct manufacturer) from car;

(1 mark for each correct command)


12. (i) Give two advantages and two disadvantages of tree topology. (2)
Ans:
Advantages of Tree topology
▪ Support for broadband transmission
▪ Easily expandable
▪ Easily manageable:
▪ Error detection and error correction are very easy.

(1 mark for any 2 correct advantages)

37
Disadvantages of Tree topology
• Difficult in troubleshooting
• High cost
• Chances of Failure
• Reconfiguration is difficult
(1 mark for any 2 correct disadvantages)
OR
Define the following terms: website, web browser
Ans: Website is a collection of web pages and related content that is identified
by a common domain name and published on at least one web server.
(1 mark for correct definition)

A web browser (commonly referred to as a browser) is a software application


for accessing information on the World Wide Web.
(1 mark for correct definition)
(ii) Explain any one switching technique. (2)
Ans:
Circuit switching is referred to as the technology of data transfer that utilizes
sending messages from one point to another. This involves sending messages
from the receiver to the sender and back simultaneously. A physical
connection gets established during this process along with the receiver a
dedicated circuit is always present to handle data transmissions, through which
data is sent.
OR
Packet switching can be used as an alternative to circuit switching. In the
packet-switched networks, data is sent in discrete units that have variable length.
(2 marks for correct explanation of any one switching technique)

13. Excel Public School, Coimbatore is setting up the network between its different (4)
wings of school campus. There are 4 wings namely SENIOR(S), JUNIOR (J),
ADMIN (A) and HOSTEL (H).

Distances between various wings are given below:


Wing A to Wing S 100m
Wing A to Wing J 200m
Wing A to Wing H 400m

38
Wing S to Wing J 300m
Wing S to Wing H 100m
Wing J to Wing H 450m
Number of Computers installed at various wings are as follows:
Wings Number of Computers
Wing A 20
Wing S 150
Wing J 50
Wing H 25
(d) Suggest the best-wired medium and mention the topology or
layout to connect various wings of Excel Public School,
Coimbatore.
(e) Name the most suitable wing to house the server. Justify your
answer.
(f) Suggest placement of HUB/SWITCH in the network of the
School.
(g) Suggest a device that can provide wireless Internet access to all
smartphone/laptop users in the campus of Excel Public School,
Coimbatore.

Ans:
(a) Coaxial Cable, Bus topology/Star Topology

J A S H
200 m 100 m 100 m
(BUS topology)
(½ mark for cable and ½ mark for topology/layout)

OR

J 300 m 100 m A

100 m

H
(STAR topology)

(b) Server should be installed in wing S (Senior) where the most


number of computers are connected.
(½ mark naming the wing and ½ mark for reason)

39
(c) In all the wings (1 mark for correct answer)
(d) Wireless Access Point/Wireless Routers
(1 Mark for correct identification of device)

40
KENDRIYA VIDYALAYA SANGATHAN, Dehradun REGION
Class: XII Session: 2021-22
Computer Science (Code 083)
Practice test : Term-2

TIME: 2 HOURS MAX MARKS: 35


General Instructions

 The question paper is divided into 3 sections – A, B and C


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

Section -A
Each question carries 2 marks
Q. Part Question Marks
No No.
1. What is a Data Structure. Give two Examples. (2)

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

TCP/IP,FTP
(ii) Out of the following, which is the device that is used to connect (1)
dissimilar networks and a device that regenerates the received signals.

Switch, Router, Modem, Hub, Gateway, Repeater, Bridge

3. Differentiate between Differentiate between DDL and DML (2)


commands with respect to databases.

4. (i) Create the connection of Python with MYSQL , in which (1)


Database Name=System
User=Admin
Password= Admin2123
(ii) Name and explain the command to fetch all the rows of a query (1)
result?

1 1
5. Write the output of the queries (a) to (d) based on the table, (2)
HOSPITAL given below:

Table: HOSPITAL
DEPARTME DATEOFA
NO NAME AGE CHARGES SEX
NT DM
1 Arpit 62 Surgery 21/1/98 300 M

2 Zareena 22 Ent 12/12/97 250 F


3 Kareem 32 Arthopedic 19/2/98 200 M

4 Arun 12 Surgery 11/1/98 300 M

5 Zubin 30 Ent 12/1/98 250 M


6 Karin 16 Ent 24/2/98 250 F

7 Ankita 29 cardiology 22/2/98 800 F

8 Zareen 45 Gynecology 22/2/98 300 F

9 Kush 19 Cardiology 13/1/98 800 M


Nuclear
10 Shilpa 23 21/2/98 NULL F
medicine

1) Select Count(Distinct DEPARTMENT) From Hospital;


2) Select Max(CHARGES) from Hospital where Sex=”F”;
3) Select NAME from hospital where SEX=”M” and
DEPARTMENT=”Ent”;
4) Select NAME, DATEOFADM from Hospital order by
DATEOFADM;.
6. (i) Give one point of difference between primary key and foreign (1)
key.

(ii) Shiwani has recently started working in MySQL. Help her in (1)
understanding the difference between where and having
clause.

2 2
7 Observe the following table and answer the parts (i) and(ii) accordingly (2)

(i) Write the names of most appropriate columns, which can be


considered as Primary KEY. Justify your answer
.
(ii) What is the degree and cardinality of the above table?

OR
Table : Issued

Book_Id IssueId Issuedto Quantit


y_Issue
d
T0001 I001 Kamal 4
C0001 I002 Arvind 5
F0001 I003 Suresh 2

I) Write the names of most appropriate columns,


which can be considered as candidate keys
II) Which command can be used to remove the table
ISSUED from the database BOOK

SECTION – B
Each question carries 3 marks

8. Nandu has created a dictionary containing countries and (3)


continent as key value pairs of 6 countries.
Write a program, with separate user defined functions to perform
the following operations:
● Push the keys (name of the country) of the dictionary into a
stack, where country belongs to continent “ASIA”.
● Pop and display the content of the stack.
For example: If the sample content of the dictionary is as
follows:
R={"UK":”EUROPE, "INDIA":”ASIA”, "CHINA":”ASIA”,
"EGYPT":”AFRICA”, "CUBA":”AMERICA”,
"JAPAN":”ASIA”}
The output from the program should be: JAPAN CHINA INDIA

3 3
OR

Vaishnav has a list containing names of 10 cities. You need to


help him create a program with separate user defined functions to
perform the following operations based on this list:

. ● Traverse the content of the list and push those names which
are having more than 5 characters in it.
● Pop and display the content of the stack.
For Example: If the sample Content of the list is as follows:
N=[“Paris”, “England”, “Mumbai”, “Delhi”, “London”]

Sample Output of the code should be:

London Mumbai England


9. (i) A table, medical store has been created in a database with the (1)
following fields: MedicineNo, Medicine, MedCode, Quantity
Give the SQL command to Rename field, Medicine to
MedicineName into the medicalstore table.
(ii) Define the following terms (2)
(a) Self Join
(b) Natural Join

10. An educational institution EducationPoint has to create (3)


EDUPOINT, STUDENT AND INSERT records to maintain
their inventory. As a database administer, Ajay has decided that :
 Name of the database – EDUPOINT
 Name of the table - STUDENT
The attributes of student are as follows:
 STUDENTID – numeric, primary key
 STUDNAME – character of size 30
 SCODE – character of size 10
 MARKS – numeric
Write SQL command to accomplish the task for EducationPoint.
Section C
Each question carries 4 marks

11. Write the SQL query for questions from (i) to (iv) (4)

4 4
(i) Display the Mobile company, Mobile name & price in descending
order of their manufacturing date.
(ii) To display the name of mobile company having price between
3000 & 5000.
(iii) To display Mobile company along with mobile name with
respective supplier .
(iv) Increase the Price by 10% whose year of manufacturing is
after 2010.
12. (i) Give two advantages and two disadvantages of Bus topology (2)
OR
Define the following terms: URL, Web Server

(ii) Your friend wishes to install a wireless network in his office. (2)
Explain him the differences between guided and unguided media.

13. Trine Tech Corporation (TTC) is a professional consultancy (4)


company. The company is planning to set up their new offices in
India with its hub at Hyderabad. As a network adviser, you have
to understand their requirement and suggest them the best
available solutions. Their queries are mentioned as (i) to (iv)
below.
Physical Locations of the blocked of TT

5 5
1. What will be the most appropriate block, where TTC should
plan to install their server?
2. Draw a block to cable layout to connect all the buildings in the
most appropriate manner for efficient communication.
3. What will be the best possible connectivity out of the
following, you will suggest to connect the new setup of offices in
Bangalore with its London based office:
o Satellite Link
o Infrared
o Ethernet Cable
4. Which of the following device will be suggested by you to
connect each computer in each of the buildings:
o Switch
o Modem
o Gateway

6 6
KENDRIYA VIDYALAYA SANGATHAN, Dehradun REGION
Class: XII Session: 2021-22
Computer Science (Code 083)
PreBoard Exam : Term-2 MARKING SCHEME
SET - 1

TIME: 2 HOURS MAX MARKS: 35


General Instructions

 The question paper is divided into 3 sections – A, B and C


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

Section -A
Each question carries 2 marks
Q. Part Question Marks
No No.
1. What is a Data Structure. Give two Eg (2)

1 mark for correct definition and ½ mark each for eg

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

TCP/IP,FTP
TCP- Transmission Control
Protocol. Internet protocol
FTP- File Transfer Protocol
½ mark each for correct
expansion
(ii) Out of the following, which is the device that is used to connect (1)
dissimilar networks and a device that regenerates the received signals.

Switch, Router, Modem, Hub, Gateway, Repeater, Bridge

Dissimilar Networks-Gateway
Regenerates Signals-Repeater
½ mark for each correct answer

3. Differentiate between Differentiate between DDL and DML (2)


commands with respect to databases.

1 1
1 mark for each correct difference ( minimum 2 differences to be given)

4. (i) Create the connection of Python with MYSQL , in which (1)


Database Name=System
User=Admin
Password= Admin2123
import mysql.connector as db 1 mark for
con=mysql.connector.connect(host=”localhost”,user=”Admin”, each correct
passwd=”Admin2123”, database=”system”) answer

(ii) Name and explain the command to fetch all the rows of a query (1)
result?

Fetchall()- It fetches all the rows of a query result. It returns all ½ mark for
the rows as a list of tuples. explanation
and ½ mark
for name of
command.
5. Write the output of the queries (a) to (d) based on the table, (2)
HOSPITAL given below:

Table: HOSPITAL
DEPARTME DATEOFA
NO NAME AGE CHARGES SEX
NT DM
1 Arpit 62 Surgery 21/1/98 300 M

2 Zareena 22 Ent 12/12/97 250 F

3 Kareem 32 Arthopedic 19/2/98 200 M


4 Arun 12 Surgery 11/1/98 300 M

5 Zubin 30 Ent 12/1/98 250 M


6 Karin 16 Ent 24/2/98 250 F
7 Ankita 29 cardiology 22/2/98 800 F

8 Zareen 45 Gynecology 22/2/98 300 F


9 Kush 19 Cardiology 13/1/98 800 M
Nuclear
10 Shilpa 23 21/2/98 NULL F
medicine

2 2
1.Count(Distinct DEPARTMENT) 1 mark for
each correct
6 answer
2 Max(CHARGES)
800
3 NAME
Zubin
4. NAME, DATEOFADM
Zareen 12/12/97
Arun 11/1/98
Zubin 12/1/98
Kush 13/1/98
Arpit 21/1/98
Karee
19/2/98
m
Shilpa 21/2/98
Ankita 22/2/98
Zareen 22/2/98
Karin 24/2/98
6. (i) Give one point of difference between primary key and foreign (1)
key.

1/2 mark for each correct difference (Any one point may be given)

(ii) Shiwani has recently started working in MySQL. Help her in (1)
understanding the difference between where and having
clause.

1/2 mark for each correct difference (Any one point may be given)

3 3
7 Observe the following table and answer the parts (i) and(ii) accordingly (2)

(i) Write the names of most appropriate columns, which can be


considered as Primary KEY. Justify your answer
.
(ii) What is the degree and cardinality of the above table?

OR
Table : Issued

Book_Id IssueId Issuedto Quantit


y_Issue
d
T0001 I001 Kamal 4
C0001 I002 Arvind 5
F0001 I003 Suresh 2 (i)
Writ
e the names of most appropriate columns, which can be
considered as candidate keys
(ii)Which command can be used to remove the table ISSUED
from the database BOOK
(i) Pno. It satisfies the criteria of Primary key NOT NULL and ½ mark for
UNIQUE correct field
and ½ mark
for
justification
(ii) Degree-4
½ mark each
Cardinality-5 for correct
OR degree and
cardinality

1 mark for
(i) Book_ID
correct
answer

1 mark for
(ii) DROP Table correct
answer

4 4
SECTION – B
Each question carries 3 marks

8. Nandu has created a dictionary containing countries and (3)


continent as key value pairs of 6 countries.
Write a program, with separate user defined functions to perform
the following operations:
● Push the keys (name of the country) of the dictionary into a
stack, where country belongs to continent “ASIA”.
● Pop and display the content of the stack.
For example: If the sample content of the dictionary is as
follows:
R={"UK":”EUROPE, "INDIA":”ASIA”, "CHINA":”ASIA”,
"EGYPT":”AFRICA”, "CUBA":”AMERICA”,
"JAPAN":”ASIA”}
The output from the program should be: JAPAN CHINA INDIA

OR

Vaishnav has a list containing names of 10 cities. You need to


help him create a program with separate user defined functions to
perform the following operations based on this list:

. ● Traverse the content of the list and push those names which
are having more than 5 characters in it.
● Pop and display the content of the stack.
For Example: If the sample Content of the list is as follows:
N=[“Paris”, “England”, “Mumbai”, “Delhi”, “London”]

Sample Output of the code should be:

London Mumbai England


# Question No 8 (first option) 1 mark for
R={"UK":”EUROPE, "INDIA":”ASIA”, "CHINA":”ASIA”, correct
"EGYPT":”AFRICA”, "CUBA":”AMERICA”, PUSH
"JAPAN":”ASIA”} operation
def PUSH(S,N):
S.append(N) 1 mark for
def POP(S): correct POP
if S!=[]: operation
return S.pop()
else: 1 mark for
return None correct
ST=[] function
for k in R: calls and
if R[k]=”ASIA’: displaying
PUSH(ST,k) the output
while True:
5 5
if ST!=[]:
print(POP(ST),end=" ")
else:
break

OR # Question No 8 (second option) 1 mark for


N=[“Paris”, “England”, “Mumbai”, “Delhi”, correct
“London”,”Dehradun”,”Calcutta”,”Bareilly”,”Merrut”,”Raipur”] PUSH
def PUSH(S,N): operation
S.append(N)
def POP(S): 1 mark for
if S!=[]: correct POP
return S.pop() operation
else:
return None 1 mark for
ST=[] correct
for k in N: function
if len(k)>=5: calls and
PUSH(ST,k) displaying
while True: the output
If ST!=[]:
print(POP(ST),end=" ") Note: Marks
else: to be
break awarded for
any other
correct logic
given by the
student
9. (i) A table, medicalstore has been created in a database with the (1)
following fields: MedicineNo, Medicine, MedCode, Quantity
Give the SQL command to Rename field, Medicine to
MedicineName into the medicalstore table.
Alter table medicalstore 1 mark for
RENAME(Medicine Medicinename); correct
command

(ii) Define the following terms (2)


(a) Self Join
(b) Natural Join

1 mark for each correct definition

10. An educational institution EducationPoint has to create (3)


EDUPOINT, STUDENT AND INSERT records to maintain
their inventory. As a database administer, Ajay has decided that :
 Name of the database – EDUPOINT
 Name of the table - STUDENT
The attributes of student are as follows:
6 6
 STUDENTID – numeric, primary key
 STUDNAME – character of size 30
 SCODE – character of size 10
 MARKS – numeric
Write SQL command to accomplish the task for EducationPoint.
CREATE DATABASE EDUPOINT; 1/2 mark for
correctly
creating
database.

CREATE TABLE STUDENT ( STUDENTID INT (6) PRIMARY KEY 1 mark for
,STUDNAME CHAR(30), SCODE CHAR(10), MARKS INT ); correctly
creating the
table. ½ for
correctly
INSERT INTO STUDENT writing
VALUES(100,“HEENA”,”S001”,55) Primary
constraint.

1 mark for
correctly
INSERTING
VALUES in
the table.

Section C
Each question carries 4 marks

11. Write the SQL query for questions from (i) to (iv) (4)

(i) Display the Mobile company, Mobile name & price in descending
order of their manufacturing date.
7 7
(ii) To display the name of mobile company having price between
3000 & 5000.
(iii) To display Mobile company along with mobile name with
respective supplier .
(iv) Increase the Price by 10% whose year of manufacturing is after
2010.

i) Select M_Company, M_Name, M_Price from MobileMaster 1 mark for


order by M_Mf_Date Desc; each correct
ii) Select M_Company from MobileMaster where M_Price query
between 3000 and 5000;
iii) Select M_Company, M_Name,M_Supplier from
MobileMaster,MobileStock where
MobileMaster.M_Id=Mobilestock.M_Id;
iv) Update MobileMaster
Set M_Price=M_Price+(0.1*M_Price)
Where year(M_Mf_Date)>’2010’;
OR
v) Update MobileMaster
Set M_Price=M_Price+(0.1*M_Price)
Where M_Mf_Date>’2010’;

12. (i) Give two advantages and two disadvantages of Bus topology (2)
OR
Define the following terms: URL, Web Server

½ mark for each correct advantage / disadvantage


OR
1 mark for each correct definition

(ii) Your friend wishes to install a wireless network in his office. (2)
Explain him the differences between guided and unguided media.

1 mark for each correct differences.

13. Trine Tech Corporation (TTC) is a professional consultancy (4)


company. The company is planning to set up their new offices in
India with its hub at Hyderabad. As a network adviser, you have
to understand their requirement and suggest them the best
available solutions. Their queries are mentioned as (i) to (iv)
below.
Physical Locations of the blocked of TT

8 8
1. What will be the most appropriate block, where TTC should
plan to install their server?
2. Draw a block to cable layout to connect all the buildings in the
most appropriate manner for efficient communication.
3. What will be the best possible connectivity out of the
following, you will suggest to connect the new setup of offices in
Bangalore with its London based office:
o Satellite Link
o Infrared
o Ethernet Cable
4. Which of the following device will be suggested by you to
connect each computer in each of the buildings:
o Switch
o Modem
o Gateway

1. Finance block because it has maximum no. of Computers. 1 mark for


each correct
answer

2.

3. Satellite Link
4. Switch

9 9
10 10
KENDRIYA VIDYALAYA SANGATHAN : BHUBANESWAR REGION
TERM – 2 PRE BOARD EXAMINATION
COMPUTER SCIENCE – XII
MAX MARKS: 35 SET-01 DURATION: 2HOURS
Instructions
The question paper is divided into 3 sections – A, B and C
 Section A, consists of 7 questions (1-7). Each question carries 2 marks.
 Section B, consists of 3 questions (8-10). Each question carries 3 marks.
 Section C, consists of 3 questions (11-13). Each question carries 4 marks.
 Internal choices have been given for question numbers 7, 8 and 12.
 All questions are compulsory.
Section A (Each question carries 2 marks)
Q Part Question Marks
No No.
1. What is stack? Why it is called LIFO data structure? 2
2 (i) Which protocol is used to exchange files on Internet? 1
(ii) Expand the following Terms: 1
CDMA, URL
3 What do you mean by domain of an attribute in DBMS? Explain with an example. 2
4 Rohan Wants to delete a table “STUDENT” physically from the database “SCHOOL”, 2
based on the given code fill the statement 1 and statement 2:

import mysql.connector
mydb=mysql.connector.connect(host="localhost",user="root",passwd="12345",databa
se="SCHOOL")
mycursor=_______________ #statement 1
mycursor.execute(__________________) #statement 2
5 Write the output of the queries (a) to (d) based on the table, Mobile given below: 2
M_Id M_Company M_Name M_Price M_Mf_Date
MB001 Samsung Galaxy 15000 12-02-2013
MB003 Nokia N1100 12500 15-04-2011
MB004 Micromax Unite 3 5500 17-10-2016
MB005 Sony XperiaM 25000 20-11-2017
MB006 Oppo SelfieEx 18500 21-08-2010
a) SELECT MAX(M_Mf_Date), MIN(M_Mf_Date) FROM Mobile;
b) SELECT * FROM Mobile WHERE M_Price>15000 AND M_Company LIKE "S%";
c) SELECT M_Mf_Date FROM Mobile WHERE M_Name IN ("Galaxy", "Unite 3");
d) SELECT AVG(M_Price) FROM Mobile;
6 (i) What is the difference between where clause and having clause in SQL? 1
(ii) Write the output of the following SQL queries based on the Mobile table given in 1
Question No. 5 : select M_Price * 0.1 as discount FROM MOBILE;
7 Given the Table TRAINER 2
TID TNAME CITY HIREDATE SALARY

101 SUNAINA MUMBAI 1998-10-15 90000

102 ANAMIKA DELHI 1994-12-24 80000

103 DEEPTI CHANDIGARH 2001-12-21 82000

104 MEENAKSHI DELHI 2002-12-25 78000

105 RICHA MUMBAI 1996-01-12 95000

106 MANIPRABHA CHENNAI 2001-12-12 69000

a. What is Degree and Cardinality of the above table?


b. Which field should be made as the primary key? Justify your answer
OR
What is the difference between candidate key and Alternate key? Explain with example.
Section B (Each question carries 3 marks)
8 Reva has created a dictionary containing Product names and prices as key value pairs 3
of 4 products. Write a user defined function for the following:
● PRODPUSH() which takes a list as stack and the above dictionary as the parameters.
Push the keys (Pname of the product) of the dictionary into a stack, where the
corresponding price of the products is less than 6000. Also write the statement to call
the above function.
For example: If Reva has created the dictionary is as follows:
Product={"TV":10000, "MOBILE":4500, "PC":12500, "FURNITURE":5500}
The output from the program should be: [ ‘FURNITURE’, ‘MOBILE’]
OR
Shaan has a list containing 14 integers. You need to help him create a program with
separate user defined function to perform the following operation based on this list.

● NUMUSH() which takes a list as stack and the above list of numbers as the
parameters. push the numbers of the list which are divisible by 5 into a stack. Also
write the statement to call the function.

For Example: If the sample Content of the list is as follows:


M=[2, 10,13,17,25,32,38,44, 56, 60,21, 74, 35,15]
Sample Output of the code should be: [10, 25, 60, 35, 15]
9 (i) Write the actual datatypes as per the following Structure requirement during creation 2
of a table:
Field Description Actual Datatype with
length
PID 11 digit number
ProdName Can be upto 25 characters
DateofManufacture Date of Manufacture
Price 7 digits number which includes
2 places after decimal point.

(ii) Vani created a table named Customer that have fields Cno, Custname, Address, 1
Amount. Now she wants to increase the width to 30 Characters of the column
“Address”. Write the SQL command for it.
10 a) “Zenith” Company conducts workshops for employees of organizations. The 3
company requires data for workshops that are organized. Write SQL query to create a
Database named as “Zenith” and create a table ‘Workshop’ with the following structure:
Field Type Constraint
Workshopid Integer Primary Key
Title Varchar(50)
DateWorkshop Date
NumSpeakers Integer

b) Zenith company wants to insert a row in the table ‘Workshop’. Write the command
for it.
Section C (Each question carries 4 marks)
11 Write queries for (i) to (iv) which are based on the tables. 4
Table: VEHICLE
VCODE VEHICLETYPE PERKM
V01 VOLVO BUS 150
V02 AC DELUX BUS 125
V03 ORDINARY BUS 80
V05 SUV 30
V04 CAR 18
Table: TRAVEL
CNO CNAME TRAVELDATE KM VCODE NOP
101 K. Niwal 13-12-2015 200 V01 32
103 Adarsh Kumar 21-03-2016 120 V03 45
105 Shyam Sen 23-04-2016 450 V02 42
102 Ravi Kisan 13-01-2016 80 V02 40
107 John Malina 10-02-2015 65 V04 2
104 Sahanabhuti 28-01-2016 90 V05 4
106 Ramesh Jaya 06-04-2016 100 V01 25
Note:
 PERKM is Freight Charges per kilometre.
 KM is kilometres Travelled
 NOP is number of passengers travelled in vehicle.
i. To display CNO, CNAME, TRAVELDATE from the table TRAVEL in descending order
of CNO.
ii. To display the CNAME ,VEHICLETYPE of all customers who are travelling by
VEHICLE with code V03 or V05
iii. To display the CNO and CNAME of those customers from the table TRAVEL who
travelled between ’13-12-2015‘ and ’21-03-2016‘.
iv. To display the VCODE,CNAME,VEHICLETYPE from both the tables with distance
travelled (km) more than 100 Km.
12 (i) What is the difference between hub and switch? Which is more preferable in a large 2
network of computers and why?
(ii) Write two advantages of using an optical Fiber cable over an Twisted Pair cable to 2
connect two service stations which are 200m away from each other.
OR
Differentiate between Website and webpage. Write any two popular example of online
shopping.
13 NMS Training Institute is planning to set up its centre in Bhubaneswar with four 4
specialised blocks for Medicine, Management, Law courses along with an Admission
block in separate buildings. The physical distances between these blocks and the
number of computers to be installed in these blocks are given below. You as a network
expert have to answer the queries raised by their board of directors as given in (i) to
(iv).
Shortest distances between various locations in metres:
Admin Block to Management Block 50

Admin Block to Medicine Block 30

Admin Block to Law Block 65

Management Block to Medicine Block 40

Management Block to Law Block 125

Law Block to Medicine Block 35

Number of Computers installed at various locations are as follows:


Admin Block 250

Management Block 100

Medicine Block 45

Law Block 95
(i). Suggest the most suitable location to install the main server of this institution to get
efficient connectivity.
(ii). Suggest by drawing the best cable layout for effective network connectivity of the
blocks having server with all the other blocks.
(iii). Suggest the device to be installed in each of these buildings for connecting
computers installed within the building.
(iv) Suggest the most suitable wired medium for efficiently connecting each computer
installed in every building out of the following network cables:
 Coaxial Cable
 Ethernet Cable
 Single Pair
 Telephone Cable.

- END -
KENDRIYA VIDYALAYA SANGATHAN : BHUBANESWAR REGION
TERM – 2 Pre Board Examination
COMPUTER SCIENCE – XII
MARKING SCHEME [ SET-1 ]

Section A
Q No. Answers Marks to
No be
allotted
1. A stack is a linear data structure that follows the principle of Last In First Out (LIFO). 2
This means the last element inserted inside the stack is removed first.
Stack is a linear data structure in which the elements can be added or removed only
from one end known as “Top” of the stack. The discipline of Stack is LIFO (Last In
First Out) i.e. element inserted last will be removed first.
(1 marks for correct definition and 1 marks for correct reasons)
2 (i) FTP 1
(ii) Code Division Multiple Access 1
Uniform Resource Locator
(1/2 marks for each correct full forms)
3 Domain of an attribute is the set of values from which a value may come in a column. 2
E.g. Domain of section field may be (A,B,C,D).
(1 marks for correct definition and 1 marks for example)
4 statement 1-mydb.cursor() 2
statement 2-"DROP TABLE STUDENT"
(1 marks for each correct statement)
5 a) 20-11-2017, 21-08-2010 2
b) Sony
c) 12-02-2013
17-10-2016
d) 15300
(1/2 marks for each correct output)
6 (i) Correct difference 01 Mark 1
(ii) discount 1
1500
1250
550
2500
1850
7 a.Degree-5 2
Cardinality-6
b. Primary Key is TID, It is used to ensure data in the specific column is unique. It is
a column cannot have NULL values.

OR
Candidate key: Attribute / Attribute combinations in a relation that can serve as a
primary key. Example: In EMP table: Empno, Ename
Alternate Key: A candidate key that is not the primary key is called an alternate key.
Example: in EMP table Empno Primary key then Ename will be the alternate key.
Section B
8 Product={"TV":10000, "MOBILE":4500, "PC":12500, "FURNITURE":5500} 3
stack=[]
def PRODPUSH(stack, P): # [ 1 Mark ]
for k in Product: # [1/2 Mark ]
if P[k]<6000: # [1/2 Mark ]
stack.append(k) # [1/2 Mark ]
PRODPUSH(stack, Product) # [1/2 Mark ]
print(stack)

OR
M=[2, 10,13,17,25,32,38,44, 56, 60,21, 74, 35,15]

stack=[]
def NUMPUSH(stack, P): # [ 1 Mark ]
for k in M: # [1/2 Mark ]
if k%5==0: # [1/2 Mark ]
stack.append(k) # [1/2 Mark ]
NUMPUSH(stack, M) # [1/2 Mark ]
print(stack)
9 (i) Field Data Type Actual Datatype with 2
length
PID Numeric length 11 int(11)
ProdName Variable Character length 10 varchar(10)
DateofManufacture Data type date
Price Floating 7 digits including 2 float(7,2)
decimal

ALTER TABLE Customer


ii) MODIFY Address(30); 1
10 a. CREATE DATABASE Zenith; 3
CREATE TABLE Workshop(Workshopid integer Primary Key,Title Varchar(50),
DateWorkshop date, NumSpeakers integer);
b. INSERT INTO Workshop(101,”CCT WORKSHOP”,’12-03-2019’,3);
1 mark for create database 1 mark for create table and 1 mark for insert command)
Section C
11 SELECT CNO, CNAME, TRAVELDATE FROM TRAVEL ORDER BY CNO DESC; 4
SELECT CNAME,VEHICLETYPE FROM TRAVEL T, VEHICLE V WHERE
T.VCODE=V.VCODE AND VCODE IN(’V03’,’V05’);
SELECT CNO, CNAME, TRAVELDATE FROM TRAVEL WHERE TRAVELDATE
BETWEEN ’13-12-2015‘ AND ’21-03-2016‘;
SELECT T.VCODE,CNAME,VEHICLETYPE FROM TRAVEL T, VEHICLE V
WHERE T.VCODE=V.VCODE AND KM> 100 ;
(1 marks for each correct command)
12 (i) Hub forwards the message to every node connected and create a huge traffic in the 2
network hence reduces efficiency whereas a Switch is also called intelligent hub
since it redirects the received information/ packet to the intended node(s). In a large
network a switch is preferred to reduce the unwanted traffic in the network which
may also reduce the bandwidth and cause network congestion.
(ii) Advantages of using an optical Fiber : 2
i. Faster speed than ethernet.
ii. Lower attenuation (Any Two Advantages )
OR
Web Page is a document or a page where there is information. We can see those
pages in the browser. Web Page is a single page with information. It can be in any
form like texts, images or videos. Whereas the Website is a collection of webpages.
The website has its own domain name which is unique throughout the world.
Anything can be stored on a website like photos, videos, texts etc . Popular example
of online shopping : Amazon,Flipkart etc
13 i) Admin Block 4
(1 mark for correct answer)
(ii)

(1 mark for correct answer)


(iii) Modem or Switch or Router
(1 mark for correct answer)
(iv)Ethernet Cable
(1 mark for correct answer)
DATE:11/03/2022
KENDRIYA VIDYALAYA SANGATHAN HYDERABAD REGION
कꢁꢂꢃय ꢄꢅꢆयालय ꢀगठन ꢂदरꢄबꢄद ꢀभꢄग
TERM II 2021-2022 ꢀꢁतीया सꢂ 2021-22)
st
I Pre Board -2022 (ꢃी बोꢄड 1-2022)
CLASS:XII
SUBJECT: COMPUTER SCIENCE
TIME:2 HOURS MAX. MARKS: 35

General Instructions
The question paper is divided into 3 sections – A, B and C
Section A, consists of 7 questions (1-7). Each question carries 2marks.
Section B, consists of 3 questions (8-10). Each question carries 3marks.
Section C, consists of 3 questions (11-13). Each question carries 4marks.
Internal choices have been given for question numbers 7, 8 and12.
Section -A
Each question carries 2 marks
Q 1. Write any 2 applications of stacks. 2
Q2 a) Expand the terms POP3 , VoIP 1
b) The transmission media best suitable for connecting to hilly areas is 1
________________
Q3 1
a) If a column is expected to store values up to 2 million, choose the best data type
for it in MYSQL.
b) Lisꢀ ꢀꢁo commonlꢂ ꢃsed DBMS sofꢀꢁareꢄs. 1

Q4 Usha assigned to create a python game project and store results in MYSQL 2
database.
(a) Which package she has to import to connect with database?

(b) Write command to connect with SCHOOL database located on local host
ꢁiꢀh ꢃser as ꢅrooꢀꢆ and passꢁord as ꢅꢀigerꢆ?
Q5 Write the output of the following (a) to (d) on the basis of below given 2
table
Faculty

a) Select * from faculty where DOJ ꢀ “ꢁꢂ-12-ꢃꢄ”;


b) Select * from faculty where Fsal ꢀ ꢅꢆꢂꢂꢂ and Fname like “ꢇn”;
c) Select Fsal * ꢄꢅ as “Annual Salary” from faculty;
d) Select count(*) from faculty where Fname like “Sꢇ” and Fsal ꢀ
40000;
Q6 a) Which command is used to delete a database? 1

b) Differentiate char(n) and varchar(n) with example. 1

Q7 2
Consider tables ORDER and ORDER_ITEM table given below
ORDER ORDER_ITEM
order_id order_item_id
User_id order_id
total_cost item_name
order_date cost
status

a) Identify suitable PRIMARY KEYS in above 2 tables and Justify.


OR
b) Identify suitable FOREIGN KEY in order item table and Justify.

SECTION – B
Each question carries 3 marks

Q8 Create a record of MARKS containing RollNo, StudentName and Marks. 3


Write a user defined function to create a stack and perform the following
operations:
ꢇ Inpꢃꢀ ꢀhe RollNo, SꢀꢃdenꢀName and Marks from ꢀhe ꢃser
and Push into the stack.
ꢇ Displaꢂ ꢀhe sꢀaꢀꢃs of sꢀack afꢀer each inserꢀion
OR
Write a function in Python PUSH(L), where L is a list of numbers. From this
list push all numbers divisible by 5 into a stack N_STACK.
Display the stack if it has at least one element,otherwise display error
message.
For Example:
If the sample Content of the list is as follows:
N=[12, 15, 34, 50, 21, 70, 98, 22, 35, 38]

Sample Output of the code should be:


15 50 70 35

If the sample Content of the list is as follows:


N=[12, 18, 34, 56, 21, 73, 98, 22, 33, 38]
Stack Underflow as no numbers divisible by 5

Q9 2
a) A table, Transport is created with the following columns:

BUS_NO, BUS_ROUTE, AREA, NO_OF_STUDENTS, HELPER_NAME,


CHARGES
Write an SQL update command to increase the Bus charges by 12% for
all students
b) Identify the commands and categorize them into DDL and DML commands. 1
(i) To change the values in a table on satisfying condition
(ii). To add a new column into the table.
Q 10 Complete the below code by writing appropriate statements of Python Mysql 3
connectivity
import mysql.connector
mydb =____________( host="localhost",
user="yourusername", password="yourpassword",
database="mydatabase") #Statement(1) to connect with database
mycursor = _____________#.Statement(2) to create cursor object

mycursor._____("SELECT * FROM customers")


#Statement(3) to execute SQL command
myresult = ______________#Statement(4) to retrieve all rows from
Cursor object
for x in _____:#Statement(5) to iterate through resultset
print(x)
mycursor._________#Statement(6) to close cursor object

Section C
Each question carries 4 marks
Q.11 Write queries (a) to (d) based on the tables BOOKS and ISSUED given below: 4
BOOKS
ID NAME AUTHOR PUBLISHER PRICE TYPE QTY.
C1 FAST LATA EPF 300 TRAV 15
F1 TEARS WILLI FIRST 600 FICT 20
T1 C++ BRAIN EPF 300 READ 10
T2 C ROSSIE TDH 350 READ 5
F2 BOLTS ANNA FIRST 750 FICT 15
ISSUED
ID QTY_ISSUED
T1 4
C1 5
F1 2

(a) To show name, author and price of books published of FICT type
(b) To insert a new row in the table ISSUED having following
daꢀa:ꢆF2ꢆ,1
(c) To increase price of FICT type books by 2%
(d) To display ID and QTY_ISSUED ordered by PRICE
Q.12 2
a) What are the functions of the following devices
a)Hub b)Switch
OR

Define the following terms:briely


Mbps, PAN
b) Compare network switching techniques? 2
Explain about packet switching technique
Q.13 An International Educational Institute has been established with 4 Wings in four 4
buildings and planning to establish a network between wings. The wings and
distances are as follows:
Primary Wing, Secondary Wing, Hostel Wing and Admin Wing
Primary to Secondary Wing 150
Secondary to Admin Wing 50
Hostel to Admin wing 125
Admin to Primary Wing 150
Primary to Hostel Wing 130
Secondary to Hostel Wing 145

Number of computer systems in each wing are as follows:

Secondary 20
Admin 30
Primary 15
Hostel 10

a) Suggest and draw appropriate cable layout for connections between Wings
b) Name the type of network formed to connect all the four wings.
c) Suggest the most suitable place to house a server in Institute with reason.
d) Which wireless channel out of the following should be opted by Institute to
connect with the students all over the world?
Microwave ,Satellite, Infrared
KENDRIYA VIDYALAYA SANGATHAN
HYDERABAD REGION
PREBOARD EXAMINATIONMARKING SCHEME
COMPUTER SCIENCE (Code: 083)
MaximumMarks:35 Time: 2hours
Section -A
Each question carries 2 marks
Q. Part Question Marks
No No.
1. Expression Evaluation. (2)
Expression Conversion.
Backtracking.
Memory Management.

*any other appropriate applications


2. (i) POP3 - Post Office Protocol (1)
VoIP - Voice over Internet Protocol
(ii) Microwave. (1)
3. (i) BIGINT. (2)
(ii) MySQL, Microsoft Access, Oracle, PostgreSQL, dBASE, FoxPro,
SQLite, IBM DB2
*any two correct answers
4. (a) mysql.connector (2)
(b) mysql.connector.connect(host = “localhost”, user
=“root”, passwd=”tiger”, database= “SCHOOL”)
*any user name and password
5. a) Select * from faculty where DOJ > “90-12-31”;
F_idFnameFsal DOJ
103Sumit45000 23-07-93
104Suman22000 19-09-97
105Sumati 50000 09-07-00
b) Select * from faculty where Fsal> 25000 and Fname like “%n”;
Fid Fnamefasl DOJ
102 Aman 34000 1990-02-10
c) Select Fsal * 12 as “Annual Salary” from faculty;
Annual Salary
| 300000 |
| 408000 |
| 540000 |
| 264000 |
| 600000
d) Select count(*) from faculty where Fname like “S%” and Fsal>
40000;
count(*) |
| 2|
[1]
6. (i) DROP DATABASE <name>; (1)

(ii) CHAR datatype is used to store character string of fixed length (1)

VARCHAR datatype is used to store character string of variable


length.

Gender char(5)….accepts fixed length of 5 letters


Gender varchar(5)..accepts variable length less than 5

7. a) order_id in ORDER table and order_item_id in (2)


ORDER_ITEM table will play role of Primary_key as
they fulfill Uniquness and Not Null constarints.
OR
b) order-id will be the foreign key in the table order item

SECTION – B
Each question carries 3 marks

8. MARKS=[] (3)

def push(record):
if len(MARKS)>10:
print("Stack overflow")
else:
MARKS.append(record)
print("Stack contents")
print(MARKS)
choice = "y"
while choice in ["y","Y"]:
RollNo = int(input("enter roll no"))
StudentName = input("Enter Student name:")
Marks = int(input("Enter Marks"))
push([RollNo, StudentName, Marks])
choice = input("enter y to continue n to exit")

OR
N_STACK=[]
L=[12, 1, 34, 53, 21, 72, 98, 22, 34, 38]
[2]
def PUSH(L):
for ele in L:
if ele%5==0:
N_STACK.append(ele)

if len(N_STACK)<=0:
print("Stack Underflow as no numbers divisible by 5")
else:
for i in range(len(N_STACK)):
print(N_STACK.pop(),end=" ")

PUSH(L)
9. (i) (2)
UPDATE Transport SET charges=charges*0.12;
(ii) (1)
(i) To change the values in a table on satisfying condition-DML
(ii). To add a new column into the table- DDL

10. import mysql.connector (3)


mydb =mysql.connector.connect( host="localhost",
user="yourusername", password="yourpassword",
database="mydatabase")
#............................................Statement(1)
mycursor =mydb.cursor()#............................................Statement(2)
mycursor.execute("SELECT * FROM customers")#......Statement(3)
myresult = mycursor.fetchall()#....................................Statement(4)
for x in myresult:#...........................................................Statement(5)
print(x)
mycursor.close()#..............................................................Statement(6)

Section C
Each question carries 4 marks
11. (a) SELECT name, author, price FROM books WHERE type=”FICT”; (4)
(b) INSERT INTO issuedVALUES(”F2”,1);
(c) UPDATE books SET price =price*0.02 WHERE type=”FICT”;
(d) SELECT books.id, issued.qty_issued FROM books, issued
WHERE books.id=issued.id ORDER BY books.price

[3]
12. (i) a)Hub -A hub is a physical layer networking device which is used to (2)
connect multiple devices in a network. They are generally used to
connect computers in a LAN.When a data frame arrives at a port, it is
broadcast to every other port.
b)Switch-A switch is a data link layer networking device which
connects devices in a network and uses packet switching to send and
receive data over the network.when a data frame arrives at any port of
a network switch, it examines the destination address and sends the
frame to the corresponding device(s).
OR
e) Mbps –Megabits per second (Mbps) are units of measurement
for network bandwidth and throughput. They are used to show
how fast a network or internet connection is. Each Mbps
represents the capacity to transfer 1 million bits each second, or
roughly one small photo per second. It may also be expressed as
Mbit/s or Mb/s.
f) PAN - Personal Area Network (PAN) is an interconnection of
personal technology devices to communicate over a short
distance, which is less than 33 feet or 10 meters or within the
range of an individual person, typically using some form of
wireless technologies.

(ii) . (2)
Packet Switching
Links are created independently one by one between the nodes
on the way.
The big message is divided into a small number of packets.
Packets follow the independent path to hold the destination.
Packets do not appear in sequence at the destination.

a)

[4]
b) LAN.
At Admin Wing as it is having Maximum number of systems
and near & connected to other 2 wings.
d)
Satellite

[5]
KENDRIYA VIDYALAYA SANGATHAN, JAIPUR REGION
TERM 2 PREBOARD EXAMINATIONS (2021-22)
SUBJECT: COMPUTER SCIENCE (Code: 083)
CLASS- XII
Maximum Marks: 35 Time: 2 hours
General Instructions
The question paper is divided into 3 sections – A, B and C
Section A, consists of 7 questions (1-7). Each question carries 2 marks.
Section B, consists of 3 questions (8-10). Each question carries 3 marks.
Section C, consists of 3 questions (11-13). Each question carries 4 marks.
Internal choices have been given for question numbers 7, 8 and 12.

SECTION -A
Each question carries 2 marks
Q. Part Questions Marks
NO. No.
1 Name any two linear Data Structures? What do you understand by the term 2
LIFO?
2 (i) Write the full form of HTTP and XML. 1
(ii) Out of the following, which transmission media requires a Line of Sight? 1
Satellite, Infrared, Microwave, Radio waves
3 How the data type CHAR differs from VARCHAR in MySql? Illustrate with an 2
example?
4 Which is the most appropriate method to access 5 records from a cursor 2
object? Write down complete python statement depicting how it will be used?
5 Consider the following table named DEBTOR and write the output of the 2
following queries: -
DEBTOR
P_NO PERSON_NAME AMOUNT RATING CITY
111 KAMLESH KUMAR 50000 A JAIPUR
112 SANDEEP JAIN 25000 B UDAIPUR
113 RAJESH SHARMA 30000 B AJMER
114 OMESH 20000 C JAIPUR
115 RITIK GUPTA 70000 C KOTA
116 RAJAT 40000 C UDAIPUR
117 AMAN GUPTA 60000 A UDAIPUR

a) SELECT DISTINCT CITY FROM DEBTOR;


b) SELECT PERSON_NAME, RATING FROM DEBTOR
WHERE PERSON_NAME LIKE “%A”;
c) SELECT COUNT(*) FROM DEBTOR WHERE RATING=”C”;
d) SELECT AVG(AMOUNT) FROM DEBTOR
WHERE P_NO IN(111,113,115);
6 (i) Monika created a database in MySql. Next day she wanted to create a table 1
inside it. Which command she has to use before writing CREATE TABLE
command?
(ii) What is Equi Join? 1

7 Answer following questions based on the tables given below: - 2

Table - PRODUCT
Product_No Product_Name Price Date_of_Entry
536 Soap 5.00 2021-11-30
204 Paste 10.00 2021-04-30
427 Tea 3.00 2021-07-31
1027 Oil 2.00 2021-10-31
1038 Toffee 6.00 2021-09-30

Table - Bill
Bill_no Bill_Date Amount Product_No
10001 2022-01-02 15520.00 536
10002 2022-01-05 10320.00 204
10005 2022-01-09 10770.00 427
10011 2022-01-25 10000.00 1027
10028 2022-01-27 12000.00 1038

a. What will be the Primary Key of Product relation? Justify your answer.
b. What is the Cardinality and Degree of Product relation?
OR
a. Is there any foreign key in any of the above tables? If yes mention its
name.
b. What will be Degree and Cardinality of Bill relation?
SECTION – B
Each question carries 3 marks
8 Assume a dictionary names KVS having Region and Number of Schools as 3
key-value pairs. Write a program with separate user-defined functions to
perform the following operations:

 Push the keys (Name of Region) of the dictionary into a stack, where the
corresponding value (Number of Schools) is more than 50.
 Pop and display the content of the stack.

For example
If the sample content of the dictionary is as follows:
KVS={"DELHI":55, “JAMMU”:27, "JAIPUR":76, "GURUGRAM":47, "AGRA":60}

The output from the program should be:


AGRA JAIPUR DELHI
OR
A list NUM has some integer numbers. Write down a program to prepare a
stack of even integers from the given list NUM. The program should have user-
defined functions which perform the following operations based on this list.
 Traverse the content of the list and push the EVEN numbers onto the
stack.
 Pop and display the content of the stack.

For Example:
If the Sample Content of the list is as follows:
N=[3,5,10,13,21,28,45,56,60,78]

Sample Output of the code should be:


10, 28,56, 60
9 (i) A table TEACHER has attributes CODE, NAME, POST, and CATEGORY. Write 1
down the command to delete the attribute CATEGORY from this table.
(ii) Identify which is the valid or invalid statement out of the followings: - 2
a) DELETE and DROP TABLE commands are the part of DDL.
b) SELECT and UPDATE are the part of DML.

10 Write the queries to create a database named as ENTERPRIZE and then 3


create the following table STAFF in it as described below: -

TABLE -STAFF
StaffID Char type data with length 5 PRIMARY KEY

FirstName varchar type data with length 20 NOT NULL


LastName varchar type data with length 15
Gender Char type data with length 1
SECTION C
Each question carries 4 marks
11 Consider following tables and answer queries (i) to (iv) 4
DEALER
DCODE DEALER_NAME CITY
1 ACL Pvt NEW DELHI
2 INDIA Agency JAIPUR
3 Rajdeep Ltd UDAIPUR
4 G&G Corp JAIPUR
CAR
ID MODEL MAKER PRICE DCODE
C1 HONDA CITY HONDA 15.0 2
B2 CRETA HYUNDAI 14.0 1
T3 XUV-500 MAHINDRA 8.50 3
Note – Price is given in Lakhs

a) Display Model and Maker name whose price is more than 10 Lakhs in
the descending order of price.
b) Show Model and their respective Dealer name.
c) Display dealer name who is from JAIPUR and dealing with cars of
HONDA.
d) Display total number of dealer of each city.

12 (i) What are the differences between LAN and WAN? (Any four) 2
OR
Define Web page and URL?
(ii) Identify the Switching Technique: 2
a) In this technique the resources are reserved during the whole
communication process.
b) In this technique the data is broken into n number of smaller chunks of
data before transmission.
13 TCS Pvt. Ltd. is opening its new software development branch in Jaipur. The 4
campus of this branch has 4 wings as shown in the diagram:

Wing to Wing Distance: Number of Computers:

Wing X to Wing Z 70m Wing X 50


Wing Z to Wing Y 60m Wing Z 130
Wing Y to Wing X 135m Wing Y 40
Wing Y to Wing U 70m Wing U 15
Wing X to Wing U 165m
Wing Z to Wing U 80m

a) Draw the cable layout to connect all the wings. Also write the name of the
topology.
b) Which would be the most suitable wing to house the server of the
company? Also mention the reason of it.
c) Suggest the device to be placed /installed in each of these WINGs to
connect all the computers within each wing.
d) Suggest the placement of a Repeater in the network with justification.
KENDRIYA VIDYALAYA SANGATHAN, JAIPUR REGION
TERM 2 PREBOARD EXAMINATIONS (2021-22)
SUBJECT: COMPUTER SCIENCE (Code: 083)
CLASS- XII
MARKING SCHEME
Maximum Marks: 35 Time: 2 hours
General Instructions
The question paper is divided into 3 sections – A, B and C
Section A, consists of 7 questions (1-7). Each question carries 2 marks.
Section B, consists of 3 questions (8-10). Each question carries 3 marks.
Section C, consists of 3 questions (11-13). Each question carries 4 marks.
Internal choices have been given for question numbers 7, 8 and 12.

SECTION -A
Each question carries 2 marks
Q. Part Questions Marking Marks
NO. No. Instructions
1 List, Stack, Queue 1 mark for two 2
LIFO means Last in First Out – organization of data in such a correct data
way that the data arrived/received first will be processed last. structures’ name
1 mark for correct
definition of LIFO
2 (i) HTTP – Hyper Text Transfer Protocol ½ mark 1
XML – Extensible Markup Language ½ mark
(ii) Infrared, Microwave ½ + ½ mark 1
3 CHAR VARCHAR 2 marks for any 2
Fixed length characters/ Variable length characters/ two correct points
String String
Waste of storage space Saves storage space
Char(20) will always Varchar(20) will consume
consume 20 characters characters according the
irrespective of the length of length of string to be stored.
string to be stored.
4 fetchmany() 1 mark 2
data=cursor.fetchmany(5) 1 mark
5 a) ½ mark 2
Distinct CITY
JAIPUR
UDAIPUR
AJMER
KOTA
b)
½ mark
PERSON_NAME RATING
RAJESH SHARMA B
RITIK GUPTA C
AMAN GUPTA A
c)
Count(*)
3 ½ mark
d)
AVG(BALANCE)
½ mark
50000

6 (i) USE command 1 mark for correct 1


answer
(ii) EQUI JOIN creates a JOIN for equality or matching column(s) values of 1 mark for correct 1
the relative tables. definition
Syntax :
SELECT column_list
FROM table1, table2....
WHERE table1.column_name = table2.column_name
7 a. Product_no will be the primary key because it has unique 1 mark 2
values for each tuple and each product must have a product
number.

1 mark
b. Degree – 4 cardinality = 5
OR
a. Product_no. in Bill table is the foreign key here because it is 1 mark
the primary key of Product table and providing relationship
between both of these tables

1 mark
b. Degree – 4 Cardinality 5
SECTION – B
Each question carries 3 marks
8 #Push Function 1 marks push 3
def PUSH(S,N): function
S.append(N)

#Pop Function 1 marks pop


def POP(S): function
if S!=[]:
return S.pop()
else:
return None

ST=[] 1 Mark calling


KVS={"DELHI":55, “JAMMU”:27, "JAIPUR":76, "GURUGRAM":47, "AGRA":60} push() and pop()
for k in KVS: correctly
if KVS[k]>50:
PUSH(ST,k)

while True:
if ST!=[]:
print(POP(ST),end=" ")
else:
break
OR
#Push Function 1 marks push
def PUSH(S,N): function
S.append(N)

#Pop Fucntion 1 marks pop


def POP(S): function
if S!=[]:
return S.pop()
else:
return None

ST=[] 1 Mark calling


Num=eval(input(“Enter list elements - ”)) push() and pop()
for k in Num: correctly
if k%2==0:
PUSH(ST,k)

while True:
if ST!=[]:
print(POP(ST),end=" ")
else:
break
9 (i) ALTER TABLE TEACHER DROP CATEGORY; 1 mark 1
(ii) a) INVALID 1 mark 2
b) VALID 1 mark
10 CREATE DATABASE ENTERPRIZE; ½ mark 3
USE ENTERPRIZE; ½ mark
CREATE TABLE Staff 2 marks
(
StaffID INT(5) PRIMARY KEY,
First_Name VARCHAR(20) NOT NULL,
Last_Name VARCHAR(15),
Gender char(1) );

SECTION C
Each question carries 4 marks
11 a) SELECT MODEL, MAKER 1 mark for 4
FROM CAR correct query
WHERE PRICE>10;
ORDER BY PRICE DESC;
b) SELECT MODEL,DEALER_NAME 1 mark for
FROM CAR, DEALER correct query
WHERE CAR.DCODE=DEALER.DCODE;
c) SELECT DEALER_NAME 1 mark for
FROM CAR, DEALER correct query
WHERE CAR.DCODE=DEALER.DCODE AND
CITY=”JAIPUR” AND MAKER=”HONDA”;
1 mark for
d) SELECT CITY, COUNT(*) correct query
FROM DEALER
GROP BY CITY;
12 (i) What are differences between LAN and WAN? (Any four) ½ mark each for 2
Attributes LAN WAN any four correct
Complete The complete form of LAN The complete form of WAN is the
differences
Form is 'Local Area Network'. 'Wide Area Network'.
Definition LAN is a group of devices WAN is an arrangement of several
connected in a small devices attached over a network
geographic area, such as covering a broad area.
houses, offices, or
buildings.
Geographical LAN covers a small WAN covers a large distance
Area geographical area, geographical area.
Speed LAN provides a WAN has a slower speed as
comparatively higher compared to LAN.
speed.
Ownership LAN is owned, managed, WAN can be either private or
and used by an individual public. The Internet is the best
or an organization. example of public WAN.
Therefore, it is a private
network.
Congestion LAN has low congestion WAN has relatively higher
than WAN. congestion as compared to LAN.
Fault LAN has higher fault WAN has a lower fault tolerance as
Tolerance tolerance. compared to LAN.
Components The main components of The main components of WAN
LAN include Layer 1 include Layer 3 devices (e.g.,
devices (e.g., hubs, Routers, Multi-layer switches) and
repeaters) and Layer 2 technology-specific devices (e.g.,
devices (e.g., switches, AM, Frame-relay switches).
bridges).
Bandwidth LAN offers high WAN offers low bandwidth for the
bandwidth for the transmission.
transmission.
Cost Since LAN covers a small The setup for WAN is high because
area, it can be set up very of its wider geographical area.
cheaply.

OR
Web page
A web page (or webpage) is a hypertext document provided by a 1 mark
website and displayed to a user in a web browser. It contains
information on a single topic to be published on WWW.

URL
A URL (Uniform Resource Locator) is a unique identifier used to locate a 1 mark
resource on the Internet. It is also referred to as a web address. URLs
consist of multiple parts -- including a protocol and domain name -- that
tell a web browser how and where to retrieve a resource
Example
-
https://www.techtarget.com/searchnetworking/definition/Internet.html

(ii) a) Circuit switching 1 mark 2


b) Packet Switching 1 mark
13 a) Bus topology ½ mark for any of 4
correct layout

½ mark for
identification of
topology

OR
Star Topology

b) Wing Z is the suitable place to install server because of


80:20 principle it has maximum number of computers

c) Switch/HUB
½ mark for correct
d) Repeater should be installed between wings Y and X, X wing and ½ for
and U because the distance between these are more reason
than 100mtrs.
1 mark
½ mark for correct
location and ½ for
reason
KENDRIYA VIDYALAYA SANGATHAN,
MUMBAI REGION
PRE BOARD EXAMINATION-TERM-2 2021-22
CLASS-12 COMPUTER SCIENCE
Maximum Marks: 35 Time: 2 hours
General Instructions
● The question paper is divided into 3 sections – A, B and C.
● Section A, consists of 7 questions (1-7). Each question carries 2 marks.
● Section B, consists of 3 questions (8-10). Each question carries 3 marks.
● Section C, consists of 3 questions (11-13). Each question carries 4 marks.
● Internal choices have been given for question numbers 7, 8 and 12.

Q. Part Section -A Each question carries 2 marks Marks


No. No.
Question

1. What is Stack ? Define insert and delete operations on stack. 2

2. (i) 1
Give the full forms of the following.
(i) POP3 (ii) VoIP

(ii) Arrange the following wired media in Descending order of Transmission Speed. 1
Coaxial Cable, Optical Fibre, Twisted Pair Cable, Telephone Cable

3. Differentiate between DDL and DML command statements with examples. 2

4. Differentiate between fetchone() and fetchall() methods with suitable 2


examples for each.

5. Write a output for SQL queries (i) to (iv), which are based on the table: ACTIVITY 2
given below:

ACode ActivityName Participants PrizeMoney ScheduleDate


1001 Relay 100x4 16 10000 23-Jan-2004
1002 High jump 10 12000 12-Dec-2003
1003 Shot Put 12 8000 14-Feb-2004
1005 Long Jump 12 9000 01-Jan-2004
1008 Discuss Throw 10 15000 19-Mar-2004
(1) select count(distinct participants) from activity;
(2) select max(scheduledate),min(scheduledate) from activity;
(3) select sum(prizemoney) from activity;
(4) select avg(Participants) from Activity;

1
6. (i) Which command is used to view Structure of a Table? 1

(ii) What do you mean by referential integrity? 1

7. Consider following the following table Employee given below. 2


EmpID EName DeptNo SalaryLevel
100 Anushka 10 S3
110 Arman 20 S1
111 Gourang 10 S4
112 Asif 30 S1
114 Ravi 30 S2
115 Pranav 10 S4
102 Naveesha 20 S3

(a) Identify the Degree and Cardinality of the above table.


(b) Which columns can be considered as a Primary Key and foreign key.

OR
(a) Identify Candidate Keys from the above table ‘Employee’
(b) Consider the following table ‘ Salary’ and give answer of the following
question.

Sal Level Min_Pay Max_pay Bonus_Paid_(%)

S1 20000 35000 10

S2 25000 40000 12

S3 30000 50000 15

S4 35000 70000 NULL

If the above two tables are related to each other then which column is best
suitable for foreign key column to establish a relationship between these tables.

2
SECTION – B
Each question carries 3 marks

8. Ashutosh created a dictionary which contains Names of Fruits as a Key and Price as
a Value of it for 6 fruits.
Write a program which have a separate functions to perform PUSH and POP
operations as per following desciptions.

1. PUSH the names of the fruits whose price range between 100 to 200
( including 100 and 200 both ) into the stack.
2. POP the element and display the content on screen.
3.
For example: If the sample content of the dictionary is as follows:

Fruits ={"Guava":120, "Papaya":70 , "Banana": 65, "Apple":135,


"Strawberry":175, "Kiwi": 95}

The output from the program should be:


Strawberry Apple Guava

OR
Consider a list integer values which has 10 values in it. You need to create a
program with separate functions for the following purposes.

(1) To traverse all the elements of the list and Push those elements into the
stack which are divisible by both 3 and 5 both.
(2) Pop the element from stack and also display it.

For Example:
If the sample Content of the list is as follows:
N=[9 , 13 , 15 , 25, 30 , 40 , 45 , 65 , 90 , 105 ]

Sample Output of the code should be:


15 30 45 90 105

9. (i) A table CUSTOMER has been created with following columns. 1


CustNo, CustName, City, ContactNo,BillAmt,PurchaseDate

Write a SQL statement to remove a column PurchaseDate from the table.

(ii) Suraj wants to display the Name of the Customers,City and BillAmt whose city 2
value entered as NULL from the CUSTOMER table.
He wrote the a query but not succeeded. Help him to correct it.

SELECT CustName,City,BillAmt FROM Customer WHERE City=”NULL”;

3
10. VIkash needed to create a table PUBLISHER in a database names BOOKS. 3
The table should include following columns and it’s descriptions as given below.
Write appropriate queries to open a database and also to create a table in it.

FieldName Datatype Remarks


and size

PublCode Varchar(10) Primary Key

PublName Varchar(20) Not Null

City varchar(15)

Bill_Paid float(7,2)

Distr_Code integer(5) Foreign Key


Related Column DCode of Distributor table

Section C
Each question carries 4 marks

11. Write queries (a) to (d) based on the tables PRODUCT and CLIENT. 4

Table- Client
CID CliName City PID
01 Rakesh Delhi TP01
02 Prakash Mumbai TP05
03 Suresh Delhi TP03
04 Dinesh Delhi TP02
05 Pravesh Banglore TP04

Table- PRODUCT
PID ProdName Manufactures Price
TP01 Pen Cello 5
TP02 Gel pen Luxar 10
TP03 Ink pen Luxar 10
TP04 Pencil Natraj 2
TP05 Sketch Camel 2

(a) Display Average price of all manufacturers, Manufacturer Wise.


(b) Display ProductName,Price and Customer Name whose city is Delhi.
(c) Display Names of Products and Price whose Manufacturer is either ‘Cello’ or
‘Camel’.
(d) Display all the City Names without any repetition from the Client table

4
12 (i) Differentiate PAN, LAN and MAN and WAN networks in terms of following criteria. 2
Data Transmission Speed, Area Covered

(ii) Explain the usage of the following devices in the network. 2


(i) Modem (ii) Bridge

5
13. Great Studies University is setting up its Academic school at Sunder Nagar and 4
planning to set up a network. The university has 3 academic schools and one
administration center as shown in the diagram bellow:
Distances between Buildings

Law school to Business school 60m

Law school to Technology School 90m

Law school to Admin Center 115m

Business school to Technology School 40m

Business school to Admin Center 45m

Technology school to Admin Center 25m

Business Technology
school

Law Admin
school centre

No. of Computers in each Building


Law school 25
Technology school 50
Admin center 125
Business school 35

(i) Suggest the most suitable place( i.e school/center) to install the server of this
university Suggest with a suitable reason.
(ii) Suggest and draw an ideal layout for connecting these school/center for a
wired connectivity.
(iii) Which device will you suggest to be placed/installed in each of these
school/center to efficiently connect all the computers within these
school/center.
(iv)The university is planning to connect its admission 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.

6
KENDRIYA VIDYALAYA SANGATHAN,
MUMBAI REGION
PRE BOARD EXAMINATION-TERM-2 2021-22
CLASS-12 COMPUTER SCIENCE
Maximum Marks: 35 Time: 2 hours

MARKING SCHEME
Q. Part Section -A Each question carries 2 marks Marks
No. No.
Answers

1 Stack is data structure which performs insert and delete operations at single 2
end(i.e. Top end) , so it is also called LIFO structure. 1M
Insert operation is called PUSH and delete/remove element is called POP
operation. 1M

2 (i) POP- Post Office Protocol 1


VoIP - Voice On Internet Protocol

(ii) Optical Fibre , Twisted Pair Cable, Co-axial Cable, Telephone Cable 1

3 DDL stands for Data Definition Language.It consists commands which is 2


basically used to work with table. Not with table data.
CREATE , DROP, ALTER , USE, SHOW Ii,e
DML stands for Data Manipulation Language. It consists commands which are
basically used to deal with Records/rows of the table.
INSERT INTO, UPDATE..SET, DELETE , SELECT ( to extract records)

4 fetchone( ) method will get/ load only single record at the current position into 2
the recordset object .By default this record is in string form.
fetchall( ) method will get/load all the records into the recordset object. These
fetched records are in the list form.

5 (1) count(distinct participants) ½ x4=


16 2
10
12
(2) max(scheduledate) , min(scheduledate)
19-Mar-2004 12-Dec-2003

(3) sum(prizemoney)
54000

(4) avg(Participants)
12

6 (i) DESC / DESCRIBE command 1


(ii) Referential Integrity means there is SQL integrity assurance that the value in a 1
column as a foreign key can not be added if such value does not exist in the
primary key of the related table(Parent table).

Similarly, the value in a primary key column of the parent table can not be
deleted if the same value already exist in the related foreign key of the other
table.

7 (a) Degree - 4 Cardinality -7 2


(b) Primary Key - EmpID and foreign key- SalaryLevel

OR
(a) Candidate Keys - EmpID , DeptNo
(b) SalaryLevel

8. # Question No 8 (first option) 3


Fruits ={"Guava":120, "Papaya":70 , "Banana": 65, "Apple":135,
"Strawberry":175, "Kiwi": 95}

def PUSH(S,FName):
S.append(FName)

def POP(S):
if S !=[ ]:
return S.pop()
else:
return None
S=[ ]
for k in Fruits:
If S[k]>=100 and S[k]<=200:
PUSH(S,k)
while True:
if S !=[ ]:
print(POP(S),end=" ")
else:
break

OR

# Question No 8 (second option)


N=[9 , 13 , 15 , 25, 30 , 40 , 45 , 65 , 90 , 105 ]

def PUSH(S,Num):
S.append(Num)

def POP(S):
if S !=[ ]:
return S.pop()
else:
return None
S=[ ]
for k in N:
If k%3==0 and k%5==0:
PUSH(S,k)
while True:
if S !=[ ]:
print(POP(S),end=" ")
else:
break

9. (i) ALTER TABLE CUSTOMER 1


DROP COLUMN PurchaseDate;

(ii) SELECT CustName,City,BillAmt FROM Customer WHERE City IS NULL; 2

10 1. USE BOOKS; 2

2. CREATE TABLE PUBLISHER


( PublCode varchar(10) Primary Key,
PublName varchar(20) Not Null,
City varchar(15),
Bill_Paid float(7,2),
Distr_Code integer(5) REFERENCES Distributor(DCode) );

11 (a) SELECT Manufacturers, avg(Price) 4


FROM PRODUCT
GROUP BY Manufacturers;
(b) SELECT PRODNAME,PRICE,CITY
FROM PRODUCT,CLIENT
WHERE PRODUCT.PID=CLIENT.PID
AND CITY=’DELHI’;
(C) SELECT PRODNAME,PRICE FROM PRODUCT
WHERE MANUFACTURERS=’CELLO’
OR MANUFACTURERS=’CAMEL’;
(d) SELECT DISTINCT CITY FROM CLIENT;

12 (1) 2
Criteria \ PAN LAN MAN WAN
media
Data Highest Medium Less Very Less
Transmission
Speed
Area Covered Few Up to 4 -5 Up to 60- 70 Entire
meters Kms, Kms World

(2) (a) Modem - It is a network device to connect a system/ network with 2


outside network , specifically for internet purpose.
It is used to connect for internet and it performs
modulation/demodulation process.
(b) Bridge - It is a network device to connect two or more similar types of
networks /protocols systems in a network.
Generally, it is used by Internet Service Providers.

13 (i) Admin Center 1

(ii) 1

Star topology OR Bus Topology

(iii) Switch 1

(iv) WAN 1
KENDRIYA VIDYALAYA SANGATHAN::SILCHAR REGION
PREBOARD EXAMINATION (TERM 2) - 2022
CLASS – XII SUBJECT: COMPUTER SCIENCE (083)

Maximum Marks: 35 Duration: 2 Hrs

General Instructions:

➢ The question paper is divided into 3 Sections - A, B and C.

➢ Section A, consists of 07 Questions (1-7). Each question carries 2 Marks.

➢ Section B, consists of 03 questions (8-10). Each question carries 3 marks.

➢ Section C, consists of 03 questions (11-13). Each question carries 4 marks.

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

SECTION (A)

This section consists of 07 Questions (1 to 7).


Each question carries 2 Marks.

Sl. No. Questions Marks

1. Write down the full forms of below. 01

a) IMAP b) SLIP

What is an IP Address? 01

2. What is a stack and what are its applications? 02

3. i) What do mean by Cardinality and Degree of a table in RDBMS? 01

ii) Which function is used to connect python with MySQL databases? 01

4. i) Which SQL command is used to change or make a database active? 01

ii) Which SQL command is used to modify tuples of a relation? 01

5. What is an attribute and tuple of a table? 02

6. Table: Stationery 02
StId StationeryName Company Price

DP01 Dot Pen Luxor 10

PL02 Pencil Natraj 6

ER05 Eraser Natraj 3

5
PL01 Pencil Camelin 5

GP02 Gel Pen Montex 15

Write output for the SQL Queries based on a table Stationery

i) SELECT Company, MAX(Price), MIN(Price), COUNT(*) FROM Stationery

GROUP BY Company;

ii) SELECT StationeryName, Price*3 as ‘Total Price’ FROM Stationery;

7. Siya has to create a database named ORACLENK in MYSQL. She now needs to create a 02
table named STMASTER in the database to store the records of students of her school. The
table STMASTER has the following structure:
Table Name: STMASTER

FIELD NAME DATATYPE CONSTRAINTS

STID INTEGER PRIMARY KEY


STUDENTNAME VARCHAR(30)
DATE OF BIRTH DATE
GENDER CHAR(1)
FEE DECIMAL
STATUS VARCHAR(6)

OR
What is difference between Delete and Drop Commands?

SECTION (B)
This section consists of 03 Questions (8 to 10).
Each question carries 3 Marks.

8. Write AddNew (Book) and Remove(Book) methods in Python to add a new Book and 03

Remove a Book from a List of Books Considering them to act as PUSH and POP operations

of the data structure Stack?

OR

Write a program to implement the stack using list.

9. i) What do you mean by Domain in terms of DBMS? 01


ii) What are the main differences between Primary Key and Unique Key?
02

10. The given program is used to connect with MySQL abd show the name of the all the record 03

from the table “stmaster” from the database “oraclenk”. You are required to complete the

statements so that the code can be executed properly.

import _____.connector__pymysql

6
dbcon=pymysql._____________(host=”localhost”, user=”root”,

________=”sia@1928”)

if dbcon.isconnected()==False

print(“Error in establishing connection:”)

cur=dbcon.______________()

query=”select * from stmaster”

cur.execute(_________)

resultset=cur.fetchmany(3)

for row in resultset:

print(row)

dbcon.______()

SECTION (C)

This section consists of 03 Questions (11 to 13).


Each question carries 4 Marks.
11 Write SQL commands for the queries based on tables COMPANY and CUSTOMER. 4
Table: COMPANY
CID NAME CITY PRODUCTNAME
111 Sony Delhi TV
222 Nokia Mumbai Mobile
333 Onida Delhi TV
444 Sony Mumbai Mobile
555 Blackberry Madras Mobile
666 Dell Delhi Laptop

CUSTOMER
CUSTID NAME PRICE QTY CID
101 Rahul Sharma 70000 20 222
102 Deepak Kumar 50000 10 666
103 Mohan Kumar 30000 5 111
104 Suchaye Dev 35000 3 333
105 Neha Soni 25000 7 444
106 Siya Singh 20000 5 333
107 Arjun Singh 50000 15 666
i) To display those company name which are having price less than 30000.

ii) To display the name of the companies in reverse alphabetical order.

iii) To increase the price by 1000 for those customer whose name starts with ‘S’

iv) To add one more column totalprice with decimal(10,2) to the table customer

12. i) What do you mean network topology? Write two examples also. 02

7
Or

a) Identify the Protocol, Domain Name and document in the given URL.

https://www.silchar.kvs.ac.in/index.php

b) What is the use of ping command?

ii) What are the differences between Circuit Switching Technique and Packet 02

Switching Technique?

Or

Give two advantages and two disadvantages of star topology

13. S3 Edutech has set up its new center at Kamla Nagar for its office and web based activities. 04

The company compound has 4 buildings as shown in the diagram below:

Orbit

Building
Sunrise
Jupiter
Building
Building

Oracle

Building

Distance between various buildings.

Jupiter Building to Orbit Building 50 Mtrs

Orbit Building to Oracle Building 85Mtrs.

Oracle Building to Sunrise Building 25 Mtrs.

Sunrise Building to Jupiter Building 170 Mtrs.

Jupiter Building to Oracle Building 125 Mtrs.

Orbit Building to Sunrise Building 45Mtrs.

Number of Computers in each of the buildings is follows:

Jupiter Building 30

Orbit Building 150

Oracle Building 15

Sunrise Building 35

i) Suggest a cable layout of connections between the buildings.

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

with a suitable reason

iii) Suggest the placement of the following devices with justification:

a. Internet Connecting Device/Modem

b. Switch

iv) The organisation is planning to link its sale counter situated in various parts of the

same city, which type of network out of LAN, MAN or WAN will be formed? Justify

your answer.

9
KENDRIYA VIDYALAYA SANGATHAN::SILCHAR REGION
PREBOARD EXAMINATION (TERM 2) - 2022
CLASS – XII SUBJECT: COMPUTER SCIENCE (083)
Maximum Marks: 35 Duration: 2 Hrs

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

SECTION (A)

This section consists of 07 Questions (1 to 7).


Each question carries 2 Marks.

Sl. No. Questions Marks

11. One mark for each. 01


b) IMAP- Internet Message Access Protocol
c) SLIP-Serial Line Internet Protocol

What is an IP Address? 01
Answer:
IP stands for "Internet Protocol” It is a unique address that identifies a device
on the internet or a local network and is the set of rules governing the format of
data sent via the internet or local network.

12. What is a stack and what are its applications? 02


One mark for defining stack and one mark for writing applications.
A stack is a linear structure implemented in Last In First Out (LIFO) manner, where
instructions and deletion s are restricted to occur only at one end called Stack Top.
Applications of Stack
1. Reversing of a sequence.
2. Polish String ( Infix to Postfic conversion, Postfox and Prefix Expression
Evaluation)

13. iii) What do mean by Cardinality and Degree of a table in RDBMS? 01


Answer:
Cardinality means number of tuples of a table.
Degree means numner of attributes of a table
iv) Which function is used to connect python with MySQL databases? 01

Answer: connect()

14. iii) Which SQL command is used to change or make a database active? 01
use <Database>

10
iv) Which SQL command is used to modify tuples of a relation? 01
update Command

15. What is an attribute and tuple of a table? 02


The columns or fields are generally referred as attributes of a table. Attributes defines
structure a table.
The rows are generally referred as Tuples of a table. Tuples contains data stored in one
table.

16. Write output for the SQL Queries based on a table Stationery 01
iii) SELECT Company, MAX(Price), MIN(Price), COUNT(*) FROM Stationery
GROUP BY Company;
+------------------+------------------+------------------+-----------------+
| Company | MAX(Price) | MIN(Price) | COUNT(*) |
+------------------+------------------+------------------+-----------------+
| Camelin | 5 | 5 | 1 |
| Luxor | 10 | 10 | 1 |
| Montex | 15 | 15 | 1|
| Natraj | 6 | 3 | 2|
+------------------+------------------+------------------+------------------+

iv) SELECT StationeryName, Price*3 as ‘Total Price’ FROM Stationery;


+--------------+-----------------+ 01
| StName | Total Price |
+--------------+-----------------+
| Dot Pen | 30 |
| Eraser | 9 |
| Gel Pen | 45 |
| Pencil | 15 |
| Pencil | 18 |
+--------------+-----------------+
17. mysql> create database oraclenk; 02
mysql> use oraclenk;
one mark for correct syntax for database creation and making database active by use command.

mysql> create table stmaster(stid int primary key, studentname varchar(30), date_of_birth date,
gender char(1), fee decimal, status varchar(6));
one mark for correct syntax of creating table.
OR 02
Delete is a DML command, used to delete the record as per users criteria. – 1 Mark
Drop is a DDL command used to drop or remove various database elements such as tables,
databases, views etc.- 1 Mark

SECTION (B)
This section consists of 03 Questions (8 to 10).
Each question carries 3 Marks.

11
18. Write AddNew (Book) and Remove(Book) methods in Python to add a new Book and 03
Remove a Book from a List of Books Considering them to act as PUSH and POP operations
of the data structure Stack?
One mark for correct definition of PUSH operation
One mark for correct definition of POP operation
One Mark for checking of Underflow and Overflow conditions
OR
Write a program to implement the stack using list.
One mark for correct definition of PUSH operation
One mark for correct definition of POP operation
One mark for correct peek and display operations and correct menu.

19. iii) What do you mean by Domain in terms of DBMS?


One marks for correct meaning.
01
A domain is a pool of values from which the actual values appearing in a
given column are drawn.
iv) What are the main differences between Primary Key and Unique Key? 02

Minimum 02 Differences. One mark for each difference


Primary Key Unique Key
Primary key will not accept NULL values Unique key can accept one NULL values
A table can have only one primary key A table can have multiple unique keys.
20. ½ mark for each correct fill in the blank. 03
import mysql.connector as pymysql
dbcon=pymysql.connect(host=”localhost”, user=”root”, passwd=”sia@1928”)
if dbcon.isconnected()==False
print(“Error in establishing connection:”)
cur=dbcon.cursor()
query=”select * from stmaster”
cur.execute(query)
resultset=cur.fetchmany(3)
for row in resultset:
print(row)
dbcon.close()

SECTION (C)

This section consists of 03 Questions (11 to 13).


Each question carries 4 Marks.

12
11 One mark for each correct query 4
i) To display those company name which are having price less than 30000.

select cm.name from company cm, customer ct where cm.cid=ct.cid and


ct.price <30000;

ii) To display the name of the companies in reverse alphabetical order.

select name from company order by name desc;

iii) To increase the price by 1000 for those customer whose name starts with ‘S’

update customer set price =price+1000 where name like 's%';

iv) To add one more column totalprice with decimal(10,2) to the table customer

alter table customer add column totalprice numeric(10,2);


14. iii) What do you mean network topology? Write two examples also. 02
One mark for correct definition or meaning. And ½ mark for each example.

Or
c) Identify the Protocol, Domain Name and document in the given URL.
Protocol: https
Domain Name: silchar.kvs.ac.in
Document name : index.php
d) What is the use of ping command?
Ping command is used to check the connectivity/availability between two
computers.
iv) What are the differences between Circuit Switching Technique and Packet 02
Switching Technique?
Minimum 02 Differences. One mark for each difference
Primary Key Unique Key
In circuit switching, each data unit know In Packet switching, each data unit just
the entire path address which is provided know the final destination address
by the source intermediate path is decided by the routers.
It is not a store and forward technique. It is a store and forward technique.
Circuit switching is more reliable. Packet switching is less reliable.

Or
Give two advantages and two disadvantages of star topology
One mark for advantages
One mark for disadvantages

Advantages:
Easy to Services
Simple Access Protocols
Centralized Control /problem diagnosis

13
Disadvantages
Long Cable Length
Difficult to expand
Central Node dependency
15. 04

Orbit

Building
Sunrise
Jupiter
Building
Building

Oracle

Building

v) Suggest a cable layout of connections between the buildings.


vi) Orbit Building
vii)
a. Internet Connecting Device/Modem- Orbit Building
b. Switch- Each Building
viii) MAN, it is formed to connect various locations of the city via various
communication media.

14

You might also like