How to Save settings of custom tab product page in admin side in a database?

Depending on your situation I don’t recommend or condone doing this, but the answer to your question is to take a look at the $wpdb class and the dbDelta() function. This is the interface WordPress provides for adding custom tables.

Be careful though, with great power comes great responsibility. Using $wpdb bypasses many of the built-in WordPress security features, so you need to be very cautious with sanitizing and escaping data to avoid introducing SQL injection vulnerabilities and other security holes.

That said, here’s an abstracted class I recently used to do this for a client that may be useful for you to work with. I didn’t test this, it’s an abstraction from a much larger class so you’ll need to re-configure and test it yourself. For what it’s worth, I don’t think you need a custom table for this use case.

<?php
/**
 * Database
 *
 * Add custom tables to a WordPress database
 */

if ( ! class_exists('DB_Table') ) :

class DB_Table 
{
    protected $table;

    /**
     * Create Database Table
     *
     * Given a schema array, create a custom table in the WP database
     */
    public static function create() {
        require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );

        global $wpdb, $charset_collate;

        $table="custom_table_name"; // The name of your custom DB table
        $schema = self::schema();

        // create database table
        $table_name = $wpdb->prefix . $table;
        $sql = "CREATE TABLE IF NOT EXISTS $table_name ( ";
        $sql .= $schema;
        $sql .= " ) $charset_collate;";

        // run create process
        dbDelta( $sql );
    }

    /**
     * Schema: Level Term Rates 
     *
     * Schema definition for the custom table
     */
    public static function schema() {

        // Define your schema here for the table
        $schema = "id int(8) unsigned NOT NULL AUTO_INCREMENT,
        age int(3) NOT NULL DEFAULT '0',
        first_name text NOT NULL DEFAULT '',
        last_name text NOT NULL DEFAULT '',
        gender char(1) NOT NULL DEFAULT '',
        PRIMARY KEY (id)";

        return $schema;
    }
}

/**
 * Register Hooks
 */
register_activation_hook( __FILE__, array( 'DB_Table', 'create' ) );

endif;
?>