A staple in CodeIgniter interview questions for experienced candidates, be prepared to answer this one. Active record is a database design pattern; CI uses a modified version of it. The pattern allows data to be inserted, updated or deleted in the database with nominal scripting. The major benefit to using the Active Record features is that it allows you to create database-independent applications since the query syntax is generated by each database adapter. To get the raw query we can use $this->db->get_compiled_select(). Difference between get_compiled_select()  and last_query() is that get_compiled_select gives the query string generated even if we don’t run the query against database.