sert121/SpiderSQL huggingface dataset:
-- Language PostgreSQL
        -- Tables: 
             -- Table: addresses 
columns : [['address id', 'number'], ['line 1 number building', 'text'], ['town city', 'text'], ['zip postcode', 'text'], ['state province county', 'text'], ['country', 'text']]

 -- Table: services 
columns : [['service id', 'number'], ['service type code', 'text'], ['service name', 'text'], ['service descriptio', 'text']]

 -- Table: forms 
columns : [['form id', 'number'], ['form type code', 'text'], ['service id', 'number'], ['form number', 'text'], ['form name', 'text'], ['form description', 'text']]

 -- Table: individuals 
columns : [['individual id', 'number'], ['individual first name', 'text'], ['individual middle name', 'text'], ['inidividual phone', 'text'], ['individual email', 'text'], ['individual address', 'text'], ['individual last name', 'text']]

 -- Table: organizations 
columns : [['organization id', 'number'], ['date formed', 'time'], ['organization name', 'text'], ['uk vat number', 'text']]

 -- Table: parties 
columns : [['party id', 'number'], ['payment method code', 'text'], ['party phone', 'text'], ['party email', 'text']]

 -- Table: organization contact individuals 
columns : [['individual id', 'number'], ['organization id', 'number'], ['date contact from', 'time'], ['date contact to', 'time']]

 -- Table: party addresses 
columns : [['party id', 'number'], ['address id', 'number'], ['date address from', 'time'], ['address type code', 'text'], ['date address to', 'time']]

 -- Table: party forms 
columns : [['party id', 'number'], ['form id', 'number'], ['date completion started', 'time'], ['form status code', 'text'], ['date fully completed', 'time']]

 -- Table: party services 
columns : [['booking id', 'number'], ['customer id', 'number'], ['service id', 'number'], ['service datetime', 'time'], ['booking made date', 'time']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: What are the party emails associated with parties that used the party form that is the most common?
SQL: SELECT t1.party_email FROM parties AS t1 JOIN party_forms AS t2 ON t1.party_id  =  t2.party_id WHERE t2.form_id  =  (SELECT form_id FROM party_forms GROUP BY form_id ORDER BY count(*) DESC LIMIT 1)
-- Language PostgreSQL
        -- Tables: 
             -- Table: addresses 
columns : [['address id', 'number'], ['line 1 number building', 'text'], ['town city', 'text'], ['zip postcode', 'text'], ['state province county', 'text'], ['country', 'text']]

 -- Table: services 
columns : [['service id', 'number'], ['service type code', 'text'], ['service name', 'text'], ['service descriptio', 'text']]

 -- Table: forms 
columns : [['form id', 'number'], ['form type code', 'text'], ['service id', 'number'], ['form number', 'text'], ['form name', 'text'], ['form description', 'text']]

 -- Table: individuals 
columns : [['individual id', 'number'], ['individual first name', 'text'], ['individual middle name', 'text'], ['inidividual phone', 'text'], ['individual email', 'text'], ['individual address', 'text'], ['individual last name', 'text']]

 -- Table: organizations 
columns : [['organization id', 'number'], ['date formed', 'time'], ['organization name', 'text'], ['uk vat number', 'text']]

 -- Table: parties 
columns : [['party id', 'number'], ['payment method code', 'text'], ['party phone', 'text'], ['party email', 'text']]

 -- Table: organization contact individuals 
columns : [['individual id', 'number'], ['organization id', 'number'], ['date contact from', 'time'], ['date contact to', 'time']]

 -- Table: party addresses 
columns : [['party id', 'number'], ['address id', 'number'], ['date address from', 'time'], ['address type code', 'text'], ['date address to', 'time']]

 -- Table: party forms 
columns : [['party id', 'number'], ['form id', 'number'], ['date completion started', 'time'], ['form status code', 'text'], ['date fully completed', 'time']]

 -- Table: party services 
columns : [['booking id', 'number'], ['customer id', 'number'], ['service id', 'number'], ['service datetime', 'time'], ['booking made date', 'time']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: List all the name of organizations in order of the date formed.
SQL: SELECT organization_name FROM organizations ORDER BY date_formed ASC
-- Language PostgreSQL
        -- Tables: 
             -- Table: addresses 
columns : [['address id', 'number'], ['line 1 number building', 'text'], ['town city', 'text'], ['zip postcode', 'text'], ['state province county', 'text'], ['country', 'text']]

 -- Table: services 
columns : [['service id', 'number'], ['service type code', 'text'], ['service name', 'text'], ['service descriptio', 'text']]

 -- Table: forms 
columns : [['form id', 'number'], ['form type code', 'text'], ['service id', 'number'], ['form number', 'text'], ['form name', 'text'], ['form description', 'text']]

 -- Table: individuals 
columns : [['individual id', 'number'], ['individual first name', 'text'], ['individual middle name', 'text'], ['inidividual phone', 'text'], ['individual email', 'text'], ['individual address', 'text'], ['individual last name', 'text']]

 -- Table: organizations 
columns : [['organization id', 'number'], ['date formed', 'time'], ['organization name', 'text'], ['uk vat number', 'text']]

 -- Table: parties 
columns : [['party id', 'number'], ['payment method code', 'text'], ['party phone', 'text'], ['party email', 'text']]

 -- Table: organization contact individuals 
columns : [['individual id', 'number'], ['organization id', 'number'], ['date contact from', 'time'], ['date contact to', 'time']]

 -- Table: party addresses 
columns : [['party id', 'number'], ['address id', 'number'], ['date address from', 'time'], ['address type code', 'text'], ['date address to', 'time']]

 -- Table: party forms 
columns : [['party id', 'number'], ['form id', 'number'], ['date completion started', 'time'], ['form status code', 'text'], ['date fully completed', 'time']]

 -- Table: party services 
columns : [['booking id', 'number'], ['customer id', 'number'], ['service id', 'number'], ['service datetime', 'time'], ['booking made date', 'time']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: What are the names of organizations, ordered by the date they were formed, ascending?
SQL: SELECT organization_name FROM organizations ORDER BY date_formed ASC
-- Language PostgreSQL
        -- Tables: 
             -- Table: addresses 
columns : [['address id', 'number'], ['line 1 number building', 'text'], ['town city', 'text'], ['zip postcode', 'text'], ['state province county', 'text'], ['country', 'text']]

 -- Table: services 
columns : [['service id', 'number'], ['service type code', 'text'], ['service name', 'text'], ['service descriptio', 'text']]

 -- Table: forms 
columns : [['form id', 'number'], ['form type code', 'text'], ['service id', 'number'], ['form number', 'text'], ['form name', 'text'], ['form description', 'text']]

 -- Table: individuals 
columns : [['individual id', 'number'], ['individual first name', 'text'], ['individual middle name', 'text'], ['inidividual phone', 'text'], ['individual email', 'text'], ['individual address', 'text'], ['individual last name', 'text']]

 -- Table: organizations 
columns : [['organization id', 'number'], ['date formed', 'time'], ['organization name', 'text'], ['uk vat number', 'text']]

 -- Table: parties 
columns : [['party id', 'number'], ['payment method code', 'text'], ['party phone', 'text'], ['party email', 'text']]

 -- Table: organization contact individuals 
columns : [['individual id', 'number'], ['organization id', 'number'], ['date contact from', 'time'], ['date contact to', 'time']]

 -- Table: party addresses 
columns : [['party id', 'number'], ['address id', 'number'], ['date address from', 'time'], ['address type code', 'text'], ['date address to', 'time']]

 -- Table: party forms 
columns : [['party id', 'number'], ['form id', 'number'], ['date completion started', 'time'], ['form status code', 'text'], ['date fully completed', 'time']]

 -- Table: party services 
columns : [['booking id', 'number'], ['customer id', 'number'], ['service id', 'number'], ['service datetime', 'time'], ['booking made date', 'time']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: Find the name of the youngest organization.
SQL: SELECT organization_name FROM organizations ORDER BY date_formed DESC LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: addresses 
columns : [['address id', 'number'], ['line 1 number building', 'text'], ['town city', 'text'], ['zip postcode', 'text'], ['state province county', 'text'], ['country', 'text']]

 -- Table: services 
columns : [['service id', 'number'], ['service type code', 'text'], ['service name', 'text'], ['service descriptio', 'text']]

 -- Table: forms 
columns : [['form id', 'number'], ['form type code', 'text'], ['service id', 'number'], ['form number', 'text'], ['form name', 'text'], ['form description', 'text']]

 -- Table: individuals 
columns : [['individual id', 'number'], ['individual first name', 'text'], ['individual middle name', 'text'], ['inidividual phone', 'text'], ['individual email', 'text'], ['individual address', 'text'], ['individual last name', 'text']]

 -- Table: organizations 
columns : [['organization id', 'number'], ['date formed', 'time'], ['organization name', 'text'], ['uk vat number', 'text']]

 -- Table: parties 
columns : [['party id', 'number'], ['payment method code', 'text'], ['party phone', 'text'], ['party email', 'text']]

 -- Table: organization contact individuals 
columns : [['individual id', 'number'], ['organization id', 'number'], ['date contact from', 'time'], ['date contact to', 'time']]

 -- Table: party addresses 
columns : [['party id', 'number'], ['address id', 'number'], ['date address from', 'time'], ['address type code', 'text'], ['date address to', 'time']]

 -- Table: party forms 
columns : [['party id', 'number'], ['form id', 'number'], ['date completion started', 'time'], ['form status code', 'text'], ['date fully completed', 'time']]

 -- Table: party services 
columns : [['booking id', 'number'], ['customer id', 'number'], ['service id', 'number'], ['service datetime', 'time'], ['booking made date', 'time']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: What is the name of the organization that was formed most recently?
SQL: SELECT organization_name FROM organizations ORDER BY date_formed DESC LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: addresses 
columns : [['address id', 'number'], ['line 1 number building', 'text'], ['town city', 'text'], ['zip postcode', 'text'], ['state province county', 'text'], ['country', 'text']]

 -- Table: services 
columns : [['service id', 'number'], ['service type code', 'text'], ['service name', 'text'], ['service descriptio', 'text']]

 -- Table: forms 
columns : [['form id', 'number'], ['form type code', 'text'], ['service id', 'number'], ['form number', 'text'], ['form name', 'text'], ['form description', 'text']]

 -- Table: individuals 
columns : [['individual id', 'number'], ['individual first name', 'text'], ['individual middle name', 'text'], ['inidividual phone', 'text'], ['individual email', 'text'], ['individual address', 'text'], ['individual last name', 'text']]

 -- Table: organizations 
columns : [['organization id', 'number'], ['date formed', 'time'], ['organization name', 'text'], ['uk vat number', 'text']]

 -- Table: parties 
columns : [['party id', 'number'], ['payment method code', 'text'], ['party phone', 'text'], ['party email', 'text']]

 -- Table: organization contact individuals 
columns : [['individual id', 'number'], ['organization id', 'number'], ['date contact from', 'time'], ['date contact to', 'time']]

 -- Table: party addresses 
columns : [['party id', 'number'], ['address id', 'number'], ['date address from', 'time'], ['address type code', 'text'], ['date address to', 'time']]

 -- Table: party forms 
columns : [['party id', 'number'], ['form id', 'number'], ['date completion started', 'time'], ['form status code', 'text'], ['date fully completed', 'time']]

 -- Table: party services 
columns : [['booking id', 'number'], ['customer id', 'number'], ['service id', 'number'], ['service datetime', 'time'], ['booking made date', 'time']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: Find the last name of the latest contact individual of the organization "Labour Party".
SQL: SELECT t3.individual_last_name FROM organizations AS t1 JOIN organization_contact_individuals AS t2 ON t1.organization_id  =  t2.organization_id JOIN individuals AS t3 ON t2.individual_id  =  t3.individual_id WHERE t1.organization_name  =  "Labour Party" ORDER BY t2.date_contact_to DESC LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: addresses 
columns : [['address id', 'number'], ['line 1 number building', 'text'], ['town city', 'text'], ['zip postcode', 'text'], ['state province county', 'text'], ['country', 'text']]

 -- Table: services 
columns : [['service id', 'number'], ['service type code', 'text'], ['service name', 'text'], ['service descriptio', 'text']]

 -- Table: forms 
columns : [['form id', 'number'], ['form type code', 'text'], ['service id', 'number'], ['form number', 'text'], ['form name', 'text'], ['form description', 'text']]

 -- Table: individuals 
columns : [['individual id', 'number'], ['individual first name', 'text'], ['individual middle name', 'text'], ['inidividual phone', 'text'], ['individual email', 'text'], ['individual address', 'text'], ['individual last name', 'text']]

 -- Table: organizations 
columns : [['organization id', 'number'], ['date formed', 'time'], ['organization name', 'text'], ['uk vat number', 'text']]

 -- Table: parties 
columns : [['party id', 'number'], ['payment method code', 'text'], ['party phone', 'text'], ['party email', 'text']]

 -- Table: organization contact individuals 
columns : [['individual id', 'number'], ['organization id', 'number'], ['date contact from', 'time'], ['date contact to', 'time']]

 -- Table: party addresses 
columns : [['party id', 'number'], ['address id', 'number'], ['date address from', 'time'], ['address type code', 'text'], ['date address to', 'time']]

 -- Table: party forms 
columns : [['party id', 'number'], ['form id', 'number'], ['date completion started', 'time'], ['form status code', 'text'], ['date fully completed', 'time']]

 -- Table: party services 
columns : [['booking id', 'number'], ['customer id', 'number'], ['service id', 'number'], ['service datetime', 'time'], ['booking made date', 'time']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: What is the last name of the contact individual from the Labour party organization who was contacted most recently?
SQL: SELECT t3.individual_last_name FROM organizations AS t1 JOIN organization_contact_individuals AS t2 ON t1.organization_id  =  t2.organization_id JOIN individuals AS t3 ON t2.individual_id  =  t3.individual_id WHERE t1.organization_name  =  "Labour Party" ORDER BY t2.date_contact_to DESC LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: addresses 
columns : [['address id', 'number'], ['line 1 number building', 'text'], ['town city', 'text'], ['zip postcode', 'text'], ['state province county', 'text'], ['country', 'text']]

 -- Table: services 
columns : [['service id', 'number'], ['service type code', 'text'], ['service name', 'text'], ['service descriptio', 'text']]

 -- Table: forms 
columns : [['form id', 'number'], ['form type code', 'text'], ['service id', 'number'], ['form number', 'text'], ['form name', 'text'], ['form description', 'text']]

 -- Table: individuals 
columns : [['individual id', 'number'], ['individual first name', 'text'], ['individual middle name', 'text'], ['inidividual phone', 'text'], ['individual email', 'text'], ['individual address', 'text'], ['individual last name', 'text']]

 -- Table: organizations 
columns : [['organization id', 'number'], ['date formed', 'time'], ['organization name', 'text'], ['uk vat number', 'text']]

 -- Table: parties 
columns : [['party id', 'number'], ['payment method code', 'text'], ['party phone', 'text'], ['party email', 'text']]

 -- Table: organization contact individuals 
columns : [['individual id', 'number'], ['organization id', 'number'], ['date contact from', 'time'], ['date contact to', 'time']]

 -- Table: party addresses 
columns : [['party id', 'number'], ['address id', 'number'], ['date address from', 'time'], ['address type code', 'text'], ['date address to', 'time']]

 -- Table: party forms 
columns : [['party id', 'number'], ['form id', 'number'], ['date completion started', 'time'], ['form status code', 'text'], ['date fully completed', 'time']]

 -- Table: party services 
columns : [['booking id', 'number'], ['customer id', 'number'], ['service id', 'number'], ['service datetime', 'time'], ['booking made date', 'time']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: Find the last name of the first ever contact person of the organization with the highest UK Vat number.
SQL: SELECT t3.individual_last_name FROM organizations AS t1 JOIN organization_contact_individuals AS t2 ON t1.organization_id  =  t2.organization_id JOIN individuals AS t3 ON t2.individual_id  =  t3.individual_id WHERE t1.uk_vat_number  =  (SELECT max(uk_vat_number) FROM organizations) ORDER BY t2.date_contact_to ASC LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: addresses 
columns : [['address id', 'number'], ['line 1 number building', 'text'], ['town city', 'text'], ['zip postcode', 'text'], ['state province county', 'text'], ['country', 'text']]

 -- Table: services 
columns : [['service id', 'number'], ['service type code', 'text'], ['service name', 'text'], ['service descriptio', 'text']]

 -- Table: forms 
columns : [['form id', 'number'], ['form type code', 'text'], ['service id', 'number'], ['form number', 'text'], ['form name', 'text'], ['form description', 'text']]

 -- Table: individuals 
columns : [['individual id', 'number'], ['individual first name', 'text'], ['individual middle name', 'text'], ['inidividual phone', 'text'], ['individual email', 'text'], ['individual address', 'text'], ['individual last name', 'text']]

 -- Table: organizations 
columns : [['organization id', 'number'], ['date formed', 'time'], ['organization name', 'text'], ['uk vat number', 'text']]

 -- Table: parties 
columns : [['party id', 'number'], ['payment method code', 'text'], ['party phone', 'text'], ['party email', 'text']]

 -- Table: organization contact individuals 
columns : [['individual id', 'number'], ['organization id', 'number'], ['date contact from', 'time'], ['date contact to', 'time']]

 -- Table: party addresses 
columns : [['party id', 'number'], ['address id', 'number'], ['date address from', 'time'], ['address type code', 'text'], ['date address to', 'time']]

 -- Table: party forms 
columns : [['party id', 'number'], ['form id', 'number'], ['date completion started', 'time'], ['form status code', 'text'], ['date fully completed', 'time']]

 -- Table: party services 
columns : [['booking id', 'number'], ['customer id', 'number'], ['service id', 'number'], ['service datetime', 'time'], ['booking made date', 'time']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: What is the last name of the first individual contacted from the organization with the maximum UK Vat number across all organizations?
SQL: SELECT t3.individual_last_name FROM organizations AS t1 JOIN organization_contact_individuals AS t2 ON t1.organization_id  =  t2.organization_id JOIN individuals AS t3 ON t2.individual_id  =  t3.individual_id WHERE t1.uk_vat_number  =  (SELECT max(uk_vat_number) FROM organizations) ORDER BY t2.date_contact_to ASC LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: addresses 
columns : [['address id', 'number'], ['line 1 number building', 'text'], ['town city', 'text'], ['zip postcode', 'text'], ['state province county', 'text'], ['country', 'text']]

 -- Table: services 
columns : [['service id', 'number'], ['service type code', 'text'], ['service name', 'text'], ['service descriptio', 'text']]

 -- Table: forms 
columns : [['form id', 'number'], ['form type code', 'text'], ['service id', 'number'], ['form number', 'text'], ['form name', 'text'], ['form description', 'text']]

 -- Table: individuals 
columns : [['individual id', 'number'], ['individual first name', 'text'], ['individual middle name', 'text'], ['inidividual phone', 'text'], ['individual email', 'text'], ['individual address', 'text'], ['individual last name', 'text']]

 -- Table: organizations 
columns : [['organization id', 'number'], ['date formed', 'time'], ['organization name', 'text'], ['uk vat number', 'text']]

 -- Table: parties 
columns : [['party id', 'number'], ['payment method code', 'text'], ['party phone', 'text'], ['party email', 'text']]

 -- Table: organization contact individuals 
columns : [['individual id', 'number'], ['organization id', 'number'], ['date contact from', 'time'], ['date contact to', 'time']]

 -- Table: party addresses 
columns : [['party id', 'number'], ['address id', 'number'], ['date address from', 'time'], ['address type code', 'text'], ['date address to', 'time']]

 -- Table: party forms 
columns : [['party id', 'number'], ['form id', 'number'], ['date completion started', 'time'], ['form status code', 'text'], ['date fully completed', 'time']]

 -- Table: party services 
columns : [['booking id', 'number'], ['customer id', 'number'], ['service id', 'number'], ['service datetime', 'time'], ['booking made date', 'time']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: How many services are there?
SQL: SELECT count(*) FROM services
-- Language PostgreSQL
        -- Tables: 
             -- Table: addresses 
columns : [['address id', 'number'], ['line 1 number building', 'text'], ['town city', 'text'], ['zip postcode', 'text'], ['state province county', 'text'], ['country', 'text']]

 -- Table: services 
columns : [['service id', 'number'], ['service type code', 'text'], ['service name', 'text'], ['service descriptio', 'text']]

 -- Table: forms 
columns : [['form id', 'number'], ['form type code', 'text'], ['service id', 'number'], ['form number', 'text'], ['form name', 'text'], ['form description', 'text']]

 -- Table: individuals 
columns : [['individual id', 'number'], ['individual first name', 'text'], ['individual middle name', 'text'], ['inidividual phone', 'text'], ['individual email', 'text'], ['individual address', 'text'], ['individual last name', 'text']]

 -- Table: organizations 
columns : [['organization id', 'number'], ['date formed', 'time'], ['organization name', 'text'], ['uk vat number', 'text']]

 -- Table: parties 
columns : [['party id', 'number'], ['payment method code', 'text'], ['party phone', 'text'], ['party email', 'text']]

 -- Table: organization contact individuals 
columns : [['individual id', 'number'], ['organization id', 'number'], ['date contact from', 'time'], ['date contact to', 'time']]

 -- Table: party addresses 
columns : [['party id', 'number'], ['address id', 'number'], ['date address from', 'time'], ['address type code', 'text'], ['date address to', 'time']]

 -- Table: party forms 
columns : [['party id', 'number'], ['form id', 'number'], ['date completion started', 'time'], ['form status code', 'text'], ['date fully completed', 'time']]

 -- Table: party services 
columns : [['booking id', 'number'], ['customer id', 'number'], ['service id', 'number'], ['service datetime', 'time'], ['booking made date', 'time']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: Count the number of services.
SQL: SELECT count(*) FROM services
-- Language PostgreSQL
        -- Tables: 
             -- Table: addresses 
columns : [['address id', 'number'], ['line 1 number building', 'text'], ['town city', 'text'], ['zip postcode', 'text'], ['state province county', 'text'], ['country', 'text']]

 -- Table: services 
columns : [['service id', 'number'], ['service type code', 'text'], ['service name', 'text'], ['service descriptio', 'text']]

 -- Table: forms 
columns : [['form id', 'number'], ['form type code', 'text'], ['service id', 'number'], ['form number', 'text'], ['form name', 'text'], ['form description', 'text']]

 -- Table: individuals 
columns : [['individual id', 'number'], ['individual first name', 'text'], ['individual middle name', 'text'], ['inidividual phone', 'text'], ['individual email', 'text'], ['individual address', 'text'], ['individual last name', 'text']]

 -- Table: organizations 
columns : [['organization id', 'number'], ['date formed', 'time'], ['organization name', 'text'], ['uk vat number', 'text']]

 -- Table: parties 
columns : [['party id', 'number'], ['payment method code', 'text'], ['party phone', 'text'], ['party email', 'text']]

 -- Table: organization contact individuals 
columns : [['individual id', 'number'], ['organization id', 'number'], ['date contact from', 'time'], ['date contact to', 'time']]

 -- Table: party addresses 
columns : [['party id', 'number'], ['address id', 'number'], ['date address from', 'time'], ['address type code', 'text'], ['date address to', 'time']]

 -- Table: party forms 
columns : [['party id', 'number'], ['form id', 'number'], ['date completion started', 'time'], ['form status code', 'text'], ['date fully completed', 'time']]

 -- Table: party services 
columns : [['booking id', 'number'], ['customer id', 'number'], ['service id', 'number'], ['service datetime', 'time'], ['booking made date', 'time']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: Find name of the services that has never been used.
SQL: SELECT service_name FROM services EXCEPT SELECT t1.service_name FROM services AS t1 JOIN party_services AS t2 ON t1.service_id  =  t2.service_id
-- Language PostgreSQL
        -- Tables: 
             -- Table: addresses 
columns : [['address id', 'number'], ['line 1 number building', 'text'], ['town city', 'text'], ['zip postcode', 'text'], ['state province county', 'text'], ['country', 'text']]

 -- Table: services 
columns : [['service id', 'number'], ['service type code', 'text'], ['service name', 'text'], ['service descriptio', 'text']]

 -- Table: forms 
columns : [['form id', 'number'], ['form type code', 'text'], ['service id', 'number'], ['form number', 'text'], ['form name', 'text'], ['form description', 'text']]

 -- Table: individuals 
columns : [['individual id', 'number'], ['individual first name', 'text'], ['individual middle name', 'text'], ['inidividual phone', 'text'], ['individual email', 'text'], ['individual address', 'text'], ['individual last name', 'text']]

 -- Table: organizations 
columns : [['organization id', 'number'], ['date formed', 'time'], ['organization name', 'text'], ['uk vat number', 'text']]

 -- Table: parties 
columns : [['party id', 'number'], ['payment method code', 'text'], ['party phone', 'text'], ['party email', 'text']]

 -- Table: organization contact individuals 
columns : [['individual id', 'number'], ['organization id', 'number'], ['date contact from', 'time'], ['date contact to', 'time']]

 -- Table: party addresses 
columns : [['party id', 'number'], ['address id', 'number'], ['date address from', 'time'], ['address type code', 'text'], ['date address to', 'time']]

 -- Table: party forms 
columns : [['party id', 'number'], ['form id', 'number'], ['date completion started', 'time'], ['form status code', 'text'], ['date fully completed', 'time']]

 -- Table: party services 
columns : [['booking id', 'number'], ['customer id', 'number'], ['service id', 'number'], ['service datetime', 'time'], ['booking made date', 'time']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: What are the names of the services that have never been used?
SQL: SELECT service_name FROM services EXCEPT SELECT t1.service_name FROM services AS t1 JOIN party_services AS t2 ON t1.service_id  =  t2.service_id
-- Language PostgreSQL
        -- Tables: 
             -- Table: addresses 
columns : [['address id', 'number'], ['line 1 number building', 'text'], ['town city', 'text'], ['zip postcode', 'text'], ['state province county', 'text'], ['country', 'text']]

 -- Table: services 
columns : [['service id', 'number'], ['service type code', 'text'], ['service name', 'text'], ['service descriptio', 'text']]

 -- Table: forms 
columns : [['form id', 'number'], ['form type code', 'text'], ['service id', 'number'], ['form number', 'text'], ['form name', 'text'], ['form description', 'text']]

 -- Table: individuals 
columns : [['individual id', 'number'], ['individual first name', 'text'], ['individual middle name', 'text'], ['inidividual phone', 'text'], ['individual email', 'text'], ['individual address', 'text'], ['individual last name', 'text']]

 -- Table: organizations 
columns : [['organization id', 'number'], ['date formed', 'time'], ['organization name', 'text'], ['uk vat number', 'text']]

 -- Table: parties 
columns : [['party id', 'number'], ['payment method code', 'text'], ['party phone', 'text'], ['party email', 'text']]

 -- Table: organization contact individuals 
columns : [['individual id', 'number'], ['organization id', 'number'], ['date contact from', 'time'], ['date contact to', 'time']]

 -- Table: party addresses 
columns : [['party id', 'number'], ['address id', 'number'], ['date address from', 'time'], ['address type code', 'text'], ['date address to', 'time']]

 -- Table: party forms 
columns : [['party id', 'number'], ['form id', 'number'], ['date completion started', 'time'], ['form status code', 'text'], ['date fully completed', 'time']]

 -- Table: party services 
columns : [['booking id', 'number'], ['customer id', 'number'], ['service id', 'number'], ['service datetime', 'time'], ['booking made date', 'time']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: Find the name of all the cities and states.
SQL: SELECT town_city FROM addresses UNION SELECT state_province_county FROM addresses
-- Language PostgreSQL
        -- Tables: 
             -- Table: addresses 
columns : [['address id', 'number'], ['line 1 number building', 'text'], ['town city', 'text'], ['zip postcode', 'text'], ['state province county', 'text'], ['country', 'text']]

 -- Table: services 
columns : [['service id', 'number'], ['service type code', 'text'], ['service name', 'text'], ['service descriptio', 'text']]

 -- Table: forms 
columns : [['form id', 'number'], ['form type code', 'text'], ['service id', 'number'], ['form number', 'text'], ['form name', 'text'], ['form description', 'text']]

 -- Table: individuals 
columns : [['individual id', 'number'], ['individual first name', 'text'], ['individual middle name', 'text'], ['inidividual phone', 'text'], ['individual email', 'text'], ['individual address', 'text'], ['individual last name', 'text']]

 -- Table: organizations 
columns : [['organization id', 'number'], ['date formed', 'time'], ['organization name', 'text'], ['uk vat number', 'text']]

 -- Table: parties 
columns : [['party id', 'number'], ['payment method code', 'text'], ['party phone', 'text'], ['party email', 'text']]

 -- Table: organization contact individuals 
columns : [['individual id', 'number'], ['organization id', 'number'], ['date contact from', 'time'], ['date contact to', 'time']]

 -- Table: party addresses 
columns : [['party id', 'number'], ['address id', 'number'], ['date address from', 'time'], ['address type code', 'text'], ['date address to', 'time']]

 -- Table: party forms 
columns : [['party id', 'number'], ['form id', 'number'], ['date completion started', 'time'], ['form status code', 'text'], ['date fully completed', 'time']]

 -- Table: party services 
columns : [['booking id', 'number'], ['customer id', 'number'], ['service id', 'number'], ['service datetime', 'time'], ['booking made date', 'time']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: What are the names of all cities and states?
SQL: SELECT town_city FROM addresses UNION SELECT state_province_county FROM addresses
-- Language PostgreSQL
        -- Tables: 
             -- Table: addresses 
columns : [['address id', 'number'], ['line 1 number building', 'text'], ['town city', 'text'], ['zip postcode', 'text'], ['state province county', 'text'], ['country', 'text']]

 -- Table: services 
columns : [['service id', 'number'], ['service type code', 'text'], ['service name', 'text'], ['service descriptio', 'text']]

 -- Table: forms 
columns : [['form id', 'number'], ['form type code', 'text'], ['service id', 'number'], ['form number', 'text'], ['form name', 'text'], ['form description', 'text']]

 -- Table: individuals 
columns : [['individual id', 'number'], ['individual first name', 'text'], ['individual middle name', 'text'], ['inidividual phone', 'text'], ['individual email', 'text'], ['individual address', 'text'], ['individual last name', 'text']]

 -- Table: organizations 
columns : [['organization id', 'number'], ['date formed', 'time'], ['organization name', 'text'], ['uk vat number', 'text']]

 -- Table: parties 
columns : [['party id', 'number'], ['payment method code', 'text'], ['party phone', 'text'], ['party email', 'text']]

 -- Table: organization contact individuals 
columns : [['individual id', 'number'], ['organization id', 'number'], ['date contact from', 'time'], ['date contact to', 'time']]

 -- Table: party addresses 
columns : [['party id', 'number'], ['address id', 'number'], ['date address from', 'time'], ['address type code', 'text'], ['date address to', 'time']]

 -- Table: party forms 
columns : [['party id', 'number'], ['form id', 'number'], ['date completion started', 'time'], ['form status code', 'text'], ['date fully completed', 'time']]

 -- Table: party services 
columns : [['booking id', 'number'], ['customer id', 'number'], ['service id', 'number'], ['service datetime', 'time'], ['booking made date', 'time']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: How many cities are there in state "Colorado"?
SQL: SELECT count(*) FROM addresses WHERE state_province_county  =  "Colorado"
-- Language PostgreSQL
        -- Tables: 
             -- Table: addresses 
columns : [['address id', 'number'], ['line 1 number building', 'text'], ['town city', 'text'], ['zip postcode', 'text'], ['state province county', 'text'], ['country', 'text']]

 -- Table: services 
columns : [['service id', 'number'], ['service type code', 'text'], ['service name', 'text'], ['service descriptio', 'text']]

 -- Table: forms 
columns : [['form id', 'number'], ['form type code', 'text'], ['service id', 'number'], ['form number', 'text'], ['form name', 'text'], ['form description', 'text']]

 -- Table: individuals 
columns : [['individual id', 'number'], ['individual first name', 'text'], ['individual middle name', 'text'], ['inidividual phone', 'text'], ['individual email', 'text'], ['individual address', 'text'], ['individual last name', 'text']]

 -- Table: organizations 
columns : [['organization id', 'number'], ['date formed', 'time'], ['organization name', 'text'], ['uk vat number', 'text']]

 -- Table: parties 
columns : [['party id', 'number'], ['payment method code', 'text'], ['party phone', 'text'], ['party email', 'text']]

 -- Table: organization contact individuals 
columns : [['individual id', 'number'], ['organization id', 'number'], ['date contact from', 'time'], ['date contact to', 'time']]

 -- Table: party addresses 
columns : [['party id', 'number'], ['address id', 'number'], ['date address from', 'time'], ['address type code', 'text'], ['date address to', 'time']]

 -- Table: party forms 
columns : [['party id', 'number'], ['form id', 'number'], ['date completion started', 'time'], ['form status code', 'text'], ['date fully completed', 'time']]

 -- Table: party services 
columns : [['booking id', 'number'], ['customer id', 'number'], ['service id', 'number'], ['service datetime', 'time'], ['booking made date', 'time']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: Count the number of cities in the state of Colorado.
SQL: SELECT count(*) FROM addresses WHERE state_province_county  =  "Colorado"
-- Language PostgreSQL
        -- Tables: 
             -- Table: addresses 
columns : [['address id', 'number'], ['line 1 number building', 'text'], ['town city', 'text'], ['zip postcode', 'text'], ['state province county', 'text'], ['country', 'text']]

 -- Table: services 
columns : [['service id', 'number'], ['service type code', 'text'], ['service name', 'text'], ['service descriptio', 'text']]

 -- Table: forms 
columns : [['form id', 'number'], ['form type code', 'text'], ['service id', 'number'], ['form number', 'text'], ['form name', 'text'], ['form description', 'text']]

 -- Table: individuals 
columns : [['individual id', 'number'], ['individual first name', 'text'], ['individual middle name', 'text'], ['inidividual phone', 'text'], ['individual email', 'text'], ['individual address', 'text'], ['individual last name', 'text']]

 -- Table: organizations 
columns : [['organization id', 'number'], ['date formed', 'time'], ['organization name', 'text'], ['uk vat number', 'text']]

 -- Table: parties 
columns : [['party id', 'number'], ['payment method code', 'text'], ['party phone', 'text'], ['party email', 'text']]

 -- Table: organization contact individuals 
columns : [['individual id', 'number'], ['organization id', 'number'], ['date contact from', 'time'], ['date contact to', 'time']]

 -- Table: party addresses 
columns : [['party id', 'number'], ['address id', 'number'], ['date address from', 'time'], ['address type code', 'text'], ['date address to', 'time']]

 -- Table: party forms 
columns : [['party id', 'number'], ['form id', 'number'], ['date completion started', 'time'], ['form status code', 'text'], ['date fully completed', 'time']]

 -- Table: party services 
columns : [['booking id', 'number'], ['customer id', 'number'], ['service id', 'number'], ['service datetime', 'time'], ['booking made date', 'time']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: Find the payment method code used by more than 3 parties.
SQL: SELECT payment_method_code FROM parties GROUP BY payment_method_code HAVING count(*)  >  3
-- Language PostgreSQL
        -- Tables: 
             -- Table: addresses 
columns : [['address id', 'number'], ['line 1 number building', 'text'], ['town city', 'text'], ['zip postcode', 'text'], ['state province county', 'text'], ['country', 'text']]

 -- Table: services 
columns : [['service id', 'number'], ['service type code', 'text'], ['service name', 'text'], ['service descriptio', 'text']]

 -- Table: forms 
columns : [['form id', 'number'], ['form type code', 'text'], ['service id', 'number'], ['form number', 'text'], ['form name', 'text'], ['form description', 'text']]

 -- Table: individuals 
columns : [['individual id', 'number'], ['individual first name', 'text'], ['individual middle name', 'text'], ['inidividual phone', 'text'], ['individual email', 'text'], ['individual address', 'text'], ['individual last name', 'text']]

 -- Table: organizations 
columns : [['organization id', 'number'], ['date formed', 'time'], ['organization name', 'text'], ['uk vat number', 'text']]

 -- Table: parties 
columns : [['party id', 'number'], ['payment method code', 'text'], ['party phone', 'text'], ['party email', 'text']]

 -- Table: organization contact individuals 
columns : [['individual id', 'number'], ['organization id', 'number'], ['date contact from', 'time'], ['date contact to', 'time']]

 -- Table: party addresses 
columns : [['party id', 'number'], ['address id', 'number'], ['date address from', 'time'], ['address type code', 'text'], ['date address to', 'time']]

 -- Table: party forms 
columns : [['party id', 'number'], ['form id', 'number'], ['date completion started', 'time'], ['form status code', 'text'], ['date fully completed', 'time']]

 -- Table: party services 
columns : [['booking id', 'number'], ['customer id', 'number'], ['service id', 'number'], ['service datetime', 'time'], ['booking made date', 'time']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: What are the payment method codes that have been used by more than 3 parties?
SQL: SELECT payment_method_code FROM parties GROUP BY payment_method_code HAVING count(*)  >  3
-- Language PostgreSQL
        -- Tables: 
             -- Table: addresses 
columns : [['address id', 'number'], ['line 1 number building', 'text'], ['town city', 'text'], ['zip postcode', 'text'], ['state province county', 'text'], ['country', 'text']]

 -- Table: services 
columns : [['service id', 'number'], ['service type code', 'text'], ['service name', 'text'], ['service descriptio', 'text']]

 -- Table: forms 
columns : [['form id', 'number'], ['form type code', 'text'], ['service id', 'number'], ['form number', 'text'], ['form name', 'text'], ['form description', 'text']]

 -- Table: individuals 
columns : [['individual id', 'number'], ['individual first name', 'text'], ['individual middle name', 'text'], ['inidividual phone', 'text'], ['individual email', 'text'], ['individual address', 'text'], ['individual last name', 'text']]

 -- Table: organizations 
columns : [['organization id', 'number'], ['date formed', 'time'], ['organization name', 'text'], ['uk vat number', 'text']]

 -- Table: parties 
columns : [['party id', 'number'], ['payment method code', 'text'], ['party phone', 'text'], ['party email', 'text']]

 -- Table: organization contact individuals 
columns : [['individual id', 'number'], ['organization id', 'number'], ['date contact from', 'time'], ['date contact to', 'time']]

 -- Table: party addresses 
columns : [['party id', 'number'], ['address id', 'number'], ['date address from', 'time'], ['address type code', 'text'], ['date address to', 'time']]

 -- Table: party forms 
columns : [['party id', 'number'], ['form id', 'number'], ['date completion started', 'time'], ['form status code', 'text'], ['date fully completed', 'time']]

 -- Table: party services 
columns : [['booking id', 'number'], ['customer id', 'number'], ['service id', 'number'], ['service datetime', 'time'], ['booking made date', 'time']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: Find the name of organizations whose names contain "Party".
SQL: SELECT organization_name FROM organizations WHERE organization_name LIKE "%Party%"