Updated SQL to include team