WITHIN interview question

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