Skip to main content
All Problems
medium0% acceptance

Revenue per Department

Calculate the total billing amount generated by each department. Join billing to visits to doctors to departments. Return the department name and total amount, rounded to 2 decimal places, sorted by total descending.

Schema

🔑idINT
first_nameTEXT
last_nameTEXT
specialtyTEXT
🔗department_idINT
emailTEXT
phoneTEXT
hire_dateTEXT
salaryREAL
postgresql

Run your query to see results

Press Ctrl + Enter to execute