MySQL 5

If you have been using MySQL for a while, you really don’t need to learn a thing about MySQL 5 to keep going. Everything you are used to using still works just as it always has. For the most part, MySQL 5 is about adding enterprise database features seen in other database engines without burdening MySQL with concepts that make it harder to learn and use.

Views

Views are denormalized, table-like structures that represent a snapshot of your data that match specific query parameters. You can thus represent as data from a single table the result of a complex join. New commands supporting views include CREATE VIEW, DROP VIEW, and ALTER VIEW.

Triggers

A database trigger is functionality that you create that gets executed whenever a specific event occurs on a table. For example, you can trigger behavior for a table whenever a new row is inserted. New commands supporting triggers include CREATE TRIGGER and DROP TRIGGER.

Stored Procedures

Stored procedures are the big feature most people have been waiting for. A stored procedure is much like creating a function that is written entirely in SQL and stored in the database. Stored procedures are useful for encapsulating a number of SQL statements that always get executed together under a single logical name for use by clients. MySQL includes a number of new commands to support stored procedures:

  • CREATE PROCEDURE

  • ALTER PROCEDURE

  • DROP PROCEDURE

  • CALL

  • BEGIN/END

Cursors

A cursor is a tool that enables you to represent an entire data set within a MySQL ...

Get MySQL Pocket Reference, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.