Help needed to formulate a query

Hi. Please could someone help me formulate a query to find all invoices for a patient.

I have a patient table with patient_id

I have an appointment table with appointment_id and patient_id

I have an invoice table with invoice_id and appointment_id and fee

Ideally I would also like to be able to get the sum of fees for a patient


SELECT
   c.client_id
 , SUM(i.fee)
FROM
  client c
INNER JOIN
  appointment a
  ON a.client_id=c.client_id
INNER JOIN
  invoice i
  ON i.appointment_id=a.appointment_id
GROUP BY
  c.client_id

(untested)