top of page
  • Facebook
  • Twitter
  • Instagram

Placement Preparation Questions

Placement Preparation questions are free resources offered by mobiprep that can help you ace any company placement process. We have curated a list of the most important MCQ questions which are asked in most companies such as Infosys, TCS, Wipro, Accenture, etc. The placement preparation questions also have detailed explanations for every question ensuring you revise all the questions with detailed answers and explanations.

Q

21

A relation has 6 attributes a1, a2, a3, a4, a5 and a6. The candidate key is ‘a2a3a4’. What is the possible number of super keys?

a.

7

b.

8

c.

16

d.

15

Correct Answer & Explanation:

b

If a relation has ‘n’ attributes and the candidate key is ‘a1a2a3’ (3 attributes combined together as a candidate key), then the number of possible super keys are 2^n-3. Hence, the number of possible super keys is 2^6-3=2^3=8

Q

22

Which of the following is a sparse index?

a.

Clustered index

b.

Secondary index for unsorted data

c.

Multi-level index

d.

Both a and c

Correct Answer & Explanation:

d

Clustered indexes are created for groups of columns considered together. Hence, clustered index is a sparse index.
Data is not sorted in secondary index. So, secondary index is a dense index.
Multi-level index is the index of an index. So, it is always sparse.

Q

23

Bitmap indexing is preferred when ____

a.

Cardinality>1

b.

Cardinality=1

c.

Cardinality<1

d.

Cardinality<=1

Correct Answer & Explanation:

c

Bitmap indexes are more suitable for low-cardinality columns. Low cardinality means that the values of an attribute are less unique. Bit map index is used when a non-unique column is indexed. So, the correct answer is cardinality<1.

Q

24

Which of the following is the correct domain relational calculus expression?

a.

{P(x1, x2,…, xn) | <x1, x2,…,xn>}

b.

{<x1 x2,…,xn> | P(x1, x2,…,xn)}

c.

{ x1, x2,…, xn | x1, x2,…,xn}

d.

{x1, x2,…,xn | <x1, x2,…,xn>}

Correct Answer & Explanation:

b

x1, x2,…, xn are the domain variables. P is the condition or the predicate calculus formula. Hence, the correct expression for domain relational calculus is {<x1 x2,…,xn> | P(x1, x2,…,xn)}

Q

25

Find the Name of the students who secured marks more than 80.

a.

{t.name | t ɛ student ʌ t[marks]>80}

b.

{t | t ɛ student v t[marks]>80}

c.

{t | t[name] = student & t[marks]>80}

d.

None of the above

Correct Answer & Explanation:

a

Option a) is the correct answer as it is in the tuple relational calculus format.

Q

26

Consider the two relations given below: Student (roll_no, name, address) Course (roll_no, course_id, course_name) The Student and the Course relations have 50 and 16 tuples respectively. What is the minimum and maximum number of tuples that are present in the natural join of the given relations?

a.

0, 16

b.

16, 50

c.

16, 16

d.

50, 66

Correct Answer & Explanation:

c

The natural join consists of the set of all combinations of tuples of both the relations that are equal on their common attribute.
As the two relations have a common attribute, the maximum number of tuples in their natural join will be equal to the number of tuples in the smaller table.
The minimum number of tuples in the natural join of the two relations is 16, because every tuple in Course will have a parent in the Student relation.

Q

27

Consider the two relations x(a,b) and y(c,d). SELECT DISTINCT a,b FROM x,y If the output of the above query should be as same as x, then

a.

x and y have no duplicates

b.

x has no duplicates and y is not empty

c.

x is not empty and y has no duplicates

d.

x and y have the same number of tuples

Correct Answer & Explanation:

b

If no condition is given while joining two tables, then the output will be the Cartesian product of the two tables. For the result to be as same as x, x should not have any duplicates (DISTINCT keyword is used). y should not be empty, because if y is empty, the result will also be empty.

Q

28

Which of the following SQL queries is used to obtain details of the first two top scorers in the class?

a.

SELECT *
FROM Students
ORDER BY Marks
LIMIT 2

b.

SELECT *
FROM Students
ORDER BY Marks DESC
LIMIT 2

c.

SELECT Name
FROM Students
ORDER BY Marks DESC
LIMIT 2, 2

d.

None of the above

Correct Answer & Explanation:

b

The ORDER BY clause along with DESC keyword is used to sort the tuples in descending order. The LIMIT 2 clause is used to select the first two tuples. Hence, the correct answer is option b)

Q

29

A student can take at most 7 courses in a year. The number of students allowed in a course in a year is not more than 120. The student – course relationship is

a.

7 :120

b.

120:7

c.

N:120

d.

7:N

Correct Answer & Explanation:

b

There can be 120 students at the maximum in one course. Each student can take up to 7 courses. Hence, the student-course relationship is 120:7

Q

30

A relation in 3NF can be converted to BCNF by the

a.

Removal of multi-valued dependencies

b.

Removal of composite keys

c.

dependent non-key attributes are put in a separate relation

d.

dependent attributes of overlapping composite keys are put in a separate relation

Correct Answer & Explanation:

d

BCNF does not allow dependencies between the attributes of the candidate key. So, to convert a relation from 3NF to BCNF, dependent attributes of overlapping composite keys should be put in a separate relation.

bottom of page