Practice Problems

Practice Problems: Views
1. Create a view that lists the name and phone number of the contact person for each publisher.
Don’t include the publisher’s ID in the view. Name the view CONTACT.
2. Change the CONTACT view so that no users can accidentally perform DML operations on the
view.
3. Create a view called HOMEWORK13 that includes the columns named Col1 and Col2 from the
FIRSTATTEMPT table. Make sure the view is created even if the FIRSTATTEMPT table doesn’t
exist.
This study source was downloaded by 100000757387545 from CourseHero.com on 03-02-2023 23:48:38 GMT -06:00
https://www.coursehero.com/file/167669181/M7-2-Practice-Problemsdocx/

4. Attempt to view the structure of the HOMEWORK13 view.
5. Create a view that lists the ISBN and title for each book in inventory along with the name and
phone number of the person to contact if the book needs to be reordered. Name the view
REORDERINFO.
This study source was downloaded by 100000757387545 from CourseHero.com on 03-02-2023 23:48:38 GMT -06:00
https://www.coursehero.com/file/167669181/M7-2-Practice-Problemsdocx/

6. Try to change the name of a contact person in the REORDERINFO view to your name. Was an
error message displayed when performing this step? If so, what was the cause of the error
message?
The column which is trying to modify maps to a non key preserved table and needs to be given the
correct type to view.
7. Select one of the books in the REORDERINFO view and try to change it’s ISBN. Was an error
message displayed when performing this step? If so, what was the cause of the error message?
This study source was downloaded by 100000757387545 from CourseHero.com on 03-02-2023 23:48:38 GMT -06:00
https://www.coursehero.com/file/167669181/M7-2-Practice-Problemsdocx/

Since ISBN is a foreign key the changes are applied because it is not properly reserved.
8. Delete the record in the REORDERINFO view containing your name (If you weren’t able to
perform #6 successfully, delete one of the contacts already listed in the table.) Was an error
message displayed when performing this step? If so, what was the cause of the error message?
Foreign key constraints have been violent hence the this error occurred.
9. Issue a rollback command to undo any changes made with the preceding DML operations.
This study source was downloaded by 100000757387545 from CourseHero.com on 03-02-2023 23:48:38 GMT -06:00
https://www.coursehero.com/file/167669181/M7-2-Practice-Problemsdocx/

10. Delete the REORDERINFO view.
Practice Problems: Additional Database Objects
This study source was downloaded by 100000757387545 from CourseHero.com on 03-02-2023 23:48:38 GMT -06:00
https://www.coursehero.com/file/167669181/M7-2-Practice-Problemsdocx/

1. Create a sequence for populating the Customer# column of the CUSTOMERS table. When
setting the start and increment values, keep in mind that data already exists in this table. The
options should be set to not cycle the values and not cache any values, and no minimum or
maximum values should be declared.
2. Add a new customer row by using the sequence created in Question 1. The only data currently
available for the customer is as follows: last name = Shoulders, first name = Frank, and zip =
23567.
This study source was downloaded by 100000757387545 from CourseHero.com on 03-02-2023 23:48:38 GMT -06:00
https://www.coursehero.com/file/167669181/M7-2-Practice-Problemsdocx/

3. Create a sequence that generates integers starting with the value 5. Each value should be three
less than the previous value generated. The lowest possible value should be 0, and the sequence
shouldn’t be allowed to cycle. Name the sequence MY_FIRST_SEQ.
4. Issue a SELECT statement that displays NEXTVAL for MY_FIRST_SEQ three times. Because
the value isn’t being placed in a table, use the DUAL table in the FROM clause of the SELECT
statement. What causes the error on the third SELECT?
This study source was downloaded by 100000757387545 from CourseHero.com on 03-02-2023 23:48:38 GMT -06:00
https://www.coursehero.com/file/167669181/M7-2-Practice-Problemsdocx/

5. Change the setting of MY_FIRST_SEQ so that the minimum value that can be generated is –
1000.
This study source was downloaded by 100000757387545 from CourseHero.com on 03-02-2023 23:48:38 GMT -06:00
https://www.coursehero.com/file/167669181/M7-2-Practice-Problemsdocx/

This study source was downloaded by 100000757387545 from CourseHero.com on 03-02-2023 23:48:38 GMT -06:00
https://www.coursehero.com/file/167669181/M7-2-Practice-Problemsdocx/
Powered by TCPDF (www.tcpdf.org)

GET HELP WITH YOUR HOMEWORK PAPERS @ 25% OFF

For faster services, inquiry about  new assignments submission or  follow ups on your assignments please text us/call us on +1 (251) 265-5102

Write My Paper Button

WeCreativez WhatsApp Support
We are here to answer your questions. Ask us anything!
👋 Hi, how can I help?
Scroll to Top