Shared Flashcard Set

Details

Data manipulation
insert, delete, update
28
Other
Not Applicable
05/16/2005

Additional Other Flashcards

 


 

Cards

Term
What is the format for an INSERT command?
Definition
INSERT INTO [(columname,...)]
VALUES (datavalue, ...);
Term
When can column headings be omitted in an INSERT commmand?
Definition
If the data entered in the VALUES clause are in the same order as the comumns in the table.
Term
When must you include the column names from an INSERT INTO commmand?
Definition
If youu only enter data for some of the columns, or if the columns are listed in a different order than they are listed in the table.
Term
How must a number that is defined as 'non-numeric' be inserted into a column?
Definition
It must be encosed in a single quotation marks if the column's datatype is not NUMBER!
Term
What error report is given if non-numeric columns are not enclosed in single quotation marks?
Definition
qoted string not properly terminated.
Term
What three approaches can be taken to enter NULL values when a row is added to a table?
Definition
1. List all the columns except the missing colun in the INSERT INTO cluase, and provide the data for the listed columns in the VALUES clause.
2. In the VALUES clause, insert two single quotation marks. Oracle9i will interpret the quotation marks to mean that a NULL value should be stored in the column.
3. In the VALUES clause, include the keyword NULL in the position.
Term
When inserting a NULL value, what will Oracle9i interpret it to mean if NULL is enclosed in single quotation marks?
Definition
It will try to store the word NULL in the column. (As a literal value)
Term
What is the syntax for combining an INSERT INTO command with a subquery?
Definition
INSERT INTO tablename [(columname, ...)]
subquery;
Term
What is the main difference between inserting data into using the INSERT INTO command with actual data and a wubquery?
Definition
The VALUES clause is not included when the commmand is used with a subquery.
Term
Does the INSERT INTO command require the subquery to be enclosed within a set of parenthes?
Definition
NO. Although including the parentheses will not generate an error.
Term
What is the syntax for an UPDATE commmand?
Definition
UPDATE tablename
SET columname = new_datavalue
[WHERE condition);
Term
what does the SET clause identify?
Definition
The column to be changed and the new value to be assigned to that column.
Term
What does the optional WHERE clause in an UPDATE command identify?
Definition
The exact row to be changed by the UPDAE command.
Term
What happens if the WHERE clause is omitted from the the UPDATE command?
Definition
The column specified in the SET clause will be updated for all records contained in the table.
Term
What SQL command instructs Oracle9i to use a substituted value in place of the variable at the time the command is actually executed?
Definition
A substitution variable.
Term
What must be entered to include a substitution variable in a SQL commmand?
Definition
Enter an ampersaned(&) followed by the name to be used for the variable in the necessaryl location.
Term
Can usere view any changes you have made if you have not permanenty saved the table/
Definition
No
Term
What is an explicit commit
Definition
occurs when the command is explicitly issued by entering COMMIT.
Term
What is an implicit COMMIT?
Definition
Why the user exits the system by issuing the EXIT command. It also occus if a DDL command, such as CREATE or ALTER TABLE is issued.
Term
When can a ROLLBACK command be used?
Definition
When a COMMIT has not occured either explicity or implicitly.
Term
What type of commands can use the ROLLBACK with?
Definition
DML commands.. Comands such as CREATE TABLE, TRUNCATE TABLE, and ALTER TABLE cannot be rolled back baecause they are DDL commands and a COMMIT occurs automaticaly when they are executed.
Term
What is the syntax for a DELETE ROW?
Definition
DELETE FROM tablename
[WHERE condition];
Term
Why does the DELETE command not allow the user to specify any column names?
Definition
Because DELETE applies to an entire row and cannot be appied to spsecific columns with a row.
Term
If youu omit the WHERE clause in a DELETE statement what will happen?
Definition
All rows will be deleted from the specified table.
Term
What is a table lock?
Definition
When DML commands are issued, Oracle9i implicityl "locks" the row or rows being affect so no other user can change the same row(s).
Term
What does the term 'shared lock' mean?
Definition
Other users can still view the data stored in the table, but it prevents anyone from altering the structure of the table or performaing other types of DDL operations.
Term
Locks will be automatically released under which conditions?
Definition
If the user issues a trasaction control statement, such as ROLLBACK or COMMIT, or if the user exits the system.
Term
What is the syntax for a SELECT....FOR UPDATE?
Definition
SELECT columnname,...
FROM tablename,
[WHERE condition]
FOR UDPDATE;
Supporting users have an ad free experience!