Finding Output For Multiple Inputs In Mysql Query