Theme, WordPress Version, MySQL Version, PHP Version Update affected files and folders

How do I keep my Files during WordPress and Theme Updates?

Don’t edit core WordPress files or the files of themes or plugins you didn’t develop yourself. If those are updated they are replaced entirely and you will lose any changes you make.

If you want to customise the theme, create a Child Theme. If you want other functionality, or to customise a plugin, create your own plugin.

During WordPress Update does the custom tables I made will also be gone?

No.

Does MySQL Version Update remove my custom Tables in wordpress?

No. MySQL doesn’t know or care which tables are yours and which are from WordPress.