title: SQL query to output data from two tables that are not directly linked by PK/FK, but are linked through multiple other tables?
body: <p>I am new to SQL and DBMS' and so I am still learning best practices and exploring what is possible and not possible. I have designed a database in Postgres, which contains 6 tables: SATELLITE DATA which has a Foreign Key with CROP DATA which has a FK with FIELDS which has a FK with FARMS which has a foreign key with MET STATION and MET DATA which also has a foreign key with MET STATION. (I hope I've explained that ok..)</p>
  
  <p>I was assuming that I could get an output table containing information from the 2 tables furthest from each other (SATELLITE DATA and MET DATA) because there was a link through all the other tables via PKs and FKs.. however I can't work out the SQL to do so. (I can envisage a very long bit of SQL to do it.. but if it is possible I would hope there is a more efficient way..)</p>
  
  <p>My questions are: Is there SQL to do what I want above in an efficient manner with the same design of database I've done? Or should I redesign my database so that each table that needs to be linked, is linked directly rather than through multiple other tables?</p>
  
  <p>Thanks in advance for any help!</p>