commissiontrnas table and custinvoicejour relationship

hi all, i have a query, i want to calculate commission of a salesorder against customer in sql ,how it can be possible…