I'm new to SharePoint and I'm working with web parts.
I have learned how to create a basic webpart and how to deploy it...but I don't have any ideas about how to create a web part that adds updates and deletes records from a database.
Making a Web Part that adds, updates or deletes item from a database is just standard ASP.NET programming. For instance if you want to insert a record to a database then you probably would like to add a button to your Web Part that has a click-handler method in which you make the database operations.
You can use SPGridView instead of ASP.NET GridView, and consider SharePoint to be just another database repository.