Deck 8: Advanced SQL
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Unlock Deck
Sign up to unlock the cards in this deck!
Unlock Deck
Unlock Deck
1/95
Play
Full screen (f)
Deck 8: Advanced SQL
1
A trigger is procedural SQL code that is automatically invoked by the RDBMS upon the occurrence of a given data manipulation event.
True
2
A persistent stored module is stored and executed on the database client machine.
False
3
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.
True
4
String manipulation functions are rarely used in programming.
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
5
Numeric functions take one numeric parameter and return one value.
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
6
A sequence is not associated with a table and can be dropped from a database with a DROP SEQUENCE command.
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
7
Triggers can only be used to update table values.
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
8
In Oracle,you can use the SQL*Plus command SHOW ERRORS to help you diagnose errors found in PL/SQL blocks.
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
9
A statement-level trigger is assumed if a designer omits the FOR EACH ROW keywords.
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
10
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.
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
11
An inequality condition is also known as a natural join and an equality condition is also called a theta join.
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
12
Subqueries cannot be used in combinations with joins.
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
13
PL/SQL blocks have a section used to declare variables.
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
14
A view is a virtual table based on a SELECT query.
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
15
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.
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
16
A relational join operation merges rows from two tables.
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
17
The SELECT statement uses the attribute list to indicate what columns to project in the resulting set.
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
18
Every PL/SQL block must be given a name.
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
19
Automating business procedures and automatically maintaining data integrity and consistency are trivial in a modern business environment.
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
20
SQL supports the conditional execution of procedures (IF-THEN-ELSE statements)that are typically supported by a programming language.
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
21
A(n)join will select only the rows with matching values in the common attribute(s).
A)natural
B)cross
C)full
D)outer
A)natural
B)cross
C)full
D)outer
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
22
An explicit cursor must return two or more rows.
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
23
An implicit cursor is automatically created in procedural SQL when the SQL statement returns only one value.
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
24
BEFORE means before the changes are made in memory but after the changes are permanently saved to disk.
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
25
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
A)8
B)18
C)26
D)144
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
26
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)"oldstyle" join
D)procedural statement
WHERE PRODUCT.V_CODE = VENDOR.V_CODE;
A)set operator
B)natural join
C)"oldstyle" join
D)procedural statement
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
27
A stored function is another name for a stored procedure.
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
28
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
A)outer
B)inner
C)equi-
D)cross
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
29
"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.
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
30
Cursors are held in a reserved memory area in the client computer.
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
31
The statement SELECT * FROM T1,T2 produces a(n)join.
A)cross
B)natural
C)equi-
D)full
A)cross
B)natural
C)equi-
D)full
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
32
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
A)OF
B)USING
C)HAS
D)JOIN ON
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
33
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.
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
34
MySQL allows multiple triggering conditions per trigger.
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
35
One of the major advantages of stored procedures is that they can be used to encapsulate and represent business transactions.
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
36
Just like database triggers,stored procedures are stored in the database.
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
37
Variables can be declared inside a stored procedure.
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
38
When using a(n)join,only rows that meet the given criteria are returned.
A)full
B)inner
C)outer
D)set
A)full
B)inner
C)outer
D)set
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
39
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
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
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
40
Stored procedures must have at least one argument.
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
41
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
A)UNION
B)UNION ALL
C)INTERSECT
D)MINUS
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
42
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
A)NVL
B)TO_CHAR
C)DECODE
D)CONVERT
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
43
is a relational set operator.
A)MINUS
B)PLUS
C)ALL
D)EXISTS
A)MINUS
B)PLUS
C)ALL
D)EXISTS
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
44
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
A)7
B)10
C)15
D)17
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
45
The statement combines rows from two queries and excludes duplicates.
A)UNION
B)UNION ALL
C)INTERSECT
D)MINUS
A)UNION
B)UNION ALL
C)INTERSECT
D)MINUS
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
46
The function returns the current system date in MS Access.
A)TO_DATE()
B)SYSDATE()
C)DATE()
D)TODAY()
A)TO_DATE()
B)SYSDATE()
C)DATE()
D)TODAY()
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
47
In subquery terminology,the first query in the SQL statement is known as the query.
A)outer
B)left
C)inner
D)base
A)outer
B)left
C)inner
D)base
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
48
In Oracle,the function converts a date to a character string.
A)CONVERT()
B)TO_DATE
C)TO_CHAR()
D)TO_STRING()
A)CONVERT()
B)TO_DATE
C)TO_CHAR()
D)TO_STRING()
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
49
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
A)NULL
B)single value
C)list of values
D)virtual table
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
50
"Unioncompatible" 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
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
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
51
When using the Oracle TO_DATE function,the code represents a three-letter month name.
A)MON
B)MM3
C)MONTH
D)MM
A)MON
B)MM3
C)MONTH
D)MM
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
52
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
A)7
B)10
C)15
D)17
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
53
When using the Oracle TO_NUMBER function to convert a character string into a number,represents a digit.
A)0
B)9
C)$
D)#
A)0
B)9
C)$
D)#
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
54
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
A)IN
B)NOT IN
C)AND
D)UNION
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
55
The data type is considered compatible with VARCHAR(35).
A)DATE
B)INT
C)TINYINT
D)CHAR(15)
A)DATE
B)INT
C)TINYINT
D)CHAR(15)
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
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?
A)0
B)2
C)7
D)10
A)0
B)2
C)7
D)10
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
57
Which of the following is a feature of a correlated subquery?
A)The inner subquery executes first.
A)The inner subquery initiates the process of
B)The outer subquery initiates the process of execution in a subquery.
D)The outer subquery executes independent execution in a subquery.of the inner subquery.
A)The inner subquery executes first.
A)The inner subquery initiates the process of
B)The outer subquery initiates the process of execution in a subquery.
D)The outer subquery executes independent execution in a subquery.of the inner subquery.
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
58
is a string function that returns the number of characters in a string value.
A)LENGTH
B)SUBSTRING
C)CONCAT
D)UCASE
A)LENGTH
B)SUBSTRING
C)CONCAT
D)UCASE
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
59
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
A)0
B)2
C)8
D)10
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
60
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)OF
C)AND
D)UNION
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
61
A(n)subquery is a subquery that executes once for each row in the outer query.
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
62
The Oracle equivalent to an MS Access AutoNumber is a(n).
A)auto-number
B)sequence
C)TO_NUMBER function
D)trigger
A)auto-number
B)sequence
C)TO_NUMBER function
D)trigger
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
63
When using a subquery,the output of a(n)query is used as the input for the outer query.
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
64
Oracle uses the function to extract the various parts of a date.
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
65
The determines the common attribute or attributes by looking for identically named attributes and compatible data types.
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
66
The pseudo-column is used to select the next value from a sequence.
A)CURRVAL
B)NEXTVAL
C)NEXT
D)GET_NEXT
A)CURRVAL
B)NEXTVAL
C)NEXT
D)GET_NEXT
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
67
The PL/SQL block starts with the section.
A)IS
B)OPEN
C)DECLARE
D)BEGIN
A)IS
B)OPEN
C)DECLARE
D)BEGIN
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
68
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.
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
69
functions extract a value of a given data type and convert it to the equivalent value in another data type.
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
70
The syntax of the DECODE function starts with .
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
71
Which of the following is a feature of oracle sequences?
A)An oracle sequence uses the identity column
A)Oracle sequences are tied to columns and tables.
B)Oracle sequences generate a character string that can be assigned to tables.
D)An oracle sequence can be created and deleted property to automatically number rows.anytime.
A)An oracle sequence uses the identity column
A)Oracle sequences are tied to columns and tables.
B)Oracle sequences generate a character string that can be assigned to tables.
D)An oracle sequence can be created and deleted property to automatically number rows.anytime.
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
72
The IN subquery uses a(n)operator.
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
73
The statement combines the output of two SELECT queries.
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
74
The statement uses the attribute list to indicate what columns to project in the resulting set.
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
75
The clause is used to restrict the output of a GROUP BY query by applying a conditional criteria to the grouped rows.
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
76
An alternate syntax for a join is: SELECT column-list FROM table1 JOIN table2 (common-column).
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
77
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
A)%ROWCOUNT
B)%NOTFOUND
C)%FOUND
D)%ISOPEN
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
78
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
A)cursor-style processing
B)stored procedures
C)embedded SQL
D)Procedural Language SQL
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
79
Oracle recommends for creating audit logs.
A)triggers
B)stored procedures
C)stored functions
D)tables
A)triggers
B)stored procedures
C)stored functions
D)tables
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck
80
The Oracle string concatenation function is .
A)CONCAT
B)+
C)||
D)&&
A)CONCAT
B)+
C)||
D)&&
Unlock Deck
Unlock for access to all 95 flashcards in this deck.
Unlock Deck
k this deck