Aptitude Test Infosys
Aptitude Test Infosys
If a student has scored less than 50, his status must be shown as ‘FAIL’.
Otherwise, his mark must be displayed.
Tom:
Dick:
SELECT STUDENTID,CASE WHEN MARKS < 50 THEN 'FAIL' ELSE Marks
END AS STATUS FROM ASSESSMENT
Harry:
Dick
Harry
Tom
None of them
Q2 of 25
outlined_flag
Consider the following code written for creating the table:
CREATE TABLE ACCOUNT (ACCNO INT , ACCNAME VARCHAR(30) NOT
NULL,BALANCE );
outlined_flag
Tables course and student have 1-N relationship respectively. Cid is the
primary key of course table and Sid is the primary key of student table. To
which table the foreign key should be added?
Course
Cid
Cname
Student
Sid
Sname
Only Student
Only Course
Q4 of 25
outlined_flag
Rajesh created a table EMP in order to record employee details.
Select the right option for inserting a new row into the table.
outlined_flag
A table Employee has the following data:
2
Q6 of 25
outlined_flag
Consider the following statements with respect to a candidate key:
a. Candidate key identifies rows in a relation uniquely.
b. There can be only one candidate key in a relation.
c. A candidate key can be a combination of more than one attribute in a
relation.
Only a and c
Only a and b
only a
Only b and c
Q7 of 25
outlined_flag
Consider the below table SalesPerson:
Based on the output of the above query, identify the correct statement.
outlined_flag
Consider the following "employee" table and the code given below:
BEGIN
UPDATE Employee SET Salary=5000 WHERE EmpId = 1;
COMMIT;
UPDATE Employee SET Name='Dravid', Salary = 5000 WHERE EmpId = 3;
INSERT INTO Employee VALUES(3, 'Yuvraj', 2500);
EXCEPTION
WHEN OTHERS THEN
COMMIT;
END;
outlined_flag
Consider the tables vehtype and vehicle given below:
vehicle(id, vid, brand, model, price) with id being the primary key and
vid foreign key to the vehtype table.
Note: The only difference between the options is in the 'WHERE' clause.
SELECT brand FROM vehicle WHERE vid in (SELECT vid FROM vehtype HAVING
COUNT(vtype)>1);
SELECT brand FROM vehicle WHERE vid in (SELECT vid FROM vehtype GROUP BY vid
HAVING COUNT(vtype)>1)
SELECT brand FROM vehicle WHERE vid IN (SELECT vid FROM vehtype) HAVING
COUNT(vid)>1;
SELECT brand FROM vehicle WHERE vid in (SELECT vid FROM vehtype) GROUP BY
brand HAVING COUNT(vid)>1
Q10 of 25
outlined_flag
Consider the tables emp and dept given below:
outlined_flag
Consider the table toys given below:
A)
B)
C)
D)
D
Q12 of 25
outlined_flag
Consider the following relational schema along with functional dependencies:
D
Q13 of 25
outlined_flag
Cray Retail is a retail chain. They have a table in their database that has the
following data:
Three developers Tom, Dick and Harry are given the task of finding the
average salary of the employees in the company. They have been told that a
NULL in the salary column means that those employees should not be
considered.
outlined_flag
Consider a table named Measurement with the following structure and data;
What will be the value of p_Status when the procedure is executed with the
input set (v_Num1,v_Num2,v_Num3) = (1,3,6)
-4
NULL
-2
-3
Q15 of 25
outlined_flag
Consider the tables product and orders with the data as follows:
Choose the query which will generate the output given below:
outlined_flag
Consider the table broker given below:
Which of the following will be one of the rows in the output of the below SQL
query?
A.
B.
C.
D.
D
Q17 of 25
outlined_flag
Consider the below table named Destination:
DestId in the Travel table references the DestId of the Destination table using
a FOREIGN KEY.
Given the above details which of the following queries will execute
successfully.
Choose 2 CORRECT options.
DELETE FROM Destination where destId = 102
UPDATE Destination SET destId = 105 where destId = 103
DELETE FROM Destination where destId = 104
UPDATE Destination SET destId = 105 where destId = 102
Q18 of 25
outlined_flag
Consider the table Teacher given below:
How many rows will get updated when the below query is executed?
2
Q19 of 25
outlined_flag
Consider the tables given below:
A.
B.
C.
D.
D
Q20 of 25
outlined_flag
Consider the table products given below:
PC
PC <br> Printer
Laptop
Printer
Q21 of 25
outlined_flag
Consider the tables SUPPLIER and ORDERS given below:
Identify the query to fetch the details of all the suppliers along with order
details. Include the suppliers who haven't ordered any items also.
SELECT s.supplier_id, o.supplier_id, o.order_date FROM supplier s LEFT OUTER JOIN orders
o on s.supplier_id=o.supplier_id;
Q22 of 25
outlined_flag
Consider the tables customer and subscription given below:
SELECT customerName
FROM customer c JOIN subscription s ON s.customerId=c.customerId
WHERE s. customerId NOT IN
(SELECT customerId
FROM subscription GROUP BY customerId HAVING COUNT (customerId)
=
(SELECT MAX(COUNT(customerId)) FROM subscription GROUP
BY customerId));
Jack
Hary
Tom
Peter
Q23 of 25
outlined_flag
Consider the tables Bank, CustAccountDetails and AccountDetails given
below:
A.
B.
C.
D. No rows will be selected
D
Q24 of 25
outlined_flag
Consider the following tables:
SELECT B.BankName,AD.AccType,SUM(Balance)
FROM CustAccountDetails CA INNER JOIN Bank B ON CA.BankCode =
B.BankCode
INNER JOIN AccountDetails AD ON CA.AccId = AD.AccId
GROUP BY B.BankName,AD.AccType HAVING SUM(Balance) =
(SELECT MIN(SUM(Balance)) from custAccountDetails GROUP BY
BankCode,AccId);
A.
B.
C.
D.
C
D
Q25 of 25
outlined_flag
Consider following tables:
There is a requirement to display donor id, donor name of those donors who
donated the blood.
Also display the patient id who have received blood from these donors.
A.
B.
D
Test-II –Infy Programming
Question 1:
Given a string, find the substring based on following conditions,
1. The substring must be the longest one of all the possible substring in the given string.
2. There must not be any repeating characters in the substring.
3. If there is more than one substring satisfying the above two conditions, then print the
substring which occurs first.
4. Length of the substring must be minimum 3.
If there is no substring satisfying all the aforementioned conditions then print -1.
Question 2:
Given an array of integers, find the combination of integers forming a sequence which satisfies
the below conditions:
1.
1. The ith integer must satisfy the given equation in the sequence
(1)
Question 4 :Given a list of string and numbers, rotate the string by one position to the right if the
sum of squares of digits of the corresponding number is even and rotate it twice to the left if the
sum of the squares of the digits of the corresponding number is odd.
Question 5: Given an array, find the sub array which can be a square matrix with maximum
sum. If there are multiple results print the matrices in the order of their orders( i.e, 3×3 matrix
will be printed first, then 2X2…so on)
Question 6: Given an alphanumeric string, extract all numbers, remove the duplicate digits, and
from that set of digits construct the largest even number possible.
Question 7 :Given a mxn matrix select an element if the same element appears at 4 consecutive
position again. Return the minimum element from all the gathered elements. What is
consecutive? It’s horizontal, vertical and all possible diagonals.
Question 8: State whether a giving string contains matching braces or not. In case mismatch is
present then output the index of mismatch position.
Question 10: From a alphanumeric string extract all digits, From the smallest odd number with
no repeats.
Question 11:A simple String rotation type question where INPUT will be given in the form of
Dictionary and based on the value of the Dictionary the STRING should be rotated either
clockwise or anti-clockwise.
Question 12 It is based on matrix which i felt a bit difficult. We have to find the number which
occur consecutively 4 times either in a ROW, COLUMN, DIAGONAL and more importantly
REVERSE DIAGONAL. If there are multiple such elements find the minimum among them.If
there is no such element print “-1”.
Question 13: Ques 2: Given a string of brackets (, ), {, }, [, ], find the position in the string
where the orders of brackets breaks.
I/p: ())
O/p: 3
I/p: (){[]}(
O/p: 8
Question 14 Coding Task
Write a C program to print the first half of an array at last and last half of the array at first.
Input format:
Output Format:
Modified Array
Sample Input
If n = odd
12345
Expected Output:
45312
Sample Input
If n = even
146235
Expected Output:
235146
Write a program to remove the given word from the input string. If the substring is not present in
the input string, then print the input string as is.
Input Format:
Second line consists of the words which we want to remove from the given sentence.
Output Format:
Sample Input:
learning
Expected Output:
Question 17: Find longest substring of unique characters which is case insensitive.
Question 19: Reversing a string leaving the special characters in the same place.
Question 20: For a given list of numbers, find its factors and add the factors. Then if the sum of
factors is present in the original list, sort it and print it.
Example:
Input: 0,1,6
Output = 1,6
If the sum numbers are not present in original list, then return -1.
Question 21: Maximum number of swaps will be given and an list of digits will be given. We
have to swap numbers to get the lowest number possible by using all digits from the list.
Question 22: Input a matrix. Check if do we get the same number consecutively at least 4 times
in any fashion (Vertical, Horizontal, Diagonal). Record those sets.
• If we get such multiple sets then print the number which is the least one
• If we get such a single set then print the same number
• If we get such no set then print -1
Example1
133339
169239
122549
224579
245672
Sets we get here [3 3 3 3] horizontally in the first line, [9 9 9 9] vertically in the last column,[2 2
2 2] diagonally. Hence, we’ll print min(3,9,2) = 2 here.
Example2
1237
4558
6666
9134
Sets we get here [6 6 6 6] only horizontally in 3rd row. Hence, we’ll print 6 here.
Example3
Input m x n. Let’s take
1234
5678
9123
3214
Question 23: Input type String. Output type number. Print out the maximum even number which
can be generated by making combinations of numbers present in the given string. Each number
can be used only once ie. No Redundancy.
Example1
Example2
Output Number = -1
Question 24: Given m*n matrix where m defines number of rows and n defines number of
columns. Your job is to check whether a number is consecutive for 3 times either in row,
column, or diagonal. If there are more than one such numbers then print the minimum one.
Note : n = m+1
Input :
Output :
Integer
Sample Testcases :
I/P 1:
23456243
23476762
23555525
23112136
11119035
23115127
O/P 1 : 1
Question 25: Given a special set of numbers and a special sum. Find all those combinations
from the given set, equaling the given sum.
Input :
Output :
Combinations satisfying criteria
Sample Testcases :
I/P 1:
-1, 1, 0, 0, 2, -2
O/P 1
Explanation : Following combinations are satisfying (-1,1,2,-2), (0, 0, 1, -1), (0, 0, -2, 2)
Solution :
import itertools
l=list(map(int,input().split(",")))
s=int(input())
res=list(itertools.combinations(l,4))
c=0
for i in res:
u=sum(i)
if u == s:
c+=1
print(c)
Question 26: You are given a list of numbers from 1 to 9, in which each word is seperated by ‘,’.
Your job is to find the sum of two numbers. These two numbers are needed to be calculated as
per following rules :
Add all the numbers that do not come between 5 and 8 in the input.
2. Second number should be calculated as :
Append all the numbers to each other that comes between 5 and 8 (inclusive).
Input :
Output :
Sample Testcases :
I/P 1:
3,4,5,2,7,9,8,3,2
O/P 1:
52810
Solution :
lst = list(map(int,input().split(",")))
a = sum(lst[:lst.index(5)])
b = sum(lst[lst.index(8)+1:])
#finding first number
n1 = a+b
rest = lst[lst.index(5):lst.index(8)+1]
n2 = ""
for i in rest:
n2+=str(i)
print(int(n2)+n1)
Question 27: Given a row/column count and a matrix, your job is to find those possible
2*2 matrix where each should follow the given rule :
Input :
Output :
Sample Testcases :
I/P 1:
43
40 42 2
30 24 27
180 190 40
11 121 13
O/P 1:
40 42
30 24
30 24
180 190
24 27
190 40
Question 28: You are provided with a mathematical expression, your job is to solve this
expression.
Input :
Output : Result
Sample Testcases :
I/P 1:
(4+3)*(12/6)+100
O/P 1:
114
Solution :
exp=str(input())
res=int(eval(exp))
print(res)
Question 29: You are provided with a string of numbers, check whether it is a palindrome or
not. If it is not a palindrome, then, reverse the string, add it to the original string and check
again. You are required to repeat the process until it becomes palindrome. Find the length of
palindromic string.
Input :
Sample Testcases :
I/P 1:
O/P 1:
I/P 2:
145
O/P 2:
Explanation :
Given string is 145, it is not a palindrome. Reversing and adding, 145+541 = 686,
Hence it is a palindrome.
Solution :
def palincheck(num):
s=str(num[::-1])
if s==num:
return True
return False
n=(input())
val=0
k=0
while(True):
if(palincheck(n)):
val=len(n)
print(val)
break
else:
s1 = str(n[::-1])
k=int(n)+int(s1)
n=str(k)
palincheck(n)
Question 30: You will be given a string of characters and special characters, you task is
to reverse the string leaving special characters in same place.
Input :
Sample Testcases :
I/P 1:
dsd$^f#
O/P 1:
fds$^d#
Solution :
s=input()
d=dict()
res=””
for i in range(len(s)):
if s[i].isalnum()==False:
d.update({i:s[i]})
else:
res+=s[i]
res=list(res[::-1])
res.insert(i,j)
print(“”.join(res))
Question 31: You will be given a number in the form of string, extract out digits at odd
places, square & merge them. First 4 digits will be the required OTP.
Input :
ample Testcases :
I/P 1:
34567
O/P 1:
1636
Solution :
n=input()
s=””
i=0
for i in range(0,len(n)):
if int(i)%2==1:
s+=str(int(n[i])**2)
print(s[:4])
Question 32: For a given list of numbers, find its factors and add the factors. Then if the
sum of factors is present in the original list, sort it and print it else print -1.
Input :
Sample Testcases :
I/P 1:
1,2,4,7
O/P 1:
[1,4]
I/P 2:
2,4
O/P 2:
-1
Solution :
def findfactsum(n):
s=1
for j in range(2,n+1):
if n%j==0:
s+=j
return s
res=[]
l=list(map(int,input()))
for i in l:
val=findfactsum(i)
if val in l:
res.append(i)
if(len(res)==0):
print(“-1”)
else:
print(sorted(res))
Question 33: Find longest substring of unique characters which is case insensitive.
For “ABDEFGABEF”, the longest substring are “BDEFGA” and “DEFGAB”, with length
6.
Input :
Sample Testcases :
I/P 1:
CDEF
O/P 1:
Solution :
s=input()
s1=””
for i in range(len(s)):
if(s[i] in s1):
break;
else:
s1+=s[i]
print(len(s1))
Question 34: Given a string of random numbers, your job is to find the product of the
numbers(one is lesser and one is greater) who is already present in the string.
For instance, a pronic number is a number which is the product of two consecutive
integers, that is, a number of the form n(n + 1). Like 6 is the pronic number as 2*3 = 6.
Input :
Sample Testcases :
I/P 1:
123456
O/P 1:
[2,6,12]
I/P 2:
4567
O/P 2:
-1
Solution :
import itertools
list1=[]
s=str(input())
def pronic(s1):
set1=[]
set2=[]
for p in range(0,len(s1)-1):
a=int(s1[p])
b=int(s1[p+1])
mul=int(a*b)
mul=str(mul)
if mul in res:
set1.append(mul)
if (len(set1)==0):
print(“-1”)
else:
print(set1)
pronic((s))
Question 35: Given a string and it contains the digits as well as non-digits. We have to
find the largest even number from available digits after removing the duplicates. If not
possible, print -1.
Input :
Output :
Largest number
Sample Testcases :
I/P 1:
%#32%#%2
O/P 1:
32
I/P 2:
%#2373#@
O/P 2:
732
Solution :
def largeeven(lst):
if(res[-1]%2==0 or res[-1]==0):
return res
else:
for j in range(1,len(lst)+1):
if(res[-j]%2==0 or res[-j]==0):
ev=res.pop(-j)
res.append(ev)
return res
else:
return -1
s1=set()
s=str(input())
for i in s:
if i.isdigit():
s1.add(int(i))
res=sorted(s1,reverse=True)
print(largeeven(s1))
POSTED ON
Question 36: You are given a string of brackets (, ), {, }, [, ], your job is to find the position of
string where order of brackets breaks.
Input :
Output :
Sample Testcases :
I/P 1:
[(((())))][
O/P 1:
12
I/P 2:
{{]}()
O/P 2:
Solution :
s1=[]
op=[‘(‘,'{‘,'[‘]
cl=[‘)’,’}’,’]’]
def validate(s):
for i in range(len(s)):
if s[i] in op:
s1.append(s[i])
res=cl.index(s[i])
s1.pop()
else:
return (i+1)
if(len(s1)==0):
return 0
else:
return len(s)+1
s=str(input())
print(validate(s))
Question 37: Given a string s, find length of the longest prefix which is also suffix. The prefix
and suffix should not overlap.
Input :
Output :
“Length of prefix-suffix”
Sample Testcases :
I/P 1:
codeecode
O/P 1:
I/P 2:
wwwwww
O/P 2:
Solution :
def longestPreSuf(s) :
n = len(s)
prsf = [0] * n
l=0
i=1
while (i < n) :
if (s[i] == s[l]) :
l=l+1
prsf[i] = l
i=i+1
else :
if (l != 0) :
l = prsf[l-1]
else :
prsf[i] = 0
i=i+1
res = prsf[n-1]
if(res > n/2) :
return n//2
else :
return res
s = str(input())
print(longestPreSuf(s))
Question 38: You are provided two or more strings, where each string is associated with the
number (seperated by :). If sum of square of digits is even then rotate the string right by one
position, and if sum of square of digits is odd then rotate the string left by two position.
Input :
Output :
Rotated Strings.
Sample Testcases :
I/P 1 :
abcde:234,pqrs:246
O/P 1 :
cdeab
spqr
Explanation :
For first teststring, ‘abcde’ associated integer is 234, squaring 4+9+16=29, which is odd,
so we rotate string left by two positions. For second teststring, ‘spqr’ associated integer
is 246, squaring 4+16+36=56, which is even, so we rotate string right by one position.
Solution :
s=input().split(“,”)
sa=[]
num=[]
for i in s:
s1,n=i.split(“:”)
sa.append(s1)
num.append(n)
def rotate(s2,n):
n=list(str(n))
s=0
for i in n:
s+=int(i)**2
if s%2==0:
else:
for i in range(len(num)):
print(rotate(sa[i],num[i]))
Test-III –Infy Pythom MCQ
1.Python was invented by :
GV Rossum
Dennis Ritchie
Bjarne Stroustrap
James Gosling
a = 8.3
b=2
print a//b
4.15
4
4.1
4.0
s='pythonn'
print(s[0:7:2])
pythonn2
pythonn
pton
2
l = ["one","two","three"]
s = "-".join(l)
print(s)
Type Error : join() not applicable for lists
[one-two-three]
one-two-three
-one-two-three-
l = [10,20,30]
print(l*2)
[10,20,30,10,20,30]
[20,40,60]
10 20 30 10 20 30
10 20 3010 20 30
15.Which of the following method does not work with list ?
push()
pop()
extend()
None of the above
16.Predict the output of following code :
s = set("code of geeks")
print(s.difference("geeks "))
8
{'c', 'o', 'f', 'd', ' '}
{'c', 'o', 'f', 'd'}
{'g', 'e', 'k', 's'}
s = set("code of geeks")
print(s.intersection("geeks "))
Error : Operation Intersection not defined
{'g', 'e', 'k', 's', ' '}
{'k', 'o', 'g', 'd', 'f', 'e', 's', ' ', 'c'}
None of these
r = lambda g: g * 2
s = lambda g: g * 3
x=2
x = r(x)
x = s(x)
x = r(x)
x = s(x)
print(x)
4
24
72
Compilation Error
19.Identify the line which has error :
a=1
s=1
for i in (2,3,5):
s=a++
print(s)
2
3
4
5
20.s1 = {2,3,4,5}
s1[2] = 3
print(s1)
import re
s = ‘s’
x = re.search(‘a’,s)
print(x.start())
1
2
4
No error
print('code'.replace('cde', '1'))
1
cde
code
Error : String 'cde' not present in original string
def int():
print("CODE")
int
int()
Unknown reference to 'int'
Error : int can't be a variable name
CODE
None of these
26.Decorators generally starts with :
!
@
$
#
27.Which of the following expressions can be used to multiply a given number ‘a’
by 4?
a>>2
a>>4
a<<4
a<<2
sum(2,4,23)
sum({1,2,7})
29 10
29 Error
Error 10
None of these
def outer():
global glo
glo = 20
def inner():
global glo
glo = 30
print(glo)
glo = 10
outer()
print( glo)
10
20
30
None of these
dicts = dict()
for l in enumerate(range(2)):
dicts[l[0]] = l[1]
dicts[l[1]+7] = l[0]
print(dicts)
{0:0, 1:1, 2:1, 3:0}
{0:0, 1:1, 8:1, 7:0}
Error : Dictionary index can not be modified
None of These
31.Which dictionary method returns an object that contains key-value pairs of
dictionary ?
items()
keys()
elements()
element()
int = 1
def randommethod():
global int
for i in (1, 2, 3):
int += 1
randommethod()
print(int)
Compile Time Error
1
Type Error
4
class stud:
def __init__(self, roll_no, grade):
self.roll_no = roll_no
self.grade = grade
def display (self):
print("Roll no : ", self.roll_no, ", Grade: ", self.grade)
stud1 = stud(28, ‘acode’)
stud1.age=24
print(hasattr(stud1, 'age'))
28
Error
24
None of these
List = ['code','of','codeofgeeks']
print(List[2][-6])
codeofgeeks
f
Error - Unidentified operation on List
o
lst = [1, 2, 3]
lst.append([5,6,7,8,9,10])
print(len(lsts))
3
9
4
Error
print(bool)
print(bool())
True
Error True
False
Error False
key = 100
try:
key = key/0
except ZeroDivisionError:
print('Hacked ', end = '')
else:
print('Division successful ', end = '')
try:
key = key/5
except:
print('Hacked 1 ', end = '')
else:
print('Coder', end = '')
Hacked Coder
Hacked Hacked1
Hacked Coder Hacked1
None of these
dig = 0
for i in range(0, 5, 0.1):
dig += i
i+=0
print(dig)
5
0.1 + 0.2 + ........ + 4.99
0.1 + 0,2 + ........ + 4.00
Error
s= 'codeofgeeks'
for i in range(len(s)):
s[i].upper()
print (s)
Codeofgeeks
codeofgeeks
CODEOFGEEKS
Type Error
import re
s = "code of geeks code of geeks code of geeks"
x = re.sub("geeks","god",s,2)
print(x)
code of geeks code of god code of geeks
code of god code of god code of geeks
code of geeks code of geeks code of god
Runtime Error
49.It removes the key ‘k’ and its value from ‘dict’.
dict.remove(k,v)
dict.pop(k,v)
dict.delete(k,v)
dict.erase(k,v)
Answers of above 1-50 questions
a = 8.3
b=2
print a//b
Answer Provided:
Correct Answer: 4.0
s='pythonn'
print(s[0:7:2])
Answer Provided:
Correct Answer: pton
l = ["one","two","three"]
s = "-".join(l)
print(s)
Answer Provided:
Correct Answer: one-two-three
l = [10,20,30]
print(l*2)
Answer Provided:
Correct Answer: [10,20,30,10,20,30]
s = set("code of geeks")
print(s.intersection("geeks "))
Answer Provided:
Correct Answer: {'g', 'e', 'k', 's', ' '}
r = lambda g: g * 2
s = lambda g: g * 3
x=2
x = r(x)
x = s(x)
x = r(x)
x = s(x)
print(x)
Answer Provided:
Correct Answer: 72
a=1
s=1
for i in (2,3,5):
s=a++
print(s)
Answer Provided:
Correct Answer:
s1 = {2,3,4,5}
s1[2] = 3
print(s1)
import re
s = ‘s’
x = re.search(‘a’,s)
print(x.start())
Answer Provided:
Correct Answer: No error
print('code'.replace('cde', '1'))
Answer Provided:
Correct Answer: code
def int():
print("CODE")
int
int()
Answer Provided:
Correct Answer: CODE
Which of the following expressions can be used to multiply a given number ‘a’ by
4?
Answer Provided:
Correct Answer: a<<2
Find the value returned in both case :
sum(2,4,23)
sum({1,2,7})
Answer Provided:
Correct Answer: Error 10
def outer():
global glo
glo = 20
def inner():
global glo
glo = 30
print(glo)
glo = 10
outer()
print( glo)
Answer Provided:
Correct Answer: 20
dicts = dict()
for l in enumerate(range(2)):
dicts[l[0]] = l[1]
dicts[l[1]+7] = l[0]
print(dicts)
Answer Provided:
Correct Answer: {0:0, 1:1, 8:1, 7:0}
int = 1
def randommethod():
global int
for i in (1, 2, 3):
int += 1
randommethod()
print(int)
Answer Provided:
Correct Answer: 4
class stud:
def __init__(self, roll_no, grade):
self.roll_no = roll_no
self.grade = grade
def display (self):
print("Roll no : ", self.roll_no, ", Grade: ", self.grade)
stud1 = stud(28, ‘acode’)
stud1.age=24
print(hasattr(stud1, 'age'))
Answer Provided:
Correct Answer: Error
List = ['code','of','codeofgeeks']
print(List[2][-6])
Answer Provided:
Correct Answer: f
lst = [1, 2, 3]
lst.append([5,6,7,8,9,10])
print(len(lsts))
Answer Provided:
Correct Answer: Error
print(bool)
print(bool())
Answer Provided:
Correct Answer: False
key = 100
try:
key = key/0
except ZeroDivisionError:
print('Hacked ', end = '')
else:
print('Division successful ', end = '')
try:
key = key/5
except:
print('Hacked 1 ', end = '')
else:
print('Coder', end = '')
Answer Provided:
Correct Answer: Hacked Coder
dig = 0
for i in range(0, 5, 0.1):
dig += i
i+=0
print(dig)
Answer Provided:
Correct Answer: Error
int = 1
def randommethod():
global int
for i in (1, 2, 3):
int += 1
randommethod()
print(int)
Answer Provided:
Correct Answer: 4
s= 'codeofgeeks'
for i in range(len(s)):
s[i].upper()
print (s)
Answer Provided:
Correct Answer: codeofgeeks
import re
s = "code of geeks code of geeks code of geeks"
x = re.sub("geeks","god",s,2)
print(x)
Answer Provided:
Correct Answer: code of god code of god code of geeks
class ClassA:
def _init_(self, val1) :
self.value = val1
def method_a(self) :
return 10+self.value
class ClassB:
def _init_(self, val2):
self. num=val2
def method_b(self, obj):
return obj.method_a()+self.num
obj1=ClassA(20)
obj2=ClassB(30)
print(obj2.method_b(obj1))
a) 60
b) 50
c) 30
d) 40
2) Consider the relational schema along with the functional dependencies given below:
a) 2
b) 4
c) 3
d) 1
i) h(key) = key%10
ii) h(key) = key%25
iii) h(key) = key%50
Which of the hashing methods would NOT lead to collision when the following values are to be stored in
the hash tablé?
a) Only
b) Both ii) and iii)
c) Both i) and iii)
d) All i), ii) and iii)
4) Number 14 needs to be searched using BINARY SEARCH in the following sorted list of numbers:
1, 3, 7.9, 14, 19, 45
How many comparisons will be required to conclude that the number 14 is found at the 5th position?
Note: We have used integer division for finding the middle element and the index starts with 0 (zero)
a) 2
b) 3
c) 4
d) 1
5) Consider a Patient table with attributes patientid (primary key), patientname, city, dateofbirth, and
phone. Except patientid no columns are unique. The table has three indexes as follows:
IDX1 – patientid
IDX2 – patientname, dateofbirth
IDX3 – gateofbirth, phone
Which of the following queries will result in INDEX UNIQUE SCAN?
Q6
What gets printed? name = "snow storm" name[5] = 'X' print name
Ans D
A) snow storm
B) snowXstorm
C) snow Xtorm
D) ERROR, this code will not run
Q7
What gets printed? var = 100 if ( var == 100 ) : print "Value of expression is 100"
Ans C
• A) Nothing
• B) An Error
• C) Value of expression is 100
• D) NONE
Ans:- D
Q8
What is the output of the following Python program? num1 = 5 if num1 >= 91: num2 = 3 else: if num1
< 6: num2 = 4 else: num2 = 2 x = num2 * num1 + 1 print (x,x%7)
Ans B
• A) 21 3
• B) 21 0
• C) 21 21
• D) NONE
Q9
slicing operations can be used on strings as well?
Ans A
• A) True
• B) False
Q10
Ans A
• A) True
• B) False
Q11
Ans A
• A) 1234
• B) abcd
• C) u04d2
• D) None of the above
Q12
Ans B
• A) Back Index Format
• B) Built In Functions
• C) Bored Inline Functions
• D) Boost Index File
Q13
Which of these is not a core datatype?
Ans C
• A) Lists
• B) Dictionary
• C) Tuples
• D) Class
Q14
9.
What gets printed? a = 10 b = 2 print a if b else 0
Ans A
• A) 10
• B) 2
• C) 0
• D) Error
Q15
Ans C
• A) TXT
• B) DAT
• C) PY
• D) JAVA
Q16
What gets printed? def myfunc(x, y, z, a): print x + y nums = [1, 2, 3, 4] myfunc(*nums)
Marks B
• A) 1
• B) 3
• C) 4
• D) 5
Q17
What gets printed? if False: print('Hi') elif True: print('Hello') else: print('Howdy')
Ans V
• A) Nothing
• B) Hi
• C) Hello
• D) Howdy
Q18
Ans B
• A) The text, "hello world" in one line
• B) The text, "helloworld" in one line
• C) "hello" in one line and "world" in the next line
• D) Syntax Error. This Python program will not run.
Q19
Ans B
• A) 5 10
• B) 1 2 3 4 5
• C) [(0, 0), (1, 1), (2, 2), (3, 3), (4, 4)]
• D) 0, 0, 1, 1, 2, 2, 3, 3, 4, 4
Q20
What gets printed? def addItem(listParam): listParam += [1] mylist = [1, 2, 3, 4] addItem(mylist) print
len(mylist)
Ans D
• A) 1
• B) 3
• C) 4
• D) 5
Q21
Ans C
• A) Howdy
• B) Nothing
• C) An Error
• D) 10
Q22
What gets printed? def dostuff(param1, *param2): print type(param2) dostuff('apples', 'bananas',
'cherry', 'dates')
Ans C
• A) str
• B) int
• C) tuple
• D) list
Q23
Ans A
• A) True
• B) False
Q24
What sequence of numbers is printed? values = [1, 2, 1, 3] nums = set(values) def checkit(num): if
num in nums: return True else: return False for i in filter(checkit, values): print i
Ans B
• A) 1 2 3
• B) 1 2 1 3
• C) 1 2 13 1 2 1 3
• D) Error
Q25
Ans B
• A) hi
• B) true
• C) false
• D) nothing
Test IV
Q1. Look at this series: 12, 11, 13, 12, 14, 13, Q2. Look at this series: 36, 34, 30, 28, 24, … What
… What number should come next? number should come next?
A. 10 A. 22
B. 16 B. 26
C. 13 C. 23
D. 15 D. 20
Q3 Look at this series: 7, 10, 8, 11, 9, 12, … Q4. Look at this series: 2, 1, (1/2), (1/4), … What
What number should come next? number should come next?
A. 7 A. (1/3)
B. 12 B. (1/8)
C. 10 C. (2/8)
D. 13 D. (1/16)
Q5. Look at this series: 80, 10, 70, 15, 60, … Q6. Which word does NOT belong with the others?
What number should come next? A. index
A. 20 B. glossary
B. 25 C. chapter
C. 30 D. book
D. 50
Q7. Which word is the odd man out? Q8. Which word does NOT belong with the others?
A. trivial A. wing
B. unimportant B. fin
C. important C. beak
D. insignificant D. rudder
Q9. Which word is the odd man out? Q10. Pick the odd man out?
A. hate A. just
B. fondness B. fair
C. liking C. equitable
D. attachment D. biased
Q11. CUP : LIP :: BIRD : ? Q12. Paw : Cat :: Hoof : ?
A. GRASS A. Lamb
B. FOREST B. Horse
C. BEAK C. Elephant
D. BUSH D. Tiger
Q13. Safe : Secure :: Protect : Q14. Melt : Liquid :: Freeze :
A. Lock A. Ice
B. Guard B. Solid
C. Sure C. Condense
D. Conserve D. Push
Q15. Parts : Strap :: Wolf : Q16. An Informal Gathering occurs when a group
A. Flow of people get together in a casual, relaxed manner.
B. Animal Which situation below is the best example of an
C. Wood Informal Gathering?
D. Fox
A. A debating club meets on the first Sunday
morning of every month.
B. After finding out about his salary raise, Jay and a
few colleagues go out for a quick dinner after
work.
C. Meena sends out 10 invitations for a
bachelorette party she is giving for her elder sister.
D. Whenever she eats at a Chinese restaurant,
Roop seems to run into Dibya.
Q17. A Tiebreaker is an additional contest Q18. The Sharks and the Bears each finished with
carried out to establish a winner among tied 34 points, and they are now battling it out in a
contestants. Choose one situation from the five-minute overtime.
options below that best represents a
Tiebreaker. A. When he is offered a better paying position,
Jacob leaves the restaurant he manages to
A. At halftime, the score is tied at 2-2 in a manage a new restaurant on the other side of
football match. town.
B. Serena and Maria have each secured 1 set B. Catherine is spending her junior year of college
in the game. studying abroad in France.
C. The umpire tosses a coin to decide which C. Malcolm is readjusting to civilian life after two
team will have bat first. years of overseas military service.
D. RCB and KKR each finished at 140 all out. D. After several miserable months, Sharon decides
that she can no longer share an apartment with
her roommate Hilary.
Q19. Reentry occurs when a person leaves Q20. Posthumous Award occurs when an award is
his or her social system for a period of time given to someone, after their death. Choose one
and then returns. Which situation below situation below as the best example of
best describes Reentry? Posthumous Award.
A. When he is offered a better paying A. Late yesteryear actress Sridevi was awarded
position, Javed leaves the hotel he manages with a Lifetime Achievement Award posthumously
to manage another one in a neighboring city. in Filmfare 2019.
B. Charan is spending her final year of B. Chitra never thought she’d live to receive a third
college studying abroad in China. booker prize for her novel.
C. Manan is readjusting to civilian life after 2 C. Emanuel has been honored with a prestigious
years of overseas merchant navy service. literary award for his writing career and his
D. After 5 miserable months, Sneha decides daughter accepted the award on behalf of her
that she can no longer share her room with deceased father.
roommate Hital. D. Meenal’s publisher canceled her book contract
after she failed to deliver the manuscript on time.
Test V
Q1. The ‘A’ state government has chalked Q2. The car dealer found that there was a
out a plan for the underdeveloped ‘B’ district tremendous response for the new XYZ’s car
where 66% of the funds will be placed in the booking with long queues of people complaining
hands of a committee of local about the duration of business hours and
representatives. arrangements. Courses of action:
Courses of action: I. People should make their arrangement of lunch
I. The ‘A’ state government should decide and snacks while going for car XYZ’s booking and
guidelines and norms for the functioning of be ready to spend several hours.
the committee. II. Arrangement should be made for more booking
II. Other state government may follow desks and increase business hours to serve more
similar plan if directed by the Central people in less time.
government.
A. If only I follows
A. If only I follows B. If only II follows
B. If only II follows C. If either I or II follows
C. If either I or II follows D. If neither I nor II follows
D. If neither I nor II follows E. If both I and II follow
E. If both I and II follow
Q3. The ‘M’ state government has decided Q4. lert villagers nabbed a group of bandits armed
hence forth to award the road construction with murderous weapons. Courses of action:
contracts through open tenders only. I. The villagers should be provided sophisticated
Courses of action: weapons.
I. The ‘M’ state will not be able to get the II. The villagers should be rewarded for their
work done swiftly as it will have to go courage and unity.
through tender and other procedures.
II. Hence forth the quality of roads A. If only I follows
constructed may be far better. B. If only II follows
C. If either I or II follows
A. If only I follows D. If neither I nor II follows
B. If only II follows E. If both I and II follow
C. If either I or II follows
D. If neither I nor II follows
E. If both I and II follow
Q5. 10 coaches of a passenger train have got Q6. If a legislature decides to fund agricultural
derailed and have blocked the railway track subsidy programs, national radio, and a small
from both ends. Courses of action: business loan program, what 2 other programs can
I. The railway authorities should immediately they fund?
send men and equipment and clear the spot
II. All the trains running in both directions A. harbor improvements and school music
should be diverted immediately via other program
routes. B. harbor improvements and international airport
C. hurricane preparedness and international
A. If only I follows airport
B. If only II follows D. hurricane preparedness and school music
C. If either I or II follows program
D. If neither I nor II follows E. harbor improvements and hurricane
E. If both I and II follow preparedness
Q7. Statement: Anger is energy, in a more Q8. Statement: Medicine ‘P’ is a drug which is
proactive way and how to channelize it is in causing ripples in the medical field.
itself a skill. Assumptions: I. No other drug is causing ripples in
Assumptions: I. Anger need to be the medical field.
channelized. II. Medicine ‘P’ is a great drug.
II. Only skillful people can channelize anger
to energy. A) If only assumption I is implicit.
B) If only assumption II is implicit.
A) If only assumption I is implicit. C) if either I or II is implicit.
B) If only assumption II is implicit. D) if neither I or II is implicit.
C) if either I or II is implicit. E) if both I and II are implicit.
D) if neither I or II is implicit.
E) if both I and II are implicit.
Q9. A train 110 m long is running with a Q10. A, B, and C started a business with capitals of
speed of 60 km/hr. At what time will it pass Rs. 8000, Rs. 10000, and Rs. 12000 respectively. At
a man who is running at 6 km/hr in the the end of the year, the profit share of B is Rs.
direction opposite to that in which the train 1500. The difference between the profit shares of
is going? A and C is?
a)5 sec a.Rs. 300
b)6 sec b.Rs. 400
c)7 sec c.Rs. 500
d)10 sec d.Rs. 600
e.None of these
Q11.If Rs. 510 be divided among A, B, C in Q12. The current of a stream runs at the rate of 4
such a way that A gets 2/3 of what B gets, kmph. A boat goes 6 km and back to the starting
and B gets 1/4 of what C gets, then their point in 2 hours, then find the speed of the boat in
shares are respectively? still water?
a) Rs. 120, Rs. 240, a)10 kmph
b) Rs. 150Rs. 60, Rs. 90, b)21 kmph
c) Rs. 360Rs. 150, Rs. 300, Rs. 60 c)8 kmph
d) None of these d)12 kmph
Q13. In how much time would the simple Q14Find the cost of fencing around a circular field
interest on a certain sum be 0.125 times the of diameter 28 m at the rate of Rs.1.50 a meter?
principal at 10% per annum? a)Rs.150
a) 1 1/4 years b)Rs.132
b) 1 3/4 years c)Rs.100
c) 2 1/4 years d)Rs.125
d) 2 3/4 years
Q15. A pupil’s marks were wrongly entered Q16. The H.C.F of two numbers is 11, and their
as 83 instead of 63. Due to the average L.C.M is 7700. If one of the numbers is 275, then
marks for the class got increased by half. The the other is?
number of pupils in the class is? a)279
a)10 b)283
b)20 c)308
c)40 d)318
d)73
Q17. If the sum of the two numbers is 22 Q18. Three pipes A, B and C can fill a tank from
and the sum of their squares is 404, then the empty to full in 30 minutes, 20 minutes and 10
product of the numbers is? minutes respectively. When the tank is empty, all
a)40 the three pipes are opened. A, B and C discharge
b)44 chemical solutions P, Q and R respectively. What is
c)80 the proportion of solution R in the liquid in the
d)88 tank after 3 minutes?
a)5/11
b)6/11
c)7/11
d)8/11
Q19. The principle that amounts to Rs. 4913 Q20. The radius of a wheel is 22.4 cm. What is the
in 3 years at 6 1/4 % per annum C.I. distance covered by the wheel in making 500
compounded annually, is? resolutions?
a)Rs. 3096 a) 252 m
b)Rs. 4076 b) 704 m
c)Rs. 4085 c) 352 m
d)Rs. 4096 d) 808 m
e) None of these
https://www.allindiajobs.in/2015/11/infosys-placement-papers-2016.html
Test 6
1. Jake left point A for point B. 2 hours and 15 2. A completes a work in 2 days, B in 4 days, C in 9
minutes later, Paul left A for B and arrived at B at and D in 18 days. They form group of two such
the same time as Jake. Had both of them started that difference is maximum between them to
simultaneously from A and B travelling towards complete the work. What is difference in the
each other, they would have met in 120 minutes. number of days they complete that work?
How much time (hours) did it take for the slower
one to travel from A to B if the ratio of speeds of
the faster to slower is 3:1?
3. . How many 4 digit numbers contain number 2. 4. How many three digit numbers abc are formed
a. 3170 b. 3172 c. 3174 d. 3168 where at least two of the three digits are same.
5. How many kgs of wheat costing Rs.24/- per kg 6. What is the next number of the following
must be mixed with 30 kgs of wheat costing sequence 7, 14, 55, 110, ....?
Rs.18.40/- per kg so that 15% profit can be
obtained by selling the mixture at Rs.23/- per kg
9. There are 1000 junior and 800 senior students in 10. 161?85?65?89 = 100, then use + or - in place of
a class.And there are 60 sibling pairs where each ? and take + as m,- as n then find value of m-n
pair has 1 junior and 1 senior. One student is
chosen from senior and 1 from junior
randomly.What is the probability that the two
selected students are from a sibling pair?
11. In a cycle race there are 5 persons named as 12. Rahul took a part in cycling game where 1/5
J,K,L,M,N participated for 5 positions so that in ahead of him and 5/6 behind him excluding him.
how many number of ways can M finishes always Then total number of participants are:
before N?
13. If a refrigerator contains 12 cans such that 7 14. There are 16 people, they divide into four
blue cans and 5 red cans. In how many ways can groups, now from those four groups select a team
we remove 8 cans so that atleast 1 blue can and 1 of three members,such that no two members in
red can remains in the refrigerator. the team should belong to same group.
15. How many five digit numbers are there such 16. 7 people have to be selected from 12 men and
that two left most digits are even and remaining 3 women, Such that no two women can come
are odd and digit 4 should not be repeated. together. In how many ways we can select them?
17. Tennis players take part in a tournament. Every 18. Find the unit digit of product of the prime
player plays twice with each of his opponents. number up to 50 .
How many games are to be played?
19. If [x^(1/3)] - [x^(1/9)] = 60 then find the value 20. A family X went for a vacation. Unfortunately it
of x. rained for 13 days when they were there. But
whenever it rained in the mornings, they had clear
afternoons and vice versa. In all they enjoyed 11
mornings and 12 afternoons. How many days did
they stay there totally?
1. 125 small but identical cubes are put together to form a large cube. This large cube is now
painted on all six faces.
(i) How many of the smaller cubes have (ii) How many of the smaller cubes have exactly
no face painted at all. three faces painted?
(a) 27
(a) 98
(b) 64
(b) 100
(c) 8
(c) 96
(d) 36
(d) 95
(a) 4
(b) 8
(c) 9
(d) 27
2. Directions : Study the following information and answer the question given below: In a certain code,
the symbols for 0 (zero) is @ and for 1 is $. There are no other symbols for all other number greater than
one. The numbers greater than 1 are to be written only by using the two symbols given above. The value
of the symbol for 1 doubles itself every time it shifts one place to the left. Study the following examples:
‘0’ is written as @, ‘1’ is written as #, ‘2’ is written as #, @‘3’ is written as # # ‘4’ is written as #@@ and
so on
(a) #@@@
(b) ###@
(c) ##@@
(d) ##@#
a) 2367 a)5
b) 2451 b)3
c) 2531 c)8
d) 2489 d)9
5. Census population of a district in 1981 was 4.54 6. Based on the statement in the question, mark
Lakhs, while in year 2001 it was 7.44 Lakhs. What the most logical pair of statement that follow
was the estimated mid-year population of that "Either he will shout or they will fire".
district in year 2009.
(1) He shouted.
d)5.9 Lacs
(a) 1,4
(b) 2,3
(c) 4,1
7. Gautham passes through seven lane to reach his school. He finds that YELLOW lane is between his
house and KAMA lane. The third lane from his school is APPLE lane. PEACOCK lane is immediately before
the PARK lane. He passes ASH lane at the end. KAMA lane is between YELLOW lane and PEACOCK lane.
The sixth lane from his house is RAO lane.
I. How many lane are there between KAMA lane II. After passing the park lane how many lane does
and RAO lane ? Gautham cross to reach the school ?
a) one a) 4
b) two b) 3
c) three c) 2
d) four d) 1
III. After passing the YELLOW lane how many lane IV. Which lane is between PARK lane and RAO lane
does Gautham cross to reach the school ? ?
a) YELLOW lane
a) 4 b) KAMA lane
b) 6 c) APPLE lane
c) 2 d) PEACOCK lane
d) 1
a) 18 min
b) 16 min
c) 14 min
d) 12 min
8. Find the maximum value of n such that 50! is 9. Find the no of ways in which 6 toffees can be
perfectly divisible by 2520^n . distributed over 5 different people namely
A,B,C,D,E.
a) 8
b) 9
c) 4
d) 5
10. A train covered a distance at a uniform speed 11. A girl leaves from her home. She first walks 30
.if the train had been 6 km/hr faster it would have metres in North-west direction and then 30 metres
been 4 hour less than schedule time and if the in South-west direction. Next, she walks 30 metres
train were slower by 6 km/hr it would have been 6 in South-east direction. Finally, she turns towards
hrs more.find the distance. her house. In which direction is she moving?
a) 720 Km Option
b) 830 Km
c) 1000Km
d) 540 Km
A) North-east
B) North-west
C) South-east
D) South-west
E) None of these
12. There are two containers on a table. A and B. 13. Four persons A,B,C,D were there. All were of
A is half full of wine, while B,which is twice A's size, different weights. All Four gave a statement.
is one quarter full of wine. Both containers are Among the four statements only the person who is
filled with water and the contents are poured into lightest in weight of all others gave a true
a third container C. What portion of container C's statement.
mixture is wine?
14. There is well of depth 30 m and frog is at 15. Find the next term in the given series 47, 94,
bottom of the well. He jumps 3 m in one day and 71, 142, 119, 238, _ ?
falls back 2 m in the same day. How many days will
it take for the frog to come out of the well? a) 331
a) 26 days b) 360
b) 27 days c)320
c) 28 days d)340
d) 29 days
16. A train leaves Meerut at 5 a.m. and reaches 17. ‘A’ and ‘B’ started a business in partnership
Delhi at 9 a.m. Another train leaves Delhi at 7 a.m. investing Rs 20000/- and Rs 15000/- respectively.
and reaches Meerut at 10.30 a.m. At what time do After six months ‘C’ jointed them with Rs 20000/-.
the two trains travel in order to cross each other ? What will be B’s share in the total profit of Rs
25000/- earned at the end of two years from the
starting of the business?
a) 7.56 am
b) 8.56 am
c) 5.56 am a) 7500
d) 4.56 am b) 5500
c) 4500
d) 6500
a) p=17 a) 6
b) q=18 b) 4
c) r=18
c) 8
d) s=17 d) 2
Solution Link : http://www.alpingi.com/wp-content/uploads/2016/04/Infosys-Placement-Paper-2.pdf
Test 8
a) 56 b) u
b) 58
c) 57 c) t
d) 59
d) l
3. What is the next number in the series 4. Data Sufficiency Question: Is w a Whole
3,7,13,19... number?
Statement 1: 3w is an Odd number.
a) 39 Statemet 2: 2w is an Even number
b) 29
c) 49
d) 59
a) Only A statement is enough
b) Only B statement is enough
c) Both A and B are required
d) Neither A or B is sufficient
5. Joe's age, Joe's sister's age and Joe’s 6. The sum of series represented as
fathers age sums up to a century. When
son is as old as his father, Joe's sister will 1/(1×5)+1/(5×9)+1/(9×13)+−−−−+1/(221×225) is: :
be twice as old as now. When Joe is as old
as his father then his father is twice as old
as when his sister was as old as her
father.Age of her father ? a) 28/221
b) 56/221
a) 50
b) 60 c) 56/225
c) 70
d) None of these
d) Data insufficient
7. What are the next three terms in the 8. What is the next number in the series. a, b, d, h,
series 3, 6, 7, 12, 13, 18, 19, 24, _ _ _? _?
a) 26,31,32
a=1,b=2,c=3……z=26.
b)25,30,31
c)27,32,33
a) q
d)24,29,30 b) p
c) r
d) s
9.The number of zeros at the end of the product of 10. A train goes from stations A to B. One day
all prime numbers between 1 and 1111 is? there is a technical problem at the very beginning
of the journey & hence the train travels at 3/5 of
it's original speed and so it arrives 2 hours late.
a)11 Had the problem occurred after 50 miles had been
covered, the train would have arrived 40 min
b)111 earlier(i.e., only 120-40 = 80 min late). What is the
distance between the 2 stations?
c)1
d)111.1
a)150 miles
b)120 miles
c)160 miles
d)100 miles
11. Due to some defect in our elevator, I was 12. In the Garbar Jhala, Ahmadabad a shopkeeper
climbing down the staircase. I’d climbed first raises the price of Jewellery by x% then he
down just 7 steps when I saw a man on the decreases the new price by x%. After one such up
ground floor. Continuing to walk down, I down cycle, the price of a Jewellery decreased by
greeted the man and I was surprised to see Rs. 21025. After a second updown cycle the
that when I was yet to get down 4 steps to jewellery was sold for Rs. 484416. What was the
reach the ground floor, the man had already original price of the jewellery.
finished climbing the staircase. He perhaps
climbed up 2 steps for every 1 of mine. How
many steps did the staircase have? a)100000,841.
b) 525625, 841.
a) 22 steps c) 525625, 100.
b) 11 steps
c) 33 steps d) None
d) 44 steps
13. Three football teams are there. Given 14. A dog takes 4 leaps for every 5 leaps of hare
below is the group table. but 3 leaps of dog is equal to 4 leaps of hare
compare speed?
Fill in the x's
a) 14:15
P - Played
b) 16:17
W – Won
c) 18:19
L - Lost
d) 20:11
D - Draw
F - Goals For
A - Goals Against
PWLDFA
A2 2xx x 1
B2 x x 124
C2 x x x37
15. A bird keeper has got P pigeons, M 16. 3,4,7,10,13,16,19,22, . . . Find 10th term in
mynas and S sparrows. The keeper goes for series.
lunch leaving his assistant to watch the
birds. Suppose p = 10, m = 5, s = 8 when the a) 38
bird keeper comes back, the assistant b)48
informs the x birds have escaped. The bird
keeper exclaims: "Oh no! All my sparrows c)28
are gone." How many birds flew away?
d)8
When the bird keeper comes back, the
assistant told him that x birds have escaped.
The keeper realized that atleast 2 sparrows
have escaped. What is minimum no of birds
that can escape?
17. a,d,i,p,? what is next term 18. A shop has 4 shelf, 3 wardrobes, 2 chairs and 7
tables for sell. You have to buy ?
a) q
b) r
i. 1 shelf
c) s
ii. 1 wardrobe
d) t
iii. either 1 chair or 1 table
a)108
b)144
c)256
d)72
3. GOOD is coded as 164 then BAD as 21. If 4. Supposing a clock takes 7 seconds to strike
UGLY coded as 260 then JUMP? 7. How long will it take to strike 10?
b)100
c)300 a) 55 m
b) 44 m
d)500 c) 33 m
d) 66m
7. 16, 36, 100, 324, _ ? Find the next 8. How many ways can one arrange the
term. word EDUCATION such that relative
a) 1156 positions of vowels and consonants
b) 1120 remains same?
c) 2000 a)2880
d) 5000
b)3220
c)1000
d)8820
9. There are 8 digits and 5 alphabets.In 10. What is the next number of the following
how many ways can you form an sequence 7, 14, 55, 110, _ ?
alphanumeric word using 3 digits and
2 alphabets? a)121
a)2621
b)1221
b)4200
c)1331
c) 43200
d)111
d)none
11. In an Octagon the number of possible 12. How many numbers are divisible by 4 between
diagonals are? 1 to 100
8
a) C2 – 8 a) 34
8
b) C4 – 8 b) 14
8 1
c) C –8 c) 24
8
d) C2 –2 d) 44
13. 5 cars are to be parked in 5 parking 14. 12 persons can complete the work in 18 days.
slots. there are 3 red cars, 1 blue car and 1 after working for 6 days, 4 more persons added to
green car. How many ways the car can be complete the work fast. in how many more days
parked? they will complete the work?
d) 120 ways
15. A set of football matches is to be 16. Next term in series 3, 32, 405, _
organized in a "round-robin" fashion, i.e.,
every participating team plays a match
against every other team once and only a)5155
once. If 21 matches are totally played, how
many teams participated? b)6144
c)2222
a)9 d)4416
b)5
c)9
d)11
17. A cube is divided into 729 identical 18. Find the radius of the circle inscribed in a
cubelets. Each cut is made parallel to some triangle ABC. Triangle ABC is a right-angled
surface of the cube . But before doing that isosceles triangle with the hypotenuse as 62√
the cube is colored with green color on
one set of adjacent faces ,red on the other
set of adjacent faces, blue on the third set. a) Radius is 2 cm
So, how many cubelets are there which b) Radius is 4 cm
are painted with exactly one color? c) Radius is 6 cm
d) Radius is 8 cm
a)306
b)294
c)100
d)729
19. How many boys are there in the class if 20. If dolly works hard then she can get A grade
the number of boys in the class is 8 more
than the number of girls in the class, which 1. If dolly does not work hard then she can get A
is five times the difference between the grade
number of girls and boys in the class. 2. If dolly gets an A grade then she must have
worked hard
a)80
3. If dolly does not gets an A grade then she must
b)40
not have worked hard
c)60
4. Dolly wishes to get A grad.
d)10
1. The hour hand lies between 3 and 4. Tthe 2. Jack and Jill went up and down a hill. They
difference between hour and minute hand started from the bottom and Jack met Jill
is 50 degree.What are the two possible again 20 miles from the top while
timings? returning. Jack completed the race 1 min a
a) Substitute the θ = 8011, 28011 head of Jill. If the hill is 440 miles high and
b) Substitute the θ =7011, 18011 their speed while down journey is 1.5
c) Substitute the θ = 6011, 38011 times the up journey. How long it took for
d) Substitute the θ =58011, 48011 the Jack to complete the race ?
a)12.6 min
b)11.6 min
c)13.6 min
d)None
3. Data Sufficiency question: A, B, C, D have 4. One of the longest sides of the triangle is
to stand in a queue in descending order of 20 m. The other side is 10 m. Area of the
their heights. Who stands first? I. D was triangle is 80 m2. What is the another side
not the last, A was not the first. II. The first of the triangle?
is not C and B was not the tallest.
a)Assume a=20,b=10
a) Person A
b) Person B b)Assume a=30,b=20
c) Person C
d) Person D c) Assume a=40, b=20
d)Assume a=60,b=10
5. Data Sufficiency Question: 6. Mr. T has a wrong weighing pan. One arm
is lengthier than other. 1 kilogram on left
balances 8 melons on right, 1 kilogram on
a and b are two positive numbers. How right balances 2 melons on left. If all
many of them are odd? melons are equal in weight, what is the
weight of a single melon.
I. Multiplication of b with an odd
number gives an even number.
II. a2 – b is even. a)300gm
b)400gm
a. None of a and b are odd
b. None of a and b are even c)200gm
c. Either a or b odd
d. None of the above statement is true d)600gm
7. If ABC =C3 and CAB = D3, Then find D3÷B3 8. There are three trucks A, B, C. A loads 10
kg/min. B loads 13 1/3 kg/min. C unloads 5
kg/min. If three simultaneously works then
a)74 what is the time taken to load 2.4 tones?
a) 2 hrs 10 mins
b)64
b) 2 hrs 30 mins
c)84
c) 4 hrs 10 mins
d)54
d) 4 hrs 30 mins
9. HERE = COMES – SHE, (Assume S = 8) Find 10. A person is 80 years old in 490 and only 70
value of R + H + O years old in 500 in which year is he born?
a) 24 a) 400 BC
b) 14 b) 550 BC
c) 34
d) 44 c) 570 BC
d) 440 BC
11. Lucia is a wonderful grandmother and her 12. A family X went for a vacation.
age is between 50 and 70. Each of her sons Unfortunately it rained for 13 days when
have as many sons as they have brothers. they were there. But whenever it rained in
Their combined ages give Lucia's present the mornings, they had clear afternoons
age.what is the age? and vice versa. In all they enjoyed 11
a) Approx 64. mornings and 12 afternoons. How many
b) Approx 84 days did they stay there totally?
c) Approx 54
d) Approx 94
a)9 days
b) 21 days
c)18 days
d)27 days
13. Find the unit digit of product of the prime 14. Complete the series.. 2 2 12 12 30 30 ?
number up to 50 . a)1*2=2
a) 1
b) 2 b)6*5=30
c) 5
d) 0 c)7*8=56
d)8*9=72
1. Which of the following creates a virtual relation for storing the query ?
A. Function
B. View
C. Procedure
Answer: Option B
Explanation:
View
Any such relation that is not part of the logical model, but is made visible to a user as a
virtual relation, is called a view.
2. Which of the following is the syntax for views where v is view name ?
A. Create view v as “query name”;
Answer: Option C
Explanation:
Create view v as “query expression”;
is any legal query expression. The view name is represented by v
Answer: Option B
Explanation:
View definition is kept up-to-date
D. Cannot determine
Answer: Option A
Explanation:
Will affect the relation from which it is defined
5. SQL view is said to be updatable (that is, inserts, updates or deletes can be applied on
the view) if which of the following conditions are satisfied by the query defining the view?
C. The select clause contains only attribute names of the relation, and does not have any
expressions, aggregates, or distinct specification.
Answer: Option D
Explanation:
All of the mentioned
All of the conditions must be satisfied to update the view in sql.
6. Which of the following is used at the end of the view to reject the tuples which do not
satisfy the condition in where clause ?
A. With
B. Check
C. With check
D. All of the mentioned
Answer: Option C
Explanation:
With check
Views can be defined with a with check option clause at the end of the view definition;
then, if a tuple inserted into the view does not satisfy the view’s where clause condition,
the insertion is rejected by the database system.
1. Which one of the following is a set of one or more attributes taken collectively to uniquely
identify a record?
A. Candidate key
B. Sub key
C. Super key
D. Foreign key
Answer: Option C
Explanation:
Super key
Super key is the superset of all the keys in a relation.
2. Consider attributes ID , CITY and NAME . Which one of this can be considered as a
super key ?
A. NAME
B. ID
C. CITY
D. CITY , ID
Answer: Option B
Explanation:
ID
Here the id is the only attribute which can be taken as a key. Other attributes are not
uniquely identified .
Answer: Option A
Explanation:
No proper subset is a super key
The subset of a set cannot be the same set.Candidate key is a set from a super key which
cannot be the whole of the super set
4. A _____ is a property of the entire relation, rather than of the individual tuples in which
each tuple is unique.
A. Rows
B. Key
C. Attribute
D. Fields
Answer: Option B
Explanation:
Key
Key is the constraint which specifies uniqueness.
A. Name
B. Street
C. Id
D. Department
Answer: Option C
Explanation:
Id
The attributes name , street and department can repeat for some tuples.But the id
attribute has to be unique .So it forms a primary key.
6. Which one of the following cannot be taken as a primary key ?
A. Id
B. Register number
C. Dept_id
D. Street
Answer: Option D
Explanation:
Street
Street is the only attribute which can occur more than once.
7. A attribute in a relation is a foreign key if the _______ key from one relation is used as an
attribute in that relation .
A. Candidate
B. Primary
C. Super
D. Sub
Answer: Option B
Explanation:
Primary
The primary key has to be referred in the other relation to form a foreign key in that relation .
8. The relation with the attribute which is the primary key is referenced in another relation.
The relation which has the attribute as primary key is called
A. Referential relation
B. Referencing relation
C. Referenced relation
D. Referred relation
Answer: Option B
Explanation:
Referencing relation
9. The ______ is the one in which the primary key of one relation is used as a normal
attribute in another relation .
A. Referential relation
B. Referencing relation
C. Referenced relation
D. Referred relation
Answer: Option C
Explanation:
Referenced relation
10. A _________ integrity constraint requires that the values appearing in specified
attributes of any tuple in the referencing relation also appear in specified attributes of at
least one tuple in the referenced relation.
A. Referential
B. Referencing
C. Specific
D. Primary
Answer: Option A
Explanation:
Referential
A relation, say r1, may include among its attributes the primary key of another relation, say
r2. This attribute is called a foreign key from r1, referencing r2. The relation r1 is also called
the referencing relation of the foreign key dependency, and r2 is called the referenced
relation of the foreign key.
A. On
B. Using
C. Set
D. Where
Answer: Option A
Explanation:
On
On gives the condition for the join expression.
C. Inner join
Answer: Option C
Explanation:
Inner join
INNER JOIN: Returns all rows when there is at least one match in BOTH tables
3. What type of join is needed when you wish to include rows that do not have matching
values?
A. Equi-join
B. Natural join
C. Outer join
Answer: Option C
Explanation:
Outer join
An outer join does not require each record in the two joined tables to have a matching
record.
A. One
B. Two
C. Three
D. All of the mentioned
Answer: Option D
Explanation:
All of the mentioned
Join can combine multiple tables.
A. Cross join
B. Natural join
Answer: Option D
Explanation:
All of the mentioned
There are totally four join types in SQL.
A. 2
B. 3
C. 4
D. 5
Answer: Option D
Explanation:
5
Types are inner join,left outer join,right outer join,full join,cross join.
7. Which join refers to join records from the right table that have no matching key in the left
table are include in the result set:
Answer: Option B
Explanation:
Right outer join
RIGHT OUTER JOIN: Return all rows from the right table, and the matched rows from the
left table.
A. Join
B. Selection
C. Union
D. Cross product
Answer: Option A
Explanation:
Join
Answer: Option B
Explanation:
Select * from R cross join S
1. A _________ consists of a sequence of query and/or update statements.
A. Transaction
B. Commit
C. Rollback
D. Flashback
Answer: Option A
Explanation:
Transaction
Transaction is a set of operation until commit.
A. View
B. Commit
C. Rollback
D. Flashback
Answer: Option B
Explanation:
Commit
Commit work commits the current transaction.
3. In order to undo the work of transaction after last commit which one should be used ?
A. View
B. Commit
C. Rollback
D. Flashback
Answer: Option C
Explanation:
Rollback
Rollback work causes the current transaction to be rolled back; that is, it undoes all the
updates performed by the SQL statements in the transaction.
4. Consider the following action:
Transaction…..
Commit;
Rollback;
What does Rollback do?
D. No action
Answer: Option D
Explanation:
No action
Once a transaction has executed commit work, its effects can no longer be undone by
rollback work.
5. In case of any shut down during transaction before commit which of the following
statement is done automatically ?
A. View
B. Commit
C. Rollback
D. Flashback
Answer: Option C
Explanation:
Rollback
Once a transaction has executed commit work, its effects can no longer be undone by
rollback work.
A. Commit
B. Atomic
C. Flashback
D. Retain
Answer: Option B
Explanation:
Atomic
By atomic , either all the effects of the transaction are reflected in the database, or none are
(after rollback).
D. Maintaining a data
Answer: Option A
Explanation:
Conforming a action or triggering a response
A. Committed
B. Aborted
C. Rolled back
D. Failed
Answer: Option A
Explanation:
Committed
A complete transaction always commits.
9. Which of the following is used to get back all the transactions back after rollback ?
A. Commit
B. Rollback
C. Flashback
D. Redo
Answer: Option C
Explanation:
Flashback
A. Transaction
B. Flashback
C. Rollback
D. Abort
Answer: Option C
Explanation:
Rollback
Flashback will undo all the statements and Abort will terminate the operation.
Answer: Option D
Explanation:
All of the mentioned
A database index is a data structure that improves the speed of data retrieval operations on
a database table at the cost of additional writes.
B. 2
C. 3
D. 4
Answer: Option B
Explanation:
2
They are clustered index and non clustered index.
Answer: Option C
Explanation:
It is used for pointing data rows containing key values
Nonclustered indexes have a structure separate from the data rows. A nonclustered index
contains the nonclustered index key values and each key value entry has a pointer to the
data row that contains the key value.
Answer: Option B
Explanation:
Clustered index is built by default on unique key columns
Nonclustered indexes have a structure separate from the data rows. A nonclustered index
contains the nonclustered index key values and each key value entry has a pointer to the
data row that contains the key value.
B. It makes harder for sql server engines to work to work on index which have large keys
C. It doesn’t make harder for sql server engines to work to work on index which have large
keys
Answer: Option B
Explanation:
It makes harder for sql server engines to work to work on index which have large keys
Indexes tend to improve the performance.
Answer: Option B
Explanation:
Yes, Indexes are stored on disk
Indexes take memory slots which are located on the disk.
A. Are those which are composed by database for its internal use
Answer: Option B
Explanation:
A composite index is a combination of index on 2 or more columns
A composite index is an index on two or more columns of a table.
A. Disabling
B. Dropping
C. Altering
D. Both a and b
Answer: Option A
Explanation:
Disabling
A database index is a data structure that improves the speed of data retrieval operations on
a database table at the cost of additional writes.
9. In _______________ index instead of storing all the columns for a record together, each
column is stored separately with all other rows in an index.
A. Clustered
B. Column store
C. Non clustered
D. Row store
Answer: Option B
Explanation:
Column store
A database index is a data structure that improves the speed of data retrieval operations on
a database table at the cost of additional writes.
10. A _________________ index is the one which satisfies all the columns requested in the
query without performing further lookup into the clustered index.
A. Clustered
B. Non Clustered
C. Covering
D. B-Tree
Answer: Option C
Explanation:
Covering
A covered query is a query where all the columns in the query’s result set are pulled from
non-clustered indexes.
1. This set of Database Questions & Answers focuses on “SQL Data Types and Schemas”
Dates must be specified in the format
A. mm/dd/yy
B. yyyy/mm/dd
C. dd/mm/yy
D. yy/dd/mm
Answer: Option B
Explanation:
yyyy/mm/dd
yyyy/mm/dd is the default format in sql
A. Index
B. Reference
C. Assertion
D. Timestamp
Answer: Option A
Explanation:
Index
Index is the reference to the tuples in a relation.
B. Blob
Answer: Option B
Explanation:
Blob
SQL therefore provides large-object data types for character data (clob) and binary data
(blob). The letters “lob” in these data types stand for “Large OBject.”
A. Create datatype
B. Create data
C. Create definetype
D. Create type
Answer: Option D
Explanation:
Create type
The create type clause can be used to define new types.Syntax : create type Dollars as
numeric(12,2) final; .
5. Values of one type can be converted to another domain using which of the following ?
A. Cast
B. Drop type
C. Alter type
D. Convert
Answer: Option A
Explanation:
Cast
Example of cast :cast (department.budget to numeric(12,2)). SQL provides drop type and
alter type clauses to drop or modify types that have been created earlier.
6. Which of the following closely resembles Create view ?
B. Create table . . . as
C. With data
D. Create view as
Answer: Option B
Explanation:
Create table . . . as
The ‘create table . . . as’ statement closely resembles the create view statement and both
are defined by using queries.The main difference is that the contents of the table are set
when the table is created, whereas the contents of a view always reflect the current query
result.
7. In contemporary databases the top level of the hierarchy consists of ______, each of
which can contain _____.
A. Catalogs, schemas
B. Schemas, catalogs
C. Environment, schemas
D. Schemas, Environment
Answer: Option A
Explanation:
Catalogs, schemas
8. Which of the following statements creates a new table temp instructor that has the same
schema as instructor.
Answer: Option B
Explanation:
Create table temp_instructor like instructor;
A. First
B. Second
C. Third
D. Fourth
Answer: Option A
Explanation:
First
The first normal form is used to eliminate the duplicate information.
2. A table on the many side of a one to many or many to many relationship must:
Answer: Option D
Explanation:
Have a composite key
The relation in second normal form is also in first normal form and no partial dependencies
on any column in primary key.
D. Have all non key fields depend on the whole primary key
Answer: Option A
Explanation:
Eliminate all hidden dependencies
The relation in second normal form is also in first normal form and no partial dependencies
on any column in primary key.
Answer: Option C
Explanation:
Loss less, dependency – preserving decomposition into BCNF is always possible
We say that the decomposition is a lossless decomposition if there is no loss of information
by replacing r (R) with two relation schemas r1(R1) andr2(R2).
5. Functional Dependencies are the types of constraints that are based on______
A. Key
B. Key revisited
C. Superset key
D. None of these
Answer: Option A
Explanation:
Key
Key is the basic element needed for the constraints.
A. Functional dependency
B. Database modeling
C. Normalization
D. Decomposition
Answer: Option C
Explanation:
Normalization
Normalisation is the process of removing redundancy and unwanted data.
7. Which forms simplifies and ensures that there is minimal data aggregates and repetitive
groups:
A. 1NF
B. 2NF
C. 3NF
Answer: Option C
Explanation:
3NF
The first normal form is used to eliminate the duplicate information.
8. Which forms has a relation that possesses data about an individual entity:
A. 2NF
B. 3NF
C. 4NF
D. 5NF
Answer: Option C
Explanation:
4NF
A Table is in 4NF if and only if, for every one of its non-trivial multivalued dependencies X
\twoheadrightarrow Y, X is a superkey—that is, X is either a candidate key or a superset
thereof.
A. 1NF
B. 2NF
C. 3NF
D. 4NF
Answer: Option C
Explanation:
3NF
The table is in 3NF if every non-prime attribute of R is non-transitively dependent (i.e.
directly dependent) on every superkey of R.
10. Empdt1(empcode, name, street, city, state,pincode). For any pincode, there is only one
city and state. Also, for given street, city and state, there is just one pincode. In
normalization terms, empdt1 is a relation in
A. 1 NF only
D. BCNF and hence also in 3NF, 2NF and 1NF View Answer
Answer: Option B
Explanation:
2 NF and hence also in 1 NF
The relation in second normal form is also in first normal form and no partial dependencies
on any column in primary key.
A. Create table
B. Modify table
C. Alter table
Answer: Option C
Explanation:
Alter table
SYNTAX – alter table table-name add constraint , where constraint can be any constraint on
the relation.
A. Not null
B. Positive
C. Unique
D. Check ‘predicate’
Answer: Option B
Explanation:
Positive
Positive is a value and not a constraint.
3. Foreign key is the one in which the ________ of one relation is referenced in another
relation.
A. Foreign key
B. Primary key
C. References
D. Check constraint
Answer: Option B
Explanation:
Primary key
The foreign-key declaration specifies that for each course tuple, the department name
specified in the tuple must exist in the department relation.
4. Domain constraints, functional dependency and referential integrity are special forms of
_________.
A. Foreign key
B. Primary key
C. Assertion
D. Referential constraint
Answer: Option C
Explanation:
Assertion
An assertion is a predicate expressing a condition we wish the database to always satisfy.
Answer: Option A
Explanation:
Create assertion 'assertion-name' check 'predicate';
B. Ensure that duplicate records are not entered into the table
C. Improve the quality of data entered for a specific property (i.e., table column)
Answer: Option C
Explanation:
Improve the quality of data entered for a specific property (i.e., table column)
B. Certain fields are required (such as the email address, or phone number) before the
record is accepted
C. Information on the customer must be known before anything can be sold to that custome
D. When entering an order quantity, the user must input a number and not some text (i.e.,
12 rather than ‘a dozen’)
Answer: Option C
Explanation:
Information on the customer must be known before anything can be sold to that custome
The information can be referred and obtained .
A. Mapping Cardinality
Answer: Option A
Explanation:
Mapping Cardinality
Mapping cardinality is also called as cardinality ratio.
A. One-to-many
B. One-to-one
C. Many-to-many
D. Many-to-one
Answer: Option B
Explanation:
One-to-one
Here one entity in one set is related to one one entity in other set.
10. An entity in A is associated with at most one entity in B. An entity in B, however, can be
associated with any number (zero or more) of entities in A.
A. One-to-many
B. One-to-one
C. Many-to-many
D. Many-to-one
Answer: Option D
Explanation:
Many-to-one
Here more than one entity in one set is related to one one entity in other set.
B. Ensure that duplicate records are not entered into the table
Answer: Option C
Explanation:
Improve the quality of data entered for a specific property
The data entered will be in a particular cell (i.e., table column) .
12. Establishing limits on allowable property values, and specifying a set of acceptable,
predefined options that can be assigned to a property are examples of:
A. Attributes
C. Method constraints
Answer: Option B
Explanation:
Data integrity constraints
Only particular value satsfying the constraints are entered in column .
13. Which of the following can be addressed by enforcing a referential integrity constraint?
B. Certain fields are required (such as the email address, or phone number) before the
record is accepted
C. Information on the customer must be known before anything can be sold to that customer
D. Then entering an order quantity, the user must input a number and not some text (i.e., 12
rather than ‘a dozen’)
Answer: Option C
Explanation:
Information on the customer must be known before anything can be sold to that customer
14. ______ is a special type of integrity constraint that relates two relations & maintains
consistency across the relations.
D. Domain Constraints
Answer: Option B
Explanation:
Referential Integrity Constraints
15. Which one of the following uniquely identifies the elements in the relation?
A. Secondary Key
B. Primary key
C. Foreign key
D. Composite key
Answer: Option B
Explanation:
Primary key
Primary key checks for not null and uniqueness constraint
16. Drop Table cannot be used to drop a table referenced by a _________ constraint.
A. Local Key
B. Primary Key
C. Composite Key
D. Foreign Key
Answer: Option D
Explanation:
Foreign Key
Foreign key is used when primary key of one relation is used in another relation .
A. Constraints
B. Stored Procedure
C. Triggers
D. Cursors
Answer: Option A
Explanation:
Constraints
Constraints are specified to restrict entries in the relation.
1. Which one of the following is a set of one or more attributes taken collectively to uniquely
identify a record?
A. Candidate key
B. Sub key
C. Super key
D. Foreign key
Answer: Option C
Explanation:
Super key
Super key is the superset of all the keys in a relation.
2. Consider attributes ID , CITY and NAME . Which one of this can be considered as a
super key ?
A. NAME
B. ID
C. CITY
D. CITY , ID
Answer: Option B
Explanation:
ID
Here the id is the only attribute which can be taken as a key. Other attributes are not
uniquely identified .
Answer: Option A
Explanation:
No proper subset is a super key
The subset of a set cannot be the same set.Candidate key is a set from a super key which
cannot be the whole of the super set
4. A _____ is a property of the entire relation, rather than of the individual tuples in which
each tuple is unique.
A. Rows
B. Key
C. Attribute
D. Fields
Answer: Option B
Explanation:
Key
Key is the constraint which specifies uniqueness.
A. Name
B. Street
C. Id
D. Department
Answer: Option C
Explanation:
Id
The attributes name , street and department can repeat for some tuples.But the id attribute
has to be unique .So it forms a primary key.
A. Id
B. Register number
C. Dept_id
D. Street
Answer: Option D
Explanation:
Street
Street is the only attribute which can occur more than once.
7. A attribute in a relation is a foreign key if the _______ key from one relation is used as an
attribute in that relation .
A. Candidate
B. Primary
C. Super
D. Sub
Answer: Option B
Explanation:
Primary
The primary key has to be referred in the other relation to form a foreign key in that relation .
8. The relation with the attribute which is the primary key is referenced in another relation.
The relation which has the attribute as primary key is called
A. Referential relation
B. Referencing relation
C. Referenced relation
D. Referred relation
Answer: Option B
Explanation:
Referencing relation
9. The ______ is the one in which the primary key of one relation is used as a normal
attribute in another relation .
A. Referential relation
B. Referencing relation
C. Referenced relation
D. Referred relation
Answer: Option C
Explanation:
Referenced relation
10. A _________ integrity constraint requires that the values appearing in specified
attributes of any tuple in the referencing relation also appear in specified attributes of at
least one tuple in the referenced relation.
A. Referential
B. Referencing
C. Specific
D. Primary
Answer: Option A
Explanation:
Referential
A relation, say r1, may include among its attributes the primary key of another relation, say
r2. This attribute is called a foreign key from r1, referencing r2. The relation r1 is also called
the referencing relation of the foreign key dependency, and r2 is called the referenced
relation of the foreign key.
The situation where the lock waits only for a specified amount of time for another lock to be
released is
A. Lock timeout
B. Wait-wound
C. Timeout
D. Wait
Answer: Option A
Explanation:
Lock timeout
The timeout scheme is particularly easy to implement, and works well if transactions are
short and if longwaits are likely to be due to deadlocks.
A. Tables
B. Fields
C. Records
D. Keys
Answer: Option A
Explanation:
Fields are the column of the relation or tables.Records are each row in relation.Keys are the
constraints in a relation .
A. Column
B. Key
C. Row
D. Entry
Answer: Option C
Explanation:
Column has only one set of values.Keys are constraints and row is one whole set of attributes.Entry
is just a piece of data.
A. Attribute
B. Tuple
C. Field
D. Instance
Answer: Option B
Explanation:
Tuple
Tuple is one entry of the relation with several attributes which are fields.
A. Record
B. Column
C. Tuple
D. Key
Answer: Option B
Explanation:
Attribute is a specific domain in the relation which has entries of all tuples.
5. For each attribute of a relation, there is a set of permitted values, called the ________ of
that attribute.
A. Domain
B. Relation
C. Set
D. Schema
Answer: Option A
Explanation:
The values of the attribute should be present in the domain.Domain is a set of values permitted .
6. Database __________ , which is the logical design of the database, and the database
_______,which is a snapshot of the data in the database at a given instant in time.
A. Instance, Schema
B. Relation, Schema
C. Relation, Domain
D. Schema, Instance
Answer: Option D
Explanation:
Schema, Instance
Instance is a instance of time and schema is a representation.
A. Different
B. Indivisbile
C. Constant
D. Divisible
Answer: Option B
Explanation:
Indivisbile
A. Any
B. Same
C. Sorted
D. Constant
Answer: Option A
Explanation:
Any
The values only count .The order of the tuples does not matter.
A. Query
B. Relational
C. Structural
D. Compiler
Answer: Option A
Explanation:
Query
Query language is a method through which the database entries can be accessed.
10. Student(ID, name, dept name, tot_cred) In this query which attribute form the primary
key?
A. Name
B. Dept
C. Tot_cred
D. ID
Answer: Option D
Explanation:
ID The attributes name ,dept and tot_cred can have same values unlike ID .
C. Relational algebra
D. Query language
Answer: Option C
Explanation:
Relational algebra
Domain and Tuple relational calculus are non-procedural language.Query language is a
method through which the database entries can be accessed.
12. The_____ operation allows the combining of two relations by merging pairs of tuples,
one from each relation, into a single tuple.
A. Select
B. Join
C. Union
D. Intersection
Answer: Option B
Explanation:
Join
Join finds the common tuple in the relations and combines it.
13. The result which operation contains all pairs of tuples from the two relations, regardless
of whether their attribute values match.
A. Join
B. Cartesian product
C. Intersection
D. Set difference
Answer: Option B
Explanation:
Cartesian product
Cartesian product is the multiplication of all the values in the attributes.
14. The _______operation performs a set union of two “similarly structured” tables
A. Union
B. Join
C. Product
D. Intersect
Answer: Option A
Explanation:
Union
Union just combines all the values of relations of same attributes.
15. The most commonly used operation in relational algebra for projecting a set of tuple
from a relation is
A. Join
B. Projection
C. Select
D. Union
Answer: Option C
Explanation:
Select
Select is used to view the tuples of the relation with or without some constraints.
16. The _______ operator takes the results of two queries and returns only rows that
appear in both result sets.
A. Union
B. Intersect
C. Difference
D. Projection
Answer: Option B
Explanation:
Intersect
The union operator gives the result which is the union of two queries and difference is the
one where query which is not a part of second query .
17. A ________ is a pictorial depiction of the schema of a database that shows the relations
in the database, their attributes, and primary keys and foreign keys.
A. Schema diagram
B. Relational algebra
C. Database diagram
D. Schema flow
Answer: Option A
Explanation:
Schema diagram
18. The _________ provides a set of operations that take one or more relations as input
and return a relation as an output
A. Schematic representation
B. Relational algebra
C. Scheme diagram
D. Relation flow
Answer: Option B
Explanation:
Relational algebra
Test 12
1. DBMS is a collection of ………….. that enables user to create and maintain a database.
A) Keys
B) Translators
C) Program
D) Language Activity
9. A logical schema
A) is the entire database
B) is a standard way of organizing information into accessible parts.
C) Describes how data is actually stored on disk.
D) All of the above
1. C) Program
2. B) Domains
3. A) Entity
4. C) Data Flow Diagram
5. A) Hierarchical schema
6. C) System
7. B) Schema
8. C) Having
9. B) is a standard .. accessible parts.
10. C) Structured query language
11) C. a tuple
12) B. COUNT
13) C. data is integrated and can be accessed by multiple programs
14) B. instance of the database
15) D. both B and C
16) A. schema
17) C. foreign key
18) C. DCL
19) D. Both A and B
20) A. alter
Test 13
1. The candidate key is that you choose to identify each row uniquely is called ……………..
A) Alternate Key
B) Primary Key
C) Foreign Key
D) None of the above
7. A ………………. Does not have a distinguishing attribute if its own and most are dependent
entities, which are part of some another entity.
A) Weak entity
B) Strong entity
C) Non-attributes entity
D) Dependent entity
10. The number of tuples in a relation is called its …………. While the number of attributes in a
relation is called it’s ………………..
A) Degree, Cardinality
B) Cardinality, Degree
C) Rows, Columns
D) Columns, Rows
11) The language that requires a user to specify the data to be retrieved without specifying
exactly how to get it is
A. Procedural DML
B. Non-Procedural DML
C. Procedural DDL
D. Non-Procedural DDL
12) Which two files are used during the operation of the DBMS?
A. Query languages and utilities
B. DML and query language
C. Data dictionary and transaction log
D. Data dictionary and query language
13) The database schema is written in
A. HLL
B. DML
C. DDL
D. DCL
14) The way a particular application views the data from the database that the application
uses is a
A. module
B. relational model
C. schema
D. subschema
19) Which are the two ways in which entities can participate in a relationship?
A. Passive and active
B. Total and partial
C. Simple and Complex
D. All of the above
20) …….. data type can store unstructured data
A. RAW
B. CHAR
C. NUMERIC
D. VARCHAR
ANSWERS:
1. B. Primary Key
2. A. Unique predicate
3. C. DISTINCT
4. C. i-true, ii-true
5. A. Data Control Language
6. A. Normalization
7. A. Weak entity
8. D. Predicate
9. A. Constraints
10. B. Cardinality, Degree
11. B. Non-Procedural DML
12.C. Data dictionary and transaction log
13. C. DDL
14. D. subschema
15. B. is much more data independence than some other database models
16. B. Data elements in the database can be modified by changing the data dictionary.
17. C. Attributes
18. A. External
19. B. Total and partial
20. A. RAW
Test 14
3. One aspect that has to be dealt with by the integrity subsystem is to ensure that only valid
values can be assigned to each data items. This is referred to as
A) Data Security
B) Domain access
C) Data Control
D) Domain Integrity
8. In snapshot, …………………. clause tells oracle how long to wait between refreshes.
A) Complete
B) Force
C) Next
D) Refresh
9. ……………… defines rules regarding the values allowed in columns and is the standard
mechanism for enforcing database integrity.
A) Column
B) Constraint
C) Index
D) Trigger
ANSWERS:
1. C) i-False, ii-True
2. B) Model
3. D) Domain Integrity
4. B) Semi-Join
5. D) Project
6. D) Reduces
7. D) All of the above
8. D) Refresh
9. B) Constraint
10. C) Both of them
Test 15
1. In SQL, which command is used to issue multiple CREATE TABLE, CREATE VIEW and
GRANT statements in a single transaction?
A) CREATE PACKAGE
B) CREATE SCHEMA
C) CREATE CLUSTER
D) All of the above
2. In SQL, the CREATE TABLESPACE is used
A) to create a place in the database for storage of scheme objects, rollback segments, and
naming the data files to comprise the tablespace.
B) to create a database trigger.
C) to add/rename data files, to change storage
D) All of the above
3. Which character function can be used to return a specified portion of a character string?
A) INSTR
B) SUBSTRING
C) SUBSTR
D) POS
4. Which of the following is TRUE for the System Variable $date$?
A) Can be assigned to a global variable.
B) Can be assigned to any field only during design time.
C) Can be assigned to any variable or field during run time.
D) Can be assigned to a local variable.
8. Which of the following SQL command can be used to modify existing data in a database
table?
A) MODIFY
B) UPDATE
C) CHANGE
D) NEW
9. When SQL statements are embedded inside 3GL, we call such a program as ……….
A) nested query
B) nested programming
C) distinct query
D) embedded SQL
10. ……………. provides option for entering SQL queries as execution time, rather than at the
development stage.
A) PL/SQL
B) SQL*Plus
C) SQL
D) Dynamic SQL
11) The RDBMS terminology for a row is
A. tuple
B. relation
C. attribute
D. degree
12) To change column value in a table the ……… command can be used.
A. create
B. insert
C. alter
D. update
13) The full form of DDL in Database Management System is
A. Dynamic Data Language
B. Detailed Data Language
C. Data Definition Language
D. Data Derivation Language
18) A …………. represents the number of entities to which another entity can be associated
A. mapping cardinality
B. table
C. schema
D. information
19) Which two files are used during operation of the DBMS
A. Query languages and utilities
B. DML and query language
C. Data dictionary and transaction log
D. Data dictionary and query language
ANSWERS:
1. B) CREATE SCHEMA
2. A) to create a place in the database for storage of scheme objects……….
3. C) SUBSTR
4. B) Can be assigned to any field only during design time.
5. C) Insert, Update, Delete
6. A) Data Definition Language
7. B) 2345
8. B) UPDATE
9. D) embedded SQL
10.D) Dynamic SQL
11) A. tuple
12) D. update
13) C. Data Definition Language
14) B. grant option
15) D. domain
16) C. functional dependency
17) A. Parent-Child relationship between the tables that connect them
18) A. mapping cardinality
19) C. Data dictionary and transaction log
20) D. super key
Test 16
1. The relational model is based on the concept that data is organized and stored in two-
dimensional tables called ……………………….
A) Fields
B) Records
C) Relations
D) Keys
2. ……………….. contains information that defines valid values that are stored in a column or
data type.
A) View
B) Rule
C) Index
D) Default
A) i-only
B) ii-only
C) Both of them
D) None of them
A) <>
B) <
C) =<
D) >=
7. An outstanding functionality of SQL is its support for automatic ………… to the target data.
A) programming
B) functioning
C) navigation
D) notification
8. ………………… is a special type of integrity constraint that relates two relations & maintains
consistency across the relations.
E) Key Constraints
A) GROUP BY Clause
B) HAVING Clause
C) FROM Clause
D) WHERE Clause
10. Drop Table cannot be used to drop a table referenced by a …………… constraint.
A) Local Key
B) Primary Key
C) Composite Key
D) Foreign Key
ANSWERS:
1. C) Relations
2. C) Index
3. C) Both of them
4. B) Edgar F. Codd
5. A) use database
6. C) =<
7. C) navigation
8. B) Referential…..Constraints
9. B) HAVING Clause
10. D) Foreign Key
Test 17
2. …………….. is a utility to capture a continuous record of server activity and provide auditing
capability.
A) SQL Server Profile
B) SQL server service manager
C) SQL server setup
D) SQL server wizard.
5. ………………… approach reduces time and effort required for design and lesser risk in database
management.
A) Single global database
B) Top-down approach
C) Multiple databases
D) None of the above
ANSWERS:
1. B) Information
2. B) SQL server service manager
3. A) record
4. B) Operational database
5. C) Multiple databases
6. A) Hierarchic Sequential Access Method
7. D) sys indexes
8. C) It should avoid/reduce the redundancy.
9. A) Chain
10. A) Constraints
Test 18
B) Null set of X
C) Super set of Y
D) Subset of Y
A) DML
B) DCL
C) DDL
A) Tuples
B) Rows
C) Both of them
D) None of them
4. In the ………………… mode any record in the file can be accessed at random
A) Sequential access
B) Random access
C) Standard access
D) Source access
C) Delete table_name
A) Key integrity
B) Domain integrity
C) Entity integrity
D) Referential integrity
8. A ……………… allows to make copies of the database periodically to help in the cases of
crashes & disasters.
A) Recovery utility
B) Backup Utility
C) Monitoring utility
9. ………………. Allows definitions and query language statements to be entered; query results
are formatted and displayed.
A) Schema Processor
B) Query Processor
C) Terminal Interface
10. The main task carried out in the …………… is to remove repeating attributes to separate
tables.
ANSWERS:
1. A) Subset of X
2. C) DDL
3. C) Both of them
4. B) Random access
5. A) Delete * from table_name
6. A) Key integrity
7. B) Fourth Normal Form
8. B) Backup Utility
9. C) Terminal Interface
10. D) Fourth Normal Form
Test 19
6. Which is proper subset designed to support views belonging to different classes of users in
order to hide or protect information.
A) Schema
B) Sub-schema
C) Non-schema
D) Non-sub schema
7. Which contain information about a file needed by system programs for accessing file
records?
A) File blocks
B) File operators
C) File headers
D) None of these
8. A ……………….. DBMS distributes data processing tasks between the workstation and
network server.
A) Network
B) Relational
C) Client Server
D) Hierarchical
9. The ……………….. refers to the way data is organized in and accessible from DBMS.
A) database hierarchy
B) data organization
C) data sharing
D) data model
ANSWERS:
1. ………………………. is the powerful language for working with RDBMS.
C) Query Language
6. Which is proper subset designed to support views belonging to different classes of users in
order to hide or protect information.
B) Sub-schema
7. Which contain information about a file needed by system programs for accessing file
records?
C) File headers
8. A ……………….. DBMS distributes data processing tasks between the workstation and
network server.
C) Client Server
9. The ……………….. refers to the way data is organized in and accessible from DBMS.
D) data model
6) The …….. is used for creating and destroying table, indexes and other forms of structures.
A. data manipulation language
B. data control language
C. transaction control language
D. data definition language
7) The view of total database content is
A. Conceptual view
B. Internal view
C. External view
D. Physical view
8) The ………… refers to the way data is organized in and accessible from DBMS.
A. database hierarchy
B. data organization
C. data sharing
D. data model
12) When the values in one or more attributes being used as a foreign key must exist in
another set of one or more attributes in another table, we have created a(n) ……..
A. transitive dependency
B. insertion anomaly
C. referential integrity constraint
D. normal form
16) ………. is, a table have more than one set of attributes that could be chosen as the key
A. foreign key
B. integrity key
C. relationship
D. candidate key
17) The database environment has all of the following components except.
A. users
B. separate files
C. database
D. database administrator
19) The way a particular application views the data from the database that the application
uses is a
A. module
B. relational model
C. schema
D. sub schema
20) ……. is a condition specified on a database schema and restricts the data that can be
stored in an instance of the database.
A. Key Constraint
B. Check Constraint
C. Foreign key constraint
D. integrity constraint
ANSWERS:
1) B. Tree like structure
2) A. data item
3) D. Primary key
4) C. attribute
5) A. Number of tuples
6) D. data definition language
7) A. Conceptual view
8) D. data model
9) C. three levels
10) C. EF Codd
11) C. Tables
12) C. referential integrity constraint
13) D. view level
14) D. attributes
15) B. data record
16) D. candidate key
17) A. users
18) B. Project
19) D. sub schema
20) B. Check Constraint
Test 21
1. A ………………… specifies the actions needed to remove the drawbacks in the current design
of a database.
A) 1 NF
B) 2 NF
C) 3 NF
D) Normal form
2. A relation is in ……………………… if an attribute of a composite key is dependent on an
attribute of another composite key.
A) 2NF
B) 3NF
C) BCNF
D) 1NF
5. In 2NF
A) No functional dependencies exist.
B) No multivalued dependencies exist.
C) No partial functional dependencies exist
D) No partial multivalued dependencies exist.
8. Which normal form is considered adequate for normal relational database design?
A) 2NF
B) 5NF
C) 4NF
D) 3NF
9. Dependency preservation is not guaranteed in
A) BCNF
B) 3NF
C) 4NF
D) DKNF
10. A relation is ………………. if every field contains only atomic values that are, no lists or sets.
A) 1 NF
B) 2 NF
C) 3 NF
D) BCNF
ANSWERS:
1. A ………………… specifies the actions needed to remove the drawbacks in the current design
of a database.
D) Normal form
5. In 2NF
C) No partial functional dependencies exist
8. Which normal form is considered adequate for normal relational database design?
D) 3NF
1. Which of the following relational algebra operations do not require the participating tables
to be union-compatible?
A. Union
B. Intersection
C. Difference
D. Join
4) The rule that a value of a foreign key must appear as a value of some specific table is called
a
A. Referential constraint
B. Index
C. Integrity constraint
D. Functional
9) If two relations R and S are joined, then the non-matching tuples of both R and S are
ignored in
A. left outer join
B. right outer join
C. full outer join
D. inner join
11) If an entity can belong to only one lower level entity then the constraint is
A. disjoint
B. partial
C. overlapping
D. single
15) Which of the following constitutes a basic set of operations for manipulating relational
data?
A. Predicate calculus
B. Relational calculus
C. Relational algebra
D. SQL
20) E-R model uses this symbol to represent the weak entity set?
A. Dotted rectangle
B. Diamond
C. Doubly outlined rectangle
D. None of these
ANSWERS:
1) D.Join
2) C. Aggregation operator
3) C. Hierarchical model
4) A. Referential constraint
5) C. Aggregation
6) A. Join
7) B. Select * from R cross join S
8) B. weak relationship sets
9) D. inner join
10) C. Procedural query Language
11) B. partial
12) C. natural join
13) A. double lines
14) A. Aggregation
15) C. Relational algebra
16) B. Non-Procedural language
17) B. a Binary operator
18) C. ellipse
19) A. rectangle
20) C. Doubly outlined rectangle
Test 23
2) As per equivalence rules for query transformation, selection operation distributes over
A. Union
B. Intersection
C. Set difference
D. All of the above
4) Which of the following relational algebraic operations is not from set theory?
A. Union
B. Intersection
C. Cartesian Product
D. Select
5) An entity set that does not have sufficient attributes to form a primary key is a
A. strong entity set
B. weak entity set
C. simple entity set
D. primary entity set
8) Which of the operations constitute a basic set of operations for manipulating relational
data?
A. Predicate calculus
B. Relational calculus
C. Relational algebra
D. None of the above
11) A file manipulation command that extracts some of the records from a file is called
A. SELECT
B. PROJECT
C. JOIN
D. PRODUCT
18) Different values for the same data item is referred to as …….
A. data consistency
B. data inconsistency
C. data integrity
D. data duplication
19) The ………. returns row after combining two tables based on common values.
A. difference
B. product
C. join
D. union
6. Which of the following operation is used if we are interested in only certain columns of a
table?
A) PROJECTION
B) SELECTION
C) UNION
D) JOIN
9. Which command is used to select distinct subject (SUB) from the table (BOOK)?
A) SELECT ALL FROM BOOK
B) SELECT DISTINCT SUB FROM BOOK
C) SELECT SUB FROM BOOK
D) All of the above
10. In SQL, which of the following is not a data definition language commands?
A) RENAME
B) REVOKE
C) GRANT
D) UPDATE
ANSWERS:
1. Which of the following query is correct for using comparison operators in SQL?
A) SELECT sname, coursename FROM studentinfo WHERE age>50 and <80;
B) SELECT sname, coursename FROM studentinfo WHERE age>50 and age <80;
C) SELECT sname, coursename FROM studentinfo WHERE age>50 and WHERE
age<80;
D) None of the above
2.How to select all data from studentinfo table starting the name from letter ‘r’?
A) SELECT * FROM studentinfo WHERE sname LIKE ‘r%’;
B) SELECT * FROM studentinfo WHERE sname LIKE ‘%r%’;
C) SELECT * FROM studentinfo WHERE sname LIKE ‘%r’;
D) SELECT * FROM studentinfo WHERE sname LIKE ‘_r%’;
3. Which of the following SQL query is correct for selecting the name of staffs from ‘tblstaff’
table where salary is 15,000 or 25,000?
A) SELECT sname from tblstaff WHERE salary IN (15000, 25000);
B) SELECT sname from tblstaff WHERE salary BETWEEN 15000 AND 25000;
C) Both A and B
D) None of the above
4. The SELECT statement, that retrieves all the columns from empinfo table name starting
with d to p is ……………………..
A) SELECT ALL FROM empinfo WHERE ename like ‘[d-p]%’;
B) SELECT * FROM empinfo WHERE ename is ‘[d-p]%’;
C) SELECT * FROM empinfo WHERE ename like ‘[p-d]%’;
D) SELECT * FROM empinfo WHERE ename like ‘[d-p]%’;
5. Select a query that retrieves all of the unique countries from the student table?
A) SELECT DISTINCT coursename FROM studentinfo;
B) SELECT UNIQUE coursename FROM studentinfo;
C) SELECT DISTINCT coursename FROM TABLE studentinfo;
D) SELECT INDIVIDUAL coursename FROM studentinfo;
6. Which query is used for sorting data that retrieves the all the fields from empinfo table and
listed them in the ascending order?
A) SELECT * FROM empinfo ORDER BY age;
B) SELECT * FROM empinfo ORDER age;
C) SELECT * FROM empinfo ORDER BY COLUMN age;
D) SELECT * FROM empinfo SORT BY age;
8. How to Delete records from studentinfo table with name of student ‘Hari Prasad’?
A) DELETE FROM TABLE studentinfo WHERE sname=’Hari Prasad’;
B) DELETE FROM studentinfo WHERE sname=’Hari Prasad’;
C) DELETE FROM studentinfo WHERE COLUMN sname=’Hari Prasad’;
D) DELETE FROM studentinfo WHERE sname LIKE ‘Hari Prasad’;
10. ………………… joins two or more tables based on a specified column value not equaling a
specified column value in another table.
A) OUTER JOIN
B) NATURAL JOIN
C) NON-EQUIJOIN
D) EQUIJOIN
ANSWERS:
1. B) SELECT sname, coursename FROM studentinfo WHERE age>50 and age <80;
2. A) SELECT * FROM studentinfo WHERE sname LIKE ‘r%’;
3. A) SELECT sname from tblstaff WHERE salary IN (15000, 25000);
4. D) SELECT * FROM empinfo WHERE ename like ‘[d-p]%’;
5. A) SELECT DISTINCT coursename FROM studentinfo;
6. A) SELECT * FROM empinfo ORDER BY age;
7. D) INSERT INTO stdinfo VALUES (“15”, “Hari Thapa”, 45, 5000);
8. B) DELETE FROM studentinfo WHERE sname=’Hari Prasad’;
9. A) CHECK, FOREIGN KEY
10.C) NON-EQUIJOIN
Test 26:-SQL and Embedded Sql
2) The keyword to eliminate duplicate rows from the query result in SQL is.
A. DISTINCT
B. NO DUPLICATE
C. UNIQUE
D. None of the above
3) Which of the following aggregate function does not ignore nulls in its results?
A. COUNT
B. COUNT(*)
C. MAX
D. MIN
5) ……………. operator is used to compare a value to a list of literals values that have been specified.
A. Like
B. Compare
C. Between
D. In
6) The language used in application programs to request data from the DBMS is referred to as
the
A. DML
B. DDL
C. VDL
D. SDL
13) The ………… operator is used to compare the value to a list of literals values that that have
been specified.
A. BETWEEN
B. ANY
C) IN
D) ALL
14) ………… function divides one numeric expression by another and returns the remainder.
A. POWER
B. MOD
C. ROUND
D. REMAINDER
15) A data manipulation command the combines the record from one or more tables is called.
A) SELECT
B. PROJECT
C. JOIN
D. PRODUCT
19) Which is used to specify the user views and their mappings to the conceptual schema?
A. DDL
B. DML
C. SDL
D. VDL
1) C. DDL
2) C. UNIQUE
3) B. COUNT(*)
4) D. EXISTS
5) A. Like
6) A. DML
7) B. The data manipulation language(DML)
8) D. All of the above
9) B. DDL and DML
10) D. None of these.
11) D. All of the above
12) C. ALTER
13) A. BETWEEN
14) B. MOD
15) C. JOIN
16) A. Data definition language
17) A.Conceptual schema
18) B.DML
19) D.VDL
20) B.DML
Test 27-SQL server
1. ……………………. are predefined and maintained SQL Server and users cannot assign or
directly change the values.
A) Global variables
B) Local Variables
C) Integer Variables
D) Floating Variables
3. Constraint checking can be disabled on existing ……….. and …………. constraints so that any
data you modify or add to the table is not checked against the constraint.
A) CHECK, FOREIGN KEY
B) DELETE, FOREIGN KEY
C) CHECK, PRIMARY KEY
D) PRIMARY KEY, FOREIGN KEY
4. ……………. and ………………. are the Transact – SQL control-of-flow key words.
A) Continue, Stop
B) Break, Stop
C) Continue, While
D) While, Going to
5. The type of constraint …………………… specifies data values that are acceptable in a column.
A) DEFAULT
B) CHECK
C) PRIMARY
D) UNIQUE
6. The ………………… constraint defines a column or combination of columns whose values
match the primary key of the same or another table.
A) DEFAULT
B) CHECK
C) PRIMARY
D) FOREIGN KEY
9. When a …………….. clause is used, each item in the select list must produce a single value
for each group.
A) ORDER BY
B) GROUP
C) GROUP BY
D) GROUP IN
10. MS SQL Server uses a variant of SQL called T-SQL, or Transact SQL, an implementation
of ……………… with some extensions.
A) MS SQL Server
B) Tabular Data Set
C) SQL-92
D) Tabular Data Stream
ANSWERS:
1. A) Global variables
2. A) One @ symbol
3. A) CHECK, FOREIGN KEY
4. C) Continue, While
5. B) CHECK
6. D) FOREIGN KEY
7. C) IF……..ELSE
8. C) Referential integrity
9. C) GROUP BY
10.C) SQL-92
Test 28:Sql server
2. SQL Server 2005 NOT includes the following system database ………….
A) tempdb Database
B) Master Database
C) Model Database
D) sqldb Database
4. ………………… is a read-only database that contains system objects that are included with
SQL Server 2005.
A) Resource Database
B) Master Database
C) Model Database
D) msdb Database
7. The query used to remove all references for the pubs and newspubs databases from the
system tables is ……………………..
A) DROP DATABASE pubs, newpubs;
B) DELETE DATABASE pubs, newpubs;
C) REMOVE DATABASE pubs, newpubs;
D) DROP DATABASE pubs and newpubs;
8. …………………. clause specifies the groups into which output rows are to be placed and, if
aggregate functions are included in the SELECT clause.
A) ORDER BY
B) GROUP
C) GROUP BY
D) GROUP IN
9. ……………… are predefined and maintained SQL Server where users cannot assign or
directly change the values.
A) Local Variables
B) Global Variables
C) Assigned Variables
D) Direct Variables
10. Microsoft SQL Server NOT uses which of the following operator category?
A) Bitwise Operator
B) Unary Operator
C) Logical Operator
D) Real Operator
ANSWERS:
1) In the …………, one transaction inserts a row in the table while the other transaction is
halfway through its browsing of the table.
A. transaction read a problem
B. one way read a problem
C. serial read problem
D. phantom read problem
5) If a transaction obtains a shared lock on a row, it means that the transaction wants to ….. that row.
A. write
B. insert
C. execute
D. read
6) The node where the distributed transaction originates is called the …….
A. local coordinator
B. starting coordinator
C. global coordinator
D. originating node
7) If a transaction obtains an exclusive lock on a row, it means that the transaction wants to
……. that row.
A. select
B. update
C. view
D. read
9) …….. is a specific concurrency problem wherein two transactions depend on each other for
something.
A. phantom read problem
B. transaction read a problem
C. deadlock
D. locking
10) If a database server is referenced in a distributed transaction, the value of its commit
point strength determines which role it plays in the ………
A. two-phase commit
B. two-phase locking
C. transaction locking
D. checkpoints
11) Transaction ………. ensures that the transaction is being executed successfully.
A. concurrency
B. consistency
C. serializability
D. non serialiasability
12) The situation in which a transaction holds a data item and waits for the release of data
item held by some other transaction, which in turn waits for another transaction, is called
…….
A. serializable schedule
B. process waiting
C. concurrency
D. deadlock
13) ………… protocol grantees that a set of transactions becomes serializable.
A. two-phase locking
B. two-phase commit
C. transaction locking
D. checkpoints
14) The global coordinator forgets about the transaction phase is called ………
A. Prepare phase
B. Commit phase
C. Forget phase
D. Global phase
15) In two-phase commit, ………. coordinates the synchronization of the commit or rollback
operations.
A. database manager
B. central coordinator
C. participants
D. concurrency control manager
18) After the nodes are prepared, the distributed transaction is said to be ……
A. in-doubt
B. in-prepared
C. prepared transaction
D. in-node
19) In ………., we have many mini transactions within the main transaction.
A. transaction control
B. chained transaction
C. nested transaction
D. calling transaction
20) In a two-phase locking protocol, a transaction release locks in ……… phase.
A. shrinking phase
B. growing phase
C. running phase
D. initial phase
ANSWERS:
8) The ………. consists of the various applications and database that play a role in a backup
and recovery strategy.
A. Recovery Manager environment
B. Recovery Manager suit
C. Recovery Manager file
D. Recovery Manager database
9) In which the database can be restored up to the last consistent state after the system
failure?
A. Backup
B. Recovery
C. Both
D. None
14) Most backup and recovery commands in ……….. are executed by server sessions.
A. Backup Manager
B. Recovery Manager
C. Backup and Recovery Manager
D. Database Manager
15) …….. systems typically allows to replace failed disks without stopping access to the system.
A. RAM
B. RMAN
C. RAD
D. RAID
16) An ……… is an exact copy of a single data-file, archived redo log file, or control file.
A. image copy
B. data file copy
C. copy log
D. control copy
18) The remote backup site is sometimes called the ………. site.
A. primary
B. secondary
C. ternary
D. None of the above
20) The simplest approach to introducing redundancy is to duplicate every disk is called …..
A. mirroring
B. imaging
C. copying
D. All of the above
ANSWERS:
1) C. Two-phase commit
2) A. Recovery measures
3) D. failure recovery
4) C. Security
5) A. disk errors
6) D. Scalability
7) C. system recovery
8) A. Recovery Manager environment
9) B. Recovery
10) D. stored script
11) B. records
12) B. registration
13) B. Shadow paging
14) B. Recovery Manager
15) D. RAID
16) A. image copy
17) B. RAID level 2
18) B. secondary
19) A. to take Backup of the Oracle Database
20) A. mirroring
For code on matrix refer link :- https://www.geeksforgeeks.org/matrix/
https://www.geeksforgeeks.org/tag/python-string-programs/
https://www.multisoftsystems.com/assessments/python-practice-test
https://play.google.com/store/apps/details?id=ab.design.infyqt_placement
https://codeofgeeks.com/category/infytq-last-year-problems/