MySql function – how to create functions

Custom function in MySQL comes handy if we have some sort of calculation what to make, in order to get a value what can be stored. This implies that we want to push some logic into the database which is not a to popular idea among engineers. A function always gives...

MySql join – the basics

In a relational database with high level of normalization the data is stored in multiple tables. To retrieve the data from many tables joins can be used to connect data from multiple tables or itself(self join). Joins nowadays are considered to be a slow operation,...

MySql trigger

Trigger is a database object, associated with a table. Trigger does it’s specified function if an event occures such as insert/update/delete records. Benefits of Triggers in MySQL: triggers can change  values before insert/update . If you set the trigger to...

MySql start learning – install a sample database

On the dev.mysql.com site you can find few example databases, but for now I will use the world database (innodb). There is a really cool large data dump available from Stack Exchange for performance testing. MySQL world database install guide can be found here, but...

MySql books – where to start mysql

I was lucky and I had the chance to study MySQL (&PHP basics) on a 20 week full-time course, with a Tutor who had 15+years experience in web development. He really guided us if something was not clear. Unfortunately nowadays most people just start at home google...

MySQL insert with stored procedure

Stored procedures can be used to insert new values for more than one table.  This could be handy if the data is stored in few tables as well as restricting the inputs coming from the application layer. The following example will show how to create a stored procedure...