Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Database SQL Hands-on Assignments To perform the following assignments, refer to

ID: 3827009 • Letter: D

Question

Database SQL Hands-on Assignments To perform the following assignments, refer to the tables in the JustLee Books database. 1. Create a view that lists the name and phone number of the contact person at each publisher. Don't include the publishers 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 HOMEWORK 13 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. 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. 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? lf so, what was the cause of the error message?

Explanation / Answer

Solution:

1)

CREATE VIEW [Contact] AS

SELECT Name, Phone FROM PUBLISHER WHERE 1

2)

CREATE OR REPLACE VIEW [Contact] AS
SELECT Name FROM PUBLISHER WHERE 1

3)

CREATE VIEW [Homework13] AS

IF NOT EXISTS (SELECT * FROM sysobjects WHERE Col1='abc' and Col2=xyz')

I hope this helps. Don't forget to give a thumbs up if you like this.