database implementation code

implement relational database, including heap version, sorted version
and several query operations