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

Debug the following View SQL Statement. Use the Virtual Machine you have been pr

ID: 3908496 • Letter: D

Question

Debug the following View SQL Statement. Use the Virtual Machine you have been provided to do this. List everything that you had to do in order to fix it. Only list the line that was fixed and what you did to it.

The code to debug is as follows:

Create or replace view List_Book_Details

  select book_code, title, price, author_first author_last, Publisher_name city   

from Henry_books.Wrote a,

Henry_Books.Author b,

Henry_Books.Book c,

henry_books.publisher

where book_code = book_code

and author_num = author_num

and publisher_code = publisher_code

Explanation / Answer

Create or replace view List_Book_Details

select c.book_code, c.title, c.price, b.author_first b.author_last, p.Publisher_name city

from Henry_books.Wrote a,
Henry_Books.Author b,
Henry_Books.Book c,
henry_books.publisher p

where c.book_code = a.book_code

and a.author_num =b.author_num

and c.publisher_code = p.publisher_code

The code should be like above, because more than one table contain the same column name, hence column name must contain the table reference, otherwise they will be ambiguous..

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote