Madeeasy Bits FORMAT
Madeeasy Bits FORMAT
sh
de
a. ease of searching b. sequential ordering of a file c. both (A)&(B) d. none these ANSWER:C
a
Pr
5).In context with relational algebra, which of the following are unary operations
a
hr
nd
1). SELECT 2). PROJECT 3).UNION 4).PRODUCT
,A
a. 2 and 4 only b. 1and 4 only c. 1 and 3 only d. All are binary operations ANSWER: B
ct
tri
is
6).Let R is a relation schema ,R(A,B,C,D) and F={ A->B,B- >C,C->A }is the set of functional dependency. How many
D
candidate keys are there?
a
hn
a. 1 b. 2 c. 3 d. none of these ANSWER: C ris
,K
7). Consider the following SQL query WITH max balance(value)AS SELECT MAX(balance) FROM account; The result of
ru
lle
8).match list-I with list-II and select the correct answer using the codes given below the lists:
.R
.S
List-I list-II
R
V.
-1-
SELECT ename FROM emp GROUP BY deptno;
What is the output of the query?
a. Syntax error b. All employee name are displayed
c. None of these. d. All employee names department wise are displayed ANSWER: A
11). A correlated sub query always executes in
a. Top- Bottom- Top b. None of these. c. Top- Bottom d. Bottom- Top ANSWER: A
12). Consider the query: SELECT dept*, emp*FROM emp,dept;
Which one of the following reflects the output of these above query?
sh
a. All the dept tables columns are followed by the emp table columns
ade
b. both tables are displayed as mixture c. none of these
Pr
a
d. All the emp tables columns are followed by the dept table columns ANSWER: A
hr
nd
,A
13). Consider the relational R(A,B,C,D) and the set F=(AB->CD,C->A), the number of candidate keys are
ct
a. 1 b. 3 c. 4 d. 2 ANSWER: D
tri
is
D
14). . In a relation there are 4 records as shown below [d]
a
hn
Teacher Course Text Division
Smith Data Structure Bar Fram ris I
,K
There is an index file associated with this and it contains 1,4,3,2 value.
,G
16). Given the relation R(X, Y, W, Z, P, Q) AND THE SET F= {XY->W, XW->P, PQ->Z, XY->Q}
.&
.M
a. either losses or lossy b. neither lossless or lossy c. lossless decomposition d. lossy decomposition ANSWER: C
A.
17). SELECT COUNT (*) FROM emp HAVING COUNT (*)>2; This query when executed given
a. none of these b. error c. cannot say d. Some output ANSWER: B
18). what is the highest normal form of the relation R(W,X,Y,Z) with the set F=(WY->XZ,X->Y)?
a. 3NF b. BCNF c. 1NF d. 2NF ANSWER: A
19). An empty table is given, consider the following query: SELECT COUNT (Commission) FROM emp;
What will be the output of this query?
a. Null b. Error c. 1 d. 0 ANSWER: D
-2-
20). Consider the SCHEDULE show below. What is the highest normal form of this relation?
SCHEDULE (student_ID, class_No, student_Name, student_Major, class_Time, Building_Room, Instructor).
assume the following functional dependencies
{ Student_ID->Student_Name,Student_ID->Student_major,Class_No->Classs_time,Class_No->Buliding Room, Class_No-
>instructor}
a. 1NF b. 2NF c. BCNF d. 3NF ANSWER: A
21).The five aggregation operations in SQL are
a. SUM, AVG, MIN, MAX, COUNT b. SUM.AVG, MIN, MAX, DISTINICT
c. SUM, AVG, IN, DISITINCT, COUNT d. SUM,AVG,IN,ALL,ANY ANSWER: A
sh
de
22). what are the prime attributes of the relation R(A,B,C,D) and the set F={AB->C, C->D, D->A}
a
Pr
a. A,C and d b. B,C and D c. A,B and c d. A,B and D ANSWER: D
a
hr
nd
23). Given the relation R (A, B, C, D) and the set F= {AB->C, B->D, D->B}.
,A
find the candidates keys of the relation
ct
tri
is
a. AC and BD b. AB and AD c. AB and CD d. BC and AD ANSWER: B
D
a
24). Consider the following queries
hn
ris
S1 : SELECT e.name FROM emp e WHERE e.sal=ANY (SELECT sal FROM emp WHERE e.name='X') ;
,K
ru
S2: SELECT e.name FROM emp e WHERE e.sal IN (SELECT sal FROM emp WHERE e.name='X');
lle
va
S3: SELECTe.name FROMemp e WHEREe.sal = ALL (SELECT sal FROM emp WHERE e.name='X');
la
ud
25). what are the prime attributes of relation R(A,B,C,D,E) and the set F={A->CD,C->B,B->AE}
yt
ol
.P
a. B, C b. A, C c. A, D d. A, B ANSWER: D
.R
26).Given relations R(w,x) and S(y,z) the result of SELECT DISTINCT w,x FROM R,S;
.S
R
V.
c. S has no duplicates and R is non empty d. R has no duplicates and S is non empty ANSWER: D
.M
-3-
What is the candidate key ?
a). {Branch, city} b). { Acc_ No, Branch} c). {Acc_ no, City} d). {Acc_no, Depositor} ANSWER: D
28).Consider the relation R (a, b, c, d) and the set F = { a c, b d}. The relation is in
a). 1NF but not in 2 NF b).2NF but not in 3 NF c). 3NF d). None of these ANSWER: A
29). Generally speaking ,for a weak entity set to be meaningful it must be part of a
a. One-to- many relationship b. many-to- many relationship
c. One-to- one relationship d. none of these ANSWER: A
30). A relation R is defined as R(S#, STATUS, CITY, SNAME) where S# is primary key.
sh
If R decomposed into two relations R1 and R2 .
a de
which of the following is a loss less decomposition?
Pr
a
a. R1 (S#, STATUS), R2 (S#, CITY, SNAME) b. R1 (S#, STATUS), R2 (STATUS, CITY, SNAME)
hr
nd
,A
c. R1 (S#, STATUS, SNAME), R2 (S#, CITY, STATUS) d. R1 (S#, STATUS, CITY), R2 (S#, CITY, SNAME) ANSWER: A
ct
31). Which language is used to define the integrity constraints?
tri
is
D
a. None of these b. DCL c. DML d. DDL ANSWER:D
a
hn
32). A table T1 in a relation database has the following rows and column:
ris
,K
Roll no Marks
ru
1 10
lle
va
2 20
la
3 30
ud
4 Null
,G
The following sequence of SQL statement was successfully executed on the table T1.
ic
hn
a. A schedule S isrecoverable if no transaction T in S commits until all transaction 'T' which writes an item that reads,
N
have committed
A.
A.
-4-
a. All strings beginning "Made\%Easy” b. Gives error
c. All strings beginning with "Made Easy" d. All strings beginning with "Made %Easy” ANSWER: D
37). The goal concurrency control in database system is to
a. Allow only those concurrent executions of transaction that are equivalent to some serial exactions of these
transactions
b. Execute transactions serially
c. Allow only these transaction to execution concurrently that do not access any common relation
d. Lock and unlock relation ANSWER: A
38). in an E-R diagram, the entity set Employee has name, age and address as attributes is a multivalued composites
sh
attributes composed of street number, city and pin code. When mapped to a relational model, the relations are
ade
Pr
Select one:
a
hr
a. Employee (name, age), Address (name, street, number, city, pin code)
nd
,A
b. Employee (name, age, address[n])
ct
tri
c. Employee (name, age, street, number,[n],city[n],pin code[n])
is
D
d. Employee(name, age, street, number[n],city[n],pin code[n])
a
hn
ris
The correct answer is: Employee (name, age), Address (name, street, number, city, pin code)
,K
39). suppose that we decompose the schema R(A,B,C,D) into R1 (A,B,C) and R2 (A,D,E) if the set F are functional
ru
lle
40). Which of the following SQL keyword is used with DCL statements?
ec
yt
42). Find the highest normal form of the relational R(A,B,C,D) and the set F={AB->D,AC->BD,B->C}
V.
.&
a. DELETE allows deletion of tuples, if a user deletes all tuples of relation the relation still exists, but it is empty .But if a
relation is DROP, then it no longer exists.
b. DELETE allows deletion of any number of tuples of relation the relation still exists, but it is not empty .But if a relation
is DROP, then it exist and may not be empty
c. DELETE allows deletion of any number of tuples of relation the relation still exists, but it is not empty .But if a relation
is DROP, then it exist and may be empty
d. Either (a) or (c) ANSWER: A
44). making a change to the conceptual scheme of a database but not affecting the existing external schemas is an
example of:
-5-
a.logical data independence b. concurrency control c. integrity control d. physical data independence ANSWER:A
45). A relational which is in 3NF may still have undesirable data redundancy because there may exist Select one:
a. Trivial functional dependency b. none of these ANSWER: D
c. Transaction functional dependency d. Non trivial functional dependencies involving prime attributes only
46). Which of the following is true?
a. Theta join, equi, join, natural join are all called inner joins b. Equi join is called inner join
c. Theta join is also called inner join d. Natural join is inner join ANSWER: A
47). What is data integrity?
sh
a. The inability to view a data base because of system problems
de
a
b. Maintaining consistency of the data in a database
Pr
a
c. None of these d. Data being unavailable because it is being used by another user ANSWER : B
hr
nd
,A
48). Consider the following set of functional dependencies(FDs)
ct
{Emp_no->Ename, Bdate, Address,Dept_no}
tri
is
D
{Dept_no->Dname, Mgr->No}
a
hn
The additional FD(s) which cannot be inferred from the above set of FDs is ANSWER: C
ris
,K
a. {Ename, Dept->Mgr_No} b. {Emp_No->Dname} c. {Ename->Dept_No} d. {Emp->No, Dname, Mgr_no}
ru
lle
49). A relation (for the relational database model) consists of a set of tuples, which implies that
va
la
a. For any tuples, the values associated with all of their attributes may be the same
ud
,G
b. Relational model supports multi-valued attributes whose values can be represented in sets.
ic
hn
c. K is a key for some other relational d. Every tuple of R1 has a distinct value for k 1 ANSWER: C
.&
-6-
What is the candidate key of this relation?
a. XY and ZW b. XY and WX c. XY and YZ d. XW and YZ ANSWER: B
55). ‘_ __ _%' matches any string of
a. Exactly three characters b. At most three characters
c. at most three characters d. At least three characters ANSWER: D
sh
ade
Pr
a
TOPIC::::: DATABASE MANAGEMENT SYSTEM
hr
nd
,A
1). consider relation schema R(A,B,C,D,E) with functional dependencies F containing A->B and C->D. T the schema is
decomposed into R1 (A,B) AND R2 (A,C,D,E).Find which relation is not in BCNF.
ct
tri
is
a. R1 is not in BCNF b. None of these.
D
a
c. R2 is not in BCNF d. R1 is not in BCNF but R2 is in BCNF ANSWER: C
hn
2). Let R (ABCDEFGH) be a relation with the following functional dependencies ris
,K
ru
FD={AB>CDEF
lle
va
A->C
la
ud
B->D
,G
ic
C->FG
hn
ec
G->H
yt
ol
.P
H->F
.R
3). Let R is a schema, R (Sid, Cid, Sname, Cname, marks) and functional dependency
.M
F={Sid->Sname, Cid->Cname, (Sid,Cid)->marks}, The highest normal form satisfied by above relation R is
N
A.
A.
-7-
a). Serializable schedule b). Non- schedule c). A dead lock schedule d). None of the above ANSWER: C
5).Consider a database with four tables.
employee_(Fname,Lname,SSN,DNO),Department_(Dname,Dnumber),works_no(ESSN,PNO)and project(CPname,
Pnumber, Dnum), then write a query to retrieve a list of employees and the projects they are working on, ordered by
department and within each department, ordered alphabetically by last name,frist name.
a. SELECT Dname, Lname, Fname, Pname FROM Department, Employee, Works_no, Project WHERE PNO=Pnumber and
Dnumber=DNO ORDER BYDname, Lname
b. None of these
c. SELECT Dname, Lname, Fname, Pname FROM Department, Employee, Works_no, Project WHERE Dnumber = DNO and
SSN=ESSN GROUP BY pnumber
sh
de
d. SELECT Dname,Lname,Fname,Pname FROM Department,Employee,Works_no,Project WHERE Dnumber = DNO and
a
Pr
SSN=ESSN and PNO=Pnumber ORDER BY D name ,Lname,Fname ANSWER: C
a
hr
6). Assertion (A): second level index in multilevel indexing will be always a primary index.
nd
,A
Reason (R) : all indexed files will be always physics ordered file.
ct
tri
Which one of the following is true?
is
D
a. Both (A) and (R) are false b. Both (A) and (R) are true and (R) is the reason for (A)
a
hn
c. Both (A) and (R) are true but (R) is not correct reason for (A) d. (A) is true but (R) is false ANSWER: A
ris
,K
8). Consider the following functional dependencies in a database:
ru
lle
Date of Birth->Age
va
la
Age->Eligibility
ud
,G
Name->Roll_number
ic
hn
Roll_number->Name
ec
yt
Course_number->course_name
ol
.P
Course_number->instructor
.R
.S
(Roll number,(course_number)->Grade)
R
V.
V.
a. In BCNF b. in 3NF but not in BCNF c. none of these d. In 2NF but not in 3NF ANSWER:B
.M
N
A.
-8-
a. 3NF b. 4NF c. 1NF d. BCNF ANSWER::A
10). which of the following scenarios may lead to an irrecoverable error in a database system?
Select one:
a. a transaction read a data item after it is read by an committed transaction
b. a transaction read a data item after it is written by an committed transaction
c. a transaction read a data item after it is written by an uncommitted transaction
d. a transaction writes a data item after it is read by an uncommitted transaction ANSWER: C
11). consider the following instance
sh
X y z
ade
1 4 2
Pr
a
1 5 3
hr
nd
,A
1 6 3
ct
3 2 2
tri
is
D
Which one of the following correctly describes the functional dependency hold by above instance. Select one:
a
hn
a. YZ->X,Y->Z and Y->X b. YZ->X and X->Z c. XY->Y and X->Z d. XY->Z and Z->Y ANSWER::A
ris
,K
12). S1: select b.cname FROM deposit d, borrow b WHERE d.bal>10,000 and b.amt <5000 and d.cname = b. cname
ru
lle
S2 : Cname who are having an account with balance>10,000 and a loan with amount<5000
va
la
∩ t [cname] = u[cname])}
ic
hn
a). S1 , S2 are same b). S2 S3 are same c). S1, S2, S3 are same d). S1, S3 are same ANSWER :: C
ec
yt
13). consider the following set dependencies F on the schema (A,B,C) F={A->BC,B->C,A->B,AB->C} The canonical cover of
ol
this set is
.P
.R
a. A->B and B->C b. A->BC and AB->C c. A->BC and B->C d. A->BC and A->B ANSWER::B
.S
R
V.
Q : SELECT max (sal) FROM emp GROUP BY dept no HAVING dept no<>10;
Q SELECT max (sal) FROM emp WHERE dept no<>10 GROUP BY dept no;
15). Which query will give maximum salary of each department except department number 10 from employee table?
a). Only Q1 b). Only Q2 c). Both Q1 and Q2 d). None of these ANSWER::C
16). which of the following is false about above ANSWER:::B
a. None of these b. Q1 is faster than Q2 c. Q2 is faster than Q1 d. both queries can be used for the required result
17). Consider the following statement:
S1 : every functional dependency is either a trivial dependency or must be a super key. Then the relation is in BCNF
-9-
S2 : All transitive dependencies can be removed in 3NF. Which of the following is true?
a. no one of these b. S1 and S2 are true c. S1 is true d. S2 is true ANSWER:::B
18).Consider the following statement:
S1: select Cnames who is having an account balance>10,000but not having any loan
S2: SELECT Cname FROM account WHERE bal>10,000 and Cname NOT IN (SELECT Cname FROM borrow);
Which of the following is true?
a. Both S1 , S2 are same b. none of these c. S1 , S2 are not same d. cannot say ANSWER::A
19). The SQL expression:
sh
SELECT distinct T. branch-name FROM branch T, branch S
ade
WHERE T.assets>s.assets and S.branch-city=”PONDICHERRY”
Pr
a
find the name of
hr
nd
,A
a. the branch that has the greatest asset in PONDICHERRY
ct
b. Any branches that has greater assets than any branch located in PONDICHERRY
tri
is
D
c. All branches that have greater assets than any branch located in PONDICHERRY
a
hn
d. All branches that have greater assets than all branch located in PONDICHERRY ANSWER::C
ris
,K
20).Consider the following relation schema pertaining to supplier_ part database
ru
lle
S(S#, SNAMME) ,P(P#,COLOR) and SP denotes the product of S and P What does the following SQL query produces?
va
la
SELECT DISTINCTS .NAME FROMS WHERE S . S# IN(SELECT SP.S# FROM SP WHERE SP. P# IN(SELECT P.P# FROM WHERE
ud
P.COLOR ='RED')).
,G
ic
a. Get supplier name for suppliers who supply at least one red part
hn
ec
b. None of these
yt
ol
.P
c. Get suppliers names for suppliers who supply only RED parts
.R
d. Get supplier name for suppliers who do not supply red parts ANSWER:: A
.S
R
V.
21).Consider two tables in a relational database with columns and rows as follows:
V.
.&
1 ABC
N
1
A.
A.
2 DEF 2
3 GHI 3
4 JKL 4
TABLE: STUDENT
TABLE: DEPARTMENT
Dept_id Dept_ name
1 A
2 B
- 10 -
3 C
Roll_no is the primary key of the student table, Dept_id is the primary key of the department table and student. Dept_id
is a foreign key from department. Dept_id
What will happen if we try to execute the following two SQL statements?
1. Update student set Dept_id=Null where Roll_no=1 2. Update department set Dept_id=Null where Dept_id=1
a. Both 1 and 2 will fail b. Both 1 and 2 will succeed
c. 1 will fail 2 will succeed d. 1 will succeed but 2 will fail ANSWER:: D
22).A relation Emp is defined with attributes empcode(unique) ,name,street,city,state,and pin code For any pincode,
there is only one city and state. Also for any give street, city and state, there is just one pin code. In normalized terms
sh
EMP, is a relation in
ade
a. 1NF only b. 3NF and hence also in 2NF and 1NF
Pr
a
c. 2NF and hence also in 1NF d. BCNF and hence also in 3NF, 2NF, 1NF ANSWER::C
hr
nd
The correct answer is: 2NF and hence also in 1NF
,A
ct
23). The employee information in a company is stored in the relation
tri
is
Employee: (name,sex,salary,deptname)
D
a
hn
Assume name is the primary key. Consider th SQL query
ris
,K
SELECT deptName FROM Employee WHERE sex='M' GROUP BY deptName HAVING AVG(salary)>(SELECT
ru
AVG(salary)FROM Employee);
lle
va
a. Of the male employee is more than the average salary of the male employees in the company
,G
ic
b. Of the male employees is more than the average salary of the employees in same department
hn
ec
- 11 -
ANSWER:::C
sh
de
25). A compound key
a
Pr
a. both (a) and (b) above b. is made up of a several pieces of information
a
hr
nd
c. is a combination of each unique key d . unique identifies an item in a list ANSWER ::A
,A
26). The database administration is, in effect, the coordinator between the ___ and the___
ct
tri
is
a. data base, users b. application program , users c. DBMS,data based. application program,data base ANSWER:A
D
a
27).a race condition occurs when
hn
a. none of these ris
b. two uses typing to obtain write lock on same data item
,K
ru
c. two user of the DBMS are interacting with different files at the same time
lle
va
The correct answer is: two concurrent activities interact to cause a processing error
,G
ic
A company has a storeroom, which consists of few employees who order products from different shops. Following is the
yt
ol
- 12 -
b. Retrieve the product number, employee number where an employee has ordered products from more than one shop
c. Retrieve the product number, employee number where the employee has ordered products from exactly than one
shop
d. Retrieve the product number, employee number where the employee has ordered from the shop which has not given
product to any other employees ANSWER:: B
29).. Consider the schema R=(A,B,C,D,E,F) together with the functional dependencies:
A->B DE->F B->C The highest normal form of the above relation is
a. 3NF b. 2NF c. 1NF d. BCNF ANSWER::C
Common data for next 2 questions
sh
There are six tables describes a company , describing employees,departments,buildings , which department(s) an
ade
employee works in (and a percentage of the time for each), department manger (possibly more than one per
Pr
department) , and in which building an employee works(an employee may have more than one office). The primary
a
hr
key of each table is the attribute(s) in capitals. Other attributes are not necessarily unique.
nd
,A
EMP (EID, EName, Salary, Start_date, En d_date)
ct
tri
IN_DEPT (EID, DID, Percent_time)
is
D
BUILDING (BID, Bname, Address)
a
hn
IN_BULIDING (EID, BID)
ris
,K
DEPT (DID, Dname, Annual_Budget)
ru
lle
30).WHICH of the following queries finds the name of department where no employees work?
ud
,G
b. SELECT Dname
ec
yt
BY DID
R
V.
V.
c. SELECT Dname
.M
N
A.
FROM DEPT
A.
- 13 -
31).Which one of the following queries finds the name of building where more than 50 employees work?
1. SELECT bname FROM IN_BULLIDING GROUP _BY BID WHERE Count (*)>50
2. SELECT Bname FROM BUILDING WHERE BID IN (SELECT BID FROM) IN_BUILDING
GROUP BY BID HAVING COUNT.BID (*)>50
3. SELECT Bname FROM BUILDING B, IN BUILDING I WHERE B.BID = I.BID GROYP BY B.BID
HAVING COUNT (*)>50
4) SELECT Bname FROM BUILDING B WHERE 50< (Select count (*) from IN_BUILDING | Where I. BID = B. BID
a. 1 and 3 b. 3 and 4 c. 2 and 4 d. 1 and 2 ANSWER : C
sh
Common data for next 2 questions
ade
Consider a database table T with attributes A,B,C,D,E and a set of functional dependencies
Pr
a
FD={AE->BC,AC->D,CD->BE,D->E}
hr
nd
,A
32).what is the highest normal form of the table T?
ct
a. BCNF b. 3NF c. 2NF d. 1NF ANSWER:: D
tri
is
D
33). which of the following are the candidate key of T?
a
hn
a. AE,BA,D b. AE,AC,CD c. D,E d. AE,AC,AD ANSWER:D
ris
,K
33).If we decompose S into S1 =ABD and S2 =BC , then fill in the following blanks for A,B and C
ru
lle
Consider the relation schema S(A,B,C,D) and the following functional dependencies on
va
la
S{A->BCD,B->C,CD->A}
ud
,G
c. Lossy, dependency preserving, BCNF d. Lossless, not dependency preserving, BCNF ANSWER:::D
R
V.
V.
34).If we decompose S into S1 =ABC and S2 =bcd, then which of the following observation become true? Consider the
.&
S{A->BCD,B->C,CD->A}
N
A.
A.
- 14 -
b. The relation R(ABCDE) with FD'S F={AB->CDE,C->A,D->E} is in BCNF
c. The relation R (ABCD) with FD'S F={A->BCD,B->CD,C->D} is in 3NF
d. The relation (ABCD) with FD'S F={A->B,B->C,C->D} is in 2NF ANSWER:: D
37).CONSIDER the relational and its sample data.(consider that these are the only tuples for the given relation?)
sh
1. The functional dependency (Emp No, Dept NO)->ProjNo holds over R
de
a
2. The functional dependency DeptNo->ProjNo holds over R
Pr
a
hr
3. The functional dependency Emp No -> DeptNo holds over R
nd
,A
4. The functional dependency ProjNo -> DeptNo holds over R
ct
5. The functional dependency (Emp No, ProjNo)->DeptNo holds over R
tri
is
D
a. 3,4 and 5 b. 1,2 and 3 c. all of the above d. 2,3 and 4 ANSWER:: A
a
hn
38).Consider the relation ‘properly (propeertyld village name, Lot# Area)’ with the following functional dependencies.
ris
,K
1. Propertyld-> (village anme,Lot#,area)
ru
lle
2. (Villagename, lot#)->(propertyld,area)
va
la
3. Area->village name
ud
,G
Which of the following statement is false with respect to the information given above?
ic
hn
a. The functional dependency area->village name violates BCNF b. The relational ‘property’ is in BCNF
ec
yt
39). consider the flowing table obtain using student and instructor
.R
.S
The relation student and instructor as given below. Please note that Fname and Lname also denote the first name and
R
V.
instructor
.M
N
A.
A.
ANSWER ::C
a. the set operation such as CARTESIAN PRODUCT and DIVISION CAN BE APPLIED ON THESE TWO RELATIONS
b. the two relations are not union-compatible since their attributes names differ
- 15 -
c. to find out the student who are not instructors, it is necessary to perform the operations student % instructor
d. the set operation such as CARTESIAN PRODUCT and DIVISION CAN BE APPLIED ON THESE TWO RELATIONS
40). The terms in list-I have been mapped to list-II so that it corresponds to the mapping process of the ER model into a
relational model. Which of the following represents the mapping process?
sh
ade
Pr
a
hr
nd
,A
ct
tri
is
D
a
ANSWER::A
hn
41). Consider the following statements . ris
,K
ru
1. An entity integrity constraint states that no primary key value can be null.
lle
va
a). Only 1 and 3 b). Only 2 and 3 c). Only 1 and 2 d). All of these. ANSWER::C
yt
ol
a). Normalization is a formal technique that can be used at any stage of the database design.
.S
R
b). Normalization can be used as a validation technique to check the structure of relations which may have been created
V.
V.
using ER modeling.
.&
c). The process of normalization through decomposition must achieves the lossless join property at any cost whereas the
.M
- 16 -
c). The FD3 violates 3 NF d). The FD3 violets BCNF ANSWER::C
a1 b1 c1
a1 b1 c2
sh
a2 b1 c1
de
a
Pr
a2 b1 c3
a
hr
nd
What is the number of functional dependencies in the canonical cover of this relation? Answer: 2
,A
2). Consider relation r( P, Q, R, S) with functional dependencies.
ct
tri
is
PQ R
D
a
PQ S
hn
R P ris
,K
ru
SQ
lle
va
3). Given a relation R with four attributes A, B, C, D the following FD’s holds for R?
,G
ic
4).Find the highest normal form of the relation R(A, B, C, D) that holds following FDs.
.R
A B BD AC BC A
.S
R
V.
F G
N
A.
A.
P Q P R
RP R Q
PQ R QR P
Which of the following is correct?
a). F covers G but G does not over F b). G cover F but F doesnot over G
c). F covers G and G covers F d). None of these Answer: C
6). A relation R(A, B, C, D, E, F) holds following Fds
AB C C D D EA EF FB
- 17 -
Find the number of candidate keys of R. Answer: 8
7). Given R(A, B, C, D) with FDs F= {AB --> CD, C A, B D} is decomposed into R1 (A, B, C) and R2 (B,C,D) then which
of the following statement is true about decomposition of R?
a). Lossless and dependency preserve decomposition.
b). Loss less and not dependency preserve decomposition
c). Lossy and dependency preserve decomposition
d). Lossy and not dependency preserve decomposition Answer: A
8). A relation R(A, B, C, D, E, F, G) holds following FDs.
B ACD
sh
de
BD E
a
Pr
EFG H
a
hr
nd
F GH
,A
Which of the following FD can be removed without altering the key of the relation R?
ct
tri
is
a). B ACD B). BD E C). EFG H D). F GH Answer: C
D
a
9). Consider the following statement
hn
i). Decomposition a relation into BCNF may not be lossless. ris
,K
ru
ii). If R and S are two relation in BCNF the natural join of R and S is also in BCNF.
lle
va
a). Only I b). Only ii c). Both I and ii d). None of these Answer: A
,G
ic
iv). If we define foreign key in relation R1 the DBMS checks foreign key constraints when ever a tuple in R is deleted.
V.
.&
a). I, ii, iv b).i, ii, iii c). All are true d). None of these. Answer: C
N
A.
11).Consider a relation R(A, B, C, D) with FDs A B and C D then the decomposition of R into R1 (A, B)
A.
and R2(C,
D) is
a). Dependency preserving and lossless join b). Lossless but NOT dependency preserving
c). Dependency preserving but not lossless join d). Not Dependency preserving and not lossless join Answer: C
12). Given a relation R(A, B, C, D) with FDs set {A B, B C, C B}
i). Lossless decomposition is always possible for R
ii). Dependency preserving decomposition is always possible for R.
Assume decomposition includes all the attributes of R.
- 18 -
a). Both I and ii true b). I is true and ii is false c). I is false and ii is true d). Both I and ii are false Answer: B
13).Consider the following statement
P: Canonical cover may not be unique
Q : F = {AB C, A B, B - A} Canonical cover of F is unique
Which of the above statements true.
a). Both P and Q true b). P is true and Q is false c). P is false and Q is true d). Both P and Q are false Answer: B
14).Consider a relation R(A, B, C, D, E) holds FDs : F = {AB C, C D, B E} is decomposed into R1(A, B, C) and R2(C,
D) then this decomposition.
a). Lossless and dependency preserving b). Dependency preserving and not lossless
sh
de
c). Lossless and not dependency preserving d). Not dependency preserving and not lossless Answer: C
a
Pr
15). Consider the following FD set on R(A, B, C) F = {A BC, B C, A B, AB C}
a
hr
nd
The canonical cover of this set is
,A
a). A B and B C b). A BC and B C c). A BC and B C d).B BC and AB C Answer: A
ct
tri
is
16). Consider a relation R(A, B, C, D) holds FDs AC B, BD C, CE D, DA E , EB A.
D
a
Find number of keys that contain attribute A. Answer: 3
hn
ris
17). How many maximum relation required for the following relation R(A B C D E) with FD (A BF, CD E, B D, E
,K
A) into BCNF without violation of lossless and dependency preserving decomposition?
ru
lle
18).How many super keys in the following relation R(A B C D E) (AB C, BC D, CD A, AD B).
ud
,G
a). If table R has a forgien key constraint referencing table S then each tuple in R is necessarily related to some tuple in S
.P
b). The SQL statement delete from R might cause tuples in the table other than just R to be deletd.
R
V.
c). NULL values Can be used to opt a tuple out of enforcement of a forgien key.
V.
.&
d). Anything that can be expressed in an ER diagram via ternary relationship can be expressed some other logically
.M
R(C, D) Q( B, C) P(A, B)
C is a foreign key in Q referencing R(C) on delete cascade B is foreign in P referencing Q(B) on delete set null suppose
current content of P. Q, R as follows.
P Q R
AB AB AB
ab ab ab
ab aa ab
ab
- 19 -
After executing delete from R what tuples P will contain?
a). (a, NULL) and (b, b) b). (a, NULL) AND (B, NULL) C). (b,b ) only d). P will not be changed Answer: B
21). In the most general case, if table r has forgien key constraint referencing table S then Answer: C
a). each tuple in R is related to one or more tuples in S. b). Each tuple in R is related to exactly one tuple in S.
c). Each tuple in R I related to Zero or one tuple in S d). Each tuple in R is related to zero or more tuples in S.
22). Consider the following statements
i). An entity integrity constraint states that no primary key value can be null.
ii). A referential integrity constraint is specified between two relations.
sh
iii). A foreien key can’t be used to refer to it’s own relation
ade
Identify which of the above statements are correct?
Pr
a
a). Only I and (iii) b). only (ii) and (iii) c). Only (i) and (ii) d). All of these Answer: C
hr
nd
23).If both the functional dependencies X Y and Y X hold for two attribute X and Y then the relationship between X
,A
and Y is
ct
tri
is
a). 1 : 1 b). M : 1 c). 1 : M d). None of these Answer: A
D
a
24). R(A, B, C, D) is a relation which of the following does not have a lossless join dependency preserving BCNF
hn
decomposition. ris
,K
a). A -> B, B CD b). A B , B C, CD c). AB C , C AD d). ABCD Answer: C
ru
lle
26). A relation P(A, B, C) has no non – trivial functional dependencies, and then what should be the set of candidate keys
ic
a). {ABC} b).{ A, B, C} c). {AB, BC, CA} d). None of these Answer: A
yt
ol
27).In a relation is in BCNF, then which of the following statement is always true?
.P
.R
a). The relation does not have any type of data redundancy
.S
R
b). The relation does not have data redundancy (which is due to functional dependency).
V.
V.
c).The relation may have data redundancy (which is due to functional dependency ).
.&
.M
- 20 -
Topic Name :::: SQL
1). Consider the relations:
S(Sid, sname, city)
P(pid, pname, color)
SP(sid, pid)
Consider the following SQL query
Select distinct sname
From S
sh
Where EXISTS
a de
(select * from SP where SP. sid = s.sid AND SP. pid = ‘P1’)
Pr
a
The above query represents which of the following ?
hr
nd
,A
a). Get supplier names from suppliers who supply part P1 b). Get supplier names who supply part P only
ct
c). Get supplier name who does not supply part P1 d). None of these. Answer: D
tri
is
D
2). Which of the following statement is not correct about SQL?
a
hn
a). SQL is a declarative query language in which we declare what we want but not how to compute.
ris
,K
b). In SQL NULL is ignored in any aggregation function.
ru
lle
c). For any SQL query the exist a unique translation into relation algebra. Answer: C
va
la
d). schema Normalization reduces potential data redundancy but not enhances query efficiency.
ud
,G
SELECT stud _ id
.R
.S
EXCEPT
.M
SELECT stud_id
N
A.
A.
- 21 -
c). Finds the students who are enrolled in atleast one course by CS department and not enrolled in any course offered by
ME department
d). Finds the students who are enrolled in all course by CS department and not enrolled in any courses offered by ME
department. Answer: C
4). Consider the relation
Project(pno, pname, budget, city)
Q1: SELECT Pname
From proj
WHERE NOT (budget <= ANY (SELECT budget
sh
FROM proj
ade
Pr
WHERE city = ‘KANPUR’))
a
hr
Q1 computes.
nd
,A
a). Name of the projects whose budgets is less than atleast one project in KANPUR.
ct
tri
b). Name of the projects whose budgets is greater than some project in KANPUR.
is
D
c). Name of the projects whose budgets is less than all project5 in KANPUR.
a
hn
ris
d). Name of the projects whose budgets is greater than all project in KANPUR. Answer: D
,K
5). Consider the relations
ru
lle
Proj(pid, pname,budget,city)
va
la
ud
Q: SELECT pname
,G
FROM proj P1
ic
hn
(select budget
.P
.R
From proj P2
.S
a). greater than some project in DELHI b). greater than all project in DELHI
A.
A.
c). less than all project in DELHI d). Less than any project in Delhi Answer: B
6). Consider the folowiong rlations
Emp(eno, ename, titile , city)
Project(pno, pname, budget)
Works (eno,pno)
Pay(title, salary)
Which query finds what fraction of the budget is spend on salaries for the people working on that project?
a). SELECT P.pno, pname, sal/budget AS frac
- 22 -
From project P, (Select pno, sum(salary))
AS sal FROM works, Emp, Pay WHERE works.eno = Emp.eno AND Emp.title = ay.title
Group by pno) AS Q WHERE P. pno = Q. pno ORDER BY budget ;
b). Select P.pno, pname sum(salary) budget AS frac From project P, works, W.Emp E, Pay’
WHERE P.pno = W.pno AND W. eno = E.eno AND E.title = Pay . title
GROUP BY P.pno, budget ORDER BY budget
c). Both a and b d). None of these Answer: C
7). Consider the following relations:
sh
Bank (bname, city)
de
a
Travel (pname, city)
Pr
a
SELECT T1.pname FROM Travel T1 WHERE NOT EXISTS (SELECT B. city From Bank B
hr
nd
,A
WHERE B.bname = ‘SBI’
ct
EXCEPT
tri
is
D
SELECT T2.city FROM Travel T2 Where T1.pname = T2.pname)
a
hn
This query finds name of the persons. Answer: C
ris
,K
a). Who have not travelled in any city where SBI is located b). Who have not travelled in all city where SBI is located
ru
lle
c). Who have travelled in all city where SBI is located d). Who have travelled in any city where SBI is located
va
la
8). SELECT 1
ud
,G
FROM 2
ic
hn
WHERE 3
ec
yt
GROUP BY 4
ol
.P
HAVING 5
.R
.S
ORDER BY 6
R
V.
V.
What is correct order for evaluating an SQL statement ? Where order is 6 digit number. Answer: 234516
.&
9). Which of the following queries will give the names of the employees who are earning maximum salary?
.M
N
a). Select name from emp where sal = (select max(sal) from emp)
A.
A.
b). Select name from emp where sal > = (select sal from emp)
c). Both a) and b) are correct queries but the processing time is too high in b) than in a)
d). Both a and b are correct but processing is too high a) than in b) Answer: A
10). Which of the following aggregate function is does not ignore nulls its result?
a). COUNT B). COUNT * C). MAX D). MIN Answer: B
11). A database schema is specified by a set of definition expressed by a language called Answer: C
a)., Procedural language b). Data Manipulation language c). Data definition language d). Data Query language
- 23 -
12). Consider the following employee schema employee( name, salary, dept.no, phone).
Consider the following SQL query.
Select ename frim employee where ename like “ _ _ _” It returns the name of employee
a). Whose name is atleast three characters long. b). Whose name is most three characters long
c). Whose name is exactly three characters long. d). Whose name is “_ _ _ ” Answer:C
13). Consider the following relational schema
Employee (ename , salary, job)
Consider the following SQL queries and identity which of them are correct?
sh
a). Select distinct ename, job from employee b). Select ename, distinct job from employee
ade
c). Select distinct ename from employee Answer:: A, C
Pr
a
14). Consider the following relation schema:
hr
nd
,A
Author (A_name, A_ city)
ct
Book (B_ title , A_ name, P_name, Price)
tri
is
D
Publisher (P_name, P_ city)
a
hn
From the queries given below, which query is syntactically and logically incorrect for above schemas:
ris
,K
a). SELECT B- title, Price from BOOK, WHERE P-name IN (SELECT P_name, P_city from publisher where P-city = “Delhi” )
ru
lle
b). SELECT P_name, A_ Name, B_ title from BOOK where price BETWEEN 1000 AND (select avg(price) from BOOK
va
la
C). SELECT A_name A_city, Count(P_name) FROM Author, BOOK, Where Author. A_ name = BOOK. A_ name GROUP by
ic
1 500 Rajesh
.S
R
V.
2 300 Ramesh
V.
.&
3 100 Suresh
.M
4 600 Rajesh
N
A.
A.
5 800 Rajesh
6 900 Suresh
7 400 Rakesh
Number of tuples if we execute the following query on the above table is …………………. Answer: 3
Select Customer, Sum (order_price) From orders Group by Customer Having Sum (order _ prie) < = 1000
16). Consider the following relational schema student (Sid, Sname)
SID Sname
1 A
- 24 -
2 B
3 Null
4 Null
Now consider the following queries
Q1: Select count (*) from student
Q2: Select count (Sid) from student
Query q1 and Q2 returns respectively.
a). 4 and 3 b). 4 and 4 c). 3 and 3 d). Invalid table Answer: A
sh
ade
Pr
a
hr
nd
,A
ct
tri
is
D
a
hn
ris
,K
ru
lle
va
la
ud
,G
ic
hn
ec
yt
ol
.P
.R
.S
R
V.
V.
.&
.M
N
A.
A.
- 25 -