miguel greenberg's database scripts