Description
Lab #8: Insert data from queries
Learn how to use an INSERT
statement with a query of other data and an embedded sequence value. Reinforce how to alter a table’s column to add a NOT NULL
constraint, update a column with a correlated UPDATE
statement, learn how to use a correlated UPDATE
statement to set an initial value in a newly added column.
- Lab
- Description
- Help Section
- Instructions
Lab Description
You learn how to match the SELECT
-list sequence of values to the column-list of the price table. You re-enforce how to change a null allowed column into a NOT NULL
allowed column by adding a column constraint. You re-enforce a skill learned in the prior lab by using a correlated UPDATE
statement to populate a newly added column with correct values.
The lab has four parts, which you find after clicking on the Lab Instructions link. The steps are:
- Step 1: Write an
INSERT
statement that uses a modified form of theSELECT
statement that you developed in Lab #7. - Step 2: Change a nullable
price_type
column in theprice
table to a mandatory column. - Step 3: Use a correlated
UPDATE
statement to populate the correct values for a newly added column and master how to use theBETWEEN
operator. - Step 4: Change a nullable
rental_item_price
column in therental_item
table to a mandatory column.