Db Link Of Product Features Saved As Separate Products

Have been trying to work out how the products with features that save as a seperate products get linked to each other in the database tables.

For products that are created using "variations as a one product', I can easily tell from the products table from the 'product_type' as V and 'parent_product_id" columns. Also from the product_variation_group_products table, it also has a column for 'parent_product_id'.

But for products that are created using "variations as seperate products", they are shown as product_type P and without a parent_product_id. So if I just have the product_id of a product, how can I find if it is linked to other products by variation?

In the admin panel, we are able to see all the variations that a product has, so there must be a way they are linked, but I can't seem to work out the sequence of tables that would display that.

NOTE: I've figured out the link is in the 'group_id' column 'product_variation_group_products' table. If the items are linked, they have the same group_id