Squash repeatedly typing the same query – Use a MySQL VIEW instead.

arnaud-papa-28756

Photo by Arnaud Papa on Unsplash

Do you find yourself repeatedly typing the same query? Want to save it for reuse? A VIEW to the rescue it is! In this blog post we will look at a scenario and a VIEW that fits this very need.

(more…)

MySQL Triggers for Data Integrity – In lieu of Check Constraints Part 2.

todd-quackenbush-701

Photo by Todd Quackenbush on Unsplash

Part 1 of this two-part series, discussed the requirements for implementing data integrity checks using a TRIGGER. With the success of that TRIGGER, this second blog post will dive into its workings, gaining an understanding of how the checks are performed, along with the TRIGGER itself.


Note: All data, names or naming found within the database presented in this post, are strictly used for practice, learning, instruction, and testing purposes. It by no means depicts actual data belonging to or being used by any party or organization.

I will be using Xubuntu Linux 16.04.3 LTS (Xenial Xerus) and MySQL 5.7.21 for these exercises.

(more…)

MySQL Triggers for Data Integrity – In lieu of Check Constraints Part 1.

delano-balten-348814

Photo by Delano Balten on Unsplash


Want to automate a process and ensure an operation is carried out for your database tables? Perhaps data integrity checks? Beginning with this blog post, I will present a two-part series leveraging MySQL triggers to ensure data integrity for mock pipeline pipe asset data.

Note: All data, names or naming found within the database presented in this post, are strictly used for practice, learning, instruction, and testing purposes. It by no means depicts actual data belonging to or being used by any party or organization.

I will be using Xubuntu Linux 16.04.3 LTS (Xenial Xerus) and MySQL 5.7.20 for these exercises.

(more…)

Simple Example of a MySQL Temporary Table.

Need a table without creating a permanent one in your database? You are in luck!!! This blog post will cover using the TEMPORARY keyword in a CREATE TABLE statement to CREATE a temporary table. But don’t get attached. It won’t be around forever!

(more…)

MySQL Prepared Statements with 2 easy examples.

Learning and developing MySQL skills continuously presents opportunities to discover new and interesting things as I navigate this path. In this blog post, I will share a recent find with you.
Prepared statements.

Note: All data, names or naming found within the database presented in this post, are strictly used for practice, learning, instruction, and testing purposes. It by no means depicts actual data belonging to or being used by any party or organization.

(more…)

MySQL Transactions and User-defined session variables.

This blog post will cover a simple example of using a TRANSACTION along with user-defined session variables to greatly reduce the chance for errors on our part when updating multiple database tables.


Note: All data, names or naming found within the database presented in this post, are strictly used for practice, learning, instruction, and testing purposes. It by no means depicts actual data belonging to or being used by any party or organization.

(more…)