Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 43

1.

Which of the following statements are Table C


TRUE about an SQL query? Id Phone Area
P : An SQL query can contain a HAVING -----------------
clause even 10 2200 02
if it does not have a GROUP BY clause 99 2100 01
Q : An SQL query can contain a HAVING Consider the above tables A, B and C. How many tuples does the
clause only result of the following SQL query contains?
if it has a GROUP BY clause SELECT A.id
R : All attributes used in the GROUP BY FROM A
clause must WHERE A.age > ALL (SELECT B.age FROM B
appear in the SELECT clause WHERE B. name = "arun")
S : Not all attributes used in the GROUP
BY clause a. 4
need to appear in the SELECT clause
b. 3
a. P and R
c. 0
b. P and S
d. 1
c. Q and R
View Answer Report Discuss Too Difficult! Search Google
d. Q and S
Answer: (b).3
View Answer Report Discuss Too Difficult! Search Google

Answer: (c).Q and R 3. Consider a database table T containing two


columns X and Y each of type integer. After the
creation of the table, one record (X=1, Y=1) is
2. Table A inserted in the table. Let MX and My denote the
Id Name Age respective maximum values of X and Y among all
---------------- records in the table at any point in time. Using MX
12 Arun 60 and MY, new records are inserted in the table 128
15 Shreya 24 times with X and Y values being MX+1, 2*MY+1
99 Rohit 11 respectively. It may be noted that each time after
the insertion, values of MX and MY change. What
Table B will be the output of the following SQL query after
Id Name Age the steps mentioned above are carried out?
---------------- SELECT Y FROM T WHERE X=7;
15 Shreya 24
25 Hari 40 a. 127
98 Rohit 20
99 Rohit 11 b. 255
c. 129 1 Rahul 66
2 Sourav 67
d. 257 3 Anil 69

View Answer Report Discuss Too Difficult! Search Google Table : Reservation
pid class tid
Answer: (a).127 ---------------
0 AC 8200
1 AC 8201
4. Database table by name Loan_Records is given below. 2 SC 8201
Borrower Bank_Manager Loan_Amount 5 AC 8203
Ramesh Sunderajan 10000.00 1 SC 8204
Suresh Ramgopal 5000.00 3 AC 8202
Mahesh Sunderajan 7000.00 What pids are returned by the following SQL query for the above instance
What is the output of the following SQL query? of the tables?
SELECT pid
SELECT Count(*) FROM Reservation ,
FROM ( (SELECT Borrower, Bank_Manager WHERE class ‘AC’ AND
FROM Loan_Records) AS S EXISTS (SELECT *
NATURAL JOIN (SELECT Bank_Manager, FROM Passenger
Loan_Amount WHERE age > 65 AND
FROM Loan_Records) AS T ); Passenger. pid = Reservation.pid)

a. 3 a. 1, 0

b. 9 b. 1, 2

c. 5 c. 1, 3

d. 6 d. 1, 5

View Answer Report Discuss Too Difficult! Search Google View Answer Report Discuss Too Difficult! Search Google

Answer: (c).5 Answer: (c).1, 3

5. A relational schema for a train reservation database is given below. 6. Consider the following relational schema:
Passenger (pid, pname, age) Reservation (pid, class, tid)
Suppliers(sid:integer, sname:string, city:string,
Table: Passenger street:string)
pid pname age Parts(pid:integer, pname:string, color:string)
----------------- Catalog(sid:integer, pid:integer, cost:real)
0 Sachin 65
Consider the following relational query on the above s.salary >=e.salary)
database: Q2 : Select e.empId
From employee e
SELECT S.sname Where e.salary > Any
FROM Suppliers S (Select distinct salary From employee s Where
WHERE S.sid NOT IN (SELECT C.sid s.department = “5”)
FROM Catalog C
WHERE C.pid NOT IN (SELECT P.pid a. Q1 is the correct query
FROM Parts P
WHERE P.color<> 'blue')) b. Q2 is the correct query

Assume that relations corresponding to the above c. Both Q1 and Q2 produce the same answer
schema are not empty. Which one of the following is
the correct interpretation of the above query? d. Neither Q1 nor Q2 is the correct quer

a. Find the names of all suppliers who have supplied a View Answer Report Discuss Too Difficult! Search Google
non-blue part.
Answer: (b).Q2 is the correct query
b. Find the names of all suppliers who have not
supplied a non-blue part.
8. Given the following statements:
c. Find the names of all suppliers who have supplied
only blue parts.
S1: A foreign key declaration can always
be replaced by an equivalent check
d. Find the names of all suppliers who have not
assertion in SQL.
supplied only blue parts.
S2: Given the table R(a,b,c) where a and
b together form the primary key, the
View Answer Report Discuss Too Difficult! Search Google
following is a valid table definition.
CREATE TABLE S (
Answer: (a).Find the names of all suppliers who have supplied a non-blue part.
a INTEGER,
d INTEGER,
e INTEGER,
7. Consider the table employee(empId, name, department, PRIMARY KEY (d),
salary) and the two queries Q1 ,Q2 below. Assuming FOREIGN KEY (a) references R)
that department 5 has more than one employee, and we Which one of the following statements is CORRECT?
want to find the employees who get higher salary than
anyone in the department 5, which one of the a. S1 is TRUE and S2 is FALSE
statements is TRUE for any arbitrary employee table?
Q1 : Select e.empId b. Both S1 and S2 are TRUE
From employee e
Where not exists c. S1 is FALSE and S2 is TRUE
(Select * From employee s where s.department = “5”
and d. Both S1 and S2 are FALSE
View Answer Report Discuss Too Difficult! Search Google a. select R.* from R, S where R.a=S.a (D)

Answer: (d).Both S1 and S2 are FALSE b. select distinct R.* from R,S where R.a=S.a

c. select R.* from R,(select distinct a from S) as S1 where R.a=S1.a


9. Given the following schema:
d. select R.* from R,S where R.a=S.a and is unique R
employees(emp-id, first-name, last-name, hire-date, dept-id, salary)
departments(dept-id, dept-name, manager-id, location-id) View Answer Report Discuss Too Difficult! Search Google

You want to display the last names and hire dates of all latest hiresAnswer:
in (c).select R.* from R,(select distinct a from S) as S1 where R.a=S1.a
their respective departments
in the location ID 1700. You issue the following query: Bits
UGC NET MCQs
Networking MCQSoftware Engineering MCQSystems Programming
SQL> SELECT last-name, hire-date MCQUNIX System MCQNeural Networks MCQFuzzy Systems MCQ
FROM employees GATE CSE MCQs
WHERE (dept-id, hire-date) IN Computer Architecture MCQDBMS MCQNetworking MCQ
(SELECT dept-id, MAX(hire-date) C Programs
FROM employees JOIN departments USING(dept-id) C - Arrays and Pointers
WHERE location-id = 1700 C - Stacks and Queues
GROUP BY dept-id); C - Linked Lists
C - Matrices
What is the outcome? HOME /

GATE STUDY MATERIAL /


a. It executes but does not give the correct result
DBMS /
b. It executes and gives the correct result
11. Consider the following relational schema:
c. generates an error because of pairwise comparison
employee(empId, empName, empDept)
d. It generates an error because the GROUP BY clause cannot be used customer(custId, custName, salesRepId, rating)
with table joins in a subquery
salesRepId is a foreign key referring to empId of the employee relation.
View Answer Report Discuss Too Difficult! Search Google Assume that each employee makes a sale to at least one customer.
What does the following query return?
Answer: (b).It executes and gives the correct result
SELECT empName
FROM employee E
WHERE NOT EXISTS (SELECT custId
10. SQL allows tuples in relations, and correspondingly defines the multiplicity of tuples in the result
FROM customer C
of joins. Which one of the following queries always gives the same answer as the nested query
WHERE C.salesRepId = E.empId
shown below:
AND C.rating <> ’GOOD’);
select * from R where a in (select S.a from S)
a. Names of all the employees with at least one of their customers having a (d).drop
Answer: ‘GOOD’
rating.

b. Names of all the employees with at most one of their customers having a ‘GOOD’
14. Consider the relation account (customer, balance) where customer
rating. is a primary key and there are no null values. We would like to rank
customers according to decreasing balance. The customer with the
c. Names of all the employees with none of their customers having a ‘GOOD’ rating.
largest balance gets rank 1. ties are not broke but ranks are
skipped: if exactly two customers have the largest balance they
d. Names of all the employees with all their customers having a ‘GOOD’ rating.
each get rank 1 and rank 2 is not assigned
Query1:
View Answer Report Discuss Too Difficult! Search Google select A.customer, count(B.customer)
from account A, account B
Answer: (d).Names of all the employees with all their customers having a ‘GOOD’
whererating.
A.balance <=B.balance
group by A.customer

12. The statement that is executed automatically by the system Query2:


as a side effect of the modification of the database is select A.customer, 1+count(B.customer)
from account A, account B
a. backup where A.balance < B.balance
group by A.customer
b. assertion
Consider these statements about Query1 and Query2.
c. recovery
1. Query1 will produce the same row set as Query2 for
d. trigger some but not all databases.
2. Both Query1 and Query2 are correct implementation
View Answer Report Discuss Too Difficult! Search Google of the specification
3. Query1 is a correct implementation of the specification
Answer: (d).trigger but Query2 is not
4. Neither Query1 nor Query2 is a correct implementation
of the specification
13. 5. Assigning rank with a pure relational query takes
Which of the following command is used to delete a table in SQL?
less time than scanning in decreasing balance order
a. delete assigning ranks using ODBC.

b. truncate Which two of the above statements are correct?

a. 2 and 5
c. remove
b. 1 and 3
d. drop
c. 1 and 4
View Answer Report Discuss Too Difficult! Search Google
d. 3 and 5 16. The following table has two attributes A and C where A is the primary
key and C is the foreign key referencing A with on-delete cascade.
View Answer Report Discuss Too Difficult! Search Google
AC
Answer: (c).1 and 4 -----
24
34
15. 43
Consider the relation "enrolled(student, course)" in which (student, course)
52
is the primary key, and the relation "paid(student, amount)" where student
72
is the primary key. Assume no null values and no foreign keys or integrity
constraints. Given the following four queries: 95
64
Query1: select student from enrolled where
student in (select student from paid) The set of all tuples that must be additionally deleted to preserve
Query2: select student from paid where referential integrity when the tuple (2,4) is deleted is:
student in (select student from enrolled)
Query3: select E.student from enrolled E, paid P a. (3,4) and (6,4)
where E.student = P.student
Query4: select student from paid where exists b. (5,2) and (7,2)
(select * from enrolled where enrolled.student
= paid.student) c. (5,2), (7,2) and (9,5)

Which one of the following statements is correct? d. (3,4), (4,3) and (6,4)

a. All queries return identical row sets for any database View Answer Report Discuss Too Difficult! Search Google

b. Query2 and Query4 return identical row sets for all databases butAnswer:
there (c).(5,2), (7,2) and (9,5)
exist databases for which Query1 and Query2 return different row sets.

c. There exist databases for which Query3 returns strictly fewer rows
17.thanThe relation book (title, price) contains the titles and prices of
Query2 different books. Assuming that no two books have the same price,
what does the following SQL query list?
d. There exist databases for which Query4 will encounter an integrity violation
at runtime. select title
from book as B
View Answer Report Discuss Too Difficult! Search Google where (select count(*)
from book as T
Answer: (a).All queries return identical row sets for any database where T.price > B.price) < 5

a. Titles of the four most expensive books

b. Title of the fifth most inexpensive book


c. 19. books
Title of the fifth most expensive bookTitles of the five most expensive The employee information in a company is stored in the relation
Employee (name, sex, salary, deptName)
d. Titles of the five most expensive books (name is primary key )
Consider the following SQL query
View Answer Report Discuss Too Difficult! Search Google
select deptName
Answer: (d).Titles of the five most expensive books from Employee
where sex = 'M'
group by deptName
18. Consider the following relation having avg (salary) > (select avg (salary) from Employee)
schema pertaining to a students
database: It returns the names of the department in which

Student (rollno, name, address) a. the average salary is more than the average salary in the
Enroll (rollno, courseno, company
coursename)
b. the average salary of male employees is more than the average
where the primary keys are salary of all male employees in the company
rollno,courseno. The number of
tuples in the Student and Enroll c. the average salary of male employees is more than the average
tables are 120 and 8 respectively. salary of employees in the same department
What are the maximum and
minimum number of tuples that d. the average salary of male employees is more than the average
can be present in (Student * salary in the company
Enroll), where '*' denotes natural
join ? View Answer Report Discuss Too Difficult! Search Google

a. 8, 0 Answer: (d).the average salary of male employees is more than the average
salary in the company
b. 120, 8

c. 960, 8 20. Consider the set of relations shown below and the SQL query
that follows.
d. 960, 120
Students: (Roll_number, Name, Date_of_birth)
View Answer Report Discuss Too Difficult! Search Google Courses: (Course number, Course_name, Instructor)
Grades: (Roll_number, Course_number, Grade)
Answer: (a).8, 0
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 Answer: (a).r has no duplicates and s is non-empty

Which of the following sets is computed by the above query?


22. In SQL, relations can contain null values, and comparisons
with null values are treated as unknown. Suppose all
comparisons with a null value are treated as false.
Which of the following pairs is not equivalent?

a. x = 5 AND not(not(x = 5))

b. x = 5 AND x> 4 and x < 6, where x is an integer

c. x < 5 AND not (x = 5)


a. Names of students who have got an A grade in all courses
taught by Korth d. None of the above

b. Names of students who have got an A grade in all courses View Answer Report Discuss Too Difficult! Search Google

c. Names of students who have got an A grade in at least one of Answer: (c).x < 5 AND not (x = 5)
the courses taught by Korth

d. None of the above 23. Consider the following three table to store student
enrollements in different courses.
View Answer Report Discuss Too Difficult! Search Google
Student(EnrollNo, Name)
Answer: (c).Names of students who have got an A grade in at least one of theCourse(CourseID,
courses taught byName)
Korth
EnrollMents(EnrollNo, CourseID)
21. Given relations r(w, x) and s(y, z), the result of (EnrollNo,CourseID are primary keys)

SELECT DISTINCT w, x What does the following query do?


FROM r, s
SELECT S.Name
is guaranteed to be same as r, provided FROM Student S, Course C, Enrollments E
WHERE S.EnrollNo = E.EnrollNo AND
a. r has no duplicates and s is non-empty C.Name = "DBMS" AND
E.CourseID = C.CourseID AND
b. r and s have no duplicates S.EnrollNo IN
(SELECT S2.EnrollNo
c. s has no duplicates and r is non-empty FROM Student S2, Course C2, Enrollments E2
WHERE S2.EnrollNo = E2.EnrollNo AND
d. r and s have the same number of tuples E2.CourseID = C2.CourseID
C2.Name = "OS")
View Answer Report Discuss Too Difficult! Search Google
a. Answer: (c).5
Name of all students who are either enrolled in "DBMS" or "OS" courses

b. Name of all students who are enrolled in "DBMS" and "OS"


25. Select operation in SQL is equivalent to
c. Name of all students who are either enrolled in "DBMS" or "OS" or both
a. the selection operation in relational algebra
d. None of the above
b. the selection operation in relational algebra, except that
View Answer Report Discuss Too Difficult! Search Google select in SQL retains duplicates

Answer: (b).Name of all students who are enrolled in "DBMS" and "OS" c. the projection operation in relational algebra

d. the projection operation in relational algebra, except that


24. Consider the following Employee table select in SQL retains duplicates

ID salary DeptName View Answer Report Discuss Too Difficult! Search Google
1 10000 EC
2 40000 EC Answer: (d).the projection operation in relational algebra,
3 30000 CS except that select in SQL retains duplicates
4 40000 ME
5 50000 ME
6 60000 ME 26. Consider the following relation
7 70000 CS
Cinema (theater, address, capacity)
How many rows are there in the result of following query?
Which of the following options will be needed at the end of the
SELECT E.ID SQL query
FROM Employee E
WHERE EXISTS (SELECT E2.salary SELECT P1. address
FROM Employee E2 FROM Cinema P1
WHERE E2.DeptName = 'CS'
AND E.salary > E2.salary) Such that it always finds the addresses of theaters with maximum
capacity?
a. 0
a. WHERE P1. Capacity> = All (select P2. Capacity from Cinema P2)
b. 4
b. WHERE P1. Capacity> = Any (select P2. Capacity from Cinema P2)
c. 5
c. WHERE P1. Capacity > All (select max(P2. Capacity) from Cinema P2)
d. 6
d. WHERE P1. Capacity > Any (select max (P2. Capacity) from Cinema P2
View Answer Report Discuss Too Difficult! Search Google
View Answer Report Discuss Too Difficult! Search Google
Answer: (a).WHERE P1. Capacity> = All (select P2. Capacity from Cinema P2)
28. A table 'student' with schema (roll, name, hostel, marks), and another table
'hobby' with schema (roll, hobbyname) contains records as shown below:
27. A company maintains records of sales made by its salespersons and pays them commission based on each individual's total
Table: Student
sales made in a year. This data is maintained in a table with following schema:

salesinfo = (salespersonid, totalsales, commission) ROLL NAME HOSTEL MARKS


1798 Manoj
In a certain year, due to better business results, the company decides Rathod
to further 7 95 its salespersons by enhancing the
reward
commission paid to them as per the following formula: 2154 Soumic Banerjee 5 68
If commission < = 50000, enhance it by 2% If 50000 < commission 2369<Gumma Reddy
= 100000, 7 86 it by 4% If commission > 100000,
enhance
enhance it by 6% 2581 Pradeep Pendse 6 92
2643 Suhas Kulkarni 5 78
The IT staff has written three different SQL scripts to calculate 2711 Nitin Kadam
enhancement 8 72 slab, each of these scripts is to run as a
for each
separate transaction as follows: 2872 Kiran Vora 5 92
2926 Manoj Kunkalikar 5 94
T1 2959 Hemant Karkhanis 7 88
Update salesinfo 3125 Rajesh Doshi 5 82
Set commission = commission * 1.02
Where commission < = 50000; Table: hobby

T2 ROLL HOBBYNAME
Update salesinfo 1798 chess
Set commission = commission * 1.04 1798 music
Where commission > 50000 and commission is < = 100000; 2154 music
2369 swimming
T3 2581 cricket
Update salesinfo 2643 chess
Set commission = commission * 1.06 2643 hockey
Where commission > 100000; 2711 volleyball
2872 football
2926
Which of the following options of running these transactions will cricket
update the commission of all salespersons correctly?
2959 photography
a. Execute T1 followed by T2 followed by T3 3125 music
3125 chess
b. Execute T2, followed by T3; T1 running concurrently throughout The following SQL query is executed on the above tables:

c. Execute T3 followed by T2; T1 running concurrently throughoutselect hostel


from student natural join hobby
d. Execute T3 followed by T2 followed by T1 where marks > = 75 and roll between 2000 and 3000;
Relations S and H with the same schema as those of these two tables
View Answer Report Discuss Too Difficult! Search Google respectively contain the same information as tuples. A new relation S’ is
obtained by the following relational algebra operation: S’ = ∏hostel ((σs.roll =
Answer: (d).Execute T3 followed by T2 followed by T1 H.roll (σmarks > 75 and roll > 2000 and roll < 3000 (S))
X (H)) The difference between the number of rows output by the SQL statement and the
30. Consider number
the of tuples
relations in R)
r1(P, Q, S’ is
and r2(R, S, T)
with primary keys P and R respectively. The
a. 6 relation r1 contains 2000 tuples and r2 contains
2500 tuples. The maximum size of the join r1⋈ r2
b. 4 is :

c. 2 a. 2000

d. 0 b. 2500

View Answer Report Discuss Too Difficult! Search Google c. 4500

Answer: (b).4 d. 5000

View Answer Report Discuss Too Difficult! Search Google


29. In an inventory management system implemented at a trading corporation, there are several tables designed to hold all the
Answer:
information. Amongst these, the following two tables hold information (a).2000
on which items are supplied by which suppliers, and which
warehouse keeps which items along with the stock-level of these items. Supply = (supplierid, itemcode) Inventory = (itemcode,
warehouse, stocklevel) For a specific information required by the 31. Student (school-id,
management, sch-roll-no,
following SQL sname,
query has beensaddress)
written
School (school-id, sch-name, sch-address, sch-
Select distinct STMP.supplierid phone)
From Supply as STMP Enrolment(school-id sch-roll-no, erollno,
Where not unique (Select ITMP.supplierid examname)
From Inventory, Supply as ITMP ExamResult(erollno, examname, marks)
Where STMP.supplierid = ITMP.supplierid
And ITMP.itemcode = Inventory.itemcode What does the following SQL query output?
And Inventory.warehouse = 'Nagpur');
SELECT sch-name, COUNT (*)
For the warehouse at Nagpur, this query will find all suppliers who FROM School C, Enrolment E, ExamResult R
WHERE E.school-id = C.school-id
a. do not supply any item AND
E.examname = R.examname AND E.erollno =
b. supply exactly one item R.erollno
AND
c. supply one or more items R.marks = 100 AND S.school-id IN (SELECT
school-id
d. supply two or more items FROM student
GROUP BY school-id
View Answer Report Discuss Too Difficult! Search Google HAVING COUNT (*) > 200)
GROUP By school-id
Answer: (d).supply two or more items
a. for each school with more than 200 students
appearing in exams, the name of the school and
the number of 100s scored by its students b. relation s(S) is in the outer loop

c. join selection factor between r(R) and s(S) is more than 0.5
b. for each school with more than 200 students in it,
the name of the school and the number of 100s d. join selection factor between r(R) and s(S) is less than 0.5
scored by its students
View Answer Report Discuss Too Difficult! Search Google
c. for each school with more than 200 students in it,
the name of the school and the number of its Answer: (a).relation r(R) is in the outer loop
students scoring 100 in at least one exam

d. nothing; the query has a syntax error


34. Let E1 and E2 be two entities in an E/R diagram with simple
single-valued attributes. R1 and R2 are two relationships
View Answer Report Discuss Too Difficult! Search Google
between E1 and E2, where R1 is one-to-many and R2 is many-
to-many. R1 and R2 do not have any attributes of their own.
Answer: (d).nothing; the query has a syntax error
What is the minimum number of tables required to represent this
situation in the relational model?
32. Given the basic ER and relational models, which of the a. 2
following is INCORRECT?
b. 3
a. An attribute of an entity can have more than one value
c. 4
b. An attribute of an entity can be composite
d. 5
c. In a row of a relational table, an attribute can have more than
one value View Answer Report Discuss Too Difficult! Search Google
d. In a row of a relational table, an attribute can have exactly one
Answer: (b).3
value or a NULL value

View Answer Report Discuss Too Difficult! Search Google


35. In a schema with attributes A, B, C, D and E following set of
Answer: (c).In a row of a relational table, an attribute can have more than onefunctional
value dependencies are given

A → B A → C CD → E B → D E → A
33. Consider a join (relation algebra) between relations r(R)and s(S) Which of the following functional dependencies is NOT
using the nested loop method. There are 3 buffers each of size implied by the above set?
equal to disk block size, out of which one buffer is reserved for
intermediate results. Assuming size(r(R)) < size(s(S)), the join a. CD → AC
will have fewer number of disk block accesses if
b. BD → CD
a. relation r(R) is in the outer loop
c. BC → CD 37. Which of the following relational query languages have the same
expressive power?
d. AC → BC
1.Relational algebra
View Answer Report Discuss Too Difficult! Search Google 2.Tuple relational calculus restricted to safe expressions
3.Domain relational calculus restricted to safe expressions
Answer: (b).BD → CD
a. II and III only

36. A database of research articles in a journal uses the following b. I and II only
schema.
c. I and III only
(VOLUME, NUMBER, STARTPGE, ENDPAGE, TITLE, YEAR,
PRICE) d. I, II and III

The primary key is (VOLUME, NUMBER, STARTPAGE, View Answer Report Discuss Too Difficult! Search Google
ENDPAGE) and the following functional dependencies exist in the
schema. Answer: (d).I, II and III

(VOLUME, NUMBER, STARTPAGE, ENDPAGE) -> TITLE


(VOLUME, NUMBER) -> YEAR 38. A Relation R with FD set {A->BC, B->A, A->C, A->D, D->A}.
(VOLUME, NUMBER, STARTPAGE, ENDPAGE) -> PRICE How many candidate keys will be there in R?

The database is redesigned to use the following schemas. a. 1

(VOLUME, NUMBER, STARTPAGE, ENDPAGE, TITLE, PRICE)b. 2


(VOLUME, NUMBER, YEAR)
c. 3
Which is the weakest normal form that the new database satisfies,
but the old one does not? d. 4

a. 1NF View Answer Report Discuss Too Difficult! Search Google

b. 2NF Answer: (c).3


c. 3NF
39. What is the min and max number of tables required to convert an
d. BCNF
ER diagram with 2 entities and 1 relationship between them with
partial participation constraints of both entities?
View Answer Report Discuss Too Difficult! Search Google
a. Min 1 and max 2
Answer: (b).2NF
b. Min 1 and max 3 DBMS /

c. Min 2 and max 3 41. Consider the FDs given in above question. The relation R is

d. Min 2 and max 2 a. in 1NF, but not in 2NF

View Answer Report Discuss Too Difficult! Search Google b. in 2NF, but not in 3NF

Answer: (c).Min 2 and max 3 c. in 3NF, but not in BCNF

d. in BCNF
40. Relation R has eight attributes ABCDEFGH. Fields of View Answer Report Discuss Too Difficult! Search Google
R contain only atomic values. F = {CH -> G, A -> BC,
B -> CFH, E -> A, F -> EG} is a set of functional Answer: (a).in 1NF, but not in 2NF
dependencies (FDs) so that F+ is exactly the set of
FDs that hold for R. How many candidate keys does
the relation R have?
42. Which of the following is TRUE?
a. 3
a. Every relation in 3NF is also in BCNF
b. 4
b. A relation R is in 3NF if every non-prime attribute of R is fully
c. 5 functionally dependent on every key of R

c. Every relation in BCNF is also in 3NF


d. 6
d. No relation can be in both BCNF and 3NF
View Answer Report Discuss Too Difficult! Search Google
View Answer Report Discuss Too Difficult! Search Google
Answer: (b).4
Answer: (c).Every relation in BCNF is also in 3NF
Bits
UGC NET MCQs
Networking MCQSoftware Engineering MCQSystems Programming
MCQUNIX System MCQNeural Networks MCQFuzzy Systems MCQ
GATE CSE MCQs
Computer Architecture MCQDBMS MCQNetworking MCQ
C Programs
C - Arrays and Pointers
C - Stacks and Queues
C - Linked Lists
C - Matrices
HOME /

GATE STUDY MATERIAL /


43. Consider a relational table with a single record for each registered Which one of the following option is INCORRECT?
student with the following attributes.

1. Registration_Num: Unique registration number


of each registered student
2. UID: Unique identity number, unique at the
national level for each citizen
3. BankAccount_Num: Unique account number at
the bank. A student can have multiple accounts
or join accounts. This attribute stores the
primary account number.
4. Name: Name of the student
5. Hostel_Room: Room number of the hostel

Which one of the following option is INCORRECT?


a. BankAccount_Num is candidate key
a. BankAccount_Num is candidate key
b. Registration_Num can be a primary key
b. Registration_Num can be a primary key
c. UID is candidate key if all students are from the same country
c. UID is candidate key if all students are from the same country
d. If S is a superkey such that S∩UID is NULL then S∪UID is also a superk
d. If S is a superkey such that S∩UID is NULL then S∪UID is also a
superkey View Answer Report Discuss Too Difficult! Search Google

View Answer Report Discuss Too Difficult! Search Google Answer: (a).BankAccount_Num is candidate key

45. Consider the following relational schema:


44. Consider a relational table with a single record for each registered student
with the following attributes. Suppliers(sid:integer, sname:string, city:string, street:string)
Parts(pid:integer, pname:string, color:string)
1. Registration_Num: Unique registration number Catalog(sid:integer, pid:integer, cost:real)
of each registered student (sid,pid are primary keys)
2. UID: Unique identity number, unique at the Assume that, in the suppliers relation above, each supplier and
national level for each citizen each street within a city has a unique name, and (sname, city)
3. BankAccount_Num: Unique account number at forms a candidate key. No other functional dependencies are
the bank. A student can have multiple accounts implied other than those implied by primary and candidate keys.
or join accounts. This attribute stores the Which one of the following is TRUE about the above schema?
primary account number.
4. Name: Name of the student a. The schema is in BCNF
5. Hostel_Room: Room number of the hostel
b. The schema is in 3NF but not in BCNF
c. The schema is in 2NF but not in 3NF c. {E, F, H, K, L}

d. The schema is not in 2NF d. {E}

View Answer Report Discuss Too Difficult! Search Google View Answer Report Discuss Too Difficult! Search Google

Answer: (a).The schema is in BCNF Answer: (b).{E, F, H}

46. Consider the following relational schemes for a library database: 48. Given the following two statements:
Book (Title, Author, Catalog_no, Publisher, Year, Price)
Collection (Title, Author, Catalog_no) with in the following S1: Every table with two single-valued
functional dependencies: attributes is in 1NF, 2NF, 3NF and BCNF.

I. Title Author --> Catalog_no S2: AB->C, D->E, E->C is a minimal cover for
II. Catalog_no --> Title, Author, Publisher, Year the set of functional dependencies
III. Publisher Title Year --> Price AB->C, D->E, AB->E, E->C.

Assume {Author, Title} is the key for both schemes. Which of the Which one of the following is CORRECT?
following statements is true?
a. S1 is TRUE and S2 is FALSE
a. Both Book and Collection are in BCNF
b. Both S1 and S2 are TRUE
b. Both Book and Collection are in 3NF only
c. S1 is FALSE and S2 is TRUE
c. Book is in 2NF and Collection is in 3NF
d. Both S1 and S2 are FALSE
d. Both Book and Collection are in 2NF only
View Answer Report Discuss Too Difficult! Search Google
View Answer Report Discuss Too Difficult! Search Google
Answer: (a).S1 is TRUE and S2 is FALSE
Answer: (c).Book is in 2NF and Collection is in 3NF
49. The maximum number of superkeys for the relation
schema R(E,F,G,H) with E as the key is
47. Consider the relation scheme R = {E, F, G, H, I, J, K, L, M, M} and the set of
functional dependencies {{E, F} -> {G}, {F} -> {I, J}, {E, H} -> {K, L},
a. K ->
5 {M}, L
-> {N} on R. What is the key for R?
b. 6
a. {E, F}
c. 7
b. {E, F, H}
d. 8
View Answer Report Discuss Too Difficult! Search Google >A}. What are the candidate keys of R?

Answer: (d).8
a. AE, BE

50. b. AE, BE, DE


Which one of the following statements about normal forms is FALSE?
c. AEH, BEH, BCH
a. BCNF is stricter than 3NF
d. AEH, BEH, DEH
b. Lossless, dependency-preserving decomposition into 3NF is always
possible
View Answer Report Discuss Too Difficult! Search Google
c. Lossless, dependency-preserving decomposition into BCNF is always
possible Answer: (d).AEH, BEH, DEH

d. Any relation with two attributes is in BCNF


53. The relation scheme Student Performance (name, courseNo,
View Answer Report Discuss Too Difficult! Search Google rollNo, grade) has the following functional dependencies:
name, courseNo → grade
Answer: (c).Lossless, dependency-preserving decomposition into BCNF rollNo, courseNo → grade
is always possible name → rollNo
rollNo → name
51. Let r be a relation instance with schema R = (A, B, C, D). We The highest normal form of this relation scheme is
define r1 = ΠA, B, C (r) and r2 = ΠA.D (r). Let s = r1 * r2 where *
denotes natural join. Given that the decomposition of r into r1 anda. 2 NF
r2 is lossy, which one of the following is TRUE?
b. 3 NF
a. s⊂r
c. BCNF
b. r∪s
d. 4NF
c. r⊂s
View Answer Report Discuss Too Difficult! Search Google
d. r*s=s
Answer: (b).3 NF
View Answer Report Discuss Too Difficult! Search Google

Answer: (c).r ⊂ s 54. Consider the following functional dependencies in a database:

Data_of_Birth → Age
52. Consider a relation scheme R = (A, B, C, D, E, H) on which the Age → Eligibility
following functional dependencies hold: {A–>B, BC–>D, E–>C, D– Name → Roll_number
Roll_number → Name
Course_number → Course_name c. Relational algebra has the same power as safe relational calculus
Course_number → Instructor
(Roll_number, Course_number) → Grade d. None of the above

The relation (Roll_number, Name, Date_of_birth, Age) is: View Answer Report Discuss Too Difficult! Search Google

a. In second normal form but not in third normal form Answer: (c).Relational algebra has the same power as safe relational
calculus
b. In third normal form but not in BCNF

c. In BCNF 57. Relation R is decomposed using a set of functional dependencies, F


and relation S is decomposed using another set of functional
d. None of the above dependencies G. One decomposition is definitely BCNF, the other is
definitely 3NF, but it is not known which is which. To make a guaranteed
View Answer Report Discuss Too Difficult! Search Google identification, which one of the following tests should be used on the
decompositions? (Assume that the closures of F and G are available).
Answer: (d).None of the above
a. Dependency-preservation

b. Lossless-join
55. Relation R with an associated set of functional dependencies, F is
decomposed into BCNF. The redundancy (arising out of functional c. BCNF definition
dependencies) in the resulting set relations is.
d. 3NF definition
a. Zero

b. View Answer Report Discuss Too Difficult! Search Google


More than zero but less than that of an equivalent 3NF decomposition

c. Proportional to the size of F+ Answer: (c).BCNF definition

d. Indeterminate
58. From the following instance of a relation scheme R (A, B, C), we can
View Answer Report Discuss Too Difficult! Search Google conclude that :
ABC
Answer: (a).Zero 111
110
232
232
56. With regard to the expressive power of the formal relational query
languages, which of the following statements is true? a. A functionally determines B and B functionally determines C
a. Relational algebra is more powerful than relational calculus
b. A functionally determines B and B does not functionally determine C
b. Relational algebra has the same power as relational calculus
c. B does not functionally determine C 61. R(A,B,C,D) is a relation. Which of the following does not have a
lossless join, dependency preserving BCNF decomposition?
d. A does not functionally determine B and B does not functionally
determine C a. A->B, B->CD

View Answer Report Discuss Too Difficult! Search Google b. A->B, B->C, C->D

Answer: (c).B does not functionally determine C c. AB->C, C->AD

d. A ->BCD
59. Consider a schema R(A,B,C,D) and functional dependencies A->B and
C->D. Then the decomposition of R into R1(AB) and R2(CD) is View Answer Report Discuss Too Difficult! Search Google

a. dependency preserving and lossless join Answer: (c).AB->C, C->AD

b. lossless join but not dependency preserving


62. Consider a relation geq which represents “greater than or equal to”,
c. dependency preserving but not lossless join
that is, (x,y) ∈ geq only if y >= x.
d. not dependency preserving and not lossless join
create table geq
(
View Answer Report Discuss Too Difficult! Search Google ib integer not null
ub integer not null
Answer: (c).dependency preserving but not lossless join primary key 1b
foreign key (ub) references geq on delete cascade
)
60. Suppose the adjacency relation of vertices in a graph is represented in a
table Adj(X,Y). Which of the following queries cannot be expressed by Which
a of the following is possible if a tuple (x,y) is deleted?
relational algebra expression of constant length?
a. A tuple (z,w) with z > y is deleted
a. List of all vertices adjacent to a given vertex
b. A tuple (z,w) with z > x is deleted
b. List all vertices which have self loops
c. A tuple (z,w) with w < x is deleted
c. List all vertices which belong to cycles of less than three vertices
d. The deletion of (x,y) is prohibited
d. List all vertices reachable from a given vertex
View Answer Report Discuss Too Difficult! Search Google
View Answer Report Discuss Too Difficult! Search Google
Answer: (c).A tuple (z,w) with w < x is deleted
Answer: (d).List all vertices reachable from a given vertex
63. Given the following relation instance. d. {P,S,U}→{Q}

xyz View Answer Report Discuss Too Difficult! Search Google


142
153 Answer: (c).{P,S}→{S}
163
322
65. A relational database contains two tables student and department in
Which of the following functional dependencies are satisfied by the instance?
which student table has columns roll_no, name and dept_id and
(GATE CS 2000) department table has columns dept_id and dept_name. The
following insert statements were executed successfully to populate
the empty tables:
a. XY -> Z and Z -> Y
Insert into department values (1, 'Mathematics')
b. YZ -> X and Y -> Z Insert into department values (2, 'Physics')
Insert into student values (l, 'Navin', 1)
c. YZ -> X and X -> Z Insert into student values (2, 'Mukesh', 2)
Insert into student values (3, 'Gita', 1)
d. XZ -> Y and Y -> X
How many rows and columns will be retrieved by the following SQL
View Answer Report Discuss Too Difficult! Search Google statement?

Answer: (b).YZ -> X and Y -> Z Select * from student, department

a. 0 row and 4 columns


64. Consider the relation X(P, Q, R, S, T, U) with the following set of
b. 3 rows and 4 columns
functional dependencies
c. 3 rows and 5 columns
F={
{P, R} → {S,T},
d. 6 rows and 5 columns
{P, S, U} → {Q, R}
}
View Answer Report Discuss Too Difficult! Search Google
Which of the following is the trivial functional dependency in F+
is closure of F? Answer: (d).6 rows and 5 columns

a. {P,R}→{S,T}
66. A table has fields Fl, F2, F3, F4, F5 with the following
b. {P,R}→{R,T} functional dependencies F1 → F3 F2→ F4 (F1 . F2) →
F5 In terms of Normalization, this table is in
c. {P,S}→{S}
a. 1 NF
b. 2 NF Answer: (d).not in 2NF

c. 3 NF
69. Which option is true about the SQL query given below?
d. none of the above
SELECT firstName, lastName
View Answer Report Discuss Too Difficult! Search Google FROM Employee
WHERE lastName BETWEEN 'A%' AND 'D%';
Answer: (a).1 NF
a. It will display all the employees having last names starting
with the alphabets 'A' till 'D' inclusive of A and exclusive of
67. Which of the following is NOT a superkey in a relational D.
schema with attributes V, W, X, Y, Z and primary key V
Y? b. It will throw an error as BETWEEN can only be used for
Numbers and not strings.
a. VXYZ
c. It will display all the employees having last names starting
b. VWXZ from 'A' and ending with 'D'.

d. It will display all the employees having last names in the


c. VWXY
range of starting alphabets as 'A' and 'D' excluding the
names starting with 'A' and 'D'.
d. VWXYZ
View Answer Report Discuss Too Difficult! Search Google
View Answer Report Discuss Too Difficult! Search Google
Answer: (a).It will display all the employees having last names
Answer: (b).V W X Z starting with the alphabets 'A' till 'D' inclusive of A and exclusive of
D.

68. Let R (A, B, C, D, E, P, G) be a relational schema in which


the following functional dependencies are known to hold: 70. Which of the given options define a transaction
AB → CD, DE → P, C → E, P → C and B → G. The correctly?
relational schema R is
a. A transaction consists of DDL statements on the
a. in BCNF database schema.
b. in 3NF, but not in BCNF b. A transaction consists of COMMIT or ROLLBACK in a
database session.
c. in 2NF, but not in 3NF
c. A transaction consists of either a collection of DML
d. not in 2NF statements or a DDL or DCL or TCL statement to form a
logical unit of work in a database session.
View Answer Report Discuss Too Difficult! Search Google
d. A transaction consists of collection of DML and DDL a. I only
statements in different sessions of the database.
b. II only
View Answer Report Discuss Too Difficult! Search Google
c. Both I and II
Answer: (c).A transaction consists of either a collection of DML
statements or a DDL or DCL or TCL statement to form a d. Neither I nor II
logical unit of work in a database session.
View Answer Report Discuss Too Difficult! Search Google
71. Consider the following transactions with data items
P and Q initialized to zero: Answer: (b).II only
T1: read (P) ;
read (Q) ;
73. Consider the transactions T1, T2, and T3 and the
if P = 0 then Q : = Q + 1 ;
schedules S1 and S2 given below.
write (Q) ;
T2: read (Q) ;
T1: r1(X); r1(Z); w1(X); w1(Z)
read (P) ;
T2: r2(Y); r2(Z); w2(Z)
if Q = 0 then P : = P + 1 ;
T3: r3(Y); r3(X); w3(Y)
write (P) ;
S1: r1(X); r3(Y); r3(X); r2(Y); r2(Z);
w3(Y); w2(Z); r1(Z); w1(X); w1(Z)
Any non-serial interleaving of T1 and T2 for
S2: r1(X); r3(Y); r2(Y); r3(X); r1(Z);
concurrent execution leads to
r2(Z); w3(Y); w1(X); w2(Z); w1(Z)
a. A serializable schedule
Which one of the following statements about the
b. A schedule that is not conflict serializable schedules is TRUE?

a. Only S1 is conflict-serializable
c. A conflict serializable schedule
b. Only S2 is conflict-serializable
d. A schedule for which a precedence graph cannot
be drawn
c. Both S1 and S2 are conflict-serializable
View Answer Report Discuss Too Difficult! Search Google d. Neither S1 nor S2 is conflict-serializable

Answer: (b).A schedule that is not conflict serializable View Answer Report Discuss Too Difficult! Search Google

Answer: (a).Only S1 is conflict-serializable


72. Which of the following concurrency control protocols ensure both
conflict serialzability and freedom from deadlock? I. 2-phase locking
II. Time-stamp ordering 74. 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 d. A transaction reads a data item after it is written by an
5% interest. uncommitted transaction

1. T1 start View Answer Report Discuss Too Difficult! Search Google


2. T1 B old=12000 new=10000
3. T1 M old=0 new=2000 Answer: (d).A transaction reads a data item after it is written by an
4. T1 commit uncommitted transaction
5. T2 start
6. T2 B old=10000 new=10500
7. T2 commit 76. Consider the following transaction involving two bank
accounts x and y.
Suppose the database system crashes just before log
record 7 is written. When the system is restarted, which read(x); x := x – 50; write(x); read(y); y := y + 50;
one statement is true of the recovery procedure? write(y)
a. We must redo log record 6 to set B to 10500 The constraint that the sum of the accounts x and y
should remain constant is that of
b. We must undo log record 6 to set B to 10000 and then
redo log records 2 and 3 a. Atomicity

c. We need not redo log records 2 and 3 because b. Consistency


transaction T1 has committed
c. Isolation
d. We can apply redo and undo operations in arbitrary order
because they are idempotent d. Durability
View Answer Report Discuss Too Difficult! Search Google
View Answer Report Discuss Too Difficult! Search Google
Answer: (b).We must undo log record 6 to set B to 10000 and then redo log records 2 and 3
Answer: (b).Consistency

75. Which of the following scenarios may lead to an irrecoverable error


in a database system ? 77. Consider a simple checkpointing protocol and the
following set of operations in the log.
a. A transaction writes a data item after it is read by an uncommitted
transaction (start, T4); (write, T4, y, 2, 3); (start, T1); (commit, T4);
(write, T1, z, 5, 7);
b. A transaction reads a data item after it is read by an uncommitted (checkpoint);
transaction (start, T2); (write, T2, x, 1, 9); (commit, T2); (start, T3);
(write, T3, z, 7, 2);
c. A transaction reads a data item after it is written by a committed
transaction If a crash happens now and the system tries to recover
using both undo and redo operations, what are the
contents of the undo list and the redo list
a. Undo: T3, T1; Redo: T2 View Answer Report Discuss Too Difficult! Search Google

b. Undo: T3, T1; Redo: T2, T4 Answer: (d).Deadlock-freedom

c. Undo: none; Redo: T2, T4, T3; T1


80. Consider the following two phase locking protocol. Suppose a
d. Undo: T3, T1, T4; Redo: T2 transaction T accesses (for read or write operations), a certain set of
objects {O1,...,Ok}. This is done in the following manner: Step 1. T
View Answer Report Discuss Too Difficult! Search acquires exclusive locks to O1, . . . , Ok in increasing order of their
Google addresses. Step 2. The required operations are performed. Step 3.
All locks are released. This protocol will
Answer: (a).Undo: T3, T1; Redo: T2
a. guarantee serializability and deadlock-freedom

78. Which level of locking provides the highest degree of concurrencyb.in guarantee neither serializability nor deadlock-freedom
a relational data base?
c. guarantee serializability but not deadlock-freedom
a. Page
d. guarantee deadlock-freedom but not serializability
b. Table
View Answer Report Discuss Too Difficult! Search Google
c. Row
Answer: (a).guarantee serializability and deadlock-freedom
d. Page, table and row level locking allow the same degree of
concurrency 81. Suppose a database schedule S involves transactions T1, ....Tn.
Construct the precedence graph of S with vertices representing
View Answer Report Discuss Too Difficult! Search Google the transactions and edges representing the conflicts. If S is
serializable, which one of the following orderings of the vertices
Answer: (c).Row of the precedence graph is guaranteed to yield a serial
schedule?

79. Which one of the following is NOT a part of the ACID properties a. Topological order
of database transactions?
b. Depth-first order
a. Atomicity
c. Breadth-first order
b. Consistency
d. Ascending order of transaction indices
c. Isolation
View Answer Report Discuss Too Difficult! Search Google
d. Deadlock-freedom
Answer: (a).Topological order
d. S1 is conflict equivalent to S2, but not to S3
82. Consider the following database schedule with two
transactions, T1 and T2. View Answer Report Discuss Too Difficult! Search Google

S = r2(X); r1(X); r2(Y); w1(X); r1(Y); w2(X); a1; a2; Answer: (d).S1 is conflict equivalent to S2, but not to S3

where ri(Z) denotes a read operation by transaction Ti on a


variable Z, wi(Z) denotes a write operation by Ti on a 84. Which of the following statement is/are incorrect?
variable Z and ai denotes an abort by transaction Ti . Which
one of the following statements about the above schedule A: A schedule following strict two phase locking protocol
is TRUE? is conflict serializable as well as recoverable.
B: Checkpoint in schedules are inserted to ensure
a. S is non-recoverable recoverability.

b. S is recoverable, but has a cascading abort a. Only 1

c. S does not have a cascading abort b. Only 2

d. S is strict c. Both 1 and 2

View Answer Report Discuss Too Difficult! Search Google d. None

Answer: (c).S does not have a cascading abort View Answer Report Discuss Too Difficult! Search Google

Answer: (b).Only 2
83. 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 85. An index is clustered, if
N on object O.]
a. it is on a set of fields that form a candidate key
(S1) 2RA 2WA 3RC 2WB 3WA 3WC 1RA 1RB 1WA 1WB
(S2) 3RC 2RA 2WA 2WB 3WA 1RA 1RB 1WA 1WB 3WC b. it is on a set of fields that include the primary key
(S3) 2RA 3RC 3WA 2WA 2WB 3WC 1RA 1RB 1WA 1WB
c. the data records of the file are organized in the same
Which of the following statements is TRUE? order as the data entries of the index
a. S1, S2 and S3 are all conflict equivalent to each other d. the data records of the file are organized not in the same
order as the data entries of the index
b. No two of S1, S2 and S3 are conflict equivalent to each
other View Answer Report Discuss Too Difficult! Search Google
c. S2 is conflict equivalent to S3, but not to S1 Answer: (c).the data records of the file are organized in the same order as the
data entries of the index b. b

c. c
86. A clustering index is defined on the fields which are of
type d. d

a. non-key and ordering View Answer Report Discuss Too Difficult! Search Google

b. non-key and non-ordering Answer: (c).c

c. key and ordering


89. Consider the following SQL query:
d. key and non-ordering
select distinct al, a2,........., an
View Answer Report Discuss Too Difficult! Search Google from r1, r2,........, rm
where P
Answer: (a).non-key and ordering
For an arbitrary predicate P, this query is equivalent to
which of the following relational algebra expressions ?
87. A file is organized so that the ordering of data records
is the same as or close to the ordering of data entries
in some index. Then that index is called
a. A
a. Dense
b. B
b. Sparse
c. C
c. Clustered
d. D
d. Unclustered
View Answer Report Discuss Too Difficult! Search Google
View Answer Report Discuss Too Difficult! Search Google Answer: (a).A
Answer: (c).Clustered
90. Consider three data items D1, D2 and D3 and the
following execution schedule of transactions T1, T2 and
88. Which of the following relational calculus expressions T3. In the diagram, R(D) and W(D) denote the actions
is not safe? reading and writing the data item D respectively.

Which of the following statements is correct?


a. a
a. The schedule is serializable as T2; T3; T1

b. The schedule is serializable as T2; T1; T3

c. The schedule is serializable as T3; T2; T1

d. The schedule is not serializable a. 1

View Answer Report Discuss Too Difficult! Search Google b. 2

Answer: (d).The schedule is not serializable c. 3

91. Given the following input (4322, 1334, 1471, 9679, d. 4


1989, 6171, 6173, 4199) and the hash function x
mod 10, which of the following statements are true? View Answer Report Discuss Too Difficult!

1. 9679, 1989, 4199 hash to the same value Answer: (b).2


2. 1471, 6171 hash to the same value
3. All elements hash to the same value
4. Each element hashes to a different value 93. Consider the relation Student (name, sex, marks), where
the primary key is name, pertaining to students in a class
a. 1 only
that has at least one boy and one girl. What does the
following relational algebra expression produce?
b. 2 only (Note: r is the rename operator). The condition in join is
"(sex = female ^ x = male ^ marks ≤ m)"
c. 1 and 2 only

d. 3 or 4
a. names of girl students with the highest marks
View Answer Report Discuss Too Difficult! Search Google
b. names of girl students with more marks than some boy
Answer: (c).1 and 2 only student

c. names of girl students with marks not less than some boy
92. Let R1 (A, B, C) and R2 (D, E) be two relation students4)
schema, where the primary keys are shown
underlined, and let C be a foreign key in R1 d. names of girl students with more marks than all the boy
referring to R2. Suppose there is no violation of the students
above referential integrity constraint in the
corresponding relation instances r1 and r2. Which View Answer Report Discuss Too Difficult! Search Google
one of the following relational algebra expressions
would necessarily produce an empty relation ? Answer: (d).names of girl students with more marks than all
the boy students
MCQs DBMS|UGC-
uses these timestamps only to
decide whether a transaction
should wait or roll back.

NET|GATE|Computer Views are useful for _____


unwanted information, and for
Science 2. collecting together information
from more than one relation
Usage of Preemption and into a single view.
1. Transaction Rollback prevents
______. A. Hiding

A. Unauthorised usage of data file B. Deleting

B. Deadlock situation C. Highlighting

C. Data manipulation D. All of the above

D. File preemption View/Hide


Correct Answer is A
Ans
View/Hide
Correct Answer is B
Ans This is Primary Advantage of
Views in Database
One approach for preventing Views can represent a subset of
deadlocks is to impose an the data contained in a table;
ordering of all data items, and consequently, a view can limit
to require that a transaction the degree of exposure of the
lock data items only in a underlying tables to the outer
sequence consistent with the world: a given user may have
ordering. permission to query the view,
The second approach for while denied access to the rest
preventing deadlocks is to use Explanation of the base table.
Explanation preemption and transaction Views can join and simplify
rollbacks. In preemption, when multiple tables into a single
a transaction T2 requests a lock virtual table
that transaction T1 holds, the Views can act as aggregated
lock granted to T1 may be tables, where the database
preempted by rolling back of T1, engine aggregates data (sum,
and granting of the lock to T2. average etc.) and presents the
To control the preemption, we calculated results as part of the
assign a unique timestamp to data
each transaction. The system Views can hide the complexity
of data; for example a view B. 2 − dimensions
could appear as Sales2000 or
Sales2001, transparently
C. 3 − dimensions
partitioning the actual
underlying table
D. Multidimensions
The decision tree classifier is a
3. widely used technique for View/Hide
Correct Answer is B
______. Ans

A. Classification A Cross tab is A layout of data


in rows, columns, and pages.
Dimension members are listed
B. Association
across the first row and down
the first column; the data for
C. Partition measures appears in the cells
that form the body of the cross
Explanation
tab. A cross tab can be used to
D. Clustering
display summary information
and show how data varies
View/Hide across dimensions, such as
Correct Answer is A
Ans sales by region by month. A
cross tab is sometimes called a
Decision Tree Classifier is a matrix.
simple and widely used
classification technique. It 5. Thoma’s-write rule is ______.
applies a straightforward idea to
solve the classification problem.
A. Two phase locking protocol
Decision Tree Classifier poses a
Explanation series of carefully crafted
questions about the attributes of B. Timestamp ordering protocol
the test record. Each time time
it receive an answer, a follow-up
C. One phase locking protocol
question is asked until a
conclusion about the class label
of the record is reached. D. Sliding window protocol

Cross_tab displays permit users View/Hide


Correct Answer is B
4. to view ______ of Ans
multidimensional data at a time.
The Thomas Write rule is a rule
A. 1 − dimension Explanation in time stamp-based
concurrency control. It can be
summarized as ignore outdated Referential Integrity
writes.
It states that, if a more recent
The SQL expression Select
transaction has already written
distinct T, branch_name from
the value of an object, then a
branch T, branch S where
less recent transaction does not 7.
T.assets ‹ S.assets and
need perform its own write since
S.branch_city= “Mumbai” finds
it will eventually be overwritten
the names of
by the more recent one.
The Thomas Write rule is
applied in situations where a All branches that have greater
predefined logical order is A. assets than some branch
assigned to transactions when located in Mumbai.
they start. For example a
transactions might be assigned All branches that have greater
a monotonically increasing time B. assets than all branches in
stamp when it is created. The Mumbai.
rule prevents changes in the
order in which the transactions
are executed from creating The branch that has greatest
C.
different outputs: The outputs asset in Mumbai.
will always be consistent with
the predefined logical order. Any branch that has greater
D. assets than any branch in
Value that appears in one Mumbai.
relation for a given set of
6. attributes also appears for a View/Hide
certain set of attributes in Correct Answer is A
Ans
another relation.
Explanation
A. Logical Integrity
Consider the following schemas
B. Referential Integrity : Branch_Schema =
(branch_name, assets, city)
C. Domain Integrity Customer_Schema =
(cutstomer_name, street, city)
Deposit_Schema =
D. Data Integrity 8.
(branch_name,
account_number,
View/Hide customer_name, balance)
Correct Answer is B Borrow_Schema =
Ans
(branch_name, loan_number,
customer_name, amount)
Explanation This is standard Rule of
Which of the following tuple View/Hide
Correct Answer is A
relational calculus finds all Ans
customers who have loan
amount more than ` 12,000 ?
Create is a DDL Command
Select is a DML Command
t(customer_name) | Rectangle is a symbol in er
A. Explanation
t∈borrow[?] t[amount]›12000} model to represent the storage
of data
Record is a Relationship
{t |t(customer_name) |
B.
t∈borrow[?] t[amount]›12000}
10. Which of the following is true ?
{t |[?] ∈ borrow
C. (t(customer_name=s(customer_ A relation in BCNF is always in
A.
name))[?] [amount]›12000} 3NF

{t |[?] ∈ borrow A relation in 3NF is always in


B.
D. (t(customer_name)[?] BCNF
s[amount] ›12000}
C. BCNF and 3NF are same
View/Hide
Correct Answer is C
Ans D. A relation in BCNF is not in 3NF

Explanation View/Hide
Correct Answer is A
Ans
Match the following :
(a) Create (i) The E-R Model Since BCNF is higher form of
(b) Select (ii) Relationship 3NF, so a relation in BCNF must
Model Explanation
9. be in 3NF but the reverse is not
(c) Rectangle (iii) DDL true
(d) Record (iv) DML
Codes :
(a) (b) (c) (d) The User Work Area (UWA) is a
set of Program variables
11. declared in the host program to
A. (iii) (iv) (i) (ii) communicate the contents of
individual records between
B. (iv) (iii) (ii) (i)
A. DBMS & the Host record
C. (iv) (iii) (i) (ii)
B. Host program and Host record
D. (iii) (iv) (ii) (i)
C. Host program and DBMS Which level of Abstraction
13. describes how data are stored in
the data base ?
Host program and Host
D.
language
A. Physical level
View/Hide
Correct Answer is C
Ans B. View level

User Work Area (UWA) that C. Abstraction level


appears at the top level is a
buffer through which the
D. Logical level
Explanation programmer or user
communicates with the
database, using one of the View/Hide
Correct Answer is A
traditional host languages Ans

If a relation with a Schema R is Physical Level is The lowest


decomposed into two relations level of abstraction describes
R1 and R2 such that (R1 ∪ R2) how the data are actually
Explanation
= R1 then which one of the stored. The physical level
12. describes complex low-level
following is to be satisfied for a
lossless joint decomposition (→ data structures in detail.
indicates functional
dependency) Third normal form is based on
14.
the concept of ______.
(R1 ∩ R2) → R1 or R1 ∩ R2 →
A.
R2 A. Closure Dependency

B. R1 ∩ R2 → R1 B. Transitive Dependency

C. R1 ∩ R2 → R2 C. Normal Dependency

R1 ∩ R2 → R1 and R1 ∩ R2 → D. Functional Dependency


D.
R2

View/Hide
View/Hide Correct Answer is B
Correct Answer is A Ans
Ans

Second and third normal forms


Explanation Explanation based on concept of functional
dependency. where Second
normal form means no partial C. Documentation
dependency and Third normal
form means no transitive
D. Record lock
dependency

View/Hide
Referential integrity is directly Correct Answer is D
15. Ans
related to

Record locking is used for


A. Relation key
preventing simultaneous update
Explanation
of the same data and therefore
B. Foreign key avoiding inconsistent results.

C. Primary key B+ tree are preferred to binary


17.
tree in Database because
D. Candidate key
Disk capacity are greater than
A.
memory capacities
View/Hide
Correct Answer is B
Ans
Disk access is much slower than
B.
memory access
Referential integrity is a
database concept that ensures
that relationships between Disk data transfer rates are
tables remain consistent. When C. much less than memory data
one table has a foreign key to transfer rate
another table, the concept of
Explanation
referential integrity states that
Disks are more reliable than
you may not add a record to the D.
Memory
table that contains the foreign
key unless there is a
corresponding record in the View/Hide
Correct Answer is B
linked table. Ans

In multiuser database if two Disk access is slow and B+ Tree


users wish to update the same provide search in less number of
16. disk hits. This is primarily
record at the same time, they
are prevented from doing so by because unlike binary seach
trees, B+ trees have very high
Explanation
fanout (typically on the order of
A. Jamming
100 or more), which reduces
the number of I/O operations
B. Password required to find an element in
the tree.
A Transaction Manager is which refers to the size in which data
18.
of the following ? fields are sub-divided.

A. Maintains a log of transactions Which level of Abstraction


20. describes what data are stored
in the Database ?
Maintains before and after
B.
database images
A. Physical level
Maintains appropriate
C.
concurrency control B. View level

D. All of the above C. Abstraction level

View/Hide D. Logical level


Correct Answer is D
Ans
View/Hide
Correct Answer is D
A transaction manager is the Ans
part of an application that is
Explanation responsible for coordinating
Logical level is higher level of
transactions across one or more
abstraction that describes what
resources.
Explanation data are stored in database and
what relationship among those
19. What is Granularity ? data

A. The size of database The problem that occurs when


one transaction updates a
21. database item and then the
B. The size of data item
transaction fails for some reason
is ________.
C. The size of record
A. Temporary Select Problem
D. The size of file
B. Temporary Modify Problem
View/Hide
Correct Answer is B
Ans
C. Dirty Read Problem

The granularity of the data table


D. None
also determines how much
Explanation
storage space the database
requires.The granularity of data View/Hide Correct Answer is C
Ans View/Hide
Correct Answer is B
Ans
Explanation
Explanation
Consider a schema R(A, B, C, D)
and functional dependencies A Which of the following is not a
22. → B and C → D. Then the 24. type of Database Management
decomposition R1(A, B) and System ?
R2(C, D) is
A. Hierarchical
Dependency preserving but not
A.
lossless join
B. Network

Dependency preserving and


B. C. Relational
lossless join

D. Sequential
Lossless Join but not
C.
dependency preserving
View/Hide
Correct Answer is D
Ans
D. Lossless Join

Explanation
View/Hide
Correct Answer is A
Ans
Manager&rsquos salary details
are to be hidden from Employee
Explanation 25.
Table. This Technique is called
as
If D1,D2, ....Dn are domains in
a relational model, then the
23. A. Conceptual level Datahiding
relation is a table, which is a
subset of
B. Physical level Datahiding
A. D1+D2+... +Dn
C. External level Datahiding
B. D1ΧD2Χ ... ΧDn
D. Logical level Datahiding
C. D1∪D2∪... ∪Dn
View/Hide
Correct Answer is C
Ans
D. D1−D2−...−Dn
Explanation More columns than columns in
A.
original table
26. A Network Schema
B. More rows than original table
restricts to one to many
A.
relationship Same number of rows as the
C.
original table
permits many to many
B.
relationship Same number of columns as the
D.
original table
C. stores Data in a Database
View/Hide
Correct Answer is C
Ans
D. stores Data in a Relation

Explanation
View/Hide
Correct Answer is B
Ans
The employee information of an
Organization is stored in the
Explanation
relation : Employee (name, sex,
salary, deptname) Consider the
The relation “divides” on a set of following SQL query Select
27.
positive integers is ________. 29. deptname from Employee
Where sex = ‘M’ group by
A. Symmetric and transitive deptname having avg (salary) >
{select avg (salary) from
Employee} Output of the given
B. Anti symmetric and transitive query corresponds to

C. Symmetric only Average salary of employee


A. more than average salary of the
D. Transitive only organization.

View/Hide Average salary less than


Correct Answer is B B. average salary of the
Ans
organization.
Explanation
Average salary of employee
C. equal to average salary of the
The “PROJECT” operator of a
organization
28. relational algebra creates a new
table that has always
D. Average salary of male
employees in a department is View/Hide
Correct Answer is a
more than average salary of the Ans
organization
Explanation
View/Hide
Correct Answer is D
Ans
42. E-R modeling technique is:

Explanation
A. Tree structure

For a database relation R(a, b,


B. Top-down method
c, d) where the domains of a, b,
c, d include only the atomic
30. C. Bottom-up method
values. The functional
dependency a → c, b → d holds
in the following relation D. Right-left approach

A. In 1NF not in 2NF View/Hide


Correct Answer is b
Ans
B. In 2NF not in 3NF
Explanation
C. In 3NF
Data items stored as grouped
43.
D. In 1NF items is:

View/Hide A. Record
Correct Answer is B
Ans
B. List
What property of the files
41. prevents sharing of files and C. Strings
directories?

D. Title list
A. Tree structure

View/Hide
B. One level structure Correct Answer is a
Ans

C. Two level structure Explanation

D. Length Data items are fragmented,


44.
replicated and propagated in:
A. DBMS C. Relational Model

B. RDBMS D. Entity Relationship Model

C. DDBMS View/Hide
Correct Answer is a,c
Ans
D. DML
Explanation
View/Hide
Correct Answer is c
Ans In an E-R diagram ellipses
47.
represents
Explanation
A. Entity sets
If every non-key attribute is
functionally dependent on the B. relationship among entity sets
45.
primary key, then the relation
will be in
C. attributes

A. 1NF
D. link in attributes & entity sets

B. 2NF
View/Hide
Correct Answer is c
Ans
C. 3NF
Explanation
D. 4NF
The set of permitted values for
48.
View/Hide each attribute is called its
Correct Answer is c
Ans
A. Attribute set
Explanation
B. attribute range
which of the following is record
46.
based logical model(s)?
C. domain

A. Network Model
D. group

B. Object-oriented model
View/Hide
Correct Answer is c
Ans
51.Redundancy is dangerous as it is a potential threat to
Explanation
dataA.IntegrityB.ConsistencyC.SufficiencyD.NoneView/Hide
Ans
Relations produced from an E-R
49. Correct Answer is a,b
model will always be in
Explanation
A. 1NF 52.Who is more concerned about the conceptual level of the
DBMSA.DBAB.The end userC.The Systems
B. 2NF programmerD.ClientView/Hide Ans
Correct Answer is a
C. 3NF Explanation
53.An Attribute of one table matching the primary key of
D. 4NF
another table is called asA.Foreign keyB.Secondary
keyC.Candidate keyD.CompositeView/Hide Ans
View/Hide
Correct Answer is a
Correct Answer is c Explanation
Ans
54.If a relation is in BCNF, then it is also
Explanation inA.1NFB.2NFC.3NFD.all of aboveView/Hide Ans
Correct Answer is c
50. E-R modeling technique is a Explanation
55.The way a particular application views the data from the
A. Top-down approach database that the application uses is aA.ModuleB.Relational
ModelC.SchemaD.Sub SchemaView/Hide Ans
B. Bottom-up approach Correct Answer is d
Explanation
C. Left-right approach 56.Locking can be used for:A.DeadlockB.Lost
UpdateC.Uncommitted dependencyD.Inconsistent
D. none of above dataView/Hide Ans
Correct Answer is bcd
View/Hide Explanation
Correct Answer is a
Ans 57.In relation Model Column is referred to as
:A.TupleB.EntityC.DegreeD.AttributeView/Hide Ans
Explanation Correct Answer is d
Explanation
58.ER Model Comes underA.Physical data ModelB.Record
Author Does Not claim of any answer these answers are as based logical ModelC.Object based logical ModelD.All of
per expert opinion aboveView/Hide Ans
Correct Answer is c
Explanation
59.Which of the following is the problem of file management Correct Answer is c
system? (a) Lack of data independence(b) Data redundancy(c) Explanation
Update (d) all Periodically adding, changing, & Deleting file 67.Transaction X holds a shared lock R. if transaction Y
records is called requests for a shared lock on R :A.result in deadlock
fileA.UpdatingB.UpgradingC.RestructuringD.RenewingView/Hi situationB.Immediately GrantedC.Immediately
de Ans rejectedD.Granted as is released by XView/Hide Ans
Correct Answer is d Correct Answer is b
Explanation60.Which of the following is a relational Explanation
databaseA.4th DimensionsB.FoxProC.dbase-IVD.All of the 68.command used to select only one copy of each set of
aboveView/Hide Ans duplicable rows :A.Select DistantB.Select UniqueC.Select
Correct Answer is a DifferentD.NoneView/Hide Ans
Explanation Correct Answer is a
61.The Index consists of :A.A list of keysB.Pointers to the Explanation
master listC.Both (a) & (b)D.None of aboveView/Hide Ans 69.Which of following is the characteristics of a relational
Correct Answer is d database model?A.TablesB.Treelike StructureC.Complex
Explanation logical relationshipD.recordsView/Hide Ans
62.Report generators are used toA.Store data input by a Correct Answer is acd
userB.retrieve information from filesC.Answer queriesD.Both Explanation
(b) & (c)View/Hide Ans 70.Which command is used to remove rows from a
Correct Answer is c table?A.DeleteB.RemoveC.TruncateD.Both (a) & (b)View/Hide
Explanation Ans
63.In a relational schema, each tuple is divided into fields Correct Answer is d
called :A.RelationsB.DomainsC.QueriesD.None of Explanation
aboveView/Hide Ans 71.Which command is used to remove a table or index from
Correct Answer is d the database in SQL?A.Delete TableB.Drop tableC.Erase
Explanation TableD.None of aboveView/Hide Ans
64.The set of permitted values for each attribute is called its Correct Answer is b
:A.Attribute setB.Attribute rangeC.DomainD.GroupView/Hide Explanation
Ans 72.A report generator is used to :A.Update filesB.Print files on
Correct Answer is b paperC.Data EntryD.NoneView/Hide Ans
Explanation Correct Answer is b
65.A DBMS consists of application programs called Explanation
:A.FORTRANB.AUTOFLOWC.BPLD.TOTALView/Hide Ans 73.The modify operation is likely to be done after
Correct Answer is c :A.DeleteB.Look-upC.InsertD.None of aboveView/Hide Ans
Explanation Correct Answer is b
66.A locked file can be :A.Accessed by only one Explanation
userB.modified by user with correct passwordC.is used to hide
sensitive informationD.NoneView/Hide Ans
74.The database environment has all of the following
A. Where data is located
components except :A.UsersB.Separate
filesC.DatabaseD.DBAView/Hide Ans
B. who owns it
Correct Answer is b
Explanation
C. size of disk storage device
75.If every non key attribute is functionally dependent on the
primary key, then the relation will be in
D. How the data is used
:A.1NFB.2NFC.3NFD.4NFView/Hide Ans
Correct Answer is c
View/Hide
Explanation Correct Answer is c
Ans
76.Director�s Salary details are hidden from the employee,
that is :A.Conceptual level HidingB.Physical level data Explanation
HidingC.External level data hidingD.None of aboveView/Hide
Ans Data item characteristics that
Correct Answer is c 82. are important in data
Explanation management include
77.Which of the following is record based logical
model(s)?A.Network ModelB.object oriented A. Width
modelC.Relational ModelD.E-R ModelView/Hide Ans
Correct Answer is ac B. language
Explanation
78.The distinguishable parts of a record are C. spelling
calledA.DataB.filesC.fieldsD.All of aboveView/Hide Ans
Correct Answer is c D. all of above
Explanation
79.Embedded pointers provideA.An inverted indexB.a View/Hide
Correct Answer is a
secondary access pathC.a physical record keyD.all of Ans
aboveView/Hide Ans
Correct Answer is b Explanation
Explanation
80.Which database handles full text data, image, audio and 83. A schema describes
video?A.Transaction databaseB.Graphics databaseC.Video on
demand databaseD.Multimedia databaseView/Hide Ans A. Record & files
Correct Answer is d
Explanation B. data elements

A data dictionary does not


81. C. record relationships
provide information about
D. all of the above Explanation

View/Hide Which of the following is at


Correct Answer is d
Ans 86. highest level in the hierarchy of
data organization?
Explanation
A. Data Record
84. Data security threat include
B. data File
A. Privacy invasion
C. Database
B. hardware failure
D. Data Bank
Fraudulent manipulation of
C.
data View/Hide
Correct Answer is c
Ans
D. all of above
Explanation
View/Hide
Correct Answer is a
Ans The logical data structure with
87.
one to many relationship is a
Explanation
A. Network
Which language is used by
85. most of dbms�s for helping B. Tree
their users to access data?
C. Chain
A. 4GL
D. All of above
B. SQL
View/Hide
Correct Answer is d
C. Query languages Ans

D. HLL Explanation

View/Hide An entry in a telephone book


Correct Answer is c 88.
Ans can be compared to a
A. Database

B. File

C. Record

D. Field

View/Hide
Correct Answer is c
Ans

Explanation

Author Does Not claim of any answer these answers are as


per expert opinion

You might also like