What is a stored procedure in sql with example?



What is a stored procedure in sql with example?..

Answer / Ramesh Chanda

"Stored Procedure": It's a prepared SQL code that can be saved and reused. To create a stored procedure, you use the CREATE PROCEDURE statement. Here's an example:

CREATE PROCEDURE CalculateAverage ( @a INT, @b INT )
AS
SELECT AVG( @a + @b )

EXECUTE CalculateAverage 5, 10

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More SQL PLSQL Interview Questions

Is inner join faster than left join?

0 Answers  


How many triggers can be implemented for a table?

3 Answers   HSBC,


What is memory optimized?

1 Answers  


How can you maintain the integrity of your database on instances where deleting an element in a table result in the deletion of the element(s) within another table?

1 Answers  


how to check myisam tables for errors? : Sql dba

1 Answers  


How will we see framework of a table?

2 Answers   Accenture,


How to Execute a Package in PL/SQL.?

1 Answers   MCN Solutions,


What is a trigger in pl/sql?

1 Answers  


What is primary key and foreign key with example?

1 Answers  


How to Declare Fixed Length String Value In PL SQL

1 Answers  


Can ddl statements be used in pl/sql?

1 Answers  


what is HASH join?

2 Answers   Genpact, HCL,


Categories