Unseen Passage

For Class 4 to Class 12

Class 12 Computer Science Sample Paper

Please refer to Class 12 Computer Science Sample Paper with solutions provided below. All class 12 Computer Science sample papers have been provided below based on the latest CBSE pattern and examination guidelines issued for the current academic year. Students must practice a lot of CBSE Sample Papers for Class 12 Computer Science as it will help them to clear all doubts. Practicing more guess papers for Standard 12 Computer Science will help them to get more marks.

CBSE Sample Paper for Class 12 Computer Science

Sample Paper for Class 12 Computer Science
Class 12 Computer Science Sample Paper Set A
Sample Paper for Class 12 Computer Science Term 1
Class 12 Computer Science Sample Paper Term 1 Set A
Class 12 Computer Science Sample Paper Term 1 Set B
Sample Paper for Class 12 Computer Science Term 2
Class 12 Computer Science Sample Paper Term 2 Set A
Class 12 Computer Science Sample Paper Term 2 Set B

Class 12 Computer Science Sample Paper Term 2 Set A

Section – A

1. Explain any one example of stack.
Answer: A pile of plates in a cafeteria can be a good example of a stack. The plates get added to the stack as they get cleaned and also whenever a plate is required it is taken from the top of the stack. The first plate placed on the stack is the last one to be used.

2. (a) Expand the following:
HTTP, IRC
(b) Neha wants to transfer data within a city at very high speed. Write the wired transmission medium and type of network.
Answer: (a) HTTP : Hypertext Transfer Protocol.
IRC : Internet Relay Chat.
(b) Wired Transmission medium: Optical fibre cable
Type of Network : MAN

3. What keys are used in DBMS?
Answer: The key is defined as the column or attribute or a combination of attributes that is used to identify records of the database table. Sometimes we might have to retrieve data from more than one table, in that case we require to join tables with the help of keys. It also controls and maintains the integrity of information stored in the database.

4. What is a database connection? How is a database connection established?
Answer: A database connection is a mean to communicate form of the script to a database program. Each database module needs to provide a connect function that returns a connection object. The parameters that are passed to connect vary by the module and what is required to communicate with the database.

5. Write the output of the queries (a) to (b) based on the table, Teacher given below:

Class 12 Computer Science Sample Paper Term 2 Set A

(a) SELECT Name FROM Teacher WHERE Salary>25000;
(b) SELECT Name, Department FROM Teacher WHERE Department LIKE ‘%Sc’;
(c) SELECT T_ID, Department FROM Teacher WHERE Gender = ‘F’;
(d) SELECT DISTINCT Department FROM Teacher;
Answer: (a) Name
Sandeep
Sangeeta
Shyam
(b) Name Department
Jugal Computer Sc
Shiv Om Computer Sc
(c) T_ID Department
2 History
4 History
8 Mathematics
(d) DISTINCT Department
Computer Sc
History
Mathematics

6. (a) Which declaration doesn’t use the same number of bytes and consumption of bytes depend on the input data?
(b) Write any two aggregate function used in SQL.
Answer: (a) Varchar
(b) MIN(), MAX()

7. Consider the table, STUDENT given below:

Class 12 Computer Science Sample Paper Term 2 Set A

(a) Which field should be made the primary key? Justify your answer.
(b) Identify the degree and cardinality of given table.
Answer: (a) RollNo should be made the primary key as it uniquely identifies each record of the table.
(b) Degree : 5
Cardinality : 4

OR

(a) Identify the candidate key(s) of table STUDENT.
(b) Identify the alternate key of table STUDENT
Answer: (a) RollNo, AdmnNo
(b) AdmnNo

8. Write an algorithm to evaluate postfix expression.
Answer: Step 1: Start
Step 2: Check all symbols from left to right and repeat steps 3 & 4 for each symbol of expression until
all symbols are over.
Step 3: If the symbol is an operand, push it onto stack.
Step 4: If the symbol is an operator then:
(a) Pop the top two operands (op1, op2) from stack and apply the operator in between them like (op2
operator op1).
(b) Evaluate the expression and place the result back on the stack.
Step 5: Set result equal to top element on the stack.
Step 6: Stop

OR

Riya has a list containing 8 integers. 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 odd numbers into a stack.
♦ Pop and display the content of the stack.
For Example:
If the sample Content of the list is as follows:
List1 = [26,45,89,32,44,61,41,99]
Sample Output of the code should be:
99 41 61 89 45
Answer: List1 = [26,45,89,32,44,61,41,99]
def PUSH(S, List1):
S.append(List1)
def POP(S):
if S!=[]:
return S.pop()
else:
return None
Stack1=[]
for k in List1:
if k%2 != 0:
PUSH(Stack1,k)
while True:
if Stack1!=[]:
print(POP(Stack1),end=” “)
else:
break

9. (a) What is the default format for “Datetime” &“Timestamp” data type?
(b) Define Equi join.
Answer: (a) YYYY-MM-DD hh:mm:ss
(b) Equi join is a simple SQL join condition that uses equal sign as a comparison operator.
Syntax
SELECT column1, column2, column3
FROM Table1, Table2
WHERE Table1. column1 = Table2. column1;

10. Consider the following table, Emp given below:

Class 12 Computer Science Sample Paper Term 2 Set A

Write Python code to insert 2 records with suitable data in the above table taking system date as Hiredate.
Answer: import MySQLdb
db =MySQLdb.connect(‘localhost’,’HRMAN’,
‘Admin@pwd’,’cosmetics’)
cursor=db.cursor(prepared = TRUE)
sql=”””Insert into table(‘EmpNo’,’EmpName’,
‘job’, ‘Mgr’, ‘Hiredate’, ‘Sal’, “deptNo.”)
VALUES(‘%S’, ‘%S’, ‘%S’, ‘%S’, V‘%F’, ‘%S’)
current_date = datetime.now()‘%S’,
Form_date = current_date.strftime(‘%d-%m-%y’)
insert_value = [(‘7369’, ‘Smith’, ‘Clerk’, ‘7839’,
current_date,800, NULL),
(‘7788’, ‘Scott’, ‘Analyst’, ‘7566’, current_date, 3000, 15)]
try:
cursor.executemany(sql, insert_value)
print(cursor.rowcount, “Records inserted”)
db.commit()
except:
db.rolback()
cursor.close()
db.close()

Section – C

11. Write SQL queries for (a) to (d) on the basis of table, ITEMS and TRADERS given below:

Class 12 Computer Science Sample Paper Term 2 Set A
Class 12 Computer Science Sample Paper Term 2 Set A

(a) To display the details of all the items in ascending order of item names (i.e., INAME).
(b) To display item name and price of all those items,whose price is in the range of 10000 and 22000 (both values inclusive).
(c) To display the number of items, which are traded by each trader. The expected output of this query should be:
T01 2 T02 2 T03 1
(d) To display item names and traders name from both tables who are in Delhi.
Answer: (a) SELECT* FROM ITEMS ORDER BY INAME ASC;
(b) SELECT INAME, PRICE FROM ITEMS WHERE PRICE > = 10000 AND PRICE <= 22000;
(c) SELECT TCODE, COUNT (CODE) FROM ITEMS GROUP BY TCODE;
(d) SELECT INAME, TNAME FROM ITEMS I, TRADERS T WHERE I.TCODE=T.TCODE AND
CITY = “DELHI”;

12. (a) Name the protocol:
(i) Used to transfer voice using packet switched network.
(ii) Used for chatting between two groups or between two individuals.
Answer: (a) (i) VoIP [Voice over Internet Protocol]
(ii) IRC [Internet Relay chat]

OR

What is web hosting?
(a) What is ARPANET?
Answer: Web hosting is the service that makes our website available to be viewed by others on the Internet. A web host provides space on its server, so that other computers around the world can access our website by means of a network or modem.
(b) ARPANET was the network that became the basis for the Internet. Based on a concept first published in 1967, ARPANET was developed under the direction of the U.S. Advanced Research Projects Agency (ARPA). In 1969, the idea became a modest reality with the interconnection of four university computers.
The initial purpose was to communicate with and share computer resources among mainly scientific users at the connected institutions.

13. Uplifting Skills Hub India is a knowledge and skill community which has an aim to uplift the standard of knowledge and skills in the society. It is planning to setup its training centers in multiple towns and villages pan India with its head offices in the nearest cities. They have created a model of their network with a city, a town and 3 villages as follows:
As a network consultant, you have to suggest the best network related solutions for their issues/problems raised in (a) to (b) keeping in mind the distance between various locations and given parameters.

Class 12 Computer Science Sample Paper Term 2 Set A

Shortest distance between various location:

Class 12 Computer Science Sample Paper Term 2 Set A

Number of Computers installed at various locations are as follows:

Class 12 Computer Science Sample Paper Term 2 Set A

Answer: (a) B_TOWN can house the server as it has the maximum no. of computers.
(b) Optical fibre cable is the best for this star topology

Class 12 Computer Science Sample Paper Term 2 Set A

(c) Switch
(d) VoIP

Related Posts

error: Content is protected !!