Ruby on Rails is Model-View-Controller web-application framework. Rails uses ActiveRecord database abstraction classes to work with SQL tables. However, sometimes it is more convenient to work with plain SQL queries(without any model classes) for specific database operations.