"What can I do with Stored Procedures and Why?
Stored procedures can be used to group SQL commands and add logic to your SQL statements, whilst reducing the quantity of data transferred between your application and your database. For example, managing session in a PHP web application. If you want to update the session record when a request is made for an existing session, or create new session altogether you could do all this along with checks in one stored procedure. This would normally consist of using a SELECT command to get all the request data from the database regarding the given session ID, then programming your code to execute an INSERT or an UPDATE command depending on how many rows came back. With stored procedures you can include all this in one simple SQL command which simply returns true for when a new session is made, and false for when a session is updated."