Samplepaper UT1
Samplepaper UT1
SECTION - A
1 State True or False “Variable declaration is implicit in Python.” 1
a)Computer Science-@-2024@2025
b)Computer Science-@-2024-2025
c)Computer Science-2024-2025
d)Computer Science-@-2024-@2025
4 The __________clause of SELECT query allows us to select only those rows in the 1
results that satisfy a
specified condition.
(a) Where (b) from (c) having (d) like
1
5 Suppose a tuple T is declared as T = (10, 12, 43, 39), which of the following is 1
incorrect?
a) print(T[1])
b) T[2] = -29
c) print(max(T))
d) print(len(T))
6 Which is not a constraint in SQL? (a) Unique (b) Distinct (c) Primary key (d) Not Null 1
7 Which of the following function is used to find the joining date of a junior most 1
employee?
(a) MAX (Join_date) (b) MAXIMUM(Join_date)
(c) MINIMUM(Join_date) (d) MIN(Join_date)
8 What will the following expression be evaluated to in Python? 1
print(5+8/ 2**-2*2-6)
(a) 63.0 (b) - 6 3 . 0 (c) 0.0 (d) 63.5
9 To sort the result set in descending order, ___________ keyword is used with ORDER BY. 1
a) Descending
b) Sort
c) Desc
d) Des
SECTION – B
10 The code given below accepts five numbers and displays whether they are even or odd . 2
Observe the following code carefully and rewrite it removing all syntax and logical errors
for i range(5):
num=int(input('enter a number'))
if num/2=0:
print('even')
else:
print('odd')
11 Give the output of the below code:- 2
2
12 What do you meant by degree and cardinality with example 2
3
14 Write the output of the following python code: 3
Based on the given table, write SQL queries for the following:
i. To display NO, NAME, TDATE from the table TRIP in descending order of NO.
ii. To display the NO and NAME of those drivers from the table TRIP who travelled between
‘2015-02-10’ and ‘2015-04-01’.
iii. To display all the details from table TRIP in which the distance travelled is more than 100
KM in ascending order of NOP
16 a) Write outputs of SQL queries i) to iv) based on the relations VEHICLE and TRAVEL given 2+1
below:-
4
1. SELECT COUNT (*), VCODE FROM TRAVEL GROUP BY VCODE HAVING
COUNT (*) > 1;
2. SELECT DISTINCT VCODE FROM TRAVEL :
3. SELECT A.VCODE, CNAME, VEHICLETYPE FROM TRAVEL A, VEHICLE B
WHERE A. VCODE = B. VCODE and KM < 90;
4. SELECT CNAME, KM*PERKM FROM TRAVEL A, VEHICLE B WHERE
A.VCODE = B.VCODE AND A. VCODE =‘V05’;
(v)
5
Display the Bus_no,S_name ,S_type from the tables where address contains ‘h’
SECTION – E
18 a)Write a program to copy all the duplicate elements into “dup” list and unique elements to 2+2
“uniq” list from a list of integers
For Eg:
If list elements :[10,20,30,40,20,40,50,20,60]
Then output:
Unique List [10, 30, 50, 60]
Duplicate List [20, 40]
b)Write a program that accepts a dictionary contains name as key and the subject marks(s
subjects Eng,Phy,Comp) as value in the form of list. Display the student name and the
highest mark in the subject and the average
For eg:
If dictionary is
D={‘MATHEW’:[92,90,91],’AMAL’:[85,88,89],’MEENA’:[94,99,100]}
Then the output is
NAME HIGHEST AVERAGE
MATHEW 92 91.0
AMAL 89 87.33
MEENA 100 97.66