Question to the SQL-only people, how would you handle something dynamic? If I have a database of shoes and want people to be able to find them by brand, size, style, etc., what does that look like?
SELECT *
FROM shoes
WHERE (CASE WHEN :brand_id IS NOT NULL THEN brand_id = :brand_id ELSE TRUE END)
AND (CASE WHEN :size IS NOT NULL THEN size = :size ELSE TRUE END)
AND (CASE WHEN :style IS NOT NULL THEN style = :style ELSE TRUE END)