CREATE TABLE Timed_Locations_of_Things (thing_id INT, Date_and_Time DATETIME, Location_Code CHAR)
CREATE TABLE Customer_Event_Notes (Customer_Event_Note_ID INT, Customer_Event_ID INT, service_type_code CHAR, resident_id INT, property_id INT, date_moved_in DATETIME)
CREATE TABLE Organizations (organization_id INT, parent_organization_id INT, organization_details VARCHAR)
CREATE TABLE Customer_Events (Customer_Event_ID INT, customer_id INT, date_moved_in DATETIME, property_id INT, resident_id INT, thing_id INT)
CREATE TABLE Properties (property_id INT, property_type_code CHAR, property_address VARCHAR, other_details VARCHAR)
CREATE TABLE Customers (customer_id INT, customer_details VARCHAR)
CREATE TABLE Things (thing_id INT, organization_id INT, Type_of_Thing_Code CHAR, service_type_code CHAR, service_details VARCHAR)
CREATE TABLE Residents (resident_id INT, property_id INT, date_moved_in DATETIME, date_moved_out DATETIME, other_details VARCHAR)
CREATE TABLE Residents_Services (resident_id INT, service_id INT, date_moved_in DATETIME, property_id INT, date_requested DATETIME, date_provided DATETIME, other_details VARCHAR)
CREATE TABLE Timed_Status_of_Things (thing_id INT, Date_and_Date DATETIME, Status_of_Thing_Code CHAR)
CREATE TABLE Services (service_id INT, organization_id INT, service_type_code CHAR, service_details VARCHAR)

Give me a bar chart to show the proportion of each type of the thing that has the status 'Close' or has a status record before the date '2017-06-19 02:59:21', could you list by the X from low to high?
SELECT Type_of_Thing_Code, COUNT(Type_of_Thing_Code) FROM Timed_Status_of_Things AS T1 JOIN Things AS T2 ON T1.thing_id = T2.thing_id WHERE T1.Status_of_Thing_Code = 'Close' OR T1.Date_and_Date < '2017-06-19 02:59:21' GROUP BY Type_of_Thing_Code ORDER BY Type_of_Thing_Code
SELECT "Type_of_Thing_Code", COUNT("Type_of_Thing_Code") FROM "Timed_Status_of_Things" AS "T1" JOIN "Things" AS "T2" ON "T1"."thing_id" = "T2"."thing_id" WHERE "T1"."Date_and_Date" < '2017-06-19 02:59:21' OR "T1"."Status_of_Thing_Code" = 'Close' GROUP BY "Type_of_Thing_Code" ORDER BY "Type_of_Thing_Code" NULLS FIRST