Chapter 6: Updating Data
Cengage Learning Testing, Powered by Cognero
Page 1
1. You can create a new table using data in an existing table.
a.
True
b.
False
ANSWER:
True
POINTS:
1
REFERENCES:
167
2. The command, CREATE TABLE AS LEVEL1_CUSTOMER USING CUSTOMER; creates a table called
LEVEL1_CUSTOMER that has the same structure as CUSTOMER.
a.
True
b.
False
ANSWER:
POINTS:
REFERENCES:
3. The data stored in tables changes only infrequently.
a.
True
b.
False
ANSWER:
POINTS:
REFERENCES:
4. It is a good idea to use a SELECT command to display the data you changed to verify that the correct update was made.
a.
True
b.
False
ANSWER:
True
POINTS:
1
REFERENCES:
170
5. When necessary, include a WHERE clause into the UPDATE command to indicate the column on which the change is
to take place.
a.
True
b.
False
ANSWER:
POINTS:
REFERENCES:
6. To verify that the correct change was made to data in a table, use the DISPLAY command.
a.
True
b.
False
ANSWER:
POINTS:
REFERENCES:
7. You cannot use a compound condition with an UPDATE command.
a.
True
Chapter 6: Updating Data
Cengage Learning Testing, Powered by Cognero
Page 2
b.
False
ANSWER:
POINTS:
REFERENCES:
8. You can use the existing value in a column and a calculation to update a value.
a.
True
b.
False
ANSWER:
True
POINTS:
1
REFERENCES:
170
9. You use the APPEND command to add additional rows to tables.
a.
True
b.
False
ANSWER:
POINTS:
REFERENCES:
10. By default, Oracle commits each action query as soon as the user executes the query.
a.
True
b.
False
ANSWER:
True
POINTS:
1
REFERENCES:
173
11. Access does not support the COMMIT or ROLLBACK commands.
a.
True
b.
False
ANSWER:
True
POINTS:
1
REFERENCES:
173
12. If the Autocommit mode is turned off, you can cancel updates at any time during your current work session.
a.
True
b.
False
ANSWER:
True
POINTS:
1
REFERENCES:
173
13. Updates become permanent automatically when you exit from the DBMS.
a.
True
b.
False
ANSWER:
True
POINTS:
1
Cengage Learning Testing, Powered by Cognero
Page 4
20. In SQL Server, the word NULL appears in the results when a column contains a null value.
a.
True
b.
False
ANSWER:
True
POINTS:
1
REFERENCES:
179
21. In Oracle 11 g, a null value is displayed as a hyphen.
a.
True
b.
False
ANSWER:
True
POINTS:
1
REFERENCES:
178
22. To add a new column, use the ADD NEW COLUMN clause of the ALTER TABLE command.
a.
True
b.
False
ANSWER:
POINTS:
REFERENCES:
23. When you add a new column to a table, the default for Oracle, SQL Server, and Access is to accept null values.
a.
True
b.
False
ANSWER:
True
POINTS:
1
REFERENCES:
180
24. You cannot change the characteristics of existing columns.
a.
True
b.
False
ANSWER:
POINTS:
REFERENCES:
25. In Access, use the Documenter tool to show the layout of a table.
a.
True
b.
False
ANSWER:
True
POINTS:
1
REFERENCES:
182
26. In SQL Server, execute the sp_columns command to list all the columns in a table.
a.
True
b.
False
Chapter 6: Updating Data
Cengage Learning Testing, Powered by Cognero
Page 5
ANSWER:
True
POINTS:
1
REFERENCES:
182
27. If you decrease the size of a column, it is possible to lose some data currently in the column.
a.
True
b.
False
ANSWER:
True
POINTS:
1
REFERENCES:
183
28. You can increase the length of column but you cannot decrease the length of a column.
a.
True
b.
False
ANSWER:
POINTS:
REFERENCES:
29. In some cases, you might need to change a table’s structure in ways that are beyond the capabilities of your DBMS.
When that happens, use the RESTRUCTURE command to redesign the table.
a.
True
b.
False
ANSWER:
POINTS:
REFERENCES:
30. There are table structure changes that are beyond the capabilities of SQL.
a.
True
b.
False
ANSWER:
True
POINTS:
1
REFERENCES:
185
31. To permanently remove both a table and its data, you must issue both a DROP TABLE command and a DELETE
command.
a.
True
b.
False
ANSWER:
False
POINTS:
1
REFERENCES:
185/186
32. The DROP TABLE command creates an empty table.
a.
True
b.
False
ANSWER:
POINTS:
Chapter 6: Updating Data
Cengage Learning Testing, Powered by Cognero
Page 8
ANSWER:
d
POINTS:
1
REFERENCES:
173
43. The ____ command is permanent.
a.
SELECT
b.
COMMIT
c.
SAVE
d.
UPDATE
ANSWER:
b
POINTS:
1
REFERENCES:
173
44. A(n) ____ can be viewed as a sequence of steps that accomplishes a single task.
a.
procedure
b.
transaction
c.
program
d.
method
ANSWER:
b
POINTS:
1
REFERENCES:
173
45. To delete rows from the database, use the ____ command.
a.
ROLLBACK
b.
COMMIT
c.
DELETE
d.
UPDATE
ANSWER:
c
POINTS:
1
REFERENCES:
173
46. What happens if you run a DELETE command that does not contain a WHERE clause?
a.
The table will be deleted.
b.
All rows will be deleted from the table.
c.
All values would be replaced by nulls.
d.
None of the above.
ANSWER:
b
POINTS:
1
REFERENCES:
173
47. If you specified ____ for a column when you created a table, then changing a value in a column to null is prohibited.
a.
NOT NULL
b.
NULL
c.
CHAR
d.
NUMBER
Chapter 6: Updating Data
Cengage Learning Testing, Powered by Cognero
Page 9
ANSWER:
a
POINTS:
1
REFERENCES:
173
48. In Oracle, use the ____ command to display the structure of a table.
a.
SHOW TABLE
b.
SHOW LAYOUT
c.
DESCRIBE
d.
DISPLAY LAYOUT
ANSWER:
c
POINTS:
1
REFERENCES:
185
49. You can use the ____ clause of the ALTER TABLE command to change a column that currently rejects null values so
that it will accept null values.
a.
ADD
b.
MODIFY
c.
UPDATE
d.
NULL
ANSWER:
b
POINTS:
1
REFERENCES:
185
50. In SQL, use the ____ data type for variable-length character columns.
a.
TEXT
b.
VARCHAR
c.
VARIABLE
d.
CHARLENGTH
ANSWER:
b
POINTS:
1
REFERENCES:
185
51. You can use the ____ command to delete an entire table and its data.
a.
ROLLBACK
b.
DELETE TABLE
c.
DROP TABLE
d.
DELETE
ANSWER:
c
POINTS:
1
REFERENCES:
185
52. Which of the following is a valid SQL command?
a.
DROP TABLE LEVEL1_CUSTOMER;
b.
DROP LEVEL1_CUSTOMER;
c.
DELETE LEVEL1_CUSTOMER;
Chapter 6: Updating Data
Cengage Learning Testing, Powered by Cognero
Page 10
d.
All of the above
ANSWER:
a
POINTS:
1
REFERENCES:
186
53. By placing a(n) ____________________ command in an INSERT command, you can add the query results to a table.
ANSWER:
SELECT
POINTS:
1
REFERENCES:
168
54. The format for the UPDATE command is the word UPDATE, followed by the name of the table to be updated. The
next portion of the command consists of the word ____________________, followed by the name of the column to be
updated, an equals sign, and the new value.
ANSWER:
SET
POINTS:
1
REFERENCES:
170
55. During your current work session you can save your changes immediately by executing the ____________________
command.
ANSWER:
COMMIT
POINTS:
1
REFERENCES:
173
56. If you decide that you do not want to save the changes you have made during your current work session, you can
reverse the changes by executing the ____________________ command.
ANSWER:
ROLLBACK
POINTS:
1
REFERENCES:
173
57. The ROLLBACK command reverses changes made to the ____________________ only.
ANSWER:
data
POINTS:
1
REFERENCES:
173
58. To sort rows in a specific order, use the ____________________ clause with the desired sort key(s).
ANSWER:
ORDER BY
POINTS:
1
REFERENCES:
172
59. You use the ____________________ command to remove rows from a table.
ANSWER:
DELETE
POINTS:
1
REFERENCES:
174
60. A(n) ____________________ is a logical unit of work.
ANSWER:
transaction
POINTS:
1
69. In Oracle, use the ____________________ command to display the structure of a table.
ANSWER:
DESCRIBE
POINTS:
1
REFERENCES:
182
70. You can change the characteristics of existing columns by using the ____________________ clause of the ALTER
TABLE command.
ANSWER:
MODIFY
POINTS:
1
REFERENCES:
183
71. To change a column that currently rejects null values so that it accepts null vlaues, use the ____________________
clause in the ALTER TABLE command.
ANSWER:
MODIFY
POINTS:
1
REFERENCES:
185
72. You can delete a table that is no longer needed by using the ____________________ TABLE command.
ANSWER:
DROP
POINTS:
1
REFERENCES:
185
73. Describe the format for the UPDATE command.
ANSWER:
The format for the UPDATE command is the word UPDATE, followed by the name of the table to be
updated. The next portion of the command consists of the word SET, followed by the name of the
column to be updated, an equals sign, and the new value. When necessary, include a WHERE clause to
indicate the row(s) on which the change is to take place.
POINTS:
1
REFERENCES:
170
74. How can you use the COMMIT and ROLLBACK commands to support transactions?
ANSWER:
You can use the COMMIT and ROLLBACK commands to support transactions as follows:
Before beginning the updates for a transaction, commit any previous updates by executing the
COMMIT command.
Complete the updates for the transaction. If any update cannot be completed, execute the ROLLBACK
command and discontinue the updates for the current transaction.
If you can complete all updates successfully, execute the COMMIT command after completing the final
update.
POINTS:
1
REFERENCES:
174
75. Describe the format of the ALTER TABLE command to add a new column.