Pregunta de entrevista de WITHIN

Design some SQL queries and model them in a Ruby on Rails system.