EasyEnv
Engineering/Courses/Catalog/MySQL/Stored Procedures and Triggers
MySQL
IntermediateLesson 10 of 1335 min · hands-on

Stored Procedures and Triggers

Part of the MySQL course

Every order in the system is supposed to be written to an audit log. Most of them are. The ones that are not came from the admin console, the nightly import, and a one-off script somebody ran in March. The rule was real, but it was enforced in application code, and application code is something each writer has to remember to run.

MySQL lets you move logic into the database itself, where "who is writing" stops mattering. A stored procedure is a named block of SQL you call by name. A trigger is a block that fires automatically whenever a row is inserted, updated or deleted. Both are powerful, both are easy to overuse, and this lesson covers the mechanics and the judgement together. ...

Want to learn MySQL Stored Procedures and Triggers in a real environment?

Click below, get a fresh Linux box with MySQL ready to go, and work through Stored Procedures and Triggers hands-on with an AI tutor that knows your code.

Start this lessonStored Procedures and Triggers

What you'll learn

  • DELIMITER
  • CREATE PROCEDURE
  • IN and OUT parameters
  • CALL
  • CREATE TRIGGER
  • BEFORE INSERT and AFTER UPDATE
  • NEW and OLD

Read this lesson in your language

All lessons in this course

13 lessons
  1. 1What is MySQL20 min
  2. 2The mysql CLI and First Commands25 min
  3. 3Creating Databases and Tables30 min
  4. 4Data Types30 min
  5. 5SELECT and WHERE30 min
  6. 6Joins35 min
  7. 7Aggregates and Grouping30 min
  8. 8Indexes30 min
  9. 9Transactions and Storage Engines35 min
  10. 10Stored Procedures and Triggers35 min
  11. 11EXPLAIN and Query Tuning35 min
  12. 12mysqldump and Restore25 min
  13. 13Capstone: Design an Ecommerce Schema50 min

Explore other courses

Stored Procedures and Triggers - MySQL (English) | Engineering Courses