0% found this document useful (0 votes)
15 views112 pages

RDBMS

The document contains multiple choice questions and answers related to relational databases, covering topics such as database structure, keys, SQL operations, and data manipulation languages. Each question is followed by an explanation of the correct answer, providing insights into relational database concepts. The content serves as a study guide for understanding relational database management systems.

Uploaded by

goshipnetwork
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views112 pages

RDBMS

The document contains multiple choice questions and answers related to relational databases, covering topics such as database structure, keys, SQL operations, and data manipulation languages. Each question is followed by an explanation of the correct answer, providing insights into relational database concepts. The content serves as a study guide for understanding relational database management systems.

Uploaded by

goshipnetwork
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 112

Relational -DBMS

Multiple Choice Questions and Answers :-

1. A relational database consists of a collection of

a) Tables

b) Fields

c) Records

d) Keys

View Answer

Answer:a

Explanation:Fields are the column of the relation or tables.Records are each row in relation.Keys are the
constraints in a relation .

2. A ________ in a table represents a relationship among a set of values.

a) Column

b) Key

c) Row

d) Entry

View Answer

Answer:c

Explanation:Column has only one set of values.Keys are constraints and row is one whole set of
attributes.Entry is just a piece of data.

3. The term _______ is used to refer to a row.


a) Attribute

b) Tuple

c) Field

d) Instance

View Answer

Answer:b

Explanation:Tuple is one entry of the relation with several attributes which are fields.

4. The term attribute refers to a ___________ of a table.

a) Record

b) Column

c) Tuple

d) Key

View Answer

Answer:b

Explanation:Attribute is a specific domain in the relation which has entries of all tuples.

5. For each attribute of a relation, there is a set of permitted values, called the ________ of that
attribute.

a) Domain

b) Relation

c) Set

d) Schema

View Answer
Answer:a

Explanation:The values of the attribute should be present in the domain.Domain is a set of values
permitted .

6. Database __________ , which is the logical design of the database, and the database _______,which is
a snapshot of the data in the database at a given instant in time.

a) Instance, Schema

b) Relation, Schema

c) Relation, Domain

d) Schema, Instance

View Answer

Answer:d

Explanation:Instance is a instance of time and schema is a representation.

7.Course(course_id,sec_id,semester)

Here the course_id,sec_id and semester are __________ and course is a _________ .

a) Relations, Attribute

b) Attributes, Relation

c) Tuple, Relation

d) Tuple, Attributes

View Answer

Answer:b

Explanation:The relation course has a set of attributes course_id,sec_id,semester .


8. Department (dept name, building, budget) and Employee (employee_id , name, dept name,salary)

Here the dept_name attribute appears in both the relations .Here using common attributes in relation
schema is one way of relating ___________ relations.

a) Attributes of common

b) Tuple of common

c) Tuple of distinct

d) Attributes of distinct

View Answer

Answer:c

Explanation:Here the relations are connected by the common attributes.

9. A domain is atomic if elements of the domain are considered to be ____________ units.

a) Different

b) Indivisbile

c) Constant

d) Divisible

View Answer

Answer:b

Explanation:None.

10. The tuples of the relations can be of ________ order.

a) Any

b) Same
c) Sorted

d) Constant

View Answer

Answer:a

Explanation:The values only count .The order of the tuples does not matter.

1. Which one of the following is a set of one or more attributes taken collectively to uniquely identify a
record?

a) Candidate key

b) Sub key

c) Super key

d) Foreign key

View Answer

Answer:c

Explanation:Super key is the superset of all the keys in a relation.

2. Consider attributes ID , CITY and NAME . Which one of this can be considered as a super key ?

a) NAME

b) ID

c) CITY

d) CITY , ID

View Answer
Answer:b

Explanation:Here the id is the only attribute which can be taken as a key. Other attributes are not
uniquely identified .

3. The subset of super key is a candidate key under what condition ?

a) No proper subset is a super key

b) All subsets are super keys

c) Subset is a super key

d) Each subset is a super key

View Answer

Answer:a

Explanation:The subset of a set cannot be the same set.Candidate key is a set from a super key which
cannot be the whole of the super set

4. A _____ is a property of the entire relation, rather than of the individual tuples in which each tuple is
unique.

a) Rows

b) Key

c) Attribute

d) Fields

View Answer

Answer:b

Explanation:Key is the constraint which specifies uniqueness.


5. Which one of the following attribute can be taken as a primary key ?

a) Name

b) Street

c) Id

d) Department

View Answer

Answer:c

Explanation:The attributes name , street and department can repeat for some tuples.But the id attribute
has to be unique .So it forms a primary key.

6. Which one of the following cannot be taken as a primary key ?

a) Id

b) Register number

c) Dept_id

d) Street

View Answer

Answer:d

Explanation:Street is the only attribute which can occur more than once.

7. A attribute in a relation is a foreign key if the _______ key from one relation is used as an attribute in
that relation .

a) Candidate

b) Primary

c) Super
d) Sub

View Answer

Answer:b

Explanation:The primary key has to be referred in the other relation to form a foreign key in that
relation .

8. The relation with the attribute which is the primary key is referenced in another relation. The relation
which has the attribute as primary key is called

a) Referential relation

b) Referencing relation

c) Referenced relation

d) Referred relation

View Answer

Answer:b

Explanation:None.

9. The ______ is the one in which the primary key of one relation is used as a normal attribute in another
relation .

a) Referential relation

b) Referencing relation

c) Referenced relation

d) Referred relation

View Answer

Answer:c
Explanation:None.

10. A _________ integrity constraint requires that the values appearing in specified attributes of any
tuple in the referencing relation also appear in specified attributes of at least one tuple in the referenced
relation.

a) Referential

b) Referencing

c) Specific

d) Primary

View Answer

Answer:a

Explanation:A relation, say r1, may include among its attributes the primary key of another relation, say
r2. This attribute is called a foreign key from r1, referencing r2. The relation r1 is also called the
referencing relation of the foreign key dependency, and r2 is called the referenced relation of the foreign
key.

1. Using which language can a user request information from a database ?

a) Query

b) Relational

c) Structural

d) Compiler

View Answer

Answer:a
Explanation:Query language is a method through which the database entries can be accessed.

2. Student(ID, name, dept name, tot_cred)

In this query which attribute form the primary key?

a) Name

b) Dept

c) Tot_cred

d) ID

View Answer

Answer:d

Explanation:The attributes name ,dept and tot_cred can have same values unlike ID .

3. Which one of the following is a procedural language ?

a) Domain relational calculus

b) Tuple relational calculus

c) Relational algebra

d) Query language

View Answer

Answer:c

Explanation:Domain and Tuple relational calculus are non-procedural language.Query language is a


method through which the database entries can be accessed.

4. The_____ operation allows the combining of two relations by merging pairs of tuples, one from each
relation, into a single tuple.
a) Select

b) Join

c) Union

d) Intersection

View Answer

Answer:b

Explanation:Join finds the common tuple in the relations and combines it.

5. The result which operation contains all pairs of tuples from the two relations, regardless of whether
their attribute values match.

a) Join

b) Cartesian product

c) Intersection

d) Set difference

View Answer

Answer:b

Explanation:Cartesian product is the multiplication of all the values in the attributes.

6. The _______operation performs a set union of two “similarly structured” tables

a) Union

b) Join

c) Product

d) Intersect

View Answer
Answer:a

Explanation:Union just combines all the values of relations of same attributes.

7. The most commonly used operation in relational algebra for projecting a set of tuple from a relation is

a) Join

b) Projection

c) Select

d) Union

View Answer

Answer:c

Explanation:Select is used to view the tuples of the relation with or without some constraints.

8. The _______ operator takes the results of two queries and returns only rows that appear in both
result sets.

a) Union

b) Intersect

c) Difference

d) Projection

View Answer

Answer:b

Explanation:The union operator gives the result which is the union of two queries and difference is the
one where query which is not a part of second query .
9. A ________ is a pictorial depiction of the schema of a database that shows the relations in the
database, their attributes, and primary keys and foreign keys.

a) Schema diagram

b) Relational algebra

c) Database diagram

d) Schema flow

View Answer

Answer:a

Explanation:None.

10. The _________ provides a set of operations that take one or more relations as input and return a
relation as an output.

a) Schematic representation

b) Relational algebra

c) Scheme diagram

d) Relation flow

View Answer

Answer:b

Explanation:None.

1. Which one of the following is used to define the structure of the relation ,deleting relations and
relating schemas ?
a) DML(Data Manipulation Langauge)

b) DDL(Data Definition Langauge)

c) Query

d) Relational Schema

View Answer

Answer:b

Explanation: Data Definition language is the language which performs all the operation in defining
structure of relation.

2. Which one of the following provides the ability to query information from the database and to insert
tuples into, delete tuples from, and modify tuples in the database ?

a) DML(Data Manipulation Langauge)

b) DDL(Data Definition Langauge)

c) Query

d) Relational Schema

View Answer

Answer:a

Explanation: DML performs change in the values of the relation .

3. Create table employee (name varchar ,id integer)

What type of statement is this ?

a) DML

b) DDL

c) View
d) Integrity constraint

View Answer

Answer:b

Explanation:Data Definition language is the language which performs all the operation in defining
structure of relation.

4. Select * from employee

What type of statement is this?

a) DML

b) DDL

c) View

d) Integrity constraint

View Answer

Answer:a

Explanation: Select operation just shows the required fields of the relation. So it forms a DML

5. The basic data type char(n) is a _____ length character string and varchar(n) is _____ length character.

a) Fixed, equal

b) Equal, variable

c) Fixed, variable

d) Variable, equal

View Answer

Answer:c
Explanation: Varchar changes its length accordingly whereas char has a specific length which has to be
filled by either letters or spaces .

6. An attribute A of datatype varchar(20) has the value “Avi” . The attribute B of datatype char(20) has
value ”Reed” .Here attribute A has ____ spaces and attribute B has ____ spaces .

a) 3, 20

b) 20, 4

c) 20 , 20

d) 3, 4

View Answer

Answer:a

Explanation: Varchar changes its length accordingly whereas char has a specific length which has to be
filled by either letters or spaces.

7. To remove a relation from an SQL database, we use the ______ command.

a) Delete

b) Purge

c) Remove

d) Drop table

View Answer

Answer:d

Explanation: Drop table deletes the whole structure of the relation .purge removes the table which
cannot be obtained again.

8. Delete from r; r – relation


This command performs which of the following action ?

a) Remove relation

b) Clear relation entries

c) Delete fields

d) Delete rows

View Answer

Answer:b

Explanation: Delete command removes the entries in the table.

9. Insert into instructor values (10211, ’Smith’, ’Biology’, 66000);

What type of statement is this ?

a) Query

b) DML

c) Relational

d) DDL

View Answer

Answer:b

Explanation: The values are manipulated .So it is a DML .

10. Updates that violate __________ are disallowed .

a) Integrity constraints

b) Transaction control

c) Authorization
d) DDL constraints

View Answer

Answer:a

Explanation:Integrity constraint has to be maintained in the entries of the relation .

1. Select name ____ instructor name, course id

from instructor, teaches

where instructor.ID= teaches.ID;

Which keyword must be used here to rename the field name ?

a) From

b) Rename

c) As

d) Join

View Answer

Answer:c

Explanation:As keyword is used to rename.

2. Select * from employee where dept_name=”Comp Sci”;

In the SQL given above there is an error . Identify the error .


a) Dept_name

b) Employee

c) “Comp Sci”

d) From

View Answer

Answer:c

Explanation:For any string operations single quoted(‘) must be used to enclose.

3. Select emp_name

from department

where dept_name like ’ _____ Computer Science’;

Which one of the following has to be added into the blank to select the dept_name which has Computer
Science as its ending string ?

a) %

b) _

c) ||

d) $

View Answer

Answer:a

Explanation:The % character matches any substring.

4. ’_ _ _ ’ matches any string of ______ three characters. ’_ _ _ %’ matches any string of at ______ three
characters.

a) Atleast, Exactly
b) Exactly, Atleast

c) Atleast, All

d) All , Exactly

View Answer

Answer:b

Explanation:None.

5. Select name

from instructor

where dept name = ’Physics’

order by name;

By default, the order by clause lists items in ______ order.

a) Descending

b) Any

c) Same

d) Ascending

View Answer

Answer:d

Explanation:Specification of descending order is essential but it not for ascending.

6. Select *

from instructor

order by salary ____, name ___;


To display the salary from greater to smaller and name in ascending order which of the following
options should be used ?

a) Ascending, Descending

b) Asc, Desc

c) Desc, Asc

d) Descending, Ascending

View Answer

Answer:c

Explanation:None.

7. Select name

from instructor

where salary <= 100000 and salary >= 90000;

This query can be replaced by which of the following ?

a) Select name

from instructor

where salary between 90000 and 100000;

b) Select name

from employee

where salary <= 90000 and salary>=100000;

c) Select name

from employee

where salary between 90000 and 100000;

d) Select name

from instructor
where salary between 100000 and 90000;

View Answer

Answer:a

Explanation: SQL includes a between comparison operator to simplify where clauses that specify that a
value be less than or equal to some value and greater than or equal to some other value.

8. Select instructor.*

from instructor, teaches

where instructor.ID= teaches.ID;

This query does which of the following operation?

a) All attributes of instructor and teaches are selected

b) All attributes of instructor are selected on the given condition

c) All attributes of teaches are selected on given condition

d) Only the some attributes from instructed and teaches are selected

View Answer

Answer:b

Explanation:The asterisk symbol “ * ” can be usedin the select clause to denote “all attributes.”

9. In SQL the spaces at the end of the string are removed by _______ function .

a) Upper

b) String

c) Trim

d) Lower

View Answer
Answer:c

Explanation: The syntax of trim is Trim(s); where s-string .

10. _____ operator is used for appending two strings.

a) &

b) %

c) ||

d) _

View Answer

Answer:c

Explanation: || is the concatenation operator.

1. The union operation is represented by

a) n

b) U

c) –

d) *

View Answer

Answer:b
Explanation:Union operator combines the relations.

2. The intersection operator is used to get the _____ tuples.

a) Different

b) Common

c) All

d) Repeating

View Answer

Answer:b

Explanation:Intersection operator ignores unique tuples and takes only common ones.

3. The union operation automatically __________, unlike the select clause.

a) Adds tuples

b) Eliminates unique tuples

c) Adds common tuples

d) Eliminates duplicate

View Answer

Answer:d

Explanation:None.

4. If we want to retain all duplicates, we must write ________ in place of union.

a) Union all

b) Union some
c) Intersect all

d) Intersect some

View Answer

Answer:a

Explanation:Union all will combine all the tuples including duplicates.

5. (Select course id

from section

where semester = ’Fall’ and year= 2009)

except

(select course id

from section

where semester = ’Spring’ and year= 2010);

This query displays

a) Only tuples from second part

b) Only tuples from the first part which has the tuples from second part

c) Tuples from both the parts

d) Tuples from first part which do not have second part

View Answer

Answer:d

Explanation:Except keyword is used to ignore the values.

6. For like predicate which of the following is true.


i) % matches zero of more characters.

ii) _ matches exactly one character.

a) i-only

b) ii-only

c) Both of the mentioned

d) None of the mentioned

View Answer

Answer:a

Explanation:% is used with like and _ is used to fill in the character.

7. The number of attributes in relation is called as its

a) Cardinality

b) Degree

c) Tuples

d) Entity

View Answer

Answer:b

Explanation:None.

8. _____ clause is an additional filter that is applied to the result.

a) Select

b) Group-by

c) Having
d) Order by

View Answer

Answer:c

Explanation:Having is used to provide additional aggregate filtration to the query.

9. _________ joins are SQL server default

a) Outer

b) Inner

c) Equi

d) None of the mentioned

View Answer

Answer:b

Explanation:It is optional to give the inner keyword with join as it is default .

10. The _____________ is essentially used to search for patterns in target string.

a) Like Predicate

b) Null Predicate

c) In Predicate

d) Out Predicate

View Answer

Answer:a

Explanation:Like predicate matches the string in the given pattern.


1. A _____ indicates an absent value that may exist but be unknown or that may not exist at all.

a) Empty tuple

b) New value

c) Null value

d) Old value

View Answer

Answer:c

Explanation:None.

2. If the attribute phone number is included in the relation all the values need not be entered into the
phone number column . This type of entry is given as

a) 0

b) –

c) Null

d) Empty space

View Answer

Answer:c

Explanation:Null is used to represent absence of a value.

3. The predicate in a where clause can involve Boolean operations such as and.The result of true and
unknown is_______, false and unknown is _____, while unknown and unknown is _____.

a) Unknown, unknown, false

b) True, false, unknown

c) True, unknown, unknown

d) Unknown, false, unknown

View Answer

Answer:d

Explanation:None.

4. Select name

from instructor

where salary is not null;

Selects

a) Tuples with null value

b) Tuples with no null values

c) Tuples with any salary

d) All of the mentioned

View Answer

Answer:b

Explanation:Not null constraint removes the tpules of null values.

5. In a employee table to include the attributes whose value always have some value which of the
following constraint must be used ?

a) Null
b) Not null

c) Unique

d) Distinct

View Answer

Answer:b

Explanation:Not null constraint removes the tpules of null values.

6. Using the ______ clause retains only one copy of such identical tuples.

a) Null

b) Unique

c) Not null

d) Distinct

View Answer

Answer:d

Explanation:Unique is a constraint.

7. Create table employee (id integer,name varchar(20),salary not null);

Insert into employee values (1005,Rach,0);

Insert into employee values (1007,Ross, );

Insert into employee values (1002,Joey,335);

Some of these insert statements will produce an error. Identify the statement.

a) Insert into employee values (1005,Rach,0);

b) Insert into employee values (1002,Joey,335);

c) Insert into employee values (1007,Ross, );


d) Both a and c

View Answer

Answer:c

Explanation:Not null constraint is specified which means sone value (can include 0 also) should be given.

8. The primary key must be

a) Unique

b) Not null

c) Both a and b

d) Either a or b

View Answer

Answer:c

Explanation:Primary key must satisfy unique and not null condition for sure.

9. You attempt to query the database with this command: (25)

select nvl (100 / quantity, none)

from inventory;

Why does this statement cause an error when QUANTITY values are null?

a. The expression attempts to divide by a null value.

b. The data types in the conversion function are incompatible.

c. The character string none should be enclosed in single quotes (‘ ‘).

d. A null value used in an expression cannot be converted to an actual value

View Answer
Answer:a

Explanation: The expression attempts to divide by a null value is errorneous in sql.

10. The result of _____unknown is unknown.

a) Xor

b) Or

c) And

d) Not

View Answer

Answer:d

Explanation:Since unknown does not hold any value the value cannot have a reverse value.

1. Aggregate functions are functions that take a ___________ as input and return a single value.

a) Collection of values

b) Single value

c) Aggregate value

d) Both a & b

View Answer

Answer:a
Explanation:None.

2. Select __________

from instructor

where dept name= ’Comp. Sci.’;

Which of the following should be used to find the mean of the salary ?

a) Mean(salary)

b) Avg(salary)

c) Sum(salary)

d) Count(salary)

View Answer

Answer:b

Explanation:Avg() is used to find the mean of the values.

3. Select count (____ ID)

from teaches

where semester = ’Spring’ and year = 2010;

If we do want to eliminate duplicates, we use the keyword ______in the aggregate expression.

a) Distinct

b) Count

c) Avg

d) Primary key

View Answer
Answer:a

Explanation:Distinct keyword is used to select only unique items from the relation.

4. All aggregate functions except _____ ignore null values in their input collection.

a) Count(attribute)

b) Count(*)

c) Avg

d) Sum

View Answer

Answer:b

Explanation:* is used to select all values including null.

5. A Boolean data type that can take values true, false, and________ .

a) 1

b) 0

c) Null

d) Unknown

View Answer

Answer:d

Explanation:Unknown values do not take null value but it is not known.

6. The ____ connective tests for set membership, where the set is a collection of values produced by a
select clause. The ____ connective tests for the absence of set membership.

a) Or, in
b) Not in, in

c) In, not in

d) In, or

View Answer

Answer:c

Explanation:In checks if the query has the value but not in checks if it does not have the value.

7. Which of the following should be used to find all the courses taught in the Fall 2009 semester but not
in the Spring 2010 semester .

a) Select distinct course id

from section

where semester = ’Fall’ and year= 2009 and

course id not in (select course id

from section

where semester = ’Spring’ and year= 2010);

b) Select distinct course_id

from instructor

where name not in (’Fall’, ’Spring’);

c) (Select course id

from section

where semester = ’Spring’ and year= 2010)

d) Select count (distinct ID)

from takes

where (course id, sec id, semester, year) in (select course id, sec id, semester, year

from teaches
where teaches.ID= 10101);

View Answer

Answer:a

Explanation:None.

8. The phrase “greater than at least one” is represented in SQL by _____.

a) < all b) < some c) > all

d) > some

View Answer

Answer:d

Explanation: >some takes atlest one value above it .

9. Which of the following is used to find all courses taught in both the Fall 2009 semester and in the
Spring 2010 semester .

a) Select course id

from section as S

where semester = ’Fall’ and year= 2009 and

exists (select *

from section as T

where semester = ’Spring’ and year= 2010 and

S.course id= T.course id);

b) Select name

from instructor

where salary > some (select salary


from instructor

where dept name = ’Biology’);

c) Select count (distinct ID)

from takes

where (course id, sec id, semester, year) in (select course id, sec id, semester, year

from teaches

where teaches.ID= 10101);

d) (Select course id

from section

where semester = ’Spring’ and year= 2010)

View Answer

Answer:a

Explanation:None.

10. We can test for the nonexistence of tuples in a subquery by using the _____ construct.

a) Not exist

b) Not exists

c) Exists

d) Exist

View Answer

Answer:b

Explanation:Exists is used to check for existence of tuples.


1. A Delete command operates on ______ relation.

a) One

b) Two

c) Several

d) Null

View Answer

Answer:a

Explanation:Delete can delete from only one table at a time.

2. Delete from r where P;

The above command

a) Deletes a particular tuple from the relation

b) Deletes the relation

c) Clears all entries from the relation

d) All of the mentioned

View Answer

Answer:a

Explanation:Here P gives the condition for deleting specific rows.

3. Which one of the following deletes all the entries but keeps the structure of the relation .

a) Delete from r where P;


b) Delete from instructor where dept name= ’Finance’;

c) Delete from instructor where salary between 13000 and 15000;

d) Delete from instructor;

View Answer

Answer:d

Explanation:Absence of condition deletes all rows.

4. Which of the following is used to insert a tuple from another relation .

a) Insert into course (course id, title, dept name, credits)

values (’CS-437’, ’Database Systems’, ’Comp. Sci.’, 4);

b) Insert into instructor

select ID, name, dept name, 18000

from student

where dept name = ’Music’ and tot cred > 144;

c) Insert into course values (’CS-437’, ’Database Systems’, ’Comp. Sci.’, 4);

d) Not possible

View Answer

Answer:b

Explanation:Using select statement in insert will include rows which are the result of the selection.

5. Which of the following deletes all tuples in the instructor relation for those instructors associated with
a department located in the Watson building which is in department relation.

a) Delete from instructor

where dept_name in ‘Watson’;


b) Delete from department

where building=’Watson’;

c) Delete from instructor

where dept_name in (select dept name

from department

where building = ’Watson’);

d) Both a and c

View Answer

Answer:c

Explanation:The query must include building=watson condition to filter the tuples.

6. Update instructor

_____ salary= salary * 1.05;

Fill in with correct keyword to update the instructor relation.

a) Where

b) Set

c) In

d) Select

View Answer

Answer:b

Explanation:Set is used to update the particular value.

7. _________ are useful in SQL update statements,where they can be used in the set clause.
a) Multiple queries

b) Sub queries

c) Update

d) Scalar subqueries

View Answer

Answer:d

Explanation:None.

8. The problem of ordering the update in multiple update is avoided using

a) Set

b) Where

c) Case

d) When

View Answer

Answer:c

Explanation:The case statements can add the order of updating tuples.

9. Which of the following is the correct format for case statements .

a) Case

when pred1 … result1

when pred2 … result2

...

when predn … resultn


else result0

end

b) Case

when pred1 then result1

when pred2 then result2

...

when predn then resultn

else result0

end

c) Case

when pred1 then result1

when pred2 then result2

...

when predn then resultn

else result0

d) All of the mentioned

View Answer

Answer:b

Explanation:None.
1. The____condition allows a general predicate over the relations being joined.

a) On

b) Using

c) Set

d) Where

View Answer

Answer:a

Explanation:On gives the condition for the join expression.

2. Which of the join operations do not preserve non matched tuples.

a) Left outer join

b) Right outer join

c) Inner join

d) Natural join

View Answer

Answer:c

Explanation:INNER JOIN: Returns all rows when there is at least one match in BOTH tables.

3. Select *

from student join takes using (ID);

The above query is equivalent to

a) Select *

from student inner join takes using (ID);


b) Select *

from student outer join takes using (ID);

c) Select *

from student left outer join takes using (ID);

d) Both a and b

View Answer

Answer:a

Explanation:Join can be replaced by inner join.

4. What type of join is needed when you wish to include rows that do not have matching values?

a) Equi-join

b) Natural join

c) Outer join

d) All of the mentioned

View Answer

Answer:c

Explanation:An outer join does not require each record in the two joined tables to have a matching
record..

5. How many tables may be included with a join?

a) One

b) Two

c) Three

d) All of the mentioned


View Answer

Answer:d

Explanation:Join can combine multiple tables.

6. Which are the join types in join condition:

a) Cross join

b) Natural join

c) Join with USING clause

d) All of the mentioned

View Answer

Answer:d

Explanation:There are totally four join types in SQL.

7. How many join types in join condition:

a) 2

b) 3

c) 4

d) 5

View Answer

Answer:d

Explanation:Types are inner join,left outer join,right outer join,full join,cross join.
8. Which join refers to join records from the right table that have no matching key in the left table are
include in the result set:

a) Left outer join

b) Right outer join

c) Full outer join

d) Half outer join

View Answer

Answer:b

Explanation:RIGHT OUTER JOIN: Return all rows from the right table, and the matched rows from the
left table.

9. The operation which is not considered a basic operation of relational algebra is

a) Join

b) Selection

c) Union

d) Cross product

View Answer

Answer:a

Explanation:None.

10. In SQL the statement select * from R, S is equivalent to

a) Select * from R natural join S

b) Select * from R cross join S

c) Select * from R union join S


d) Select * from R inner join S

View Answer

Answer:b

Explanation:None.

1. Which of the following creates a virtual relation for storing the query ?

a) Function

b) View

c) Procedure

d) None of the mentioned

View Answer

Answer:b

Explanation:Any such relation that is not part of the logical model, but is made visible to a

user as a virtual relation, is called a view.

2. Which of the following is the syntax for views where v is view name ?

a) Create view v as “query name”;

b) Create “query expression” as view;

c) Create view v as “query expression”;

d) Create view “query expression”;

View Answer
Answer:c

Explanation: is any legal query expression. The view name is

represented by v.

3. Select course_id

from physics_fall_2009

where building= ’Watson’;

Here the tuples are selected from the view.Which one denotes the view.

a) Course_id

b) Watson

c) Building

d) physics_fall_2009

View Answer

Answer:c

Explanation:View names may appear in a query any place where a relation name may appear.

4. Materialised views make sure that

a) View definition is kept stable

b) View definition is kept up-to-date

c) View definition is verified for error

d) View is deleted after specified time

View Answer

Answer:b
Explanation:None.

5. Updating the value of the view

a) Will affect the relation from which it is defined

b) Will not change the view definition

c) Will not affect the relation from which it is defined

d) Cannot determine

View Answer

Answer:a

Explanation:None.

6. SQL view is said to be updatable (that is, inserts, updates or deletes can be applied on the view) if
which of the following conditions are satisfied by the query defining the view?

a) The from clause has only one database relation.

b) The query does not have a group by or having clause.

c) The select clause contains only attribute names of the relation, and does not have any expressions,
aggregates, or distinct specification.

d) All of the mentioned

View Answer

Answer:d

Explanation:All of the conditions must be satisfied to update the view in sql.

7. Which of the following is used at the end of the view to reject the tuples which do not satisfy the
condition in where clause ?

a) With
b) Check

c) With check

d) All of the mentioned

View Answer

Answer:c

Explanation:Views can be defined with a with check option clause at the end of the view definition;
then, if a tuple inserted into the view does not satisfy the view’s where clause condition, the insertion is
rejected by the database system.

9. For the view Create view instructor_info as

select ID, name, building

from instructor, department

where instructor.dept name= department.dept name;

If we insert tuple into the view as insert into instructor info values (’69987’, ’White’, ’Taylor’);

What will be the values of the other attributes in instructor and department relations?

a) Default value

b) Null

c) Error statement

d) 0

View Answer

Answer:b

Explanation:The values take null if there is no constraint in the attribute else it is a Erroneous statement.
10. Create view faculty as

Select ID, name, dept name

from instructor;

Find the error in this query .

a) Instructor

b) Select

c) View …as

d) None of the mentioned

View Answer

Answer:d

Explanation:Syntax is – create view v as ;.

1. A _________ consists of a sequence of query and/or update statements.

a) Transaction

b) Commit

c) Rollback

d) Flashback

View Answer

Answer:a
Explanation:Transaction is a set of operation until commit.

2. Which of the following makes the transaction permanent in the database ?

a) View

b) Commit

c) Rollback

d) Flashback

View Answer

Answer:b

Explanation:Commit work commits the current transaction.

3. In order to undo the work of transaction after last commit which one should be used ?

a) View

b) Commit

c) Rollback

d) Flashback

View Answer

Answer:c

Explanation:Rollback work causes the current transaction to be rolled back; that is, it undoes all the
updates performed by the SQL statements in the transaction.

4. Consider the following action:

Transaction…..

Commit;
Rollback;

What does Rollback do?

a) Undoes the transactions before commit

b) Clears all transactions

c) Redoes the transactions before commit

d) No action

View Answer

Answer:d

Explanation:Once a transaction has executed commit work, its effects can no longer be undone by
rollback work.

5. In case of any shut down during transaction before commit which of the following statement is done
automatically ?

a) View

b) Commit

c) Rollback

d) Flashback

View Answer

Answer:c

Explanation:Once a transaction has executed commit work, its effects can no longer be undone by
rollback work.

6. In order to maintain the consistency during transactions database provides

a) Commit

b) Atomic
c) Flashback

d) Retain

View Answer

Answer:b

Explanation:By atomic , either all the effects of the transaction are reflected in the database, or none
are (after rollback).

7. Transaction processing is associated with everything below except

a) Conforming a action or triggering a response

b) Producing detail summary or exception report

c) Recording a business activity

d) Maintaining a data

View Answer

Answer:a

Explanation:None.

8. A transaction completes its execution is said to be

a) Committed

b) Aborted

c) Rolled back

d) Failed

View Answer
Answer:a

Explanation:A complete transaction always commits.

9. Which of the following is used to get back all the transactions back after rollback ?

a) Commit

b) Rollback

c) Flashback

d) Redo

View Answer

Answer:c

Explanation:None.

10. ______ will undo all statements up to commit?

a) Transaction

b) Flashback

c) Rollback

d) Abort

View Answer

Answer:c

Explanation:Flashback will undo all the statements and Abort will terminate the operation.
1. The database administrator who authorizes all the new users, modifies database and takes grants
privilege is

a) Super user

b) Administrator

c) Operator of operating system

d) All of the mentioned

View Answer

Answer:d

Explanation:The authorizations provided by the administrator to the user is privilege.

2. Which of the following is a basic form of grant statement ?

a) Grant ‘privilege list’

on ‘relation name or view name’

to ‘user/role list’;

b) Grant ‘privilege list’

on ‘user/role list’

to ‘relation name or view name’;

c) Grant ‘privilege list’

to ‘user/role list’

d) Grant ‘privilege list’

on ‘relation name or view name’

on ‘user/role list’;

View Answer
Answer:a

Explanation:The privilege list allows the granting of several privileges in one command .

3. Which of the following is used to provide privilege to only a particular attribute ?

a) Grant select on employee to Amit

b) Grant update(budget) on department to Raj

c) Grant update(budget,salary,Rate) on department to Raj

d) Grant delete to Amit

View Answer

Answer:b

Explanation:This grant statement gives user Raj update authorization on the budget attribute of the
department relation.

4. Which of the following statement is used to remove the privilege from the user Amir ?

a) Remove update on department from Amir

b) Revoke update on employee from Amir

c) Delete select on department from Raj

d) Grant update on employee from Amir

View Answer

Answer:b

Explanation:revoke on from ;

5. Which of the following is used to provide delete authorization to instructor ?


a) Create role instructor ;

grant delete to instructor;

b) Create role instructor;

grant select on takes

to instructor;

c) Create role instructor;

grant delete on takes

to instructor;

d) All of the mentioned

View Answer

Answer:c

Explanation:The role is first created and the authorization is given on relation takes to the role.

6. Which of the following is true regarding views ?

a) The user who creates a view cannot be given update authorization on a view without having update
authorization on the relations used to define the view.

b) The user who creates a view cannot be given update authorization on a view without having update
authorization on the relations used to define the view.

c) If a user creates a view on which no authorization can be granted, the system will allow the view
creation request.

d) A user who creates a view receives all privileges on that view.

View Answer

Answer:c

Explanation:A user who creates a view does not necessarily receive all privileges on that view.
7. If we wish to grant a privilege and to allow the recipient to pass the privilege on to other users, we
append the __________ clause to the appropriate grant command.

a) With grant

b) Grant user

c) Grant pass privelege

d) With grant option

View Answer

Answer:d

Explanation:None.

8. In authorization graph if DBA provides authorization to u1 which inturn gives to u2 which of the
following is correct ?

a) If DBA revokes authorization from u1 then u2 authorization is also revoked .

b) If u1 revokes authorization from u2 then u2 authorization is revoked .

c) Both a and b

d) If u2 revokes authorization then u1 authorization is revoked .

View Answer

Answer:c

Explanation:A user has an authorization if and only if there is a path from the root of the authorization
graph down to the node representing the user.

9. Which of the following is used to avoid cascading of authorizations from the user ?

a) Granted by current role

b) Revoke select on department from Amit, Satoshi restrict;

c) Revoke grant option for select on department from Amit;


d) Revoke select on department from Amit, Satoshi cascade;

View Answer

Answer:b

Explanation:The revoke statement may specify restrict in order to prevent cascading revocation.The
keyword cascade can be used instead of restrict to indicate that revocation should cascade.

10. The granting and revoking of roles by the user may cause some confusions when that user role is
revoked .To overcome the above situation

a) The privilege must be granted only by roles

b) The privilege is granted by roles and users

c) The user role cannot be removed once given

d) By restricting the user access to the roles

View Answer

Answer:a

Explanation:The current role associated with a session can be set by executing set role role name. The
specified role must have been granted to the user, else the set role statement fails.

1. Any recursive view must be defined as the union of two subqueries: a _______ query that is
nonrecursive and a __________ query.

a) Base, recursive

b) Recursive, Base

c) Base, Redundant
d) View, Base

View Answer

Answer:a

Explanation:First compute the base query and add all the resultant tuples to the recursively defined
view relation.

2. Ranking of queries is done by which of the following ?

a) Group by

b) Order by

c) Having

d) Both a and b

View Answer

Answer:b

Explanation:Order by clause arranges the values in ascending or descending order where default is
ascending order .

3. In rank() function if one value is shared by two tuples then

a) The rank order continues as counting numbers

b) The rank order continues by leaving one rank in the middle

c) The user specifies the order

d) The order does not change

View Answer

Answer:b
Explanation:Example . rank() over (order by (GPA) desc).

4. The __________ function that does not create gaps in the ordering.

a) Intense_rank()

b) Continue_rank()

c) Default_rank()

d) Dense_rank()

View Answer

Answer:d

Explanation:For dense_rank() the tuples with the second highest value all get rank 2, and tuples with the
third highest value get rank 3, and so on .

5. Select ID, GPA

from student grades

order by GPA

____________;

Inorder to give only 10 rank on the whole we should use

a) Limit 10

b) Upto 10

c) Only 10

d) Max 10

View Answer

Answer:a

Explanation:However, the limit clause does not support partitioning, so we cannot get the top n within
each partition without performing ranking; further, if more than one student gets the same GPA, it is
possible that one is included in the top 10, while another is excluded.

6. If there are n tuples in the partition and the rank of the tuple is r , then its ________ is defined as (r -
1)/(n-1) .

a) Ntil()

b) Cum_rank

c) Percent_rank

d) rank()

View Answer

Answer:c

Explanation:Percent rank of a tuple gives the rank of the tuple as a fraction.

7. Inorder to simplify the null value confusion in the rank function we can specify

a) Not Null

b) Nulls last

c) Nulls first

d) Either b or c

View Answer

Answer:d

Explanation:select ID, rank () over (order by GPA desc nulls last) as s rank from student grades;.

8. Suppose we are given a view tot credits (year, num credits) giving the total number of credits taken by
students in each year.The query that computes averages over the 3 preceding tuples in the specified sort
order is
a) Select year, avg(num credits)

over (order by year rows 3 preceding)

as avg total credits

from tot credits;

b) Select year, avg(num credits)

over (order by year rows 3 unbounded preceding)

as avg total credits

from tot credits;

c) Both a and b

d) Either a or b

View Answer

Answer:a

Explanation:Suppose that instead of going back a fixed number of tuples, we want the window to
consist of all prior years we use rows unbounded preceding.

9. The functions which construct histograms and use buckets for ranking is

a) Rank()

b) Newtil()

c) Ntil()

d) None of the mentioned

View Answer

Answer:c

Explanation:For each tuple, ntile(n) then gives the number of the bucket in which it is placed, with
bucket numbers starting with 1.
10. The command ________________ such tables are available only within the transaction executing the
query, and are dropped when the transaction finishes.

a) Create table

b) Create temporary table

c) Create view

d) Create label view

View Answer

Answer:b

Explanation:None.

1. OLAP stands for

a) Online analytical processing

b) Online analysis processing

c) Online transaction processing

d) Online aggregate processing

View Answer

Answer:a

Explanation:OLAP is the manipulation of information to support decision making .


2. Data that can be modeled as dimension attributes and measure attributes are called _______ data.

a) Multidimensional

b) Singledimensional

c) Measured

d) Dimensional

View Answer

Answer:a

Explanation:Given a relation used for data analysis, we can identify some of its attributes as measure
attributes, since they measure some value, and can be aggregated upon.Dimension attribute define the
dimensions on which measure attributes, and summaries of measure attributes, are viewed.

3. The generalization of cross-tab which is represented visually is ____________ which is also called as
data cube.

a) Two dimensional cube

b) Multidimensional cube

c) N-dimensional cube

d) Cuboid

View Answer

Answer:a

Explanation:Each cell in the cube is identified for the values for the three dimensional attributes.

4. The process of viewing the cross-tab (Single dimensional) with a fixed value of one attribute is

a) Slicing

b) Dicing

c) Pivoting
d) Both a and b

View Answer

Answer:d

Explanation:For eg., The item name and colour is viewed for a fixed size.

5. The operation of moving from finer-granularity data to a coarser granularity (by means of aggregation)
is called a ________.

a) Rollup

b) Drill down

c) Dicing

d) Pivoting

View Answer

Answer:a

Explanation:The opposite operation—that of moving fromcoarser-granularity data to finer-granularity


data—is called a drill down.

6. In SQL the cross-tabs are created using

a) Slice

b) Dice

c) Pivot

d) All of the mentioned

View Answer

Answer:a
Explanation:pivot (sum(quantity) for color in (’dark’,’pastel’,’white’)) .

7. { (item name, color, clothes size), (item name, color), (item name, clothes size), (color, clothes size),
(item name), (color), (clothes size), () }

This can be achieved by using which of the following ?

a) group by rollup

b) group by cubic

c) group by

d) None of the mentioned

View Answer

Answer:d

Explanation:’Group by cube’ is used .

8. What do data warehouses support?

a) OLAP

b) OLTP

c) OLAP and OLTP

d) Operational databases

View Answer

Answer:a

Explanation:None .

9. Select item name, color, clothes size, sum(quantity)

from sales
group by rollup(item name, color, clothes size);

How many grouping is possible in this rollup?

a) 8

b) 4

c) 2

d) 1

View Answer

Answer:b

Explanation:{ (item name, color, clothes size), (item name, color), (item name), () } .

10. Which one of the following is the right syntax for DECODE ?

a) DECODE (search, expression, result [, search, result]… [, default])

b) DECODE (expression, result [, search, result]… [, default], search)

c) DECODE (search, result [, search, result]… [, default], expression)

d) DECODE (expression, search, result [, search, result]… [, default])

View Answer

Answer:d

Explanation:None .

1. An ________ is a set of entities of the same type that share the same properties, or attributes .

a) Entity set
b) Attribute set

c) Relation set

d) Entity model

View Answer

2. Entity is a

a) Object of relation

b) Present working model

c) Thing in real world

d) Model of relation

View Answer

Answer:c

Explanation:For example, each person in a university is an entity.

3. The descriptive property possessed by each entity set is _________ .

a) Entity

b) Attribute

c) Relation

d) Model

View Answer
Answer:b

Explanation:Possible attributes of the instructor entity set are ID, name, dept name, and salary.

4. The function that an entity plays in a relationship is called that entity’s _____________.

a) Participation

b) Position

c) Role

d) Instance

View Answer

Answer:c

Explanation:A relationship is an association among several entities.

5. The attribute name could be structured as a attribute consisting of first name, middle initial, and last
name . This type of attribute is called

a) Simple attribute

b) Composite attribute

c) Multivalued attribute

d) Derived attribute

View Answer

Answer:b

Explanation:Composite attributes can be divided into subparts (that is, other attributes).

6. The attribute AGE is calculated from DATE_OF_BIRTH . The attribute AGE is

a) Single valued
b) Multi valued

c) Composite

d) Derived

View Answer

Answer:d

Explanation:The value for this type of attribute can be derived from the values of other related
attributes or entities.

7. Not applicable condition can be represented in relation entry as

a) NA

b) 0

c) NULL

d) Blank Space

View Answer

Answer:c

Explanation:NULL always represents that the value is not present.

8. Which of the following can be a multivalued attribute ?

a) Phone_number

b) Name

c) Date_of_birth

d) All of the mentioned

View Answer
Answer:a

Explanation:Name and Date_of_birth cannot hold more than 1 value.

9. Which of the following is a single valued attribute

a) Register_number

b) Address

c) SUBJECT_TAKEN

d) Reference

View Answer

Answer:a

Explanation:None.

10. In a relation between the entities the type and condition of the relation should be specified . That is
called as______attribute

a) Desciptive

b) Derived

c) Recursive

d) Relative

View Answer

Answer:a

Explanation:Consider the entity sets student and section, which participate in a relationship set takes.
We may wish to store a descriptive attribute grade with the relationship to record the grade that a
student got in the class.
1. Which of the following gives a logical structure of the database graphically ?

a) Entity-relationship diagram

b) Entity diagram

c) Database diagram

d) Architectural representation

View Answer

Answer:a

Explanation:E-R diagrams are simple and clear—qualities that may well account in large part for the
widespread use of the E-R model.

2. The entity relationship set is represented in E-R diagram as

a) Double diamonds

b) Undivided rectangles

c) Dashed lines

d) Diamond

View Answer

Answer:d

Explanation:Dashed lines link attributes of a relationship set to the relationship set.

3. The Rectangles divided into two parts represents

a) Entity set

b) Relationship set
c) Attributes of a relationship set

d) Primary key

View Answer

Answer:a

Explanation:The first part of the rectangle , contains the name of the entity set. The second part
contains the names of all the attributes of the entity set.

4. Consider a directed line(->) from the relationship set advisor to both entity sets instructor and
student. This indicates _________ cardinality

a) One to many

b) One to one

c) Many to many

d) Many to one

View Answer

Answer:b

Explanation:This indicates that an instructor may advise at most one student, and a student may have at
most one advisor.

5. We indicate roles in E-R diagrams by labeling the lines that connect ___________ to __________.

a) Diamond , diamond

b) Rectangle, diamond

c) Rectangle, rectangle

d) Diamond, rectangle

View Answer
Answer:d

Explanation:Diamond represents a relationship set and rectangle represents a entity set.

6. An entity set that does not have sufficient attributes to form a primary key is termed a __________ .

a) Strong entity set

b) Variant set

c) Weak entity set

d) Variable set

View Answer

Answer:c

Explanation:An entity set that has a primary key is termed a strong entity set.

7. For a weak entity set to be meaningful, it must be associated with another entity set, called the

a) Identifying set

b) Owner set

c) Neighbour set

d) Strong entity set

View Answer

Answer:a

Explanation:Every weak entity must be associated with an identifying entity; that is, the weak entity set
is said to be existence dependent on the identifying entity set. The identifying entity set is said to own
the weak entity set that it identifies.It is also called as owner entity set.

8. Weak entity set is represented as


a) Underline

b) Double line

c) Double diamond

d) Double rectangle

View Answer

Answer:c

Explanation:An entity set that has a primary key is termed a strong entity set.

9. If you were collecting and storing information about your music collection, an album would be
considered a(n) _____.

a) Relation

b) Entity

c) Instance

d) Attribute

View Answer

Answer:b

Explanation:An entity set is a logical container for instances of an entity type and instances of any type
derived from that entity type.

10. What term is used to refer to a specific record in your music database; for instance; information
stored about a specific album?

a) Relation

b) Instance

c) Table
c) Column

View Answer

Answer:b

Explanation:The environment of database is said to be instance. A database instance or an ‘instance’ is


made up of the background processes needed by the database.

1. Let us consider phone_number ,which can take single or several values . Treating phone_numberas an
_________ permits instructors to have several phone numbers (including zero) associated with them.

a) Entity

b) Attribute

c) Relation

d) Value

View Answer

Answer:a

Explanation:Treating a phone as an attribute phone_number implies that instructors have precisely one
phone number each.

2. The total participation by entities is represented in E-R diagram as

a) Dashed line

b) Double line
c) Double rectangle

d) Circle

View Answer

Answer:b

Explanation:It is used to represent the relation between several attributes.

3. Given the basic ER and relational models, which of the following is INCORRECT?

a) An attribute of an entity can have more than one value

b) An attribute of an entity can be composite

c) In a row of a relational table, an attribute can have more than one value

d) In a row of a relational table, an attribute can have exactly one value or a NULL value

View Answer

Answer:c

Explanation:It is possible to have several values for a single attribute provide it is a multi-valued
attribute.

4. Which of the following indicates the maximum number of entities that can be involved in a
relationship?

a) Minimum cardinality

b) Maximum cardinality

c) ERD

d) Greater Entity Count

View Answer
Answer:b

Explanation:In SQL (Structured Query Language), the term cardinality refers to the uniqueness of data
values contained in a particular column (attribute) of a database table.

5. In E-R diagram generalization is represented by

a) Ellipse

b) Dashed ellipse

c) Rectangle

d) Triangle

View Answer

Answer:d

Explanation:Ellipse represents attributes,rectangle represents entity.

6. What is a relationship called when it is maintained between two entities?

a) Unary

b) Binary

c) Ternary

d) Quaternary

View Answer

Answer:b

Explanation:Binary word usually represents two attributes.

7. Which of the following is a low level operator?

a) Insert
b) Update

c) Delete

d) Directory

View Answer

Answer:d

Explanation:Directory is a low level to word on in file system .

8. Key to represent relationship between tables is called

a) Primary key

b) Secondary Key

c) Foreign Key

d) None of the mentioned

View Answer

Answer:c

Explanation:Primary key of one relation used as an attribute in another relation is called foreign key.

9. A window into a portion of a database is

a) Schema

b) View

c) Query

d) Data dictionary

View Answer
Answer:b

Explanation:View is a logical portion of a database which is needed by some users.

10. A primary key is combined with a foreign key creates

a) Parent-Child relation ship between the tables that connect them

b) Many to many relationship between the tables that connect them

c) Network model between the tables that connect them

d) None of the mentioned

View Answer

Answer:a

Explanation:Using the two relationships mother and father provides us a record of a child’s mother,
even if we are not aware of the father’s identity; a null value would be required if the ternary
relationship parent is used. Using binary relationship sets is preferable in this case.

1. The entity set person is classified as student and employee .This process is called

a) Generalization

b) Specialization

c) Inheritance

d) Constraint generalization

View Answer
Answer:b

Explanation:The process of designating subgroupings within an entity set is called specialization.

2. Which relationship is used to represent a specialization entity ?

a) ISA

b) AIS

c) ONIS

d) WHOIS

View Answer

Answer:a

Explanation:In terms of an E-R diagram, specialization is depicted by a hollow arrow-head pointing from
the specialized entity to the other entity.

3. The refinement from an initial entity set into successive levels of entity subgroupings represents a
________ design process in which distinctions are made explicit.

a) Hierarchy

b) Bottom-up

c) Top-down

d) Radical

View Answer

Answer:c

Explanation:The design process may also proceed in a bottom-up manner, in which multiple entity sets
are synthesized into a higher-level entity set on the basis of common features.
4. There are similarities between the instructor entity set and the secretary entity set in the sense that
they have several attributes that are conceptually the same across the two entity sets: namely, the
identifier, name, and salary attributes. This process is called

a) Commonality

b) Specialization

c) Generalization

d) Similarity

View Answer

Answer:c

Explanation:Generalization is used to emphasize the similarities among lower-level entity sets and to
hide the differences.

5. If an entity set is a lower-level entity set in more than one ISA relationship, then the entity set has

a) Hierarchy

b) Multilevel inheritance

c) Single inheritance

d) Multiple inheritance

View Answer

Answer:d

Explanation:The attributes of the higher-level entity sets are said to be inherited by the lower-level
entity sets.

6. A _____________ constraint requires that an entity belong to no more than one lower-level entity set.

a) Disjointness

b) Uniqueness
c) Special

d) Relational

View Answer

Answer:a

Explanation:For example, student entity can satisfy only one condition for the student type attribute; an
entity can be either a graduate student or an undergraduate student, but cannot be both.

7. Consider the employee work-team example, and assume that certain employees participate in more
than one work team . A given employee may therefore appear in more than one of the team entity sets
that are lower level entity sets of employee. Thus, the generalization is _____________.

a) Overlapping

b) Disjointness

c) Uniqueness

d) Relational

View Answer

Answer:a

Explanation:In overlapping generalizations, the same entity may belong to more than one lower-level
entity set within a single generalization.

8. The completeness constraint may be one of the following: Total generalization or specialization ,
Partial generalization or specialization . Which is the default ?

a) Total

b) Partial

c) Should be specified

d) Cannot be determined
View Answer

Answer:b

Explanation:Partial generalization or specialization – Some higher-level entities may not belong to any
lower-level entity set.

9. Functional dependencies are a generalization of

a) Key dependencies

b) Relation dependencies

c) Database dependencies

d) None of the mentioned

View Answer

Answer:a

Explanation:The subclasses are combined to form the superclass.

10. Which of the following is another name for weak entity?

a) Child

b) Owner

c) Dominant

d) All of the mentioned

View Answer

Answer:a

Explanation:A parent may be called as a strong entity.


Create table department

(dept_name varchar (20),

building varchar (15),

budget number,

primary key (dept_name));

Create table course

(course_id varchar (7),

title varchar (50),

dept_name varchar (20),

credits numeric (2,0),

primary key (course_id),

foreign key (dept_name) __________ department);

Create table instructor

(ID varchar (5),

name varchar (20) not null,

dept_name varchar (20),

salary numeric (8,2),


foreign key (dept_name) _______ department);

Create table section

(course_id varchar (8),

sec_id varchar (8),

semester varchar (6),

year numeric (4,0),

building varchar (15),

room_number varchar (7),

time_slot id varchar (4),

primary key (course_id, sec_id, semester, year),

foreign key (_______) ______ course);

Create table teaches

(ID varchar (5),

course_id varchar (8),

sec_id varchar (8),

semester varchar (6),

year numeric (4,0),

primary key (ID, course_id, sec_id, semester, year),

foreign key (course_id, sec_id, semester, year) references section,

foreign key (ID) _______ instructor);

Answer questions based on the above commands


1. Which is the main relation which is used in the university database which is referenced by all other
relation of the university .

a) Teaches

b) Course

c) Department

d) Section

View Answer

Answer:c

Explanation:Department is the only relation which forms the main part of the university database .

2. The department relation has the an entry budget whose type has to be replaced by

a) Varchar (20)

b) Varchar2 (20)

c) Numeric (12,2)

d) Numeric

View Answer

Answer:c

Explanation:Department is the only relation which forms the main part of the university database.

3. In the course relation the title field should throw an error in case of any missing title . The command
to be added in title is

a) Unique

b) Not null

c) 0
d) Null

View Answer

Answer:b

Explanation:By specifying not null the value cannot be left blank .

4. In the above DDL command the foreign key entries are got by using the keyword

a) References

b) Key reference

c) Relating

d) None of the above

View Answer

Answer:a

Explanation:References (table_name) give the prior table name for the entry.

5. Identify the error in the section relation

a) No error

b) Year numeric (4,0)

c) Building varchar (15)

d) Sec_id varchar (8)

View Answer

Answer:a

Explanation:The building and the sec_id have varchar values and year is of numeric type. So no such
errors are found in the relation.
6. The following entry is given in to the instructor relation .

(100202,Drake,Biology,30000)

Identify the output of the query given

a) Row(s) inserted

b) Error in ID of insert

c) Error in Name of insert

d) Error in Salary of the insert

View Answer

Answer:b

Explanation:The varchar(5) value cannot hold the entry 100202.

7. Which of the following can be used as a primary key entry of the instructor relation.

a) DEPT_NAME

b) NAME

c) ID

d) All of the above

View Answer

Answer:c

Explanation:The value ID can only be primary key unlike dept_name which is used as a foreign key.

8. In the section relation which of the following is used as a foreign key ?

a) Course_id
b) Course_id,sec_id

c) Room_number

d) Course_id,sec_id,room_number

View Answer

Answer:a

Explanation:Course_id is the only field which is present in the course relation.

9. In order to include an attribute Name to the teaches relation which of the following command is used
?

a) Alter table teaches include Name;

b) Alter table teaches add Name;

c) Alter table teaches add Name varchar;

d) Alter table teaches add Name varchar(20);

View Answer

Answer:d

Explanation:The form of the alter table command is

alter table r add AD;

where r is the name of an existing relation, A is the name of the attribute to be added, and D is the type
of the added attribute.

10. To replace the relation section with some other relation the initial step to be carried out is

a) Delete section;

b) Drop section;

c) Delete from section;


d) Replace section new_table ;

View Answer

Answer:b

Explanation: Droping the table drops all the references to that table .

The instructor relation

ID Name Dept_name Salary

10101 Hayley Comp.Sci. 65000

12121 Jackson Finance 90000

15151 Nathan Music 87000

22222 April Biology 73000


34345 Crick Comp.Sci. 100000

The course relation

Course_id Title Dept_name Credits

CS-101 Robotics Comp.Sci. 5

BIO-244 Genetics Biology 4

PHY-333 Physical Principles Physics 3

MUS-562 Music Video Production Music 2

FIN-101 Investment Banking Finance 3

Answer the questions based on the above relations

1. Which of the following command is used to display the departments of the instructor relation ?

a) Select * from instructor where Dept_name = Finance;

b) Select * from instructor ;

c) Select dept_name from instructor;

d) Select dept_name for instructor where Name=Jackson;

View Answer

Answer:c

Explanation:Only one field is necessary for the query and where clause is not needed for the selection.
2. How can we select the elements which have common Dept_name in both the relation ?

a) Select * from instructor i , course c where i.Dept_name=c.Dept_name;

b) Select Dept name from instructor ,Course ;

c) Select * from instructor i , course c ;

d) Select Dept_name from instructor where Dept_name = NULL;

View Answer

Answer:a

Explanation:Here only the common elements are displayed .

3. Select distinct Dept_name from instructor ;

How many row(s) are displayed ?

a) 4

b) 3

c) 5

d) Error

View Answer

Answer:a

Explanation:Distinct keyword eliminates the the common Dept_name .

4. Suppose the Authority want to include a new instructor for the title Neuroscience what command
should be inserted ?

a) Insert into instructor values(12111,Emma,NeuroScience,200000);

b) Insert into course values(12111,Introduction,NeuroScience,2);

c) Insert into instructor values(12111,Emma,Biology,200000);


Insert into course values(BIO-112,Introduction to Neuro Science,NeuroScience,2);

d) Insert into course values(12111,Emma,NeuroScience,200000);

View Answer

Answer:c

Explanation:The values have to be inserted into both the relations to be intact .

5. If a person all the people in Music department gets fired which of the following has to be performed
on the instructor relation ?

a) Delete Dept_name=Music in instructor;

b) Delete from instructor where Dept_name=Music;

c) Remove Dept_name= Music

d) All of the mentioned

View Answer

Answer:b

Explanation:Delete from table_name where condition .

6. Select distinct T.name

from instructor as T, instructor as S

where T.salary > S.salary and S.dept name = ’Comp.Sci.’;

What will be displayed as the value of name for the above query ?

a) Hayley

b) Jackson

c) Hayley and Crick

d) Crick
View Answer

Answer:d

Explanation:Only the greatest salary in Comp.Sci dept is selected for the query .

7. select Name

from instructor

where salary > some (select salary from instructor where dept_name = ‘Comp.Sci.’);

How many rows are selected ?

a) 3

b) 4

c) 2

d) 1

View Answer

Answer:d

Explanation:This displays the names of instructors with salary greater than that of some (at least one)
instructor in the Biology department .

8. How will you select the Names whose first letter is E ?

a) Select Name

from instructor

where Name like ’A%;

b) Select Name

from course

where Name like ’A%;


c) Select Dept_name

from instructor

where Name like ’A%;

d) Select Name

from instructor

where Dept_name like ’A%;

View Answer

Answer:a

Explanation:% is used to indicate that some characters may appear .

9. Which function is used to find the count of distinct departments?

a) Dist

b) Distinct

c) Count

d) Count,Dist

View Answer

Answer:a

Explanation:count (distinct ID) is the correct usage .

10. Which function is used to identify the title with Least scope ?

a) Min(Credits)

b) Max(Credits)

c) Min(title)
d) Min(Salary)

View Answer

Answer:a

Explanation:Max is used to find the highest element and Min is used to find the lowest element .

1. _____________ can help us detect poor E-R design.

a) Database Design Process

b) E-R Design Process

c) Relational scheme

d) Functional dependencies

View Answer

Answer:d

Explanation:For eg.,Suppose an instructor entity set had attributes dept name and dept address, and
there is a functional dependency dept name -> dept address.

2. If a multivalued dependency holds and is not implied by the corresponding functional dependency, it
usually arises from one of the following sources.

a) A many-to-many relationship set

b) A multivalued attribute of an entity set

c) A one-to-many relationship set


d) Both a and b

View Answer

Answer:d

Explanation:For a many-to-many relationship set each related entity set has its own schema and there is
an additional schema for the relationship set. For a multivalued attribute, a separate schema is created
consisting of that attribute and the primary key of the entity set.

3. Which of the following has each related entity set has its own schema and there is an additional
schema for the relationship set.

a) A many-to-many relationship set

b) A multivalued attribute of an entity set

c) A one-to-many relationship set

d) Both a and b

View Answer

Answer:a

Explanation:If a multivalued dependency holds and is not implied by the corresponding functional
dependency, it usually arises from this source.

4. In which of the following , a separate schema is created consisting of that attribute and the primary
key of the entity set.

a) A many-to-many relationship set

b) A multivalued attribute of an entity set

c) A one-to-many relationship set

d) Both a and b

View Answer
Answer:b

Explanation:If a multivalued dependency holds and is not implied by the corresponding functional
dependency, it usually arises from this source.

4. Suppose the user finds the usage of room number and phone number in a relational schema there is
confusion.This is reduced by

a) Unique-role assumption

b) Unique-key assignment

c) Role intergral assignment

d) None of the mentioned

View Answer

Answer:a

Explanation:A desirable feature of a database design is the unique-role assumption, which means that
each attribute name has a unique meaning in the database.

5. What is the best way to represent the attributes in a large database?

a) Relational-and

b) Concatenation

c) Dot representation

d) All of the above

View Answer

Answer:b

Explanation: Example inst sec and student sec.


6. Designers use which of the following to tune performance of systems to support time-critical
operations?

a) Denormalization

b) Redundant optimization

c) Optimization

d) Realization

View Answer

Answer:a

Explanation:The process of taking a normalized schema and making it nonnormalized is called


denormalization.

7. In the schema (dept name, size) we have relations total inst 2007, total inst 2008 . Which dependency
have lead to this relation ?

a) Dept name, year->size

b) Year->size

c) Dept name->size

d) Size->year

View Answer

Answer:a

Explanation:The process of taking a normalized schema and making it nonnormalized is called


denormalization.

8. Relation dept year(dept name, total inst 2007, total inst 2008, total inst 2009) .Here the only
functional dependencies are from dept name to the other attributes .This relation is in

a) Fourth NF
b) BCNF

c) Third NF

d) Second NF

View Answer

Answer:b

Explanation:BCNF has only one normal form.

9. Thus a _______ of course data gives the values of all attributes, such as title and department, of all
courses at a particular point in time.

a) Instance

b) Snapshot

c) Both a and b

d) All of the mentioned

View Answer

Answer:b

Explanation:We use the term snapshot of data to mean the value of the data at a particular point in
time.

10. Representations such as the in the dept year relation, with one column for each value of an attribute,
are called _______; they are widely used in spreadsheets and reports and in data analysis tools.

a) Cross-tabs

b) Snapshot

c) Both a and b

d) All of the mentioned

View Answer
Answer:a

Explanation:SQL includes features to convert data from a normal relational representation to a crosstab.

1. Which level of RAID refers to disk mirroring with block striping?

a) RAID level 1

b) RAID level 2

c) RAID level 0

d) RAID level 3

View Answer

Answer:a

Explanation:RAID level 1 refers to disk mirroring with block striping.

2. Optical disk technology uses

a) Helical scanning

b) DAT

c) a laser beam

d) RAID

View Answer

Answer:d

Explanation:Redundant Array of Inexpensive Disks.


3. With multiple disks, we can improve the transfer rate as well by ___________ data across multiple
disks.

a) Striping

b) Dividing

c) Mirroring

d) Dividing

View Answer

Answer:a

Explanation:Data striping consists of splitting the bits of each byte across multiple disks; such striping is
called bitlevel striping.

4. Which one of the following is a Stripping technique ?

a) Byte level stripping

b) Raid level stripping

c) Disk level stripping

d) Block level stripping

View Answer

Answer:d

Explanation:Block-level striping stripes blocks across multiple disks. It treats the array of disks as a single
large disk, and it gives blocks logical numbers.

5. The RAID level which mirroring is done along with stripping is

a) RAID 1+0

b) RAID 0

c) RAID 2
d) Both a and b

View Answer

Answer:d

Explanation:Mirroring without striping can also be used with arrays of disks, to give the appearance of a
single large, reliable disk.

6. Where performance and reliability are both important, RAID level ____ is used.

a) 0

b) 1

c) 2

d) 0+1

View Answer

Answer:d

Explanation:Mirroring without striping can also be used with arrays of disks, to give the appearance of a
single large, reliable disk.

7. ______________ partitiones data and parity among all N+1 disks, instead of storing data in N-disks
and parity in one disk.

a) Block interleaved parity

b) Block interleaved distributed parity

c) Bit parity

d) Bit interleaved parity

View Answer

Answer:b
Explanation:In level 5, all disks can participate in satisfying read requests, unlike RAID level 4, where the
parity disk cannot participate, so level 5 increases the total number of requests that can be met in a
given amount of time.

8. Hardware RAID implementations permit _________; that is, faulty disks can be removed and replaced
by new ones without turning power off.

a) Scrapping

b) Swapping

c) Hot swapping

d) None of the mentioned

View Answer

Answer:c

Explanation:Hot

swapping reduces the mean time to repair, since replacement of a disk does not have to wait until a
time when the system can be shut down.

9. ___________ is popular for applications such as storage of log files in a database system, since it offers
the best write performance.

a) RAID level 1

b) RAID level 2

c) RAID level 0

d) RAID level 3

View Answer

Answer:a

Explanation:RAID level 1 refers to disk mirroring with block striping.


10. ______________ which increases the number of I/O operations needed to write a single logical
block, pays a significant time penalty in terms of write performance.

a) RAID level 1

b) RAID level 2

c) RAID level 5

d) RAID level 3

View Answer

Answer:a

Explanation:In level 5, all disks can participate in satisfying read requests, unlike RAID level 4, where the
parity disk cannot participate, so level 5 increases the total number of requests that can be met in a
given amount of time.

1. A(n) _________ can be used to preserve the integrity of a document or a message.

a) Message digest

b) Message summary

c) Encrypted message

d) None of the mentioned

Answer: c

Explanation: Encryption algorithms are used to keep the contents safe .

2. A hash function must meet ________ criteria.

a) Two

b) Three
c) Four

d) None of the mentioned

Answer: b

Explanation: Only if the criteria is fulfilled the values are hashed .

3. What is the main limitation of Hierarchical Databases?

a) Limited capacity (unable to hold much data)

b) Limited flexibility in accessing data

c) Overhead associated with maintaining indexes

d) The performance of the database is poor

Answer: b

Explanation: In this the data items are place in a tree like hierarchical structure .

4. The property (or set of properties) that uniquely defines each row in a table is called the:

a) Identifier

b) Index

c) Primary key

d) Symmetric key

Answer: c

Explanation: Primary is used to uniquely identify the tuples .

5. The separation of the data definition from the program is known as:
a) Data dictionary

b) Data independence

c) Data integrity

d) Referential integrity

Answer: b

Explanation: Data dictionary is the place where the meaning of the data are organized .

6. In the client / server model, the database:

a) Is downloaded to the client upon request

b) Is shared by both the client and server

c) Resides on the client side d

d) Resides on the server side

Answer: d

Explanation: The server has all the database information and the client access it .

7. The traditional storage of data that is organized by customer, stored in separate folders in filing
cabinets is an example of what type of ‘database’ system?

a) Hierarchical

b) Network

c) Object oriented

d) Relational

Answer: a

Explanation: Hierarchy is based on Parent-Child Relationship. Parent-Child Relationship Type is basically


1:N relationship

8. The database design that consists of multiple tables that are linked together through matching data
stored in each table is called a) Hierarchical database

b) Network database

c) Object oriented database

d) Relational database

Answer: d

Explanation: A relational database is a collection of data items organized as a set of formally described
tables from which data can be accessed or reassembled.

9. The association role defines:

a) How tables are related in the database

b) The relationship between the class diagram and the tables in the database

c) The tables that each attribute is contained

d) Which attribute is the table’s primary key

Answer: a

Explanation: The tables are always related in the database to form consistency .

10. The purpose of an N-Ary association is:

a) To capture a parent-child relationship

b) To deal with one to many relationships

c) To deal with relationships that involve more than two tables

d) To represent an inheritance relationship


Answer: c

Explanation: The is binary n-array association meaning more than two classes are involved in the
relationship.

You might also like