human
Schema:
Staff (staff_id, gender, first_name, last_name, email_address, phone_number)
Customers (customer_id, customer_type_code, address_line_1, address_line_2, town_city, state, email_address, phone_number)
Products (product_id, parent_product_id, product_category_code, date_product_first_available, date_product_discontinued, product_name, product_description, product_price)
Complaints (complaint_id, product_id, customer_id, complaint_outcome_code, complaint_status_code, complaint_type_code, date_complaint_raised, date_complaint_closed, staff_id)
Please answer with SQL.
assistant
Sure, I understand.
human
Find the number of complaints with Product Failure type for each complaint status?
assistant
SELECT complaint_status_code , COUNT( * ) FROM complaints WHERE complaint_type_code = 'Product Failure' GROUP BY complaint_status_code;
human
What were the complaint outcome code of each of those claims? | Here are the complaint outcome codes of each of Product Failure type claims. | What is the complaint status code of each of those claims?
assistant
SELECT complaint_status_code FROM complaints WHERE complaint_type_code = "Product Failure" ;