So now you add the customer_score with the agent_score based on customer number and who ever has highest score that agent is assigned to the Customer and so..on
John,12,35,- Agent3 jackson is assigned since customerscore 35+agent_score 45 =80 -rank 1
James,13,55 - agent 2 Kelly since 55+55=110-rank 1( agent 3 is not considered since he is already assigned with a customer)
harvard,14,25 - agent 1 since he is remaining agent....
here is the SQL for create and insert for testing:
CREATE TABLE Customer(
Customer_name varchar2,Customer_num number, customer_score number
CREATE TABLE Agent(
Agent_number number,agent_name varchar2,Agent_Score number,Customer_num number
You can lead some folks to knowledge, but you can not make them think.
The average person thinks he's above average!
For most folks, they don't know, what they don't know.
Good judgement comes from experience. Experience comes from bad judgement.