Dbms Placement Ques
Dbms Placement Ques
I,
Students(rollno: integer, sname: string) II
Courses(courseno: integer, cname: string)
Registration(rollno: integer, courseno: integer, percent: real)
,
Which of the following queries are equivalent to this query in English? II
"Find the distinct names of all students who score I,
more than 90% in the course numbered 107"
I
V
The minimum number of tables needed to represent M, N, P, R1, R2 is
A2
3
C4
D5
Consider a join (relation algebra) between relations r(R)and s(S) using the
nested loop method. There are 3 buffers each of size equal to disk block
size, out of which one buffer is reserved for intermediate results. Assuming
size(r(R)) < size(s(S)), the join will have fewer number of disk block
accesses if
Consider the relational schema given below, where eId of the relation
dependent is a foreign key referring to empId of the relation employee.
Assume that every employee has at least one associated dependent in the
dependent relation.
employee (empId, empName, empAge)
dependent(depId, eId, depName, depAge)
Consider the following relational algebra query:
The above query evaluates to the set of empIds of employees whose age
is greater than that of
A some dependent.
B all dependents.
C some of his/her dependents
D all of his/her dependents.
A2
B3
C4
D5
In a schema with attributes A, B, C, D and E following set of functional
dependencies are given
A → B A → C CD → E B → D E → A
Which of the following functional dependencies is NOT implied by the
above set?
A CD → AC
B BD → CD
C BC → CD
D AC → BC
A database of research articles in a journal uses the following schema.
(VOLUME, NUMBER, STARTPGE, ENDPAGE, TITLE, YEAR, PRICE)
The primary key is (VOLUME, NUMBER, STARTPAGE, ENDPAGE) and
the following functional dependencies exist in the schema.
(VOLUME, NUMBER, STARTPAGE, ENDPAGE) -> TITLE
(VOLUME, NUMBER) -> YEAR
(VOLUME, NUMBER, STARTPAGE, ENDPAGE) -> PRICE
The database is redesigned to use the following schemas.
(VOLUME, NUMBER, STARTPAGE, ENDPAGE, TITLE, PRICE)
(VOLUME, NUMBER, YEAR)
Which is the weakest normal form that the new database satisfies, but the
old one does not?
A 1NF
B 2NF
C 3NF
D BCNF
A Relation R with FD set {A->BC, B->A, A->C, A->D, D->A}. How many
candidate keys will be there in R?
A1
B2
C3
D4
A m+n and 0
B mn and 0
C m+n and m-n
D mn and m+n
Given two union compatible relations R1(A,B) and R2(C,D). What is the
result of the operation R1⋈A=C∧ B=D R2 A. R1 ∪ R2 B. R1 Χ R2 C. R1 - R2 D. R1 ∩
R2
Aa
Bb
Cc
Dd
C2
D3
Match the following with respect to
RDBMS
:
A (1)
(2)
C (3)
D (4)
Consider the following schema :
Sailors (sid, sname, rating, age)
Boats (bid, bname, colour)
Reserves (sid, bid, day)
Two boats can have the same name but the colour differentiates them.
The two relations
ρ (Tempsids, (Ⲡ sid, bid Reserves)/(Ⲡ bid ( σ bname ='Ganga' Boats))),
Ⲡ sname (Tempsids ⋈ Sailors)
If / is division operation, the above set of relations represents the query
A4
B6
C7
D3
Which one is correct w.r.t. RDBMS ?
A pk(R ) → pk(R )
2 1
B pk(R ) → pk(R )
1 2
C pk(R ) → R ∩ R
2 1 2
D pk(R ) → R ∩ R
1 1 2
A m+n&0
B mn & 0
C m+n&|m-n|
D mn & m + n
Let R(a, b, c) and S(d, e, f) be two relations in which d is the foreign key of
S that refers to the primary key of R. Consider the following four
operations R and S. I. Insert into R II. Insert into S III. Delete from R IV.
Delete from S Which of the following can cause violation of the referential
integrity constraint above?
A Both I and IV
B Both II and III
C All of these
D None of these
Given the relations employee (name, salary, dept-no), and department
(dept-no, dept-name,address) Which of the following queries cannot be
expressed using the basic relational algebra operations (σ, π, x, -, ∪, p)
A I and IV only
B III and IV only
C I, II and III only
D II, III and IV only
In a relational database model, NULL values can be used for all but which
one of the following ?
To allow duplicate tuples in the table by filling the primary key column(s) with
A NULL.
To avoid confusion with actual legitimate data values like 0 (zero) for integer
B columns and ’’ (the empty string) for string columns.
To leave columns in a tuple marked as ’’unknown’’ when the actual value is
C unknown.
To fill a column in a tuple when that column does not really ”exist” for that
D particular tuple.
A A
B AB
C ABC
D ABD
A (a)
B (a), (b) and (c)
C (d)
D (a) and (d)
In RDBMS, which type of Join returns all rows that satisfy the join
condition?
Inner Join
B Outer Join
C Semi Join
D Anti Join
A P and R
B P and S
C Q and R
D Q and S
Which of the following statements are TRUE about an SQL query? P : An
SQL query can contain a HAVING clause even if it does not have a
GROUP BY clause Q : An SQL query can contain a HAVING clause only if
it has a GROUP BY clause R : All attributes used in the GROUP BY
clause must appear in the SELECT clause S : Not all attributes used in the
GROUP BY clause need to appear in the SELECT clause
A P and R
P and S
C Q and R
Q and S
A3
B9
C5
D6
Consider the table employee(empId, name, department, salary) and the
two queries Q1 ,Q2 below. Assuming that department 5 has more than
one employee, and we want to find the employees who get higher salary
than anyone in the department 5, which one of the statements is TRUE for
any arbitrary employee table?
Q1 : Select e.empId
From employee e
Where not exists
(Select * From employee s where s.department = “5” and
s.salary >=e.salary)
Q2 : Select e.empId
From employee e
Where e.salary > Any
(Select distinct salary From employee s Where s.department
= “5”)
A backup
B assertion
C recovery
trigger
The relation book (title, price) contains the titles and prices of different
books. Assuming that no two books have the same price, what does the
following SQL query list?
select title
from book as B
where (select count(*)
from book as T
where T.price > B.price) < 5
A the average salary is more than the average salary in the company
the average salary of male employees is more than the average salary of all
B male employees in the company
the average salary of male employees is more than the average salary of
C employees in the same department
the average salary of male employees is more than the average salary in the
D company
Consider the set of relations shown below and the SQL query that follows.
Students: (Roll_number, Name, Date_of_birth)
Courses: (Course number, Course_name, Instructor)
Grades: (Roll_number, Course_number, Grade)
select distinct Name
from Students, Courses, Grades
where Students. Roll_number = Grades.Roll_number
and Courses.Instructor = Korth
and Courses.Course_number = Grades.Course_number
and Grades.grade = A
Which of the following sets is computed by the above query?
A Names of students who have got an A grade in all courses taught by Korth
B Names of students who have got an A grade in all courses
Names of students who have got an A grade in at least one of the courses
C taught by Korth
D None of the above
Given relations r(w, x) and s(y, z), the result of
SELECT DISTINCT w, x
FROM r, s
is guaranteed to be same as r, provided
A WHERE P1. Capacity> = All (select P2. Capacity from Cinema P2)
B WHERE P1. Capacity> = Any (select P2. Capacity from Cinema P2)
C WHERE P1. Capacity > All (select max(P2. Capacity) from Cinema P2)
D WHERE P1. Capacity > Any (select max (P2. Capacity) from Cinema P2)
Consider the following tables :
A A serializable schedule
B A schedule that is not conflict serializable
C A conflict serializable schedule
D A schedule for which a precedence graph cannot be drawn
Consider the following schedule for transactions T1, T2 and
T3: W
hich one of the schedules below is the correct serialization of the above?
A T1->>T3->>T2
B T2->>T1->>T3
C T2->>T3->>T1
D T3->>T1->>T2
Consider the following four schedules due to three transactions (indicated
by the subscript) using read and write on a data item x, denoted by r(x)
and w(x) respectively. Which one of them is conflict serializable.
AA
BB
CC
DD
Consider the following log sequence of two transactions on a bank
account, with initial balance 12000, that transfer 2000 to a mortgage
payment and then apply a 5% interest.
1. T1 start
2. T1 B old=12000 new=10000
3. T1 M old=0 new=2000
4. T1 commit
5. T2 start
6. T2 B old=10000 new=10500
7. T2 commit
Suppose the database system cra shes just before log record 7 is written.
When the system is restarted, which one statement is true of the recovery
procedure?
Consider three data items D1, D2 and D3 and the following execution
schedule of transactions T1, T2 and T3. In the diagram, R(D) and W(D)
denote the actions reading and writing the data item D
respectively.
Consider the following transaction involving two bank accounts x and y.
read(x); x := x – 50; write(x); read(y); y := y + 50;
write(y)
The constraint that the sum of the accounts x and y should remain
constant is that of
A Atomicity
B Consistency
C Isolation
D Durability
Consider the following database schedule with two transactions, T1 and
T2.
S = r2(X); r1(X); r2(Y); w1(X); r1(Y); w2(X); a1; a2;
where ri(Z) denotes a read operation by transaction Ti on a variable Z,
wi(Z) denotes a write operation by Ti on a variable Z and ai denotes an
abort by transaction Ti . Which one of the following statements about the
above schedule is TRUE?
A S is non-recoverable
B S is recoverable, but has a cascading abort
C S does not have a cascading abort
D S is strict
Consider the following three schedules of transactions T1, T2 and T3.
[Notation: In the following NYO represents the action Y (R for read, W for
write) performed by transaction N on object O.]
(S1) 2RA 2WA 3RC 2WB 3WA 3WC 1RA 1RB 1WA 1WB
(S2) 3RC 2RA 2WA 2WB 3WA 1RA 1RB 1WA 1WB 3WC
(S3) 2RA 3RC 3WA 2WA 2WB 3WC 1RA 1RB 1WA 1WB
Which of the following statements is TRUE?
A S1, S2 and S3 are all conflict equivalent to each other
B No two of S1, S2 and S3 are conflict equivalent to each other
C S2 is conflict equivalent to S3, but not to S1
D S1 is conflict equivalent to S2, but not to S3