Computer Science CBSE Class 12 Term 2 (II) Solved Model question Paper for 2022 CBSE Board exam. Model paper of CBSE Computer Science (Python) with solution as per latest syllabus.
Computer Science (Python) Model Paper Class 12
Total Marks: 35 MARKS
Time: 2 hrs
N.O of Questions : 13
Q.1. Differentiate between: ( 2 marks )
(i) Linear Queue and Circular Queue
(ii) A queue and Deque.
(i) As the names suggest a linear queue is linear where as a circular queue is circular i.e. the two ends of circular queue meet. Circular queue is used to overcome the problem of unutilized spaces in fixed-size linear queues and doesnot find much application in python as python has dynamic lists.
(ii)In a queue, insertions and deletions can be done only one end where as in a deque these operations can be done from both the ends. Deques can be input restricted i.e. insertion at only one end and deletion at both or they can be output restricted i.e. insertion at both the ends and deletion at only one.
Q.2. How are SQL commands classified ? (2 mark)
1.DDL (Data Definition Language)
2.DML (Data Manipulation Language)
3.DQL (Data Query Language)
4.DCL (Data Control Language)
Q.3.What is a network? What are its goals and applications? (2marks)
Two or more autonomous computing devices conncected to one another in order to exchange information or share resources is called computer network.
Its goals and applications:
Can share software
Q.4.Discuss and compare various types of networks? (2 mark)
Peer to peer network-
Each computer on a peer-peer network is equal. Each computer can play the role of a client and server.
Client- server network-
There is a computer reserved for the server’s job and its only job is to help workstations access data, software and hardware resources.
Q.5.What are hubs ? what are its types? (2 mark)
Hardware device used to connect several computers together.
Types of hub-
a)Active hubs- also connect plus repeat the signal
b)Passive hubs- signal is passed from one computer to another.
Q.6.What are aggregate functions? What is their use? Give some examples.
Answer:The function that work on whole records of one column at a time is called aggregate functions.Or in other word Function that works on aggregate of rows. A multiple row function.
An aggregate Function retrieve a single value after performing calculation on set of values.
SUM (),MIN(),MAX(),COUNT(),AVG() etc.
Q.7.a) What is the use of ORDER BY clause?(1 mark)
Answer: The use of ORDER BY clause is to order the result test set.
b)What is the default sort order of ORDER BY clause?( 1 mark)
Answer: The default sort order of ORDER BY clause is to sort the result set in ascending order.
Q8.Differentiate between DDL and DML commands. ( 3mark )
1 . DDL is Data Definition Language
2 . Used to define data structure
3 . Used to define database structure or schema
4 . It uses commands are: CREATE, ALTER, DROP, TRUNCATE, RENAME
5 . Works on whole table
6 . Not have a where clause to filter
7 . The changes done by DDL commands cannot be rolled back
8 . Example — Drop table student
1 . Data Manipulation Language
2 . Used to manipulate the existing databases.
3 . Used for managing data within schema objects
4 . The commands are: SELECT, INSERT, DELETE, UPDATE, MERGE, CALL
5 . Works on one or more rows
6. Where clause to filter records
7 . The changes can be rolled back
8 . Further classified as procedural and non procedural
9 . Example — Select * from student
Q.9. (3 marks)
(a) What is the use of UPDATE statement in SQL ? How is it different from ALTER statement
(b) Mr. Shankar created a table VEHICLE with 3 rows and 4 columns. He added 1 more row to it deleted one column. What is the Cardinality and Degree of the Table VEHICLE ?
(c) Consider the following table named “GYM” with details about fitness items being sold in the store. Write command of SQL for (i) to (iv).
|G101||power fir exerciser||20000||power gymea|
|G102||Aquafst Hand Grip||1800||Reliable|
|G104||Protoner Extreme GYM||30000||coscore|
|G105||Message Belt||5000||Message expert|
|G106||cross Trainer||13000||GTC fitness|
(a)UPDATE statement in SQL is used to update the data of an existing table in database .
ALTER is a DDL (Data Definition Language) statement. Whereas the UPDATE is a DML (Data Manipulation Language) statement. ALTER is used for the update of the structure of the table (add/remove field/index etc). Whereas UPDATE is used to update data.
number of cardinality = 4
Number of degree = 3
select * from GYM
Where INAME like “A%”
select ICODE , INAME from GYM
Where BRANDNAME in ( “Reliable” , “Coscore” )
Set BRANDNAME = “Fit Trend India ”
Where ICODE = “G101”;
insert into GYM values (“G107”, “Vibro exerciser”, 21000, “GTCFitness”) ;
Q.10.(a) Mr. James created a table CLIENT with 2 rows and 4 columns. He added 2 more rows to it and deleted one column. What is the Cardinality and Degree of the Table CLIENT ? 2 mark
(b) Consider the following table FITNESS with details about fitness products being sold in the store. Write command of SQL for (i) to (iv). (2 marks)
|P6||Belly Vibrator Belt||6500||Ambawya|
(i) To display the names of all the products with price more than 20000.
(ii) To display the names of all products by the manufacturer “Aone”.
(iii) To change the price data of all the products by applying 25% discount reduction.
(iv)To add a new row for product with the details
“P7”, “Vibro Exerciser”, 28000, “Aone”.
Cardinality = 4
Degree = 3
select * from FITNESS
Where price > 20000
select pname from FITNESS
Where manufacturer = “Aone”;
Set price = price * 0.75 ;
insert into FITNESS values (“P7” , “Vibro Exerciser”, 28000, “Aone” ) ;
Q.11. When would you prefer (4 marks)
(i) bridges over hubs
(ii) switch over other network devices?
(i) We would prefer bridges over hubs when we need to connect multiple networks.
(ii) We would prefer switch over others network devices when want to segment networks into different sub-networks to prevent traffic overloading.
Q.12. Write a program that depending upon user’s choice, either pushes or pops an element in a stack. (3 marks)
stack = [ ] while True : com = input("Enter ( Push or Pop ) : ") if com == "push" or com == "Push" : num = int(input("Enter a number : ")) stack.append(num) elif len(stack) == 0 : print("Underflow") elif com == "pop" or com == "Pop" : stack.pop() yes = input ("Enter ( Yes or no ) : ") if yes == "No" or yes == "no": print("Thank you !!!!") break
Q.13. In a Database, there are two tables given below : (4 marks)
|E2||VIJAY SINGH TOMAR||1300000||101|
Write SQL Queries for the following :
(i) = To display employee ids , names of employees, job ids with corresponding job titles.
(ii) = To display names of employees, sales and corresponding job titles who have achieved sales more than 1300000.
(iii) = To display names and corresponding job titles of those employees who have ‘SINGH’ (anywhere) in their names.
(iv) = Identify foreign key in the table EMPLOYEE.
(v) = Write SQL command to change the JOBID to 104 of the EMPLOYEE with ID as E4 in the table ‘EMPLOYEE’ .
(i) SELECT EMPLOYEEID , NAME , EMPLOYEE.JOBID , JOBTITLE FROM EMPLOYEE NATURAL JOIN ON JOB ;
(ii) SELECT NAME , SALES , JOBTITLE FROM EMPLOYEE , JOB WHERE EMPLOYEE.JOBID = JOB.JOBID AND SALES > 1300000 ;
(iii) SELECT NAME , JOBTITLE FROM EMPLOYEE , JOB WHERE EMPLOYEE.JOBID = JOB.JOBID AND NAME LIKE “%SINGH%” ;
(v) UPDATE EMPLOYEE SET JOBID = 104 WHERE EMPLOYEEID = “E4” ;
Thanks for reading Computer Science Model Paper Class 12 (Term 2) with Solution. These are some valuable content below –