The query returns you the data of student with roll number you search for.
here value refers to the roll number taken as input. And roll_number is the field name in your table.
<?php
global $wpdb;
$rows = $wpdb->get_results( "SELECT * FROM table_name WHERE roll_number = value");
if( !empty($rows) ) {
$roll_num = $rows->roll_number;
$full_name = $rows->full_name;
$percentage = $rows->percentage;
$result = $rows->result;
}
?>
roll_number, full_name, percentage, result are field names in the table. If field names are different then replace these with proper fields in table.