Chapter 08 Advanced SQL
Chapter 08 Advanced SQL
True / False
2. An inequality condition is also known as a natural join and an equality condition is also called a theta join.
a. True
b. False
ANSWER: False
POINTS: 1
DIFFICULTY: Difficulty: Easy
REFERENCES: p. 341
LEARNING OBJECTIVES: DATA.CORO.15.LO8-1 - LO8-1
NATIONAL STANDARDS: United States - BUSPROG: Analytic
TOPICS: SQL Join Operators
KEYWORDS: Bloom's: Knowledge
4. The SELECT statement uses the attribute list to indicate what columns to project in the result set
a. True
b. False
ANSWER: True
POINTS: 1
DIFFICULTY: Difficulty: Easy
Copyright Cengage Learning. Powered by Cognero. Page 1
Chapter 08: Advanced SQL
REFERENCES: p. 356
LEARNING OBJECTIVES DATA.CORO.15.LO8-7 - LO8-7
:
NATIONAL STANDARDS United States - BUSPROG: Analytic - BUSPROG: Analytic skills: Statistics and Management
: Science
TOPICS: SQL Join Operators
KEYWORDS: Bloom's: Knowledge
5. Numeric functions take one numeric parameter and return one value.
a. True
b. False
ANSWER: True
POINTS: 1
DIFFICULTY: Difficulty: Easy
REFERENCES: p. 366
LEARNING OBJECTIVES DATA.CORO.15.LO8-7 - LO8-7
:
NATIONAL STANDARDS United States - BUSPROG: Analytic - BUSPROG: Analytic skills: Statistics and Management
: Science
TOPICS: SQL Functions
KEYWORDS: Bloom's: Knowledge
7. UNION, INTERSECT, and MINUS work properly only if relations are intersect-compatible, which means that the
names of the relation attributes and their data types must be different.
a. True
b. False
ANSWER: False
POINTS: 1
DIFFICULTY: Difficulty: Easy
REFERENCES: p. 371
LEARNING OBJECTIVES: DATA.CORO.15.LO8-4 - LO8-4
NATIONAL STANDARDS: United States - BUSPROG: Analytic
TOPICS: Relational set Operators
Copyright Cengage Learning. Powered by Cognero. Page 2
Chapter 08: Advanced SQL
9. A sequence is not associated with a table and can be dropped from a database with a DROP SEQUENCE command.
a. True
b. False
ANSWER: True
POINTS: 1
DIFFICULTY: Difficulty: Easy
REFERENCES: p. 386-387
LEARNING OBJECTIVES: DATA.CORO.15.LO8-6 - LO8-6
NATIONAL STANDARDS: United States - BUSPROG: Analytic
TOPICS: Sequences
KEYWORDS: Bloom's: Knowledge
10. SQL supports the conditional execution of procedures (IF-THEN-ELSE statements) that are typically supported by a
programming language.
a. True
b. False
ANSWER: False
POINTS: 1
DIFFICULTY: Difficulty: Easy
REFERENCES: p. 387
LEARNING OBJECTIVES: DATA.CORO.15.LO8-7 - LO8-7
NATIONAL STANDARDS: United States - BUSPROG: - Analytic
TOPICS: Procedural SQL
KEYWORDS: Bloom's: Knowledge
11. To remedy the lack of procedural functionality in SQL, and to provide some standardization within the many vendor
offerings, the SQL-99 standard defined the use of persistent stored modules.
a. True
b. False
Copyright Cengage Learning. Powered by Cognero. Page 3
Chapter 08: Advanced SQL
ANSWER: True
POINTS: 1
DIFFICULTY: Difficulty: Easy
REFERENCES: p. 388
LEARNING OBJECTIVES: DATA.CORO.15.LO8-7 - LO8-7
NATIONAL STANDARDS: United States - BUSPROG: - Analytic
TOPICS: Procedural SQL
KEYWORDS: Bloom's: Knowledge
12. A persistent stored module is stored and executed on the database client machine.
a. True
b. False
ANSWER: False
POINTS: 1
DIFFICULTY: Difficulty: Easy
REFERENCES: p. 388
LEARNING OBJECTIVES: DATA.CORO.15.LO8-7 - LO8-7
NATIONAL STANDARDS: United States - BUSPROG: Analytic
TOPICS: Procedural SQL
KEYWORDS: Bloom's: Knowledge
14. In Oracle, you can use the SQL*Plus command SHOW ERRORS to help you diagnose errors found in PL/SQL
blocks.
a. True
b. False
ANSWER: True
POINTS: 1
DIFFICULTY: Difficulty: Moderate
REFERENCES: p. 390
LEARNING OBJECTIVES: DATA.CORO.15.LO8-7 - LO8-7
NATIONAL STANDARDS: United States - BUSPROG: - Analytic
TOPICS: Procedural SQL
16. The most useful feature of PL/SQL blocks is that they let a designer create code that can be named, stored, and
executed by the DBMS.
a. True
b. False
ANSWER: True
POINTS: 1
DIFFICULTY: Difficulty: Easy
REFERENCES: p. 391
LEARNING OBJECTIVES: DATA.CORO.15.LO8-7 - LO8-7
NATIONAL STANDARDS: United States - BUSPROG: - Analytic
TOPICS: Procedural SQL
KEYWORDS: Bloom's: Knowledge
17. Automating business procedures and automatically maintaining data integrity and consistency are trivial in a modern
business environment.
a. True
b. False
ANSWER: False
POINTS: 1
DIFFICULTY: Difficulty: Easy
REFERENCES: p. 392
LEARNING OBJECTIVES: DATA.CORO.15.LO8-7 - LO8-7
NATIONAL STANDARDS: United States - BUSPROG: - Analytic
TOPICS: Procedural SQL
KEYWORDS: Bloom's: Knowledge
18. A trigger is procedural SQL code that is automatically invoked by the RDBMS upon the occurrence of a given data
manipulation event.
a. True
b. False
ANSWER: True
Copyright Cengage Learning. Powered by Cognero. Page 5
Chapter 08: Advanced SQL
POINTS: 1
DIFFICULTY: Difficulty: Easy
REFERENCES: p. 393
LEARNING OBJECTIVES: DATA.CORO.15.LO8-7 - LO8-7
NATIONAL STANDARDS: United States - BUSPROG: Analytic
TOPICS: Procedural SQL
KEYWORDS: Bloom's: Knowledge
20. A statement-level trigger is assumed if a designer omits the FOR EACH ROW keywords.
a. True
b. False
ANSWER: True
POINTS: 1
DIFFICULTY: Difficulty: Easy
REFERENCES: p. 394
LEARNING OBJECTIVES: DATA.CORO.15.LO8-7 - LO8-7
NATIONAL STANDARDS: United States - BUSPROG: Analytic
TOPICS: Procedural SQL
KEYWORDS: Bloom's: Knowledge
21. A row-level trigger is assumed if we omit the FOR EACH ROW keywords and a statement-level trigger required the
use of the FOR EACH ROW keyword.
a. True
b. False
ANSWER: False
POINTS: 1
DIFFICULTY: Difficulty: Easy
REFERENCES: p. 394
LEARNING OBJECTIVES DATA.CORO.15.LO8-7 - LO8-7
:
NATIONAL STANDARDS United States - BUSPROG: Analytic - BUSPROG: Analytic skills: Statistics and Management
: Science
TOPICS: Procedural SQL
Copyright Cengage Learning. Powered by Cognero. Page 6
Chapter 08: Advanced SQL
23. BEFORE means before the changes are made in memory but after the changes are permanently saved to disk.
a. True
b. False
ANSWER: False
POINTS: 1
DIFFICULTY: Difficulty: Easy
REFERENCES: p. 398
LEARNING OBJECTIVES DATA.CORO.15.LO8-7 - LO8-7
:
NATIONAL STANDARDS United States - BUSPROG: Analytic - BUSPROG: Analytic skills: Statistics and Management
: Science
TOPICS: Procedural SQL
KEYWORDS: Bloom's: Knowledge
24. Just like database triggers, stored procedures are stored in the database.
a. True
b. False
ANSWER: True
POINTS: 1
DIFFICULTY: Difficulty: Easy
REFERENCES: p. 401
LEARNING OBJECTIVES: DATA.CORO.15.LO8-7 - LO8-7
NATIONAL STANDARDS: United States - BUSPROG: Analytic
TOPICS: Procedural SQL
KEYWORDS: Bloom's: Knowledge
25. One of the major advantages of stored procedures is that they can be used to encapsulate and represent business
transactions.
a. True
b. False
ANSWER: True
POINTS: 1
DIFFICULTY: Difficulty: Easy
REFERENCES: p. 401
LEARNING OBJECTIVES: DATA.CORO.15.LO8-7 - LO8-7
NATIONAL STANDARDS: United States - BUSPROG: Analytic
TOPICS: Procedural SQL
KEYWORDS: Bloom's: Knowledge
28. Cursors are held in a reserved memory area in the client computer.
a. True
b. False
ANSWER: False
POINTS: 1
DIFFICULTY: Difficulty: Easy
REFERENCES: p. 407
LEARNING OBJECTIVES: DATA.CORO.15.LO8-7 - LO8-7
29. An implicit cursor is automatically created in procedural SQL when the SQL statement returns only one value
a. True
b. False
ANSWER: True
POINTS: 1
DIFFICULTY: Difficulty: Easy
REFERENCES: p. 407
LEARNING OBJECTIVES: DATA.CORO.15.LO8-7 - LO8-7
NATIONAL STANDARDS: United States - BUSPROG: - Analytic
TOPICS: Procedural SQL
KEYWORDS: Bloom's: Knowledge
32. "Linked SQL" is a term used to refer to SQL statements that are contained within an application programming
language such as COBOL, C++, ASP, Java, or ColdFusion.
a. True
b. False
ANSWER: False
Copyright Cengage Learning. Powered by Cognero. Page 9
Chapter 08: Advanced SQL
POINTS: 1
DIFFICULTY: Difficulty: Easy
REFERENCES: p. 410
LEARNING OBJECTIVES: DATA.CORO.15.LO8-7 - LO8-7
NATIONAL STANDARDS: United States - BUSPROG: - Analytic
TOPICS: Embedded SQL
KEYWORDS: Bloom's: Knowledge
Multiple Choice
34. When using a(n) _____ join, only rows that meet the given criteria are returned.
a. full b. inner
c. outer d. set
ANSWER: b
POINTS: 1
DIFFICULTY: Difficulty: Easy
REFERENCES: p. 341
LEARNING OBJECTIVES: DATA.CORO.15.LO8-1 - LO8-1
NATIONAL STANDARDS: United States - BUSPROG: Analytic
TOPICS: SQL Join Operators
KEYWORDS: Bloom's: Knowledge
35. The statement SELECT * FROM T1, T2 produces a(n) _____ join.
a. cross b. natural
c. equi- d. full
ANSWER: a
POINTS: 1
DIFFICULTY: Difficulty: Easy
REFERENCES: p. 342
Copyright Cengage Learning. Powered by Cognero. Page 10
Chapter 08: Advanced SQL
36. How many rows would be returned from a cross join of tables A and B, if A contains 8 rows and B contains 18?
a. 8 b. 18
c. 26 d. 144
ANSWER: d
POINTS: 1
DIFFICULTY: Difficulty: Moderate
REFERENCES: p. 342
LEARNING OBJECTIVES: DATA.CORO.15.LO8-1 - LO8-1
NATIONAL STANDARDS: United States - BUSPROG: Analytic
TOPICS: SQL Join Operators
KEYWORDS: Bloom's: Application
37. A(n) _____ join will select only the rows with matching values in the common attribute(s).
a. natural b. cross
c. full d. outer
ANSWER: a
POINTS: 1
DIFFICULTY: Difficulty: Easy
REFERENCES: p. 343
LEARNING OBJECTIVES: DATA.CORO.15.LO8-1 - LO8-1
NATIONAL STANDARDS: United States - BUSPROG: Analytic
TOPICS: SQL Operators
KEYWORDS: Bloom's: Knowledge
38. If a designer wishes to create an inner join, but the two tables do not have a commonly named attribute, he can use
a(n) _____ clause.
a. OF b. USING
c. HAS d. JOIN ON
ANSWER: d
POINTS: 1
DIFFICULTY: Difficulty: Moderate
REFERENCES: p. 345
LEARNING OBJECTIVES: DATA.CORO.15.LO8-1 - LO8-1
NATIONAL STANDARDS: United States - BUSPROG: Analytic
TOPICS: SQL Operators
KEYWORDS: Bloom's: Application
39. A(n) _____ join returns not only the rows matching the join condition (that is, rows with matching values in the
common columns) but also the rows with unmatched values.
a. outer b. inner
c. equi- d. cross
Copyright Cengage Learning. Powered by Cognero. Page 11
Chapter 08: Advanced SQL
ANSWER: a
POINTS: 1
DIFFICULTY: Difficulty: Moderate
REFERENCES: p. 347
LEARNING OBJECTIVES: DATA.CORO.15.LO8-1 - LO8-1
NATIONAL STANDARDS: United States - BUSPROG: Analytic
TOPICS: SQL Operators
KEYWORDS: Bloom's: Application
41. In subquery terminology, the first query in the SQL statement is known as the _____ query.
a. outer b. left
c. inner d. base
ANSWER: a
POINTS: 1
DIFFICULTY: Difficulty: Easy
REFERENCES: p. 350
LEARNING OBJECTIVES: DATA.CORO.15.LO8-2 - LO8-2
NATIONAL STANDARDS: United States - BUSPROG: Analytic
TOPICS: Subqueries and Correlated Queries
KEYWORDS: Bloom's: Knowledge
42. In the context of SELECT subquery types, a _____ is returned when an UPDATE subquery is used.
a. NULL b. single value
c. list of values d. virtual table
ANSWER: b
POINTS: 1
DIFFICULTY: Difficulty: Easy
REFERENCES: p. 351
LEARNING OBJECTIVESDATA.CORO.15.LO8-2 - LO8-2
Copyright Cengage Learning. Powered by Cognero. Page 12
Chapter 08: Advanced SQL
:
NATIONAL STANDARDS United States - BUSPROG: Analytic - BUSPROG: Analytic skills: Statistics and Management
: Science
TOPICS: Subqueries and Correlated Queries
KEYWORDS: Bloom's: Knowledge
44. The _____ function returns the current system date in MS Access.
a. TO_DATE() b. SYSDATE()
c. DATE() d. TODAY()
ANSWER: c
POINTS: 1
DIFFICULTY: Difficulty: Easy
REFERENCES: p. 362
LEARNING OBJECTIVES: DATA.CORO.15.LO8-3 - LO8-3
NATIONAL STANDARDS: United States - BUSPROG: - Analytic
TOPICS: SQL Functions
KEYWORDS: Bloom's: Knowledge
45. When using the Oracle TO_DATE function, the code _____ represents a three-letter month name.
a. MON b. MM3
c. MONTH d. MM
ANSWER: a
POINTS: 1
DIFFICULTY: Difficulty: Easy
REFERENCES: p. 363
LEARNING OBJECTIVES: DATA.CORO.15.LO8-3 - LO8-3
NATIONAL STANDARDS: United States - BUSPROG: - Analytic
TOPICS: SQL Functions
KEYWORDS: Bloom's: Knowledge
a. CONVERT() b. TO_DATE
c. TO_CHAR() d. TO_STRING()
ANSWER: c
POINTS: 1
DIFFICULTY: Difficulty: Easy
REFERENCES: p. 363
LEARNING OBJECTIVES: DATA.CORO.15.LO8-3 - LO8-3
NATIONAL STANDARDS: United States - BUSPROG: - Analytic
TOPICS: SQL Functions
KEYWORDS: Bloom's: Knowledge
47. _____ is a string function that returns the number of characters in a string value.
a. LENGTH b. SUBSTRING
c. CONCAT d. UCASE
ANSWER: a
POINTS: 1
DIFFICULTY: Difficulty: Easy
REFERENCES: p. 368
LEARNING OBJECTIVES: DATA.CORO.15.LO8-3 - LO8-3
NATIONAL STANDARDS: United States - BUSPROG: Analytic
TOPICS: SQL Functions
KEYWORDS: Bloom's: Knowledge
48. When using the Oracle TO_NUMBER function to convert a character string into a number, _____ represents a digit.
a. 0 b. 9
c. $ d. #
ANSWER: b
POINTS: 1
DIFFICULTY: Difficulty: Easy
REFERENCES: p. 369
LEARNING OBJECTIVES: DATA.CORO.15.LO8-3 - LO8-3
NATIONAL STANDARDS: United States - BUSPROG: - Analytic
TOPICS: SQL Functions
KEYWORDS: Bloom's: Knowledge
49. The Oracle _____ function compares an attribute or expression with a series of values and returns an associated value
or a default value if no match is found.
a. NVL b. TO_CHAR
c. DECODE d. CONVERT
ANSWER: c
POINTS: 1
DIFFICULTY: Difficulty: Easy
REFERENCES: p. 370
LEARNING OBJECTIVES: DATA.CORO.15.LO8-4 - LO8-4
53. The _____ statement combines rows from two queries and excludes duplicates.
a. UNION b. UNION ALL
c.
INTERSECT d. MINUS
ANSWER: a
POINTS: 1
DIFFICULTY: Difficulty: Easy
REFERENCES: p. 372
LEARNING OBJECTIVES DATA.CORO.15.LO8-4 - LO8-4
:
NATIONAL STANDARDS United States - BUSPROG: Analytic - BUSPROG: Analytic skills: Statistics and Management
: Science
TOPICS: Relational Set Operators
KEYWORDS: Bloom's: Application
54. Assume a designer is using the UNION operator to combine the results from two tables with identical structure,
CUSTOMER and CUSTOMER_2. The CUSTOMER table contains 10 rows, while the CUSTOMER_2 table contains 7
rows. Customers Jenna and Howard are included in the CUSTOMER table as well as in the CUSTOMER_2 table. How
many records are returned when using the UNION operator?
a. 7 b. 10
c. 15 d. 17
ANSWER: c
POINTS: 1
DIFFICULTY: Difficulty: Moderate
REFERENCES: p. 372
LEARNING OBJECTIVES: DATA.CORO.15.LO8-4 - LO8-4
NATIONAL STANDARDS: United States - BUSPROG: Analytic
TOPICS: Relational Set Operators
KEYWORDS: Bloom's: Application
55. Assume you are using the UNION ALL operator to combine the results from two tables with identical structure,
CUSTOMER and CUSTOMER_2. The CUSTOMER table contains 10 rows, while the CUSTOMER_2 table contains 7
rows. Customers Dunne and Olowski are included in the CUSTOMER table as well as in the CUSTOMER_2 table. How
many records are returned when using the UNION ALL operator?
a. 7 b. 10
c. 15 d. 17
ANSWER: d
POINTS: 1
DIFFICULTY: Difficulty: Moderate
REFERENCES: p. 373
LEARNING OBJECTIVES: DATA.CORO.15.LO8-4 - LO8-4
NATIONAL STANDARDS: United States - BUSPROG: Analytic
TOPICS: Relational Set Operators
KEYWORDS: Bloom's: Application
56. Assume you are using the INTERSECT operator to combine the results from two tables with identical structure,
CUSTOMER and CUSTOMER_2. The CUSTOMER table contains 10 rows, while the CUSTOMER_2 table contains 7
rows. Customers Dunne and Olowski are included in the CUSTOMER table as well as in the CUSTOMER_2 table. How
many records are returned when using the INTERSECT operator?
Copyright Cengage Learning. Powered by Cognero. Page 16
Chapter 08: Advanced SQL
a. 0 b. 2
c. 7 d. 10
ANSWER: b
POINTS: 1
DIFFICULTY: Difficulty: Moderate
REFERENCES: p. 374
LEARNING OBJECTIVES: DATA.CORO.15.LO8-4 - LO8-4
NATIONAL STANDARDS: United States - BUSPROG: Analytic
TOPICS: Relational Set Operators
KEYWORDS: Bloom's: Application
57. The _____ statement in SQL combines rows from two queries and returns only the rows that appear in the first set but
not in the second.
a. UNION b. UNION ALL
c. INTERSECT d. MINUS
ANSWER: d
POINTS: 1
DIFFICULTY: Difficulty: Easy
REFERENCES: p. 375
LEARNING OBJECTIVES: DATA.CORO.15.LO8-4 - LO8-4
NATIONAL STANDARDS: United States - BUSPROG: Analytic
TOPICS: Relational Set Operators
KEYWORDS: Bloom's: Application
58. Assume you are using the MINUS operator to combine the results from two tables with identical structure,
CUSTOMER and CUSTOMER_2. The CUSTOMER table contains 10 rows, while the CUSTOMER_2 table contains 7
rows. Customers Dunne and Olowski are included in the CUSTOMER table as well as in the CUSTOMER_2 table. How
many records are returned when using the MINUS operator?
a. 0 b. 2
c. 8 d. 10
ANSWER: c
POINTS: 1
DIFFICULTY: Difficulty: Moderate
REFERENCES: p. 375-376
LEARNING OBJECTIVES: DATA.CORO.15.LO8-4 - LO8-4
NATIONAL STANDARDS: United States - BUSPROG: Analytic
TOPICS: Relational Set Operators
KEYWORDS: Bloom's: Application
59. The _____ operator could be used in place of INTERSECT if the DBMS does not support it.
a. IN b. OF
c. AND d. UNION
ANSWER: a
POINTS: 1
DIFFICULTY: Difficulty: Easy
Copyright Cengage Learning. Powered by Cognero. Page 17
Chapter 08: Advanced SQL
REFERENCES: p. 377
LEARNING OBJECTIVES: DATA.CORO.15.LO8-4 - LO8-4
NATIONAL STANDARDS: United States - BUSPROG: - Analytic
TOPICS: Relational Set Operators
KEYWORDS: Bloom's: Knowledge
60. The _____ operator could be used in place of MINUS if the DBMS does not support it.
a. IN b. NOT IN
c. AND d. UNION
ANSWER: b
POINTS: 1
DIFFICULTY: Difficulty: Easy
REFERENCES: p. 377
LEARNING OBJECTIVES: DATA.CORO.15.LO8-4 - LO8-4
NATIONAL STANDARDS: United States - BUSPROG: - Analytic
TOPICS: Relational Set Operators
KEYWORDS: Bloom's: Knowledge
63. The _____ pseudo-column is used to select the next value from a sequence.
Copyright Cengage Learning. Powered by Cognero. Page 18
Chapter 08: Advanced SQL
a. CURRVAL b. NEXTVAL
c. NEXT d. GET_NEXT
ANSWER: b
POINTS: 1
DIFFICULTY: Difficulty: Easy
REFERENCES: p. 384
LEARNING OBJECTIVES: DATA.CORO.15.LO8-6 - LO8-6
NATIONAL STANDARDS: United States - BUSPROG: Analytic
TOPICS: Sequences
KEYWORDS: Bloom's: Application
64. In Oracle, _____ make(s) it possible to merge SQL and traditional programming constructs, such as variables,
conditional processing (IF-THEN-ELSE), basic loops (FOR and WHILE loops,) and error trapping.
a. cursor-style processing b. stored procedures
c. embedded SQL d. Procedural Language SQL
ANSWER: d
POINTS: 1
DIFFICULTY: Difficulty: Easy
REFERENCES: p. 388
LEARNING OBJECTIVES: DATA.CORO.15.LO8-7 - LO8-7
NATIONAL STANDARDS: United States - BUSPROG: - Analytic
TOPICS: Procedural SQL
KEYWORDS: Bloom's: Knowledge
68. _____ is a cursor attribute that returns TRUE if the last FETCH returned a row, and FALSE if not.
a. %ROWCOUNT b. %NOTFOUND
c. %FOUND d. %ISOPEN
ANSWER: c
POINTS: 1
DIFFICULTY: Difficulty: Easy
REFERENCES: p. 408
LEARNING OBJECTIVES: DATA.CORO.15.LO8-7 - LO8-7
NATIONAL STANDARDS: United States - BUSPROG: - Analytic
TOPICS: Procedural SQL
KEYWORDS: Bloom's: Knowledge
Completion
69. The _____ determines the common attribute or attributes by looking for identically named attributes and compatible
data types.
ANSWER: natural join
POINTS: 1
DIFFICULTY: Difficulty: Easy
REFERENCES: p. 343
LEARNING OBJECTIVES: DATA.CORO.15.LO8-1 - LO8-1
NATIONAL STANDARDS: United States - BUSPROG: Analytic
TOPICS: SQL Join Operators
KEYWORDS: Bloom's: Knowledge
70. An alternate syntax for a join is: SELECT column-list FROM table1 JOIN table2 _____ (common-column).
ANSWER: USING
POINTS: 1
DIFFICULTY: Difficulty: Easy
Copyright Cengage Learning. Powered by Cognero. Page 20
Chapter 08: Advanced SQL
REFERENCES: p. 344
LEARNING OBJECTIVES: DATA.CORO.15.LO8-1 - LO8-1
NATIONAL STANDARDS: United States - BUSPROG: Analytic
TOPICS: SQL Join Operators
KEYWORDS: Bloom's: Knowledge
71. When using a subquery, the output of a(n) _____ query is used as the input for the outer query.
ANSWER: inner
POINTS: 1
DIFFICULTY: Difficulty: Easy
REFERENCES: p. 350
LEARNING OBJECTIVES: DATA.CORO.15.LO8-2 - LO8-2
NATIONAL STANDARDS: United States - BUSPROG: Analytic
TOPICS: Subqueries and correlated Queries
KEYWORDS: Bloom's: Knowledge
72. The _____ clause is used to restrict the output of a GROUP BY query by applying a conditional criteria to the grouped
rows.
ANSWER: HAVING
POINTS: 1
DIFFICULTY: Difficulty: Easy
REFERENCES: p. 353
LEARNING OBJECTIVES: DATA.CORO.15.LO8-2 - LO8-2
NATIONAL STANDARDS: United States - BUSPROG: Analytic
TOPICS: Subqueries and Correlated Queries
KEYWORDS: Bloom's: Knowledge
74. The use of the _____ operator allows you to compare a single value with a list of values returned by the first subquery
(sqA) using a comparison operator other than EQUALS.
ANSWER: ALL
POINTS: 1
DIFFICULTY: Difficulty: Easy
REFERENCES: p. 355
LEARNING OBJECTIVES: DATA.CORO.15.LO8-2 - LO8-2
NATIONAL STANDARDS: United States - BUSPROG: Analytic
Copyright Cengage Learning. Powered by Cognero. Page 21
Chapter 08: Advanced SQL
75. The ___ statement uses the attribute list to indicate what columns to project in the resulting set.
ANSWER: SELECT
POINTS: 1
DIFFICULTY: Difficulty: Easy
REFERENCES: p. 356
LEARNING OBJECTIVES: DATA.CORO.15.LO8-2 - LO8-2
NATIONAL STANDARDS: United States - BUSPROG: Analytic
TOPICS: Subqueries and Correlated Queries
KEYWORDS: Bloom's: Knowledge
76. A(n) _____ subquery is a subquery that executes once for each row in the outer query.
ANSWER: correlated
POINTS: 1
DIFFICULTY: Difficulty: Easy
REFERENCES: p. 358
LEARNING OBJECTIVES: DATA.CORO.15.LO8-2 - LO8-2
NATIONAL STANDARDS: United States - BUSPROG: Analytic
TOPICS: Subqueries and Correlated Queries
KEYWORDS: Bloom's: Knowledge
77. Oracle uses the _____ function to extract the various parts of a date.
ANSWER: TO_CHAR
POINTS: 1
DIFFICULTY: Difficulty: Easy
REFERENCES: p. 363
LEARNING OBJECTIVES: DATA.CORO.15.LO8-3 - LO8-3
NATIONAL STANDARDS: United States - BUSPROG: - Analytic
TOPICS: SQL Functions
KEYWORDS: Bloom's: Knowledge
78. _____ functions extract a value of a given data type and convert it to the equivalent value in another data type.
ANSWER: Conversion
POINTS: 1
DIFFICULTY: Difficulty: Easy
REFERENCES: p. 368
LEARNING OBJECTIVES: DATA.CORO.15.LO8-3 - LO8-3
NATIONAL STANDARDS: United States - BUSPROG: Analytic
TOPICS: SQL Functions
KEYWORDS: Bloom's: Knowledge
POINTS: 1
DIFFICULTY: Difficulty: Easy
REFERENCES: p. 370
LEARNING OBJECTIVES: DATA.CORO.15.LO8-3 - LO8-3
NATIONAL STANDARDS: United States - BUSPROG: Analytic
TOPICS: SQL Functions
KEYWORDS: Bloom's: Knowledge
80. The _____ statement combines the output of two SELECT queries.
ANSWER: UNION
POINTS: 1
DIFFICULTY: Difficulty: Easy
REFERENCES: p. 372
LEARNING OBJECTIVES: DATA.CORO.15.LO8-4 - LO8-4
NATIONAL STANDARDS: United States - BUSPROG: Analytic
TOPICS: Relational Set Operators
KEYWORDS: Bloom's: Knowledge
81. A(n) _____ query can be used to produce a relation that retains the duplicate rows.
ANSWER: UNION ALL
POINTS: 1
DIFFICULTY: Difficulty: Easy
REFERENCES: p. 373
LEARNING OBJECTIVES: DATA.CORO.15.LO8-4 - LO8-4
NATIONAL STANDARDS: United States - BUSPROG: Analytic
TOPICS: Relational Set Operators
KEYWORDS: Bloom's: Knowledge
82. The _____ statement can be used to combine rows from two queries, returning only the rows that appear in both sets.
ANSWER: INTERSECT
POINTS: 1
DIFFICULTY: Difficulty: Easy
REFERENCES: p. 373
LEARNING OBJECTIVES: DATA.CORO.15.LO8-4 - LO8-4
NATIONAL STANDARDS: United States - BUSPROG: Analytic
TOPICS: Relational Set Operators
KEYWORDS: Bloom's: Knowledge
84. If the DBMS does not support the INTERSECT statement, one can use a(n) _____ subquery to achieve the same
result.
ANSWER: IN
POINTS: 1
DIFFICULTY: Difficulty: Easy
REFERENCES: p. 377
LEARNING OBJECTIVES: DATA.CORO.15.LO8-4 - LO8-4
NATIONAL STANDARDS: United States - BUSPROG: - Analytic
TOPICS: Relational Set Operators
KEYWORDS: Bloom's: Knowledge
85. A(n) _____ routine pools multiple transactions into a single batch to update a master table field in a single operation.
ANSWER: batch update
POINTS: 1
DIFFICULTY: Difficulty: Easy
REFERENCES: p. 379
LEARNING OBJECTIVES: DATA.CORO.15.LO8-5 - LO8-5
NATIONAL STANDARDS: United States - BUSPROG: Analytic
TOPICS: Relational Set Operators
KEYWORDS: Bloom's: Knowledge
86. A(n) _____ view is a view that can be used to update attributes in the base table(s) that are used in the view.
ANSWER: updatable
POINTS: 1
DIFFICULTY: Difficulty: Easy
REFERENCES: p. 380
LEARNING OBJECTIVES: DATA.CORO.15.LO8-5 - LO8-5
NATIONAL STANDARDS: United States - BUSPROG: Analytic
TOPICS: Relational Set Operators
KEYWORDS: Bloom's: Knowledge
87. In MS Access, a designer can use the _____ data type to define a column in his table that will be automatically
populated with unique numeric values.
ANSWER: AutoNumber
POINTS: 1
DIFFICULTY: Difficulty: Easy
REFERENCES: p. 382
LEARNING OBJECTIVES: DATA.CORO.15.LO8-6 - LO8-6
NATIONAL STANDARDS: United States - BUSPROG: - Analytic
TOPICS: Sequences
KEYWORDS: Bloom's: Knowledge
Copyright Cengage Learning. Powered by Cognero. Page 24
Chapter 08: Advanced SQL
88. In an Oracle sequence, the _____ pseudo-column retrieves the current value of a sequence.
ANSWER: CURRVAL
POINTS: 1
DIFFICULTY: Difficulty: Easy
REFERENCES: p. 384
LEARNING OBJECTIVES: DATA.CORO.15.LO8-6 - LO8-6
NATIONAL STANDARDS: United States - BUSPROG: - Analytic
TOPICS: Sequences
KEYWORDS: Bloom's: Knowledge
89. Using Oracle _____, a designer can write a PL/SQL code block by enclosing the commands inside BEGIN and END
clauses.
ANSWER: SQL*Plus
POINTS: 1
DIFFICULTY: Difficulty: Easy
REFERENCES: p. 389
LEARNING OBJECTIVES: DATA.CORO.15.LO8-7 - LO8-7
NATIONAL STANDARDS: United States - BUSPROG: - Analytic
TOPICS: Procedural SQL
KEYWORDS: Bloom's: Knowledge
90. A row-level trigger requires use of the _____ keywords and is executed once for each row affected by the triggering
statement.
ANSWER: FOR EACH ROW
POINTS: 1
DIFFICULTY: Difficulty: Easy
REFERENCES: p. 394
LEARNING OBJECTIVES: DATA.CORO.15.LO8-7 - LO8-7
NATIONAL STANDARDS: United States - BUSPROG: Analytic
TOPICS: Procedural SQL
KEYWORDS: Bloom's: Knowledge
91. _____ is the term used to describe an environment in which the SQL statement is not known in advance and is
generated at run time.
ANSWER: Dynamic SQL
POINTS: 1
DIFFICULTY: Difficulty: Easy
REFERENCES: p. 414
LEARNING OBJECTIVES: DATA.CORO.15.LO8-8 - LO8-8
NATIONAL STANDARDS: United States - BUSPROG: Analytic
TOPICS: Embedded SQL
KEYWORDS: Bloom's: Knowledge
Essay
93. What are the four different types of results that can be returned from a subquery?
ANSWER: A subquery can return one or more values.
The fourth result that a subquery can return is no value at all. It is called NULL.
POINTS: 1
DIFFICULTY: Difficulty: Easy
REFERENCES: p. 351
LEARNING OBJE DATA.CORO.15.LO8-2 - LO8-2
CTIVES:
NATIONAL STANDUnited States - BUSPROG: Analytic
ARDS:
TOPICS: Subqueries and Correlated Queries
KEYWORDS: Bloom's: Knowledge
ANSWER: SQL functions are very useful tools. Functions always use a numerical, date, or string value. The
value may be part of the command itself (a constant or literal) or it may be an attribute located in a
table. Therefore, a function may appear anywhere in a SQL statement where a value or an attribute
can be used. There are many types of SQL functions, such as arithmetic, trigonometric, string, date,
and time functions.
These functions are useful when all employees need to be ordered by year of birth, or when a
marketing department wants to generate a list of all customers ordered by zip code and the first three
digits of their telephone numbers. In both of these cases, data elements that are not present as such in
the database will be required; instead, an SQL function that can be derived from an existing attribute
is required.
POINTS: 1
DIFFICULTY: Difficulty: Moderate
REFERENCES: p. 361
LEARNING OBJE DATA.CORO.15.LO8-3 - LO8-3
CTIVES:
NATIONAL STANDUnited States - BUSPROG: Analytic
ARDS:
TOPICS: SQL Functions
KEYWORDS: Bloom's: Comprehension
96. How are triggers critical to proper database operation and management?
ANSWER: - Triggers can be used to enforce constraints that cannot be enforced at the DBMS design and
implementation levels.
- Triggers add functionality by automating critical actions and providing appropriate warnings and
suggestions for remedial action. In fact, one of the most common uses for triggers is to facilitate the
enforcement of referential integrity.
- Triggers can be used to update table values, insert records in tables, and call other stored procedures.
POINTS: 1
DIFFICULTY: Difficulty: Moderate
REFERENCES: p. 393
LEARNING OBJE DATA.CORO.15.LO8-7 - LO8-7
CTIVES:
NATIONAL STANDUnited States - BUSPROG: Analytic
ARDS:
TOPICS: Procedural SQL
KEYWORDS: Bloom's: Comprehension
97. Summarize the hierarchy of steps involved in creating and running an executable program with embedded SQL
statements.
ANSWER: While the steps required to create and execute a program consisting of embedded SQL statements
vary from one programming language to another, the following steps are considered as a general
standard.
a) The programmer writes embedded SQL code within the host language instructions. The code
follows the standard syntax required for host language and embedded SQL.
b) A preprocessor is used to transform the embedded SQL into specialized procedure calls that are
DBMS-specific and language-specific. The preprocessor is provided by the DBMS vendor and is
specific to the host language.
c) The program is compiled using the host language compiler. The compiler creates an object code
module for the program containing the DBMS procedure calls.
d) The object code is linked to the respective library modules and generates the executable program.
This process binds the DBMS procedure calls to the DBMS run-time libraries. Additionally, the
binding process typically creates an “access plan” module that contains instructions to run the
embedded code at run time.
e) The executable is run, and the embedded SQL statement retrieves data from the database.
POINTS: 1
DIFFICULTY: Difficulty: Moderate
REFERENCES: p. 411
LEARNING OBJE DATA.CORO.15.LO8-8 - LO8-8
CTIVES:
NATIONAL STANDUnited States - BUSPROG: Analytic
ARDS:
TOPICS: Embedded SQL
KEYWORDS: Bloom's: Comprehension