How to create a custom table using custom code in WordPress? 


global $wpdb;
    global $charset_collate;
    $table_name = $wpdb->prefix . 'custom_table';
	$sql = "CREATE TABLE IF NOT EXISTS $table_name (
		`ID` int(20) NOT NULL AUTO_INCREMENT,
		`name` varchar(200)  NOT NULL,
		`mobile_number` varchar(200) NOT NULL,
		`email` varchar(20) NOT NULL,
		PRIMARY KEY (`ID`)
	)$charset_collate;";
    require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
    dbDelta( $sql );