SELECT id AS Code, name AS Name, productdetailstyle AS Layout, CONCAT('/store/cat/', replace(replace(replace(replace(replace(replace(replace(replace(id, ' ', '+'), '!', '%21'), "'", '%27'), '-', '%2D'), '/', '-'), '(', '%28'), ')', '%29'), '&', '%26'), '/', replace(replace(replace(replace(replace(replace(replace(replace(name, ' ', '+'), '!', '%21'), "'", '%27'), '-', '%2D'), '/', '-'), '(', '%28'), ')', '%29'), '&', '%26')) AS URL FROM departments WHERE web = 1 AND id = 'BALL'