CREATE TABLE Appointment (AppointmentID INT, Patient INT, PrepNurse INT, Physician INT, Start DATETIME, End DATETIME, ExaminationRoom TEXT)
CREATE TABLE Prescribes (Physician INT, Patient INT, Medication INT, Date DATETIME, Appointment INT, Dose VARCHAR)
CREATE TABLE Undergoes (Patient INT, Procedures INT, Stay INT, DateUndergoes DATETIME, Physician INT, AssistingNurse INT)
CREATE TABLE Medication (Code INT, Name VARCHAR, Brand VARCHAR, Description VARCHAR)
CREATE TABLE Patient (SSN INT, Name VARCHAR, Address VARCHAR, Phone VARCHAR, InsuranceID INT, PCP INT)
CREATE TABLE Nurse (EmployeeID INT, Name VARCHAR, Position VARCHAR, Registered BOOLEAN, SSN INT)
CREATE TABLE Block (BlockFloor INT, BlockCode INT)
CREATE TABLE On_Call (Nurse INT, BlockFloor INT, BlockCode INT, OnCallStart DATETIME, OnCallEnd DATETIME)
CREATE TABLE Trained_In (Physician INT, Treatment INT, CertificationDate DATETIME, CertificationExpires DATETIME)
CREATE TABLE Room (RoomNumber INT, RoomType VARCHAR, BlockFloor INT, BlockCode INT, Unavailable BOOLEAN)
CREATE TABLE Affiliated_With (Physician INT, Department INT, PrimaryAffiliation BOOLEAN)
CREATE TABLE Physician (EmployeeID INT, Name VARCHAR, Position VARCHAR, SSN INT)
CREATE TABLE Procedures (Code INT, Name VARCHAR, Cost FLOAT)
CREATE TABLE Department (DepartmentID INT, Name VARCHAR, Head INT)
CREATE TABLE Stay (StayID INT, Patient INT, Room INT, StayStart DATETIME, StayEnd DATETIME)

Give me a bar chart showing how many physicians for each department name they primarily affiliated in, list Y-axis from high to low order.
SELECT T3.Name, COUNT(T3.Name) FROM Physician AS T1 JOIN Affiliated_With AS T2 ON T1.EmployeeID = T2.Physician JOIN Department AS T3 ON T2.Department = T3.DepartmentID WHERE T2.PrimaryAffiliation = 1 GROUP BY T3.Name ORDER BY COUNT(T3.Name) DESC
SELECT "T3"."Name", COUNT("T3"."Name") FROM "Physician" AS "T1" JOIN "Affiliated_With" AS "T2" ON "T1"."EmployeeID" = "T2"."Physician" AND "T2"."PrimaryAffiliation" = 1 JOIN "Department" AS "T3" ON "T2"."Department" = "T3"."DepartmentID" GROUP BY "T3"."Name" ORDER BY COUNT("T3"."Name") DESC NULLS LAST