LAB_CHAPTER_5_QUIZ

24 July 2022
4.7 (114 reviews)
43 test answers

Unlock all answers in this set

Unlock answers (39)
question
Which of the following commands is used to add rows to a table?
answer
INSERT
question
Which of the following commands is used to modify existing data in a table?
answer
UPDATE
question
Which of the following commands is used to add data to an existing row in a table?
answer
UPDATE
question
Which command is used to prevent other users from making changes to a table?
answer
LOCK TABLE
question
Which of the following commands is used to remove rows from a table?
answer
DELETE
question
Which keyword permanently saves changed data in a table?
answer
COMMIT
question
Which keywords create a shared lock on a table to prevent another user from making changes to data in specified columns?
answer
SELECT...FOR UPDATE
question
Which of the following commands allows a user to "undo" uncommitted changes to data?
answer
ROLLBACK
question
Which of the following will allow a user to enter a NULL value using the INSERT command?
answer
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
question
Which of the following statements about the INSERT keyword is incorrect?
answer
Oracle11g does not allow column names to be omitted from the INSERT INTO clause.
question
When the INSERT command is being used to enter data into a non-numeric column, the data must be enclosed in ____
answer
single quotation marks
question
When data is being entered into a VARCHAR2 or CHAR column using the INSERT command, the data will be stored in
answer
the same case used in the INSERT command
question
Use the ____ keyword to enter the computer's date as a data value in the INSERT command.
answer
SYSTDATE
question
When inserting a row into a table, how can you indicate that a row contains a NULL value?
answer
In the VALUES clause, include the keyword NULL in the position where the value should be listed XX
question
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?
answer
VALUES
question
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?
answer
An error message is returned and the row is not added to the table.
question
Which of the following is not a valid SQL command?
answer
INSERT INTO acctmantable AS (SELECT amid, amname, amedate, region FROM acctmanager WHERE amedate <= SYSDATE);
question
If a table already exists, what command would you issue to add copies of existing rows from one table to the other?
answer
INSERT command with a subquery
question
The column to be updated by the UPDATE command is specified in the ____ clause.
answer
WHERE XX
question
The row(s) to be updated by the UPDATE command is specified by the ____ clause.
answer
SET XX
question
Which of the following clauses of the UPDATE command is optional?
answer
WHERE
question
If the ____ clause of the UPDATE command is omitted, then all the rows in the specified table will be changed.
answer
WHERE
question
Which of the following statements about the UPDATE command is incorrect?
answer
The mandatory WHERE clause identifies the specific row(s) to be changed by the UPDATE command.
question
Which of the following is not a valid SQL command?
answer
UPDATE acctmanager SET amname = UPPER(amname) WHERE amid = 'J500'; XX
question
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.
answer
SIBSTITUTION VARIABLE
question
Which of the following statements about substitution variables is incorrect?
answer
The command SET VERIFY OFF will delete all values stored in substitution variables.
question
When does a COMMIT command explicitly occur?
answer
When the user executes COMMIT;.
question
A user who is issuing DML commands can save modified data or undo uncommitted changes by issuing ____ statements.
answer
transaction control
question
When does a COMMIT command implicitly occur?
answer
When the user issues a DDL command such as CREATE or ALTER TABLE.
question
The effect of which of the following commands can never be reversed by the ROLLBACK command?
answer
CREATE TABLE ALTER TABLE COMMIT
question
Which of the following statements about the DELETE command is incorrect?
answer
If you omit the mandatory WHERE clause, an error message will be issued. XX
question
The ____ command will prevent two users from trying to make changes to the same table at the same time.
answer
LOCK TABLE
question
Which of the following types of locks permits other users access to unlocked portions of a table?
answer
SHARED LOCK
question
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).
answer
SELECT...FOR UPDATE
question
A(n) ____ lock will prevent any DDL operations from being performed on the locked table.
answer
Exclusive Lock
question
A lock arising from a SELECT...FOR UPDATE command will be released when
answer
a COMMIT command is executed
question
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?
answer
UPDATE promotion SET maxretail = 75 WHERE gift = 'FREE SHIPPING';
question
Which of the following SQL statements will insert a new row into the PROMOTION table?
answer
INSERT INTO promotion (gift, minretail, maxretail) VALUES ('FREE BOOK', 75.01, 89.99);
question
Which of the following commands will delete only publisher 4 from the PUBLISHER table?
answer
DELETE FROM publisher WHERE pubid = 4
question
Which of the following is a valid statement?
answer
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
question
Regarding the INSERT statement, which of the following is correct?
answer
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
question
Which of the following statements about COMMIT and ROLLBACK commands is incorrect?
answer
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
question
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?
answer
UPDATE publisher SET phone = '800-714-8321' WHERE pubid = 1;