Using SQL Tables to get BOM

Friends,

I have been doing some really cool stuff in Powerapps to consolodate data across our company.  I would like a little boost on this next function... I want to create a BOM from the latest released/approved assembly, just from using the SQL tables.  I have had great success using the tables for extracting other information, at this point, I am ready to attempt this.

I am asking:

Which tables I need.

Any boost in the SQL selects & joins to set this up.

Thank you!

SolidworksApi/macros