How do I get the total amount of money paid by each customer minus the amount collected (`em_paid_to`)?

table customer

```
cust_id INT
f_name VARCHAR
l_name VARCHAR
email VARCHAR
c_limit INT

```

table transaction

```
id INT
em_paid_by VARCHAR
em_paid_to VARCHAR
amount INT
trans_date DATE

```

I already tried this to get the total paid by each customer but it did not work:

```
SELECT C.F_NAME, C.L_NAME, COUNT(T.EM_PAID_BY), SUM(T.AMOUNT)
FROM CUSTOMER C 
JOIN TRANSACTION T ON C.EMAIL = T.EM_PAID_BY;

```

...and this to get the total collected by each customer, still the same error and I need to get the difference between the two results.

```
SELECT C.F_NAME, C.L_NAME, COUNT(T.EM_PAID_TO), SUM(T.AMOUNT)
FROM CUSTOMER C 
JOIN TRANSACTION T ON C.EMAIL = T.EM_PAID_TO;

```

What I am hoping to get is like this **Old McDonald oldmcdonald@gmail.com 2000**
i.e *(2000 + 4000 + 1000) - (2000 + 3000) = 2000*