Modern Database Management 11th Edition Hoffer Test Bank
Modern Database Management 11th Edition Hoffer Test Bank
1) A join operation:
A) brings together data from two different fields.
B) causes two tables with a common domain to be combined into a single table or view.
C) causes two disparate tables to be combined into a single table or view.
D) is used to combine indexing operations.
Answer: B
Diff: 1 Page Ref: 290
Topic: Processing Multiple Tables
AACSB: Use of Information Technology
2) A join in which the joining condition is based on equality between values in the common
columns is called a(n):
A) equi-join.
B) unilateral join.
C) natural join.
D) both A and C.
Answer: D
Diff: 1 Page Ref: 291, 292
Topic: Processing Multiple Tables
AACSB: Use of Information Technology
Subtopic: Equi-join
3) A join that is based upon equality between values in two common columns with the same
name and where one duplicate column has been removed is called a(n):
A) equi-join.
B) natural join.
C) multivariate join.
D) inner join.
Answer: B
Diff: 1 Page Ref: 292, 293
Topic: Processing Multiple Tables
AACSB: Use of Information Technology
Subtopic: Natural Join
6) The outer join syntax does not apply easily to a join condition of more than ________ tables.
A) two
B) three
C) four
D) five
Answer: A
Diff: 2 Page Ref: 294
Topic: Processing Multiple Tables
AACSB: Use of Information Technology
Subtopic: Outer Join
7) In which of the following situations would one have to use an outer join in order to obtain the
desired results?
A) A report is desired that lists all customers who placed an order.
B) A report is desired that lists all customers and the total of their orders.
C) A report is desired that lists all customers and the total of their orders during the most recent
month, and includes customers who did not place an order during the month (their total will be
zero).
D) There is never a situation that requires only an outer join.
Answer: C
Diff: 3 Page Ref: 293, 294
Topic: Processing Multiple Tables
AACSB: Analytic Skills, Use of Information Technology
Subtopic: Outer Join
11) A type of query that is placed within a WHERE or HAVING clause of another query is
called a:
A) master query.
B) subquery.
C) superquery.
D) multi-query.
Answer: B
Diff: 1 Page Ref: 298
Topic: Processing Multiple Tables
AACSB: Use of Information Technology
Subtopic: Subqueries
12) SQL provides the ________ technique, which involves placing an inner query within the
WHERE or HAVING clause of an outer query.
A) grouping
B) joining
C) subquery
D) union
Answer: C
Diff: 2 Page Ref: 298, 299
Topic: Processing Multiple Tables
AACSB: Use of Information Technology
Subtopic: Subqueries
3
Copyright © 2013 Pearson Education, Inc. Publishing as Prentice Hall
13) ________ takes a value of true if a subquery returns an intermediate results table which
contains one or more rows.
A) IN
B) HAVING
C) EXISTS
D) EXTENTS
Answer: C
Diff: 2 Page Ref: 301, 302
Topic: Processing Multiple Tables
AACSB: Use of Information Technology
Subtopic: Subqueries
14) EXISTS will take a value of ________ if the subquery returns an intermediate results table
which contains one or more rows.
A) FALSE
B) 1
C) TRUE
D) undefined
Answer: C
Diff: 1 Page Ref: 302
Topic: Processing Multiple Tables
AACSB: Use of Information Technology
Subtopic: Subqueries
15) In SQL, a(n) ________ subquery is a type of subquery in which processing the inner query
depends on data from the outer query.
A) correlated
B) paired
C) natural
D) inner
Answer: A
Diff: 2 Page Ref: 303
Topic: Processing Multiple Tables
AACSB: Use of Information Technology
Subtopic: Correlated Subqueries
16) ________ use the result of the outer query to determine the processing of the inner query.
A) Correlated subqueries
B) Outer subqueries
C) Inner subqueries
D) Subqueries
Answer: A
Diff: 2 Page Ref: 303
Topic: Processing Multiple Tables
AACSB: Use of Information Technology
Subtopic: Subqueries
4
Copyright © 2013 Pearson Education, Inc. Publishing as Prentice Hall
17) The ________ clause is used to combine the output from multiple queries into a single result
table.
A) INTERSECT
B) DIVIDE
C) COLLATE
D) UNION
Answer: D
Diff: 1 Page Ref: 306
Topic: Processing Multiple Tables
AACSB: Use of Information Technology
Subtopic: Combining Queries
18) A ________ is a temporary table used in the FROM clause of an SQL query.
A) correlated subquery
B) derived table
C) view table
D) none of the above
Answer: B
Diff: 2 Page Ref: 305, 306
Topic: Processing Multiple Tables
AACSB: Use of Information Technology
Subtopic: Using Derived Tables
5
Copyright © 2013 Pearson Education, Inc. Publishing as Prentice Hall
21) Establishing IF-THEN-ELSE logical processing within an SQL statement can be
accomplished by:
A) using the if-then-else construct.
B) using the immediate if statement.
C) using the CASE keyword in a statement.
D) using a subquery.
Answer: C
Diff: 2 Page Ref: 308
Topic: Processing Multiple Tables
AACSB: Use of Information Technology
Subtopic: Conditional Expressions
22) All of the following are guidelines for better query design EXCEPT:
A) understand how indexes are used in query processing.
B) use a lot of self-joins.
C) write simple queries.
D) retrieve on the data that you need.
Answer: B
Diff: 2 Page Ref: 312, 313
Topic: Tips for Developing Queries
AACSB: Analytic Skills
Subtopic: Guidelines for Better Query Design
6
Copyright © 2013 Pearson Education, Inc. Publishing as Prentice Hall
25) An interactive command that can be used to dynamically control a user session for
appropriate integrity measures is:
A) rollback.
B) rollforward.
C) set autocommit.
D) expunge.
Answer: C
Diff: 2 Page Ref: 315
Topic: Ensuring Transaction Integrity
AACSB: Analytic Skills, Use of Information Technology
26) The ________ DBA view shows information about all users of the database in Oracle.
A) DBA_USERS
B) USERS
C) DBA_VIEWS
D) DBA_INDEXES
Answer: A
Diff: 1 Page Ref: 316
Topic: Data Dictionary Facilities
AACSB: Use of Information Technology
27) If the DBA wishes to describe all tables in the database, which data dictionary view should
be accessed in Oracle?
A) dba_tab_privs
B) dba_tab_comments
C) dba_table_label
D) dba_tables
Answer: D
Diff: 2 Page Ref: 316
Topic: Data Dictionary Facilities
AACSB: Analytic Skills, Use of Information Technology
7
Copyright © 2013 Pearson Education, Inc. Publishing as Prentice Hall
29) User-defined data types:
A) can be a subclass of a standard type.
B) can behave as an object.
C) can have defined functions and methods.
D) can have all of the above.
Answer: D
Diff: 2 Page Ref: 317
Topic: SQL: 2008 Enhancements and Extensions to SQL
AACSB: Use of Information Technology
32) All of the following are new data types added in SQL:2008 EXCEPT:
A) BIGINT.
B) BIT.
C) MULTISET.
D) XML.
Answer: B
Diff: 2 Page Ref: 319
Topic: SQL: 2008 Enhancements and Extensions to SQL
AACSB: Analytic Skills, Use of Information Technology
Subtopic: New Data Types
8
Copyright © 2013 Pearson Education, Inc. Publishing as Prentice Hall
33) ________ differs from array because it can contain duplicates.
A) BIGINT
B) XML
C) MULTISET
D) TABLE
Answer: C
Diff: 2 Page Ref: 319
Topic: SQL: 2008 Enhancements and Extensions to SQL
AACSB: Analytic Skills
Subtopic: New Data Types
35) Extensions defined in SQL-99 that include the capability to create and drop modules of code
stored in the database schema across user sessions are called:
A) stored procedures.
B) Persistent Stored Modules.
C) flow control modules.
D) none of the above.
Answer: B
Diff: 2 Page Ref: 320
Topic: SQL: 2008 Enhancements and Extensions to SQL
AACSB: Use of Information Technology
Subtopic: Programming Extensions
36) A named set of SQL statements that are considered when a data modification occurs are
called:
A) stored procedures.
B) treatments.
C) triggers.
D) trapdoors.
Answer: C
Diff: 1 Page Ref: 321
Topic: Triggers and Routines
AACSB: Use of Information Technology
9
Copyright © 2013 Pearson Education, Inc. Publishing as Prentice Hall
37) All of the following are part of the coding structure for triggers EXCEPT:
A) event.
B) condition.
C) selection.
D) action.
Answer: C
Diff: 1 Page Ref: 323
Topic: Triggers and Routines
AACSB: Use of Information Technology
Subtopic: Triggers
38) While triggers run automatically, ________ do not and have to be called.
A) trapdoors
B) routines
C) selects
D) updates
Answer: B
Diff: 2 Page Ref: 324
Topic: Triggers and Routines
AACSB: Use of Information Technology
Subtopic: Routines
10
Copyright © 2013 Pearson Education, Inc. Publishing as Prentice Hall
41) A procedure is:
A) stored within the database.
B) given a unique name.
C) called by name.
D) all of the above.
Answer: D
Diff: 2 Page Ref: 324
Topic: Triggers and Routines
AACSB: Use of Information Technology
Subtopic: Routines
43) In order to embed SQL inside of another language, the ________ statement must be placed
before the SQL in the host language.
A) GET SQL
B) EXEC SQL
C) RUN SQL
D) SQL SQL
Answer: B
Diff: 2 Page Ref: 328
Topic: Embedded SQL and Dynamic SQL
AACSB: Analytic Skills, Use of Information Technology
11
Copyright © 2013 Pearson Education, Inc. Publishing as Prentice Hall
45) An equi-join is a join in which one of the duplicate columns is eliminated in the result table.
Answer: FALSE
Diff: 2 Page Ref: 291
Topic: Processing Multiple Tables
AACSB: Use of Information Technology
Subtopic: Equi-join
46) A join in which the joining condition is based on equality between values in the common
column is called a(n) equi-join.
Answer: TRUE
Diff: 1 Page Ref: 291
Topic: Processing Multiple Tables
AACSB: Use of Information Technology
Subtopic: Equi-join
48) A natural join is the same as an equi-join, except that it is performed over matching columns
that have been defined with the same name, and one of the duplicate columns is eliminated.
Answer: TRUE
Diff: 1 Page Ref: 292
Topic: Processing Multiple Tables
AACSB: Use of Information Technology
Subtopic: Natural Join
50) An SQL query that implements an outer join will return rows that do not have matching
values in common columns.
Answer: TRUE
Diff: 1 Page Ref: 293
Topic: Processing Multiple Tables
AACSB: Use of Information Technology
Subtopic: Outer Join
12
Copyright © 2013 Pearson Education, Inc. Publishing as Prentice Hall
51) Using an outer join produces this information: rows that do not have matching values in
common columns are not included in the result table.
Answer: FALSE
Diff: 1 Page Ref: 293
Topic: Processing Multiple Tables
AACSB: Use of Information Technology
Subtopic: Outer Join
52) One major disadvantage of the outer join is that information is easily lost.
Answer: FALSE
Diff: 3 Page Ref: 295
Topic: Processing Multiple Tables
AACSB: Use of Information Technology
Subtopic: Outer Join
54) Joining tables or using a subquery may produce the same result.
Answer: TRUE
Diff: 2 Page Ref: 299
Topic: Processing Multiple Tables
AACSB: Use of Information Technology
Subtopic: Subqueries
13
Copyright © 2013 Pearson Education, Inc. Publishing as Prentice Hall
55) The following queries produce the same results.
Answer: TRUE
Diff: 2 Page Ref: 299
Topic: Processing Multiple Tables
AACSB: Analytic Skills, Use of Information Technology
Subtopic: Subqueries
Answer: FALSE
Diff: 2 Page Ref: 298
Topic: Processing Multiple Tables
AACSB: Analytic Skills, Use of Information Technology
Subtopic: Subqueries
57) In order to find out what customers have not placed an order for a particular item, one might
use the NOT qualifier along with the IN qualifier.
Answer: TRUE
Diff: 2 Page Ref: 301
Topic: Processing Multiple Tables
AACSB: Analytic Skills, Use of Information Technology
Subtopic: Subqueries
14
Copyright © 2013 Pearson Education, Inc. Publishing as Prentice Hall
58) EXISTS takes a value of false if the subquery returns an intermediate result set.
Answer: FALSE
Diff: 2 Page Ref: 302
Topic: Processing Multiple Tables
AACSB: Analytic Skills, Use of Information Technology
Subtopic: Subqueries
59) When EXISTS or NOT EXISTS is used in a subquery, the select list of the subquery will
usually just select all columns as a placeholder because it doesn't matter which columns are
returned.
Answer: TRUE
Diff: 1 Page Ref: 303
Topic: Processing Multiple Tables
AACSB: Analytic Skills, Use of Information Technology
Subtopic: Subqueries
60) A subquery in which processing the inner query depends on data from the outer query is
called a codependent query.
Answer: FALSE
Diff: 2 Page Ref: 303
Topic: Processing Multiple Tables
AACSB: Use of Information Technology
Subtopic: Subqueries
Answer: TRUE
Diff: 3 Page Ref: 303
Topic: Processing Multiple Tables
AACSB: Analytic Skills, Use of Information Technology
Subtopic: Subqueries
62) A correlated subquery is executed once for each iteration through the outer loop.
Answer: TRUE
Diff: 2 Page Ref: 303
Topic: Processing Multiple Tables
AACSB: Use of Information Technology
Subtopic: Correlated Subqueries
15
Copyright © 2013 Pearson Education, Inc. Publishing as Prentice Hall
63) Subqueries can only be used in the WHERE clause.
Answer: FALSE
Diff: 1 Page Ref: 305
Topic: Processing Multiple Tables
AACSB: Use of Information Technology
Subtopic: Using Derived Tables
64) The UNION clause is used to combine the output from multiple queries into a single result
table.
Answer: TRUE
Diff: 1 Page Ref: 307
Topic: Processing Multiple Tables
AACSB: Use of Information Technology
Subtopic: Combining Queries
66) Figuring out what attributes you want in your query before you write the query will help with
query writing.
Answer: TRUE
Diff: 1 Page Ref: 311
Topic: Tips for Developing Queries
AACSB: Use of Information Technology
67) It is better not to have a result set identified before writing GROUP BY and HAVING
clauses for a query.
Answer: FALSE
Diff: 1 Page Ref: 311
Topic: Tips for Developing Queries
AACSB: Use of Information Technology
68) Specifying the attribute names in the SELECT statement will make it easier to find errors in
queries and also correct for problems that may occur in the base system.
Answer: FALSE
Diff: 1 Page Ref: 312
Topic: Tips for Developing Queries
AACSB: Analytic Skills
16
Copyright © 2013 Pearson Education, Inc. Publishing as Prentice Hall
69) Correlated subqueries are less efficient than queries that do not use nesting.
Answer: TRUE
Diff: 1 Page Ref: 313
Topic: Tips for Developing Queries
AACSB: Analytic Skills
Subtopic: Guidelines for Better Query Design
71) A transaction is the complete set of closely related update commands that must all be done,
or none of them done, for the database to remain valid.
Answer: TRUE
Diff: 2 Page Ref: 314
Topic: Ensuring Transaction Integrity
AACSB: Use of Information Technology
72) Transaction integrity commands are not used to identify whole units of database changes that
must be completed in full for the database to retain integrity.
Answer: FALSE
Diff: 3 Page Ref: 315
Topic: Ensuring Transaction Integrity
AACSB: Analytic Skills, Use of Information Technology
73) RDBMSs store database definition information in system-created tables which can be
considered a data dictionary.
Answer: TRUE
Diff: 1 Page Ref: 315
Topic: Data Dictionary Facilities
AACSB: Use of Information Technology
17
Copyright © 2013 Pearson Education, Inc. Publishing as Prentice Hall
75) SQL:2008 allows one to calculate linear regressions, moving averages and correlations
without moving the data outside of the database.
Answer: TRUE
Diff: 1 Page Ref: 317
Topic: SQL: 2008 Enhancements and Extensions to SQL
AACSB: Analytic Skills, Use of Information Technology
Subtopic: Analytical Functions
77) Persistent Stored Modules are extensions defined in SQL:1999 that include the capability to
add and drop modules of code.
Answer: TRUE
Diff: 1 Page Ref: 320
Topic: SQL: 2008 Enhancements and Extensions to SQL
AACSB: Use of Information Technology
Subtopic: Programming Extensions
78) A routine is a named set of SQL statements that are considered when a data modification
occurs.
Answer: FALSE
Diff: 1 Page Ref: 321
Topic: Triggers and Routines
AACSB: Use of Information Technology
80) Triggers can be used to ensure referential integrity, enforce business rules, create audit trails
and replicate tables, but cannot call other triggers.
Answer: FALSE
Diff: 2 Page Ref: 322
Topic: Triggers and Routines
AACSB: Use of Information Technology
Subtopic: Triggers
18
Copyright © 2013 Pearson Education, Inc. Publishing as Prentice Hall
81) Triggers have three parts: the event, the condition, and the action.
Answer: TRUE
Diff: 1 Page Ref: 323
Topic: Triggers and Routines
AACSB: Use of Information Technology
Subtopic: Triggers
82) A function has only input parameters but can return multiple values.
Answer: FALSE
Diff: 1 Page Ref: 324
Topic: Triggers and Routines
AACSB: Use of Information Technology
Subtopic: Routines
83) The advantages of SQL-invoked routines are flexibility, efficiency, shareability and
applicability.
Answer: TRUE
Diff: 1 Page Ref: 324
Topic: Triggers and Routines
AACSB: Analytic Skills, Use of Information Technology
Subtopic: Routines
86) When a subquery is used in the FROM clause, it is called a denied table.
Answer: FALSE
Diff: 1 Page Ref: 305
Topic: Processing Multiple Tables
AACSB: Use of Information Technology
Subtopic: Using Derived Tables
19
Copyright © 2013 Pearson Education, Inc. Publishing as Prentice Hall
87) Establishing IF-THEN-ELSE logical processing within an SQL statement can now be
accomplished by using the CASE keyword in a statement.
Answer: TRUE
Diff: 1 Page Ref: 308
Topic: Processing Multiple Tables
AACSB: Use of Information Technology
Subtopic: Conditional Expressions
88) User-defined functions can improve system performance because they will be processed as
sets rather than individually, thus reducing system overhead.
Answer: FALSE
Diff: 2 Page Ref: 315
Topic: Ensuring Transaction Integrity
AACSB: Use of Information Technology
89) Persistent Sorted Modules are extensions defined in SQL-99 that include the capability to
create and drop modules of code stored in the database schema across user sessions.
Answer: FALSE
Diff: 1 Page Ref: 320
Topic: SQL: 2008 Enhancements and Extensions to SQL
AACSB: Use of Information Technology
Subtopic: Programming Extensions
90) A trigger is a named set of SQL statements that are considered when a data modification
occurs.
Answer: TRUE
Diff: 1 Page Ref: 321
Topic: Triggers and Routines
AACSB: Use of Information Technology
Subtopic: Triggers
91) Discuss the differences between an equi-join, natural join and outer join.
Answer: Both a natural join and an equi-join create a join based upon equality between some
common columns. While the equi-join keeps the redundant columns that are used for the match,
the natural join removes duplicates. There are situations where one table may contain
information that is not in the other table. However, it is necessary to display both matching data
as well as records which do not have a match in the second table. This situation is where we
would use an outer join.
Diff: 2 Page Ref: 291-295
Topic: Processing Multiple Tables
AACSB: Analytic Skills
20
Copyright © 2013 Pearson Education, Inc. Publishing as Prentice Hall
92) What is a self-join and how is it used?
Answer: A self-join is a join of one table to itself. This is often used for unary relationships
where you have a recursive foreign key. One possible use for this would be to produce a list of
who is supervised by another staff member. Self-joins can be slow, so they should be used with
caution.
Diff: 2 Page Ref: 297
Topic: Physical Database Design Process
AACSB: Analytic Skills
Subtopic: Self Join
94) What is a derived table? When is it used? Can you describe any situations where you would
have to use it over a subquery in the WHERE clause?
Answer: A derived table can be created by placing a subquery within the FROM clause. The
derived table is simply a temporary table in memory which can be accessed just like a table or
view. Sometimes, these are referred to as inline views. A derived table is useful for situations
where you need to create aggregate values (such as a sum) and then use these in another query. A
derived table would be used instead of a subquery in cases where you need to display results
from multiple tables. If the results need to come from a subselect, this is not possible, so we
would have to use a derived table.
Diff: 2 Page Ref: 305-306
Topic: Processing Multiple Tables
AACSB: Analytic Skills, Reflective Thinking
Subtopic: Using Derived Tables
21
Copyright © 2013 Pearson Education, Inc. Publishing as Prentice Hall
96) What are some tips for developing queries?
Answer: Some suggestions to help the query writing process include: gaining familiarity with
the data model, entity and attributes that you are querying. It is also very important to think about
the results that you wish to obtain from the query. Related to this, figure out what attributes you
want the query to return. Once this is done, figure out which tables contain the attributes and
include these in the FROM clause. By reviewing the ERD, you can determine which columns in
each table will be used to establish relationships and establish a link in the WHERE clause. Once
everything works fine, then you can look at the use of GROUP BY and HAVING.
Diff: 2 Page Ref: 310, 311
Topic: Tips for Developing Queries
AACSB: Analytic Skills, Use of Information Technology
97) What strategies can be used to write queries that run more efficiently?
Answer: It makes sense to specify the attribute names rather than just * in the SELECT clause.
If you are writing a query for a wide table, specifying only the attributes that are needed is going
to save a great deal of processing time. Also, changes in the base table post-production could
affect query results. Specifying the attribute names will make it easier to notice and correct for
such errors.
Use subqueries sparingly, since these increase processing time.
If you have several separate reports which need data from one table, write one query to retrieve
all of the data and use what you need in each report.
Diff: 2 Page Ref: 312
Topic: Tips for Developing Queries
AACSB: Analytic Skills, Reflective Thinking
22
Copyright © 2013 Pearson Education, Inc. Publishing as Prentice Hall
100) What is the difference between a trigger and a routine?
Answer: A trigger, once written and compiled, sits silently on the database server waiting for an
event to happen. It is usually tied to one table and some action, such as insert, update or delete.
Conversely, a routine has to be called even though it resides on the database server. It may
access one, many or no tables in order to produce the desired results.
Diff: 2 Page Ref: 321-322
Topic: Transforming EER Diagrams into Relations
AACSB: Use of Information Technology
23
Copyright © 2013 Pearson Education, Inc. Publishing as Prentice Hall