sql and mapping work