Database Programming With SQL 15-2: DML Operations and Views Practice Activities
Database Programming With SQL 15-2: DML Operations and Views Practice Activities
Database Programming With SQL 15-2: DML Operations and Views Practice Activities
Vocabulary
Identify the vocabulary word for each definition below.
Try It / Solve It
Use the DESCRIBE statement to verify that you have tables named copy_d_songs, copy_d_events,
copy_d_cds, and copy_d_clients in your schema. If you don't, write a query to create a copy of each.
1. Query the data dictionary USER_UPDATABLE_COLUMNS to make sure the columns in the base
tables will allow UPDATE, INSERT, or DELETE. Use a SELECT statement or the Browse Data
Dictionary feature in HTML DB. All table names in the data dictionary are stored in uppercase.
2. Use the CREATE or REPLACE option to create a view of all the columns in the copy_d_songs
table called view_copy_d_songs.
Copyright © 2020, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.
3. Use view_copy_d_songs to INSERT the following data into the underlying copy_d_songs table.
Execute a SELECT * from copy_d_songs to verify your DML command. See the graphic.
4. Create a view based on the DJs on Demand COPY_D_CDS table. Name the view
read_copy_d_cds. Select all columns to be included in the view. Add a WHERE clause to restrict
the year to 2000. Add the WITH READ ONLY option.
6. Use REPLACE to modify read_copy_d_cds. Replace the READ ONLY option with WITH CHECK
OPTION CONSTRAINT ck_read_copy_d_cds. Execute a SELECT * statement to verify that the
view exists.
7. Use the read_copy_d_cds view to delete any CD of year 2000 from the underlying copy_d_cds.
8. Use the read_copy_d_cds view to delete cd_number 90 from the underlying copy_d_cds table.
10. Execute a SELECT * statement for the base table copy_d_cds. What rows were deleted?
12. What is Moore’s Law? Do you consider that it will continue to apply indefinitely? Support your
opinion with research from the internet.
Copyright © 2020, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.