J.D. begins work at Sacred Heart under Attending Physician Dr. Perry Cox (John C. McGinley), who generally refers to J.D. as "Newbie" or by a variety of girls' names. J.D. thinks of Cox as his mentor, which Cox adamantly denies. As much as he hates to admit it, however, Cox respects J.D. as a doctor and even cares about him as a person, even offering him personal advice on a few occasions. J.D.'s faith in Cox is shaken when the latter has a breakdown following the death of three patients. After a deeply depressed Cox shows up to work drunk, J.D. refuses to see him, claiming that he does not approve of Cox's behavior. However, he later confesses to Cox that he still looks upon him as a hero, and admires him for caring so much about his patients that he takes it hard when things go badly for them. At the end of the episode, Cox thanks J.D. — and, atypically, calls him by his real name — for helping him forgive himself and get on with his life. After Cox is promoted to Chief of Medicine in season 8, he and J.D. are often at odds over hospital matters, mirroring Cox's relationship with the former chief, Dr. Bob Kelso (Ken Jenkins), in earlier seasons. Kelso advises J.D. that he is the one who will have to press for hospital matters if they're important enough, even if it means fighting Cox to do it. On J.D.'s last day at Sacred Heart, Cox finally admits that J.D. is an exceptional physician, an exceptional person, and a friend — albeit only when he thinks J.D. isn't around to hear it.