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

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', order by the X-axis in descending.
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 DESC
SELECT "Type_of_Thing_Code", COUNT("Type_of_Thing_Code") FROM "Timed_Status_of_Things" "T1" JOIN "Things" "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" DESC