Data Type as validation constraint – with example in MySQL

Oftentimes, those less-than-obvious gems of programming go unnoticed. Some things are in place for us to utilize, yet we never think about them. In this blog post, I will cover how you can use the integer data type itself, as a sort of validation constraint for data coming into your table(s). Of course, all situations are unique, so this is not a one-size-fits-all solution. However, under the right circumstances, it could be a handy little trick to have up your sleeve.

[Head this way for more great MySQL blogging >>>]

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…)