This is a follow-up to "SQL language proposal: JOIN FOREIGN" [1] [2].<p>Thanks to the comments from HN and Github users, new syntax alternatives have been added to the proposal. Please vote on the syntax you prefer, feel free to leave any other comments, including other syntax ideas.<p>Note: Choice 1,2,3 use foreign key names in the syntax, while Choice 4 uses foreign key <i>column</i> names, similar to JOIN USING.<p>For details, see the "Alternative syntax" section of the Gist [2].<p>1) JOIN FOREIGN fk_alias.fk_name (original proposal)<p><pre><code> SELECT f.title, f.did, d.name, f.date_prod, f.kind
FROM films f
JOIN FOREIGN f.films_did_fkey d
SELECT f.title, f.did, d.name, f.date_prod, f.kind
FROM distributors d
JOIN films f FOREIGN films_did_fkey REF d
</code></pre>
2) JOIN table FOREIGN fk_alias.fk_name REF pk_alias<p><pre><code> SELECT f.title, f.did, d.name, f.date_prod, f.kind
FROM films f
JOIN distributors d FOREIGN f.films_did_fkey REF d
SELECT f.title, f.did, d.name, f.date_prod, f.kind
FROM distributors d
JOIN films f FOREIGN f.films_did_fkey REF d
</code></pre>
3) JOIN table FOREIGN fk_name [ FROM | TO ] alias<p><pre><code> SELECT f.title, f.did, d.name, f.date_prod, f.kind
FROM films f
JOIN distributors d FOREIGN films_did_fkey FROM f
SELECT f.title, f.did, d.name, f.date_prod, f.kind
FROM distributors d
JOIN films f FOREIGN films_did_fkey TO d
</code></pre>
4) JOIN table FOREIGN (fk_col, ...) [ FROM | TO ] alias<p><pre><code> SELECT f.title, f.did, d.name, f.date_prod, f.kind
FROM films f
JOIN distributors d FOREIGN (did) FROM f
SELECT f.title, f.did, d.name, f.date_prod, f.kind
FROM distributors d
JOIN films f FOREIGN (did) TO d
</code></pre>
[1]: https://news.ycombinator.com/item?id=29739147<p>[2]: https://gist.github.com/joelonsql/15b50b65ec343dce94db6249cfea8aaa#sql-language-proposal-join-foreign