week 7 intro to sqlite: updated solution