db_name
stringclasses 146
values | prompt
stringlengths 310
4.81k
|
---|---|
insurance_fnol
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# 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 )
#
# Customers_Policies.Policy_ID can be joined with Available_Policies.Policy_ID
# Customers_Policies.Customer_ID can be joined with Customers.Customer_ID
# First_Notification_of_Loss.Customer_ID can be joined with Customers_Policies.Customer_ID
# First_Notification_of_Loss.Policy_ID can be joined with Customers_Policies.Policy_ID
# First_Notification_of_Loss.Service_ID can be joined with Services.Service_ID
# Claims.FNOL_ID can be joined with First_Notification_of_Loss.FNOL_ID
# Settlements.Claim_ID can be joined with Claims.Claim_ID
#
### Question:
#
# Find the policy types more than 4 customers use. Show their type code.
#
### SQL:
#
# SELECT policy_type_code FROM available_policies GROUP BY policy_type_code HAVING count(*) > 4
#
### End.
|
insurance_fnol
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# 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 )
#
# Customers_Policies.Policy_ID can be joined with Available_Policies.Policy_ID
# Customers_Policies.Customer_ID can be joined with Customers.Customer_ID
# First_Notification_of_Loss.Customer_ID can be joined with Customers_Policies.Customer_ID
# First_Notification_of_Loss.Policy_ID can be joined with Customers_Policies.Policy_ID
# First_Notification_of_Loss.Service_ID can be joined with Services.Service_ID
# Claims.FNOL_ID can be joined with First_Notification_of_Loss.FNOL_ID
# Settlements.Claim_ID can be joined with Claims.Claim_ID
#
### Question:
#
# Find the total and average amount of settlements.
#
### SQL:
#
# SELECT sum(settlement_amount) , avg(settlement_amount) FROM settlements
#
### End.
|
insurance_fnol
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# 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 )
#
# Customers_Policies.Policy_ID can be joined with Available_Policies.Policy_ID
# Customers_Policies.Customer_ID can be joined with Customers.Customer_ID
# First_Notification_of_Loss.Customer_ID can be joined with Customers_Policies.Customer_ID
# First_Notification_of_Loss.Policy_ID can be joined with Customers_Policies.Policy_ID
# First_Notification_of_Loss.Service_ID can be joined with Services.Service_ID
# Claims.FNOL_ID can be joined with First_Notification_of_Loss.FNOL_ID
# Settlements.Claim_ID can be joined with Claims.Claim_ID
#
### Question:
#
# Return the sum and average of all settlement amounts.
#
### SQL:
#
# SELECT sum(settlement_amount) , avg(settlement_amount) FROM settlements
#
### End.
|
insurance_fnol
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# 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 )
#
# Customers_Policies.Policy_ID can be joined with Available_Policies.Policy_ID
# Customers_Policies.Customer_ID can be joined with Customers.Customer_ID
# First_Notification_of_Loss.Customer_ID can be joined with Customers_Policies.Customer_ID
# First_Notification_of_Loss.Policy_ID can be joined with Customers_Policies.Policy_ID
# First_Notification_of_Loss.Service_ID can be joined with Services.Service_ID
# Claims.FNOL_ID can be joined with First_Notification_of_Loss.FNOL_ID
# Settlements.Claim_ID can be joined with Claims.Claim_ID
#
### Question:
#
# Find the name of services that have been used for more than 2 times in first notification of loss.
#
### SQL:
#
# SELECT t2.service_name FROM first_notification_of_loss AS t1 JOIN services AS t2 ON t1.service_id = t2.service_id GROUP BY t1.service_id HAVING count(*) > 2
#
### End.
|
insurance_fnol
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# 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 )
#
# Customers_Policies.Policy_ID can be joined with Available_Policies.Policy_ID
# Customers_Policies.Customer_ID can be joined with Customers.Customer_ID
# First_Notification_of_Loss.Customer_ID can be joined with Customers_Policies.Customer_ID
# First_Notification_of_Loss.Policy_ID can be joined with Customers_Policies.Policy_ID
# First_Notification_of_Loss.Service_ID can be joined with Services.Service_ID
# Claims.FNOL_ID can be joined with First_Notification_of_Loss.FNOL_ID
# Settlements.Claim_ID can be joined with Claims.Claim_ID
#
### Question:
#
# Which services have been used more than twice in first notification of loss? Return the service name.
#
### SQL:
#
# SELECT t2.service_name FROM first_notification_of_loss AS t1 JOIN services AS t2 ON t1.service_id = t2.service_id GROUP BY t1.service_id HAVING count(*) > 2
#
### End.
|
insurance_fnol
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# 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 )
#
# Customers_Policies.Policy_ID can be joined with Available_Policies.Policy_ID
# Customers_Policies.Customer_ID can be joined with Customers.Customer_ID
# First_Notification_of_Loss.Customer_ID can be joined with Customers_Policies.Customer_ID
# First_Notification_of_Loss.Policy_ID can be joined with Customers_Policies.Policy_ID
# First_Notification_of_Loss.Service_ID can be joined with Services.Service_ID
# Claims.FNOL_ID can be joined with First_Notification_of_Loss.FNOL_ID
# Settlements.Claim_ID can be joined with Claims.Claim_ID
#
### Question:
#
# What is the effective date of the claim that has the largest amount of total settlement?
#
### SQL:
#
# SELECT t1.Effective_Date FROM claims AS t1 JOIN settlements AS t2 ON t1.claim_id = t2.claim_id GROUP BY t1.claim_id ORDER BY sum(t2.settlement_amount) DESC LIMIT 1
#
### End.
|
insurance_fnol
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# 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 )
#
# Customers_Policies.Policy_ID can be joined with Available_Policies.Policy_ID
# Customers_Policies.Customer_ID can be joined with Customers.Customer_ID
# First_Notification_of_Loss.Customer_ID can be joined with Customers_Policies.Customer_ID
# First_Notification_of_Loss.Policy_ID can be joined with Customers_Policies.Policy_ID
# First_Notification_of_Loss.Service_ID can be joined with Services.Service_ID
# Claims.FNOL_ID can be joined with First_Notification_of_Loss.FNOL_ID
# Settlements.Claim_ID can be joined with Claims.Claim_ID
#
### Question:
#
# Find the claim that has the largest total settlement amount. Return the effective date of the claim.
#
### SQL:
#
# SELECT t1.Effective_Date FROM claims AS t1 JOIN settlements AS t2 ON t1.claim_id = t2.claim_id GROUP BY t1.claim_id ORDER BY sum(t2.settlement_amount) DESC LIMIT 1
#
### End.
|
insurance_fnol
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# 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 )
#
# Customers_Policies.Policy_ID can be joined with Available_Policies.Policy_ID
# Customers_Policies.Customer_ID can be joined with Customers.Customer_ID
# First_Notification_of_Loss.Customer_ID can be joined with Customers_Policies.Customer_ID
# First_Notification_of_Loss.Policy_ID can be joined with Customers_Policies.Policy_ID
# First_Notification_of_Loss.Service_ID can be joined with Services.Service_ID
# Claims.FNOL_ID can be joined with First_Notification_of_Loss.FNOL_ID
# Settlements.Claim_ID can be joined with Claims.Claim_ID
#
### Question:
#
# How many policies are listed for the customer named "Dayana Robel"?
#
### SQL:
#
# SELECT count(*) FROM customers AS t1 JOIN customers_policies AS t2 ON t1.customer_id = t2.customer_id WHERE t1.customer_name = "Dayana Robel"
#
### End.
|
insurance_fnol
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# 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 )
#
# Customers_Policies.Policy_ID can be joined with Available_Policies.Policy_ID
# Customers_Policies.Customer_ID can be joined with Customers.Customer_ID
# First_Notification_of_Loss.Customer_ID can be joined with Customers_Policies.Customer_ID
# First_Notification_of_Loss.Policy_ID can be joined with Customers_Policies.Policy_ID
# First_Notification_of_Loss.Service_ID can be joined with Services.Service_ID
# Claims.FNOL_ID can be joined with First_Notification_of_Loss.FNOL_ID
# Settlements.Claim_ID can be joined with Claims.Claim_ID
#
### Question:
#
# Count the total number of policies used by the customer named "Dayana Robel".
#
### SQL:
#
# SELECT count(*) FROM customers AS t1 JOIN customers_policies AS t2 ON t1.customer_id = t2.customer_id WHERE t1.customer_name = "Dayana Robel"
#
### End.
|
insurance_fnol
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# 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 )
#
# Customers_Policies.Policy_ID can be joined with Available_Policies.Policy_ID
# Customers_Policies.Customer_ID can be joined with Customers.Customer_ID
# First_Notification_of_Loss.Customer_ID can be joined with Customers_Policies.Customer_ID
# First_Notification_of_Loss.Policy_ID can be joined with Customers_Policies.Policy_ID
# First_Notification_of_Loss.Service_ID can be joined with Services.Service_ID
# Claims.FNOL_ID can be joined with First_Notification_of_Loss.FNOL_ID
# Settlements.Claim_ID can be joined with Claims.Claim_ID
#
### Question:
#
# What is the name of the customer who has the most policies listed?
#
### SQL:
#
# SELECT t1.customer_name FROM customers AS t1 JOIN customers_policies AS t2 ON t1.customer_id = t2.customer_id GROUP BY t1.customer_name ORDER BY count(*) DESC LIMIT 1
#
### End.
|
insurance_fnol
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# 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 )
#
# Customers_Policies.Policy_ID can be joined with Available_Policies.Policy_ID
# Customers_Policies.Customer_ID can be joined with Customers.Customer_ID
# First_Notification_of_Loss.Customer_ID can be joined with Customers_Policies.Customer_ID
# First_Notification_of_Loss.Policy_ID can be joined with Customers_Policies.Policy_ID
# First_Notification_of_Loss.Service_ID can be joined with Services.Service_ID
# Claims.FNOL_ID can be joined with First_Notification_of_Loss.FNOL_ID
# Settlements.Claim_ID can be joined with Claims.Claim_ID
#
### Question:
#
# Which customer uses the most policies? Give me the customer name.
#
### SQL:
#
# SELECT t1.customer_name FROM customers AS t1 JOIN customers_policies AS t2 ON t1.customer_id = t2.customer_id GROUP BY t1.customer_name ORDER BY count(*) DESC LIMIT 1
#
### End.
|
insurance_fnol
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# 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 )
#
# Customers_Policies.Policy_ID can be joined with Available_Policies.Policy_ID
# Customers_Policies.Customer_ID can be joined with Customers.Customer_ID
# First_Notification_of_Loss.Customer_ID can be joined with Customers_Policies.Customer_ID
# First_Notification_of_Loss.Policy_ID can be joined with Customers_Policies.Policy_ID
# First_Notification_of_Loss.Service_ID can be joined with Services.Service_ID
# Claims.FNOL_ID can be joined with First_Notification_of_Loss.FNOL_ID
# Settlements.Claim_ID can be joined with Claims.Claim_ID
#
### Question:
#
# What are all the policy types of the customer named "Dayana Robel"?
#
### SQL:
#
# SELECT DISTINCT t3.policy_type_code FROM customers AS t1 JOIN customers_policies AS t2 ON t1.customer_id = t2.customer_id JOIN available_policies AS t3 ON t2.policy_id = t3.policy_id WHERE t1.customer_name = "Dayana Robel"
#
### End.
|
insurance_fnol
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# 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 )
#
# Customers_Policies.Policy_ID can be joined with Available_Policies.Policy_ID
# Customers_Policies.Customer_ID can be joined with Customers.Customer_ID
# First_Notification_of_Loss.Customer_ID can be joined with Customers_Policies.Customer_ID
# First_Notification_of_Loss.Policy_ID can be joined with Customers_Policies.Policy_ID
# First_Notification_of_Loss.Service_ID can be joined with Services.Service_ID
# Claims.FNOL_ID can be joined with First_Notification_of_Loss.FNOL_ID
# Settlements.Claim_ID can be joined with Claims.Claim_ID
#
### Question:
#
# Tell me the types of the policy used by the customer named "Dayana Robel".
#
### SQL:
#
# SELECT DISTINCT t3.policy_type_code FROM customers AS t1 JOIN customers_policies AS t2 ON t1.customer_id = t2.customer_id JOIN available_policies AS t3 ON t2.policy_id = t3.policy_id WHERE t1.customer_name = "Dayana Robel"
#
### End.
|
insurance_fnol
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# 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 )
#
# Customers_Policies.Policy_ID can be joined with Available_Policies.Policy_ID
# Customers_Policies.Customer_ID can be joined with Customers.Customer_ID
# First_Notification_of_Loss.Customer_ID can be joined with Customers_Policies.Customer_ID
# First_Notification_of_Loss.Policy_ID can be joined with Customers_Policies.Policy_ID
# First_Notification_of_Loss.Service_ID can be joined with Services.Service_ID
# Claims.FNOL_ID can be joined with First_Notification_of_Loss.FNOL_ID
# Settlements.Claim_ID can be joined with Claims.Claim_ID
#
### Question:
#
# What are all the policy types of the customer that has the most policies listed?
#
### SQL:
#
# SELECT DISTINCT t3.policy_type_code FROM customers AS t1 JOIN customers_policies AS t2 ON t1.customer_id = t2.customer_id JOIN available_policies AS t3 ON t2.policy_id = t3.policy_id WHERE t1.customer_name = (SELECT t1.customer_name FROM customers AS t1 JOIN customers_policies AS t2 ON t1.customer_id = t2.customer_id GROUP BY t1.customer_name ORDER BY count(*) DESC LIMIT 1)
#
### End.
|
insurance_fnol
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# 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 )
#
# Customers_Policies.Policy_ID can be joined with Available_Policies.Policy_ID
# Customers_Policies.Customer_ID can be joined with Customers.Customer_ID
# First_Notification_of_Loss.Customer_ID can be joined with Customers_Policies.Customer_ID
# First_Notification_of_Loss.Policy_ID can be joined with Customers_Policies.Policy_ID
# First_Notification_of_Loss.Service_ID can be joined with Services.Service_ID
# Claims.FNOL_ID can be joined with First_Notification_of_Loss.FNOL_ID
# Settlements.Claim_ID can be joined with Claims.Claim_ID
#
### Question:
#
# List all the policy types used by the customer enrolled in the most policies.
#
### SQL:
#
# SELECT DISTINCT t3.policy_type_code FROM customers AS t1 JOIN customers_policies AS t2 ON t1.customer_id = t2.customer_id JOIN available_policies AS t3 ON t2.policy_id = t3.policy_id WHERE t1.customer_name = (SELECT t1.customer_name FROM customers AS t1 JOIN customers_policies AS t2 ON t1.customer_id = t2.customer_id GROUP BY t1.customer_name ORDER BY count(*) DESC LIMIT 1)
#
### End.
|
insurance_fnol
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# 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 )
#
# Customers_Policies.Policy_ID can be joined with Available_Policies.Policy_ID
# Customers_Policies.Customer_ID can be joined with Customers.Customer_ID
# First_Notification_of_Loss.Customer_ID can be joined with Customers_Policies.Customer_ID
# First_Notification_of_Loss.Policy_ID can be joined with Customers_Policies.Policy_ID
# First_Notification_of_Loss.Service_ID can be joined with Services.Service_ID
# Claims.FNOL_ID can be joined with First_Notification_of_Loss.FNOL_ID
# Settlements.Claim_ID can be joined with Claims.Claim_ID
#
### Question:
#
# List all the services in the alphabetical order.
#
### SQL:
#
# SELECT service_name FROM services ORDER BY service_name
#
### End.
|
insurance_fnol
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# 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 )
#
# Customers_Policies.Policy_ID can be joined with Available_Policies.Policy_ID
# Customers_Policies.Customer_ID can be joined with Customers.Customer_ID
# First_Notification_of_Loss.Customer_ID can be joined with Customers_Policies.Customer_ID
# First_Notification_of_Loss.Policy_ID can be joined with Customers_Policies.Policy_ID
# First_Notification_of_Loss.Service_ID can be joined with Services.Service_ID
# Claims.FNOL_ID can be joined with First_Notification_of_Loss.FNOL_ID
# Settlements.Claim_ID can be joined with Claims.Claim_ID
#
### Question:
#
# Give me a list of all the service names sorted alphabetically.
#
### SQL:
#
# SELECT service_name FROM services ORDER BY service_name
#
### End.
|
insurance_fnol
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# 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 )
#
# Customers_Policies.Policy_ID can be joined with Available_Policies.Policy_ID
# Customers_Policies.Customer_ID can be joined with Customers.Customer_ID
# First_Notification_of_Loss.Customer_ID can be joined with Customers_Policies.Customer_ID
# First_Notification_of_Loss.Policy_ID can be joined with Customers_Policies.Policy_ID
# First_Notification_of_Loss.Service_ID can be joined with Services.Service_ID
# Claims.FNOL_ID can be joined with First_Notification_of_Loss.FNOL_ID
# Settlements.Claim_ID can be joined with Claims.Claim_ID
#
### Question:
#
# How many services are there?
#
### SQL:
#
# SELECT count(*) FROM services
#
### End.
|
insurance_fnol
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# 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 )
#
# Customers_Policies.Policy_ID can be joined with Available_Policies.Policy_ID
# Customers_Policies.Customer_ID can be joined with Customers.Customer_ID
# First_Notification_of_Loss.Customer_ID can be joined with Customers_Policies.Customer_ID
# First_Notification_of_Loss.Policy_ID can be joined with Customers_Policies.Policy_ID
# First_Notification_of_Loss.Service_ID can be joined with Services.Service_ID
# Claims.FNOL_ID can be joined with First_Notification_of_Loss.FNOL_ID
# Settlements.Claim_ID can be joined with Claims.Claim_ID
#
### Question:
#
# Count the total number of available services.
#
### SQL:
#
# SELECT count(*) FROM services
#
### End.
|
insurance_fnol
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# 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 )
#
# Customers_Policies.Policy_ID can be joined with Available_Policies.Policy_ID
# Customers_Policies.Customer_ID can be joined with Customers.Customer_ID
# First_Notification_of_Loss.Customer_ID can be joined with Customers_Policies.Customer_ID
# First_Notification_of_Loss.Policy_ID can be joined with Customers_Policies.Policy_ID
# First_Notification_of_Loss.Service_ID can be joined with Services.Service_ID
# Claims.FNOL_ID can be joined with First_Notification_of_Loss.FNOL_ID
# Settlements.Claim_ID can be joined with Claims.Claim_ID
#
### Question:
#
# Find the names of users who do not have a first notification of loss record.
#
### SQL:
#
# SELECT customer_name FROM customers EXCEPT SELECT t1.customer_name FROM customers AS t1 JOIN first_notification_of_loss AS t2 ON t1.customer_id = t2.customer_id
#
### End.
|
insurance_fnol
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# 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 )
#
# Customers_Policies.Policy_ID can be joined with Available_Policies.Policy_ID
# Customers_Policies.Customer_ID can be joined with Customers.Customer_ID
# First_Notification_of_Loss.Customer_ID can be joined with Customers_Policies.Customer_ID
# First_Notification_of_Loss.Policy_ID can be joined with Customers_Policies.Policy_ID
# First_Notification_of_Loss.Service_ID can be joined with Services.Service_ID
# Claims.FNOL_ID can be joined with First_Notification_of_Loss.FNOL_ID
# Settlements.Claim_ID can be joined with Claims.Claim_ID
#
### Question:
#
# Which customers do not have a first notification of loss record? Give me the customer names.
#
### SQL:
#
# SELECT customer_name FROM customers EXCEPT SELECT t1.customer_name FROM customers AS t1 JOIN first_notification_of_loss AS t2 ON t1.customer_id = t2.customer_id
#
### End.
|
insurance_fnol
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# 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 )
#
# Customers_Policies.Policy_ID can be joined with Available_Policies.Policy_ID
# Customers_Policies.Customer_ID can be joined with Customers.Customer_ID
# First_Notification_of_Loss.Customer_ID can be joined with Customers_Policies.Customer_ID
# First_Notification_of_Loss.Policy_ID can be joined with Customers_Policies.Policy_ID
# First_Notification_of_Loss.Service_ID can be joined with Services.Service_ID
# Claims.FNOL_ID can be joined with First_Notification_of_Loss.FNOL_ID
# Settlements.Claim_ID can be joined with Claims.Claim_ID
#
### Question:
#
# Find the names of customers who have used either the service "Close a policy" or the service "Upgrade a policy".
#
### SQL:
#
# SELECT t1.customer_name FROM customers AS t1 JOIN first_notification_of_loss AS t2 ON t1.customer_id = t2.customer_id JOIN services AS t3 ON t2.service_id = t3.service_id WHERE t3.service_name = "Close a policy" OR t3.service_name = "Upgrade a policy"
#
### End.
|
insurance_fnol
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# 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 )
#
# Customers_Policies.Policy_ID can be joined with Available_Policies.Policy_ID
# Customers_Policies.Customer_ID can be joined with Customers.Customer_ID
# First_Notification_of_Loss.Customer_ID can be joined with Customers_Policies.Customer_ID
# First_Notification_of_Loss.Policy_ID can be joined with Customers_Policies.Policy_ID
# First_Notification_of_Loss.Service_ID can be joined with Services.Service_ID
# Claims.FNOL_ID can be joined with First_Notification_of_Loss.FNOL_ID
# Settlements.Claim_ID can be joined with Claims.Claim_ID
#
### Question:
#
# Which customers have used the service named "Close a policy" or "Upgrade a policy"? Give me the customer names.
#
### SQL:
#
# SELECT t1.customer_name FROM customers AS t1 JOIN first_notification_of_loss AS t2 ON t1.customer_id = t2.customer_id JOIN services AS t3 ON t2.service_id = t3.service_id WHERE t3.service_name = "Close a policy" OR t3.service_name = "Upgrade a policy"
#
### End.
|
insurance_fnol
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# 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 )
#
# Customers_Policies.Policy_ID can be joined with Available_Policies.Policy_ID
# Customers_Policies.Customer_ID can be joined with Customers.Customer_ID
# First_Notification_of_Loss.Customer_ID can be joined with Customers_Policies.Customer_ID
# First_Notification_of_Loss.Policy_ID can be joined with Customers_Policies.Policy_ID
# First_Notification_of_Loss.Service_ID can be joined with Services.Service_ID
# Claims.FNOL_ID can be joined with First_Notification_of_Loss.FNOL_ID
# Settlements.Claim_ID can be joined with Claims.Claim_ID
#
### Question:
#
# Find the names of customers who have used both the service "Close a policy" and the service "New policy application".
#
### SQL:
#
# SELECT t1.customer_name FROM customers AS t1 JOIN first_notification_of_loss AS t2 ON t1.customer_id = t2.customer_id JOIN services AS t3 ON t2.service_id = t3.service_id WHERE t3.service_name = "Close a policy" INTERSECT SELECT t1.customer_name FROM customers AS t1 JOIN first_notification_of_loss AS t2 ON t1.customer_id = t2.customer_id JOIN services AS t3 ON t2.service_id = t3.service_id WHERE t3.service_name = "New policy application"
#
### End.
|
insurance_fnol
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# 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 )
#
# Customers_Policies.Policy_ID can be joined with Available_Policies.Policy_ID
# Customers_Policies.Customer_ID can be joined with Customers.Customer_ID
# First_Notification_of_Loss.Customer_ID can be joined with Customers_Policies.Customer_ID
# First_Notification_of_Loss.Policy_ID can be joined with Customers_Policies.Policy_ID
# First_Notification_of_Loss.Service_ID can be joined with Services.Service_ID
# Claims.FNOL_ID can be joined with First_Notification_of_Loss.FNOL_ID
# Settlements.Claim_ID can be joined with Claims.Claim_ID
#
### Question:
#
# Which customers have used both the service named "Close a policy" and the service named "Upgrade a policy"? Give me the customer names.
#
### SQL:
#
# SELECT t1.customer_name FROM customers AS t1 JOIN first_notification_of_loss AS t2 ON t1.customer_id = t2.customer_id JOIN services AS t3 ON t2.service_id = t3.service_id WHERE t3.service_name = "Close a policy" INTERSECT SELECT t1.customer_name FROM customers AS t1 JOIN first_notification_of_loss AS t2 ON t1.customer_id = t2.customer_id JOIN services AS t3 ON t2.service_id = t3.service_id WHERE t3.service_name = "New policy application"
#
### End.
|
insurance_fnol
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# 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 )
#
# Customers_Policies.Policy_ID can be joined with Available_Policies.Policy_ID
# Customers_Policies.Customer_ID can be joined with Customers.Customer_ID
# First_Notification_of_Loss.Customer_ID can be joined with Customers_Policies.Customer_ID
# First_Notification_of_Loss.Policy_ID can be joined with Customers_Policies.Policy_ID
# First_Notification_of_Loss.Service_ID can be joined with Services.Service_ID
# Claims.FNOL_ID can be joined with First_Notification_of_Loss.FNOL_ID
# Settlements.Claim_ID can be joined with Claims.Claim_ID
#
### Question:
#
# Find the IDs of customers whose name contains "Diana".
#
### SQL:
#
# SELECT customer_id FROM customers WHERE customer_name LIKE "%Diana%"
#
### End.
|
insurance_fnol
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# 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 )
#
# Customers_Policies.Policy_ID can be joined with Available_Policies.Policy_ID
# Customers_Policies.Customer_ID can be joined with Customers.Customer_ID
# First_Notification_of_Loss.Customer_ID can be joined with Customers_Policies.Customer_ID
# First_Notification_of_Loss.Policy_ID can be joined with Customers_Policies.Policy_ID
# First_Notification_of_Loss.Service_ID can be joined with Services.Service_ID
# Claims.FNOL_ID can be joined with First_Notification_of_Loss.FNOL_ID
# Settlements.Claim_ID can be joined with Claims.Claim_ID
#
### Question:
#
# What are the IDs of customers who have "Diana" in part of their names?
#
### SQL:
#
# SELECT customer_id FROM customers WHERE customer_name LIKE "%Diana%"
#
### End.
|
insurance_fnol
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# 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 )
#
# Customers_Policies.Policy_ID can be joined with Available_Policies.Policy_ID
# Customers_Policies.Customer_ID can be joined with Customers.Customer_ID
# First_Notification_of_Loss.Customer_ID can be joined with Customers_Policies.Customer_ID
# First_Notification_of_Loss.Policy_ID can be joined with Customers_Policies.Policy_ID
# First_Notification_of_Loss.Service_ID can be joined with Services.Service_ID
# Claims.FNOL_ID can be joined with First_Notification_of_Loss.FNOL_ID
# Settlements.Claim_ID can be joined with Claims.Claim_ID
#
### Question:
#
# What are the maximum and minimum settlement amount on record?
#
### SQL:
#
# SELECT max(settlement_amount) , min(settlement_amount) FROM settlements
#
### End.
|
insurance_fnol
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# 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 )
#
# Customers_Policies.Policy_ID can be joined with Available_Policies.Policy_ID
# Customers_Policies.Customer_ID can be joined with Customers.Customer_ID
# First_Notification_of_Loss.Customer_ID can be joined with Customers_Policies.Customer_ID
# First_Notification_of_Loss.Policy_ID can be joined with Customers_Policies.Policy_ID
# First_Notification_of_Loss.Service_ID can be joined with Services.Service_ID
# Claims.FNOL_ID can be joined with First_Notification_of_Loss.FNOL_ID
# Settlements.Claim_ID can be joined with Claims.Claim_ID
#
### Question:
#
# Find the maximum and minimum settlement amount.
#
### SQL:
#
# SELECT max(settlement_amount) , min(settlement_amount) FROM settlements
#
### End.
|
insurance_fnol
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# 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 )
#
# Customers_Policies.Policy_ID can be joined with Available_Policies.Policy_ID
# Customers_Policies.Customer_ID can be joined with Customers.Customer_ID
# First_Notification_of_Loss.Customer_ID can be joined with Customers_Policies.Customer_ID
# First_Notification_of_Loss.Policy_ID can be joined with Customers_Policies.Policy_ID
# First_Notification_of_Loss.Service_ID can be joined with Services.Service_ID
# Claims.FNOL_ID can be joined with First_Notification_of_Loss.FNOL_ID
# Settlements.Claim_ID can be joined with Claims.Claim_ID
#
### Question:
#
# List all the customers in increasing order of IDs.
#
### SQL:
#
# SELECT customer_id , customer_name FROM customers ORDER BY customer_id ASC
#
### End.
|
insurance_fnol
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# 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 )
#
# Customers_Policies.Policy_ID can be joined with Available_Policies.Policy_ID
# Customers_Policies.Customer_ID can be joined with Customers.Customer_ID
# First_Notification_of_Loss.Customer_ID can be joined with Customers_Policies.Customer_ID
# First_Notification_of_Loss.Policy_ID can be joined with Customers_Policies.Policy_ID
# First_Notification_of_Loss.Service_ID can be joined with Services.Service_ID
# Claims.FNOL_ID can be joined with First_Notification_of_Loss.FNOL_ID
# Settlements.Claim_ID can be joined with Claims.Claim_ID
#
### Question:
#
# What is the ordered list of customer ids?
#
### SQL:
#
# SELECT customer_id , customer_name FROM customers ORDER BY customer_id ASC
#
### End.
|
insurance_fnol
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# 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 )
#
# Customers_Policies.Policy_ID can be joined with Available_Policies.Policy_ID
# Customers_Policies.Customer_ID can be joined with Customers.Customer_ID
# First_Notification_of_Loss.Customer_ID can be joined with Customers_Policies.Customer_ID
# First_Notification_of_Loss.Policy_ID can be joined with Customers_Policies.Policy_ID
# First_Notification_of_Loss.Service_ID can be joined with Services.Service_ID
# Claims.FNOL_ID can be joined with First_Notification_of_Loss.FNOL_ID
# Settlements.Claim_ID can be joined with Claims.Claim_ID
#
### Question:
#
# Retrieve the open and close dates of all the policies associated with the customer whose name contains "Diana"
#
### SQL:
#
# SELECT t2.date_opened , t2.date_closed FROM customers AS t1 JOIN customers_policies AS t2 ON t1.customer_id = t2.customer_id WHERE t1.customer_name LIKE "%Diana%"
#
### End.
|
insurance_fnol
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# 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 )
#
# Customers_Policies.Policy_ID can be joined with Available_Policies.Policy_ID
# Customers_Policies.Customer_ID can be joined with Customers.Customer_ID
# First_Notification_of_Loss.Customer_ID can be joined with Customers_Policies.Customer_ID
# First_Notification_of_Loss.Policy_ID can be joined with Customers_Policies.Policy_ID
# First_Notification_of_Loss.Service_ID can be joined with Services.Service_ID
# Claims.FNOL_ID can be joined with First_Notification_of_Loss.FNOL_ID
# Settlements.Claim_ID can be joined with Claims.Claim_ID
#
### Question:
#
# What are the open and close dates of all the policies used by the customer who have "Diana" in part of their names?
#
### SQL:
#
# SELECT t2.date_opened , t2.date_closed FROM customers AS t1 JOIN customers_policies AS t2 ON t1.customer_id = t2.customer_id WHERE t1.customer_name LIKE "%Diana%"
#
### End.
|
medicine_enzyme_interaction
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# medicine ( id, name, Trade_Name, FDA_approved )
# enzyme ( id, name, Location, Product, Chromosome, OMIM, Porphyria )
# medicine_enzyme_interaction ( enzyme_id, medicine_id, interaction_type )
#
# medicine_enzyme_interaction.medicine_id can be joined with medicine.id
# medicine_enzyme_interaction.enzyme_id can be joined with enzyme.id
#
### Question:
#
# How many kinds of enzymes are there?
#
### SQL:
#
# SELECT count(*) FROM enzyme
#
### End.
|
medicine_enzyme_interaction
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# medicine ( id, name, Trade_Name, FDA_approved )
# enzyme ( id, name, Location, Product, Chromosome, OMIM, Porphyria )
# medicine_enzyme_interaction ( enzyme_id, medicine_id, interaction_type )
#
# medicine_enzyme_interaction.medicine_id can be joined with medicine.id
# medicine_enzyme_interaction.enzyme_id can be joined with enzyme.id
#
### Question:
#
# What is the total count of enzymes?
#
### SQL:
#
# SELECT count(*) FROM enzyme
#
### End.
|
medicine_enzyme_interaction
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# medicine ( id, name, Trade_Name, FDA_approved )
# enzyme ( id, name, Location, Product, Chromosome, OMIM, Porphyria )
# medicine_enzyme_interaction ( enzyme_id, medicine_id, interaction_type )
#
# medicine_enzyme_interaction.medicine_id can be joined with medicine.id
# medicine_enzyme_interaction.enzyme_id can be joined with enzyme.id
#
### Question:
#
# List the name of enzymes in descending lexicographical order.
#
### SQL:
#
# SELECT name FROM enzyme ORDER BY name DESC
#
### End.
|
medicine_enzyme_interaction
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# medicine ( id, name, Trade_Name, FDA_approved )
# enzyme ( id, name, Location, Product, Chromosome, OMIM, Porphyria )
# medicine_enzyme_interaction ( enzyme_id, medicine_id, interaction_type )
#
# medicine_enzyme_interaction.medicine_id can be joined with medicine.id
# medicine_enzyme_interaction.enzyme_id can be joined with enzyme.id
#
### Question:
#
# What are the names of enzymes in descending order?
#
### SQL:
#
# SELECT name FROM enzyme ORDER BY name DESC
#
### End.
|
medicine_enzyme_interaction
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# medicine ( id, name, Trade_Name, FDA_approved )
# enzyme ( id, name, Location, Product, Chromosome, OMIM, Porphyria )
# medicine_enzyme_interaction ( enzyme_id, medicine_id, interaction_type )
#
# medicine_enzyme_interaction.medicine_id can be joined with medicine.id
# medicine_enzyme_interaction.enzyme_id can be joined with enzyme.id
#
### Question:
#
# List the names and the locations that the enzymes can make an effect.
#
### SQL:
#
# SELECT name , LOCATION FROM enzyme
#
### End.
|
medicine_enzyme_interaction
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# medicine ( id, name, Trade_Name, FDA_approved )
# enzyme ( id, name, Location, Product, Chromosome, OMIM, Porphyria )
# medicine_enzyme_interaction ( enzyme_id, medicine_id, interaction_type )
#
# medicine_enzyme_interaction.medicine_id can be joined with medicine.id
# medicine_enzyme_interaction.enzyme_id can be joined with enzyme.id
#
### Question:
#
# What are the names and locations of all enzymes listed?
#
### SQL:
#
# SELECT name , LOCATION FROM enzyme
#
### End.
|
medicine_enzyme_interaction
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# medicine ( id, name, Trade_Name, FDA_approved )
# enzyme ( id, name, Location, Product, Chromosome, OMIM, Porphyria )
# medicine_enzyme_interaction ( enzyme_id, medicine_id, interaction_type )
#
# medicine_enzyme_interaction.medicine_id can be joined with medicine.id
# medicine_enzyme_interaction.enzyme_id can be joined with enzyme.id
#
### Question:
#
# What is the maximum Online Mendelian Inheritance in Man (OMIM) value of the enzymes?
#
### SQL:
#
# SELECT max(OMIM) FROM enzyme
#
### End.
|
medicine_enzyme_interaction
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# medicine ( id, name, Trade_Name, FDA_approved )
# enzyme ( id, name, Location, Product, Chromosome, OMIM, Porphyria )
# medicine_enzyme_interaction ( enzyme_id, medicine_id, interaction_type )
#
# medicine_enzyme_interaction.medicine_id can be joined with medicine.id
# medicine_enzyme_interaction.enzyme_id can be joined with enzyme.id
#
### Question:
#
# What is the maximum OMIM value in the database?
#
### SQL:
#
# SELECT max(OMIM) FROM enzyme
#
### End.
|
medicine_enzyme_interaction
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# medicine ( id, name, Trade_Name, FDA_approved )
# enzyme ( id, name, Location, Product, Chromosome, OMIM, Porphyria )
# medicine_enzyme_interaction ( enzyme_id, medicine_id, interaction_type )
#
# medicine_enzyme_interaction.medicine_id can be joined with medicine.id
# medicine_enzyme_interaction.enzyme_id can be joined with enzyme.id
#
### Question:
#
# What is the product, chromosome and porphyria related to the enzymes which take effect at the location 'Cytosol'?
#
### SQL:
#
# SELECT product , chromosome , porphyria FROM enzyme WHERE LOCATION = 'Cytosol'
#
### End.
|
medicine_enzyme_interaction
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# medicine ( id, name, Trade_Name, FDA_approved )
# enzyme ( id, name, Location, Product, Chromosome, OMIM, Porphyria )
# medicine_enzyme_interaction ( enzyme_id, medicine_id, interaction_type )
#
# medicine_enzyme_interaction.medicine_id can be joined with medicine.id
# medicine_enzyme_interaction.enzyme_id can be joined with enzyme.id
#
### Question:
#
# What is the product, chromosome, and porphyria of the enzymes located at 'Cytosol'?
#
### SQL:
#
# SELECT product , chromosome , porphyria FROM enzyme WHERE LOCATION = 'Cytosol'
#
### End.
|
medicine_enzyme_interaction
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# medicine ( id, name, Trade_Name, FDA_approved )
# enzyme ( id, name, Location, Product, Chromosome, OMIM, Porphyria )
# medicine_enzyme_interaction ( enzyme_id, medicine_id, interaction_type )
#
# medicine_enzyme_interaction.medicine_id can be joined with medicine.id
# medicine_enzyme_interaction.enzyme_id can be joined with enzyme.id
#
### Question:
#
# What are the names of enzymes who does not produce 'Heme'?
#
### SQL:
#
# SELECT name FROM enzyme WHERE product != 'Heme'
#
### End.
|
medicine_enzyme_interaction
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# medicine ( id, name, Trade_Name, FDA_approved )
# enzyme ( id, name, Location, Product, Chromosome, OMIM, Porphyria )
# medicine_enzyme_interaction ( enzyme_id, medicine_id, interaction_type )
#
# medicine_enzyme_interaction.medicine_id can be joined with medicine.id
# medicine_enzyme_interaction.enzyme_id can be joined with enzyme.id
#
### Question:
#
# What are the names of enzymes whose product is not 'Heme'?
#
### SQL:
#
# SELECT name FROM enzyme WHERE product != 'Heme'
#
### End.
|
medicine_enzyme_interaction
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# medicine ( id, name, Trade_Name, FDA_approved )
# enzyme ( id, name, Location, Product, Chromosome, OMIM, Porphyria )
# medicine_enzyme_interaction ( enzyme_id, medicine_id, interaction_type )
#
# medicine_enzyme_interaction.medicine_id can be joined with medicine.id
# medicine_enzyme_interaction.enzyme_id can be joined with enzyme.id
#
### Question:
#
# What are the names and trade names of the medicines which has 'Yes' value in the FDA record?
#
### SQL:
#
# SELECT name , trade_name FROM medicine WHERE FDA_approved = 'Yes'
#
### End.
|
medicine_enzyme_interaction
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# medicine ( id, name, Trade_Name, FDA_approved )
# enzyme ( id, name, Location, Product, Chromosome, OMIM, Porphyria )
# medicine_enzyme_interaction ( enzyme_id, medicine_id, interaction_type )
#
# medicine_enzyme_interaction.medicine_id can be joined with medicine.id
# medicine_enzyme_interaction.enzyme_id can be joined with enzyme.id
#
### Question:
#
# What are the names and trade names of the medcines that are FDA approved?
#
### SQL:
#
# SELECT name , trade_name FROM medicine WHERE FDA_approved = 'Yes'
#
### End.
|
medicine_enzyme_interaction
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# medicine ( id, name, Trade_Name, FDA_approved )
# enzyme ( id, name, Location, Product, Chromosome, OMIM, Porphyria )
# medicine_enzyme_interaction ( enzyme_id, medicine_id, interaction_type )
#
# medicine_enzyme_interaction.medicine_id can be joined with medicine.id
# medicine_enzyme_interaction.enzyme_id can be joined with enzyme.id
#
### Question:
#
# What are the names of enzymes in the medicine named 'Amisulpride' that can serve as an 'inhibitor'?
#
### SQL:
#
# SELECT T1.name FROM enzyme AS T1 JOIN medicine_enzyme_interaction AS T2 ON T1.id = T2.enzyme_id JOIN medicine AS T3 ON T2.medicine_id = T3.id WHERE T3.name = 'Amisulpride' AND T2.interaction_type = 'inhibitor'
#
### End.
|
medicine_enzyme_interaction
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# medicine ( id, name, Trade_Name, FDA_approved )
# enzyme ( id, name, Location, Product, Chromosome, OMIM, Porphyria )
# medicine_enzyme_interaction ( enzyme_id, medicine_id, interaction_type )
#
# medicine_enzyme_interaction.medicine_id can be joined with medicine.id
# medicine_enzyme_interaction.enzyme_id can be joined with enzyme.id
#
### Question:
#
# What are the names of the enzymes used in the medicine Amisulpride that acts as inhibitors?
#
### SQL:
#
# SELECT T1.name FROM enzyme AS T1 JOIN medicine_enzyme_interaction AS T2 ON T1.id = T2.enzyme_id JOIN medicine AS T3 ON T2.medicine_id = T3.id WHERE T3.name = 'Amisulpride' AND T2.interaction_type = 'inhibitor'
#
### End.
|
medicine_enzyme_interaction
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# medicine ( id, name, Trade_Name, FDA_approved )
# enzyme ( id, name, Location, Product, Chromosome, OMIM, Porphyria )
# medicine_enzyme_interaction ( enzyme_id, medicine_id, interaction_type )
#
# medicine_enzyme_interaction.medicine_id can be joined with medicine.id
# medicine_enzyme_interaction.enzyme_id can be joined with enzyme.id
#
### Question:
#
# What are the ids and names of the medicine that can interact with two or more enzymes?
#
### SQL:
#
# SELECT T1.id , T1.Name FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id = T1.id GROUP BY T1.id HAVING count(*) >= 2
#
### End.
|
medicine_enzyme_interaction
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# medicine ( id, name, Trade_Name, FDA_approved )
# enzyme ( id, name, Location, Product, Chromosome, OMIM, Porphyria )
# medicine_enzyme_interaction ( enzyme_id, medicine_id, interaction_type )
#
# medicine_enzyme_interaction.medicine_id can be joined with medicine.id
# medicine_enzyme_interaction.enzyme_id can be joined with enzyme.id
#
### Question:
#
# For every medicine id, what are the names of the medicines that can interact with more than one enzyme?
#
### SQL:
#
# SELECT T1.id , T1.Name FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id = T1.id GROUP BY T1.id HAVING count(*) >= 2
#
### End.
|
medicine_enzyme_interaction
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# medicine ( id, name, Trade_Name, FDA_approved )
# enzyme ( id, name, Location, Product, Chromosome, OMIM, Porphyria )
# medicine_enzyme_interaction ( enzyme_id, medicine_id, interaction_type )
#
# medicine_enzyme_interaction.medicine_id can be joined with medicine.id
# medicine_enzyme_interaction.enzyme_id can be joined with enzyme.id
#
### Question:
#
# What are the ids, names and FDA approval status of medicines in descending order of the number of enzymes that it can interact with.
#
### SQL:
#
# SELECT T1.id , T1.Name , T1.FDA_approved FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id = T1.id GROUP BY T1.id ORDER BY count(*) DESC
#
### End.
|
medicine_enzyme_interaction
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# medicine ( id, name, Trade_Name, FDA_approved )
# enzyme ( id, name, Location, Product, Chromosome, OMIM, Porphyria )
# medicine_enzyme_interaction ( enzyme_id, medicine_id, interaction_type )
#
# medicine_enzyme_interaction.medicine_id can be joined with medicine.id
# medicine_enzyme_interaction.enzyme_id can be joined with enzyme.id
#
### Question:
#
# What are the ids, names, and FDA approval status for medicines ordered by descending number of possible enzyme interactions?
#
### SQL:
#
# SELECT T1.id , T1.Name , T1.FDA_approved FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id = T1.id GROUP BY T1.id ORDER BY count(*) DESC
#
### End.
|
medicine_enzyme_interaction
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# medicine ( id, name, Trade_Name, FDA_approved )
# enzyme ( id, name, Location, Product, Chromosome, OMIM, Porphyria )
# medicine_enzyme_interaction ( enzyme_id, medicine_id, interaction_type )
#
# medicine_enzyme_interaction.medicine_id can be joined with medicine.id
# medicine_enzyme_interaction.enzyme_id can be joined with enzyme.id
#
### Question:
#
# What is the id and name of the enzyme with most number of medicines that can interact as 'activator'?
#
### SQL:
#
# SELECT T1.id , T1.name FROM enzyme AS T1 JOIN medicine_enzyme_interaction AS T2 ON T1.id = T2.enzyme_id WHERE T2.interaction_type = 'activitor' GROUP BY T1.id ORDER BY count(*) DESC LIMIT 1
#
### End.
|
medicine_enzyme_interaction
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# medicine ( id, name, Trade_Name, FDA_approved )
# enzyme ( id, name, Location, Product, Chromosome, OMIM, Porphyria )
# medicine_enzyme_interaction ( enzyme_id, medicine_id, interaction_type )
#
# medicine_enzyme_interaction.medicine_id can be joined with medicine.id
# medicine_enzyme_interaction.enzyme_id can be joined with enzyme.id
#
### Question:
#
# What is the id and name of the enzyme that can interact with the most medicines as an activator?
#
### SQL:
#
# SELECT T1.id , T1.name FROM enzyme AS T1 JOIN medicine_enzyme_interaction AS T2 ON T1.id = T2.enzyme_id WHERE T2.interaction_type = 'activitor' GROUP BY T1.id ORDER BY count(*) DESC LIMIT 1
#
### End.
|
medicine_enzyme_interaction
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# medicine ( id, name, Trade_Name, FDA_approved )
# enzyme ( id, name, Location, Product, Chromosome, OMIM, Porphyria )
# medicine_enzyme_interaction ( enzyme_id, medicine_id, interaction_type )
#
# medicine_enzyme_interaction.medicine_id can be joined with medicine.id
# medicine_enzyme_interaction.enzyme_id can be joined with enzyme.id
#
### Question:
#
# What is the interaction type of the enzyme named 'ALA synthase' and the medicine named 'Aripiprazole'?
#
### SQL:
#
# SELECT T1.interaction_type FROM medicine_enzyme_interaction AS T1 JOIN medicine AS T2 ON T1.medicine_id = T2.id JOIN enzyme AS T3 ON T1.enzyme_id = T3.id WHERE T3.name = 'ALA synthase' AND T2.name = 'Aripiprazole'
#
### End.
|
medicine_enzyme_interaction
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# medicine ( id, name, Trade_Name, FDA_approved )
# enzyme ( id, name, Location, Product, Chromosome, OMIM, Porphyria )
# medicine_enzyme_interaction ( enzyme_id, medicine_id, interaction_type )
#
# medicine_enzyme_interaction.medicine_id can be joined with medicine.id
# medicine_enzyme_interaction.enzyme_id can be joined with enzyme.id
#
### Question:
#
# What is the type of interaction for the enzyme named 'ALA synthase' and the medicine named 'Aripiprazole'?
#
### SQL:
#
# SELECT T1.interaction_type FROM medicine_enzyme_interaction AS T1 JOIN medicine AS T2 ON T1.medicine_id = T2.id JOIN enzyme AS T3 ON T1.enzyme_id = T3.id WHERE T3.name = 'ALA synthase' AND T2.name = 'Aripiprazole'
#
### End.
|
medicine_enzyme_interaction
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# medicine ( id, name, Trade_Name, FDA_approved )
# enzyme ( id, name, Location, Product, Chromosome, OMIM, Porphyria )
# medicine_enzyme_interaction ( enzyme_id, medicine_id, interaction_type )
#
# medicine_enzyme_interaction.medicine_id can be joined with medicine.id
# medicine_enzyme_interaction.enzyme_id can be joined with enzyme.id
#
### Question:
#
# What is the most common interaction type between enzymes and medicine? And how many are there?
#
### SQL:
#
# SELECT interaction_type , count(*) FROM medicine_enzyme_interaction GROUP BY interaction_type ORDER BY count(*) DESC LIMIT 1
#
### End.
|
medicine_enzyme_interaction
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# medicine ( id, name, Trade_Name, FDA_approved )
# enzyme ( id, name, Location, Product, Chromosome, OMIM, Porphyria )
# medicine_enzyme_interaction ( enzyme_id, medicine_id, interaction_type )
#
# medicine_enzyme_interaction.medicine_id can be joined with medicine.id
# medicine_enzyme_interaction.enzyme_id can be joined with enzyme.id
#
### Question:
#
# What are the most common types of interactions between enzymes and medicine, and how many types are there?
#
### SQL:
#
# SELECT interaction_type , count(*) FROM medicine_enzyme_interaction GROUP BY interaction_type ORDER BY count(*) DESC LIMIT 1
#
### End.
|
medicine_enzyme_interaction
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# medicine ( id, name, Trade_Name, FDA_approved )
# enzyme ( id, name, Location, Product, Chromosome, OMIM, Porphyria )
# medicine_enzyme_interaction ( enzyme_id, medicine_id, interaction_type )
#
# medicine_enzyme_interaction.medicine_id can be joined with medicine.id
# medicine_enzyme_interaction.enzyme_id can be joined with enzyme.id
#
### Question:
#
# How many medicines have the FDA approval status 'No' ?
#
### SQL:
#
# SELECT count(*) FROM medicine WHERE FDA_approved = 'No'
#
### End.
|
medicine_enzyme_interaction
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# medicine ( id, name, Trade_Name, FDA_approved )
# enzyme ( id, name, Location, Product, Chromosome, OMIM, Porphyria )
# medicine_enzyme_interaction ( enzyme_id, medicine_id, interaction_type )
#
# medicine_enzyme_interaction.medicine_id can be joined with medicine.id
# medicine_enzyme_interaction.enzyme_id can be joined with enzyme.id
#
### Question:
#
# How many medicines were not approved by the FDA?
#
### SQL:
#
# SELECT count(*) FROM medicine WHERE FDA_approved = 'No'
#
### End.
|
medicine_enzyme_interaction
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# medicine ( id, name, Trade_Name, FDA_approved )
# enzyme ( id, name, Location, Product, Chromosome, OMIM, Porphyria )
# medicine_enzyme_interaction ( enzyme_id, medicine_id, interaction_type )
#
# medicine_enzyme_interaction.medicine_id can be joined with medicine.id
# medicine_enzyme_interaction.enzyme_id can be joined with enzyme.id
#
### Question:
#
# How many enzymes do not have any interactions?
#
### SQL:
#
# SELECT count(*) FROM enzyme WHERE id NOT IN ( SELECT enzyme_id FROM medicine_enzyme_interaction );
#
### End.
|
medicine_enzyme_interaction
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# medicine ( id, name, Trade_Name, FDA_approved )
# enzyme ( id, name, Location, Product, Chromosome, OMIM, Porphyria )
# medicine_enzyme_interaction ( enzyme_id, medicine_id, interaction_type )
#
# medicine_enzyme_interaction.medicine_id can be joined with medicine.id
# medicine_enzyme_interaction.enzyme_id can be joined with enzyme.id
#
### Question:
#
# What is the count of enzymes without any interactions?
#
### SQL:
#
# SELECT count(*) FROM enzyme WHERE id NOT IN ( SELECT enzyme_id FROM medicine_enzyme_interaction );
#
### End.
|
medicine_enzyme_interaction
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# medicine ( id, name, Trade_Name, FDA_approved )
# enzyme ( id, name, Location, Product, Chromosome, OMIM, Porphyria )
# medicine_enzyme_interaction ( enzyme_id, medicine_id, interaction_type )
#
# medicine_enzyme_interaction.medicine_id can be joined with medicine.id
# medicine_enzyme_interaction.enzyme_id can be joined with enzyme.id
#
### Question:
#
# What is the id and trade name of the medicines can interact with at least 3 enzymes?
#
### SQL:
#
# SELECT T1.id , T1.trade_name FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id = T1.id GROUP BY T1.id HAVING COUNT(*) >= 3
#
### End.
|
medicine_enzyme_interaction
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# medicine ( id, name, Trade_Name, FDA_approved )
# enzyme ( id, name, Location, Product, Chromosome, OMIM, Porphyria )
# medicine_enzyme_interaction ( enzyme_id, medicine_id, interaction_type )
#
# medicine_enzyme_interaction.medicine_id can be joined with medicine.id
# medicine_enzyme_interaction.enzyme_id can be joined with enzyme.id
#
### Question:
#
# What are the ids and trade names of the medicine that can interact with at least 3 enzymes?
#
### SQL:
#
# SELECT T1.id , T1.trade_name FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id = T1.id GROUP BY T1.id HAVING COUNT(*) >= 3
#
### End.
|
medicine_enzyme_interaction
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# medicine ( id, name, Trade_Name, FDA_approved )
# enzyme ( id, name, Location, Product, Chromosome, OMIM, Porphyria )
# medicine_enzyme_interaction ( enzyme_id, medicine_id, interaction_type )
#
# medicine_enzyme_interaction.medicine_id can be joined with medicine.id
# medicine_enzyme_interaction.enzyme_id can be joined with enzyme.id
#
### Question:
#
# What are the distinct name, location and products of the enzymes which has any 'inhibitor' interaction?
#
### SQL:
#
# SELECT DISTINCT T1.name , T1.location , T1.product FROM enzyme AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.enzyme_id = T1.id WHERE T2.interaction_type = 'inhibitor'
#
### End.
|
medicine_enzyme_interaction
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# medicine ( id, name, Trade_Name, FDA_approved )
# enzyme ( id, name, Location, Product, Chromosome, OMIM, Porphyria )
# medicine_enzyme_interaction ( enzyme_id, medicine_id, interaction_type )
#
# medicine_enzyme_interaction.medicine_id can be joined with medicine.id
# medicine_enzyme_interaction.enzyme_id can be joined with enzyme.id
#
### Question:
#
# What are the different names, locations, and products of the enzymes that are capable inhibitor interactions?
#
### SQL:
#
# SELECT DISTINCT T1.name , T1.location , T1.product FROM enzyme AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.enzyme_id = T1.id WHERE T2.interaction_type = 'inhibitor'
#
### End.
|
medicine_enzyme_interaction
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# medicine ( id, name, Trade_Name, FDA_approved )
# enzyme ( id, name, Location, Product, Chromosome, OMIM, Porphyria )
# medicine_enzyme_interaction ( enzyme_id, medicine_id, interaction_type )
#
# medicine_enzyme_interaction.medicine_id can be joined with medicine.id
# medicine_enzyme_interaction.enzyme_id can be joined with enzyme.id
#
### Question:
#
# List the medicine name and trade name which can both interact as 'inhibitor' and 'activitor' with enzymes.
#
### SQL:
#
# SELECT T1.name , T1.trade_name FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id = T1.id WHERE interaction_type = 'inhibitor' INTERSECT SELECT T1.name , T1.trade_name FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id = T1.id WHERE interaction_type = 'activitor'
#
### End.
|
medicine_enzyme_interaction
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# medicine ( id, name, Trade_Name, FDA_approved )
# enzyme ( id, name, Location, Product, Chromosome, OMIM, Porphyria )
# medicine_enzyme_interaction ( enzyme_id, medicine_id, interaction_type )
#
# medicine_enzyme_interaction.medicine_id can be joined with medicine.id
# medicine_enzyme_interaction.enzyme_id can be joined with enzyme.id
#
### Question:
#
# What are the medicine and trade names that can interact as an inhibitor and activitor with enzymes?
#
### SQL:
#
# SELECT T1.name , T1.trade_name FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id = T1.id WHERE interaction_type = 'inhibitor' INTERSECT SELECT T1.name , T1.trade_name FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id = T1.id WHERE interaction_type = 'activitor'
#
### End.
|
medicine_enzyme_interaction
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# medicine ( id, name, Trade_Name, FDA_approved )
# enzyme ( id, name, Location, Product, Chromosome, OMIM, Porphyria )
# medicine_enzyme_interaction ( enzyme_id, medicine_id, interaction_type )
#
# medicine_enzyme_interaction.medicine_id can be joined with medicine.id
# medicine_enzyme_interaction.enzyme_id can be joined with enzyme.id
#
### Question:
#
# Show the medicine names and trade names that cannot interact with the enzyme with product 'Heme'.
#
### SQL:
#
# SELECT name , trade_name FROM medicine EXCEPT SELECT T1.name , T1.trade_name FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id = T1.id JOIN enzyme AS T3 ON T3.id = T2.enzyme_id WHERE T3.product = 'Protoporphyrinogen IX'
#
### End.
|
medicine_enzyme_interaction
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# medicine ( id, name, Trade_Name, FDA_approved )
# enzyme ( id, name, Location, Product, Chromosome, OMIM, Porphyria )
# medicine_enzyme_interaction ( enzyme_id, medicine_id, interaction_type )
#
# medicine_enzyme_interaction.medicine_id can be joined with medicine.id
# medicine_enzyme_interaction.enzyme_id can be joined with enzyme.id
#
### Question:
#
# What are the medicine and trade names that cannot interact with the enzyme with the product 'Heme'?
#
### SQL:
#
# SELECT name , trade_name FROM medicine EXCEPT SELECT T1.name , T1.trade_name FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id = T1.id JOIN enzyme AS T3 ON T3.id = T2.enzyme_id WHERE T3.product = 'Protoporphyrinogen IX'
#
### End.
|
medicine_enzyme_interaction
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# medicine ( id, name, Trade_Name, FDA_approved )
# enzyme ( id, name, Location, Product, Chromosome, OMIM, Porphyria )
# medicine_enzyme_interaction ( enzyme_id, medicine_id, interaction_type )
#
# medicine_enzyme_interaction.medicine_id can be joined with medicine.id
# medicine_enzyme_interaction.enzyme_id can be joined with enzyme.id
#
### Question:
#
# How many distinct FDA approval statuses are there for the medicines?
#
### SQL:
#
# SELECT count(DISTINCT FDA_approved) FROM medicine
#
### End.
|
medicine_enzyme_interaction
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# medicine ( id, name, Trade_Name, FDA_approved )
# enzyme ( id, name, Location, Product, Chromosome, OMIM, Porphyria )
# medicine_enzyme_interaction ( enzyme_id, medicine_id, interaction_type )
#
# medicine_enzyme_interaction.medicine_id can be joined with medicine.id
# medicine_enzyme_interaction.enzyme_id can be joined with enzyme.id
#
### Question:
#
# How many different FDA approval statuses exist for medicines?
#
### SQL:
#
# SELECT count(DISTINCT FDA_approved) FROM medicine
#
### End.
|
medicine_enzyme_interaction
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# medicine ( id, name, Trade_Name, FDA_approved )
# enzyme ( id, name, Location, Product, Chromosome, OMIM, Porphyria )
# medicine_enzyme_interaction ( enzyme_id, medicine_id, interaction_type )
#
# medicine_enzyme_interaction.medicine_id can be joined with medicine.id
# medicine_enzyme_interaction.enzyme_id can be joined with enzyme.id
#
### Question:
#
# Which enzyme names have the substring "ALA"?
#
### SQL:
#
# SELECT name FROM enzyme WHERE name LIKE "%ALA%"
#
### End.
|
medicine_enzyme_interaction
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# medicine ( id, name, Trade_Name, FDA_approved )
# enzyme ( id, name, Location, Product, Chromosome, OMIM, Porphyria )
# medicine_enzyme_interaction ( enzyme_id, medicine_id, interaction_type )
#
# medicine_enzyme_interaction.medicine_id can be joined with medicine.id
# medicine_enzyme_interaction.enzyme_id can be joined with enzyme.id
#
### Question:
#
# What are the names of enzymes that include the string 'ALA'?
#
### SQL:
#
# SELECT name FROM enzyme WHERE name LIKE "%ALA%"
#
### End.
|
medicine_enzyme_interaction
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# medicine ( id, name, Trade_Name, FDA_approved )
# enzyme ( id, name, Location, Product, Chromosome, OMIM, Porphyria )
# medicine_enzyme_interaction ( enzyme_id, medicine_id, interaction_type )
#
# medicine_enzyme_interaction.medicine_id can be joined with medicine.id
# medicine_enzyme_interaction.enzyme_id can be joined with enzyme.id
#
### Question:
#
# find the number of medicines offered by each trade.
#
### SQL:
#
# SELECT trade_name , count(*) FROM medicine GROUP BY trade_name
#
### End.
|
medicine_enzyme_interaction
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# medicine ( id, name, Trade_Name, FDA_approved )
# enzyme ( id, name, Location, Product, Chromosome, OMIM, Porphyria )
# medicine_enzyme_interaction ( enzyme_id, medicine_id, interaction_type )
#
# medicine_enzyme_interaction.medicine_id can be joined with medicine.id
# medicine_enzyme_interaction.enzyme_id can be joined with enzyme.id
#
### Question:
#
# How many medicines are offered by each trade name?
#
### SQL:
#
# SELECT trade_name , count(*) FROM medicine GROUP BY trade_name
#
### End.
|
university_basketball
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# basketball_match ( Team_ID, School_ID, Team_Name, ACC_Regular_Season, ACC_Percent, ACC_Home, ACC_Road, All_Games, All_Games_Percent, All_Home, All_Road, All_Neutral )
# university ( School_ID, School, Location, Founded, Affiliation, Enrollment, Nickname, Primary_conference )
#
# basketball_match.School_ID can be joined with university.School_ID
#
### Question:
#
# List all schools and their nicknames in the order of founded year.
#
### SQL:
#
# SELECT school , nickname FROM university ORDER BY founded
#
### End.
|
university_basketball
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# basketball_match ( Team_ID, School_ID, Team_Name, ACC_Regular_Season, ACC_Percent, ACC_Home, ACC_Road, All_Games, All_Games_Percent, All_Home, All_Road, All_Neutral )
# university ( School_ID, School, Location, Founded, Affiliation, Enrollment, Nickname, Primary_conference )
#
# basketball_match.School_ID can be joined with university.School_ID
#
### Question:
#
# What are the different schools and their nicknames, ordered by their founding years?
#
### SQL:
#
# SELECT school , nickname FROM university ORDER BY founded
#
### End.
|
university_basketball
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# basketball_match ( Team_ID, School_ID, Team_Name, ACC_Regular_Season, ACC_Percent, ACC_Home, ACC_Road, All_Games, All_Games_Percent, All_Home, All_Road, All_Neutral )
# university ( School_ID, School, Location, Founded, Affiliation, Enrollment, Nickname, Primary_conference )
#
# basketball_match.School_ID can be joined with university.School_ID
#
### Question:
#
# List all public schools and their locations.
#
### SQL:
#
# SELECT school , LOCATION FROM university WHERE affiliation = 'Public'
#
### End.
|
university_basketball
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# basketball_match ( Team_ID, School_ID, Team_Name, ACC_Regular_Season, ACC_Percent, ACC_Home, ACC_Road, All_Games, All_Games_Percent, All_Home, All_Road, All_Neutral )
# university ( School_ID, School, Location, Founded, Affiliation, Enrollment, Nickname, Primary_conference )
#
# basketball_match.School_ID can be joined with university.School_ID
#
### Question:
#
# What are the public schools and what are their locations?
#
### SQL:
#
# SELECT school , LOCATION FROM university WHERE affiliation = 'Public'
#
### End.
|
university_basketball
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# basketball_match ( Team_ID, School_ID, Team_Name, ACC_Regular_Season, ACC_Percent, ACC_Home, ACC_Road, All_Games, All_Games_Percent, All_Home, All_Road, All_Neutral )
# university ( School_ID, School, Location, Founded, Affiliation, Enrollment, Nickname, Primary_conference )
#
# basketball_match.School_ID can be joined with university.School_ID
#
### Question:
#
# When was the school with the largest enrollment founded?
#
### SQL:
#
# SELECT founded FROM university ORDER BY enrollment DESC LIMIT 1
#
### End.
|
university_basketball
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# basketball_match ( Team_ID, School_ID, Team_Name, ACC_Regular_Season, ACC_Percent, ACC_Home, ACC_Road, All_Games, All_Games_Percent, All_Home, All_Road, All_Neutral )
# university ( School_ID, School, Location, Founded, Affiliation, Enrollment, Nickname, Primary_conference )
#
# basketball_match.School_ID can be joined with university.School_ID
#
### Question:
#
# Return the founded year for the school with the largest enrollment.
#
### SQL:
#
# SELECT founded FROM university ORDER BY enrollment DESC LIMIT 1
#
### End.
|
university_basketball
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# basketball_match ( Team_ID, School_ID, Team_Name, ACC_Regular_Season, ACC_Percent, ACC_Home, ACC_Road, All_Games, All_Games_Percent, All_Home, All_Road, All_Neutral )
# university ( School_ID, School, Location, Founded, Affiliation, Enrollment, Nickname, Primary_conference )
#
# basketball_match.School_ID can be joined with university.School_ID
#
### Question:
#
# Find the founded year of the newest non public school.
#
### SQL:
#
# SELECT founded FROM university WHERE affiliation != 'Public' ORDER BY founded DESC LIMIT 1
#
### End.
|
university_basketball
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# basketball_match ( Team_ID, School_ID, Team_Name, ACC_Regular_Season, ACC_Percent, ACC_Home, ACC_Road, All_Games, All_Games_Percent, All_Home, All_Road, All_Neutral )
# university ( School_ID, School, Location, Founded, Affiliation, Enrollment, Nickname, Primary_conference )
#
# basketball_match.School_ID can be joined with university.School_ID
#
### Question:
#
# What is the founded year of the non public school that was founded most recently?
#
### SQL:
#
# SELECT founded FROM university WHERE affiliation != 'Public' ORDER BY founded DESC LIMIT 1
#
### End.
|
university_basketball
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# basketball_match ( Team_ID, School_ID, Team_Name, ACC_Regular_Season, ACC_Percent, ACC_Home, ACC_Road, All_Games, All_Games_Percent, All_Home, All_Road, All_Neutral )
# university ( School_ID, School, Location, Founded, Affiliation, Enrollment, Nickname, Primary_conference )
#
# basketball_match.School_ID can be joined with university.School_ID
#
### Question:
#
# How many schools are in the basketball match?
#
### SQL:
#
# SELECT count(DISTINCT school_id) FROM basketball_match
#
### End.
|
university_basketball
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# basketball_match ( Team_ID, School_ID, Team_Name, ACC_Regular_Season, ACC_Percent, ACC_Home, ACC_Road, All_Games, All_Games_Percent, All_Home, All_Road, All_Neutral )
# university ( School_ID, School, Location, Founded, Affiliation, Enrollment, Nickname, Primary_conference )
#
# basketball_match.School_ID can be joined with university.School_ID
#
### Question:
#
# Count the number of schools that have had basketball matches.
#
### SQL:
#
# SELECT count(DISTINCT school_id) FROM basketball_match
#
### End.
|
university_basketball
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# basketball_match ( Team_ID, School_ID, Team_Name, ACC_Regular_Season, ACC_Percent, ACC_Home, ACC_Road, All_Games, All_Games_Percent, All_Home, All_Road, All_Neutral )
# university ( School_ID, School, Location, Founded, Affiliation, Enrollment, Nickname, Primary_conference )
#
# basketball_match.School_ID can be joined with university.School_ID
#
### Question:
#
# What is the highest acc percent score in the competition?
#
### SQL:
#
# SELECT acc_percent FROM basketball_match ORDER BY acc_percent DESC LIMIT 1
#
### End.
|
university_basketball
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# basketball_match ( Team_ID, School_ID, Team_Name, ACC_Regular_Season, ACC_Percent, ACC_Home, ACC_Road, All_Games, All_Games_Percent, All_Home, All_Road, All_Neutral )
# university ( School_ID, School, Location, Founded, Affiliation, Enrollment, Nickname, Primary_conference )
#
# basketball_match.School_ID can be joined with university.School_ID
#
### Question:
#
# Return the highest acc percent across all basketball matches.
#
### SQL:
#
# SELECT acc_percent FROM basketball_match ORDER BY acc_percent DESC LIMIT 1
#
### End.
|
university_basketball
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# basketball_match ( Team_ID, School_ID, Team_Name, ACC_Regular_Season, ACC_Percent, ACC_Home, ACC_Road, All_Games, All_Games_Percent, All_Home, All_Road, All_Neutral )
# university ( School_ID, School, Location, Founded, Affiliation, Enrollment, Nickname, Primary_conference )
#
# basketball_match.School_ID can be joined with university.School_ID
#
### Question:
#
# What is the primary conference of the school that has the lowest acc percent score in the competition?
#
### SQL:
#
# SELECT t1.Primary_conference FROM university AS t1 JOIN basketball_match AS t2 ON t1.school_id = t2.school_id ORDER BY t2.acc_percent LIMIT 1
#
### End.
|
university_basketball
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# basketball_match ( Team_ID, School_ID, Team_Name, ACC_Regular_Season, ACC_Percent, ACC_Home, ACC_Road, All_Games, All_Games_Percent, All_Home, All_Road, All_Neutral )
# university ( School_ID, School, Location, Founded, Affiliation, Enrollment, Nickname, Primary_conference )
#
# basketball_match.School_ID can be joined with university.School_ID
#
### Question:
#
# Return the primary conference of the school with the lowest acc percentage score.
#
### SQL:
#
# SELECT t1.Primary_conference FROM university AS t1 JOIN basketball_match AS t2 ON t1.school_id = t2.school_id ORDER BY t2.acc_percent LIMIT 1
#
### End.
|
university_basketball
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# basketball_match ( Team_ID, School_ID, Team_Name, ACC_Regular_Season, ACC_Percent, ACC_Home, ACC_Road, All_Games, All_Games_Percent, All_Home, All_Road, All_Neutral )
# university ( School_ID, School, Location, Founded, Affiliation, Enrollment, Nickname, Primary_conference )
#
# basketball_match.School_ID can be joined with university.School_ID
#
### Question:
#
# What is the team name and acc regular season score of the school that was founded for the longest time?
#
### SQL:
#
# SELECT t2.team_name , t2.ACC_Regular_Season FROM university AS t1 JOIN basketball_match AS t2 ON t1.school_id = t2.school_id ORDER BY t1.founded LIMIT 1
#
### End.
|
university_basketball
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# basketball_match ( Team_ID, School_ID, Team_Name, ACC_Regular_Season, ACC_Percent, ACC_Home, ACC_Road, All_Games, All_Games_Percent, All_Home, All_Road, All_Neutral )
# university ( School_ID, School, Location, Founded, Affiliation, Enrollment, Nickname, Primary_conference )
#
# basketball_match.School_ID can be joined with university.School_ID
#
### Question:
#
# Return the name of the team and the acc during the regular season for the school that was founded the earliest.
#
### SQL:
#
# SELECT t2.team_name , t2.ACC_Regular_Season FROM university AS t1 JOIN basketball_match AS t2 ON t1.school_id = t2.school_id ORDER BY t1.founded LIMIT 1
#
### End.
|
university_basketball
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# basketball_match ( Team_ID, School_ID, Team_Name, ACC_Regular_Season, ACC_Percent, ACC_Home, ACC_Road, All_Games, All_Games_Percent, All_Home, All_Road, All_Neutral )
# university ( School_ID, School, Location, Founded, Affiliation, Enrollment, Nickname, Primary_conference )
#
# basketball_match.School_ID can be joined with university.School_ID
#
### Question:
#
# Find the location and all games score of the school that has Clemson as its team name.
#
### SQL:
#
# SELECT t2.All_Games , t1.location FROM university AS t1 JOIN basketball_match AS t2 ON t1.school_id = t2.school_id WHERE team_name = 'Clemson'
#
### End.
|
university_basketball
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# basketball_match ( Team_ID, School_ID, Team_Name, ACC_Regular_Season, ACC_Percent, ACC_Home, ACC_Road, All_Games, All_Games_Percent, All_Home, All_Road, All_Neutral )
# university ( School_ID, School, Location, Founded, Affiliation, Enrollment, Nickname, Primary_conference )
#
# basketball_match.School_ID can be joined with university.School_ID
#
### Question:
#
# What are the all games score and location of the school called Clemson?
#
### SQL:
#
# SELECT t2.All_Games , t1.location FROM university AS t1 JOIN basketball_match AS t2 ON t1.school_id = t2.school_id WHERE team_name = 'Clemson'
#
### End.
|
university_basketball
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# basketball_match ( Team_ID, School_ID, Team_Name, ACC_Regular_Season, ACC_Percent, ACC_Home, ACC_Road, All_Games, All_Games_Percent, All_Home, All_Road, All_Neutral )
# university ( School_ID, School, Location, Founded, Affiliation, Enrollment, Nickname, Primary_conference )
#
# basketball_match.School_ID can be joined with university.School_ID
#
### Question:
#
# What are the average enrollment size of the universities that are founded before 1850?
#
### SQL:
#
# SELECT avg(enrollment) FROM university WHERE founded < 1850
#
### End.
|
university_basketball
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# basketball_match ( Team_ID, School_ID, Team_Name, ACC_Regular_Season, ACC_Percent, ACC_Home, ACC_Road, All_Games, All_Games_Percent, All_Home, All_Road, All_Neutral )
# university ( School_ID, School, Location, Founded, Affiliation, Enrollment, Nickname, Primary_conference )
#
# basketball_match.School_ID can be joined with university.School_ID
#
### Question:
#
# Return the average enrollment of universities founded before 1850.
#
### SQL:
#
# SELECT avg(enrollment) FROM university WHERE founded < 1850
#
### End.
|
university_basketball
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# basketball_match ( Team_ID, School_ID, Team_Name, ACC_Regular_Season, ACC_Percent, ACC_Home, ACC_Road, All_Games, All_Games_Percent, All_Home, All_Road, All_Neutral )
# university ( School_ID, School, Location, Founded, Affiliation, Enrollment, Nickname, Primary_conference )
#
# basketball_match.School_ID can be joined with university.School_ID
#
### Question:
#
# Show the enrollment and primary_conference of the oldest college.
#
### SQL:
#
# SELECT enrollment , primary_conference FROM university ORDER BY founded LIMIT 1
#
### End.
|
university_basketball
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# basketball_match ( Team_ID, School_ID, Team_Name, ACC_Regular_Season, ACC_Percent, ACC_Home, ACC_Road, All_Games, All_Games_Percent, All_Home, All_Road, All_Neutral )
# university ( School_ID, School, Location, Founded, Affiliation, Enrollment, Nickname, Primary_conference )
#
# basketball_match.School_ID can be joined with university.School_ID
#
### Question:
#
# What are the enrollment and primary conference for the university which was founded the earliest?
#
### SQL:
#
# SELECT enrollment , primary_conference FROM university ORDER BY founded LIMIT 1
#
### End.
|
university_basketball
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# basketball_match ( Team_ID, School_ID, Team_Name, ACC_Regular_Season, ACC_Percent, ACC_Home, ACC_Road, All_Games, All_Games_Percent, All_Home, All_Road, All_Neutral )
# university ( School_ID, School, Location, Founded, Affiliation, Enrollment, Nickname, Primary_conference )
#
# basketball_match.School_ID can be joined with university.School_ID
#
### Question:
#
# What is the total and minimum enrollment of all schools?
#
### SQL:
#
# SELECT sum(enrollment) , min(enrollment) FROM university
#
### End.
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.