24 January 2018

legsCount

My solution:
DROP PROCEDURE IF EXISTS legsCount; 

CREATE PROCEDURE legsCount() 
  SELECT SUM(IF(type = "human", 2, 4)) AS summary_legs 
  FROM   creatures 
  ORDER  BY id;