added sql database
implemented test code