Skip to main content
1
What do you mean by Cardinality and Degree in a relation?
2
Write the name of five Open source RDBMS.
3
How would you troubleshoot if following problems occur on your computer?
(a)   Program runs slowly or isn’t working right
(b)   Program is completely unresponsive
(c)    Problems starting or shutting down the computer
(d)  Computer begins randomly rebooting or crashing
(e)   No sound/ speaker problem
4
Do as direction
(a)   100100  (convert into hexadecimal Number system)
(b)   101001  (convert into Octal Number system)
(c)    10011 (Convert into Binary Number system)
(d)  BD(16) (convert into Binary Number system) 
(e)   76(8) (convert into Decimal Number system)
5
Write name of any five Python programming language keywords.
6
How a comment is written in python language?
7
What will be value of a, b, and c after evaluation of these code?
a, b, c = 5, 10, 7
b, c, a = a + 1, b + 2, c - 1
print (a, b, c)
8
What will be result of x and y after evaluation?
x, y = 90, 562
x, y, x = x + 1, y - 10, x + 10
print(x, y)
7
From the following, find out which assignment statement will produce an error. State reason(s) too.
(a)   x = 550     (b) y = 0377     (c) z = 0o984          (d) 565thnumber = 340
8
Following code contains an endless loop. Could you find out why? Suggest a solution.
n = 8
answer = 1
while(n > 0):
        answer = answer + n ** 4
         n = n + 1
print (answer)
9
Consider the following Python program :
N= int(input(" enter a number"))
sum=0
i=1
while(i<=N):
    sum= sum +i
i= i+2
print(sum)
what is the output when the input value is 5?
10
Which of the following is not a python legal string operation and why?
(a)   ‘abc’ + ‘abc’         (b) ‘abc’ * 3          (c)   ‘abc’ + 3           (d) ‘abc’.lower()
11
What is the result of the following expression?
print('one', 'two' * 2)
print('one' + 'two' * 2)
print( len('0123456789') )
12
What is the result of the following expression?
s='9934246053'
print(s[-1], s[-3])
print(s[-3 : ], s[ : -3])
print(s[-100 : -3], s[-100 : 3])
13
What will be printed after execution of given code?
t1=['e','b','ae','iou','eru']
t1.sort()
print(t1)
14
Write the most appropriate list method to perform the following task.
(a)   Delete a given element from the list
(b)   Delete 3rd element from the list
(c)    Add an element in the end of the list
(d)  Add an element in the beginning of the list.
(e)   Add elements of a list in the end of a list
15
Predict the output
d=dict()
d['left']='<'
d['right']='>'
d['end']='blankspace'
print( d['left'] and d['right'] or d['right']and d['left'])
print( d['left'] and d['right'] or d['right']and d['left'] and d['end'])
print( (d['left'] and d['right'] or d['right']and d['left']) and d['end'])
print("end")
16
What will be the output produced by following code?
d1={4:"number", "b":"string",(34,6):"tuple"}
print("dictionary contents")
for x in d1.keys():
    print(x, ':', d1[x], end='')
    print(d1[x]*3)
    print(
17
Find out errors
my_dict={}
my_dict[(1,2,4)]=8
my_dict[[4,2,1]]=10
print(my_dict)
18
Create a dictionary whose keys are month names and whose values are the number of days in the corresponding months.
19
Write a program that asks the user to enter product names and prices. Store all of these in a dictionary whose keys are product names and whose values are the prices.
20
Is there any difference between dictionary and list? Explain with suitable example.
21
Define the following:
Primary key, Alternate key, Candidate key
22
Mr. Jai is responsible for setting up an inventory system in a supermarket. He creates a database table, INVENTORY, to store the information on product for sale.
INVENTORY
CAT
CODE
NAME
PRICE
QTY
Soap
S1034
Lux
30
20
Washing powder
Ws3421
Surf
50
100
Soap
S293
Pears
38
200
Noodle
N0943
Maggi
15
264
Snake
S452
Lays
20
287
            a)Which field CAT, CODE, NAME, PRICE, or QTY, should be used as a Primary key field?
b) Mr. Jai write the following SQL command based on the five given records in INVENTORY above,
what is the query result?
Select code, price from inventory where price > 25 and qty< 135;
c) Write command to create above table.
d) Display distinct name of cat as “Category”.
23
Write a program to print this pattern
1                                      *                                          1
12                                    **                                        22
123                                  ***                                      333
1234                                ****                                     4444
24
Write a program to find out odd numbers between 50 to 150.
25
Write a program to take input of a number and check whether it is even or not.
26
Write SQL query of following table structure ( Q.no. i to Q.no. vii )          
                                                            Relation : student
Code
Student_Name
Department
Year
sex
FYBE45
Raman Verma
Computer Science
Final year
M
SYBE23
Rupa
Electronics
Second year
F
SYBE27
Tamim Mahmud
Mechanical
Second Year
M
TYBE76
Yasmin
Computer science
Third Year
F
TYBE74
Gurmeet Kaur
Electronics
Third Year
F
(i) To display name and code of students of third year.
(ii) To display name, code and year of students of computer science department.
(iii) To display name, code department and year of all female students.
(iv) To count number of final year students from table student.
(v) To display details of all computer science female students.
(vi) To modify the department as “Computer Science” whose Student Name is “Rupa”;
(vii) To delete all the female students.
27
A dictionary contains details of two workers with their name as key and other details in the form of dictionary as value. Write a program to print the worker’s information in records format.          
Eg. Employee= {‘Ritika’ : {‘Age’ : 20, ‘salary’ : 20000}, ‘Rakhi’ : {‘Age’ : 25’, ‘salary’ : 25000} }
28
Write a function/ method to print a string in reverse order.                
29
Write a program with function/ method to print a List in reverse order.
30
Write a program to check whether a number is odd or even.
31
Write a program to print table of a number where number is entered by user.
32
Write a program to print all prime numbers between 50 to 150.
33
Write a program to print all odd numbers between 50 to 160.
34
Write a program to print all even numbers between 50 to 180

Comments