How do I display SQL query on a specific page of my wordpress site

$result = $wpdb->get_results( "SELECT `account_number`,`consumer_name`,`bill_amount`,`due_date`,`disco_date`,`bill_status` FROM {$wpdb->prefix}_bill_inquiry where  `account_number` = '$inputnumber' AND `pin_number` = '$inputpin'", OBJECT );

$wpdb->prefix will automatically print the prefix, then to convert the result in array form you can use the following snippet:

$result = json_decode(json_encode($result),true);

You can either place it in a template or you can create a shortcode in functions.php, you can refer shortcode docs.

tech