Nothing Special   »   [go: up one dir, main page]

12 Computer Science PMT

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 3

SHEMFORD FUTURISTIC SCHOOL, PINJORE

PRE-MIDTERM EXAMINATION
SESSION 2024-2025
COMPUTER SCIENCE - 083
CLASS: 12 MM: 50
DATE : 27-07-2024 Time: 2 hour
General Instructions:
 Attempt your paper neatly.
 All questions are compulsory.
 Attempt all parts of a question in order.
 Read the questions, follow the format and answer accordingly.
SECTION A 10x0.5=5
1a) Which of the following is an invalid data type in Python?
b) (a) Set (b) None (c)Integer (d)Real
2 What will be the output of the following statement?
print(3-2**2**3+99/11)
(a) 244 (b) 244.0 (c) -244.0 (d) Error
3a) ______ command is used to remove primary key from the table in SQL.
b) (a) Update (b)Remove (c) Alter (d)Drop
4a) Which of the following statement(s) would give an error after executing the following code?
S="Welcome to class XII" # Statement 1
b) print(S) # Statement 2
c) S="Thank you" # Statement 3
d) S[0]= '@' # Statement 4
e) S=S+"Thank you" # Statement 5
f) (a) Statement 3 (b) Statement 4 (c) Statement 5 (d) Statement 4 and 5
5a) _________ is a non-key attribute, whose values are derived from the primary key of some other
table.
b) (a) Primary Key (b) Foreign Key (c) Candidate Key 1 3 (d) Alternate Key
6 The SELECT statement when combined with __________ clause, returns records without
repetition.
(a) DESCRIBE (b) UNIQUE (c) DISTINCT (d) NULL
7 What will the following expression be evaluated to in Python?
print(15.0 / 4 + (8 + 3.0))
(a) 14.75 (b)14.0 (c) 15 (d) 15.5
8 Which of the following commands will delete the table from MYSQL database?
(a) DELETE TABLE (b) DROP TABLE (c) REMOVE TABLE (d) ALTER TABLE
9a) Assertion & Reasoning based questions.
b) Mark the correct choice as
c) (a) Both A and R are true and R is the correct explanation for A 4
d) (b) Both A and R are true and R is not the correct explanation for A
e) (c) A is True but R is False
f) (d) A is false but R is True

Assertion (A):- If the arguments in function call statement match the number and order of
arguments as defined in the function definition, such arguments are called positional arguments.
Reasoning (R):- During a function call, the argument list first contains default argument(s)
followed by positional argument(s).
10 Assertion (A): CSV (Comma Separated Values) is a file format for data storage which looks like a
text file.
Reason (R): The information is organized with one record on each line and each field is separated
by comma
SECTION B 5x2=10
11 Rao has written a code to input a number and check whether it is prime or not. His code is having
errors. Rewrite the correct code and underline the corrections made.
def prime():
n=int(input("Enter number to check :: ")
for i in range (2, n//2):
if n%i=0:
print("Number is not prime \n")
break
else:
print("Number is prime \n’)
12 Write two points of difference between Circuit Switching and Packet Switching.
13 (a) Given is a Python string declaration:
myexam="@@CBSE Examination 2022@@"
Write the output of: print(myexam[::-2])

(b) Write the output of the code given below:


my_dict = {"name": "Aman", "age": 26}
my_dict['age'] = 27
my_dict['address'] = "Delhi"
print(my_dict.items())
14 Categorize the following commands as DDL or DML:
INSERT, UPDATE, ALTER, DROP
15 What is the difference between mutable and immutable datatypes.
SECTION C 5X3=15
16 What is the use of functions in python programming? Explain it with an example.
17 What is a Module? Explain the structure of a Python Module.
18 Explain the concept of Foreign key and Primary key.
19 Explain the following terms:- HTTP,FTP,NIC
20 Write the classification of SQL statements.
SECTION D
21 Write the output of the queries (i) to (iv) based on the table, TECH_COURSE given below: 5X4=20
Table: TECH_COURSE
CID CNAME FEES STARTDATE TID
C201 Animation and VFX 12000 2022-07-02 101
C202 CADD 15000 2021-11-15 NULL
C203 DCA 10000 2020-10-01 102
C204 DDTP 9000 2021-09-15 104
C205 Mobile Application 18000 2022-11-01 101
Development
C206 Digital marketing 16000 2022-07-25 103

(i) SELECT DISTINCT TID FROM TECH_COURSE;


(ii) SELECT TID, COUNT(*), MIN(FEES) FROM TECH_COURSE GROUP BY TID HAVING
COUNT(TID)>1;
(iii) SELECT CNAME FROM TECH_COURSE WHERE FEES>15000 ORDER BY CNAME;
(iv) SELECT AVG(FEES) FROM TECH_COURSE WHERE FEES BETWEEN 15000 AND 17000;
22 Discuss about len(), max(), index() and sum() in brief.
23 Write a function, vowelCount() in Python that counts and displays the number of vowels in the
text file named Poem.txt.
24 Sartaj has created a table named Student in MYSQL database, SCHOOL:
 rno(Roll number )- integer  name(Name) - string  DOB (Date of birth) – Date  Fee – float
Note the following to establish connectivity between Python and MySQL:
 Username - root  Password - tiger  Host - localhost
Sartaj, now wants to display the records of students whose fee is more than 5000. Help Sartaj to
write the program in Python.
25 1. Define the term Domain with respect to RDBMS. Give one example to support your answer.
2. Explain the importance of MySQL Database System.

You might also like