Finding How Tables are Related

jmiskey
Kilo Sage

We need to create a database view so that we can ultimately see all assets that do not have any user entitlements associated with them.   Since this involves multiple tables, I believe that I need to create a Database View,

Using the Database Schema maps, it looks like I need to go from the Asset table (alm_asset) to the Software License table (alm_license) to the User Entitlement table (alm_entitlement_user) table.   However, is there a way to see exactly how these tables are connected?   Specifically, which fields are they joined on (we need to know that to connect them in the Database View)?

I could mess around with trial and error, but I figure that there has got to be a better way.   I actually tried connecting the Asset table and Software License table on the "asset_tag" field, since both have that field in them, but that tossed a bunch of errors back to me.   So I figured that cannot be correct and there has got to be a better way of finding the appropriate linking fields.

Thanks

6 REPLIES 6

SudhirOjha
Mega Guru

if you have already tables created and data --then you can easily guess.


e.g. incident.number = problem.relatedincidents.


I found out that I don't think we need to join the Software License table to the Asset table, and the Software License table seems to be an extension of the Asset table.



However, we do need to join the Software License (alm_license) table to the User License Entitlement table (alm_entitlement_user) table.   Getting help from another programmer here, is looks like that is done by joining the sys_id field from the Software License table to the licensed_by field on the User License Entitlement table.



I guess we can find it by poking/playing around with it, but I was hoping for something a little more concrete.   I come from a SQL background, and usually the visual relationships expressed there include the field names, so it is easy to see exactly how things are joined (the visual diagrams show the joins between fields, not just to the general table).