Chapter 8 An inequality condition is also known as a natural

subject Type Homework Help
subject Pages 9
subject Words 3934
subject Authors Carlos Coronel, Steven Morris

Unlock document.

This document is partially blurred.
Unlock all pages and 1 million more documents.
Get Access
page-pf1
CHAPTER 8: ADVANCED SQL
1. An inequality condition is also known as a natural join and an equality condition is also called a theta join.
a. True
b. False
2. 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
3. A sequence is not associated with a table and can be dropped from a database with a DROP SEQUENCE
command.
a. True
b. False
4. SQL supports the conditional execution of procedures (IF-THEN-ELSE statements) that are typically
supported by a programming language.
a. True
b. False
5. 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
6. A persistent stored module is stored and executed on the database client machine.
a. True
b. False
7. Every PL/SQL block must be given a name.
a. True
b. False
page-pf2
Chapter 8: Advanced SQL
8. 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
9. PL/SQL blocks have a section used to declare variables.
a. True
b. False
10. 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
11. Automating business procedures and automatically maintaining data integrity and consistency are trivial in a
modern business environment.
a. True
b. False
12. 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
13. A trigger is executed as part of the transaction that triggered it.
a. True
b. False
14. Triggers can only be used to update table values.
a. True
b. False
15. A statement-level trigger is assumed if a designer omits the FOR EACH ROW keywords.
a. True
b. False
page-pf3
Chapter 8: Advanced SQL
16. Each statement inside the PL/SQL code must end with a period (.).
a. True
b. False
17. To test a trigger, one should use the EXECUTE TRIGGER command.
a. True
b. False
18. Just like database triggers, stored procedures are stored in the database.
a. True
b. False
19. One of the major advantages of stored procedures is that they can be used to encapsulate and represent
business transactions.
a. True
b. False
20. One of the disadvantages of stored procedures is that they increase network traffic.
a. True
b. False
21. Stored procedures help reduce code duplication by means of code isolation and code sharing.
a. True
b. False
22. Stored procedures must have at least one argument.
a. True
b. False
23. Variables can be declared inside a stored procedure.
a. True
b. False
page-pf4
Chapter 8: Advanced SQL
24. Stored procedures are executed using the EXEC command.
a. True
b. False
25. Cursors are held in a reserved memory area in the client computer.
a. True
b. False
26. An implicit cursor is automatically created in procedural SQL when the SQL statement returns only one
value.
a. True
b. False
27. An explicit cursor must return two or more rows.
a. True
b. False
28. The NEXT command for a cursor is used to retrieve a row from the cursor and place it in the respective
PL/SQL variables.
a. True
b. False
29. Cursor-style processing involves retrieving data from the cursor, one row at a time.
a. True
b. False
30. A stored function is another name for a stored procedure.
a. True
b. False
31. 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
page-pf5
Chapter 8: Advanced SQL
32. A relational join operation merges rows from two tables.
a. True
b. False
33. A trigger definition consists of the triggering timing, the triggering event, the triggering level, and the
triggering action.
a. True
b. False
34. 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
35. MySQL allows multiple triggering conditions per trigger.
a. True
b. False
36. The following SQL statement uses a(n) .
SELECT P_CODE, P_DESCRIPT, P_PRICE, V_NAME
FROM PRODUCT, VENDOR
WHERE PRODUCT.V_CODE = VENDOR.V_CODE;
a. set operator b. natural join
c. old-style join d. procedural statement
37. When using a(n) join, only rows that meet the given criteria are returned.
a. full b. inner
c. outer d. set
38. The statement SELECT * FROM T1, T2 produces a(n) join.
a. cross b. natural
c. equi- d. full
page-pf6
Chapter 8: Advanced SQL
39. 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
40. A(n) join will select only the rows with matching values in the common attribute(s).
a. natural b. cross
c. full d. outer
41. 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
42. The ANSI standard defines type(s) of outer join(s)
a. one b. two
c. three d. four
43. 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
44. The syntax for a left outer join is .
a. SELECT column-list
FROM table1 OUTER JOIN table2 LEFT
WHERE join-condition
b. SELECT column-list
FROM table1 LEFT [OUTER] JOIN table2
ON join-condition
c. SELECT column-list
WHERE LEFT table1 = table 2
d. SELECT column-list
FROM table1 LEFT table2 [JOIN]
WHERE join-condition
page-pf7
Chapter 8: Advanced SQL
45. A join returns rows with matching values and includes all rows from both tables (T1 and T2) with
unmatched values.
a. natural b. cross
c. full outer d. left outer
46. All join conditions are connected through a(n) logical operator.
a. NOR b. OR
c. AND d. NOT
47. 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
48. A is a query inside a query.
a. subquery b. range query
c. join d. set query
49. In subquery terminology, the first query in the SQL statement is known as the query.
a. outer b. left
c. inner d. base
50. Which of the following is a feature of a correlated subquery?
a. The inner subquery executes first. b. The outer subquery initiates the process of
execution in a subquery.
c. The inner subquery initiates the process of d. The outer subquery executes independent
execution in a subquery. of the inner subquery.
51. In a subquery, the query is executed first.
a. left b. right
c. inner d. outer
52. The function returns the current system date in MS Access.
a. TO_DATE() b. SYSDATE()
c. DATE() d. TODAY()
page-pf8
Chapter 8: Advanced SQL
53. When using the Oracle TO_DATE function, the code represents a three-letter month name.
a. MON b. MM3
c. MONTH d. MM
54. The Oracle function returns the current date.
a. DATE b. SYSDATE
c. CURRENT_DATE d. TO_DATE
55. In Oracle, the function converts a date to a character string.
a. CONVERT() b. TO_DATE
c. TO_CHAR() d. TO_STRING()
a. CONCAT b. +
c. || d. &&
57. is a string function that returns the number of characters in a string value.
a. LENGTH b. SUBSTRING
c. CONCAT d. UCASE
58. When using the Oracle TO_NUMBER function to convert a character string into a number,
represents a digit.
a. 0 b. 9
c. $ d. #
59. is a relational set operator.
a. MINUS b. PLUS
c. ALL d. EXISTS
60. Union-compatible means that the .
a. names of the relation attributes can be different, but the data types must be alike
b. names of the relation attributes must be the same, but the data types can be different
c. names of the relation attributes must be the same and their data types must be alike
d. number of attributes must be the same, but the names and data types can be different
page-pf9
Chapter 8: Advanced SQL
61. The data type is considered compatible with VARCHAR(35).
a. DATE b. INT
c. TINYINT d. CHAR(15)
62. 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
63. The data type is compatible with NUMBER.
a. VARCHAR(15) b. SMALLINT
c. DATE d. CHAR(10)
64. The statement combines rows from two queries and excludes duplicates.
a. UNION b. UNION ALL
c. INTERSECT d. MINUS
65. The syntax for the UNION query is .
a. query + query b. UNION (query, query)
c. UNION: query query d. query UNION query
66. 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
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
page-pfa
Chapter 8: Advanced SQL
68. 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?
a. 0 b. 2
c. 7 d. 10
69. 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
70. 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
71. The operator could be used in place of INTERSECT if the DBMS does not support it.
a. IN b. OF
c. AND d. UNION
a. IN b. NOT IN
c. AND d. UNION
73. The Oracle equivalent to an MS Access AutoNumber is a(n) .
a. auto-number b. sequence
c. TO_NUMBER function d. trigger
page-pfb
Chapter 8: Advanced SQL
74. Which of the following is a feature of oracle sequences?
a. Oracle sequences are tied to columns and tables. b. Oracle sequences generate a character string
that can be assigned to tables.
c. An oracle sequence uses the identity column d. An oracle sequence can be created and deleted
property to automatically number rows. anytime.
75. The pseudo-column is used to select the next value from a sequence.
a. CURRVAL b. NEXTVAL
c. NEXT d. GET_NEXT
76. A(n) is a block of code containing standard SQL statements and procedural extensions that is stored
and executed at the DBMS server.
a. PSM b. PLS
c. SQL Statement d. PMR
77. 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
78. The PL/SQL block starts with the section.
a. IS b. OPEN
c. DECLARE d. BEGIN
79. Oracle recommends for creating audit logs.
a. triggers b. stored procedures
c. stored functions d. tables
80. 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
81. An alternate syntax for a join is: SELECT column-list FROM table1 JOIN table2 (common-column).
page-pfc
Chapter 8: Advanced SQL
82. The determines the common attribute or attributes by looking for identically named attributes and
compatible data types.
83. When using a subquery, the output of a(n) query is used as the input for the outer query.
84. The clause is used to restrict the output of a GROUP BY query by applying a conditional criteria to the
grouped rows.
85. The IN subquery uses a(n) operator.
86. 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.
87. A(n) subquery is a subquery that executes once for each row in the outer query.
88. Oracle uses the function to extract the various parts of a date.
89. functions extract a value of a given data type and convert it to the equivalent value in another data type.
90. The syntax of the DECODE function starts with .
91. The statement combines the output of two SELECT queries.
92. A(n) query can be used to produce a relation that retains the duplicate rows.
93. The statement can be used to combine rows from two queries, returning only the rows that appear in
both sets.
94. The syntax of the MINUS statement in Oracle is .
page-pfd
Chapter 8: Advanced SQL
95. If the DBMS does not support the INTERSECT statement, one can use a(n) subquery to achieve the
same result.
96. A(n) view is a view that can be used to update attributes in the base table(s) that are used in the view.
97. A(n) routine pools multiple transactions into a single batch to update a master table field in a single
operation.
98. 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.
99. In an Oracle sequence, the pseudo-column retrieves the current value of a sequence.
100. Using Oracle , a designer can write a PL/SQL code block by enclosing the commands inside BEGIN
and END clauses.
101. A row-level trigger requires use of the keywords and is executed once for each row affected by the
triggering statement.
102. When the critical application code is isolated in a single program, improves.
103. is the term used to describe an environment in which the SQL statement is not known in advance and is
generated at run time.
104. Explain the different basic types of join operations. What are they and how do they work?
page-pfe
Chapter 8: Advanced SQL
105. What are the four different types of results that can be returned from a subquery?
106. Describe the important features and applications of SQL functions
107. Describe the characteristics of an Oracle sequence.
page-pff
Chapter 8: Advanced SQL
108. How are triggers critical to proper database operation and management?
109. Summarize the hierarchy of steps involved in creating and running an executable program with embedded
SQL statements.

Trusted by Thousands of
Students

Here are what students say about us.

Copyright ©2022 All rights reserved. | CoursePaper is not sponsored or endorsed by any college or university.