Deck 4: Single-Table Queries

Full screen (f)
exit full mode
Question
A simple condition has the form: column name,comparison operator,and then either another column name or a value.​
Use Space or
up arrow
down arrow
to flip the card.
Question
A query is a question represented in a way that the DBMS can understand.
Question
Preceding a condition by the NOT operator reverses the truth of the original condition.​
Question
Instead of including every column in the SELECT clause,you can use an ampersand (&)to indicate that you want to include all columns.​
Question
The WHERE clause is used to retrieve rows that satisfy some condition.​
Question
When you connect two or more simple conditions with the AND operator,each condition must be listed on a separate line.​
Question
You cannot assign names to computed columns.​
Question
You can use computed columns in comparisons.​
Question
To specify that query results be listed in a specific order,use the SORT BY clause.​
Question
When you query a database,there is a defined order in which the results are displayed.​
Question
When the OR operator connects simple conditions,the compound condition will be true whenever any one of the simple conditions is true.​
Question
SQL requires that you follow special formatting rules.​
Question
When data is sorted on two columns,the more important column is called the major sort key.​
Question
An arithmetic column is a column that does not exist in the database but can be computed using data in existing columns.​
Question
To sort records in descending order,follow the name of the sort key with the REVERSE operator.​
Question
The BETWEEN operator is an essential feature of SQL.​
Question
In a SELECT statement,the FROM clause and the WHERE clause (when used)must appear on separate lines.​
Question
The only arithmetic operators that can be used in SELECT statements are + for addition and - for subtraction.​
Question
After the word FROM in a SELECT statement,you list any conditions (restrictions)that apply to the data you want to retrieve.​
Question
All SELECT statements require a WHERE clause.​
Question
In a nested query,the outer query is evaluated first.​
Question
The basic form of the SQL SELECT command is ____.​

A)FROM-SELECT-WHERE
B)​SELECT-FROM-WHERE
C)FROM-WHERE-SELECT
D)​WHERE-SELECT-FROM
Question
Which of the following operators can be used for a column computation?​

A)+
B)​^
C)**
D)​All of the above
Question
The DISTINCT operator is useful when used in conjunction with the COUNT function.​
Question
The GROUP BY clause sorts the data in a particular order.​
Question
Sometimes a condition involves a column that can accept null values.​
Question
The ____ operator is inclusive,meaning that a value equal to either end would be selected.​

A)AND
B)​BETWEEN
C)OR
D)​NOT
Question
It is possible to place one query inside another.​
Question
In SQL,you use the ____ command to query a database.​

A)WHERE
B)​SELECT
C)FROM
D)​SET
Question
You form compound conditions by connecting two or more simple conditions using the ____ operator.​

A)AND
B)​OR
C)NOT
D)​All of the above
Question
The MIN function determines the minimum value in a column.​
Question
The UNIQUE operator eliminates duplicate values in a query.​
Question
It is possible to use both a WHERE clause and a HAVING clause in a SELECT statement.​
Question
Preceding a condition by the ____ operator reverses the truth of the original condition.​

A)REVERSE
B)​NOT
C)NULL
D)​OR
Question
The COUNT function only applies to columns with numeric values.​
Question
The WHERE clause applies to both rows and groups.​
Question
The HAVING clause is used to restrict groups that are included in a query result.​
Question
The ____ operator specifies a range of values in a condition.​

A)LIKE
B)​BETWEEN
C)DISTINCT
D)​GROUP
Question
Aggregate functions apply to groups of rows.​
Question
In the SELECT clause,you can use the ____ symbol to indicate that you want to include all columns.​

A)\
B)​/
C)*
D)​?
Question
The ____ function calculates a total of the values in a column.​

A)TOTAL
B)​CALCULATE
C)SUM
D)​ADD
Question
A(n)____________________ clause provides a concise way of phrasing certain conditions.​
Question
The ____ clause lets you group data on a particular column.​

A)GROUP
B)​GROUP BY
C)SET GROUP
D)​GROUPING
Question
You use the ____ clause to list data in a specific order.​

A)ORDER
B)​SET ORDER
C)ORDER BY
D)​LIST BY
Question
You can use the ____ operator followed by a collection of values to provide a concise way of phrasing certain conditions.​

A)LIKE
B)​CONTAIN
C)VALUES
D)​IN
Question
When you use the ____ function,you can use the asterisk (*)to represent any column.​

A)SUM
B)​COUNT
C)MAX
D)​MIN
Question
____________________ conditions are formed by connecting two or more simple conditions.​
Question
The ____ wildcard symbol represents any individual character.​

A)%
B)​_
C)/
D)​\
Question
You use the ____________________ clause to retrieve rows that satisfy some condition.​
Question
The ____ operator finds rows that do not contain a null value in the specified column.​

A)IS NULL
B)​NOT NULL
C)!NULL
D)​IS NOT NULL
Question
The ____________________ operator uses one or more wildcard characters to test for a pattern match.​
Question
The ____ clause is used to restrict the groups that will be included in a query result.​

A)LIKE
B)​HAVING
C)WHERE
D)​HAVE
Question
When the ____________________ operator connects simple conditions,all the simple conditions must be true in order for the compound condition to be true.​
Question
The ____ operator uses one or more wildcard characters to test for a pattern match.​

A)PATTERN
B)​LIKE
C)MATCH
D)​SIMILAR
Question
In SQL for Oracle and for SQL Server,the ____ symbol is used as a wildcard to represent any collection of characters.​

A)*
B)​%
C)?
D)​!
Question
A(n)____________________ column is a column that does not exist in the database but can be computed using data in the existing columns.​
Question
The ____ function determines the number of rows in a table.​

A)ROW
B)​CALCULATE
C)COUNT
D)​NUMBER
Question
A(n)____________________ is simply a question represented in a way that the DBMS can understand.​
Question
When you need to sort data on two columns,the less important column is called the ____ sort key.​

A)double
B)​primary
C)minor
D)​foreign
Question
You can assign a name to a computed column by following the computation with the word ____________________ and the desired name.​
Question
You can use the ____________________ clause to limit the groups that are included.​
Question
The column on which data is to be sorted is called a sort ____________________.​
Question
When you use the MAX function,SQL ignores any ____________________ value(s)in the column and eliminates them from the computations.​
Question
In SQL,you specify the order of data in query results by using the ____________________ clause.​
Question
When you need to sort data on two columns,the more important column is called the ____________________ sort key.​
Question
Compare the WHERE and HAVING clauses.​
Question
When you use the ____________________ function,you must specify the column to total,and the column data type must be numeric.​
Question
SQL has special functions,called ____________________ functions,to calculate sums,averages,counts,maximum values,and minimum values.​
Question
The ____________________ operator finds rows that contain a null value in the specified column.​
Question
The ____________________ operator eliminates duplicate values in the query results.​
Question
____________________ creates groups of rows that share some common characteristic.​
Question
The inner query in a nested query is called a(n)____________________.​
Question
Describe simple and compound conditions.​
Question
How do you construct the SELECT query?​
Question
To sort records in descending order,follow the name of the sort key with the ____________________ operator.​
Unlock Deck
Sign up to unlock the cards in this deck!
Unlock Deck
Unlock Deck
1/75
auto play flashcards
Play
simple tutorial
Full screen (f)
exit full mode
Deck 4: Single-Table Queries
1
A simple condition has the form: column name,comparison operator,and then either another column name or a value.​
True
2
A query is a question represented in a way that the DBMS can understand.
True
3
Preceding a condition by the NOT operator reverses the truth of the original condition.​
True
4
Instead of including every column in the SELECT clause,you can use an ampersand (&)to indicate that you want to include all columns.​
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
5
The WHERE clause is used to retrieve rows that satisfy some condition.​
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
6
When you connect two or more simple conditions with the AND operator,each condition must be listed on a separate line.​
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
7
You cannot assign names to computed columns.​
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
8
You can use computed columns in comparisons.​
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
9
To specify that query results be listed in a specific order,use the SORT BY clause.​
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
10
When you query a database,there is a defined order in which the results are displayed.​
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
11
When the OR operator connects simple conditions,the compound condition will be true whenever any one of the simple conditions is true.​
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
12
SQL requires that you follow special formatting rules.​
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
13
When data is sorted on two columns,the more important column is called the major sort key.​
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
14
An arithmetic column is a column that does not exist in the database but can be computed using data in existing columns.​
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
15
To sort records in descending order,follow the name of the sort key with the REVERSE operator.​
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
16
The BETWEEN operator is an essential feature of SQL.​
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
17
In a SELECT statement,the FROM clause and the WHERE clause (when used)must appear on separate lines.​
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
18
The only arithmetic operators that can be used in SELECT statements are + for addition and - for subtraction.​
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
19
After the word FROM in a SELECT statement,you list any conditions (restrictions)that apply to the data you want to retrieve.​
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
20
All SELECT statements require a WHERE clause.​
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
21
In a nested query,the outer query is evaluated first.​
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
22
The basic form of the SQL SELECT command is ____.​

A)FROM-SELECT-WHERE
B)​SELECT-FROM-WHERE
C)FROM-WHERE-SELECT
D)​WHERE-SELECT-FROM
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
23
Which of the following operators can be used for a column computation?​

A)+
B)​^
C)**
D)​All of the above
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
24
The DISTINCT operator is useful when used in conjunction with the COUNT function.​
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
25
The GROUP BY clause sorts the data in a particular order.​
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
26
Sometimes a condition involves a column that can accept null values.​
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
27
The ____ operator is inclusive,meaning that a value equal to either end would be selected.​

A)AND
B)​BETWEEN
C)OR
D)​NOT
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
28
It is possible to place one query inside another.​
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
29
In SQL,you use the ____ command to query a database.​

A)WHERE
B)​SELECT
C)FROM
D)​SET
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
30
You form compound conditions by connecting two or more simple conditions using the ____ operator.​

A)AND
B)​OR
C)NOT
D)​All of the above
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
31
The MIN function determines the minimum value in a column.​
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
32
The UNIQUE operator eliminates duplicate values in a query.​
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
33
It is possible to use both a WHERE clause and a HAVING clause in a SELECT statement.​
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
34
Preceding a condition by the ____ operator reverses the truth of the original condition.​

A)REVERSE
B)​NOT
C)NULL
D)​OR
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
35
The COUNT function only applies to columns with numeric values.​
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
36
The WHERE clause applies to both rows and groups.​
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
37
The HAVING clause is used to restrict groups that are included in a query result.​
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
38
The ____ operator specifies a range of values in a condition.​

A)LIKE
B)​BETWEEN
C)DISTINCT
D)​GROUP
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
39
Aggregate functions apply to groups of rows.​
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
40
In the SELECT clause,you can use the ____ symbol to indicate that you want to include all columns.​

A)\
B)​/
C)*
D)​?
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
41
The ____ function calculates a total of the values in a column.​

A)TOTAL
B)​CALCULATE
C)SUM
D)​ADD
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
42
A(n)____________________ clause provides a concise way of phrasing certain conditions.​
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
43
The ____ clause lets you group data on a particular column.​

A)GROUP
B)​GROUP BY
C)SET GROUP
D)​GROUPING
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
44
You use the ____ clause to list data in a specific order.​

A)ORDER
B)​SET ORDER
C)ORDER BY
D)​LIST BY
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
45
You can use the ____ operator followed by a collection of values to provide a concise way of phrasing certain conditions.​

A)LIKE
B)​CONTAIN
C)VALUES
D)​IN
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
46
When you use the ____ function,you can use the asterisk (*)to represent any column.​

A)SUM
B)​COUNT
C)MAX
D)​MIN
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
47
____________________ conditions are formed by connecting two or more simple conditions.​
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
48
The ____ wildcard symbol represents any individual character.​

A)%
B)​_
C)/
D)​\
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
49
You use the ____________________ clause to retrieve rows that satisfy some condition.​
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
50
The ____ operator finds rows that do not contain a null value in the specified column.​

A)IS NULL
B)​NOT NULL
C)!NULL
D)​IS NOT NULL
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
51
The ____________________ operator uses one or more wildcard characters to test for a pattern match.​
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
52
The ____ clause is used to restrict the groups that will be included in a query result.​

A)LIKE
B)​HAVING
C)WHERE
D)​HAVE
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
53
When the ____________________ operator connects simple conditions,all the simple conditions must be true in order for the compound condition to be true.​
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
54
The ____ operator uses one or more wildcard characters to test for a pattern match.​

A)PATTERN
B)​LIKE
C)MATCH
D)​SIMILAR
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
55
In SQL for Oracle and for SQL Server,the ____ symbol is used as a wildcard to represent any collection of characters.​

A)*
B)​%
C)?
D)​!
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
56
A(n)____________________ column is a column that does not exist in the database but can be computed using data in the existing columns.​
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
57
The ____ function determines the number of rows in a table.​

A)ROW
B)​CALCULATE
C)COUNT
D)​NUMBER
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
58
A(n)____________________ is simply a question represented in a way that the DBMS can understand.​
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
59
When you need to sort data on two columns,the less important column is called the ____ sort key.​

A)double
B)​primary
C)minor
D)​foreign
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
60
You can assign a name to a computed column by following the computation with the word ____________________ and the desired name.​
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
61
You can use the ____________________ clause to limit the groups that are included.​
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
62
The column on which data is to be sorted is called a sort ____________________.​
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
63
When you use the MAX function,SQL ignores any ____________________ value(s)in the column and eliminates them from the computations.​
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
64
In SQL,you specify the order of data in query results by using the ____________________ clause.​
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
65
When you need to sort data on two columns,the more important column is called the ____________________ sort key.​
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
66
Compare the WHERE and HAVING clauses.​
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
67
When you use the ____________________ function,you must specify the column to total,and the column data type must be numeric.​
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
68
SQL has special functions,called ____________________ functions,to calculate sums,averages,counts,maximum values,and minimum values.​
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
69
The ____________________ operator finds rows that contain a null value in the specified column.​
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
70
The ____________________ operator eliminates duplicate values in the query results.​
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
71
____________________ creates groups of rows that share some common characteristic.​
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
72
The inner query in a nested query is called a(n)____________________.​
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
73
Describe simple and compound conditions.​
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
74
How do you construct the SELECT query?​
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
75
To sort records in descending order,follow the name of the sort key with the ____________________ operator.​
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
locked card icon
Unlock Deck
Unlock for access to all 75 flashcards in this deck.