Select customer.name As customer_name, salesperson.name As salesperson_name, (salesperson.commission*amount) As salesperson_commission From `order` Join customer On `order`.customer_id = customer.id Join salesperson On `order`.salesperson_id = salesperson.id;