CREATE TABLE Allergy_Type (Allergy VARCHAR, AllergyType VARCHAR)
CREATE TABLE Student (StuID INT, LName VARCHAR, Fname VARCHAR, Age INT, Sex VARCHAR, Major INT, Advisor INT, city_code VARCHAR)
CREATE TABLE Has_Allergy (StuID INT, Allergy VARCHAR)

List the last name of the students who do not have any food type allergy and count them in a bart chart, and sort by the the number of lname in desc.
SELECT LName, COUNT(LName) FROM Student WHERE NOT StuID IN (SELECT T1.StuID FROM Has_Allergy AS T1 JOIN Allergy_Type AS T2 ON T1.Allergy = T2.Allergy WHERE T2.AllergyType = "food") GROUP BY LName ORDER BY COUNT(LName) DESC
WITH "_u_0" AS (SELECT ARRAY_AGG("StuID") AS "", "T2"."AllergyType" AS "_u_1" FROM "Has_Allergy" AS "T1" JOIN "Allergy_Type" AS "T2" ON "T1"."Allergy" = "T2"."Allergy" GROUP BY "T2"."AllergyType") SELECT "LName", COUNT("LName") FROM "Student" LEFT JOIN "_u_0" AS "_u_0" ON "_u_0"."_u_1" = "food" WHERE NOT ARRAY_ANY("_u_0"."", "_x" -> "StuID" = "_x") GROUP BY "LName" ORDER BY COUNT("LName") DESC NULLS LAST