Skip to content

Instantly share code, notes, and snippets.

@abarth500
Created December 2, 2014 00:57
Show Gist options
  • Save abarth500/170f4d1ff18414a050ba to your computer and use it in GitHub Desktop.
Save abarth500/170f4d1ff18414a050ba to your computer and use it in GitHub Desktop.
[データベースシステム論] 試行課題2
--試行課題2
---以下の三つのSQLを試してみて、結果からそれぞれの問い合わせの意味・違いを考えよう。
--右結合
SELECT wid, name, district, price
FROM wine LEFT JOIN vineyard
ON wine.did = vineyard.did;
--左結合
SELECT wid, name, district, price
FROM wine RIGHT JOIN vineyard
ON wine.did = vineyard.did;
--全結合
SELECT wid, name, district, price
FROM wine FULL JOIN vineyard
ON wine.did = vineyard.did;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment