LAB_CHAPTER_5_QUIZ
Which of the following commands is used to remove rows from a table?
DELETE
Which of the following commands will delete only publisher 4 from the PUBLISHER table?
DELETE FROM publisher WHERE pubid = 4
Which of the following statements about COMMIT and ROLLBACK commands is incorrect?
All DML commands (INSERT, UPDATE, DELETE) are explicitly committed and cannot be rolled back. All DDL commands (CREATE, TRUNCATE, ALTER TABLE) are explicitly committed and cannot be rolled back. A ROLLBACK command will reverse all DML operations performed since the last COMMIT was performed. *all of the above
What will happen if you try to use the INSERT command to insert a NULL value into a column that has been assigned a PRIMARY KEY constraint?
An error message is returned and the row is not added to the table.
Which keyword permanently saves changed data in a table?
COMMIT
The effect of which of the following commands can never be reversed by the ROLLBACK command?
CREATE TABLE ALTER TABLE COMMIT
A(n) ____ lock will prevent any DDL operations from being performed on the locked table.
Exclusive Lock
Which of the following commands is used to add rows to a table?
INSERT
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. XX
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 XX
The ____ command will prevent two users from trying to make changes to the same table at the same time.
LOCK TABLE
Which command is used to prevent other users from making changes to a table?
LOCK TABLE
Regarding the INSERT statement, which of the following is correct?
Non-numeric data is enclosed in single quotation marks. Column names are enclosed in parentheses ( ). The data values to be inserted are enclosed in parentheses ( ) after the VALUES keyword. * all of the above XX
Which of the following will allow a user to enter a NULL value using the INSERT command?
Omit the column from the column list in the INSERT INTO clause. Substitute two single quotation marks in the VALUES clause in the position of the column that is to be assigned the NULL value. Use the NULL keyword. *all of the above
Which of the following statements about the INSERT keyword is incorrect?
Oracle11g does not allow column names to be omitted from the INSERT INTO clause.
Which of the following commands allows a user to "undo" uncommitted changes to data?
ROLLBACK
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
Which keywords create a shared lock on a table to prevent another user from making changes to data in specified columns?
SELECT...FOR UPDATE
The row(s) to be updated by the UPDATE command is specified by the ____ clause.
SET XX
Which of the following types of locks permits other users access to unlocked portions of a table?
SHARED LOCK
A(n) ____ in a SQL command instructs Oracle11g to use a substituted value in place of the variable at the time the command is actually executed.
SIBSTITUTION VARIABLE
Use the ____ keyword to enter the computer's date as a data value in the INSERT command.
SYSTDATE
Which of the following statements about substitution variables is incorrect?
The command SET VERIFY OFF will delete all values stored in substitution variables.
Which of the following statements about the UPDATE command is incorrect?
The mandatory WHERE clause identifies the specific row(s) to be changed by the UPDATE command.
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 promotion SET maxretail = 75 WHERE gift = 'FREE SHIPPING';
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 not a valid SQL command?
UPDATE acctmanager SET amname = UPPER(amname) WHERE amid = 'J500'; XX
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 keywords is omitted from the INSERT command if the data to be added to a table is already contained in another table?
VALUES
If the ____ clause of the UPDATE command is omitted, then all the rows in the specified table will be changed.
WHERE
Which of the following clauses of the UPDATE command is optional?
WHERE
The column to be updated by the UPDATE command is specified in the ____ clause.
WHERE XX
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 explicitly occur?
When the user executes COMMIT;.
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
When the INSERT command is being used to enter data into a non-numeric column, the data must be enclosed in ____
single quotation marks
When data is being entered into a VARCHAR2 or CHAR column using the INSERT command, the data will be stored in
the same case used in the INSERT command
A user who is issuing DML commands can save modified data or undo uncommitted changes by issuing ____ statements.
transaction control