Students must start practicing the questions from CBSE Sample Papers for Class 11 Informatics Practices with Solutions Set 9 are designed as per the revised syllabus.

CBSE Sample Papers for Class 12 Informatics Practices Set 9 with Solutions

Time Allowed: 3 hours
Maximum Marks : 70

General Instructions:

  1. All questions are compulsory.
  2. Answer the questions after carefully reading the text.
  3. Student has to answer only one question where choice is given.
  4. All programming questions have to be answered with respect to Python only.
  5. In Python indentation is mandatory; however, number of spaces used for indenting may vary.
  6. In SQL related questions – semicolon should be ignored for terminating the SQL statements,
  7. Use of calculators is not permitted.

SOLVED

Multiple Choice Question:

Question 1.
(i) In which type of memory, once the program or data is written, it cannot be changed? [1]
(A) EEPROM
(B) PROM
(C) EPROM
(D) None of these [1]
Answer:
(B) PROM
Explanation: In Programmable Read-Only Memory (PROM), if there is an error in writing instructions or data, the error cannot be erased. PROM chip becomes unusable. [1]

(ii) Python code can run on a variety of platforms, it means Python is a ______ language. [1]
(A) Graphical
(B) Cross-platform
(C) independent
(D) All of these
Answer:
(C) independent
Explanation: Python is a cross-platform language: a Python program written on a Macintosh computer will run on a Linux system and vice versa Python programs can run on a Windows computer, as long as the Windows machine has the Python interpreter installed (most other operating systems come with Python pre-installed) [1]

(iii) Which statement is not valid regarding Primary key? [1]
(A) It uniquely identifies a record in the relational database table.
(B) It can allow NULL values.
(C) It is one of the candidate keys.
(D) A table can have only one primary key.
Answer:
(B) It can allow NULL values.
Explanation: A Primary key cannot have a Null value as it is used to uniquely identify a record.

(iv) Select the functions performed by a DDL: [1]
(A) It should specify the proper data types.
(B) It may define the length of the data items.
(C) It may specify the means of checking the errors in the data.
(D) All of these
Answer:
(D) All of these
Explanation: The DDL provides a set of definitions to specify the storage structure , and access methods used by the database systems. [1]

(v) The predictive typing feature of search engine that helps us by suggesting the next word in the sentence
while typing keywords and the spell checking features are examples of
(A) Machine Learning
(B) Natural Language Processing
(C) Error checking
(D) Auto correct Option
Answer:
(B) Natural Language Processing
Explanation: Natural language processing is a subfield of linguistics, computer science, and artificial intelligence concerned with the interactions between computers and human language, in particular how to program computers to process and analyze large amounts of natural language data. [1]

CBSE Sample Papers for Class 11 Informatics Practices Set 9 with Solutions

Question 2.
(a) What is the use of computer ?
Answer:
A computer is used to type documents, send E-mails and browse the Internet.

(b) What is the need of RAM? [1]
Answer:
RAM (Random Access Memory) improves the performance of a computer system by providing a way to access the data and files faster from active log files (RAM data) rather than to retrieve it from the far larger hard drive. RAM is accessed directly by the CPU so it is a fast memory. [2]

(c) Write down the type of memory needed to do the following:
(i) To store data permanently [2]
(ii) To execute the program
Answer:
(i) Secondary Memory
(ii) Primary Memory [2]

(d) Define the Central Processing Unit (CPU) ? [4]
OR
Define primary and secondary memories in detail. [4]
Answer:
Central Processing Unit (CPU) consist of a set of registers, Arithmetic Logic Unit and Control Unit, which together interprets and executes instructions in assembly language. The primary functions of the CPU are as follows: The CPU transfers instructions and input data from main memory to registers i.e internal memory. The CPU executes the instructions in the stored sequence.

When necessary, CPU transfers output data from registers to main memory. Central Processing Unit (CPU) is often called the brain of computer. The CPU is fabricated as a single Integrated Circuit (IC) and is also known as microprocessor. A CPU controls all the internal and external devices to perform arithmetic and logic operations. The CPU consists of two parts-

(i) Arithmetic Logic Unit (ALU) performs all arithmetic and logical operations for the CPU.
(ii) Control Unit (CU) controls the operations of the computer system. [4]
OR
Primary Memory: The memory also called main memory unit that communicates directly with the CPU is called main memory or internal memory or primary memory. The primary memory allows the computer to store data for immediate manipulation and to keep track of what is currently being processed. It has limited storage capacity. Main memory is volatile in nature, it means that when the power is turned OFF, the contents of this memory are lost forever. Primary memory can be further classified in two categories as:

(i) Random Access Memory (RAM): It is used for temporary storage of input data, output data and intermediate results. It is also known as read/write memory that allows CPU to read as well as write data or instructions into it.

(ii) Read Only Memory (ROM): It does not lose its contents when the power is switched OFF. ROM is also known as non-volatile memory or permanent storage. ROM can have data and instructions written to it only one time. Once a ROM chip is programmed at the time of manufacturing, it cannot be reprogrammed or rewritten.

Secondary Memory/Storage: This memory stores much larger amounts of data and information for extended periods of time. Data in secondary memory cannot be processed directly by the CPU, it must first be copied into primary memory i.e,

RAM. It is the slower and cheaper form of memory. Secondary storage is used to store data and program when they are not being processed. It is also non – volatile in nature. Due to this, the data remain in the secondary storage as long as it is not over written or deleted by the user. It is a permanent storage. Various secondary storage devices are pen drive, HDD, CD, memory cards, DVD, etc.

Question 3.
(a) On which operating systems python can run ?
Answer:
Python can run on many operating systems such as Windows, Mac OS, Unix, etc. [1]

(b) Point out the error in the following Python code,
a = bc + d
Answer:
Here the product of b and c is to be added to d and then assign the final value to a.
a = b*c + d [1]

(c) What is the result of 4 + 4/2 + 2 ? [1]
Answer:
4 + 4/2 + 2 = 4 + 2 + 2 = 8 [1]

Commonly Mode Error:
Some students get confused in / operator and operator.

Answering Tip:
operator gives quotient while % operator gives remainder.

(d) What is the syntax of if statement ? [1]
Answer:
if < condition > :
statement (s) [1]

(e) What do you mean by an infinite loop? [2]
OR
What will be the output of the following Python code and why ?
age = raw_input (“Enter your age :”)
agel = age + 10 [2]
Answer:
In an iteration the value of the loop control variable must be changed within the loop in order for the condition to become false and the control to move out of the loop. But if this value doesn’t change or so changes that the loop condition never becomes false, the iteration will never end. Such a loop is called an infinite loop. [2]

Commonly Made Error:
Students generally do not use after for and if statements.

Answering Tip:
> r- Check twice for the ‘:’.
OR
It will generate an error because raw_input ( ) function takes string as an input and the code is trying to add numeric value to a string. [2]

(f) Write a Python program to concatenate two strings and display stringl, string 2 and concatenated string. Also display its output. [4]
Answer:
str1 = input (“Enter ‘first string:”)
str2 = input(“Enter second string:”)
str = str1 + str2
print(“\nString after concatenation =”,str)
print(“String 1 =”,str1)
print(“String 2 =”,str2)
print(“Concatenated string =”,str)
Output
Enter first string: Hello
Enter second string:World
String after concatenation = Hello
World
String 1 = Hello
String 2 = World
Concatenated string = HelloWorld [4]

CBSE Sample Papers for Class 11 Informatics Practices Set 9 with Solutions

Question 4.
(a) What is foreign key used in DBMS? [3]
Answer:
A foreign key is a database key that is used to link two tables together. The FOREIGN KEY constraint identifies the relationships between the database tables by referencing a column, or set of columns, in the Child table that contains the foreign key, to the PRIMARY KEY column or set of columns, in the Parent table. [3]

(b) What are the advantages of using My SQL? [3]
Answer:
Flexibility: MySQL runs on all operating systems.

Power: MySQL focuses on performance. Enterprise-Level SQL Features: MySQL had for some time been lacking in advanced features such as sub queries, views, and stored procedures.

Query Caching: This helps enhance the speed of MySQL greatly.

Replication: Replication enables data from one MySQL database server (known as a source) to be copied to one or more MySQL database servers. 3

(c) What is the difference between the database and the table? [3]
Answer:
There is a major difference between a database and a table. The differences are as follows:
• Table is a way to represent the division of data in a database while the database is a collection of tables and data.
• Tables are used to group the data in relation to each other and create a data set. This data set will be used in the database. The data stored in the table in any form is a part of the database, but the reverse is not true.
• A database is a collection of organized data and features used to access them, whereas the table is a collection of rows and columns used to store the data. [3]

(d) While dealing with Date data type, what is the proper format to store date? Explain with an example. [4]
Answer:
The DATE data type stores the calendar date. DATE data types require four bytes. A calendar date is stored internally as an integer value equal to the number of days since December 31, 1899. In this example, mm is the month (1-12), dd is the day of the month (1-31), and yyyy is the year (0001-9999).
Default Format
DATE – format YYYY-MM-DD.
DATETIME – format: YYYY-MM-DD HH:MI:SS. TIMESTAMP – format: YYYY-MM-DD
HH:MI:SS.
YEAR – format YYYY or YY. [4]

Question 5.
(a) Name the components of database systems. [1]
OR
SQL is which type of language? [1]
Answer:
(i) Data (ii) Hardware (iii) Software (iv) Users [1]
OR
SQL is a comprehensive database language. [1]

(b) What are different types of statements supported by SQL? [2]
Answer:
There are 3 types of SQL statements as
(i) DDL (Data Definition Language): It is used to define the database structure such as tables.
(ii) DML (Data Manipulation Language): These statements are used to manipulate the data in records.
(iii) TCL (Transaction Control Language): These commands manage changes made by data manipulation languages and commands. [2]

(c) What do you mean by candidate key? [2]
Answer:
A candidate key is a subset of a super key set where the key which contains no redundant attribute is none other than a Candidate Key. In order to select the candidate keys from the set of super key, we need to look at the super key set. The role of a candidate key is to identify a table row or column uniquely. Also, the value of a candidate key cannot be Null. [2]

(d) Difference between primary key and candidate key. BDP]
Answer:

Primary Key Candidate Key
A primary key is an attribute or a combination of attributes that uniquely identify a record. A candidate key can be any attribute or a combination of attributes that can qualify as unique key in database.
Only one candidate key can be primary key. There can be multiple candidate keys in one table.

(e) Explain primary key with an example. [4]
Answer:
The primary key of a relation can be said to be a minimal super key. The field or group of field which forms the unique identifier for a table is called the table’s primary key. The primary key can uniquely identify each record in the table and it must never be the same for two records. e.g. emp_code can be a primary key for employee table. Primary key should be chosen such that its attributes are never or very rarely changed. For instance, the address field of a person should not be part of the primary key, since it is likely to change. Emp_code, on the other hand, is guaranteed to never change, till the employee is in the organization. [4]

(f) Write SQL queries for the questions that follow based on table Student.

Stu_ID Stu_Name Subject Marks (%) Address
101 Rahul Mathematics 80 Jain Nagar, Meerut
102 Neha Science 85 Lal Kurti, Meerut
103 Vivek Mathematics 90 Sastri Nagar, Delhi
104 Vipul Commerce 82 Bagphat,Meerut
105 Priyanka Science 91 Modipuram, Delhi
106 Ruchi Commerce 75 Laxmi Nagar, Delhi

(i) Display all records.
(ii) To display the details of those students who have Stu_ID 103.
(iii) To display student name, marks, Address of those students whose marks greater than 85.
(iv) Display Stu_ID, Name of those students who have subject science.
Answer:
(i) SELECT * FROM Student;
(ii) SELECT * FROM Student WHERE Stu_ID = 103;
(iii) SELECT Stu Name, Marks, Address FROM Student WHERE Marks > 85;
(iv) SELECT Stu_ID, Stu_Name From Student WHERE Subject = “Science”; [4]

Question 6.
(a) How do you specify a Long integer and a Unicode string in Python ? [2]
Answer:
Suffix L makes an integer a long integer e.g. 152 is a long integer and 15 is an integer. Unicode string values are written as normal string prefixed with u.
e.g., u’Hello’, u ‘Abe’ etc [2]

(b) Write a program that reads three numbers and prints them in ascending order. [3]
Answer:
x = int(input(“Enter first number :”))
y = int(input(“Enter second number:”))
y = int(input(“Enter second number:”))
if x < y and x < z :
if y < z :
a, b, c = x, y, z
else :
a, b, c = x, z, y
elif y < x and y < z :
if x < z :
a, b, c = y, x, z
else :
a, b, c = y, z, x
else :
if x < y :
a, b, c = z, x, y
else :

Commonly Made Error:
Some students do not use colon at their proper Place.

Answering Tip:
Use colon after conditional statements as if, elif, for, etc.

(c) Find the output
a = [10,20,30,40,50, 60]
for i in range (1,5):
a[i – 1] = a[i]
for i in range (0,5):
print (a[i], end = ” “) [2]
Answer:
Output
20 30 40 50 60 [2]

(d) Write the suitable method: [3]
(i) Add an element in the beginning of the list.
(ii) Find the length of a dictionary.
(iii) Add an element at the end of the list.
Answer:
(i) insert (0, value)
(ii) len ( )
(iii) append( ) [3]

Question 7.
(a) What do you mean by emerging trends ? [2]
Answer:
Emerging trends are the state of the art technology which gain popularity and set a new trend among users. Knowledge of emerging trends is particularly important to individuals and companies who are charged with monitoring a particular field or company. [2]

(b) How many types of grid are there? Explain them. [2]
Answer:
Grid can be of two types:
(i) Data grid, used to manage large and distributed data having the required multi-user access.
(ii) Processor grid, where processing is moved from one PC to another as need or a large task is divided into sub tasks and allotted to various nodes for parallel processing [2]

CBSE Sample Papers for Class 11 Informatics Practices Set 9 with Solutions

Question 8.
Lists are the container which store the heterogeneous elements of any type as integer, character, floating point elements of a list are represented by enclosing them in square brackets [ ]. Consider following list for python language- [4]
L=[13, 3.45, “Tree”, ‘Amar’, [10,8.91, “Apple”], 456]

(i) The output of L[-2] will be-
(A) 10
(B) 8.91
(C) [10,8.91, ‘Apple’]
(D) 3.45
Answer:
(C) [10,8.91, ‘Apple’]

(ii) To get value 8.91 from the list, the python statement will be-
(A) L[4][l]
(B) L[-2][-2]
(C) Both (A) and (B)
(D) None of these
Answer:
(C) Both (A) and (B)

(iii) The length of the list is-
(A) 6
(B) 8
(C) 18
(D) None of these
Answer:
(A) 6

(iv) print(len(L[2]) = =len(L[3])) will print-
(A) False
(B) True
(C) Error
(D) None of these
Answer:
(B) True

(v) The output of print (L[l:5:2]) will be-
(A) [3.45, ‘Amar’]
(B) [3.45, ‘Amar’, 456]
(C) [3.45, ‘Tree’, ‘Amar1,10,8.91]
(D) Error
Answer:
(A) [3.45, ‘Amar’]