Gr11-Ip-Final 2023
Gr11-Ip-Final 2023
SECTION A
1 The binary digits 0 and 1,which are the basic units of memory ,are called ___________ [1]
a. Bits b. Bytes c. Nibbles d. Mega Bytes
2 _______________is used to store data ,instructions, and results permanently for future use. [1]
a. Primary memory
b. Secondary memory
c. Main Memory
d. None of the above
3 The software which runs a computer is ? [1]
a. Synchronous Software b. Operating System c. Application Software d. System Software
4 ______________ are required to convert high-level language to machine language. [1]
a. Operating System b. Language translator c. System Utility d. Device driver
5 Which of the following symbol is used to end SQL statements? [1]
a. : b. ; c. , d. ?
6 Which of the following function is used find the address of a variable? [1]
a. function() b. str() c. input() d. id()
7 What will be the data type of the following variable? [1]
A=”101”
a. Integer b. String c. Float d.Boolean
8 Which of the following language uses 0 and 1 for writing instruction. [1]
a.High level language
b.Machine language
c.Assembly language
d.All of the above
9 Write the output of the following [1]
print(range(0,8,2))
a. 0,1,2,3,4,5,6,7,8 b. error c. range(0,8,2) d. 0,2,4,6
10 Identify the odd one out with reference to datatypes in MySQL [1]
a. char(5) b. varchar(5) c. string(5) d. int
11 Keys of dictionary must be _______________ [1]
a. Unique b. Mutable c. integers d. strings
12 Which command is used to remove table from a database? [1]
a. Delete table
b. Drop table
c. Remove table
d. Clear table
13 The column which can uniquely identify each record in a table is called __________ [1]
a. A foreign key b. A primary key c. An identifier d. A candidate key
14 Write the output of the following code [1]
L=[1,2,3,4,5]
for i in L:
print(i, end= " ")
i=i+1
a. [1,2,3,4,5] b. 1 3 5 c. error d. 1 2 3 4 5
15 The __________clause of SELECT query allows us to select only those rows in the results, [1]
that satisfy a specified condition.
a.having b. where c.if d.asc
16 What type of error is returned by the following code [1]
dict={"a":"apple","b":"ball","c":"cat"}
print(dict[1])
a.KeyError b.KeyNotFoundError c.NotFoundError d.Value Error
Q17 and Q18 are ASSERTION AND REASONING-based questions. Mark the correct choice
as
a. Both A and R are true and R is the correct explanation for A
b. Both A and R are true and R is not the correct explanation for A
c. A is True but R is False
d. A is false but R is True
17 Assertion (A):- Operating system is a system software [1]
Reasoning (R):- A system software is a collection of programs designed to operate, control,
and extend the processing capabilities of the computer itself.(a)
18 Assertion (A): - Compiler and Interpreter are known as language processors [1]
Reasoning (R):- A language processor converts programs from object code to source code©
SECTION B
19 a.Ms. Mirana wants to remove the entire content of a table "BACKUP" along with its [2]
structure
to release the storage space. What MySql statement should she use?
Drop table BACKUP;
b. Sharmila wants to make the database named ‘COMPANY’ active. Write the MySQL
commands for it.
Use COMPANY;
20 a.What is the difference between DDL and DML command?Give examples for each [2]
DDL:
DDL is Data Definition Language which is used to define data structures. For example: create
table, alter table are instructions in SQL.
DML:
DML is Data Manipulation Language which is used to manipulate data itself. For example:
insert, update, delete are instructions in SQL.
b. Mrs. Sharma is the class teacher of Class ‘XII A’ .She wants to create a table ‘Student’
to store details of her class.
a) Which of the following can be the attributes of Student table?
a) RollNo b) “Amit” c) Name d) 25
b) Name the Primary key of the table ‘Student’. State the reason for choosing it.
RollNo
OR
a.Write one similarity and one difference between CHAR and VARCHAR data types.
Both are used for storing non-numeric data.
Char
Used for fixed-length string.
Padded to the specified length when stored
Varchar
Used for variable length string
No padding takes place
Ans:Distinct
Select Location from EMPLOYEE;
Select distinct Location from Employee;
24 Write a program to obtain principal amount, rate of interest and time from user and calculate [2]
and display simple interest.
p = float(input("Enter principal: "))
r = float(input("Enter rate: "))
t = float(input("Enter time: "))
si = p * r * t / 100
print("Simple Interest =", si)
25 What will this code print? [2]
a. aList = [4, 8, 12, 16]
aList[1:3] = [20, 24, 28]
print(aList)
[4, 20, 24, 28, 16]
b. sampleList = [10, 20, 30, 40]
del sampleList[0:6]
print(sampleList)
[]
SECTION C
26 a. Write a program to take as an input, a 2 digit number. Reverse the digits eg: 25 is [3]
reversed to 52
x = int(input("Enter a two digit number: "))
y = x % 10 * 10 + x // 10
print("Reversed Number:", y)
b. Write a python program to find the Fibonacci series of numbers till 25.Some initial
elements of the series are: 0 1 1 2 3 5 8 . . . . . . .
# Program to display the Fibonacci sequence up to n-th term
l=[]
n=int(input("limit"))
for i in range(1,n+1):
num=int(input("elements"))
l.append(num)
print(l)
e=[]
o=[]
for i in L:
if i%2==0:
e.append(i)
else:
o.append(i)
print(e)
print(o)
b. To calculate Grade ,percentage and total marks of 5 subjects of any student assume that
maximum marks for each subject is 100.Grade calculation criteria is given below.Accept
marks scored for each subject from the user.
print("Enter the marks of five subjects::")
SECTION D
31 Find error in the following code(if any) and correct code by rewriting code and underline the [5]
correction
a. x= int(“Enter value of x:”) // x= int(input(“Enter value of x:”))
for in range [0,10]: // for in range (0,10):
if x=y // if x==y :
print( x + y)
else:
print( x‐y)
b. a, b = 0
if (a == b) :
c=a+b
print( c)
c. Number=250
while Number<=1000:
if Number>=750:
print (Number)
Number=Number+100
else:
print( Number*2)
Number=Number+50
d. i=1
a=int(input("ENTER FIRST NUMBER"))
for i in range(1, 11):
print(a,"*=", i ,"=",a * i)
e. Val=25
for I in the range(0,Val)
if I%2==0:
print( I+1)
else:
print (I‐1)
OR
Identify the errors in the following query
a. Select * from Student where Name is NULL;
b. Select * from employee where salary between 1000 and 2000;
c. Select * from employee where name like “A%”;
d. Update student set Name = “Sumita” where admno = 1234;
e. UPDATE Student SET fees= fees+500;
32 Write SQL Commands for the questions form (a) to (j) on the basis of table Teacher. [5]
Table :Teacher
Name Age Department Dateojjoin Salary
Jugal 24 Computer 2007-02-10 12000
Shanti 31 History 2008-03-24 20000
Sandeep 32 Maths 2009-02-25 14000
Sangeeta 45 History 2007-04-15 20000
Rahat 55 Computer 2007-05-17 21000
a. To show all information about the teachers of History department in descending order
of their name.
SELECT * FROM teacher WHERE department= “History”;
b. To list the names of teachers who are in Maths department.
SELECT name FROM teacher WHERE department= “Mathematics” AND gender=
“F”;
c. To display Name, Salary, where age less than 25 and age equal to or more than 45.
Select name,salary from TEACHER where age<25 and age>=45;
d. Update the Salary by increasing Rs. 1000 for teachers with age more than 55.
Update TEACHER set salary=salary+1000 where age>55;
e. To Insert a new record in table Teacher with the following data
‘Raja’, 23, ‘Hindi’, ‘2005-08-19’,12675.
Insert into TEACHER values(‘Raja’, 23, ‘Hindi’, ‘2005-08-19’,12675)
f. Write a SQL command to add following column in above table.
Column Name Data Type Size
Address Varchar 40
Alter table TEACHER add Address varchar(40);
g. Display the names of those teachers whose names starts with alphabet ‘S’;
Select Name from TEACHER where name like “%S”;
h. To Delete those records where Department is History.
Delete from TEACHER where department=”History”;
i. Delete all the records from the table Teacher.
Delete from TEACHER;
j. To drop the table Teacher.
Drop table teacher;
33 [5]
Write SQL Commands for the questions on the basis of the table Item
a. Display all items information.
Select * from Item;
b. Display item name and price values alone .
Select Iname,price from Item;
c. Display all soap information.
Select * from Item where Iname=”soap”;
d. Display the item information whose name starts with letter 's'.
Select Iname from Item where Iname like “s%”;
e. Display a report with item number, item name and total price. (total price = price *
quantity).
Select Itemno,Iname ,price=price*quantity as total price from Item;
f. Display item table information in ascending order based upon item name.
Select * from Item order by Iname asc;
g. Display item name and price in descending order based upon price.
Selct Iname,price from Item order by price desc;
h. Display item name, whose price is in between 50 to 100.
Select Iname from Item where price between 50 and 100;
i. Add new column total price with decimal (10, 2).
Alter table Item add total_price decimal(10,2);
j. Increase price value by 100
Update Item set price=price+100;
SECTION E
34 a. Write a python program to find the factorial of a number. Accept the number as user [1+1+2]
input.
# Python program to find the factorial of a number provided by the user.
# change the value for a different result
num=int(input("enter the number"))
#num = 12