O'Reilly logo

MySQL Management and Administration with Navicat by Gokhan Ozar

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Working with functions and procedures

MySQL has brought support for functions and stored procedures as of Version 5. A stored procedure is a set of SQL statements that can be stored on the server, so that they can be invoked later by a client, a trigger, or even another stored procedure.

Now, we will create a simple stored procedure that will select the employees with the lowest, highest, and average salaries in the company.

The default way of creating such a routine in Navicat is through the Function Wizard that is invoked by clicking on the New function button in the toolbar or by selecting the New Function command from the pop-up menu showing up with a right-click on the appropriate context.

In the Function Wizard window, select Procedure and ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required