Class 12 Term 2 Sample Paper Computer Science Set 4
Subject: Computer Science
Subject Code: 083
Class : 12
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
1. Give any two applications of stack
2 (i) Expand the following: POP3, HTTPS
(ii) Identify the Guided and Un-Guided Transmission Media out of the following: Satellite, Twisted Pair Cable, Optical Fiber, Infra-Red waves
3. Differentiate between WHERE and HAVING clause
4. Consider the given code:
import mysql.connector mydb=mysql.connector.connect (host=”localhost”, user=”root”, passwd=”kv”, database=”db”)
mycursor=mydb.cursor()
adm=1000
name=”Sonia”
mark=60
mycursor.execute(“INSERT INTO BOOKS (adm_no,name,mark) VALUES ({},'{}’,{})” .format(adm,name,mark))
mydb.commit()
a) Which record will get inserted in the table by the above code?
b) What is the role of using commit() here?
5. Write the output of the queries (a) to (d) based on the table,EMPLOYEE given below.
EMPID | NAME | CITY | PAY_LEVEL | SALARY |
E01 | AISHWARYA | MUMBAI | L9 | 200000 |
E02 | RITHUNAV | DELHI | L9 | 300000 |
E03 | SHARUKH | BHOPAL | L1 | 50000 |
E04 | MUMTAZ | DELHI | L1 | 30000 |
E05 | JESS JOHN | MAHARASHTRA | L2 | 55000 |
a) SELECT SUM(SALARY) FROM EMPLOYEE WHERE CITY LIKE “M%”;
b) SELECT PAY_LEVEL FROM EMPLOYEE GROUP BY PAY_LEVEL HAVING COUNT(*)>1;
c) SELECT * FROM EMPLOYEE ORDER BY NAME DESC
d) SELECT NAME FROM EMPLOYEE WHERE SALARY<>54000
6. (a) Which command is used to view the list of databases in the system
(b) What is the difference between COUNT(*) and COUNT(<columnname>)
7. A department is considering to maintain their worker data using SQL to store the data. As a database administrator, Kiran has decided that :
Name of the database – Department
Name of the table – WORKER
The attributes of WORKER are as follows:
WORKER_ID – character of size 3
NAME – character of size 10
SALARY – numeric
JOINING_DATE – Date
DEPARTMENT – character of size 10
WORKER_ID | NAME | SALARY | JOINING_DATE | DEPARTMENT |
100 | SAURAV | 100000 | 2014-02-20 | ADMIN |
101 | MONIKA | 200000 | 2014-02-21 | HR |
102 | KARAN | 30000 | 2012-22-20 | ACCOUNTS |
103 | MITHUN | 200000 | 2000-04-25 | ACCOUNTS |
104 | NAYANA | 500000 | 2010-08-29 | ADMIN |
105 | RIYAS | 300000 | 2011-02-12 | ADMIN |
a) Write a query to create the given table WORKER.
b) Identify the attribute best suitable to be declared as a primary key
OR
Consider the table DEPT given below:
DEPTID | HOD |
D01 | RAJU |
D02 | MANJU |
D03 | YADHU |
a) What will be the degree and cardinality of cartesian product of the tables Worker and Dept
b)Name the constraint to be used while creating the table DEPT to ensure the column DEPTID is not null.
SECTION – B
Each question carries 3 marks
8. Amar has a list containing details, which include RNO,NAME and AGE , of 5 students. Write a program with separate user defined functions to perform the following operations
# Push RNO of students into a stack, where the corresponding age is less than 18
# Pop and display the content of the stack.
Or
Hari has a list containing 6 elements. You need to help him to write a function in Python PUSH(Arr),where Arr is a list of numbers, to push all odd numbers from Arr into a stack implemented by using a list. Display the stack if it has at least one element, otherwise display “stack empty” message.
>>> Arr=[10,61,88,101,26,28]
>>> PUSH(Arr)
The item 10 can’t be inserted because it is not an odd number
The item 88 can’t be inserted because it is not an odd number
The item 26 can’t be inserted because it is not an odd number
The item 28 can’t be inserted because it is not an odd number
Stack elements after push operation : [101, 61]
9 (i) Identify the error in the following SQL query which is expected to delete all rows of a table TEMP without deleting its structure and write the correct one:
DELETE TABLE TEMP;
(ii) Differentiate Primary Key and Foreign Key with an example
10. Pratap has created a table STOCK . Now, he came to know that one more column,STACKDATE is needed in the table and also wanted to modify the size of ITEM_NAME to 100.The table STOCK has the following structure:
Table:STOCK
ITEM_ID | ITEM_NAME | QTY | UNIT_PRICE |
I001 | Drawing Copy | 3 | 20 |
I002 | Sharpener Camlin | 10 | 5 |
I003 | Eraser Natraj | 10 | 4 |
Help him to complete the tasks by suggesting appropriate SQL commands.
SECTION – C
Each question carries 4 marks
11. Write Queries a) to d) based on the tables STUDENT and LIBRARY given below:
Table:STUDENT
ADM_NO | CLASS | RNO | NAME | AGE | CITY | FEE |
100 | X | 1 | SAMEER | 34 | DELHI | 45000 |
101 | XII | 10 | ARYAN | 35 | MUMBAI | 54000 |
102 | XI | 2 | RAM | 34 | CHENNAI | 45000 |
103 | XI | 4 | PREMLATA | 36 | BHOPAL | 60000 |
104 | XII | 2 | SHIKHA | 36 | INDORE | 34000 |
105 | X | 2 | RADHA | 33 | DELHI | 23000 |
Table:LIBRARY
LIB_ID | CLASS | RNO | BOOK_ISSUE |
1000 | XII | 10 | PYTHON PROGRAMMING |
1001 | XII | 2 | C++ PROGRAMMING |
1002 | X | 1 | ESSENTIALS OF AI |
1003 | X | 2 | Basics of HTML |
1004 | XI | 2 | Fun With C |
1005 | XI | 4 | JAVA Programming |
a) To display the details of students from Delhi who pay fees more than 30000
b) To display all the students whose name, begin with ‘S’
c) To display total fee paid class-wise.
d) To display admission number, student name and name of the book issued.
12 (i) Differentiate between Bus Topology and Star Topology of Network
Or
Give the differences between HTML and XML.
(ii) How is switch different from hub? Which is more preferable in a large network of computers and why?
13. “Mumbai Corps” is planning to expand their network in India, starting with two cities in India to provide infrastructure for distribution of their product. The company has planned to set up their main office units in Mumbai at three locations and have named their offices as “Production Unit”, “Finance Unit” and “Training Unit”. The company has its corporate unit in New Delhi. A rough layout of the same is as follows:
Approximate distances between these Units is as follows
Production to Finance Unit : 70 Mtr
Production to Training Unit : 15 KM
Production to Corporate Unit : 2112 KM
Finance to Training Unit : 15 KM
In continuation of the above, the company experts have planned to install the following number of computers in each of their office units:
Number Of Computers
Production Unit : 150
Finance Unit : 35
Training Unit : 10
Corporate Unit : 30
a) Suggest the kind of network required (out of LAN, MAN, WAN) for connecting each of the following office units:
i) Production Unit and Training Unit
ii) Production Unit and Finance Unit
b) Which of the following communication media, will you suggest to be procured by the company for connecting their local offices in Mumbai for very effective communication? Ethernet Cable, Optical Fiber, Telephone Cable.
c) Which of the following devices will you suggest for connecting all the computers within each of their office units?
i)Switch/Hub
ii)Modem
iii)Telephone
d) Suggest the most suitable place to house the server for the organization with suitable reason.