Skip to content

Instantly share code, notes, and snippets.

@agawronski
Created December 11, 2017 05:36
Show Gist options
  • Save agawronski/b551b87666010f8203589b830f999105 to your computer and use it in GitHub Desktop.
Save agawronski/b551b87666010f8203589b830f999105 to your computer and use it in GitHub Desktop.
Which tables in the purchasing schema might be able to join, and which columns might be keys to join on?
select *
from purchasing.purchaseorderdetail
limit 10;
-- what keys might there be?
\dt purchasing.*
\d purchasing.productvendor
-- productid
-- businessentityid
\d purchasing.purchaseorderdetail
-- purchaseorderid
-- productid
\d purchasing.purchaseorderheader
-- purchaseorderid
-- employeeid
-- vendorid
-- shipmethodid
\d purchasing.shipmethod
-- shipmethodid
\d purchasing.vendor
-- businessentityid
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment