Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a script that creates and calls a stored procedure named test. This stored procedure should declare a variable and set it to the count

Write a script that creates and calls a stored procedure named test. This stored procedure should declare a variable and set it to the count of all products in the Products table. If the count is greater than or equal to 7, the stored procedure should display a message that says, The number of products is greater than or equal to 7. Otherwise, it should say, The number of products is less than 7.

2. Write a script that creates and calls a stored procedure named test. This stored procedure should use two variables to store (1) the count of all of the products in the Products table and (2) the average list price for those products. If the product count is greater than or equal to 7, the stored procedure should display a result set that displays the values of both variables. Otherwise, the procedure should display a result set that displays a message that says, The number of products is less than 7.

3. Write a script that creates and calls a stored procedure named test. This procedure should calculate the common factors between 10 and 20. To find a common factor, you can use the modulo operator (%) to check whether a number can be evenly divided into both numbers. Then, this procedure should display a string that displays the common factors like this: Common factors of 10 and 20: 1 2 5 10

4. Write a script that creates and calls a stored procedure named test. This procedure should attempt to insert a new category named Guitars into the Categories table. If the insert is successful, the procedure should display this message: 1 row was inserted. If the update is unsuccessful, the procedure should display this message: Row was not inserted - duplicate entry.

Need in sql language.

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

Database Design Query Formulation And Administration Using Oracle And PostgreSQL

Authors: Michael Mannino

8th Edition

1948426951, 978-1948426954

More Books

Students also viewed these Databases questions

Question

What are the Five Phases of SDLC? Explain each briefly.

Answered: 1 week ago

Question

How can Change Control Procedures manage Project Creep?

Answered: 1 week ago