retrieve data by using sql select statement