Add form fields dynamically on button click

You can do that using Javascript, by creating new DOM elements.

You can use this Try it yourself functionality from W3Schools

Copy and paste this code into Try it yourself and see how it works, it just adds a new paragraph:

<!DOCTYPE html>
<html>
<body>

<div id="div1">
<p id="p1">This is a paragraph.</p>
<p id="p2">This is another paragraph.</p>
<p><input type="button" value="Add Paragraph" onclick="addPara();"></p>
</div>

<script>
function addPara()
{
var para = document.createElement("p");
var node = document.createTextNode("This is new.");
para.appendChild(node);
var element = document.getElementById("div1");
element.appendChild(para);
}
</script>

</body>
</html>

Now, take a look at this post in SO to see how to add a form.

Sorry I missed the database part. You will need to create a php page that would handle data processing and storing in a db. Again I’m using W3schools try it yourself functionality (but generally that website can’t be trusted on more serious and professional programming info), here is the link with an example how to send data from a form to php.

That’s one way of doing it and it will refresh the page. My favourite way is to use Javascript to collect data and then send it to the php page using an AJAX call. Here is the link to ajax with php.

And this is the guide on working with database tables in WP, I guess you can just use those functions in a php page that would handle data manipulation.