Deck 6: Updating Data

Full screen (f)
exit full mode
Question
The DROP TABLE command creates an empty table.
Use Space or
up arrow
down arrow
to flip the card.
Question
MySQL does not support the COMMIT or ROLLBACK commands.
Question
MySQL allows you to reduce the size of a column.
Question
One of the nicest features of a relational DBMS, such as MySQL, is the ease with which you can change table structures.
Question
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.
Question
You cannot change the characteristics of existing columns.
Question
You can use the ROLLBACK command to return the column length to its original state.
Question
If you decrease the size of a column, it is possible to lose some data currently in the column.
Question
If you specify NOT NULL for a column when you create a table, you are prohibited from changing a value in the column to null.
Question
In a transaction, it is acceptable if some steps fail.
Question
The command for changing a value to null is the same for changing any other value.
Question
You can cancel updates at any time during your current work session.
Question
You cannot use the INSERT command to update table data.
Question
When you update the data in a table, your updates are always permanent.
Question
The ROLLBACK command reverses changes made to a table's structure.
Question
You can use REMOVE ROW to remove a row from a table.
Question
The NULL value should be enclosed in single quotation marks.
Question
In some cases, when you update the data in a table, you can reverse (cancel)them at any time during your current work session.
Question
You cannot use a compound condition to update a row.
Question
MySQL does not allow you to change the size of DECIMAL columns.
Question
If you have verified that the update you made is correct, you can use the ____ command to make the update permanent.

A)UPDATE
B)ROLL
C)COMMIT
D)SAVE
Question
In order to use the COMMIT command in MySQL, you need to change the value for AUTOCOMMIT to ____.

A)0
B)1
C)YES
D)NO
Question
When necessary, include a WHERE clause into the UPDATE command to indicate the column on which the change is to take place.
Question
In MySQL, use the ____ data type for variable-length character columns.

A)TEXT
B)VARCHAR
C)VARIABLE
D)CHARLENGTH
Question
When you use the CREATE TABLE command with the word LIKE to create a new table from an existing table, the new table has the same data as the original table.
Question
A(n)____ can be viewed as a sequence of steps that accomplishes a single task.

A)procedure
B)transaction
C)program
D)method
Question
In order to use the ROLLBACK commands in MySQL, you need to change the value for ____ to 0.

A)AUTOROLL
B)AUTOCOMMIT
C)AUTOROLLBACK
D)ENABLE
Question
In MySQL, use the ____ command to show the revised structure of a table.

A)DESCRIBE COLUMNS
B)DISPLAY DATA
C)DISPLAY COLUMNS
D)SHOW COLUMNS
Question
There are table structure changes that are beyond the capabilities of MySQL.
Question
You must execute the SET AUTOCOMMIT = 0; command once at the beginning of a session and once at the end of the session if you want to use the COMMIT and ROLLBACK commands.
Question
It is possible to use calculations to update a value in a column.
Question
The command, CREATE TABLE AS LEVEL1_CUSTOMER FROM CUSTOMER; creates a table called LEVEL1_CUSTOMER that has the same structure as CUSTOMER.
Question
If you have not run the COMMIT command, executing the ____ command will reverse all updates made during the current work session.

A)UPDATE
B)REVERSE
C)ROLLBACK
D)ROLL
Question
To add a new column, use the ADD COLUMN clause of the ALTER TABLE command.
Question
To verify that the correct change was made to data in a table, use the DISPLAY command.
Question
The data stored in tables is subject to constant change.
Question
To permanently remove both a table and its data, you must issue both a DROP TABLE command and a DELETE command.
Question
You can increase the length of a column but you cannot decrease the length of a column.
Question
To delete data from the database, use the ____ command.

A)ROLLBACK
B)COMMIT
C)DELETE
D)UPDATE
Question
Updates become permanent automatically when you exit from MySQL.
Question
The UPDATE command contains the word ____________________, followed by the name of the column to be updated, an equals sign, and the new value.
Question
By placing a(n)____________________ command in an INSERT command, you can add the query results to a table.
Question
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.
Question
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
Question
If you specified ____________________ for the column when you created the table, then changing a value in a column to null is prohibited.
Question
To change a column that currently rejects null values so that it accepts null values, use the ____ clause of the ALTER TABLE command

A)ACCEPT NULLS
B)MODIFY
C)ADD NULLS
D)CREATE
Question
You use the ____________________ command to remove rows from a table.
Question
A(n)____________________ is a logical unit of work.
Question
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.
Question
To make the same update for all rows in a table, omit the ____ clause.

A)SET
B)UPDATE
C)WHERE
D)ALTER
Question
With SQL, you can change a table's structure by using the ____________________ command.
Question
Which of the following is a valid SQL command?

A)DROP TABLE LEVEL1_CUSTOMER;
B)DROP LEVEL1_CUSTOMER;
C)DELETE LEVEL1_CUSTOMER;
D)All of the above
Question
During your current work session you can save your changes immediately by executing the ____________________ command.
Question
You can use the ____ command to create a new table using data in an existing table.

A)CREATE TABLE
B)NEW TABLE
C)UPDATE
D)ALTER TABLE
Question
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
Question
The ____ command is permanent.

A)SELECT
B)COMMIT
C)SAVE
D)UPDATE
Question
You can use the ____ command to delete an entire table and its data.

A)ROLLBACK
B)DELETE TABLE
C)DROP TABLE
D)DELETE
Question
Which of the following is a valid SQL command?

A)COMMIT TABLE;
B)COMMIT CHANGES;
C)COMMIT DB;
D)COMMIT;
Question
Which of the following commands executes a rollback?

A)ROLLBACK TABLE;
B)ROLLBACK;
C)ROLLBACK ALL;
D)ROLLBACK DB;
Question
In MySQL, use the ____ command to show the layout of a table.

A)SHOW TABLE
B)SHOW ROWS
C)SHOW COLUMNS
D)SHOW LAYOUT
Question
To add a new column, use the ____________________ clause of the ALTER TABLE command.
Question
You can delete a table that is no longer needed by using the ____________________ TABLE command.
Question
The ADD clause consists of the word ADD followed by the name of the ____________________ to be added, followed by the characteristics.
Question
In MySQL, use the ____________________ command to show the layout of a table.
Question
In a transaction, if any update cannot be completed, execute the ____________________ command and discontinue the updates for the current transaction.
Question
The format for the ALTER TABLE command is the words ALTER TABLE followed by the name of the ____________________ to be altered, followed by an appropriate clause.
Question
Before beginning the updates for a transaction, commit any previous updates by executing the ____________________ command.
Question
You can change the characteristics of existing columns by using the ____________________ clause of the ALTER TABLE command.
Question
To sort rows in a specific order, use the ____________________ clause with the desired sort key(s).
Question
Describe the format of the ALTER TABLE command to add a new column.
Question
The ROLLBACK command reverses changes made to the ____________________ only.
Question
In a transaction, if you can complete all updates successfully, execute the ____________________ command after completing the final update.
Question
Describe the format for the UPDATE command.
Question
How can you use the COMMIT and ROLLBACK commands to support transactions?
Question
The command CREATE TABLE LEVEL1_CUSTOMER ____________________ CUSTOMER; creates a new table from an existing table.
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 6: Updating Data
1
The DROP TABLE command creates an empty table.
False
2
MySQL does not support the COMMIT or ROLLBACK commands.
False
3
MySQL allows you to reduce the size of a column.
True
4
One of the nicest features of a relational DBMS, such as MySQL, is the ease with which you can change table structures.
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
5
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.
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
6
You cannot change the characteristics of existing columns.
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
7
You can use the ROLLBACK command to return the column length to its original state.
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
8
If you decrease the size of a column, it is possible to lose some data currently in the column.
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
9
If you specify NOT NULL for a column when you create a table, you are prohibited from changing a value in the column to null.
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
10
In a transaction, it is acceptable if some steps fail.
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
11
The command for changing a value to null is the same for changing any other value.
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
12
You can cancel updates at any time during your current work session.
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
13
You cannot use the INSERT command to update table data.
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
14
When you update the data in a table, your updates are always permanent.
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
15
The ROLLBACK command reverses changes made to a table's structure.
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
16
You can use REMOVE ROW to remove a row from a table.
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
17
The NULL value should be enclosed in single quotation marks.
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
18
In some cases, when you update the data in a table, you can reverse (cancel)them at any time during your current work session.
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
19
You cannot use a compound condition to update a row.
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
20
MySQL does not allow you to change the size of DECIMAL columns.
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
21
If you have verified that the update you made is correct, you can use the ____ command to make the update permanent.

A)UPDATE
B)ROLL
C)COMMIT
D)SAVE
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
22
In order to use the COMMIT command in MySQL, you need to change the value for AUTOCOMMIT to ____.

A)0
B)1
C)YES
D)NO
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
23
When necessary, include a WHERE clause into the UPDATE command to indicate the column on which the change is to take place.
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
24
In MySQL, use the ____ data type for variable-length character columns.

A)TEXT
B)VARCHAR
C)VARIABLE
D)CHARLENGTH
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
25
When you use the CREATE TABLE command with the word LIKE to create a new table from an existing table, the new table has the same data as the original table.
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
26
A(n)____ can be viewed as a sequence of steps that accomplishes a single task.

A)procedure
B)transaction
C)program
D)method
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
27
In order to use the ROLLBACK commands in MySQL, you need to change the value for ____ to 0.

A)AUTOROLL
B)AUTOCOMMIT
C)AUTOROLLBACK
D)ENABLE
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
28
In MySQL, use the ____ command to show the revised structure of a table.

A)DESCRIBE COLUMNS
B)DISPLAY DATA
C)DISPLAY COLUMNS
D)SHOW COLUMNS
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
29
There are table structure changes that are beyond the capabilities of MySQL.
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
30
You must execute the SET AUTOCOMMIT = 0; command once at the beginning of a session and once at the end of the session if you want to use the COMMIT and ROLLBACK commands.
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
31
It is possible to use calculations to update a value in a column.
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
32
The command, CREATE TABLE AS LEVEL1_CUSTOMER FROM CUSTOMER; creates a table called LEVEL1_CUSTOMER that has the same structure as CUSTOMER.
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
33
If you have not run the COMMIT command, executing the ____ command will reverse all updates made during the current work session.

A)UPDATE
B)REVERSE
C)ROLLBACK
D)ROLL
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
34
To add a new column, use the ADD COLUMN clause of the ALTER TABLE command.
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
35
To verify that the correct change was made to data in a table, use the DISPLAY command.
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
36
The data stored in tables is subject to constant change.
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
37
To permanently remove both a table and its data, you must issue both a DROP TABLE command and a DELETE command.
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
38
You can increase the length of a column but you cannot decrease the length of a column.
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
39
To delete data from the database, use the ____ command.

A)ROLLBACK
B)COMMIT
C)DELETE
D)UPDATE
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
40
Updates become permanent automatically when you exit from MySQL.
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
41
The UPDATE command contains the word ____________________, followed by the name of the column to be updated, an equals sign, and the new value.
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
42
By placing a(n)____________________ command in an INSERT command, you can add the query results to a table.
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
43
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.
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
44
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
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
45
If you specified ____________________ for the column when you created the table, then changing a value in a column to null is prohibited.
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
46
To change a column that currently rejects null values so that it accepts null values, use the ____ clause of the ALTER TABLE command

A)ACCEPT NULLS
B)MODIFY
C)ADD NULLS
D)CREATE
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
47
You use the ____________________ command to remove rows from a table.
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
48
A(n)____________________ is a logical unit of work.
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
49
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.
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
50
To make the same update for all rows in a table, omit the ____ clause.

A)SET
B)UPDATE
C)WHERE
D)ALTER
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
51
With SQL, you can change a table's structure by using the ____________________ command.
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
52
Which of the following is a valid SQL command?

A)DROP TABLE LEVEL1_CUSTOMER;
B)DROP LEVEL1_CUSTOMER;
C)DELETE LEVEL1_CUSTOMER;
D)All of the above
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
53
During your current work session you can save your changes immediately by executing the ____________________ command.
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
54
You can use the ____ command to create a new table using data in an existing table.

A)CREATE TABLE
B)NEW TABLE
C)UPDATE
D)ALTER TABLE
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
55
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
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
56
The ____ command is permanent.

A)SELECT
B)COMMIT
C)SAVE
D)UPDATE
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
57
You can use the ____ command to delete an entire table and its data.

A)ROLLBACK
B)DELETE TABLE
C)DROP TABLE
D)DELETE
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
58
Which of the following is a valid SQL command?

A)COMMIT TABLE;
B)COMMIT CHANGES;
C)COMMIT DB;
D)COMMIT;
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
59
Which of the following commands executes a rollback?

A)ROLLBACK TABLE;
B)ROLLBACK;
C)ROLLBACK ALL;
D)ROLLBACK DB;
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
60
In MySQL, use the ____ command to show the layout of a table.

A)SHOW TABLE
B)SHOW ROWS
C)SHOW COLUMNS
D)SHOW LAYOUT
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
61
To add a new column, use the ____________________ clause of the ALTER TABLE command.
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
62
You can delete a table that is no longer needed by using the ____________________ TABLE command.
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
63
The ADD clause consists of the word ADD followed by the name of the ____________________ to be added, followed by the characteristics.
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
64
In MySQL, use the ____________________ command to show the layout of a table.
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
65
In a transaction, if any update cannot be completed, execute the ____________________ command and discontinue the updates for the current transaction.
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
66
The format for the ALTER TABLE command is the words ALTER TABLE followed by the name of the ____________________ to be altered, followed by an appropriate clause.
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
67
Before beginning the updates for a transaction, commit any previous updates by executing the ____________________ command.
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
68
You can change the characteristics of existing columns by using the ____________________ clause of the ALTER TABLE command.
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
69
To sort rows in a specific order, use the ____________________ clause with the desired sort key(s).
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
70
Describe the format of the ALTER TABLE command to add a new column.
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
71
The ROLLBACK command reverses changes made to the ____________________ only.
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
72
In a transaction, if you can complete all updates successfully, execute the ____________________ command after completing the final update.
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
73
Describe the format for the UPDATE command.
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
74
How can you use the COMMIT and ROLLBACK commands to support transactions?
Unlock Deck
Unlock for access to all 75 flashcards in this deck.
Unlock Deck
k this deck
75
The command CREATE TABLE LEVEL1_CUSTOMER ____________________ CUSTOMER; creates a new table from an existing table.
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.