Students can access the CBSE Sample Papers for Class 12 Computer Science with Solutions and marking scheme Term 2 Set 4 will help students in understanding the difficulty level of the exam.
CBSE Sample Papers for Class 12 Computer Science Term 2 Set 4 with Solutions
Time: 2 Hours
Maximum 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
(2 Marks Each)
Question 1.
Evaluate the following expressions:
(a) 6*3 + 4**2//5-8
Answer:
13
(b) 10 > 5 and 7 > 12 or not 18 > 3
Answer:
False
Question 2.
(i) Expand the following terms:
(a) PPP
Answer:
PPP : Point to Point Protocol
(b) FTP
Answer:
FTP : File Transfer Protocol
(ii) Name the transmission media best suitable for connecting to hilly areas.
Answer:
Microwave / Radio wave
Question 3.
What do you understand by Candidate Keys in a table? Give a suitable example of Candidate Keys from a table containing some meaningful data.
Answer:
A table may have more than one such attribute/group of attributes that identifies a tuple uniquely, all such attribute(s) are known as Candidate Keys.
Table: ITEM
Item_No | Item | Qty |
101 | Pen | 500 |
102 | Pencil | 700 |
104 | CD | 500 |
109 | DVD | 700 |
105 | Eraser | 300 |
103 | Duster | 200 |
In the above table Item, Item No can be candidates keys.
Question 4.
Differentiate between fetchone() and fetchall() methods with suitable example for each.
Answer:
- fetchall() fetches all the rows of a query result.
- An empty list is returned if there is no record to fetch the cursor. fetchone() method returns one row or a single record at a time. It will return None if no more rows/records are available.
Question 5.
Write the output of the queries (a) to (d) based on the table Student given below:
Table: STUDENT
Roll_No | Name | Class | DOB | Gender | City | Marks |
1 | Nanda | X | 06-06-1995 | M | Agra | 551 |
2 | Saurabh | XII | 07-05-1993 | M | Mumbai | 462 |
3 | Sonal | XI | 06-05-1994 | F | Delhi | 400 |
4 | Trisla | XII | 08-08-1995 | F | Mumbai | 450 |
5 | Store | XII | 08-10-1995 | M | Delhi | 369 |
6 | Marisla | XI | 12-12-1994 | F | Dubai | 250 |
7 | Neha | X | 08-12-1995 | F | Moscow | 377 |
8 | Nishant | X | 12-06-1995 | M | Moscow | 489 |
(a) SELECT COUNT(*), City FROM STUDENT GROUP BY CITY HAVING COUNT(*)>1;
Answer:
COUNT(*) | City |
2 | Mumbai |
2 | Delhi |
2 | Moscow |
(b) SELECT MAX(DOB),MIN(DOB) FROM STUDENT;
Answer:
- MAX(DOB)
- 08-12-1995
- MIN(DOB)
- 07-05-1993
(c) SELECT NAME,GENDER FROM STUDENT WHERE CITY=”Delhi”;
Answer:
NAME | GENDER |
Sonal | F |
store | M |
(d) SELECT NAME, MARKS FROM STUDENT WHERE CITY IN (“MUMBAI”, “DELHI”)
Answer:
NAME | MARKS |
Sarubh | 462 |
Sonal | 400 |
Trisha | 350 |
Store | 469 |
Question 6.
(a) In SQL, name the clause that is used to display the tuples in ascending order of an attribute.
Answer:
ORDER BY Clause
(b) In SQL, what is the use of IS NULL operator?
Answer:
To check if the column has null value / no value.
Question 7.
Observe the following table Pro_Info carefully:
Table: Pro_Info
ID | Product | Qty | Price | Transaction_Date |
101 | Plastic Floder 12″ | 100 | 3400 | 2014-12-14 |
104 | Pen stand standard | 200 | 4500 | 2015-01-31 |
105 | Stapler Medium | 250 | 1200 | 2015-02-28 |
109 | Punching Machine Big | 200 | 1400 | 2015-03-12 |
103 | Stapler Mini | 100 | 1500 | 2015-02-02 |
(a) Write the names of the most appropriate columns, which can be considered as candidate keys.
Answer:
Candidate keys : Id, Product
(b) Write the names of the most appropriate columns, which can be considered as primary key. Justify your answer.
Answer:
Primary key : Id, because it will uniquely identify each record in the table.
OR
(a) Identify the degree and cardinality of the table Pro_info.
Answer:
Degree: 5, Cardinality: 5
(b) Consider the table TRANSPORT given below:
TRANSPORT
T_Code | ID | TType |
T101 | 101 | Bus |
T102 | 104 | Volvo |
T103 | 105 | Auto |
T104 | 109 | Train |
T105 | 101 | Truck |
T106 | 103 | Car |
Which field will be consider as the foreign key if the tables Pro_Info and TRANSPORT are related in a database?
Answer:
Id
Sect ion – B
(3 Marks Each)
Question 8.
Write a function DeleteCustomer() to delete a Customer information from a list of CStack. The function delete the name of customer from the stack.
Or
Write a function to perform push and pop operations on a Stack containing Student details as given in the following
RNo integer
Name String
Age integer
Answer:
CStack = []
def DeleteCustomer(): if (CStack == [ ]) :
print(“There is no Customer!”) else:
print(“Record deleted:”,CStack.pop()) 3
OR
defstkPUSH(stk,item): stk.append(item) top=len(stk)-1 defstkPOP(stk): ifstk!=[]:
returnstk.pop()
else:
return None
Question 9.
(a) A table, “Customers” has been created in a database with the following fields:
CustomerlD, CustomerName, ContactName, Address City, PostalCode, Country Give the SQL command to updates the first customer (CustomerlD = 1) with a new contact person “Rachit” and a new city “Mumbai”.
Answer:
UPDATE Customers
SET ContactName = ‘Rachit’, City= ‘Mumbai’
WHERE CustomerlD = 1;
(b) What is the use of wildcard ? Give an example
Answer:
The wildcard operators are used with the LIKE operator to search a value similar to a specific pattern in a column. There are 2 wildcard operators.
% (Percent) – represents 0,1 or many characters
_ (Underscore) = represents a single number or character For example: Select * from Customer where name like ‘S%’;
This command will show all those records from table named Customer where name field contains values starting with S for e.g. Sri, Siya, Shyam, Suman, etc.
Question 10.
Sonakshi has to create a database named Publishers in MYSQL.
She now needs to create a table named Book in the database to store the records of various Books.
The table Book has the following structure:
Field Name | Data type | Remarks |
BookCode | Char(3) | primary key |
Book_Name | Char(30) | |
Pages | Integer | |
Price | Integer | |
Authbr_Name | Char(30) |
Help her to complete the task by suggesting appropriate SQL commands.
Answer:
CREATE DATABASE Publishers;
CREATE TABLE Book (
Book_Code CHAR(5)PRIMARY KEY
f
Book_Name CHAR(30),
Pages INT,
Price INT,
Author_Name CHAR(30)
);
Section – C
(5 Marks Each)
Question 11.
Write queries (a) to (d) based on the tables TRAINER and COURSE given below:
TRAINER
TID | TNAME | CITY | HIREDATE | SALARY |
101 | Sunaina | Mumbai | 1998-10-15 | 90,000 |
102 | Anamika | Delhi | 1994-12-24 | 80,000 |
103 | Deepti | Chandigarh | 2001-12-21 | 82,000 |
104 | Meenakshi | Delhi | 2002-12-25 | 78,000 |
105 | Richa | Mumbai | 1996-01-12 | 95,000 |
106 | Maniprabha | Chennai | 2001-12-12 | 69,000 |
COURSE
CID | CNAME | FEES | STARTDATE | TID |
c201 | AGDCA | 12,000 | 2018-07-02 | 101 |
c202 | ADCA | 15,000 | 2018-07-15 | 103 |
c203 | DCA | 10,000 | 2018-10-01 | 102 |
c204 | DDTP | 9,000 | 2018-09-15 | 104 |
c205 | DHN | 20,000 | 2018-08-01 | 101 |
c206 | O LEVEL | 18,000 | 2018-07-25 | 105 |
(a) Display the Trainer Name, City & Salary in descending order of their Hiredate.
Answer:
SELECT TNAME, CITY, SALARY FROM TRAINER ORDER BY HIREDATE DESC;
(b) To display the TNAME and CITY of Trainer who joined the Institute in the month of December 2001.
Answer:
SELECT TNAME, CITY FROM TRAINER WHERE HIREDATE BETWEEN ‘2001-12- 01’ AND ‘2001-12-31’;
(c) To display the average salary of all trainer, city wise.
Answer:
SELECT AVG(SALARY) FROM TRAINER GROUP BY CITY;
(d) To display TNAME, HIREDATE, CNAME, STARTDATE from tables TRAINER and COURSE of all those courses whose FEES is less than or equal to 10000.
Answer:
SELECT TNAME,HIREDATE,CNAME, STARTDATE FROM TRAINER, COURSE WHERE
TRAINER.TID=COURSE.TID AND FEES<= 10000;
Question 12.
(a) Write two characteristics of Wi-Fi.
OR
Define the following:
HTML, XML
Answer:
- It is wireless network.
- It is used for short range.
OR
HTML (Hyper Text Markup Language): It is a markup language that describes the structure and behavior of a web page. This language is used to create web pages.
XML (Extensible Markup Language): It is a meta language that provides a framework to define the markup language.
(b) Explain the purpose of a router
Answer:
A router establishes connection between two networks and it can handle network with different protocols. Using a routing table, routers make sure that the data packets are travelling through the best possible paths to reach their destination.
Question 13.
Delhi University of India is starting its first campus Nagarjun Nagar of South India with its centre admission office in Mumbai. The university has three major branch comprising of Administrative Branch, Theory Branch and Practical Branch in the 5 km area campus.
As a network expert, you need to suggest the network plan as per (a) to (d) to the authorities keeping in mind the distance and other given parameters.
Expected wire distances between various locations:
Administrative Branch to Theory Branch | 90 m |
Administrative Branch to Practical Branch | 80 m |
Theory Branch to Practical Branch | 15 m |
Admission Office Mumbai to Nagarjun Campus | 1600 km |
Expected number of computers to installed at various locations in the university are as follows:
Administrative Branch | 15 |
Theory Branch | 40 |
Practical Branch | 150 |
Admission Office Mumbai | 10 |
(a) Suggest the authorities, the cable layout amongst various branches inside university campus for connecting the branches.
Answer:
The suggested cable layout amongst various blocks inside university campus for connecting the
blocks will be as follow:
(b) Suggest the most suitable place (i.e. branch) to house the server of this university with a suitable reason.
Answer:
Practical Branch, because in this branch there are maximum number of computer and according to 80 – 20 rule of 80% traffic should be local.
(c) Suggest an efficient device from the following to be installed in each of the branch to connect all the computers.
(i) Switch
(ii) Modem
(iii) Gateway
Answer:
Switch
(d) Suggest the most suitable (very high speed) service to provide data connectivity between Admission Office located in Mumbai and Nagarjun Nagar campus from the following options:
(i) Telephone lines
(ii) Fixed line dial-up connection
(iii) Co-axial cable network
(iv) GSM
(v) Leased lines
(vi) Satellite connection
Answer:
Satellite connection