To create/edit/delete custom data into or on-top of WordPress, I like to use the Pods Framework plugin: https://wordpress.org/plugins/pods/. In your particular case, you may want to consider using it's powerful Advanced Content Types which are entirely separate from WordPress and use their own database tables. Do be aware that ACT (Advanced Content Types) can not make use of the full WordPress API as they are indeed a stand-alone data "object" external to WordPress. Learn more about Pods and how to use it at: http://pods.io/
The other thing to consider when using your own PHP code and database tables is to sanitize and verify everything - you really don't want to be the target or victim of a SQL Injection attack.