Question: What is printed by the first, second, and third EXEC? Q1-Q7 are based on the table (Books) below & procedure. Q8 is based on Views

What is printed by the first, second, and third EXEC?

What is printed by the first, second, and third EXEC? Q1-Q7 are

Q1-Q7 are based on the table (Books) below & procedure. Q8 is based on Views and Q9 is based on Triggers. BookID BookAuthor BookTitle BookPrice 1 Michelle Obama Becoming 16.00 2 Maya Angelou Still I Rise 20.00 3 Yuval Noah Harari Sapiens 20.00 4 Coleman Barks The Essential Rumi 10.00 5 James McClintock Lost Antarctica 15.00 CREATE PROC order Books @Title varchar (100) = NULL, @Quantity int = NULL AS DECLARE @P varchar (50), @TotalPrice money, @id int, Author varchar (50) IF @Title IS NULL THROW 50002, 'Book Title cannot be NULL', 1 IF @Quantity IS NULL SET @Quantity = 1 SET @TotalPrice = (SELECT Book Price*@Quantity FROM Books WHERE BookTitle = @ Title) SET @id = (SELECT BOOKID FROM Books WHERE BookTitle = @ Title) SET @Author = (SELECT BookAuthor FROM Books WHERE BOOKID = @id) : SET @P = CONVERT (varchar, @id) + ' ' + @Author + CONVERT (varchar, @TotalPrice) RETURN @P GO DECLARE @book varchar(100) -----first----- EXEC @book = orderBooks @title= 'Still I Rise', @Quantity=2 PRINT @book ---second---- EXEC @book = orderBooks @Title= 'Still I Rise PRINT @book third----- EXEC @book = orderBooks PRINT @book

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!