Unlock access to all the studying documents.
View Full Document
Chapter 4: Single-Table Queries
Cengage Learning Testing, Powered by Cognero
1. A query is a question represented in a way that the DBMS can understand.
2. SQL requires that you follow special formatting rules.
3. In a SELECT statement, the FROM clause and the WHERE clause (when used) must appear on separate lines.
4. All SELECT statements require a WHERE clause.
5. After the word FROM in a SELECT statement, you list any conditions (restrictions) that apply to the data you want to
retrieve.
6. Instead of including every column in the SELECT clause, you can use an ampersand (&) to indicate that you want to
include all columns.
Cengage Learning Testing, Powered by Cognero
7. A simple condition has the form: column name, comparison operator, and then either another column name or a value.
8. The WHERE clause is used to retrieve rows that satisfy some condition.
9. Preceding a condition by the NOT operator reverses the truth of the original condition.
10. When the OR operator connects simple conditions, the compound condition will be true whenever any one of the
simple conditions is true.
11. When you connect two or more simple conditions with the AND operator, each condition must be listed on a separate
line.
12. The BETWEEN operator is an essential feature of SQL.
13. An arithmetic column is a column that does not exist in the database but can be computed using data in existing
columns.
Chapter 4: Single-Table Queries
Cengage Learning Testing, Powered by Cognero
14. The only arithmetic operators that can be used in SELECT statements are + for addition and – for subtraction.
15. You cannot assign names to computed columns.
16. You can use computed columns in comparisons.
17. When you query a database, there is a defined order in which the results are displayed.
18. To specify that query results be listed in a specific order, use the SORT BY clause.
19. To sort records in descending order, follow the name of the sort key with the REVERSE operator.
Cengage Learning Testing, Powered by Cognero
26. It is possible to place one query inside another.
27. In a nested query, the outer query is evaluated first.
28. The GROUP BY clause sorts the data in a particular order.
29. The WHERE clause applies to both rows and groups.
30. The HAVING clause is used to restrict groups that are included in a query result.
31. It is possible to use both a WHERE clause and a HAVING clause in a SELECT statement.
32. Sometimes a condition involves a column that can accept null values.
Chapter 4: Single-Table Queries
Cengage Learning Testing, Powered by Cognero
33. In SQL, you use the ____ command to query a database.
34. The basic form of the SQL SELECT command is ____.
35. In the SELECT clause, you can use the ____ symbol to indicate that you want to include all columns.
36. You form compound conditions by connecting two or more simple conditions using the ____ operator.
37. Preceding a condition by the ____ operator reverses the truth of the original condition.
Chapter 4: Single-Table Queries
Cengage Learning Testing, Powered by Cognero
38. The ____ operator specifies a range of values in a condition.
39. The ____ operator is inclusive, meaning that a value equal to either end would be selected.
40. Which of the following operators can be used for a column computation?
41. In SQL for Oracle and for SQL Server, the ____ symbol is used as a wildcard to represent any collection of characters.
42. The ____ operator uses one or more wildcard characters to test for a pattern match.
Chapter 4: Single-Table Queries
Cengage Learning Testing, Powered by Cognero
43. The ____ wildcard symbol represents any individual character.
44. You can use the ____ operator followed by a collection of values to provide a concise way of phrasing certain
conditions.
45. You use the ____ clause to list data in a specific order.
46. When you need to sort data on two columns, the less important column is called the ____ sort key.
47. The ____ function determines the number of rows in a table.
Chapter 4: Single-Table Queries
Cengage Learning Testing, Powered by Cognero
48. The ____ function calculates a total of the values in a column.
49. When you use the ____ function, you can use the asterisk (*) to represent any column.
50. The ____ clause lets you group data on a particular column.
51. The ____ clause is used to restrict the groups that will be included in a query result.
52. The ____ operator finds rows that do not contain a null value in the specified column.
Chapter 4: Single-Table Queries
Cengage Learning Testing, Powered by Cognero
53. A(n) ____________________ is simply a question represented in a way that the DBMS can understand.
54. You use the ____________________ clause to retrieve rows that satisfy some condition.
55. When the ____________________ operator connects simple conditions, all the simple conditions must be true in
order for the compound condition to be true.
56. ____________________ conditions are formed by connecting two or more simple conditions.
57. A(n) ____________________ column is a column that does not exist in the database but can be computed using data
in the existing columns.
58. You can assign a name to a computed column by following the computation with the word ____________________
and the desired name.
59. The ____________________ operator uses one or more wildcard characters to test for a pattern match.
Cengage Learning Testing, Powered by Cognero
60. A(n) ____________________ clause provides a concise way of phrasing certain conditions.
61. In SQL, you specify the order of data in query results by using the ____________________ clause.
62. The column on which data is to be sorted is called a sort ____________________.
63. When you need to sort data on two columns, the more important column is called the ____________________ sort
key.
64. To sort records in descending order, follow the name of the sort key with the ____________________ operator.
65. SQL has special functions, called ____________________ functions, to calculate sums, averages, counts, maximum
values, and minimum values.
66. When you use the ____________________ function, you must specify the column to total, and the column data type
must be numeric.
67. When you use the MAX function, SQL ignores any ____________________ value(s) in the column and eliminates
them from the computations.
68. The ____________________ operator eliminates duplicate values in the query results.