human
Schema:
Customers (Customer_ID, Customer_Details)
Customer_Policies (Policy_ID, Customer_ID, Policy_Type_Code, Start_Date, End_Date)
Claims (Claim_ID, Policy_ID, Date_Claim_Made, Date_Claim_Settled, Amount_Claimed, Amount_Settled)
Settlements (Settlement_ID, Claim_ID, Date_Claim_Made, Date_Claim_Settled, Amount_Claimed, Amount_Settled, Customer_Policy_ID)
Payments (Payment_ID, Settlement_ID, Payment_Method_Code, Date_Payment_Made, Amount_Payment)
Please answer with SQL.
assistant
Sure, I understand.
human
how many policy types are there?
assistant
SELECT COUNT( DISTINCT Policy_Type_Code ) FROM Customer_Policies;
human
what are those types?
assistant
SELECT Policy_Type_Code FROM Customer_Policies GROUP BY Policy_Type_Code;
human
how many times has a customer chosen car | There are 4 times that a customer chose a policy with type code car. | how about life?
assistant
SELECT COUNT( * ) FROM Customer_Policies WHERE Policy_type_code = "Life" ;