Please read the following table in HTML format from a webpage and then answer the question in detail according to the table. Each table cell is defined by a <td> and a </td> tag. Each table row starts with a <tr> and ends with a </tr> tag. 'rowspan=m' and 'colspan=n' represents a cell spaning over 'm' rows and 'n' columns.

Webpage title:
John Farrell (manager)
Table title:
Managerial records
Table:
<table id='hittask' contenteditable='False'>
<tr> <th colspan=1 rowspan=2 > Team </th><th colspan=1 rowspan=2 > From </th><th colspan=1 rowspan=2 > To </th><th colspan=4 rowspan=1 > Regular season record </th><th colspan=4 rowspan=1 > Post–season record </th></tr>
<tr> <th colspan=1 rowspan=1 > G </th><th colspan=1 rowspan=1 > W </th><th colspan=1 rowspan=1 > L </th><th colspan=1 rowspan=1 > Win % </th><th colspan=1 rowspan=1 > G </th><th colspan=1 rowspan=1 > W </th><th colspan=1 rowspan=1 > L </th><th colspan=1 rowspan=1 > Win % </th></tr>
<tr> <td class="highlighted"  colspan=1 rowspan=1 > Toronto Blue Jays </td><td class="highlighted"  colspan=1 rowspan=1 > 2011 </td><td class="highlighted"  colspan=1 rowspan=1 > 2012 </td><td colspan=1 rowspan=1 > 324 </td><td colspan=1 rowspan=1 > 154 </td><td colspan=1 rowspan=1 > 170 </td><td colspan=1 rowspan=1 > .475 </td><td colspan=4 rowspan=1 > — </td></tr>
<tr> <td class="highlighted"  colspan=1 rowspan=1 > Boston Red Sox </td><td colspan=1 rowspan=1 > 2013 </td><td colspan=1 rowspan=1 > 2017 </td><td colspan=1 rowspan=1 > 810 </td><td colspan=1 rowspan=1 > 432 </td><td colspan=1 rowspan=1 > 378 </td><td colspan=1 rowspan=1 > .533 </td><td colspan=1 rowspan=1 > 23 </td><td colspan=1 rowspan=1 > 12 </td><td colspan=1 rowspan=1 > 11 </td><td colspan=1 rowspan=1 > .522 </td></tr>
<tr> <th colspan=3 rowspan=1 > Total </th><th colspan=1 rowspan=1 > 1,134 </th><th colspan=1 rowspan=1 > 586 </th><th colspan=1 rowspan=1 > 548 </th><th colspan=1 rowspan=1 > .517 </th><th colspan=1 rowspan=1 > 23 </th><th colspan=1 rowspan=1 > 12 </th><th colspan=1 rowspan=1 > 11 </th><th colspan=1 rowspan=1 > .522 </th></tr>
<tr> <th colspan=11 rowspan=1 > Ref.: </th></tr>
</table>
Question:
What two teams did John Farrell serve as manager for, and what years did he manage the first team?
Answer:
John Farrell served as the manager for the Toronto Blue Jays from 2011 to 2012 and later served for the Boston Red Sox.