Deck 6: The Basics of Querying a Database
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/109
Play
Full screen (f)
Deck 6: The Basics of Querying a Database
1
New tables and views can be created from the results of a query.
True
2
One of the most common uses of the DUAL table is to get the next sequential value from an Oracle sequence object.
True
3
Pseudocolumns contain values present in a table,but not in an Oracle instance.
False
4
Composite queries use special set operators,such as UNION,to concatenate the rows of two different queries together,into a single resulting set of rows.
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
5
The DISTINCT clause cannot operate on multiple columns.
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
6
The DUAL table is a little like an internal Oracle database cursor.
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
7
Any expression containing a NULL value always returns a NULL value.
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
8
The DUAL table can be queried and updated.
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
9
NULL values are not included in the most commonly used indexes for an Oracle database.
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
10
Leaving a column value set to NULL uses more space.
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
11
Most Oracle database built-in functions will return a NULL value when passed a NULL value.
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
12
Flashback queries execute SQL statements in parallel,preferably using multiple CPU platforms and Oracle partitions.
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
13
Use of upper- and lowercase is only a factor in queries for strings or expressions enclosed in Oracle database quotation marks.
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
14
An alias can be used to refer to a column,typically in a join or a subquery.
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
15
A space character or a 0 value are NULL.
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
16
The AS clause can be used in the ORDER BY clause.
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
17
NULL values sort as the lowest value by default.
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
18
User-defined SQL functions are functions in which Java is used to custom write functions for specific tasks,which are not available in functions provided in an Oracle database.
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
19
A likely use of sequences is for surrogate foreign key generation.
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
20
Oracle SQL allows full expression-based use of both provided (built-in)and user-definable functions.
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
21
The ____ SQL group function returns the highest value from a group of values.
A) MAXIMUM
B) MAX
C) MX
D) MXM
A) MAXIMUM
B) MAX
C) MX
D) MXM
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
22
Selecting values greater than ROWNUM,as opposed to less than,or less than or equal to ROWNUM,will return no rows whatsoever.
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
23
BETWEEN allows multiple rows of returning subqueries.
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
24
The GROUP BY clause can use the column positional specification like the ORDER BY clause.
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
25
The ____ SQL group function returns the lowest value from a group of values.
A) MIN
B) MINIMUM
C) MINM
D) MNM
A) MIN
B) MINIMUM
C) MINM
D) MNM
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
26
The ____ statement allows you to specify tables and columns in the tables,from which data is selected.
A) SELECT
B) WHERE
C) FROM
D) GROUP BY
A) SELECT
B) WHERE
C) FROM
D) GROUP BY
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
27
____ queries use the ORDER BY clause to return rows in a specified order.
A) Join
B) Filtered
C) Sorted
D) Aggregated
A) Join
B) Filtered
C) Sorted
D) Aggregated
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
28
____ queries create groupings or summaries of larger row sets,producing,for example,a sum of values or a number of subtotals from all values.
A) Join
B) Filtered
C) Sorted
D) Aggregated
A) Join
B) Filtered
C) Sorted
D) Aggregated
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
29
Queries can be sorted in ascending or descending order,where descending is the default if ASC or DESC are not specified.
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
30
____ queries merge rows from one or more tables,usually linking rows based on related values.
A) Join
B) Filtered
C) Sorted
D) Aggregated
A) Join
B) Filtered
C) Sorted
D) Aggregated
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
31
____ queries use the WHERE clause to retain or filter out unwanted rows.
A) Basic
B) Filtered
C) Sorted
D) Aggregated
A) Basic
B) Filtered
C) Sorted
D) Aggregated
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
32
The following query is an example of a(n)____.
SELECT TABLESPACE_NAME,BLOCK_SIZE
FROM DBA_TABLESPACES
WHERE TABLESPACE_NAME IN
(SELECT TABLESPACE_NAME FROM DBA_DATA_FILES);
A) join query
B) aggregated query
C) sorted query
D) subquery
SELECT TABLESPACE_NAME,BLOCK_SIZE
FROM DBA_TABLESPACES
WHERE TABLESPACE_NAME IN
(SELECT TABLESPACE_NAME FROM DBA_DATA_FILES);
A) join query
B) aggregated query
C) sorted query
D) subquery
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
33
Subqueries can return more than a single column,and their calling queries can validate against those multiple columns.
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
34
____ queries simply retrieve rows.
A) Basic
B) Filtered
C) Sorted
D) Aggregated
A) Basic
B) Filtered
C) Sorted
D) Aggregated
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
35
AND has higher precedence than NOT,followed by OR.
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
36
AS is often used to check membership of one element in a list of elements.
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
37
EXISTS is sometimes faster than IN.
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
38
The difference between EXISTS and IN is that EXISTS only allows an expression on the right.
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
39
Certain types of subqueries are also known as ____ because they join without returning values from the subquery.
A) inner joins
B) outer joins
C) semi-joins
D) cross join
A) inner joins
B) outer joins
C) semi-joins
D) cross join
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
40
Subqueries can be nested within subqueries.
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
41
Queries can be summarized or aggregated into fewer rows using the GROUP BY and ____ clauses.
A) FROM
B) WHERE
C) HAVING
D) ORDER BY
A) FROM
B) WHERE
C) HAVING
D) ORDER BY
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
42
The ____ SQL group function counts the number of rows in a group.
A) COUNT
B) CN
C) CNT
D) COU
A) COUNT
B) CN
C) CNT
D) COU
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
43
The following query returns a single number as a total (or sum)of all blocks,used by all datafiles in the database: ____.
A) SELECT TOTAL(BLOCKS)FROM DBA_DATA_FILES;
B) SELECT SUM(BLOCKS)FROM DBA_DATA_FILES;
C) SELECT AVG(BLOCKS)FROM DBA_DATA_FILES;
D) SELECT COUNT(BLOCKS)FROM DBA_DATA_FILES;
A) SELECT TOTAL(BLOCKS)FROM DBA_DATA_FILES;
B) SELECT SUM(BLOCKS)FROM DBA_DATA_FILES;
C) SELECT AVG(BLOCKS)FROM DBA_DATA_FILES;
D) SELECT COUNT(BLOCKS)FROM DBA_DATA_FILES;
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
44
Comparison of a NULL value to any other value will always evaluate to ____.
A) true
B) false
C) NULL
D) UNDEFINED
A) true
B) false
C) NULL
D) UNDEFINED
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
45
The most commonly used indexes for an Oracle database are ____ indexes.
A) hash
B) BTree
C) B+Tree
D) Heap
A) hash
B) BTree
C) B+Tree
D) Heap
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
46
A(n)____ is not a function,but can be added to a table query or into other SQL commands to retrieve values not normally accessed from simple table queries.
A) NULL
B) marker
C) index
D) pseudocolumn
A) NULL
B) marker
C) index
D) pseudocolumn
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
47
The ____ statement or clause is the beginning of the SQL command for querying (retrieving)data from a database object,such as a table or view.
A) QUERY
B) SELECT
C) WHERE
D) RETRIEVE
A) QUERY
B) SELECT
C) WHERE
D) RETRIEVE
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
48
Within the realm of a database a ____ valued column,in a row,in a table,is a column,which has never been set to anything (not yet accessed),or has been deliberately set to this value.
A) NIL
B) NUL
C) NULL
D) VOID
A) NIL
B) NUL
C) NULL
D) VOID
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
49
The ____ SQL group function returns the average of a group of values.
A) AVERAGE
B) AVE
C) AVR
D) AVG
A) AVERAGE
B) AVE
C) AVR
D) AVG
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
50
A(n)____ is a chunk of memory allocated to a query,to contain the results of a query during processing of that query.
A) DUAL
B) index
C) cursor
D) view
A) DUAL
B) index
C) cursor
D) view
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
51
The ____ table is used to request data from an Oracle database,where that data is not in user application tables.
A) DUAL
B) NULL
C) TEMP
D) SYS
A) DUAL
B) NULL
C) TEMP
D) SYS
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
52
If you obtain a description of the DUAL table using the DESC command in SQL*Plus Worksheet,you will see that the only column present is called ____.
A) DUAL
B) NULL
C) VOID
D) DUMMY
A) DUAL
B) NULL
C) VOID
D) DUMMY
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
53
The ____ clause is a special SQL clause used to retrieve the first value of each group in a set of duplications.
A) DISTINCT
B) FIRST
C) INDEX
D) NULL
A) DISTINCT
B) FIRST
C) INDEX
D) NULL
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
54
Filtering uses the ____ clause to filter out unwanted rows,or retain wanted rows.
A) FROM
B) GROUP BY
C) HAVING
D) WHERE
A) FROM
B) GROUP BY
C) HAVING
D) WHERE
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
55
The ____ SQL group function adds values across rows in a group
A) ADD
B) ADDITION
C) SUM
D) SUMMATION
A) ADD
B) ADDITION
C) SUM
D) SUMMATION
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
56
Sorting allows resorting of query results using the ____ clause.
A) FROM
B) GROUP BY
C) HAVING
D) ORDER BY
A) FROM
B) GROUP BY
C) HAVING
D) ORDER BY
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
57
The ____({value},{replace})function replaces NULL values in expressions,avoiding SQL errors.
A) NVALUE
B) NVAL
C) NVL
D) NIL
A) NVALUE
B) NVAL
C) NVL
D) NIL
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
58
This query finds all columns in the table:
SELECT ____ FROM DBA_TABLESPACES;
A) ALL
B) *
C) FULL
D) #
SELECT ____ FROM DBA_TABLESPACES;
A) ALL
B) *
C) FULL
D) #
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
59
____ are automated counters,counting from a specific value,up to a specified maximum (or an enormous value with no maximum specified).
A) Keys
B) Indexes
C) Counters
D) Sequences
A) Keys
B) Indexes
C) Counters
D) Sequences
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
60
A(n)____ can act to apply a distinct name to multiple columns with the same name.
A) pseudonym
B) pseudocolumn
C) alias
D) tag
A) pseudonym
B) pseudocolumn
C) alias
D) tag
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
61
ANY,SOME,and ____ check set membership and allow subqueries that return multiple rows.
A) BETWEEN
B) IN
C) AS
D) ALL
A) BETWEEN
B) IN
C) AS
D) ALL
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
62
____ set membership evaluates an expression as being within a set of elements.
A) GROUP BY
B) HAVING
C) IN
D) LIKE
A) GROUP BY
B) HAVING
C) IN
D) LIKE
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
63
____ is used as a pattern-matching character representing zero or more characters in a subset of a string.
A) %
B) _
C) *
D) #
A) %
B) _
C) *
D) #
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
64
____ validates an expression as being between two values,and is inclusive.
A) AS
B) IN
C) BETWEEN
D) IN BETWEEN
A) AS
B) IN
C) BETWEEN
D) IN BETWEEN
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
65
The ____ pseudocolumn is used only in hierarchical queries,in tandem with the CONNECT BY operator,returning the level of a row in a hierarchy of rows,in a hierarchical query.
A) LEVEL
B) PRIOR
C) START WITH
D) FIRST
A) LEVEL
B) PRIOR
C) START WITH
D) FIRST
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
66
The ____ set operator returns one query less the other,similar to a left outer join where only distinct rows in the first query are returned.
A) UNION ALL
B) INTERSECT
C) MINUS
D) DISTINCT
A) UNION ALL
B) INTERSECT
C) MINUS
D) DISTINCT
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
67
A(n)____ flashback query allows you to pull data from a database at a specific point in time.
A) AS
B) LIKE
C) AS OF
D) IN
A) AS
B) LIKE
C) AS OF
D) IN
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
68
A(n)____ join combines rows from both tables using matching column names and column values.
A) outer
B) inner
C) cross
D) self
A) outer
B) inner
C) cross
D) self
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
69
____ pattern matches between strings;those strings are expressions.
A) LIKE
B) HAVING
C) WHERE
D) AS
A) LIKE
B) HAVING
C) WHERE
D) AS
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
70
A database ____________________ uses a special type of SQL command called a SELECT statement.
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
71
A(n)____ join returns all rows from both tables with null values replacing missing values.
A) inner
B) left outer
C) right outer
D) full outer
A) inner
B) left outer
C) right outer
D) full outer
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
72
The ____ clause extends the GROUP BY clause by filtering on resulting grouped rows (returned by the GROUP BY clause).
A) HAVING
B) WHERE
C) AS
D) IN
A) HAVING
B) WHERE
C) AS
D) IN
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
73
When using GROUP BY,the expression for the ____ statement should include at least one grouping function such as COUNT().
A) HAVING
B) SELECT
C) WHERE
D) FROM
A) HAVING
B) SELECT
C) WHERE
D) FROM
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
74
The GROUP BY clause column list ____ include all columns in the SELECT statement not affected by any aggregate functions.
A) must
B) must not
C) should
D) should not
A) must
B) must not
C) should
D) should not
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
75
The ____ clause allows a hierarchical query to begin displaying within a hierarchical structure,with a specified column and value.
A) LEVEL
B) PRIOR
C) START WITH
D) FIRST
A) LEVEL
B) PRIOR
C) START WITH
D) FIRST
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
76
The ____ set operator returns distinct rows from both queries.
A) UNION ALL
B) INTERSECT
C) MINUS
D) DISTINCT
A) UNION ALL
B) INTERSECT
C) MINUS
D) DISTINCT
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
77
____ is a wildcard character.
A) #
B) _
C) +
D) $
A) #
B) _
C) +
D) $
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
78
____ is used to represent one and only one character.
A) %
B) _
C) *
D) #
A) %
B) _
C) *
D) #
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
79
____ work best on multiple CPU platforms in tandem with partitioning,and particularly with multiple disks or RAID arrays.
A) Subqueries
B) Flashback queries
C) Joins
D) Parallel queries
A) Subqueries
B) Flashback queries
C) Joins
D) Parallel queries
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck
80
Top-N queries are executed by filtering against the ____ pseudocolumn.
A) POSITION
B) POS
C) COLNUM
D) ROWNUM
A) POSITION
B) POS
C) COLNUM
D) ROWNUM
Unlock Deck
Unlock for access to all 109 flashcards in this deck.
Unlock Deck
k this deck