Description
Lab #6: SQL UPDATE
Statement
Learn how to use ALTER TABLE
and UPDATE
statements to modify an existing table with data already inserted into the table.
- Lab
- Description
- Help Section
- Instructions
Lab Description
The lab requires you modify scripts that create and unit test ten tables. The integration script calls the ten unit test programs, which you can find in the following directory:
/home/student/Data/cit225/oracle/lib1 |
The lab has four parts, which you find after clicking on the Lab Instructions link. The steps are:
- Step 1: Add the
RENTAL_ITEM_PRICE
andRENTAL_ITEM_TYPE
columns to theRENTAL_ITEM
table.. - Step 2: Create the
PRICE
table as per the specification qualified in the lab. - Step 3: Contains four steps:
- Rename the
ITEM_RELEASE_DATE
column as theRELEASE_DATE
column; - Insert three new rows in the
ITEM
table; - Insert a new member account with three contacts;
- Insert two rows into the
RENTAL
table with a dependent row for each row in theRENTAL_ITEM
table; and - Insert one row into the
RENTAL
table with two dependent rows in theRENTAL_ITEM
table.
- Rename the
- Step 4: Contains four steps:
- Drop the
COMMON_LOOKUP_N1
andCOMMON_LOOKUP_U2
indexes; - Add three new columns to the
COMMON_LOOKUP
table; - Migrate the
COMMON_LOOKUP_CONTEXT
column values; - Use an
INSERT
statement to add two rows for theTELEPHONE
table’s lookup values to theCOMMON_LOOKUP
table; - Use the
ALTER TABLE
orCREATE INDEX
statements against theCOMMON_LOOKUP
table to cleanup the table structure, addNOT NULL
constraints, and add aUNIQUE INDEX
on theCOMMON_LOOKUP
table; and - Use an
UPDATE
statement to change theTELEPHONE_TYPE
column values in theTELEPHONE
table.
- Drop the