# CBSE Class 12 Informatics Practices Sample Paper

We have provided CBSE Class 12 Informatics Practices Sample Paper with solutions below. These Sample guess papers have been prepared as per the latest examination guidelines and paper pattern issued by CBSE. Students of Class 12 should practice all practice papers for Class 12 Informatics Practices given below as it will help them top improve their understanding of the subject. Please click on the links below to access free sample paper for Informatics Practices Class 12.

## CBSE Class 12 Informatics Practices Term 2 Sample Paper Set A

1. Read the following passage and answer the questions that follows Consider the table TRAVEL as given below:

Basis the above table information, answer the following questions.

(i) Write query to give the output as:

(a) SELECT * FROM Travel WHERE Km>200;
(b) SELECT * FROM Travel WHERE Km>=200;
(c) SELECT No, Name, Tdate, Km FROM Travel WHERE Km>=200;
(d) SELECT No, Name, Tdate, Km FROM Travel WHERE Km BETWEEN 200 AND 350;

C

(ii) Write query to display maximum Km from Travel table.
(a) SELECT MAX (Km) FROM Travel;
(b) SELECT MAXIMUM(Km) FROM Travel;
(c) SELCT HIGHEST (Km) FROM Travel;
(d) None of the above

A

(iii) Akhil has given the following command to arrange the data in ascending order of date. SELECT * FROM Travel WHERE ORDER BY Tdate; But he is not getting the desired result. Help him by choosing the correct command.
(a) SELECT * FROM Travel ORDER BY Tdate;
(b) SELECT * FROM Travel IN ASC;
(c) SELECT Tdate FROM Travel ORDER BY Tdate;
(d) None of the above

A

(iv) Choose the correct query to count the number of codes in each code type from Travel table?
(I) SELECT COUNT(Code) FROM Travel ;
(II) SELECT Code,COUNT(Code) FROM Travel GROUP BY Code;
(III) SELECT code,COUNT( DISTINCT Code) FROM Travel;
(IV) SELECT Code, COUNT( DISTINCT Code) FROM Travel GROUP BY Code;
Choose the correct option.
(a) Both (II) and (III)
(b) Both (II) and (IV)
(c) Both (I) and (III)
(d) Only (II)

D

(v) Choose the correct command to display the name of the traveller whose travel date is in year 2016.
(a) SELECT Name, Tdate FROM Travel WHERE YEAR(Tdate)=2016 ;
(b) SELECT Name, Tdate FROM Travel WHERE Tdate=2016;
(c) SELECT Name, Tdate FROM Travel WHERE YEAR(Tdate)= =2016;
(d) SELECT Name, MAX(Tdate) FROM Travel ;

A

2. What is the use of GROUP BY clause? Give an example.
Ans.
The GROUP BY clause is used to group records of a table on the basis of a common value of a column and get a summarised result for the group as per a defined function, e.g. if in a class students belong to different school houses ,then we can count the number of students in each house using a GROUP BY command such as:
SELECT COUNT(HOUSE)FROM STUDENT GROUP BY HOUSE;

Or

What do you understand by degree and cardinality of a table? Give an example.
Ans. Degree Number of columns/attributes/fields in a table are called table’s degree.
Cardinality Number of rows/tuples/records in a table are called table’s cardinality.
For example,

Degree is 4 because it has 4 columns and cardinality is 3 because it has 3 rows.

3. Given below a table Bookhouse, write SQL query for part (i) to (v).

(i) Display publisher wise total stock value (Qty * Price).
(ii) Display title of the book which is costliest.
(iii) Display number of books and total price for each type of publisher.
(iv) Display all the books where subject starts with “D” and qty is less than 3.
(v) Display all information of books whose price starts with 2.
Ans. (i) SELECT Publisher, Qty*Price AS Total_Stock_Value FROM Bookhouse GROUP BY Publisher;
(ii) SELECT Title FROM Bookhouse WHERE Price=MAX(Price);
(iii) SELECT COUNT(*), SUM(Price) FROM Bookhouse GROUP BY Publisher;
(iv) SELECT Title FROM Bookhouse WHERE Subject LIKE ‘D%’ AND Qty<3;
(v) SELECT * FROM Bookhouse WHERE Price LIKE ‘2%’;

Or

Describe different kinds of SQL command with proper examples.
Ans. SQL commands are instructions. It is used to communicate with the database. It is also used to perform specific tasks, functions and queries of data. SQL can perform various tasks like create a table, add data to tables, drop the table, modify the table, set permission for users. Types of SQL commands are as follows
(i) Data Definition Language (DDL) DDL changes the structure of the table like creating a table, deleting a table, altering a table, etc. All the command of DDL are auto-committed that means it permanently save all the changes in the database.
Here are some commands that come under DDL:
CREATE
ALTER
DROP
TRUNCATE
(ii) DataManipulation Language (DML) DML commands are used to modify the database. It is responsible for all form of changes in the database. The command of DML is not auto-committed that means it cannot permanently save all the changes in the database. They can be rollback.
Here are some commands that come under DML:
INSERT
UPDATE
DELETE
(iii) Data Control Language (DCL) DCL commands are used to grant and take back authority from any database user.
Here are some commands that come under DCL:
GRANT
REVOKE

4.

Write SQL queries for the following questions.
(i) Display Eno, Ename and Job in descending order of Eno.
(ii) Find the maximum salary of department 10.
(iii) Count the total employees working in each department.
Ans. (i) SELECT Eno, Ename, Job FROM Employee ORDER BY Eno DESC;
(ii) SELECT MAX(Salary) FROM Employee WHERE Dept=10;
(iii) SELECT COUNT(*), Dept FROM Employee GROUP BY Dept;

5. Answer the following:
(i)Write SQL command used to display the structure of a table.
(ii)Mr. lames 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?
(iii) In MySQL, Reena and Zebi are getting the following output of SELECT statement on a table Employee.

Which keyword has Zebi used with a SELECT statement to get the above output?
Ans. (i) The command to display the structure of a table is as follows:
DESCRIBE table_name;
or DESC table_name;
(ii) Cardinality = 4
Degree = 3
where, cardinality are the number of rows and degree is number of columns in a table.
(iii) Zebi has used DISTINCT clause with the SELECT command.

6. What will be the output of the following command?
(i) SELECT POWER(10,2)
(ii) SELECT ROUND(14.4743, 1)
Ans. (i) 100
(ii) 14.5

Or

Consider the decimal number x with value 8459.2654. Write commands in SQL.
(i) To round it off to a whole number.
(ii) To round it to 2 places before the decimal.
Ans. (i) SELECT ROUND(8459.2654);
(ii) SELECT ROUND(8459.2654,−2);

7. What do you mean by network topology? Write different types of topology.
Ans. A network topology is the arrangement with which computer systems or network devices are connected to each other. Topologies may define both physical and logical aspect of the network. Both logical and physical topologies could be same or different in a same network.
There are different types of topology, which are as Bus Topology In case of bus topology, all devices share single communication line or cable. Bus topology may have problem while
multiple hosts sending data at the same time. It is one of the simple forms of networking where a failure of a device does not affect the other devices. But failure of the shared communication line can make all other devices stop functioning.
Star Topology All hosts in star topology are connected to a central device, known as hub device, using a point-to-point connection. i.e. there exists a point-to-point connection between hosts and hub.
As in bus topology, hub acts as single point of failure. If hub fails, connectivity of all hosts to all other hosts fails. Every communication between hosts, takes place through only the hub. Star topology is not expensive as to connect one more host, only one cable is required and configuration is simple. Tree Topology
This topology divides the network into multiple levels/layers of network. Mainly in LANs, a network is bifurcated into three types of network devices. The lowermost is access-layer where computers are attached. The middle layer is known as distribution layer, which works as mediator between upper layer and lower layer.
The highest layer is known as core layer and is central point of the network. i.e. root of the tree from which all nodes fork. All neighboring hosts have point-to-point connection between them.Similar to the bus topology, if the root goes down, then the entire network suffers even.though it is not the single point of failure. Every connection serves as point of failure, failing of which divides the network into unreachable segment.

Or

Write one advantage each of star and bus topology used in networking. Draw a network layout of bus topology to connect six computers.
Ans. Advantage of star topology is that it is most reliable as there is a direct connection of every node with the central node or server.
Advantage of bus topology is that all nodes are connected through a single length of a cable, so very short cable length is used.
A network layout of bus topology to connect six computers is as follows:

8. JNV School at Hyderabad have their offices according to the following diagram. Go through the details and answer the questions that follows.

(i) Name the most suitable wing where the server should be installed. Justify your answer.
(ii) Draw the cable layout to efficiently connect various wings JNV, Hyderabad and also write the topology.
(iii) Suggest a device/software and its placement that would provide data security for the entire network of the School.
(iv) (a) Which device will you suggest to be placed/installed in each of these wings to efficiently connect all the computers within these wings.
(b) Suggest the placement of a repeater in the network with justification.
(v) Suggest a device and the protocol that shall be needed to provide wireless Internet access to all smartphone/laptop users in the campus of JNV, Hyderabad.
Ans. (i) SCHOOL, it contains maximum number of computers.
(ii) Star topology

(iii) Firewall should be installed in the SCHOOL where the server is located.
(iv) (a) Hub/Switch
(b) Repeater should be installed where the distance between the wings is 70 metre or more. As per the above layout no repeater is required.
(v) Devices Wi-Fi or WiMAX or Wi-Fi router
Protocols – 802.11, WAP, 802.16

Or

Draw the arrangement for connecting five computers in star and mesh topologies.
Ans. Star Topology

Mesh Topology

9. Consider a table “Salesman” with the following data

Write SQL queries using SQL functions to perform the following operations.
(i) Display salesman name and bonus after rounding off to zero decimal places.
(ii) Display the position of occurrence of the string “ta” in salesman names.
(iii) Display the four characters from salesman name starting from second character.
(iv) Display the month name for the date of join of salesman.
(v) Display the name of the weekday for the date of join of salesman.
Ans. (i) SELECT Sname, ROUND(Bonus,0)FROM Salesman;
(ii) SELECT INSTR(Sname, “ta”) FROM Salesman;
(iii) SELECT MID(Sname,2,4) FROM Salesman;
(iv) SELECT MONTHNAME(DOJ) FROM Salesman;
(v) SELECT DAYNAME(DOJ)FROM Salesman;

Or

A departmental store MyStore is considering to maintain their inventory using SQL to store the data. As a database administer, Abhay has decided that :
1. Name of the database – MyStore
2. Name of the table – Store
3. The attributes of Store are as follows:
Item No-numeric
Item Name-character of size 20
Scode-numeric
Quantity-numeric

(ii)Write the degree and cardinality of the table Store.
(iii) Insert the following data into the attributes ItemNo, ItemName and Scode respectively in the given table
Store.
ItemNo = 2010, ItemName = “Note Book” and Scode = 25
(iv) Abhay want to remove the table Store from the database MyStore.
Which command will he use from the following?
(a) DELETE FROM Store;
(b) DROP TABLE Store;
(c) DROP DATABASE MyStore;
(d) DELETE Store FROM MyStore;

(v) Now Abhay wants to display the structure of the table Store, i.e. name of the attributes and their respective
data types that he has used in the table. Write the query to display the same.
Ans. (i) ItemNo
(ii) Degree- 4, Cardinality- 7
(iii) INSERT INTO Store VALUES(2010,’Note Book’,NULL,25);
(iv) (b) DROP TABLE Store;
(v) DESCRIBE Store
or DESC Store;