Class 12 Computer Science Term 2 Practice Paper

Computer Science Class 12 Term 2 Solved Practice Paper includes new syllabus CBSE (Python) and new pattern (35 marks) for the Board Exam Term 2 . Attempt it now and check where you lags. Stacks : 5 marks, Networking :10 marks and Database and SQL : 20 marks.

Total marks : 35
Time: 2 Hrs
N.O of Questions : 13

Q.1.a) What are input/output restricted queues ? (1mark)
Answer:

Deques can be of two types: input restricted and output restricted. In input restricted deques insertion at only one end and deletion at both the ends are allowed where as in an output restricted and insertion at both the ends and deletion at only one end is allowed.

b) What are enqueue and dequeue operations ? (1 mark)
Answer:

In a queue , a new element can be added only at the end, this insertion of an element in a queue is called “enqueue”. Also data can be only removed from the front end in a queue , tis removal of an element from a queue is technically called “dequeue”. e.g.
l=[4,5,6,7]
enqueue 8 # l= [4,5,6,7,8]
dequeue # l= [5,6,7,8]

Q2. Sarthak, a student of class XII, created a table “Class”. Grade is one of the columns of this table. To find the the details of students whose Grades have not been entered, he wrote the following MySql query, which did not give the desired result:
SELECT * FROM Class WHERE Grade = “Null”;
Help Sarthak to run the query by removing the errors from the query and write the correct query.(2mark)

Answer: SELECT * FROM Class WHERE Grade is Null ;

Q.3. What is the purpose of DROP TABLE command in MySql? (2 mark)

Answer:
Delete removes the rows, the drop is used to remove the tables and DB. delete – removes row from the table – whereas Drop table clause can be used to delete specific rows.

Q.4.Differentiate between: (2 marks)
(i) DROP TABLE, DROP DATABASE
(ii) DROP TABLE, DROP clause of ALTER TABLE.

Answer:
(i)
Drop table . It delete table or relation from the database.
Drop Database . It delete database from MYSQL server.

(ii)
drop table. It delete  table or relation from database
DROP clause of ALTER TABLE. It delete the particular column or filed from table or relation.

Q.5.a)What is the difference between HAVING and WHERE clause?(1 mark)

Answer: The difference between WHERE and HAVING clause is that WHERE condition are applicable on individual rows whereas HAVING conditions are applicable on groups as formed by GROUP BY clause.

b).What is the use of GROUP BY clause?(1 mark)

Answer:The GROUP BY clause combines all those records that have identical values in the particular field or a group of fields.
Or in simple word to the make group.

Q.6. Write the equivalent infix expression for (1 mark)
a)10,3,*,7,1,-,*,23,+
Answer
:
10 * 3 * (7 – 1) + 23
b) Translate the following infix expression into its equivalent postfix expression. A*(B+D)/E-F-(G+H/K) (1 mark)
Answer:
= A*(B+D)/E-F-(G+H/K)
= (A*(B+D)/E) – (F – (G + (H/K)))
= (A*(BD+)/E) – (F – (G + (HK/)))
= ((ABD+*) / E) – (F – (GHK/+))
= ABD+* E/F – GHK/+

Q7a). Which SQL statement allows you to find the highest price from the table BOOK_INFORMATION ?(1 mark)
(a)= SELECT B0OK_ID, BOOK_TITLE, MAX(PRICE) FROM BOOK_INFORMATION ;
(b) =  SELECT MAX(PRICE) FROM BOOK_INFORMATION ;
(c)= SELECT MAXIMUM( PRICE) FROM BOOK_INFORMATION ;
(d) SELECT PRICE FROM BOOK_ INFORMATION ORDER BY PRICE DESC ;

Column Name
BOOK_ID
BOOK_TITLE
PRICE
Table BOOK-INFORMATION

Answer:
(b) =  SELECT MAX(PRICE) FROM BOOK_INFORMATION ;

Q.7(b). Which SQL statement lets you find the sales amount for each store ? (1 mark)
(a) = SELECT STORE_ID, SUM(SALES_AMOUNT) FROM SALES
(b) = SELECT STORE_ID,  SUM (SALES_AMOUNT ) FROM SALES ORDER BY STORE_ID;
(c) = SELECT STORE_ID, SUM(SALES_AMOUNT) FROM SALES GROUP BY STORE_ID;
(d) = SELECT STORE_ID, SUM(SALES_AMOUNT) FROM SALES HAVING UNIQUE STORE_ID ;

Answer:(c) = SELECT STORE_ID, SUM(SALES_AMOUNT) FROM SALES GROUP BY STORE_ID;

Q.8. What is modulation ? What is the need of modulation?(3marks)

Answer: Modulation is a process of changing the characteristic of the wave to be transmitted. Modulation alters the shape of a carrier wave to encode somehow the speech or data information that is to be carried. So signals can be transferred to long distance according to the need various modulation technique exist for long travel to highly encrypted.

Q9. What is foreign key ? How do you define a foreign key in your table?(3 marks)

Answer:
Foreign key acts as the cross-reference between tables because it references the primary key of another table, thereby establishing a link between them.
A FOREIGN KEY is the field (or collection of fields) that in one table that refers to the PRIMARY KEY in another table.

Class 12 Computer Science Term 2 Practice Paper

Q.10.How is FOREIGN KEY commands different from PRIMARY KEY command?(3 marks)

Answer:
1. The Primary key can not accept null values . foreign key can accept multiple null values .
2. While only one primary key in a table while more than one foreign key in a table .
3. The primary key uniquely identify the record in the table while foreign key is a field in the table that is primary key in another table.

Q.11.Data received by a device is as given below. The data has been sent with a checksum. Find out if the received data is correct or not? (3 marks)
1000 0110 0101 1110
1010 1100 0110 0000
0111 0001 0010 1001
1000 0001 1001 0101
1101 1010 0110 0000

Answer:
1000 0110 0101 1110

+ 1010 1100 0110 0000
——————————————-
1 0011 0010 1011 1110
+ 1 (add carry forward 1 to answer)
0010 0101 0111 1111
+ 0111 0001 0010 1001
——————————————–
1010 0011 1110 1000
+ 1 1000 0001 1001 0101
——————————————-
0010 0101 0111 1101
+ 1
+ 1101 1010 0110 0000
—————————————
1111 1111 1101 1110
complement
0000 0000 0010 0001
as complement is not zero so reciever will not accept the data a and discard it.

 Q.12a).How is FOREIGN KEY commands related to the PRIMARY KEY?(2 Marks)

Answer:
The foreign key is a column or a set of columns in one table that references the primary key columns in another table. 

b).Which SQL statement lets you list all stores whose total sales amount is over 5000 ? (2 marks)
(a) = SELECT STORE_ID, SUM(SALES_AMOUNT) FROM SALES GROUP BY STORE_ID HAVING SUM(SALES_AMOUNT) > 5000;
(b) =  SELECT STORE_ID, SUM(SALES_AMOUNT) FROM SALES GROUP BY STORE_ID HAVING SALES_AMOUNT > 5000 ;
(c) = SELECT STORE_ID, SUM(SALES_AMOUNT) FROM SALES WHERE SUM(SALES_AMOUNT) > 5000 GROUP BY STORE_ID
(d) = SELECT STORE_ID, SUM(SALES_AMOUNT) FROM SALES WHERE SALES_AMOUNT > 5000 GROUP BY STORE_ID;
Consider  this table —

Column Name
STORE_ID
SALES_DATE
SALES_AMOUNT
Table SALES

Answer:(a) = SELECT STORE_ID, SUM(SALES_AMOUNT) FROM SALES GROUP BY STORE_ID HAVING SUM(SALES_AMOUNT) > 5000;

Q.13.Discuss following network protocols, briefly (4 Marks)
(i) HTTP
(ii) FTP
(iii) SCP
(iv) SSH
(v) POP
(vi) IMAP
(vii) SMTP
(viii) VoIP

Answer:
(i) HTTP:- HTTP (Hypertext Transfer Protocol) protocol
1. set of requests from browsers to servers
2. set of responses going back to other way.

(ii) FTP:- FTP (File Transfer Protocol) is a standard for exchange of files across Internet.

(iii) SCP:- Secure Copy Protocol or “SCP” helps to transfer computer files securely from a local to a remote host. It is somewhat similar to File Transfer Protocol “FTP”, but it adds security and authentication .

(iv) SSH:- SSH or Secure Shell is a cryptographic network protocol for operating network services securely over an unsecured network.

(v) POP:- POP3, i.e., Post Office Protocol version 3 has become a standard mail protocol. POP3 defines rules about receiving emails from a remote server to a local email client.

(vi) IMAP:-Internet Message Access Protocol (IMAP) is another mail protocol used in conjunction with POP3 protocol for accessing emails on a remote web server and downloads them to local client.

(vii) SMTP:- SMTP (Simple Mail Transfer Protocol) is used for sending emails across Internet.

(viii) VoIP:- VolP (Voice over Internet Protocol) is a technology enables voice communications over Internet through compression of voice into data packets that can be efficiently transmitted over data networks and then converted back into voice at other end.

Thanks for reading Class 12 Computer Science Term 2 Practice Paper. Below is some valuable content –

Python Programs for CBSE Practical File Class 11 and 12

Computer Science with Python Class 12 Sumita Arora Solutions

Solved sample papers computer science term 2 2021-2022

Leave a Comment

Your email address will not be published. Required fields are marked *