writing businessLogic, SQL table almost OK