Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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?

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Visual C# And Databases

Authors: Philip Conrod, Lou Tylee

16th Edition

1951077083, 978-1951077082

More Books

Students also viewed these Databases questions

Question

How do Dimensional Database Models differ from Relational Models?

Answered: 1 week ago

Question

What type of processing do Relational Databases support?

Answered: 1 week ago

Question

Describe several aggregation operators.

Answered: 1 week ago