Professional Documents
Culture Documents
Mid A
Mid A
General Instructions:
1. This question paper contains two parts A and B. Each part is com-
pulsory.
2. Both Part A and Part B have choices.
3. Part-A has 2 sections:
a. Section – I is short answer questions, to be answered in one
word or one line.
b. Section – II has two case studies questions. Each case study
has 4 case-based sub- parts. An examinee is to attempt any 4
out of the 5 subparts.
4. Part - B is Descriptive Paper.
5. Part- B has three sections
a. Section-I is short answer questions of 2 marks each in which
two question have internal options.
b. Section-II is long answer questions of 3 marks each in which
two questions have internal options.
c. Section-III is very long answer questions of 5 marks each in
which one question has internal option.
6. All programming questions are to be answered using Python
Language only
Section-I
Select the most appropriate option out of the options given for each question.
Attempt any 15 questions from question no 1 to 21.
1 Find the invalid expression(s) from the following. Justify
a. ob1 = 10,20,30,40
ob2 = ob1 *3
b. ob1 = {10:20,30:40}
ob2 = ob1 *3
c. ob1 = [10:20,30:40]
ob2 = ob1 *3
d. ob1 = “10:20,30:40”
ob2 = ob1 *3 (1)
COMPUTER SCIENCE-(A) \ 2 \ 8
12 Explain any one constraints which can be used to control Data Redundancy (1)
13 Give any two features of RDBMS software (1)
Table- Coach
Coachid No Coachname Salary Sports Rating Grade Region
101 1 Aman 10000 Tennis 5 A Delhi
102 2 Karan 8500 Basketball 6 A Haryana
103 3 Rimsha 9000 Basketball 4 C Delhi
104 4 Akshit 8000 Cricket B Chandigarh
105 5 Antara 5000 Cricket 5 B Delhi
(a) Identify the attribute best suitable to be declared as a Candidate keys and
Alternate key, (1)
(b) Write the degree and cardinality of the table COACH (1)
(c) Insert a record in table COACH (Assume your own values) (1)
(d) Now Abhay wants to display the structure of the table COACH, i.e, name of
the attributes and their respective data types that he has used in the table.
Write the query to display the same. (1)
(e) Abhay want to remove the table COACH from the database Gamers. Which
command will he use from the following:
a) DELETE FROM Coach;
b) DROP TABLE Coach;
c) DROP DATABASE Gamers;
d) DELETE Coach FROM Gamers; (1)
23 Mr. X is writing a program to create a TEXT file “MyText.txt” which contains user
name and password for all students in a school. The username and passwords writ-
ten in the file are separated by a space. The user name is of fixed length i.e. 4
characters and passwords are of length 8. He has written the following code to
check for verification of password and username. As a programmer, help him to
successfully execute the given task.
Chk1, Str = 0, “ “
f = ______________________ #line1
nm = input(“Ënter user name”)
pwd = input(“Enter password”)
while True:
Str = f.readline()
wd = Str.split()
unm = ______________ #line2
pswd = _____________ #line3
____________________ #line4
COMPUTER SCIENCE-(A) \ 5 \ 8
Section- II
34 Write a User defined function to take a dictionary D1 as argument. Where D1 has
Bookno as keyfield and a list containing bookname and price as value part. Transfer
all Book names to another list for those books whose price is more than 600. (3)
COMPUTER SCIENCE-(A) \ 7 \ 8
35 a) Write a function Count( ) in Python that counts the occurrences of lower case
vowels present in a text file “A1.TXT”.
If the contents of “A1.TXT” are as follows:
Class XII – Mid Term
Output - 3 (3)
OR
b) Write a function Count() in Python, which should should count and display the
occurrences of “The/ the/ THE” in a text file “Ä1.txt”
36 Write the outputs of the SQL queries (i) to (iii) based on the relations Teacher and
Posting given below: (3)
TABLE - Teacher
P_id T_ID Name Age Department Date_of_join Salary Gender
3 1 Jugal 34 Computer Sc 2017-01-10 12000 M
1 2 Sharmila 31 History 2008-03-24 20000 F
2 3 Sandeep 32 Mathematics 2016-12-12 30000 M
1 4 Sangeeta 35 History 2015-07-01 40000 F
2 5 Rakesh 42 Mathematics 2007-09-05 25000 M
1 6 Shyam 50 History 2008-06-27 30000 M
3 7 Shiv Om 44 Computer Sc 2017-02-25 21000 M
2 8 Shalakha 33 Mathematics 2018-07-31 20000 F
Table - Posting
P_id Department Place
1 History Agra
2 Mathematics Raipur
3 Computer Science Delhi
Table : Placement
P_id Department Place
1 History Agra
2 Math Mumbai
3 Computer Science Delhi
i. To show all information about the students of History department who were
born in the month of September.
ii. To list the number of female students in each city.
iii. To list the details of all students whose name ends with “Ä”with their DOB in
descending order.
iv. To display class wise average marks .
v. To display students name and department for each student.
COMPUTER SCIENCE-(A) \ 9 \ 8
40 Attempt I or II
I)
Write a menu driven program to perform the following operations. Write User
Defined Functions for each option: (1+1+3)
(i) Create a file - A1.txt
(ii) Display the file contents
(iii) To read a text file “A1.txt” and count how many lines are ending with “ing”.
OR
II
b) a) Write a menu driven program to perform the following operations. Write
User Defined Functions for each option: (1+1+3)
(i) Create a file.
(ii) Display the file contents
(iii) To read a text file “A1.txt” and count how many words are ending with “ing”.