answer
stringlengths
18
557
context
stringlengths
27
489
question
stringlengths
12
244
text
stringlengths
275
1.7k
SELECT T1.sent_date FROM documents AS T1 JOIN Grants AS T2 ON T1.grant_id = T2.grant_id JOIN Organisations AS T3 ON T2.organisation_id = T3.organisation_id JOIN organisation_Types AS T4 ON T3.organisation_type = T4.organisation_type WHERE T2.grant_amount > 5000 AND T4.organisation_type_description = 'Research'
CREATE TABLE organisation_Types (organisation_type VARCHAR, organisation_type_description VARCHAR); CREATE TABLE Grants (grant_id VARCHAR, organisation_id VARCHAR, grant_amount VARCHAR); CREATE TABLE Organisations (organisation_id VARCHAR, organisation_type VARCHAR); CREATE TABLE documents (sent_date VARCHAR, grant_id VARCHAR)
Find out the send dates of the documents with the grant amount of more than 5000 were granted by organisation type described
<s>[INST] Given the following SQL query and context: Query: SELECT T1.sent_date FROM documents AS T1 JOIN Grants AS T2 ON T1.grant_id = T2.grant_id JOIN Organisations AS T3 ON T2.organisation_id = T3.organisation_id JOIN organisation_Types AS T4 ON T3.organisation_type = T4.organisation_type WHERE T2.grant_amount > 5000 AND T4.organisation_type_description = 'Research' Context: CREATE TABLE organisation_Types (organisation_type VARCHAR, organisation_type_description VARCHAR); CREATE TABLE Grants (grant_id VARCHAR, organisation_id VARCHAR, grant_amount VARCHAR); CREATE TABLE Organisations (organisation_id VARCHAR, organisation_type VARCHAR); CREATE TABLE documents (sent_date VARCHAR, grant_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find out the send dates of the documents with the grant amount of more than 5000 were granted by organisation type described The answer to your question is: SELECT T1.sent_date FROM documents AS T1 JOIN Grants AS T2 ON T1.grant_id = T2.grant_id JOIN Organisations AS T3 ON T2.organisation_id = T3.organisation_id JOIN organisation_Types AS T4 ON T3.organisation_type = T4.organisation_type WHERE T2.grant_amount > 5000 AND T4.organisation_type_description = 'Research'. [/s>
SELECT T1.response_received_date FROM Documents AS T1 JOIN Document_Types AS T2 ON T1.document_type_code = T2.document_type_code JOIN Grants AS T3 ON T1.grant_id = T3.grant_id WHERE T2.document_description = 'Regular' OR T3.grant_amount > 100
CREATE TABLE Documents (response_received_date VARCHAR, document_type_code VARCHAR, grant_id VARCHAR); CREATE TABLE Document_Types (document_type_code VARCHAR, document_description VARCHAR); CREATE TABLE Grants (grant_id VARCHAR, grant_amount VARCHAR)
What are the response received dates for the documents described as 'Regular' or granted with more than 100?
<s>[INST] Given the following SQL query and context: Query: SELECT T1.response_received_date FROM Documents AS T1 JOIN Document_Types AS T2 ON T1.document_type_code = T2.document_type_code JOIN Grants AS T3 ON T1.grant_id = T3.grant_id WHERE T2.document_description = 'Regular' OR T3.grant_amount > 100 Context: CREATE TABLE Documents (response_received_date VARCHAR, document_type_code VARCHAR, grant_id VARCHAR); CREATE TABLE Document_Types (document_type_code VARCHAR, document_description VARCHAR); CREATE TABLE Grants (grant_id VARCHAR, grant_amount VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What are the response received dates for the documents described as 'Regular' or granted with more than 100? The answer to your question is: SELECT T1.response_received_date FROM Documents AS T1 JOIN Document_Types AS T2 ON T1.document_type_code = T2.document_type_code JOIN Grants AS T3 ON T1.grant_id = T3.grant_id WHERE T2.document_description = 'Regular' OR T3.grant_amount > 100. [/s>
SELECT project_details FROM Projects WHERE NOT project_id IN (SELECT project_id FROM Project_Staff WHERE role_code = 'researcher')
CREATE TABLE Projects (project_details VARCHAR, project_id VARCHAR, role_code VARCHAR); CREATE TABLE Project_Staff (project_details VARCHAR, project_id VARCHAR, role_code VARCHAR)
List the project details of the projects which did not hire any staff for a researcher role.
<s>[INST] Given the following SQL query and context: Query: SELECT project_details FROM Projects WHERE NOT project_id IN (SELECT project_id FROM Project_Staff WHERE role_code = 'researcher') Context: CREATE TABLE Projects (project_details VARCHAR, project_id VARCHAR, role_code VARCHAR); CREATE TABLE Project_Staff (project_details VARCHAR, project_id VARCHAR, role_code VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List the project details of the projects which did not hire any staff for a researcher role. The answer to your question is: SELECT project_details FROM Projects WHERE NOT project_id IN (SELECT project_id FROM Project_Staff WHERE role_code = 'researcher'). [/s>
SELECT T1.task_details, T1.task_id, T2.project_id FROM Tasks AS T1 JOIN Projects AS T2 ON T1.project_id = T2.project_id WHERE T2.project_details = 'omnis' UNION SELECT T1.task_details, T1.task_id, T2.project_id FROM Tasks AS T1 JOIN Projects AS T2 ON T1.project_id = T2.project_id JOIN Project_outcomes AS T3 ON T2.project_id = T3.project_id GROUP BY T2.project_id HAVING COUNT(*) > 2
CREATE TABLE Projects (project_id VARCHAR, project_details VARCHAR); CREATE TABLE Project_outcomes (project_id VARCHAR); CREATE TABLE Tasks (task_details VARCHAR, task_id VARCHAR, project_id VARCHAR)
What are the task details, task id and project id for the projects which are detailed as 'omnis' or have more than 2 outcomes?
<s>[INST] Given the following SQL query and context: Query: SELECT T1.task_details, T1.task_id, T2.project_id FROM Tasks AS T1 JOIN Projects AS T2 ON T1.project_id = T2.project_id WHERE T2.project_details = 'omnis' UNION SELECT T1.task_details, T1.task_id, T2.project_id FROM Tasks AS T1 JOIN Projects AS T2 ON T1.project_id = T2.project_id JOIN Project_outcomes AS T3 ON T2.project_id = T3.project_id GROUP BY T2.project_id HAVING COUNT(*) > 2 Context: CREATE TABLE Projects (project_id VARCHAR, project_details VARCHAR); CREATE TABLE Project_outcomes (project_id VARCHAR); CREATE TABLE Tasks (task_details VARCHAR, task_id VARCHAR, project_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What are the task details, task id and project id for the projects which are detailed as 'omnis' or have more than 2 outcomes? The answer to your question is: SELECT T1.task_details, T1.task_id, T2.project_id FROM Tasks AS T1 JOIN Projects AS T2 ON T1.project_id = T2.project_id WHERE T2.project_details = 'omnis' UNION SELECT T1.task_details, T1.task_id, T2.project_id FROM Tasks AS T1 JOIN Projects AS T2 ON T1.project_id = T2.project_id JOIN Project_outcomes AS T3 ON T2.project_id = T3.project_id GROUP BY T2.project_id HAVING COUNT(*) > 2. [/s>
SELECT date_from, date_to FROM Project_Staff WHERE role_code = 'researcher'
CREATE TABLE Project_Staff (date_from VARCHAR, date_to VARCHAR, role_code VARCHAR)
When do all the researcher role staff start to work, and when do they stop working?
<s>[INST] Given the following SQL query and context: Query: SELECT date_from, date_to FROM Project_Staff WHERE role_code = 'researcher' Context: CREATE TABLE Project_Staff (date_from VARCHAR, date_to VARCHAR, role_code VARCHAR) [/INST] Based on the provided SQL query and context, your question is: When do all the researcher role staff start to work, and when do they stop working? The answer to your question is: SELECT date_from, date_to FROM Project_Staff WHERE role_code = 'researcher'. [/s>
SELECT COUNT(DISTINCT role_code) FROM Project_Staff
CREATE TABLE Project_Staff (role_code VARCHAR)
How many kinds of roles are there for the staff?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(DISTINCT role_code) FROM Project_Staff Context: CREATE TABLE Project_Staff (role_code VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many kinds of roles are there for the staff? The answer to your question is: SELECT COUNT(DISTINCT role_code) FROM Project_Staff. [/s>
SELECT SUM(grant_amount), organisation_id FROM Grants GROUP BY organisation_id
CREATE TABLE Grants (organisation_id VARCHAR, grant_amount INTEGER)
What is the total amount of grants given by each organisations? Also list the organisation id.
<s>[INST] Given the following SQL query and context: Query: SELECT SUM(grant_amount), organisation_id FROM Grants GROUP BY organisation_id Context: CREATE TABLE Grants (organisation_id VARCHAR, grant_amount INTEGER) [/INST] Based on the provided SQL query and context, your question is: What is the total amount of grants given by each organisations? Also list the organisation id. The answer to your question is: SELECT SUM(grant_amount), organisation_id FROM Grants GROUP BY organisation_id. [/s>
SELECT T1.project_details FROM Projects AS T1 JOIN Project_outcomes AS T2 ON T1.project_id = T2.project_id JOIN Research_outcomes AS T3 ON T2.outcome_code = T3.outcome_code WHERE T3.outcome_description LIKE '%Published%'
CREATE TABLE Research_outcomes (outcome_code VARCHAR, outcome_description VARCHAR); CREATE TABLE Project_outcomes (project_id VARCHAR, outcome_code VARCHAR); CREATE TABLE Projects (project_details VARCHAR, project_id VARCHAR)
List the project details of the projects with the research outcome described with the substring 'Published'.
<s>[INST] Given the following SQL query and context: Query: SELECT T1.project_details FROM Projects AS T1 JOIN Project_outcomes AS T2 ON T1.project_id = T2.project_id JOIN Research_outcomes AS T3 ON T2.outcome_code = T3.outcome_code WHERE T3.outcome_description LIKE '%Published%' Context: CREATE TABLE Research_outcomes (outcome_code VARCHAR, outcome_description VARCHAR); CREATE TABLE Project_outcomes (project_id VARCHAR, outcome_code VARCHAR); CREATE TABLE Projects (project_details VARCHAR, project_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List the project details of the projects with the research outcome described with the substring 'Published'. The answer to your question is: SELECT T1.project_details FROM Projects AS T1 JOIN Project_outcomes AS T2 ON T1.project_id = T2.project_id JOIN Research_outcomes AS T3 ON T2.outcome_code = T3.outcome_code WHERE T3.outcome_description LIKE '%Published%'. [/s>
SELECT T1.project_id, COUNT(*) FROM Project_Staff AS T1 JOIN Projects AS T2 ON T1.project_id = T2.project_id GROUP BY T1.project_id ORDER BY COUNT(*)
CREATE TABLE Project_Staff (project_id VARCHAR); CREATE TABLE Projects (project_id VARCHAR)
How many staff does each project has? List the project id and the number in an ascending order.
<s>[INST] Given the following SQL query and context: Query: SELECT T1.project_id, COUNT(*) FROM Project_Staff AS T1 JOIN Projects AS T2 ON T1.project_id = T2.project_id GROUP BY T1.project_id ORDER BY COUNT(*) Context: CREATE TABLE Project_Staff (project_id VARCHAR); CREATE TABLE Projects (project_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many staff does each project has? List the project id and the number in an ascending order. The answer to your question is: SELECT T1.project_id, COUNT(*) FROM Project_Staff AS T1 JOIN Projects AS T2 ON T1.project_id = T2.project_id GROUP BY T1.project_id ORDER BY COUNT(*). [/s>
SELECT role_description FROM Staff_Roles WHERE role_code = 'researcher'
CREATE TABLE Staff_Roles (role_description VARCHAR, role_code VARCHAR)
What is the complete description of the researcher role.
<s>[INST] Given the following SQL query and context: Query: SELECT role_description FROM Staff_Roles WHERE role_code = 'researcher' Context: CREATE TABLE Staff_Roles (role_description VARCHAR, role_code VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is the complete description of the researcher role. The answer to your question is: SELECT role_description FROM Staff_Roles WHERE role_code = 'researcher'. [/s>
SELECT date_from FROM Project_Staff ORDER BY date_from LIMIT 1
CREATE TABLE Project_Staff (date_from VARCHAR)
When did the first staff for the projects started working?
<s>[INST] Given the following SQL query and context: Query: SELECT date_from FROM Project_Staff ORDER BY date_from LIMIT 1 Context: CREATE TABLE Project_Staff (date_from VARCHAR) [/INST] Based on the provided SQL query and context, your question is: When did the first staff for the projects started working? The answer to your question is: SELECT date_from FROM Project_Staff ORDER BY date_from LIMIT 1. [/s>
SELECT T1.project_details, T1.project_id FROM Projects AS T1 JOIN Project_outcomes AS T2 ON T1.project_id = T2.project_id GROUP BY T1.project_id ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE Project_outcomes (project_id VARCHAR); CREATE TABLE Projects (project_details VARCHAR, project_id VARCHAR)
Which project made the most number of outcomes? List the project details and the project id.
<s>[INST] Given the following SQL query and context: Query: SELECT T1.project_details, T1.project_id FROM Projects AS T1 JOIN Project_outcomes AS T2 ON T1.project_id = T2.project_id GROUP BY T1.project_id ORDER BY COUNT(*) DESC LIMIT 1 Context: CREATE TABLE Project_outcomes (project_id VARCHAR); CREATE TABLE Projects (project_details VARCHAR, project_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Which project made the most number of outcomes? List the project details and the project id. The answer to your question is: SELECT T1.project_details, T1.project_id FROM Projects AS T1 JOIN Project_outcomes AS T2 ON T1.project_id = T2.project_id GROUP BY T1.project_id ORDER BY COUNT(*) DESC LIMIT 1. [/s>
SELECT project_details FROM Projects WHERE NOT project_id IN (SELECT project_id FROM Project_outcomes)
CREATE TABLE Project_outcomes (project_details VARCHAR, project_id VARCHAR); CREATE TABLE Projects (project_details VARCHAR, project_id VARCHAR)
Which projects have no outcome? List the project details.
<s>[INST] Given the following SQL query and context: Query: SELECT project_details FROM Projects WHERE NOT project_id IN (SELECT project_id FROM Project_outcomes) Context: CREATE TABLE Project_outcomes (project_details VARCHAR, project_id VARCHAR); CREATE TABLE Projects (project_details VARCHAR, project_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Which projects have no outcome? List the project details. The answer to your question is: SELECT project_details FROM Projects WHERE NOT project_id IN (SELECT project_id FROM Project_outcomes). [/s>
SELECT T1.organisation_id, T1.organisation_type, T1.organisation_details FROM Organisations AS T1 JOIN Research_Staff AS T2 ON T1.organisation_id = T2.employer_organisation_id GROUP BY T1.organisation_id ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE Organisations (organisation_id VARCHAR, organisation_type VARCHAR, organisation_details VARCHAR); CREATE TABLE Research_Staff (employer_organisation_id VARCHAR)
Which organisation hired the most number of research staff? List the organisation id, type and detail.
<s>[INST] Given the following SQL query and context: Query: SELECT T1.organisation_id, T1.organisation_type, T1.organisation_details FROM Organisations AS T1 JOIN Research_Staff AS T2 ON T1.organisation_id = T2.employer_organisation_id GROUP BY T1.organisation_id ORDER BY COUNT(*) DESC LIMIT 1 Context: CREATE TABLE Organisations (organisation_id VARCHAR, organisation_type VARCHAR, organisation_details VARCHAR); CREATE TABLE Research_Staff (employer_organisation_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Which organisation hired the most number of research staff? List the organisation id, type and detail. The answer to your question is: SELECT T1.organisation_id, T1.organisation_type, T1.organisation_details FROM Organisations AS T1 JOIN Research_Staff AS T2 ON T1.organisation_id = T2.employer_organisation_id GROUP BY T1.organisation_id ORDER BY COUNT(*) DESC LIMIT 1. [/s>
SELECT T1.role_description, T2.staff_id FROM Staff_Roles AS T1 JOIN Project_Staff AS T2 ON T1.role_code = T2.role_code JOIN Project_outcomes AS T3 ON T2.project_id = T3.project_id GROUP BY T2.staff_id ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE Project_outcomes (project_id VARCHAR); CREATE TABLE Project_Staff (staff_id VARCHAR, role_code VARCHAR, project_id VARCHAR); CREATE TABLE Staff_Roles (role_description VARCHAR, role_code VARCHAR)
Show the role description and the id of the project staff involved in most number of project outcomes?
<s>[INST] Given the following SQL query and context: Query: SELECT T1.role_description, T2.staff_id FROM Staff_Roles AS T1 JOIN Project_Staff AS T2 ON T1.role_code = T2.role_code JOIN Project_outcomes AS T3 ON T2.project_id = T3.project_id GROUP BY T2.staff_id ORDER BY COUNT(*) DESC LIMIT 1 Context: CREATE TABLE Project_outcomes (project_id VARCHAR); CREATE TABLE Project_Staff (staff_id VARCHAR, role_code VARCHAR, project_id VARCHAR); CREATE TABLE Staff_Roles (role_description VARCHAR, role_code VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the role description and the id of the project staff involved in most number of project outcomes? The answer to your question is: SELECT T1.role_description, T2.staff_id FROM Staff_Roles AS T1 JOIN Project_Staff AS T2 ON T1.role_code = T2.role_code JOIN Project_outcomes AS T3 ON T2.project_id = T3.project_id GROUP BY T2.staff_id ORDER BY COUNT(*) DESC LIMIT 1. [/s>
SELECT document_type_code FROM Document_Types WHERE document_description LIKE 'Initial%'
CREATE TABLE Document_Types (document_type_code VARCHAR, document_description VARCHAR)
Which document type is described with the prefix 'Initial'?
<s>[INST] Given the following SQL query and context: Query: SELECT document_type_code FROM Document_Types WHERE document_description LIKE 'Initial%' Context: CREATE TABLE Document_Types (document_type_code VARCHAR, document_description VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Which document type is described with the prefix 'Initial'? The answer to your question is: SELECT document_type_code FROM Document_Types WHERE document_description LIKE 'Initial%'. [/s>
SELECT T1.grant_start_date FROM Grants AS T1 JOIN Documents AS T2 ON T1.grant_id = T2.grant_id JOIN Document_Types AS T3 ON T2.document_type_code = T3.document_type_code WHERE T3.document_description = 'Regular' INTERSECT SELECT T1.grant_start_date FROM Grants AS T1 JOIN Documents AS T2 ON T1.grant_id = T2.grant_id JOIN Document_Types AS T3 ON T2.document_type_code = T3.document_type_code WHERE T3.document_description = 'Initial Application'
CREATE TABLE Grants (grant_start_date VARCHAR, grant_id VARCHAR); CREATE TABLE Document_Types (document_type_code VARCHAR, document_description VARCHAR); CREATE TABLE Documents (grant_id VARCHAR, document_type_code VARCHAR)
For grants with both documents described as 'Regular' and documents described as 'Initial Application', list its start date.
<s>[INST] Given the following SQL query and context: Query: SELECT T1.grant_start_date FROM Grants AS T1 JOIN Documents AS T2 ON T1.grant_id = T2.grant_id JOIN Document_Types AS T3 ON T2.document_type_code = T3.document_type_code WHERE T3.document_description = 'Regular' INTERSECT SELECT T1.grant_start_date FROM Grants AS T1 JOIN Documents AS T2 ON T1.grant_id = T2.grant_id JOIN Document_Types AS T3 ON T2.document_type_code = T3.document_type_code WHERE T3.document_description = 'Initial Application' Context: CREATE TABLE Grants (grant_start_date VARCHAR, grant_id VARCHAR); CREATE TABLE Document_Types (document_type_code VARCHAR, document_description VARCHAR); CREATE TABLE Documents (grant_id VARCHAR, document_type_code VARCHAR) [/INST] Based on the provided SQL query and context, your question is: For grants with both documents described as 'Regular' and documents described as 'Initial Application', list its start date. The answer to your question is: SELECT T1.grant_start_date FROM Grants AS T1 JOIN Documents AS T2 ON T1.grant_id = T2.grant_id JOIN Document_Types AS T3 ON T2.document_type_code = T3.document_type_code WHERE T3.document_description = 'Regular' INTERSECT SELECT T1.grant_start_date FROM Grants AS T1 JOIN Documents AS T2 ON T1.grant_id = T2.grant_id JOIN Document_Types AS T3 ON T2.document_type_code = T3.document_type_code WHERE T3.document_description = 'Initial Application'. [/s>
SELECT grant_id, COUNT(*) FROM Documents GROUP BY grant_id ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE Documents (grant_id VARCHAR)
How many documents can one grant have at most? List the grant id and number.
<s>[INST] Given the following SQL query and context: Query: SELECT grant_id, COUNT(*) FROM Documents GROUP BY grant_id ORDER BY COUNT(*) DESC LIMIT 1 Context: CREATE TABLE Documents (grant_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many documents can one grant have at most? List the grant id and number. The answer to your question is: SELECT grant_id, COUNT(*) FROM Documents GROUP BY grant_id ORDER BY COUNT(*) DESC LIMIT 1. [/s>
SELECT T1.organisation_type_description FROM organisation_Types AS T1 JOIN Organisations AS T2 ON T1.organisation_type = T2.organisation_type WHERE T2.organisation_details = 'quo'
CREATE TABLE Organisations (organisation_type VARCHAR, organisation_details VARCHAR); CREATE TABLE organisation_Types (organisation_type_description VARCHAR, organisation_type VARCHAR)
Find the organisation type description of the organisation detailed as 'quo'.
<s>[INST] Given the following SQL query and context: Query: SELECT T1.organisation_type_description FROM organisation_Types AS T1 JOIN Organisations AS T2 ON T1.organisation_type = T2.organisation_type WHERE T2.organisation_details = 'quo' Context: CREATE TABLE Organisations (organisation_type VARCHAR, organisation_details VARCHAR); CREATE TABLE organisation_Types (organisation_type_description VARCHAR, organisation_type VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the organisation type description of the organisation detailed as 'quo'. The answer to your question is: SELECT T1.organisation_type_description FROM organisation_Types AS T1 JOIN Organisations AS T2 ON T1.organisation_type = T2.organisation_type WHERE T2.organisation_details = 'quo'. [/s>
SELECT organisation_details FROM Organisations AS T1 JOIN organisation_Types AS T2 ON T1.organisation_type = T2.organisation_type WHERE T2.organisation_type_description = 'Sponsor' ORDER BY organisation_details
CREATE TABLE organisation_Types (organisation_type VARCHAR, organisation_type_description VARCHAR); CREATE TABLE Organisations (organisation_type VARCHAR)
What are all the details of the organisations described as 'Sponsor'? Sort the result in an ascending order.
<s>[INST] Given the following SQL query and context: Query: SELECT organisation_details FROM Organisations AS T1 JOIN organisation_Types AS T2 ON T1.organisation_type = T2.organisation_type WHERE T2.organisation_type_description = 'Sponsor' ORDER BY organisation_details Context: CREATE TABLE organisation_Types (organisation_type VARCHAR, organisation_type_description VARCHAR); CREATE TABLE Organisations (organisation_type VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What are all the details of the organisations described as 'Sponsor'? Sort the result in an ascending order. The answer to your question is: SELECT organisation_details FROM Organisations AS T1 JOIN organisation_Types AS T2 ON T1.organisation_type = T2.organisation_type WHERE T2.organisation_type_description = 'Sponsor' ORDER BY organisation_details. [/s>
SELECT COUNT(*) FROM Project_outcomes WHERE outcome_code = 'Patent'
CREATE TABLE Project_outcomes (outcome_code VARCHAR)
How many Patent outcomes are generated from all the projects?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM Project_outcomes WHERE outcome_code = 'Patent' Context: CREATE TABLE Project_outcomes (outcome_code VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many Patent outcomes are generated from all the projects? The answer to your question is: SELECT COUNT(*) FROM Project_outcomes WHERE outcome_code = 'Patent'. [/s>
SELECT COUNT(*) FROM Project_Staff WHERE role_code = 'leader' OR date_from < '1989-04-24 23:51:54'
CREATE TABLE Project_Staff (role_code VARCHAR, date_from VARCHAR)
How many project staff worked as leaders or started working before '1989-04-24 23:51:54'?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM Project_Staff WHERE role_code = 'leader' OR date_from < '1989-04-24 23:51:54' Context: CREATE TABLE Project_Staff (role_code VARCHAR, date_from VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many project staff worked as leaders or started working before '1989-04-24 23:51:54'? The answer to your question is: SELECT COUNT(*) FROM Project_Staff WHERE role_code = 'leader' OR date_from < '1989-04-24 23:51:54'. [/s>
SELECT date_to FROM Project_Staff ORDER BY date_to DESC LIMIT 1
CREATE TABLE Project_Staff (date_to VARCHAR)
What is the last date of the staff leaving the projects?
<s>[INST] Given the following SQL query and context: Query: SELECT date_to FROM Project_Staff ORDER BY date_to DESC LIMIT 1 Context: CREATE TABLE Project_Staff (date_to VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is the last date of the staff leaving the projects? The answer to your question is: SELECT date_to FROM Project_Staff ORDER BY date_to DESC LIMIT 1. [/s>
SELECT T1.outcome_description FROM Research_outcomes AS T1 JOIN Project_outcomes AS T2 ON T1.outcome_code = T2.outcome_code JOIN Projects AS T3 ON T2.project_id = T3.project_id WHERE T3.project_details = 'sint'
CREATE TABLE Project_outcomes (outcome_code VARCHAR, project_id VARCHAR); CREATE TABLE Research_outcomes (outcome_description VARCHAR, outcome_code VARCHAR); CREATE TABLE Projects (project_id VARCHAR, project_details VARCHAR)
What are the result description of the project whose detail is 'sint'?
<s>[INST] Given the following SQL query and context: Query: SELECT T1.outcome_description FROM Research_outcomes AS T1 JOIN Project_outcomes AS T2 ON T1.outcome_code = T2.outcome_code JOIN Projects AS T3 ON T2.project_id = T3.project_id WHERE T3.project_details = 'sint' Context: CREATE TABLE Project_outcomes (outcome_code VARCHAR, project_id VARCHAR); CREATE TABLE Research_outcomes (outcome_description VARCHAR, outcome_code VARCHAR); CREATE TABLE Projects (project_id VARCHAR, project_details VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What are the result description of the project whose detail is 'sint'? The answer to your question is: SELECT T1.outcome_description FROM Research_outcomes AS T1 JOIN Project_outcomes AS T2 ON T1.outcome_code = T2.outcome_code JOIN Projects AS T3 ON T2.project_id = T3.project_id WHERE T3.project_details = 'sint'. [/s>
SELECT T1.organisation_id, COUNT(*) FROM Projects AS T1 JOIN Project_outcomes AS T2 ON T1.project_id = T2.project_id GROUP BY T1.organisation_id ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE Project_outcomes (project_id VARCHAR); CREATE TABLE Projects (organisation_id VARCHAR, project_id VARCHAR)
List the organisation id with the maximum outcome count, and the count.
<s>[INST] Given the following SQL query and context: Query: SELECT T1.organisation_id, COUNT(*) FROM Projects AS T1 JOIN Project_outcomes AS T2 ON T1.project_id = T2.project_id GROUP BY T1.organisation_id ORDER BY COUNT(*) DESC LIMIT 1 Context: CREATE TABLE Project_outcomes (project_id VARCHAR); CREATE TABLE Projects (organisation_id VARCHAR, project_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List the organisation id with the maximum outcome count, and the count. The answer to your question is: SELECT T1.organisation_id, COUNT(*) FROM Projects AS T1 JOIN Project_outcomes AS T2 ON T1.project_id = T2.project_id GROUP BY T1.organisation_id ORDER BY COUNT(*) DESC LIMIT 1. [/s>
SELECT project_details FROM Projects WHERE organisation_id IN (SELECT organisation_id FROM Projects GROUP BY organisation_id ORDER BY COUNT(*) DESC LIMIT 1)
CREATE TABLE Projects (project_details VARCHAR, organisation_id VARCHAR)
List the project details of the projects launched by the organisation
<s>[INST] Given the following SQL query and context: Query: SELECT project_details FROM Projects WHERE organisation_id IN (SELECT organisation_id FROM Projects GROUP BY organisation_id ORDER BY COUNT(*) DESC LIMIT 1) Context: CREATE TABLE Projects (project_details VARCHAR, organisation_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List the project details of the projects launched by the organisation The answer to your question is: SELECT project_details FROM Projects WHERE organisation_id IN (SELECT organisation_id FROM Projects GROUP BY organisation_id ORDER BY COUNT(*) DESC LIMIT 1). [/s>
SELECT staff_details FROM Research_Staff ORDER BY staff_details
CREATE TABLE Research_Staff (staff_details VARCHAR)
List the research staff details, and order in ascending order.
<s>[INST] Given the following SQL query and context: Query: SELECT staff_details FROM Research_Staff ORDER BY staff_details Context: CREATE TABLE Research_Staff (staff_details VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List the research staff details, and order in ascending order. The answer to your question is: SELECT staff_details FROM Research_Staff ORDER BY staff_details. [/s>
SELECT COUNT(*) FROM Tasks
CREATE TABLE Tasks (Id VARCHAR)
How many tasks are there in total?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM Tasks Context: CREATE TABLE Tasks (Id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many tasks are there in total? The answer to your question is: SELECT COUNT(*) FROM Tasks. [/s>
SELECT COUNT(*), T1.project_details FROM Projects AS T1 JOIN Tasks AS T2 ON T1.project_id = T2.project_id GROUP BY T1.project_id
CREATE TABLE Projects (project_details VARCHAR, project_id VARCHAR); CREATE TABLE Tasks (project_id VARCHAR)
How many tasks does each project have? List the task count and the project detail.
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*), T1.project_details FROM Projects AS T1 JOIN Tasks AS T2 ON T1.project_id = T2.project_id GROUP BY T1.project_id Context: CREATE TABLE Projects (project_details VARCHAR, project_id VARCHAR); CREATE TABLE Tasks (project_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many tasks does each project have? List the task count and the project detail. The answer to your question is: SELECT COUNT(*), T1.project_details FROM Projects AS T1 JOIN Tasks AS T2 ON T1.project_id = T2.project_id GROUP BY T1.project_id. [/s>
SELECT role_code FROM Project_Staff WHERE date_from > '2003-04-19 15:06:20' AND date_to < '2016-03-15 00:33:18'
CREATE TABLE Project_Staff (role_code VARCHAR, date_from VARCHAR, date_to VARCHAR)
What are the staff roles of the staff who
<s>[INST] Given the following SQL query and context: Query: SELECT role_code FROM Project_Staff WHERE date_from > '2003-04-19 15:06:20' AND date_to < '2016-03-15 00:33:18' Context: CREATE TABLE Project_Staff (role_code VARCHAR, date_from VARCHAR, date_to VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What are the staff roles of the staff who The answer to your question is: SELECT role_code FROM Project_Staff WHERE date_from > '2003-04-19 15:06:20' AND date_to < '2016-03-15 00:33:18'. [/s>
SELECT T1.outcome_description FROM Research_outcomes AS T1 JOIN Project_outcomes AS T2 ON T1.outcome_code = T2.outcome_code
CREATE TABLE Research_outcomes (outcome_description VARCHAR, outcome_code VARCHAR); CREATE TABLE Project_outcomes (outcome_code VARCHAR)
What are the descriptions of all the project outcomes?
<s>[INST] Given the following SQL query and context: Query: SELECT T1.outcome_description FROM Research_outcomes AS T1 JOIN Project_outcomes AS T2 ON T1.outcome_code = T2.outcome_code Context: CREATE TABLE Research_outcomes (outcome_description VARCHAR, outcome_code VARCHAR); CREATE TABLE Project_outcomes (outcome_code VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What are the descriptions of all the project outcomes? The answer to your question is: SELECT T1.outcome_description FROM Research_outcomes AS T1 JOIN Project_outcomes AS T2 ON T1.outcome_code = T2.outcome_code. [/s>
SELECT role_code FROM Project_Staff GROUP BY role_code ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE Project_Staff (role_code VARCHAR)
Which role is most common for the staff?
<s>[INST] Given the following SQL query and context: Query: SELECT role_code FROM Project_Staff GROUP BY role_code ORDER BY COUNT(*) DESC LIMIT 1 Context: CREATE TABLE Project_Staff (role_code VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Which role is most common for the staff? The answer to your question is: SELECT role_code FROM Project_Staff GROUP BY role_code ORDER BY COUNT(*) DESC LIMIT 1. [/s>
SELECT COUNT(T2.friend) FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T1.name = 'Dan'
CREATE TABLE PersonFriend (friend VARCHAR, name VARCHAR); CREATE TABLE Person (name VARCHAR)
How many friends does Dan have?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(T2.friend) FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T1.name = 'Dan' Context: CREATE TABLE PersonFriend (friend VARCHAR, name VARCHAR); CREATE TABLE Person (name VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many friends does Dan have? The answer to your question is: SELECT COUNT(T2.friend) FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T1.name = 'Dan'. [/s>
SELECT COUNT(*) FROM Person WHERE gender = 'female'
CREATE TABLE Person (gender VARCHAR)
How many females does this network has?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM Person WHERE gender = 'female' Context: CREATE TABLE Person (gender VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many females does this network has? The answer to your question is: SELECT COUNT(*) FROM Person WHERE gender = 'female'. [/s>
SELECT AVG(age) FROM Person
CREATE TABLE Person (age INTEGER)
What is the average age for all person?
<s>[INST] Given the following SQL query and context: Query: SELECT AVG(age) FROM Person Context: CREATE TABLE Person (age INTEGER) [/INST] Based on the provided SQL query and context, your question is: What is the average age for all person? The answer to your question is: SELECT AVG(age) FROM Person. [/s>
SELECT COUNT(DISTINCT city) FROM Person
CREATE TABLE Person (city VARCHAR)
How many different cities are they from?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(DISTINCT city) FROM Person Context: CREATE TABLE Person (city VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many different cities are they from? The answer to your question is: SELECT COUNT(DISTINCT city) FROM Person. [/s>
SELECT COUNT(DISTINCT job) FROM Person
CREATE TABLE Person (job VARCHAR)
How many type of jobs do they have?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(DISTINCT job) FROM Person Context: CREATE TABLE Person (job VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many type of jobs do they have? The answer to your question is: SELECT COUNT(DISTINCT job) FROM Person. [/s>
SELECT name FROM Person WHERE age = (SELECT MAX(age) FROM person)
CREATE TABLE Person (name VARCHAR, age INTEGER); CREATE TABLE person (name VARCHAR, age INTEGER)
Who is the oldest person?
<s>[INST] Given the following SQL query and context: Query: SELECT name FROM Person WHERE age = (SELECT MAX(age) FROM person) Context: CREATE TABLE Person (name VARCHAR, age INTEGER); CREATE TABLE person (name VARCHAR, age INTEGER) [/INST] Based on the provided SQL query and context, your question is: Who is the oldest person? The answer to your question is: SELECT name FROM Person WHERE age = (SELECT MAX(age) FROM person). [/s>
SELECT name FROM Person WHERE job = 'student' AND age = (SELECT MAX(age) FROM person WHERE job = 'student')
CREATE TABLE person (name VARCHAR, job VARCHAR, age INTEGER); CREATE TABLE Person (name VARCHAR, job VARCHAR, age INTEGER)
Who is the oldest person whose job is student?
<s>[INST] Given the following SQL query and context: Query: SELECT name FROM Person WHERE job = 'student' AND age = (SELECT MAX(age) FROM person WHERE job = 'student') Context: CREATE TABLE person (name VARCHAR, job VARCHAR, age INTEGER); CREATE TABLE Person (name VARCHAR, job VARCHAR, age INTEGER) [/INST] Based on the provided SQL query and context, your question is: Who is the oldest person whose job is student? The answer to your question is: SELECT name FROM Person WHERE job = 'student' AND age = (SELECT MAX(age) FROM person WHERE job = 'student'). [/s>
SELECT name FROM Person WHERE gender = 'male' AND age = (SELECT MIN(age) FROM person WHERE gender = 'male')
CREATE TABLE Person (name VARCHAR, gender VARCHAR, age INTEGER); CREATE TABLE person (name VARCHAR, gender VARCHAR, age INTEGER)
Who is the youngest male?
<s>[INST] Given the following SQL query and context: Query: SELECT name FROM Person WHERE gender = 'male' AND age = (SELECT MIN(age) FROM person WHERE gender = 'male') Context: CREATE TABLE Person (name VARCHAR, gender VARCHAR, age INTEGER); CREATE TABLE person (name VARCHAR, gender VARCHAR, age INTEGER) [/INST] Based on the provided SQL query and context, your question is: Who is the youngest male? The answer to your question is: SELECT name FROM Person WHERE gender = 'male' AND age = (SELECT MIN(age) FROM person WHERE gender = 'male'). [/s>
SELECT age FROM Person WHERE job = 'doctor' AND name = 'Zach'
CREATE TABLE Person (age VARCHAR, job VARCHAR, name VARCHAR)
How old is the doctor named Zach?
<s>[INST] Given the following SQL query and context: Query: SELECT age FROM Person WHERE job = 'doctor' AND name = 'Zach' Context: CREATE TABLE Person (age VARCHAR, job VARCHAR, name VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How old is the doctor named Zach? The answer to your question is: SELECT age FROM Person WHERE job = 'doctor' AND name = 'Zach'. [/s>
SELECT name FROM Person WHERE age < 30
CREATE TABLE Person (name VARCHAR, age INTEGER)
Who is the person whose age is below 30?
<s>[INST] Given the following SQL query and context: Query: SELECT name FROM Person WHERE age < 30 Context: CREATE TABLE Person (name VARCHAR, age INTEGER) [/INST] Based on the provided SQL query and context, your question is: Who is the person whose age is below 30? The answer to your question is: SELECT name FROM Person WHERE age < 30. [/s>
SELECT COUNT(*) FROM Person WHERE age > 30 AND job = 'engineer'
CREATE TABLE Person (age VARCHAR, job VARCHAR)
How many people whose age is greater 30 and job is engineer?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM Person WHERE age > 30 AND job = 'engineer' Context: CREATE TABLE Person (age VARCHAR, job VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many people whose age is greater 30 and job is engineer? The answer to your question is: SELECT COUNT(*) FROM Person WHERE age > 30 AND job = 'engineer'. [/s>
SELECT AVG(age), gender FROM Person GROUP BY gender
CREATE TABLE Person (gender VARCHAR, age INTEGER)
What is the average age for each gender?
<s>[INST] Given the following SQL query and context: Query: SELECT AVG(age), gender FROM Person GROUP BY gender Context: CREATE TABLE Person (gender VARCHAR, age INTEGER) [/INST] Based on the provided SQL query and context, your question is: What is the average age for each gender? The answer to your question is: SELECT AVG(age), gender FROM Person GROUP BY gender. [/s>
SELECT AVG(age), job FROM Person GROUP BY job
CREATE TABLE Person (job VARCHAR, age INTEGER)
What is average age for different job title?
<s>[INST] Given the following SQL query and context: Query: SELECT AVG(age), job FROM Person GROUP BY job Context: CREATE TABLE Person (job VARCHAR, age INTEGER) [/INST] Based on the provided SQL query and context, your question is: What is average age for different job title? The answer to your question is: SELECT AVG(age), job FROM Person GROUP BY job. [/s>
SELECT AVG(age), job FROM Person WHERE gender = 'male' GROUP BY job
CREATE TABLE Person (job VARCHAR, age INTEGER, gender VARCHAR)
What is average age of male for different job title?
<s>[INST] Given the following SQL query and context: Query: SELECT AVG(age), job FROM Person WHERE gender = 'male' GROUP BY job Context: CREATE TABLE Person (job VARCHAR, age INTEGER, gender VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is average age of male for different job title? The answer to your question is: SELECT AVG(age), job FROM Person WHERE gender = 'male' GROUP BY job. [/s>
SELECT MIN(age), job FROM Person GROUP BY job
CREATE TABLE Person (job VARCHAR, age INTEGER)
What is minimum age for different job title?
<s>[INST] Given the following SQL query and context: Query: SELECT MIN(age), job FROM Person GROUP BY job Context: CREATE TABLE Person (job VARCHAR, age INTEGER) [/INST] Based on the provided SQL query and context, your question is: What is minimum age for different job title? The answer to your question is: SELECT MIN(age), job FROM Person GROUP BY job. [/s>
SELECT COUNT(*), gender FROM Person WHERE age < 40 GROUP BY gender
CREATE TABLE Person (gender VARCHAR, age INTEGER)
Find the number of people who is under 40 for each gender.
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*), gender FROM Person WHERE age < 40 GROUP BY gender Context: CREATE TABLE Person (gender VARCHAR, age INTEGER) [/INST] Based on the provided SQL query and context, your question is: Find the number of people who is under 40 for each gender. The answer to your question is: SELECT COUNT(*), gender FROM Person WHERE age < 40 GROUP BY gender. [/s>
SELECT name FROM Person WHERE age > (SELECT MIN(age) FROM person WHERE job = 'engineer') ORDER BY age
CREATE TABLE Person (name VARCHAR, age INTEGER, job VARCHAR); CREATE TABLE person (name VARCHAR, age INTEGER, job VARCHAR)
Find the name of people whose age is greater than any engineer sorted by their age.
<s>[INST] Given the following SQL query and context: Query: SELECT name FROM Person WHERE age > (SELECT MIN(age) FROM person WHERE job = 'engineer') ORDER BY age Context: CREATE TABLE Person (name VARCHAR, age INTEGER, job VARCHAR); CREATE TABLE person (name VARCHAR, age INTEGER, job VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the name of people whose age is greater than any engineer sorted by their age. The answer to your question is: SELECT name FROM Person WHERE age > (SELECT MIN(age) FROM person WHERE job = 'engineer') ORDER BY age. [/s>
SELECT COUNT(*) FROM Person WHERE age > (SELECT MAX(age) FROM person WHERE job = 'engineer')
CREATE TABLE Person (age INTEGER, job VARCHAR); CREATE TABLE person (age INTEGER, job VARCHAR)
Find the number of people whose age is greater than all engineers.
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM Person WHERE age > (SELECT MAX(age) FROM person WHERE job = 'engineer') Context: CREATE TABLE Person (age INTEGER, job VARCHAR); CREATE TABLE person (age INTEGER, job VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the number of people whose age is greater than all engineers. The answer to your question is: SELECT COUNT(*) FROM Person WHERE age > (SELECT MAX(age) FROM person WHERE job = 'engineer'). [/s>
SELECT name, job FROM Person ORDER BY name
CREATE TABLE Person (name VARCHAR, job VARCHAR)
list the name, job title of all people ordered by their names.
<s>[INST] Given the following SQL query and context: Query: SELECT name, job FROM Person ORDER BY name Context: CREATE TABLE Person (name VARCHAR, job VARCHAR) [/INST] Based on the provided SQL query and context, your question is: list the name, job title of all people ordered by their names. The answer to your question is: SELECT name, job FROM Person ORDER BY name. [/s>
SELECT name FROM Person ORDER BY age DESC
CREATE TABLE Person (name VARCHAR, age VARCHAR)
Find the names of all person sorted in the descending order using age.
<s>[INST] Given the following SQL query and context: Query: SELECT name FROM Person ORDER BY age DESC Context: CREATE TABLE Person (name VARCHAR, age VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the names of all person sorted in the descending order using age. The answer to your question is: SELECT name FROM Person ORDER BY age DESC. [/s>
SELECT name FROM Person WHERE gender = 'male' ORDER BY age
CREATE TABLE Person (name VARCHAR, gender VARCHAR, age VARCHAR)
Find the name and age of all males in order of their age.
<s>[INST] Given the following SQL query and context: Query: SELECT name FROM Person WHERE gender = 'male' ORDER BY age Context: CREATE TABLE Person (name VARCHAR, gender VARCHAR, age VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the name and age of all males in order of their age. The answer to your question is: SELECT name FROM Person WHERE gender = 'male' ORDER BY age. [/s>
SELECT T1.name, T1.age FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend = 'Dan' INTERSECT SELECT T1.name, T1.age FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend = 'Alice'
CREATE TABLE Person (name VARCHAR, age VARCHAR); CREATE TABLE PersonFriend (name VARCHAR, friend VARCHAR)
Find the name and age of the person who is a friend of both Dan and Alice.
<s>[INST] Given the following SQL query and context: Query: SELECT T1.name, T1.age FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend = 'Dan' INTERSECT SELECT T1.name, T1.age FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend = 'Alice' Context: CREATE TABLE Person (name VARCHAR, age VARCHAR); CREATE TABLE PersonFriend (name VARCHAR, friend VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the name and age of the person who is a friend of both Dan and Alice. The answer to your question is: SELECT T1.name, T1.age FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend = 'Dan' INTERSECT SELECT T1.name, T1.age FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend = 'Alice'. [/s>
SELECT DISTINCT T1.name, T1.age FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend = 'Dan' OR T2.friend = 'Alice'
CREATE TABLE Person (name VARCHAR, age VARCHAR); CREATE TABLE PersonFriend (name VARCHAR, friend VARCHAR)
Find the name and age of the person who is a friend of Dan or Alice.
<s>[INST] Given the following SQL query and context: Query: SELECT DISTINCT T1.name, T1.age FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend = 'Dan' OR T2.friend = 'Alice' Context: CREATE TABLE Person (name VARCHAR, age VARCHAR); CREATE TABLE PersonFriend (name VARCHAR, friend VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the name and age of the person who is a friend of Dan or Alice. The answer to your question is: SELECT DISTINCT T1.name, T1.age FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend = 'Dan' OR T2.friend = 'Alice'. [/s>
SELECT T1.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend IN (SELECT name FROM Person WHERE age > 40) INTERSECT SELECT T1.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend IN (SELECT name FROM Person WHERE age < 30)
CREATE TABLE Person (name VARCHAR, age INTEGER); CREATE TABLE PersonFriend (name VARCHAR, friend VARCHAR); CREATE TABLE Person (name VARCHAR)
Find the name of the person who has friends with age above 40 and under age 30?
<s>[INST] Given the following SQL query and context: Query: SELECT T1.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend IN (SELECT name FROM Person WHERE age > 40) INTERSECT SELECT T1.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend IN (SELECT name FROM Person WHERE age < 30) Context: CREATE TABLE Person (name VARCHAR, age INTEGER); CREATE TABLE PersonFriend (name VARCHAR, friend VARCHAR); CREATE TABLE Person (name VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the name of the person who has friends with age above 40 and under age 30? The answer to your question is: SELECT T1.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend IN (SELECT name FROM Person WHERE age > 40) INTERSECT SELECT T1.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend IN (SELECT name FROM Person WHERE age < 30). [/s>
SELECT T1.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend IN (SELECT name FROM Person WHERE age > 40) EXCEPT SELECT T1.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend IN (SELECT name FROM Person WHERE age < 30)
CREATE TABLE Person (name VARCHAR, age INTEGER); CREATE TABLE PersonFriend (name VARCHAR, friend VARCHAR); CREATE TABLE Person (name VARCHAR)
Find the name of the person who has friends with age above 40 but not under age 30?
<s>[INST] Given the following SQL query and context: Query: SELECT T1.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend IN (SELECT name FROM Person WHERE age > 40) EXCEPT SELECT T1.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend IN (SELECT name FROM Person WHERE age < 30) Context: CREATE TABLE Person (name VARCHAR, age INTEGER); CREATE TABLE PersonFriend (name VARCHAR, friend VARCHAR); CREATE TABLE Person (name VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the name of the person who has friends with age above 40 but not under age 30? The answer to your question is: SELECT T1.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend IN (SELECT name FROM Person WHERE age > 40) EXCEPT SELECT T1.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend IN (SELECT name FROM Person WHERE age < 30). [/s>
SELECT name FROM person EXCEPT SELECT T2.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T1.job = 'student'
CREATE TABLE Person (name VARCHAR, job VARCHAR); CREATE TABLE PersonFriend (name VARCHAR, friend VARCHAR); CREATE TABLE person (name VARCHAR)
Find the name of the person who has no student friends.
<s>[INST] Given the following SQL query and context: Query: SELECT name FROM person EXCEPT SELECT T2.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T1.job = 'student' Context: CREATE TABLE Person (name VARCHAR, job VARCHAR); CREATE TABLE PersonFriend (name VARCHAR, friend VARCHAR); CREATE TABLE person (name VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the name of the person who has no student friends. The answer to your question is: SELECT name FROM person EXCEPT SELECT T2.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T1.job = 'student'. [/s>
SELECT name FROM PersonFriend GROUP BY name HAVING COUNT(*) = 1
CREATE TABLE PersonFriend (name VARCHAR)
Find the person who has exactly one friend.
<s>[INST] Given the following SQL query and context: Query: SELECT name FROM PersonFriend GROUP BY name HAVING COUNT(*) = 1 Context: CREATE TABLE PersonFriend (name VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the person who has exactly one friend. The answer to your question is: SELECT name FROM PersonFriend GROUP BY name HAVING COUNT(*) = 1. [/s>
SELECT T2.friend FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T1.name = 'Bob'
CREATE TABLE PersonFriend (friend VARCHAR, name VARCHAR); CREATE TABLE Person (name VARCHAR)
Who are the friends of Bob?
<s>[INST] Given the following SQL query and context: Query: SELECT T2.friend FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T1.name = 'Bob' Context: CREATE TABLE PersonFriend (friend VARCHAR, name VARCHAR); CREATE TABLE Person (name VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Who are the friends of Bob? The answer to your question is: SELECT T2.friend FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T1.name = 'Bob'. [/s>
SELECT T1.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend = 'Bob'
CREATE TABLE PersonFriend (name VARCHAR, friend VARCHAR); CREATE TABLE Person (name VARCHAR)
Find the name of persons who are friends with Bob.
<s>[INST] Given the following SQL query and context: Query: SELECT T1.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend = 'Bob' Context: CREATE TABLE PersonFriend (name VARCHAR, friend VARCHAR); CREATE TABLE Person (name VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the name of persons who are friends with Bob. The answer to your question is: SELECT T1.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend = 'Bob'. [/s>
SELECT T1.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend = 'Zach' AND T1.gender = 'female'
CREATE TABLE PersonFriend (name VARCHAR, friend VARCHAR); CREATE TABLE Person (name VARCHAR, gender VARCHAR)
Find the names of females who are friends with Zach
<s>[INST] Given the following SQL query and context: Query: SELECT T1.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend = 'Zach' AND T1.gender = 'female' Context: CREATE TABLE PersonFriend (name VARCHAR, friend VARCHAR); CREATE TABLE Person (name VARCHAR, gender VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the names of females who are friends with Zach The answer to your question is: SELECT T1.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend = 'Zach' AND T1.gender = 'female'. [/s>
SELECT T2.friend FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T2.name = 'Alice' AND T1.gender = 'female'
CREATE TABLE PersonFriend (friend VARCHAR, name VARCHAR); CREATE TABLE Person (name VARCHAR, gender VARCHAR)
Find the female friends of Alice.
<s>[INST] Given the following SQL query and context: Query: SELECT T2.friend FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T2.name = 'Alice' AND T1.gender = 'female' Context: CREATE TABLE PersonFriend (friend VARCHAR, name VARCHAR); CREATE TABLE Person (name VARCHAR, gender VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the female friends of Alice. The answer to your question is: SELECT T2.friend FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T2.name = 'Alice' AND T1.gender = 'female'. [/s>
SELECT T2.friend FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T2.name = 'Alice' AND T1.gender = 'male' AND T1.job = 'doctor'
CREATE TABLE PersonFriend (friend VARCHAR, name VARCHAR); CREATE TABLE Person (name VARCHAR, job VARCHAR, gender VARCHAR)
Find the male friend of Alice whose job is a doctor?
<s>[INST] Given the following SQL query and context: Query: SELECT T2.friend FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T2.name = 'Alice' AND T1.gender = 'male' AND T1.job = 'doctor' Context: CREATE TABLE PersonFriend (friend VARCHAR, name VARCHAR); CREATE TABLE Person (name VARCHAR, job VARCHAR, gender VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the male friend of Alice whose job is a doctor? The answer to your question is: SELECT T2.friend FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T2.name = 'Alice' AND T1.gender = 'male' AND T1.job = 'doctor'. [/s>
SELECT T2.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T1.city = 'new york city'
CREATE TABLE Person (name VARCHAR, city VARCHAR); CREATE TABLE PersonFriend (name VARCHAR, friend VARCHAR)
Who has a friend that is from new york city?
<s>[INST] Given the following SQL query and context: Query: SELECT T2.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T1.city = 'new york city' Context: CREATE TABLE Person (name VARCHAR, city VARCHAR); CREATE TABLE PersonFriend (name VARCHAR, friend VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Who has a friend that is from new york city? The answer to your question is: SELECT T2.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T1.city = 'new york city'. [/s>
SELECT DISTINCT T2.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T1.age < (SELECT AVG(age) FROM person)
CREATE TABLE person (age INTEGER); CREATE TABLE Person (name VARCHAR, age INTEGER); CREATE TABLE PersonFriend (name VARCHAR, friend VARCHAR)
Who has friends that are younger than the average age?
<s>[INST] Given the following SQL query and context: Query: SELECT DISTINCT T2.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T1.age < (SELECT AVG(age) FROM person) Context: CREATE TABLE person (age INTEGER); CREATE TABLE Person (name VARCHAR, age INTEGER); CREATE TABLE PersonFriend (name VARCHAR, friend VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Who has friends that are younger than the average age? The answer to your question is: SELECT DISTINCT T2.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T1.age < (SELECT AVG(age) FROM person). [/s>
SELECT DISTINCT T2.name, T2.friend, T1.age FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T1.age > (SELECT AVG(age) FROM person)
CREATE TABLE person (age INTEGER); CREATE TABLE PersonFriend (name VARCHAR, friend VARCHAR); CREATE TABLE Person (age INTEGER, name VARCHAR)
Who has friends that are older than the average age? Print their friends and their ages as well
<s>[INST] Given the following SQL query and context: Query: SELECT DISTINCT T2.name, T2.friend, T1.age FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T1.age > (SELECT AVG(age) FROM person) Context: CREATE TABLE person (age INTEGER); CREATE TABLE PersonFriend (name VARCHAR, friend VARCHAR); CREATE TABLE Person (age INTEGER, name VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Who has friends that are older than the average age? Print their friends and their ages as well The answer to your question is: SELECT DISTINCT T2.name, T2.friend, T1.age FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T1.age > (SELECT AVG(age) FROM person). [/s>
SELECT friend FROM PersonFriend WHERE name = 'Zach' AND YEAR = (SELECT MAX(YEAR) FROM PersonFriend WHERE name = 'Zach')
CREATE TABLE PersonFriend (friend VARCHAR, name VARCHAR, YEAR INTEGER)
Who is the friend of Zach with longest year relationship?
<s>[INST] Given the following SQL query and context: Query: SELECT friend FROM PersonFriend WHERE name = 'Zach' AND YEAR = (SELECT MAX(YEAR) FROM PersonFriend WHERE name = 'Zach') Context: CREATE TABLE PersonFriend (friend VARCHAR, name VARCHAR, YEAR INTEGER) [/INST] Based on the provided SQL query and context, your question is: Who is the friend of Zach with longest year relationship? The answer to your question is: SELECT friend FROM PersonFriend WHERE name = 'Zach' AND YEAR = (SELECT MAX(YEAR) FROM PersonFriend WHERE name = 'Zach'). [/s>
SELECT T1.age FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T2.name = 'Zach' AND T2.year = (SELECT MAX(YEAR) FROM PersonFriend WHERE name = 'Zach')
CREATE TABLE PersonFriend (friend VARCHAR, name VARCHAR, year VARCHAR); CREATE TABLE PersonFriend (YEAR INTEGER, name VARCHAR); CREATE TABLE Person (age VARCHAR, name VARCHAR)
What is the age of the friend of Zach with longest year relationship?
<s>[INST] Given the following SQL query and context: Query: SELECT T1.age FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T2.name = 'Zach' AND T2.year = (SELECT MAX(YEAR) FROM PersonFriend WHERE name = 'Zach') Context: CREATE TABLE PersonFriend (friend VARCHAR, name VARCHAR, year VARCHAR); CREATE TABLE PersonFriend (YEAR INTEGER, name VARCHAR); CREATE TABLE Person (age VARCHAR, name VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is the age of the friend of Zach with longest year relationship? The answer to your question is: SELECT T1.age FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T2.name = 'Zach' AND T2.year = (SELECT MAX(YEAR) FROM PersonFriend WHERE name = 'Zach'). [/s>
SELECT name FROM PersonFriend WHERE friend = 'Alice' AND YEAR = (SELECT MIN(YEAR) FROM PersonFriend WHERE friend = 'Alice')
CREATE TABLE PersonFriend (name VARCHAR, friend VARCHAR, YEAR INTEGER)
Find the name of persons who are friends with Alice for the shortest years.
<s>[INST] Given the following SQL query and context: Query: SELECT name FROM PersonFriend WHERE friend = 'Alice' AND YEAR = (SELECT MIN(YEAR) FROM PersonFriend WHERE friend = 'Alice') Context: CREATE TABLE PersonFriend (name VARCHAR, friend VARCHAR, YEAR INTEGER) [/INST] Based on the provided SQL query and context, your question is: Find the name of persons who are friends with Alice for the shortest years. The answer to your question is: SELECT name FROM PersonFriend WHERE friend = 'Alice' AND YEAR = (SELECT MIN(YEAR) FROM PersonFriend WHERE friend = 'Alice'). [/s>
SELECT T1.name, T1.age, T1.job FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend = 'Alice' AND T2.year = (SELECT MAX(YEAR) FROM PersonFriend WHERE friend = 'Alice')
CREATE TABLE PersonFriend (name VARCHAR, friend VARCHAR, year VARCHAR); CREATE TABLE Person (name VARCHAR, age VARCHAR, job VARCHAR); CREATE TABLE PersonFriend (YEAR INTEGER, friend VARCHAR)
Find the name, age, and job title of persons who are friends with Alice for the longest years.
<s>[INST] Given the following SQL query and context: Query: SELECT T1.name, T1.age, T1.job FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend = 'Alice' AND T2.year = (SELECT MAX(YEAR) FROM PersonFriend WHERE friend = 'Alice') Context: CREATE TABLE PersonFriend (name VARCHAR, friend VARCHAR, year VARCHAR); CREATE TABLE Person (name VARCHAR, age VARCHAR, job VARCHAR); CREATE TABLE PersonFriend (YEAR INTEGER, friend VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the name, age, and job title of persons who are friends with Alice for the longest years. The answer to your question is: SELECT T1.name, T1.age, T1.job FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend = 'Alice' AND T2.year = (SELECT MAX(YEAR) FROM PersonFriend WHERE friend = 'Alice'). [/s>
SELECT name FROM person EXCEPT SELECT name FROM PersonFriend
CREATE TABLE PersonFriend (name VARCHAR); CREATE TABLE person (name VARCHAR)
Who is the person that has no friend?
<s>[INST] Given the following SQL query and context: Query: SELECT name FROM person EXCEPT SELECT name FROM PersonFriend Context: CREATE TABLE PersonFriend (name VARCHAR); CREATE TABLE person (name VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Who is the person that has no friend? The answer to your question is: SELECT name FROM person EXCEPT SELECT name FROM PersonFriend. [/s>
SELECT T2.name, AVG(T1.age) FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend GROUP BY T2.name ORDER BY AVG(T1.age) DESC LIMIT 1
CREATE TABLE PersonFriend (name VARCHAR, friend VARCHAR); CREATE TABLE Person (age INTEGER, name VARCHAR)
Which person whose friends have the oldest average age?
<s>[INST] Given the following SQL query and context: Query: SELECT T2.name, AVG(T1.age) FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend GROUP BY T2.name ORDER BY AVG(T1.age) DESC LIMIT 1 Context: CREATE TABLE PersonFriend (name VARCHAR, friend VARCHAR); CREATE TABLE Person (age INTEGER, name VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Which person whose friends have the oldest average age? The answer to your question is: SELECT T2.name, AVG(T1.age) FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend GROUP BY T2.name ORDER BY AVG(T1.age) DESC LIMIT 1. [/s>
SELECT COUNT(DISTINCT name) FROM PersonFriend WHERE NOT friend IN (SELECT name FROM person WHERE city = 'Austin')
CREATE TABLE person (name VARCHAR, friend VARCHAR, city VARCHAR); CREATE TABLE PersonFriend (name VARCHAR, friend VARCHAR, city VARCHAR)
What is the total number of people who has no friend living in the city of Austin.
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(DISTINCT name) FROM PersonFriend WHERE NOT friend IN (SELECT name FROM person WHERE city = 'Austin') Context: CREATE TABLE person (name VARCHAR, friend VARCHAR, city VARCHAR); CREATE TABLE PersonFriend (name VARCHAR, friend VARCHAR, city VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is the total number of people who has no friend living in the city of Austin. The answer to your question is: SELECT COUNT(DISTINCT name) FROM PersonFriend WHERE NOT friend IN (SELECT name FROM person WHERE city = 'Austin'). [/s>
SELECT DISTINCT T4.name FROM PersonFriend AS T1 JOIN Person AS T2 ON T1.name = T2.name JOIN PersonFriend AS T3 ON T1.friend = T3.name JOIN PersonFriend AS T4 ON T3.friend = T4.name WHERE T2.name = 'Alice' AND T4.name <> 'Alice'
CREATE TABLE PersonFriend (name VARCHAR); CREATE TABLE PersonFriend (name VARCHAR, friend VARCHAR); CREATE TABLE Person (name VARCHAR)
Find Alice's friends of friends.
<s>[INST] Given the following SQL query and context: Query: SELECT DISTINCT T4.name FROM PersonFriend AS T1 JOIN Person AS T2 ON T1.name = T2.name JOIN PersonFriend AS T3 ON T1.friend = T3.name JOIN PersonFriend AS T4 ON T3.friend = T4.name WHERE T2.name = 'Alice' AND T4.name <> 'Alice' Context: CREATE TABLE PersonFriend (name VARCHAR); CREATE TABLE PersonFriend (name VARCHAR, friend VARCHAR); CREATE TABLE Person (name VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find Alice's friends of friends. The answer to your question is: SELECT DISTINCT T4.name FROM PersonFriend AS T1 JOIN Person AS T2 ON T1.name = T2.name JOIN PersonFriend AS T3 ON T1.friend = T3.name JOIN PersonFriend AS T4 ON T3.friend = T4.name WHERE T2.name = 'Alice' AND T4.name <> 'Alice'. [/s>
SELECT COUNT(*) FROM member
CREATE TABLE member (Id VARCHAR)
How many members are there?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM member Context: CREATE TABLE member (Id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many members are there? The answer to your question is: SELECT COUNT(*) FROM member. [/s>
SELECT Name FROM member ORDER BY Name
CREATE TABLE member (Name VARCHAR)
List the names of members in ascending alphabetical order.
<s>[INST] Given the following SQL query and context: Query: SELECT Name FROM member ORDER BY Name Context: CREATE TABLE member (Name VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List the names of members in ascending alphabetical order. The answer to your question is: SELECT Name FROM member ORDER BY Name. [/s>
SELECT Name, Country FROM member
CREATE TABLE member (Name VARCHAR, Country VARCHAR)
What are the names and countries of members?
<s>[INST] Given the following SQL query and context: Query: SELECT Name, Country FROM member Context: CREATE TABLE member (Name VARCHAR, Country VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What are the names and countries of members? The answer to your question is: SELECT Name, Country FROM member. [/s>
SELECT Name FROM member WHERE Country = "United States" OR Country = "Canada"
CREATE TABLE member (Name VARCHAR, Country VARCHAR)
Show the names of members whose country is "United States" or "Canada".
<s>[INST] Given the following SQL query and context: Query: SELECT Name FROM member WHERE Country = "United States" OR Country = "Canada" Context: CREATE TABLE member (Name VARCHAR, Country VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the names of members whose country is "United States" or "Canada". The answer to your question is: SELECT Name FROM member WHERE Country = "United States" OR Country = "Canada". [/s>
SELECT Country, COUNT(*) FROM member GROUP BY Country
CREATE TABLE member (Country VARCHAR)
Show the different countries and the number of members from each.
<s>[INST] Given the following SQL query and context: Query: SELECT Country, COUNT(*) FROM member GROUP BY Country Context: CREATE TABLE member (Country VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the different countries and the number of members from each. The answer to your question is: SELECT Country, COUNT(*) FROM member GROUP BY Country. [/s>
SELECT Country FROM member GROUP BY Country ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE member (Country VARCHAR)
Show the most common country across members.
<s>[INST] Given the following SQL query and context: Query: SELECT Country FROM member GROUP BY Country ORDER BY COUNT(*) DESC LIMIT 1 Context: CREATE TABLE member (Country VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the most common country across members. The answer to your question is: SELECT Country FROM member GROUP BY Country ORDER BY COUNT(*) DESC LIMIT 1. [/s>
SELECT Country FROM member GROUP BY Country HAVING COUNT(*) > 2
CREATE TABLE member (Country VARCHAR)
Which countries have more than two members?
<s>[INST] Given the following SQL query and context: Query: SELECT Country FROM member GROUP BY Country HAVING COUNT(*) > 2 Context: CREATE TABLE member (Country VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Which countries have more than two members? The answer to your question is: SELECT Country FROM member GROUP BY Country HAVING COUNT(*) > 2. [/s>
SELECT Leader_Name, College_Location FROM college
CREATE TABLE college (Leader_Name VARCHAR, College_Location VARCHAR)
Show the leader names and locations of colleges.
<s>[INST] Given the following SQL query and context: Query: SELECT Leader_Name, College_Location FROM college Context: CREATE TABLE college (Leader_Name VARCHAR, College_Location VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the leader names and locations of colleges. The answer to your question is: SELECT Leader_Name, College_Location FROM college. [/s>
SELECT T2.Name, T1.Name FROM college AS T1 JOIN member AS T2 ON T1.College_ID = T2.College_ID
CREATE TABLE member (Name VARCHAR, College_ID VARCHAR); CREATE TABLE college (Name VARCHAR, College_ID VARCHAR)
Show the names of members and names of colleges they go to.
<s>[INST] Given the following SQL query and context: Query: SELECT T2.Name, T1.Name FROM college AS T1 JOIN member AS T2 ON T1.College_ID = T2.College_ID Context: CREATE TABLE member (Name VARCHAR, College_ID VARCHAR); CREATE TABLE college (Name VARCHAR, College_ID VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the names of members and names of colleges they go to. The answer to your question is: SELECT T2.Name, T1.Name FROM college AS T1 JOIN member AS T2 ON T1.College_ID = T2.College_ID. [/s>
SELECT T2.Name, T1.College_Location FROM college AS T1 JOIN member AS T2 ON T1.College_ID = T2.College_ID ORDER BY T2.Name
CREATE TABLE member (Name VARCHAR, College_ID VARCHAR); CREATE TABLE college (College_Location VARCHAR, College_ID VARCHAR)
Show the names of members and the locations of colleges they go to in ascending alphabetical order of member names.
<s>[INST] Given the following SQL query and context: Query: SELECT T2.Name, T1.College_Location FROM college AS T1 JOIN member AS T2 ON T1.College_ID = T2.College_ID ORDER BY T2.Name Context: CREATE TABLE member (Name VARCHAR, College_ID VARCHAR); CREATE TABLE college (College_Location VARCHAR, College_ID VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the names of members and the locations of colleges they go to in ascending alphabetical order of member names. The answer to your question is: SELECT T2.Name, T1.College_Location FROM college AS T1 JOIN member AS T2 ON T1.College_ID = T2.College_ID ORDER BY T2.Name. [/s>
SELECT DISTINCT T1.Leader_Name FROM college AS T1 JOIN member AS T2 ON T1.College_ID = T2.College_ID WHERE T2.Country = "Canada"
CREATE TABLE college (Leader_Name VARCHAR, College_ID VARCHAR); CREATE TABLE member (College_ID VARCHAR, Country VARCHAR)
Show the distinct leader names of colleges associated with members from country "Canada".
<s>[INST] Given the following SQL query and context: Query: SELECT DISTINCT T1.Leader_Name FROM college AS T1 JOIN member AS T2 ON T1.College_ID = T2.College_ID WHERE T2.Country = "Canada" Context: CREATE TABLE college (Leader_Name VARCHAR, College_ID VARCHAR); CREATE TABLE member (College_ID VARCHAR, Country VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the distinct leader names of colleges associated with members from country "Canada". The answer to your question is: SELECT DISTINCT T1.Leader_Name FROM college AS T1 JOIN member AS T2 ON T1.College_ID = T2.College_ID WHERE T2.Country = "Canada". [/s>
SELECT T1.Name, T2.Decoration_Theme FROM member AS T1 JOIN round AS T2 ON T1.Member_ID = T2.Member_ID
CREATE TABLE member (Name VARCHAR, Member_ID VARCHAR); CREATE TABLE round (Decoration_Theme VARCHAR, Member_ID VARCHAR)
Show the names of members and the decoration themes they have.
<s>[INST] Given the following SQL query and context: Query: SELECT T1.Name, T2.Decoration_Theme FROM member AS T1 JOIN round AS T2 ON T1.Member_ID = T2.Member_ID Context: CREATE TABLE member (Name VARCHAR, Member_ID VARCHAR); CREATE TABLE round (Decoration_Theme VARCHAR, Member_ID VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the names of members and the decoration themes they have. The answer to your question is: SELECT T1.Name, T2.Decoration_Theme FROM member AS T1 JOIN round AS T2 ON T1.Member_ID = T2.Member_ID. [/s>
SELECT T1.Name FROM member AS T1 JOIN round AS T2 ON T1.Member_ID = T2.Member_ID WHERE T2.Rank_in_Round > 3
CREATE TABLE round (Member_ID VARCHAR, Rank_in_Round INTEGER); CREATE TABLE member (Name VARCHAR, Member_ID VARCHAR)
Show the names of members that have a rank in round higher than 3.
<s>[INST] Given the following SQL query and context: Query: SELECT T1.Name FROM member AS T1 JOIN round AS T2 ON T1.Member_ID = T2.Member_ID WHERE T2.Rank_in_Round > 3 Context: CREATE TABLE round (Member_ID VARCHAR, Rank_in_Round INTEGER); CREATE TABLE member (Name VARCHAR, Member_ID VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the names of members that have a rank in round higher than 3. The answer to your question is: SELECT T1.Name FROM member AS T1 JOIN round AS T2 ON T1.Member_ID = T2.Member_ID WHERE T2.Rank_in_Round > 3. [/s>
SELECT T1.Name FROM member AS T1 JOIN round AS T2 ON T1.Member_ID = T2.Member_ID ORDER BY Rank_in_Round
CREATE TABLE member (Name VARCHAR, Member_ID VARCHAR); CREATE TABLE round (Member_ID VARCHAR)
Show the names of members in ascending order of their rank in rounds.
<s>[INST] Given the following SQL query and context: Query: SELECT T1.Name FROM member AS T1 JOIN round AS T2 ON T1.Member_ID = T2.Member_ID ORDER BY Rank_in_Round Context: CREATE TABLE member (Name VARCHAR, Member_ID VARCHAR); CREATE TABLE round (Member_ID VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the names of members in ascending order of their rank in rounds. The answer to your question is: SELECT T1.Name FROM member AS T1 JOIN round AS T2 ON T1.Member_ID = T2.Member_ID ORDER BY Rank_in_Round. [/s>
SELECT Name FROM member WHERE NOT Member_ID IN (SELECT Member_ID FROM round)
CREATE TABLE member (Name VARCHAR, Member_ID VARCHAR); CREATE TABLE round (Name VARCHAR, Member_ID VARCHAR)
List the names of members who did not participate in any round.
<s>[INST] Given the following SQL query and context: Query: SELECT Name FROM member WHERE NOT Member_ID IN (SELECT Member_ID FROM round) Context: CREATE TABLE member (Name VARCHAR, Member_ID VARCHAR); CREATE TABLE round (Name VARCHAR, Member_ID VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List the names of members who did not participate in any round. The answer to your question is: SELECT Name FROM member WHERE NOT Member_ID IN (SELECT Member_ID FROM round). [/s>
SELECT document_name, access_count FROM documents ORDER BY document_name
CREATE TABLE documents (document_name VARCHAR, access_count VARCHAR)
Find the name and access counts of all documents, in alphabetic order of the document name.
<s>[INST] Given the following SQL query and context: Query: SELECT document_name, access_count FROM documents ORDER BY document_name Context: CREATE TABLE documents (document_name VARCHAR, access_count VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the name and access counts of all documents, in alphabetic order of the document name. The answer to your question is: SELECT document_name, access_count FROM documents ORDER BY document_name. [/s>
SELECT document_name, access_count FROM documents ORDER BY access_count DESC LIMIT 1
CREATE TABLE documents (document_name VARCHAR, access_count VARCHAR)
Find the name of the document that has been accessed the greatest number of times, as well as the count of how many times it has been accessed?
<s>[INST] Given the following SQL query and context: Query: SELECT document_name, access_count FROM documents ORDER BY access_count DESC LIMIT 1 Context: CREATE TABLE documents (document_name VARCHAR, access_count VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the name of the document that has been accessed the greatest number of times, as well as the count of how many times it has been accessed? The answer to your question is: SELECT document_name, access_count FROM documents ORDER BY access_count DESC LIMIT 1. [/s>
SELECT document_type_code FROM documents GROUP BY document_type_code HAVING COUNT(*) > 4
CREATE TABLE documents (document_type_code VARCHAR)
Find the types of documents with more than 4 documents.
<s>[INST] Given the following SQL query and context: Query: SELECT document_type_code FROM documents GROUP BY document_type_code HAVING COUNT(*) > 4 Context: CREATE TABLE documents (document_type_code VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the types of documents with more than 4 documents. The answer to your question is: SELECT document_type_code FROM documents GROUP BY document_type_code HAVING COUNT(*) > 4. [/s>
SELECT SUM(access_count) FROM documents GROUP BY document_type_code ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE documents (access_count INTEGER, document_type_code VARCHAR)
Find the total access count of all documents in the most popular document type.
<s>[INST] Given the following SQL query and context: Query: SELECT SUM(access_count) FROM documents GROUP BY document_type_code ORDER BY COUNT(*) DESC LIMIT 1 Context: CREATE TABLE documents (access_count INTEGER, document_type_code VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the total access count of all documents in the most popular document type. The answer to your question is: SELECT SUM(access_count) FROM documents GROUP BY document_type_code ORDER BY COUNT(*) DESC LIMIT 1. [/s>
SELECT AVG(access_count) FROM documents
CREATE TABLE documents (access_count INTEGER)
What is the average access count of documents?
<s>[INST] Given the following SQL query and context: Query: SELECT AVG(access_count) FROM documents Context: CREATE TABLE documents (access_count INTEGER) [/INST] Based on the provided SQL query and context, your question is: What is the average access count of documents? The answer to your question is: SELECT AVG(access_count) FROM documents. [/s>
SELECT t2.document_structure_description FROM documents AS t1 JOIN document_structures AS t2 ON t1.document_structure_code = t2.document_structure_code GROUP BY t1.document_structure_code ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE document_structures (document_structure_description VARCHAR, document_structure_code VARCHAR); CREATE TABLE documents (document_structure_code VARCHAR)
What is the structure of the document with the least number of accesses?
<s>[INST] Given the following SQL query and context: Query: SELECT t2.document_structure_description FROM documents AS t1 JOIN document_structures AS t2 ON t1.document_structure_code = t2.document_structure_code GROUP BY t1.document_structure_code ORDER BY COUNT(*) DESC LIMIT 1 Context: CREATE TABLE document_structures (document_structure_description VARCHAR, document_structure_code VARCHAR); CREATE TABLE documents (document_structure_code VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is the structure of the document with the least number of accesses? The answer to your question is: SELECT t2.document_structure_description FROM documents AS t1 JOIN document_structures AS t2 ON t1.document_structure_code = t2.document_structure_code GROUP BY t1.document_structure_code ORDER BY COUNT(*) DESC LIMIT 1. [/s>
SELECT document_type_code FROM documents WHERE document_name = "David CV"
CREATE TABLE documents (document_type_code VARCHAR, document_name VARCHAR)
What is the type of the document named "David CV"?
<s>[INST] Given the following SQL query and context: Query: SELECT document_type_code FROM documents WHERE document_name = "David CV" Context: CREATE TABLE documents (document_type_code VARCHAR, document_name VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is the type of the document named "David CV"? The answer to your question is: SELECT document_type_code FROM documents WHERE document_name = "David CV". [/s>
SELECT document_name FROM documents GROUP BY document_type_code ORDER BY COUNT(*) DESC LIMIT 3 INTERSECT SELECT document_name FROM documents GROUP BY document_structure_code ORDER BY COUNT(*) DESC LIMIT 3
CREATE TABLE documents (document_name VARCHAR, document_type_code VARCHAR, document_structure_code VARCHAR)
Find the list of documents that are both in the most three popular type and have the most three popular structure.
<s>[INST] Given the following SQL query and context: Query: SELECT document_name FROM documents GROUP BY document_type_code ORDER BY COUNT(*) DESC LIMIT 3 INTERSECT SELECT document_name FROM documents GROUP BY document_structure_code ORDER BY COUNT(*) DESC LIMIT 3 Context: CREATE TABLE documents (document_name VARCHAR, document_type_code VARCHAR, document_structure_code VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the list of documents that are both in the most three popular type and have the most three popular structure. The answer to your question is: SELECT document_name FROM documents GROUP BY document_type_code ORDER BY COUNT(*) DESC LIMIT 3 INTERSECT SELECT document_name FROM documents GROUP BY document_structure_code ORDER BY COUNT(*) DESC LIMIT 3. [/s>
SELECT document_type_code FROM documents GROUP BY document_type_code HAVING SUM(access_count) > 10000
CREATE TABLE documents (document_type_code VARCHAR, access_count INTEGER)
What document types do have more than 10000 total access number.
<s>[INST] Given the following SQL query and context: Query: SELECT document_type_code FROM documents GROUP BY document_type_code HAVING SUM(access_count) > 10000 Context: CREATE TABLE documents (document_type_code VARCHAR, access_count INTEGER) [/INST] Based on the provided SQL query and context, your question is: What document types do have more than 10000 total access number. The answer to your question is: SELECT document_type_code FROM documents GROUP BY document_type_code HAVING SUM(access_count) > 10000. [/s>
SELECT t2.section_title FROM documents AS t1 JOIN document_sections AS t2 ON t1.document_code = t2.document_code WHERE t1.document_name = "David CV"
CREATE TABLE documents (document_code VARCHAR, document_name VARCHAR); CREATE TABLE document_sections (section_title VARCHAR, document_code VARCHAR)
What are all the section titles of the document named "David CV"?
<s>[INST] Given the following SQL query and context: Query: SELECT t2.section_title FROM documents AS t1 JOIN document_sections AS t2 ON t1.document_code = t2.document_code WHERE t1.document_name = "David CV" Context: CREATE TABLE documents (document_code VARCHAR, document_name VARCHAR); CREATE TABLE document_sections (section_title VARCHAR, document_code VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What are all the section titles of the document named "David CV"? The answer to your question is: SELECT t2.section_title FROM documents AS t1 JOIN document_sections AS t2 ON t1.document_code = t2.document_code WHERE t1.document_name = "David CV". [/s>