Write a SQL query to find the top 3 departments by average patient satisfaction score within each hospital at UC San Francisco.
Use the hospitals, departments, and patient_satisfaction tables. Exclude departments without at least one non-null satisfaction score.
Output
- One row per selected department, with
hospital_name, department_name, average_satisfaction_score, and department_rank.
- Return at most three departments per hospital, ordered by hospital name, rank, and department name. Break equal averages alphabetically by department name.