Вы находитесь на странице: 1из 14

chapter 07

True/False Indicate whether the statement is true or false. ____ ____ ____ ____ ____ ____ ____ ____ ____ 1. A database language enables the user to create database and table structures to perform basic data management chores. 2. A database language enables the user to perform complex queries designed to transform the raw data into useful information. 3. The ANSI prescribes a standard SQLthe most recent version is known as SQL-07. 4. The ANSI SQL standards are also accepted by the ISO. 5. SQL is considered hard to learn; its command set has a vocabulary of more than 300 words. 6. Data type selection is usually dictated by the nature of the data and by the intended use. 7. Only numeric data types can be added and subtracted in SQL. 8. The CHECK clause is used to define a condition for the values that the attribute domain cannot have. 9. SQL requires the use of the ADD command to enter data into a table.

____ 10. You cannot insert a row containing a null attribute value using SQL. ____ 11. To list the contents of a table, you must use the DISPLAY command. ____ 12. Any changes made to the contents of a table are not physically saved on disk until you use the SAVE <table name> command. ____ 13. Use the SAVE command often to save additions, changes, and deletions made in the table contents. ____ 14. All SQL commands must be issued on a single line. ____ 15. The SQL commands may be issued on a single line, but command sequences are best structured when the SQL command's components are shown on separate and indented lines. ____ 16. To restore the values of a table, provided you have not used the COMMIT command, you must use the ROLLBACK command. ____ 17. You can select partial table contents by naming the desired fields and by placing restrictions on the rows to be included in the output. ____ 18. Oracle users can use the Access QBE (query by example) query generator. ____ 19. Since computers identify all characters by their numeric codes, mathematical operators cannot be used to place restrictions on character-based attributes. ____ 20. String comparisons are made from left to right. ____ 21. Date procedures are often more software-specific than most other SQL procedures. ____ 22. SQL allows the use of logical restrictions on its inquiries such as OR, AND, and NOT. ____ 23. ANSI-standard SQL allows the use of special operators in conjunction with the WHERE clause. ____ 24. The conditional LIKE must be used in conjunction with wildcard characters. ____ 25. Most SQL implementations yield case-insensitive searches.

____ 26. Some RDBMSs, such as Microsoft Access, automatically make the necessary conversions to eliminate case sensitivity. ____ 27. Because COUNT is designed to tally the number of non-null "values" of an attribute, it is used in conjunction with the DISTINCT clause. ____ 28. You can create a logical (virtual) table by using the MAKE VIEW command. ____ 29. To join tables, simply enumerate the tables in the FROM clause of the SELECT statement. The DBMS will create a Cartesian product of every table in the FROM clause. To get the correct results, you need to select the rows in which the common attributes do not match. ____ 30. When joining three or more tables, you need to specify a join condition for one pair of tables. Multiple Choice Identify the choice that best completes the statement or answers the question. ____ 31. The SQL command that lets you insert row(s) into a table is ____. a. INSERT c. COMMIT b. SELECT d. UPDATE ____ 32. The SQL command that lets you permanently save data changes is ____. a. INSERT c. COMMIT b. SELECT d. UPDATE ____ 33. The SQL command that lets you select attributes from rows in one or more tables or views is ____. a. INSERT c. COMMIT b. SELECT d. UPDATE ____ 34. The SQL command that modifies an attributes values in one or more tables rows ____. a. INSERT c. COMMIT b. SELECT d. UPDATE ____ 35. The most recent version of standard SQL prescribed by the ANSI is ____. a. SQL-99 c. SQL-4 b. SQL 2002 d. SQL-07 ____ 36. SQL character data format is/are ____. a. CHAR and VARCHAR c. Alphanumeric b. VARCHAR only d. CHAR only ____ 37. To list all the contents of the PRODUCT table, you would use ____. a. LIST * FROM PRODUCT; c. DISPLAY * FROM PRODUCT; b. SELECT * FROM PRODUCT; d. SELECT ALL FROM PRODUCT; ____ 38. In Oracle, the ____ command is used to change the display for a column, for example to place a $ in front of a numeric value. a. DISPLAY c. CHAR b. FORMAT d. CONVERT ____ 39. UPDATE tablename ***** [WHERE conditionlist]; The ____ command replaces the ***** in the above statement. a. SET columnname = expression c. expression = columnname b. columnname = expression d. LET columnname = expression ____ 40. The command you would use when making changes to a PRODUCT table is ____. a. CHANGE PRODUCT

____ 41.

____ 42.

____ 43.

____ 44.

____ 45.

____ 46.

____ 47.

____ 48.

SET P_INDATE = '01/18/2004' WHERE P_CODE = '13-Q2/P2'; b. ROLLBACK PRODUCT SET P_INDATE = '01/18/2004' WHERE P_CODE = '13-Q2/P2'; c. EDIT PRODUCT SET P_INDATE = '01/18/2004' WHERE P_CODE = '13-Q2/P2'; d. UPDATE PRODUCT SET P_INDATE = '01/18/2004' WHERE P_CODE = '13-Q2/P2'; The ____ command is used to restore the tables contents to their previous values. a. COMMIT; RESTORE; c. COMMIT; ROLLBACK; b. COMMIT; BACKUP; d. ROLLBACK; Before the COMMIT command is used, you can retrieve deleted records by using the ____ command. a. UNDELETE c. UNSAVE b. ROLLBACK d. BACK To delete a row from the PRODUCT table, use the ____ command. a. KILL c. COMMIT b. DELETE d. ERASE Some RDBMSs (like Oracle) will automatically ____ data changes when issuing data definition commands. a. ROLLBACK c. UPDATE b. COMMIT d. INVOKE When you issue the DELETE FROM tablename command without specifying a where condition ____. a. No rows will be deleted. c. The last row will be deleted. b. The first row will be deleted. d. All rows will be deleted. The ____ command would be used to delete the table row where the P_Code = '2238/QPD'. a. DELETE FROM PRODUCT WHERE P_CODE = '2238/QPD'; b. REMOVE FROM PRODUCT WHERE P_CODE = '2238/QPD'; c. ERASE FROM PRODUCT WHERE P_CODE = '2238/QPD'; d. ROLLBACK FROM PRODUCT WHERE P_CODE = '2238/QPD'; The ____ command is used to select partial table contents. a. SELECT <column(s)> FROM <Table name> BY <Conditions>; b. LIST <column(s)> FROM <Table name> BY <Conditions>; c. SELECT <column(s)> FROM <Table name> WHERE <Conditions>; d. LIST<column(s)> FROM <Table name> WHERE <Conditions>; The ____ query will output the table contents when the value of V_CODE is equal to 21344.

a. SELECT P_DESCRIPT, P_INDATE, P_PRICE, V_CODE FROM PRODUCT WHERE V_CODE <> 21344; b. SELECT P_DESCRIPT, P_INDATE, P_PRICE, V_CODE FROM PRODUCT WHERE V_CODE <= 21344; c. SELECT P_DESCRIPT, P_INDATE, P_PRICE, V_CODE FROM PRODUCT WHERE V_CODE = 21344; d. SELECT P_DESCRIPT, P_INDATE, P_PRICE, V_CODE FROM PRODUCT WHERE V_CODE => 21344; ____ 49. The ____ query will output the table contents when the value of V_CODE is not equal to 21344. a. SELECT P_DESCRIPT, P_INDATE, P_PRICE, V_CODE FROM PRODUCT WHERE V_CODE <> 21344; b. SELECT P_DESCRIPT, P_INDATE, P_PRICE, V_CODE FROM PRODUCT WHERE V_CODE <= 21344; c. SELECT P_DESCRIPT, P_INDATE, P_PRICE, V_CODE FROM PRODUCT WHERE V_CODE = 21344; d. SELECT P_DESCRIPT, P_INDATE, P_PRICE, V_CODE FROM PRODUCT WHERE V_CODE => 21344; ____ 50. The ____ query will output the table contents when the value of V_CODE is less than or equal to 21344. a. SELECT P_DESCRIPT, P_INDATE, P_PRICE, V_CODE FROM PRODUCT WHERE V_CODE <> 21344; b. SELECT P_DESCRIPT, P_INDATE, P_PRICE, V_CODE FROM PRODUCT WHERE V_CODE <=21344; c. SELECT P_DESCRIPT, P_INDATE, P_PRICE, V_CODE FROM PRODUCT WHERE V_CODE => 21344; d. SELECT P_DESCRIPT, P_INDATE, P_PRICE, V_CODE FROM PRODUCT WHERE V_CODE = 21344; ____ 51. The ____ query will output the table contents when the value of the character field P_CODE is alphabetically less than 1558-QW1. a. SELECT P_CODE, P_DESCRIPT, P_QOH, P_MIN, P_PRICE FROM PRODUCT WHERE P_CODE <'1558-QW1'; b. SELECT P_CODE, P_DESCRIPT, P_QOH, P_MIN, P_PRICE FROM PRODUCT WHERE P_CODE = [1558-QW1] c. SELECT P_CODE, P_DESCRIPT, P_QOH, P_MIN, P_PRICE FROM PRODUCT WHERE P_CODE = (1558-QW1) d. SELECT P_CODE, P_DESCRIPT, P_QOH, P_MIN, P_PRICE

____ 52.

____ 53.

____ 54.

____ 55.

____ 56.

FROM PRODUCT WHERE P_CODE = {1558-QW1} The ____ mainframe query command will list all the rows in which the inventory stock dates occur on or after January 20, 2008. a. SELECT P_DESCRIPT, P_QOH, P_MIN, P_PRICE, P_INDATE FROM PRODUCT WHERE P_INDICATE >= '01/20/2008' b. SELECT P_DESCRIPT, P_QOH, P_MIN, P_PRICE, P_INDATE FROM PRODUCT WHERE P_INDICATE >= #01/20/2008# c. SELECT P_DESCRIPT, P_QOH, P_MIN, P_PRICE, P_INDATE FROM PRODUCT WHERE P_INDICATE <= '20-JAN-2008' d. SELECT P_DESCRIPT, P_QOH, P_MIN, P_PRICE, P_INDATE FROM PRODUCT WHERE P_INDICATE >= {01-20-2008} A(n) ____ is an alternate name given to a column or table in any SQL statement. a. alias c. stored function b. data type d. trigger The ____ command uses columns and column aliases to determine the total value of inventory held on hand. a. SELECT P_DESCRIPT, P_QOH, P_PRICE, P_ONHAND/P_PRICE FROM PRODUCT; b. SELECT P_DESCRIPT, P_QOH, P_PRICE, P_ONHAND=P_PRICE FROM PRODUCT; c. SELECT P_DESCRIPT, P_QOH, P_PRICE, P_QOH*P_PRICE FROM PRODUCT; d. SELECT P_DESCRIPT, P_QOH, P_PRICE, P_ONHAND-P_PRICE FROM PRODUCT; The ____ command uses columns and column aliases to determine the total value of inventory held on hand and to display the results in a column labeled TotValue. a. SELECT P_DESCRIPT, P_QOH, P_PRICE, P_QOH*P_PRICE AS TOTVALUE FROM PRODUCT; b. SELECT P_DESCRIPT, P_QOH, P_PRICE, P_QOH=P_PRICE AS TOTVALUE FROM PRODUCT; c. SELECT P_DESCRIPT, P_QOH, P_PRICE, P_QOH/P_PRICE AS TOTVALUE FROM PRODUCT; d. SELECT P_DESCRIPT, P_QOH, P_PRICE, P_QOH-P_PRICE AS TOTVALUE FROM PRODUCT; ____ is the SQL syntax requirement to list the table contents for either V_CODE = 21344 or V_CODE = 24288. a. SELECT P_DESCRIPT, P_INDATE, P_PRICE, V_CODE FROM PRODUCT WHERE V_CODE = 21344 OR V_CODE <= 24288 b. SELECT P_DESCRIPT, P_INDATE, P_PRICE, V_CODE FROM PRODUCT WHERE V_CODE = 21344 OR V_CODE => 24288 c. SELECT P_DESCRIPT, P_INDATE, P_PRICE, V_CODE FROM PRODUCT

____ 57.

____ 58.

____ 59.

____ 60.

____ 61.

____ 62.

____ 63.

____ 64.

WHERE V_CODE = 21344 OR V_CODE > 24288 d. SELECT P_DESCRIPT, P_INDATE, P_PRICE, V_CODE FROM PRODUCT WHERE V_CODE = 21344 OR V_CODE = 24288 The special operator used to check whether an attribute value is within a range of values is ____. a. BETWEEN c. LIKE b. NULL d. IN The ____ special operator is used to check whether an attribute value is null. a. BETWEEN c. LIKE b. IS NULL d. IN The special operator used to check for similar character strings is ____. a. BETWEEN c. LIKE b. IS NULL d. IN The special operator used to check whether a subquery returns any rows is ____. a. BETWEEN c. LIKE b. EXISTS d. IN The ____ command is used with the ALTER TABLE command to modify the table by deleting a column. a. DROP c. DELETE b. REMOVE d. ERASE A table can be deleted from the database by using the ____ command. a. DROP c. MODIFY b. DELETE d. ERASE The command used to list the P_CODE, P_DESCRIPT, P_INDATE, and P_PRICE fields from the Product table in ascending order by P_PRICE is ____. a. SELECT P_CODE, P_DESCRIPT, P_INDATE, P_PRICE FROM PRODUCT SEQUENCE BY P_PRICE; b. SELECT P_CODE, P_DESCRIPT, P_INDATE, P_PRICE FROM PRODUCT LIST BY P_PRICE; c. SELECT P_CODE, P_DESCRIPT, P_INDATE, P_PRICE FROM PRODUCT ORDER BY P_PRICE; d. SELECT P_CODE, P_DESCRIPT, P_INDATE, P_PRICE FROM PRODUCT ASCENDING BY P_PRICE; The SQL command to output the contents of the Employee table sorted by last name, first name, and initial is ____. a. SELECT EMP_LNAME, EMP_FNAME, EMP_INITIAL, EMP_AREACODE, EMP_PHONE FROM EMPLOYEE LIST BY EMP_LNAME, EMP_FNAME, EMP_INITIAL; b. SELECT EMP_LNAME, EMP_FNAME, EMP_INITIAL, EMP_AREACODE, EMP_PHONE FROM EMPLOYEE ORDER BY EMP_LNAME, EMP_FNAME, EMP_INITIAL; c. SELECT EMP_LNAME, EMP_FNAME, EMP_INITIAL, EMP_AREACODE,

____ 65.

____ 66.

____ 67.

____ 68.

____ 69.

____ 70.

EMP_PHONE FROM EMPLOYEE DISPLAY BY EMP_LNAME, EMP_FNAME, EMP_INITIAL; d. SELECT EMP_LNAME, EMP_FNAME, EMP_INITIAL, EMP_AREACODE, EMP_PHONE FROM EMPLOYEE SEQUENCE BY EMP_LNAME, EMP_FNAME, EMP_INITIAL; The ____ command is used to list a unique value for V_CODE, where the list will produce only a list of those values that are different from one another. a. SELECT ONLY V_CODE FROM PRODUCT; b. SELECT UNIQUE V_CODE FROM PRODUCT; c. SELECT DIFFERENT V_CODE FROM PRODUCT; d. SELECT DISTINCT V_CODE FROM PRODUCT; The SQL aggregate function that gives the number of rows containing not null values for the given column is ____. a. COUNT c. MAX b. MIN d. SUM The SQL aggregate function that gives the total of all values for a selected attribute in a given column is ____. a. COUNT c. MAX b. MIN d. SUM The SQL aggregate function that gives the average for the specific column is ____. a. COUNT c. MAX b. AVG d. SUM The command to join the P_DESCRIPT and P_PRICE fields from the PRODUCT table and the V_NAME, V_AREACODE, V_PHONE, and V_CONTACT fields from the VENDOR table where the value of V_CODE match is ____. a. SELECT P_DESCRIPT, P_PRICE, V_NAME, V_CONTACT, V_AREACODE, V_PHONE FROM PRODUCT, VENDOR WHERE PRODUCT.V_CODE <> VENDOR.V_CODE; b. SELECT P_DESCRIPT, P_PRICE, V_NAME, V_CONTACT, V_AREACODE, V_PHONE FROM PRODUCT, VENDOR WHERE PRODUCT.V_CODE = VENDOR.V_CODE; c. SELECT P_DESCRIPT, P_PRICE, V_NAME, V_CONTACT, V_AREACODE, V_PHONE FROM PRODUCT, VENDOR WHERE PRODUCT.V_CODE <= VENDOR.V_CODE; d. SELECT P_DESCRIPT, P_PRICE, V_NAME, V_CONTACT, V_AREACODE, V_PHONE FROM PRODUCT, VENDOR WHERE PRODUCT.V_CODE => VENDOR.V_CODE; The command to join the P_DESCRIPT and P_PRICE fields from the PRODUCT table and the V_NAME, V_AREACODE, V_PHONE and V_CONTACT fields from the VENDOR table, where the value of V_CODE match and the output is ordered by the Price is ____. a. SELECT P_DESCRIPT, P_PRICE, V_NAME, V_CONTACT, V_AREACODE,

V_PHONE FROM PRODUCT, VENDOR WHERE PRODUCT.V_CODE <> VENDOR.V_CODE; ORDER BY P_PRICE; b. SELECT P_DESCRIPT, P_PRICE, V_NAME, V_CONTACT, V_AREACODE, V_PHONE FROM PRODUCT, VENDOR WHERE PRODUCT.V_CODE => VENDOR.V_CODE; ORDER BY P_PRICE; c. SELECT P_DESCRIPT, P_PRICE, V_NAME, V_CONTACT, V_AREACODE, V_PHONE FROM PRODUCT, VENDOR WHERE PRODUCT.V_CODE <= VENDOR.V_CODE; ORDER BY P_PRICE; d. SELECT P_DESCRIPT, P_PRICE, V_NAME, V_CONTACT, V_AREACODE, V_PHONE FROM PRODUCT, VENDOR WHERE PRODUCT.V_CODE = VENDOR.V_CODE; ORDER BY P_PRICE; Completion Complete each statement. 71. In the SQL environment, the word ____________________ covers both questions and actions. 72. The basic SQL vocabulary has a fewer than ____________________ words. 73. A(n) ____________________ is a group of database objects, such as tables and indexes, that are related to each other. 74. With the exception of the ____________________ process, most RDBMS vendors use SQL that deviates little from the ANSI standard SQL. 75. U.S. state abbreviations are always two characters, so ____________________(2) is a logical choice for the data type representing a state column. 76. If your integer values are relatively small, use ____________________ instead of INT. 77. In a 1:M relationship, you must always create the table for the ____________________ side first. 78. ____________________ words are words used by SQL to perform specific functions. 79. Using the ____________________ command, SQL indexes can be created on the basis of any selected attribute. 80. A common practice is to create a(n) ____________________ on any field that is used as a search key, in comparison operations in a conditional expression, or when you want to list rows in a specific order. 81. To delete an index, use the ____________________ command. 82. You can indicate just the attributes that have required values by listing the ____________________ inside parentheses after the table name. 83. A(n) ____________________ character is a symbol that can be used as a general substitute for other characters or commands.

84. A(n) ____________________, also known as a nested query or an inner query, is a query that is embedded (or nested) inside another query. 85. ____________________, coupled with appropriate search conditions, is an incredibly powerful tool that enables you to transform data into information. 86. DATE() and SYSDATE are special functions that return todays date in MS Access and ____________________, respectively. 87. In SQL, all ____________________ expressions evaluate to true or false. 88. A specialty field in mathematics, known as ____________________ algebra, is dedicated to the use of logical devices. 89. If you add a new column to a table that already has rows, the existing rows will default to a value of ____________________ for the new column. 90. A table can be deleted from the database by using the ____________________ command. 91. A(n) ____________________ order sequence can be created easily by listing several attributes, separated by commas, after the ORDER BY clause. 92. Frequency distributions can be created quickly and easily using the SQL ____________________ clause. 93. The _____________________ clause of the GROUP BY statement operates very much like the WHERE clause in the SELECT statement. 94. A(n) ____________________ is performed when data is retrieved from more than one table at a time. 95. An alias is especially useful when a table must be joined to itself in ____________________ queries. Essay 96. What is a schema? How many schemas can be used in one database? 97. What command is used to save changes to the database? What is the syntax for this command? 98. What is a subquery? When is it used? Does the RDBMS deal with subqueries any differently from normal queries? 99. What are the wildcard characters that are used with the LIKE command? Provide one or more examples of each. 100. What is a view? What is the command used to create a view?

chapter 07 Answer Section


TRUE/FALSE 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. 23. 24. 25. 26. 27. 28. 29. 30. ANS: ANS: ANS: ANS: ANS: ANS: ANS: ANS: ANS: ANS: ANS: ANS: ANS: ANS: ANS: ANS: ANS: ANS: ANS: ANS: ANS: ANS: ANS: ANS: ANS: ANS: ANS: ANS: ANS: ANS: T T F T F T F F F F F F F F T T T F F T T T T T F T T F F F PTS: PTS: PTS: PTS: PTS: PTS: PTS: PTS: PTS: PTS: PTS: PTS: PTS: PTS: PTS: PTS: PTS: PTS: PTS: PTS: PTS: PTS: PTS: PTS: PTS: PTS: PTS: PTS: PTS: PTS: 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 REF: REF: REF: REF: REF: REF: REF: REF: REF: REF: REF: REF: REF: REF: REF: REF: REF: REF: REF: REF: REF: REF: REF: REF: REF: REF: REF: REF: REF: REF: 225 225 226 226 226 230 230 237 240 241 241 242 242 243 243 244 247 247 249 249 249 251-252 253 254 254 255 266 273 274-275 276

MULTIPLE CHOICE 31. 32. 33. 34. 35. 36. 37. ANS: ANS: ANS: ANS: ANS: ANS: ANS: A C B D A A B PTS: PTS: PTS: PTS: PTS: PTS: PTS: 1 1 1 1 1 1 1 REF: REF: REF: REF: REF: REF: REF: 225 225 225 225 226 231 241

38. 39. 40. 41. 42. 43. 44. 45. 46. 47. 48. 49. 50. 51. 52. 53. 54. 55. 56. 57. 58. 59. 60. 61. 62. 63. 64. 65. 66. 67. 68. 69. 70.

ANS: ANS: ANS: ANS: ANS: ANS: ANS: ANS: ANS: ANS: ANS: ANS: ANS: ANS: ANS: ANS: ANS: ANS: ANS: ANS: ANS: ANS: ANS: ANS: ANS: ANS: ANS: ANS: ANS: ANS: ANS: ANS: ANS:

B A D D B B B D A C C A B A A A C A D A B C B A A C B D A D B B D

PTS: PTS: PTS: PTS: PTS: PTS: PTS: PTS: PTS: PTS: PTS: PTS: PTS: PTS: PTS: PTS: PTS: PTS: PTS: PTS: PTS: PTS: PTS: PTS: PTS: PTS: PTS: PTS: PTS: PTS: PTS: PTS: PTS:

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

REF: REF: REF: REF: REF: REF: REF: REF: REF: REF: REF: REF: REF: REF: REF: REF: REF: REF: REF: REF: REF: REF: REF: REF: REF: REF: REF: REF: REF: REF: REF: REF: REF:

243 244 244 244 244 245 245 245 245 247 247 248 249 249 249 250 250 250 252 253 253 254 256 257 263 263 264 265 266 269 269 275 275

COMPLETION 71. ANS: query PTS: 1 72. ANS: 100 one hundred a hundred PTS: 1 73. ANS: schema REF: 226

REF: 226

PTS: 1 REF: 229 74. ANS: database creation PTS: 1 75. ANS: CHAR REF: 229

PTS: 1 REF: 230 76. ANS: SMALLINT PTS: 1 77. ANS: 1 one PTS: 1 78. ANS: Reserved REF: 232

REF: 234

PTS: 1 REF: 235 79. ANS: CREATE INDEX PTS: 1 80. ANS: index REF: 239

PTS: 1 REF: 239 81. ANS: DROP INDEX PTS: 1 REF: 240 82. ANS: attribute names PTS: 1 83. ANS: wildcard PTS: 1 84. ANS: subquery PTS: 1 85. ANS: SELECT PTS: 1 86. ANS: Oracle PTS: 1 87. ANS: conditional PTS: 1 88. ANS: Boolean PTS: 1 89. ANS: null REF: 242 REF: 242 REF: 245 REF: 247 REF: 251 REF: 252 REF: 252

PTS: 1 90. ANS: DROP PTS: 1 91. ANS: cascading

REF: 258 REF: 263

PTS: 1 REF: 264 92. ANS: GROUP BY PTS: 1 93. ANS: HAVING PTS: 1 94. ANS: join PTS: 1 95. ANS: recursive PTS: 1 ESSAY 96. ANS: In the SQL environment, a schema is a group of database objectssuch as tables and indexesthat are related to each other. Usually, the schema belongs to a single user or application. A single database can hold multiple schemas belonging to different users or applications. Think of a schema as a logical grouping of database objects, such as tables, indexes, and views. Schemas are useful in that they group tables by owner (or function) and enforce a first level of security by allowing each user to see only the tables that belong to that user. PTS: 1 REF: 229 TOP: Critical Thinking 97. ANS: Any changes made to the table contents are not saved on disk until you close the database, close the program you are using, or use the COMMIT command. If the database is open and a power outage or some other interruption occurs before you issue the COMMIT command, your changes will be lost and only the original table contents will be retained. The syntax for the COMMIT command is: COMMIT [WORK] The COMMIT command permanently saves all changessuch as rows added, attributes modified, and rows deletedmade to any table in the database. PTS: 1 REF: 242 TOP: Critical Thinking 98. ANS: A subquery, also known as a nested query or an inner query, is a query that is embedded (or nested) inside another query. The inner query is always executed first by the RDBMS. You can nest queries (place queries inside queries) many levels deep; in every case,the output of the inner query is used as the input for the outer (higher-level) query. In Chapter 8 you will learn more about the various types of subqueries. PTS: 1 REF: 245|246 TOP: Critical Thinking REF: 270 REF: 272 REF: 274 REF: 277

99. ANS: % means any and all following or preceding characters are eligible. For example: 'J%' includes Johnson, Jones, Jernigan, July, and J-231Q. 'Jo%' includes Johnson and Jones. '%n' includes Johnson and Jernigan. _ means any one character may be substituted for the underscore. For example: '_23-456-6789' includes 123-456-6789, 223-456-6789, and 323-456-6789. '_23-_56-678_' includes 123-156-6781, 123-256-6782, and 823-956-6788. '_o_es' includes Jones, Cones, Cokes, totes, and roles. PTS: 1 REF: 254 TOP: Critical Thinking 100. ANS: A view is a virtual table based on a SELECT query. The query can contain columns, computed columns, aliases, and aggregate functions from one or more tables. The tables on which the view is based are called base tables. You can create a view by using the CREATE VIEW command: CREATE VIEW viewname AS SELECT query The CREATE VIEW statement is a data definition command that stores the subquery specificationthe SELECT statement used to generate the virtual tablein the data dictionary. PTS: 1 REF: 273 TOP: Critical Thinking