SAMPLE QUESTION PAPER – 3
Class XI – Informatics Practices
Time: 3 Hours Maximum Marks: 70
SECTION – A (1 × 21 = 21 Marks)
Q1 Which of the following is/are invalid identifiers?
a) for b) total_marks c) 9value d) name#
Q2 Which of the following is/are valid operators in Python?
a) -= b) == c) && d) not
Q3 If p = True and q = False, then (p and not q) evaluates to:
a) True b) False c) True and False d) None
Q4 Python is an interpreted language. (True / False)
Q5 Evaluate the expression: 5 + 2 * 3 ** 2 – 10 % 4
a) 21 b) 23 c) 19 d) 17
Q6 Which SQL clause is used to group records?
a) WHERE b) GROUP BY c) ORDER BY d) HAVING
Q7 State True or False: String is a mutable data type.
Q8 Which of the following is invalid dictionary declaration?
a) D = {} b) D = {‘a’:1, ‘b’:2} c) D = {[1,2]:3} d) D = dict(x=1,y=2)
Q9 Which method returns all keys of a dictionary?
a) key() b) keys() c) getkeys() d) values()
Q10 What will be the output?
L = [4, 8, 12]
print(L[-1] + L[0])
print(L + [16])
Q11 Which function inserts element at specific index in list?
a) append() b) extend() c) insert() d) add()
Q12 Which of the following is invalid literal?
a) 45.67 b) “Python” c) 089 d) False
Q13 Which is mutable data type?
a) tuple b) string c) dictionary d) int
Q14 Write output:
A = 25
if A > 20:
print(A*2)
else:
print(A+5)
A = A – 5
print(A)
Q15 Which statement is correct?
A) in operator checks membership B) in compares two numbers
C) in deletes elements D) in concatenates strings
Q16 State True or False: clear() method removes all elements from dictionary.
Q17 A table can have only one ______ key.
a) Candidate b) Primary c) Foreign d) Alternate
Q18 If my_dict = {‘pen’:10,’book’:20,’eraser’:5} Which statement will not give error?
a) my_dict + {‘pencil’:8} b) my_dict[‘pen’]=15
c) print(my_dict[‘Pen’]) d) my_dict – {‘pen’:10}
Q19 If list = [5,10,15,20], what is list.index(15)?
a) 1 b) 2 c) 3 d) error
ASSERTION & REASONING
(a) Both A and R are true and R is correct explanation
(b) Both A and R are true but R is not correct explanation
(c) A is true but R is false
(d) A is false but R is true
Q20 Assertion (A): Tuple is immutable.
Reason (R): Tuple elements cannot be modified after creation.
Q21 Assertion (A): DELETE command removes records from table.
Reason (R): DELETE is a DDL command.
SECTION – B (7 × 2 = 14 Marks)
Q22 Differentiate between WHERE and HAVING clause. OR
Differentiate between ALTER and UPDATE commands with example.
Q23 a) Define Tokens in Python with example.
b) Define logical error with example.
Q24 Write a Python program to create a NumPy array using a list and display it.
Q25 Given L = [10,20,30,40,50,60,70,80,90,100] find a) L[2::2] b) L[-1::-3] OR
If L1 = [3,6,3,9,3,12,15,3,18,3] write statement to
A) Count occurrences of 3 B) Append 25 to L1
Q26 consider the table employee
| empid | adharid | name | dept | salary |
| 201 | 234567890123 | Amit Sharma | Sales | 45000 |
| 202 | 345678901234 | Riya Gupta | HR | 52000 |
| 203 | 456789012345 | Karan Mehta | IT | 60000 |
| 204 | 567890123456 | Neha Singh | Finance | 48000 |
| 205 | 678901234567 | Arjun Verma | Marketing | 55000 |
a) Identify Primary & Candidate Keys
b) write the Correct query:
i) delete * from emp where empid>5;
ii) delete from emp where empid>5;
Q27 consider following code and Correct syntactical errors:
A=10 B=20
for i in range(1,5)
A=A+i
print(A End=”#”)
Q28 (a)Write output of the following code
d={“Riya”:1,”Amit”:2}
d.update({“Neha”:3,”Riya”:5})
print(d)
b) find output
D={‘Jan’:31,’Feb’:28}
print(31 in D)
print(‘Feb’ in D.keys())
OR
Find the output of the following code
D={1:5,2:10,3:15}
del D[3]
print(len(D))
print(list(D.values()))
SECTION – C (4 × 3 = 12 Marks)
Q29 [a]Create table LIBRARY with following specifications:-
| BID | Integer |
| BNAME | Char(25) |
| AUTHOR | Varchar(30) |
| PRICE | Float(6,2) |
| PDATE | Date |
[b] write command to Insert following record
(501,’Python Guide’,’Raj Kumar’,550.75,’2023-01-15′)
Q30 consider the dictionary DATA={“Math”:80,”Science”:75} write commands to
a) Add new subject English with 87 marks
b) Increase “Math” by 5
c) Display items as tuple
OR
consider the dictionary STU={“Amit”:70,”Riya”:90,”Karan”:85} Write commands to
a) Add details of a new student “Neha” with 88 marks
b) Display keys of the dictionary
c) Display marks obtained by “Riya”
Q31 Write output of following queries:
a) Select instr(“Computer”,”o”),left(“welcome”,3)
b) Select concat(ltrim(” GOOD DAY “),”hello”);
c) Select substring(“Data Science”,6,7);
Q32 a) Define remove() and reverse() with example.
b) Find the output of the following code:-
A=[5,10,15,20,25,30,35]
print(A[-1:-5:-2])
A=A[::-1]
print(A)
OR
[a]Differentiate append() and insert().
[b] find the Output:
num=[2,4,6,8,10]
print(num[4:1:-1])
num=num[::2]
print(num)
SECTION – D (2 × 4 = 8 Marks)
Q33 consider the Table COURSE
| CODE | TITLE | COST | STARTDATE | FACID |
| C101 | Python | 12000 | 2021-05-10 | 201 |
| C102 | Java | 15000 | 2022-02-18 | NULL |
| C103 | AI | 18000 | 2021-09-05 | 203 |
| C104 | ML | 16000 | 2022-03-20 | 201 |
Write outputs:
a) SELECT CODE, DAY(STARTDATE) FROM COURSE;
b) SELECT FACID, LEFT(TITLE,3) FROM COURSE WHERE FACID IS NOT NULL;
c) SELECT TITLE, MONTH(STARTDATE) FROM COURSE WHERE COST > 14000;
d) SELECT TITLE, COST FROM COURSE WHERE COST BETWEEN 15000 AND 17000;
Q34 a) Write a python program to Create list of 10 integers and display the numbers divisible by three and lie between 20 and 70.
b) Create dictionary of 6 departments and employee count. Display departments having more than 20 employees.
OR
a) WAP in python to Input list of 8 numbers and count numbers divisible by 4.
b) WAP in python to Create dictionary of 5 employee IDs and names. Display output:
ID –> Name of all the employees
SECTION – E (3 × 5 = 15 Marks)
Q35 Consider the Table EMPLOYEE
| EID | ENAME | DEPT | CITY | SALARY | JOIN_DATE |
| E101 | Amit | Sales | Delhi | 45000 | 2008-03-15 |
| E102 | Riya | HR | Mumbai | 52000 | 2010-07-20 |
| E103 | Karan | Sales | Pune | 60000 | 2004-01-10 |
| E104 | Neha | IT | Mumbai | 70000 | 2001-11-05 |
| E105 | Suresh | Finance | Chennai | 48000 | 2012-06-18 |
Write SQL queries:
- Display ENAME, CITY, SALARY where CITY=’Mumbai’
- Display ENAME who joined in 2010
- Display names exactly 5 characters
- Display records with Salary more than 50000 and have joined before ‘2005-01-01’
- Display last 3 characters of DEPT
Q36 a) Write the SQL commands for the following:-
i) remove all the records of the table employee
ii) display records of the table student in ascending order of marks
b) WAP in python to Create dictionary of 5 subjects and marks. Display subjects with marks > 75.
Q37 a) WAP in python to Input list of 10 integers and replace even numbers with cube and odd with square.
b) WAP in python to Create dictionary of 6 product IDs and prices. Check if given ID exists.
OR
a) WAP in python to Input list of 10 numbers and display product of numbers > 10
b) WAP in python to Create dictionary of 6 student roll numbers and marks. Display average marks.
