All logical operation and database handling done in the Models like insert, update or fetch records.
Codeigniter has predefined Database methods to perform database request.
In the demonstration, with View show the HTML form and when the user submits the forms then call the Model method to insert record from the controller.