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

Database SQL To perform the following assignments, refer to the tables in the Ju

ID: 3827019 • Letter: D

Question

Database SQL To perform the following assignments, refer to the tables in the JustLee Books database. Create a view that lists the name and phone number of the contact person at each publisher. Don't include the publisher's ID in the view. Name the view CONTACT. Change the CONTACT view so that no users can accidentally perform DML operations on the view. 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. Attempt to view the structure of the HOMEWORK13 view. 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.

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.