Q:

how to Add as well as Subtract  in one single sql query based on startTime

IF startTime=11.30 AND endTime=12.30
if the user gives the start time as 11.20 it should subtract the time by ten minutes[10] in both startTime and endTime and if the start time is 11.50 it should add twenty minutes[20]
How to achieve this in one single sql query 
 output: if the startTime =11.20
 startTime=11.20
 endTime=12.20

 output : if the startTime =11.50
 startTime=11.50
 endTime=12.50

A:

Your description and examples still don't match, so I can only give a very generalised example based on your comment...
How to add or subtract an interval based on a CASE statement...
CASE
  WHEN MINUTE(startTime) = 20 THEN DATE_ADD(startTime, -10 MINUTES)
  WHEN MINUTE(startTime) = 50 THEN DATE_ADD(startTime,  20 MINUTES)
  ELSE NULL
END AS newStartTime,
CASE
  WHEN MINUTE(startTime) = 20 THEN DATE_ADD(endTime, -10 MINUTES)
  WHEN MINUTE(startTime) = 50 THEN DATE_ADD(endTime,  20 MINUTES)
  ELSE NULL
END AS newEndTime

You can have as many WHEN clauses as you like, changing the MINUTE(startTime) = 20 conditions to anything you like, and having whatever you want in the THEN clause.  Then, if you have a case that doesn't match any WHEN clause, put your desired ouput in the ELSE clause.
You'll need to repeat the logic for both the startTime and endTime fields.

