updated query
database set up