The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | Apr 2017 |
| Last Sign in: | 103 Weeks Ago, 3 Days Ago |
| Questions Answered: | 4870 |
| Tutorials Posted: | 4863 |
MBA IT, Mater in Science and Technology
Devry
Jul-1996 - Jul-2000
Professor
Devry University
Mar-2010 - Oct-2016
In this assignment you will create Views and Stored Procedures using the tables which you created in your mid-term assignment.  1. Create a View named vw_BookAuthors_<PSU_Username> (20 points) This view should perform the following query: Select all Books and their Authors. Include BookID, BookName, AuthorName  2. Create a View named vw_TotalBooksByPublisher_<PSU_Username> (20 points) This view should perform the following query: Select count of all Books grouped by PublisherName. Include COUNT(BookID) as TotalBooks and PublisherName. (Peform INNER JOIN on Books and Publisher and group it by PublisherName)  3. Create a Stored Procedure named sp_GetTotalBooksPubByPubName_<PSU_Username> (20 points) The procedure should make use of the view created in Question 2 and Select must be done on this View. The procedure should accept a variable @PublisherName as input parameter. The Where clause should apply filter on vw_TotalBooksByPublisher_<PSU_Username> view.  4. Create a Stored Procedure named sp_InsertBook_<PSU_Username> (20 points) The procedure should accept parameters like AuthorName etc. (Include all the columns as parameters, if the primary is not set as Indentity column in your table design then include this as well) (HINT: CREATE Procedure sp_InsertBook_<PSU_Username> @BookName varhchar(100) @..... @..... AS BEGIN INSERT INTO Books(BookName,.....) VALUES (@BookName,.....) END )  5. Create a Stored Procedure to update the name of a Publisher. Name the procedure as sp_UpdatePubNameByPubID_<PSU_Username> The procedure will accept two parameters (@PublisherName, @PublisherID) (HINT: CREATE Procedure sp_UpdatePubNameByPubID_<PSU_Username> (20 points) @PublisherName varhchar(100), @PublisherID INT AS BEGIN -- Write the select statement END )