implement relational database, finish heap version, sorted version and some query operations