1.

What are the stored procedures in MySQL? Also, write an example.

Answer»

The stored procedure is LIKE a subprogram in a typical COMPUTING language which is stored in the database. A stored procedure contains the name, list of parameters, and the SQL statements. All the RELATIONAL database system works as PILLARS for stored procedures.

In this example, we are CREATING a simple procedure called job_data, when this procedure will get executed, all the data from "jobs" tables will get displayed.

Example

DELIMITER //

CREATE PROCEDURE GetAllPages()
BEGIN
    SELECT * FROM pages WHERE title LIKE '%MySQL Interview Questions%';
END //

DELIMITER ;



Discussion

No Comment Found