Query to retrieve max yeae

I have 2 databases and i want to join 3 tables

i want query retrieve all rows from table(info ) and max year and min year from table (edata)
i want result to be like this

no|name|age|job|maxyear|minyear|branche
1|samy|20|teacher|2010|1999|AAAA
2|wael|18|student|2005|1998|BBBB

the first database has two table like this
table(edata)
name|year
samy|2000
samy|1999
samy|2010
wael|1998
wael|1999
wael|2005

table(branches)
no|name|branch
1|samy|AAAA
2|wael|BBBB

the second database has table( info)
no|name|age|job
1|samy|20|teacher
2|wael|18|student

SELECT curly.no
     , curly.name
     , curly.age
     , curly.job
     , larry.minyear
     , larry.maxyear
     , moe.branch
  FROM database2.info AS curly
INNER
  JOIN ( SELECT name
              , MIN(year) AS minyear
              , MAX(year) AS maxyear
           FROM database1.edata
         GROUP
             BY name ) AS larry
    ON larry.name = curly.name
INNER
  JOIN database1.branches AS moe
    ON moe.name = curly.name