23 January 2018

websiteHacking

My solution:
CREATE PROCEDURE websiteHacking() 
  SELECT id, 
         login, 
         name 
  FROM   users 
  WHERE  type = 'user' 
          OR type != 'user' 
  ORDER  BY id 

marketReport

My solution:
CREATE PROCEDURE marketReport() 
BEGIN 
  SELECT DISTINCT country, 
                  COUNT(*) AS competitors 
  FROM   foreignCompetitors 
  GROUP  BY country 
  UNION 
  SELECT "Total:" AS country, 
         COUNT(competitor) 
  FROM   foreignCompetitors; 
END