You can use below code snippet to achieve your functionality, here i have used ECMA script to access sharepoint list data. here is the msdn link for the same.
ExecuteOrDelayUntilScriptLoaded(GetStudentsData, "sp.js");
function GetStudentsData() {
context = new SP.ClientContext.get_current();
lstStudents = context.get_web().get_lists().getByTitle('Students');
web = context.get_web();
currentUser = web.get_currentUser();
context.load(currentUser);
context.executeQueryAsync(Function.createDelegate(this, this.onSuccessMethod),
Function.createDelegate(this, this.onFailureMethod));
}
function onSuccessMethod(sender, args) {
var camlStudentsQuery = new SP.CamlQuery();
// Pass your input parameters from page and you can pass those parameters through query
camlStudentsQuery.set_viewXml('<View><Query><Where><IsNotNull><FieldRef Name="Branch"
/></IsNotNull></Where></Query></View>');
this.StudentsListItems = lstStudents.getItems(camlStudentsQuery);
context.load(StudentsListItems);
context.executeQueryAsync(Function.createDelegate(this, this.showStudentData),
Function.createDelegate(this,
this.onFailureMethod));
}
function showStudentData()
{
// do your job here.
}
function onFailureMethod()
{
// catch error here
}