Normalize internal structures 2 MySQL (change definer to begin with)