Chapter 5 sql
Which of the following will allow a user to enter a NULL value using the INSERT command?
All of the above
Which of the following commands will delete only publisher 4 from the PUBLISHER table?
DELETE FROM publisher WHERE pubid = 4;
Which of the following commands is used to remove rows from a table?
Delete
If data is only being added to some of the columns in a table, the names of the columns must be listed in the VALUES clause.
False
The MODIFY command can be used to change existing data stored in a table.
False
The ROLLBACK command is used to permanently save changed data.
False
The SYSDATE keyword cannot be included in the INSERT command, only the UPDATE command.
False
Which of the following is not a valid SQL command?
INSERT INTO acctmantable AS (SELECT amid, amname, amedate, region FROM acctmanager WHERE amedate <= SYSDATE);
Which of the following SQL statements will insert a new row into the PROMOTION table?
INSERT INTO promotion (gift, minretail, maxretail)VALUES (FREE BOOK, 75.01, 89.99);
If a table already exists, what command would you issue to add copies of existing rows from one table to the other?
INSERT command with a subquery
Which of the following statements about the DELETE command is incorrect?
If you omit the mandatory WHERE clause, an error message will be issued.
When inserting a row into a table, how can you indicate that a row contains a NULL value?
In the VALUES clause, include the keyword NULL in the position where the value should be listed.
Which of the following commands is used to add rows to a table?
Insert
Regarding the INSERT statement, which of the following is correct?
Non-numeric data is enclosed in single quotation marks.
Which of the following commands allows a user to "undo" uncommitted changes to data?
Rollback
The row(s) to be updated by the UPDATE command is specified by the ____ clause.
SET
The ____ command can be used to view the contents of a record when it is anticipated that the record will need to be modified. It places a shared lock on the record(s) to be changed and prevents any other user from acquiring a lock on the same record(s).
Select for update
The column to be updated by the UPDATE command is specified in the ____ clause.
Set
Use the ____ keyword to enter the computer's date as a data value in the INSERT command.
Sysdate
A shared lock is automatically obtained when the SELECT...FOR UPDATE command is executed.
True
A transaction is defined as the set of statements that are committed at one time.
True
Data that is being added to a table is specified in the VALUES clause of the INSERT command.
True
The DROP command can be used to remove rows from an existing table.
True
The LOCK TABLE command can be used to prevent other users from making changes to a table.
True
The VALUES clause is not included with the INSERT command if the data is being retrieved from another table.
True
Transaction control statements are used to either save modified data or to undo changes before they are committed.
True
When Oracle11 g encounters a substitution variable, the user will be prompted for the actual value to be assigned to the variable.
True
Based on the contents of the PROMOTION table, which of the following will correctly change the value assigned to the MAXRETAIL column for Free Shipping to 75.00?
UPDATE promotionSET maxretail = 75WHERE gift = 'FREE SHIPPING';
Based on the contents of the PUBLISHER table, which of the following SQL statements will change the phone number for Printing Is Us to 800-714-8321?
UPDATE publisher SET phone = '800-714-8321'WHERE pubid = 1;
Which of the following commands is used to add data to an existing row in a table?
Update
Which of the following commands is used to modify existing data in a table?
Update
Which of the following is a valid statement?
When rows are added to a table, the column names can be omitted if the values are listed in the same order as the columns are listed in the table.
When does a COMMIT command implicitly occur?
When the user issues a DDL command such as CREATE or ALTER TABLE.
A lock arising from a SELECT...FOR UPDATE command will be released when ____.
a COMMIT command is executed
Commands used to modify data are called ____ commands.
data manipulation language (DML)
When the INSERT command is being used to enter data into a non-numeric column, the data must be enclosed in ____.
single quotation marks