SELECT linka
  FROM linky
 WHERE 'Nad Primaskou' IN (SELECT zastavka
                             FROM zastavky
                            WHERE id = zastavka_id); 