SAMPLE PAPER-2
INFORMATICS PRACTICES CLASS-XI
TIME:- 3hrs MM:70
SECTION – A (1X21=21)
Q1 Which of the following is/are invalid identifiers?
a) class b) total123 c) _value d) 1st_name
Q2 Which of the following is/are valid relational operators?
a) >= b) = c) != d) <>
Q3 If a = True and b = True then (a and not b) evaluates to:
a) True b) False c) True and False d) None
Q4 Python is case sensitive language. (True/False)
Q5 Evaluate the expression: 4 * 3 ** 2 + 20 % 6 – 5
a) 35 b) 33 c) 37 d) 31
Q6 Which SQL clause is used to sort records?
a) Where b) Select c) Order By d) Having
Q7 State True or False: DICTIONARY is an ordered collection.
Q8 Which of the following is invalid dictionary declaration?
a) D = {} b) D = {‘a’:1, ‘b’:2} c) D = {[10]:5} d) D = dict(a=1, b=2)
Q9 Which method is used to remove all elements from dictionary?
a) remove() b) delete() c) clear() d) pop()
Q10 What will be the output?
L = [3,6,9,4,5,2]
print(L[0:2] + L[-3:])
print(L + [12]*2)
Q11 Which method adds multiple elements in list?
a) append() b) insert() c) extend() d) index()
Q12 Which of the following is invalid literal?
a) 56.78 b) ‘python’ c) 078 d) True
Q13 Which is mutable data type?
a) string b) list c) tuple d) int
Q14 Give output:
X = 20
if X == 20:
print(X * 2)
else:
print(X / 2)
X = X – 5
print(X)
Q15 Which statement is correct?
A) not checks equality B) in checks membership
C) in concatenates values D) in deletes values
Q16 State True or False: append() adds element at the end of list.
Q17 A relation can have many ______ keys but only one primary key.
a) Candidate b) Alternate c) Foreign d) All of these
Q18 IF my_dict = {‘red’:1, ‘blue’:2, ‘green’:3} Which statement will not give error?
a) my_dict[‘yellow’]=4 b) print(my_dict[‘Red’])
c) my_dict + {‘black’:5} d) my_dict – {‘red’:1}
Q19 If list = [10,20,30,40], what is list.index(50)?
a) 4 b) 3 c) error d) 0
ASSERTION AND 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 changed after creation.
Q21 Assertion (A): SELECT is a DDL command.
Reason (R): SELECT retrieves data from table.
SECTION – B (7 × 2 = 14 Marks)
Q22 Differentiate between WHERE and HAVING clause. OR
Differentiate between ALTER and UPDATE command with example.
Q23 a) Define Keywords in Python with example.
b) Define logical error with example.
Q24 Write a program to create a NumPy array using list and display its datatype.
Q25 Given the following list: L = [25, 18, 32, 41, 56, 63, 72, 89, 90, 100]
Write Python statements to produce the following outputs: a) L[1::2] b) L[-2::-3]
OR
If L1 = [5, 10, 5, 20, 5, 30, 40, 5, 50, 5] (Answer using built-in functions only)
A) Write a statement to count occurrences of element 5 in L1.
B) Write a statement to remove the first occurrence of 5 from L1.
Q26:- a) Consider table STUDENT with following attributes:
| rollno | adharno | name | class | section |
| 101 | 234567890123 | Amit Sharma | XI | A |
| 102 | 345678901234 | Riya Gupta | XI | A |
| 103 | 456789012345 | Karan Mehta | XI | B |
| 104 | 567890123456 | Neha Singh | XI | B |
| 105 | 678901234567 | Arjun Verma | XI | C |
Identify Primary Key and Candidate Keys.
b) Identify which SQL query is correct:
i) delete * from student where rollno > 10;
ii) delete from student where rollno > 10;
Q27 Rewrite the following code after removing syntactical errors and underline the corrections made:
A=50, B
for i in range(1,10)
A=A+i
print a End=”$”
Q28Write the output of the following code:
a) d = {“Rohit”:10,”Mohan”:20}
d.update({“Riya”:30,”Rohit”:50,”rohit”:70})
print(d)
b) D={‘Apr’:30,’May’:31,’Jun’:30}
print(‘May’ in D)
print(31 in D.values())
OR
Find the output of the following code
D={ 5:100, 6:200, 7:300, 8:400 }
del D[7]
print(len(D))
print(list(D.keys()))
D[D[5]]=500
print(D)
D[6]-=50
print(D)
SECTION – C (4 × 3 = 12 Marks)
Q29 a) Write SQL query to create table BOOKS:
| Field Name | Data Type | Size |
| BID | Integer | – |
| BNAME | Char | 30 |
| AUTHOR | Varchar | 40 |
| PRICE | Float | (6,2) |
| PDATE | Date | – |
b) Insert record:(201, ‘Python Basics’, ‘ABC Sharma’, 450.50, ‘2022-07-15’)
Q30 Write Python statements to perform operations on dictionary MARKS:
MARKS = {“Amit”: 70, “Riya”: 85}
a) Add key “Neha” with value 90
b) Increase value of “Amit” by 5
c) Display dictionary items as list of tuples
OR
Write Python statements to perform operations on dictionary STUD:
STUD = {“Math”: 78, “Physics”: 88, “Chemistry”: 91}
a) Add “Biology” subject with 80 marks
b) Display all values of the dictionary
c) change the value of physics to 90
Q31 Write output of following SQL statements:
a) Select instr(“Programming”,”g”)
b) Select trim(” HELLO WORLD “)
c) Select substring(“Database System”, 5,6)
Q32 a) Define pop() and sort() functions of list with example.
b) Write output:
A = [5, 15, 25, 35, 45]
print(A[0:4:2])
A = A[::-1]
print(A)
OR
a) Differentiate between insert() and append() functions of list in python with example.
b) Write the Output:
num = [3,6,9,12,15]
print(num[3:0:-1])
num = num[1::2]
print(num)
SECTION – D (2 × 4 = 8 Marks)
Q33 Given Table: TRAINING
| TID | TNAME | FEE | STARTDATE | TRAINERID |
| TR1 | Python | 10000 | 2021-05-12 | 301 |
| TR2 | Java | 12000 | 2022-02-18 | NULL |
| TR3 | AI | 15000 | 2021-09-25 | 302 |
| TR4 | ML | 14000 | 2022-04-10 | 301 |
Write outputs of queries:
a) SELECT TID, DAY(STARTDATE) FROM TRAINING;
b) SELECT TRAINERID, LEFT(TNAME,3) FROM TRAINING WHERE TRAINERID IS NOT NULL;
c) SELECT TNAME, MONTH(STARTDATE) FROM TRAINING WHERE FEE > 11000;
d) SELECT TNAME, FEE FROM TRAINING WHERE FEE BETWEEN 12000 AND 15000;
Q34 a) Write Python program to create list of 15 integers and find smallest even number.
b) Create dictionary of 6 subjects and marks. Display subjects with marks less than 40.
OR
a) write a program to input a list of integers and display total no. of two digit and three digit numbers separately.
b) Create dictionary of 5 employee IDs and salaries. Display highest salary.
SECTION – E (3 × 5 = 15 Marks)
Q35 Given Table: STAFF
| SID | SNAME | DEPT | CITY | SALARY | JOIN_DATE |
| S101 | Arun | HR | Delhi | 40000 | 2009-03-15 |
| S102 | Meena | IT | Mumbai | 65000 | 2011-08-10 |
| S103 | Raj | Sales | Pune | 50000 | 2005-02-20 |
| S104 | Tina | IT | Delhi | 75000 | 2003-10-05 |
| S105 | Vivek | Finance | Mumbai | 48000 | 2015-06-12 |
Write SQL queries:
- Display SNAME and CITY where city is Delhi.
- Display SNAME who joined in 2011.
- Display names having exactly 4 characters.
- Display employees whose salary > 60000 OR join date before ‘2005-01-01’.
- Display last 2 characters of DEPT.
Q36 a) write the SQL queries:
i) open the database school and display the names of all the tables
ii) remove the table CUSTOMER.
b) write a Python program to Create dictionary of 5 sports and players. Display sports where player name starts with ‘A’.
Q37 a) WAP to input 8 integers and replace multiples of 3 with their square.
b) Create dictionary of 8 product IDs and prices. Input product ID and display its price if exists.
OR
a) Input 10 numbers and find sum of numbers less than 50.
b) Create dictionary of 6 students and marks. Display average marks.
