human
Schema:
Customers (Customer_ID, Customer_name)
Services (Service_ID, Service_name)
Available_Policies (Policy_ID, policy_type_code, Customer_Phone)
Customers_Policies (Customer_ID, Policy_ID, Date_Opened, Date_Closed)
First_Notification_of_Loss (FNOL_ID, Customer_ID, Policy_ID, Service_ID)
Claims (Claim_ID, FNOL_ID, Effective_Date)
Settlements (Settlement_ID, Claim_ID, Effective_Date, Settlement_Amount)
Please answer with SQL.
assistant
Sure, I understand.
human
How many policies are listed for the customer named 'Dayana Robel'?
assistant
SELECT COUNT( * ) FROM customers AS t1 JOIN customers_policies AS t2 ON t1.customer_id = t2.customer_id WHERE t1.customer_name = 'Dayana Robel';
human
And for America Jaskolski?
assistant
SELECT COUNT( * ) FROM customers AS t1 JOIN customers_policies AS t2 ON t1.customer_id = t2.customer_id WHERE t1.customer_name = 'America Jaskolski';
human
How many policies does Ellsworth Paucek have listed?
assistant
SELECT COUNT( * ) FROM customers AS t1 JOIN customers_policies AS t2 ON t1.customer_id = t2.customer_id WHERE t1.customer_name = "Ellsworth Paucek" ;