Hi,
#1. That can be done with GF hooks (after creating form) and MB Custom Table API. Something like
add_action( 'gf_after_create_form', function() {
$fields = gf_get_form_fields();
$columns = [];
foreach ( $fields as $field ) {
$columns[$field] = 'TEXT NOT NULL';
}
MB_Custom_Table_API::create( 'my_custom_table', $columns );
} );
Please note that the GF action name and function should be corrected according to GF docs. This is just the pseudo-code, not an actual running code.
#2. Similar to that, you should hook to GF after submission to insert a new row into the DB. We don't have a public API for that, but you can use $wpdb->insert()
to do it.