0% found this document useful (0 votes)
56 views6 pages

Class Xii Centum Phase-Ii CS QP 29-11-2024

ggggg
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
56 views6 pages

Class Xii Centum Phase-Ii CS QP 29-11-2024

ggggg
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

CENTUM PHASE - II

CBSE MODEL - GRADE XII DATE: 29-11-2024


SUBJECT: (083) COMPUTER SCIENCE
TIME ALLOWED: 3 Hrs. MAX MARKS: 70

General Instructions:

● This question paper contains 37 questions.


● All questions are compulsory. However, internal choices have been provided in some questions.
Attempt only one of the choices in such questions
● The paper is divided into 5 Sections- A, B, C, D and E.
● Section A consists of 21 questions (1 to 21). Each question carries 1 Mark.
● Section B consists of 7 questions (22 to 28). Each question carries 2 Marks.
● Section C consists of 3 questions (29 to 31). Each question carries 3 Marks.
● Section D consists of 4 questions (32 to 35). Each question carries 4 Marks.
● Section E consists of 2 questions (36 to 37). Each question carries 5 Marks.
● All programming questions are to be answered using Python Language only.
● In case of MCQ, text of the correct answer should also be written.

Q No Section - A Marks
(21 x 1 = 21 Marks)
1 State True or False 1
Digits are one of the parts of the Python character set
2 Identify the statement(s) from the following options which will raise 1
TypeError exception(s):
a) print('5') b) print( 5 * 3)
c) print('5' +3) d) print('5' + '3')
3 The........clause can group records on the basis of common values in a field. 1
(a) AGGREGATE (b) GROUP
(c) GROUP BY (d) JOIN

4 A primary key of a relation must be_____. 1


(a) UNIQUE only (b) NOT NULL only
(c) Both UNIQUE and NOT NULL (d) Neither UNIQUE nor NOT NULL

5 ____________ can be create using cursor( ) method of connection object. 1


(a) Cursor object (b) Cursor variable
(c) Connect (d) None of these
6 The BETWEEN clause can not be used for 1
(a) Integer Fields (b) Varchar Fields
(c) Date Fields (d) None of these
7 _____command modifies or change the existing records in a table. 1
(a) UPDATE (b) CHANGE
(c) ALTER (d) MODIFY
8 The clause to arrange the data of a column in descending order is 1
(a) DESC (b) GROUP BY
(c) LIKE (d) ASC
9 User can write Python MySQL script using 1
(a) MySQL.connector library (b) SQL.connect library
(c) MySQL.connect library (d) None of these

10 State True or False 1


“The method that can be used to delete a range of values from a list is del”.
11 Given : s= “AnikhaVenkat”. What will be the output of 1
print(s[2]+s[8]+s[0:51])?
(a) inVenkatAnikha (b) inniAnikhaVenkat
(c) inAnikhaVenkat (d) AnikhaVenkat
12 There can be____foreign keys in a relation. 1
(a) 2 (b) 3
(c) 1 (d) Multiple
13 Which of the following functions will read lines of a text file as list elements. 1
(a) read( ) (b) get()
(c) readline( ) (d) readlines( )

14 Which of the following will be the output of the statement given below? 1
print([12,34,56,78,90].pop())
(a) 78 (b) 90
(c) 12 (d) 12,34,56,78,90
15 The...........function returns True if all the characters in a string are digits. 1
(a) isalnum() (b) isdigit()
(c) isnumber() (d) isalpha()

16 The seek(n) places the file pointer at position n with reference to 1


(a) Beginning (b) End
(c) Current position (d) Position 10

17 In which module, ceil() function resides ? 1


(a) pandas (b) pyplot
(c) random (d) math

18 While opening a binary file the.........character has to be added to the mode of opening. 1
(a) b (b) x
(c) u (d) b*

19 Which of the following operator cannot be used with string data type? 1
(a) + (b) in
(c) * (d) /
Q 20 and Q 21 are Assertion(A) and Reason(R) 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
20 Assertion (A): LIKE operator is used for pattern matching in WHERE clause. 1

Reason (R): % and _ wildcard is used in LIKE operator for making a pattern.
21 Assertion (A) In a cross join the number of records in the output will be the 1
maximum.
Reason (R) A cross join is also called a Cartesian product.
Q No Section -B Marks
(7 x 2 = 14 Marks)
22 Categorize the following commands as DDL or DML: 2
INSERT, UPDATE, ALTER, DROP
23 Predict the output : 2
dic = {‘a’:1, ‘b’:2, ‘c’:3, ‘d’:4}
print(dic)
if ‘a’ in dic :
del dic[‘a’]
print(dic)

24 Differentiate between Drop and Delete commands of MYSQL. Write its syntax 2

25 What do you understand by Candidate keys in a table? Give a suitable example of 2


candidate keys from a table containing some meaningful data.

26 What will be the output of following code ? 2


L=[10,30,50,60]
L.append(70)
L.insert(2,80)
L.sort()
print(L)

27 What is the command to install mysql connector? 2


28 Write the output of the code given below: 2
a =30
def call (x):
global a
if a%2==0:
x+=a
else:
x-=a
return x
x=20
print(call(35), end="#")
print(call (40), end= "@")

Q No Section - C Marks
(3 x 3 = 14 Marks)
29 Difference between Where and Having Clause in mysql. 3

30 Write the Python code to display the present databases in MySQL 3


31 Write a function countEU() in Python, which should read each character of a text file. 3
IMP.TXT should count and display the occurrence of alphabets E and U (including
small cases e and u too).
e.g. If the file content is as follows :
Pinaky has gone to his friend’s house.
His friend’s name is Ravya. Her house is 12 km from Pinaky’s house.
The countEU() function should display the output as
E:8
U:3
Q No Section - D Marks
(4 x 4 = 16 Marks)
32 1+3

(i) SELECT F_NAME, CITY FROM WORKER ORDER BY STATE DESC;


(ii) SELECT DISTINCT (CITY) FROM WORKER;
(iii) SELECT F_NAME, STATE FROM WORKER WHERE L_NAME LIKE ‘_HA%’;
(iv) SELECT CITY, COUNT(*) FROM WORKER GROUP BY CITY;
33 4

Based on the data given above answer the following questions:


(i) Identify the columns which can be considered as Candidate keys.
(ii) Write the degree and cardinality of the table.
(iii) Write the statements to:
(a) Insert a new row with appropriate data.
(b) Increase the capacity of all the labs by 10 students which are on 'I' Floor
OR
(Option for part (iii) only)
(iii) Write the statements to:
(a) Add a constraint PRIMARY KEY to the column LABNO in the table.
(b)Delete the table LAB.
34 (i) What is equi join ? Explain with an example. 2+2
(ii) Identify which of the functions given below are aggregate functions.
COUNT() , LEFT() , RIGHT() , MAX() , AVG() , TRIM()

35 A table, named STATIONERY, in ITEMDB database, has the following structure: 4

Write the following Python function to perform the specified operation:


AddAndDisplay(): To input details of an item and store it in the table STATIONERY.
The function should then retrieve and display all records from the STATIONERY table
where the Price is greater than 120.

Assume the following for Python-Database connectivity:


Host: localhost, User: root, Password: Pencil

Q No Section - E Marks
(2 x 5 = 10 Marks)

36 SQL queries (i) to (iii) based on the relations EMPLOYEE and SALGRADE given 5
below:

(i) SELECT COUNT(SGRADE), SGRADE FROM EMPLOYEE GROUP BY SGRADE;


(ii) SELECT MIN(DOB), MAX(DOJ) FROM EMPLOYEE;
(iii) SELECT NAME, SALARY FROM EMPLOYEE E, SALGRADE S WHERE E.SGRADE=
S.SGRADE AND E.ECODE<103;
(iv) SELECT AVG(SALARY), MIN(SALARY), MAX(SALARY) FROM EMPLOYEE ;
(v) SELECT NAME, DESIGN FROM EMPLOYEE WHERE NAME LIKE “%n” ;
37 (i) What is the difference between Count(*) and count( ) functions. 2+1+2
(ii) Mention atleast three limitations of DBMS.
(iii) Write MySQL command to create the table ‘Employee’ with the following
structure and constraint.
Table: Employee

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy