answer
stringlengths 18
557
| context
stringlengths 27
489
| question
stringlengths 12
244
| text
stringlengths 275
1.7k
|
---|---|---|---|
SELECT station_id, LOCATION, manager_name FROM gas_station ORDER BY open_year
|
CREATE TABLE gas_station (station_id VARCHAR, LOCATION VARCHAR, manager_name VARCHAR, open_year VARCHAR)
|
Show gas station id, location, and manager_name for all gas stations ordered by open year.
|
<s>[INST] Given the following SQL query and context: Query: SELECT station_id, LOCATION, manager_name FROM gas_station ORDER BY open_year Context: CREATE TABLE gas_station (station_id VARCHAR, LOCATION VARCHAR, manager_name VARCHAR, open_year VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show gas station id, location, and manager_name for all gas stations ordered by open year. The answer to your question is: SELECT station_id, LOCATION, manager_name FROM gas_station ORDER BY open_year. [/s>
|
SELECT COUNT(*) FROM gas_station WHERE open_year BETWEEN 2000 AND 2005
|
CREATE TABLE gas_station (open_year INTEGER)
|
How many gas station are opened between 2000 and 2005?
|
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM gas_station WHERE open_year BETWEEN 2000 AND 2005 Context: CREATE TABLE gas_station (open_year INTEGER) [/INST] Based on the provided SQL query and context, your question is: How many gas station are opened between 2000 and 2005? The answer to your question is: SELECT COUNT(*) FROM gas_station WHERE open_year BETWEEN 2000 AND 2005. [/s>
|
SELECT LOCATION, COUNT(*) FROM gas_station GROUP BY LOCATION ORDER BY COUNT(*)
|
CREATE TABLE gas_station (LOCATION VARCHAR)
|
Show all locations and the number of gas stations in each location ordered by the count.
|
<s>[INST] Given the following SQL query and context: Query: SELECT LOCATION, COUNT(*) FROM gas_station GROUP BY LOCATION ORDER BY COUNT(*) Context: CREATE TABLE gas_station (LOCATION VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show all locations and the number of gas stations in each location ordered by the count. The answer to your question is: SELECT LOCATION, COUNT(*) FROM gas_station GROUP BY LOCATION ORDER BY COUNT(*). [/s>
|
SELECT headquarters FROM company WHERE main_industry = 'Banking' INTERSECT SELECT headquarters FROM company WHERE main_industry = 'Oil and gas'
|
CREATE TABLE company (headquarters VARCHAR, main_industry VARCHAR)
|
Show all headquarters with both a company in banking industry and a company in Oil and gas.
|
<s>[INST] Given the following SQL query and context: Query: SELECT headquarters FROM company WHERE main_industry = 'Banking' INTERSECT SELECT headquarters FROM company WHERE main_industry = 'Oil and gas' Context: CREATE TABLE company (headquarters VARCHAR, main_industry VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show all headquarters with both a company in banking industry and a company in Oil and gas. The answer to your question is: SELECT headquarters FROM company WHERE main_industry = 'Banking' INTERSECT SELECT headquarters FROM company WHERE main_industry = 'Oil and gas'. [/s>
|
SELECT headquarters FROM company EXCEPT SELECT headquarters FROM company WHERE main_industry = 'Banking'
|
CREATE TABLE company (headquarters VARCHAR, main_industry VARCHAR)
|
Show all headquarters without a company in banking industry.
|
<s>[INST] Given the following SQL query and context: Query: SELECT headquarters FROM company EXCEPT SELECT headquarters FROM company WHERE main_industry = 'Banking' Context: CREATE TABLE company (headquarters VARCHAR, main_industry VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show all headquarters without a company in banking industry. The answer to your question is: SELECT headquarters FROM company EXCEPT SELECT headquarters FROM company WHERE main_industry = 'Banking'. [/s>
|
SELECT T2.company, COUNT(*) FROM station_company AS T1 JOIN company AS T2 ON T1.company_id = T2.company_id GROUP BY T1.company_id
|
CREATE TABLE station_company (company_id VARCHAR); CREATE TABLE company (company VARCHAR, company_id VARCHAR)
|
Show the company name with the number of gas station.
|
<s>[INST] Given the following SQL query and context: Query: SELECT T2.company, COUNT(*) FROM station_company AS T1 JOIN company AS T2 ON T1.company_id = T2.company_id GROUP BY T1.company_id Context: CREATE TABLE station_company (company_id VARCHAR); CREATE TABLE company (company VARCHAR, company_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the company name with the number of gas station. The answer to your question is: SELECT T2.company, COUNT(*) FROM station_company AS T1 JOIN company AS T2 ON T1.company_id = T2.company_id GROUP BY T1.company_id. [/s>
|
SELECT company, main_industry FROM company WHERE NOT company_id IN (SELECT company_id FROM station_company)
|
CREATE TABLE station_company (company VARCHAR, main_industry VARCHAR, company_id VARCHAR); CREATE TABLE company (company VARCHAR, main_industry VARCHAR, company_id VARCHAR)
|
Show company name and main industry without a gas station.
|
<s>[INST] Given the following SQL query and context: Query: SELECT company, main_industry FROM company WHERE NOT company_id IN (SELECT company_id FROM station_company) Context: CREATE TABLE station_company (company VARCHAR, main_industry VARCHAR, company_id VARCHAR); CREATE TABLE company (company VARCHAR, main_industry VARCHAR, company_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show company name and main industry without a gas station. The answer to your question is: SELECT company, main_industry FROM company WHERE NOT company_id IN (SELECT company_id FROM station_company). [/s>
|
SELECT T3.manager_name FROM station_company AS T1 JOIN company AS T2 ON T1.company_id = T2.company_id JOIN gas_station AS T3 ON T1.station_id = T3.station_id WHERE T2.company = 'ExxonMobil'
|
CREATE TABLE gas_station (manager_name VARCHAR, station_id VARCHAR); CREATE TABLE station_company (company_id VARCHAR, station_id VARCHAR); CREATE TABLE company (company_id VARCHAR, company VARCHAR)
|
Show the manager name for gas stations belonging to the ExxonMobil company.
|
<s>[INST] Given the following SQL query and context: Query: SELECT T3.manager_name FROM station_company AS T1 JOIN company AS T2 ON T1.company_id = T2.company_id JOIN gas_station AS T3 ON T1.station_id = T3.station_id WHERE T2.company = 'ExxonMobil' Context: CREATE TABLE gas_station (manager_name VARCHAR, station_id VARCHAR); CREATE TABLE station_company (company_id VARCHAR, station_id VARCHAR); CREATE TABLE company (company_id VARCHAR, company VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the manager name for gas stations belonging to the ExxonMobil company. The answer to your question is: SELECT T3.manager_name FROM station_company AS T1 JOIN company AS T2 ON T1.company_id = T2.company_id JOIN gas_station AS T3 ON T1.station_id = T3.station_id WHERE T2.company = 'ExxonMobil'. [/s>
|
SELECT T3.location FROM station_company AS T1 JOIN company AS T2 ON T1.company_id = T2.company_id JOIN gas_station AS T3 ON T1.station_id = T3.station_id WHERE T2.market_value > 100
|
CREATE TABLE gas_station (location VARCHAR, station_id VARCHAR); CREATE TABLE company (company_id VARCHAR, market_value INTEGER); CREATE TABLE station_company (company_id VARCHAR, station_id VARCHAR)
|
Show all locations where a gas station for company with market value greater than 100 is located.
|
<s>[INST] Given the following SQL query and context: Query: SELECT T3.location FROM station_company AS T1 JOIN company AS T2 ON T1.company_id = T2.company_id JOIN gas_station AS T3 ON T1.station_id = T3.station_id WHERE T2.market_value > 100 Context: CREATE TABLE gas_station (location VARCHAR, station_id VARCHAR); CREATE TABLE company (company_id VARCHAR, market_value INTEGER); CREATE TABLE station_company (company_id VARCHAR, station_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show all locations where a gas station for company with market value greater than 100 is located. The answer to your question is: SELECT T3.location FROM station_company AS T1 JOIN company AS T2 ON T1.company_id = T2.company_id JOIN gas_station AS T3 ON T1.station_id = T3.station_id WHERE T2.market_value > 100. [/s>
|
SELECT manager_name FROM gas_station WHERE open_year > 2000 GROUP BY manager_name ORDER BY COUNT(*) DESC LIMIT 1
|
CREATE TABLE gas_station (manager_name VARCHAR, open_year INTEGER)
|
Show the manager name with most number of gas stations opened after 2000.
|
<s>[INST] Given the following SQL query and context: Query: SELECT manager_name FROM gas_station WHERE open_year > 2000 GROUP BY manager_name ORDER BY COUNT(*) DESC LIMIT 1 Context: CREATE TABLE gas_station (manager_name VARCHAR, open_year INTEGER) [/INST] Based on the provided SQL query and context, your question is: Show the manager name with most number of gas stations opened after 2000. The answer to your question is: SELECT manager_name FROM gas_station WHERE open_year > 2000 GROUP BY manager_name ORDER BY COUNT(*) DESC LIMIT 1. [/s>
|
SELECT LOCATION FROM gas_station ORDER BY open_year
|
CREATE TABLE gas_station (LOCATION VARCHAR, open_year VARCHAR)
|
order all gas station locations by the opening year.
|
<s>[INST] Given the following SQL query and context: Query: SELECT LOCATION FROM gas_station ORDER BY open_year Context: CREATE TABLE gas_station (LOCATION VARCHAR, open_year VARCHAR) [/INST] Based on the provided SQL query and context, your question is: order all gas station locations by the opening year. The answer to your question is: SELECT LOCATION FROM gas_station ORDER BY open_year. [/s>
|
SELECT rank, company, market_value FROM company WHERE main_industry = 'Banking' ORDER BY sales_billion, profits_billion
|
CREATE TABLE company (rank VARCHAR, company VARCHAR, market_value VARCHAR, main_industry VARCHAR, sales_billion VARCHAR, profits_billion VARCHAR)
|
find the rank, company names, market values of the companies in the banking industry order by their sales and profits in billion.
|
<s>[INST] Given the following SQL query and context: Query: SELECT rank, company, market_value FROM company WHERE main_industry = 'Banking' ORDER BY sales_billion, profits_billion Context: CREATE TABLE company (rank VARCHAR, company VARCHAR, market_value VARCHAR, main_industry VARCHAR, sales_billion VARCHAR, profits_billion VARCHAR) [/INST] Based on the provided SQL query and context, your question is: find the rank, company names, market values of the companies in the banking industry order by their sales and profits in billion. The answer to your question is: SELECT rank, company, market_value FROM company WHERE main_industry = 'Banking' ORDER BY sales_billion, profits_billion. [/s>
|
SELECT T3.location, T3.Representative_Name FROM station_company AS T1 JOIN company AS T2 ON T1.company_id = T2.company_id JOIN gas_station AS T3 ON T1.station_id = T3.station_id ORDER BY T2.Assets_billion DESC LIMIT 3
|
CREATE TABLE gas_station (location VARCHAR, Representative_Name VARCHAR, station_id VARCHAR); CREATE TABLE station_company (company_id VARCHAR, station_id VARCHAR); CREATE TABLE company (company_id VARCHAR, Assets_billion VARCHAR)
|
find the location and Representative name of the gas stations owned by the companies with top 3 Asset amounts.
|
<s>[INST] Given the following SQL query and context: Query: SELECT T3.location, T3.Representative_Name FROM station_company AS T1 JOIN company AS T2 ON T1.company_id = T2.company_id JOIN gas_station AS T3 ON T1.station_id = T3.station_id ORDER BY T2.Assets_billion DESC LIMIT 3 Context: CREATE TABLE gas_station (location VARCHAR, Representative_Name VARCHAR, station_id VARCHAR); CREATE TABLE station_company (company_id VARCHAR, station_id VARCHAR); CREATE TABLE company (company_id VARCHAR, Assets_billion VARCHAR) [/INST] Based on the provided SQL query and context, your question is: find the location and Representative name of the gas stations owned by the companies with top 3 Asset amounts. The answer to your question is: SELECT T3.location, T3.Representative_Name FROM station_company AS T1 JOIN company AS T2 ON T1.company_id = T2.company_id JOIN gas_station AS T3 ON T1.station_id = T3.station_id ORDER BY T2.Assets_billion DESC LIMIT 3. [/s>
|
SELECT COUNT(*) FROM region
|
CREATE TABLE region (Id VARCHAR)
|
How many regions do we have?
|
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM region Context: CREATE TABLE region (Id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many regions do we have? The answer to your question is: SELECT COUNT(*) FROM region. [/s>
|
SELECT DISTINCT region_name FROM region ORDER BY Label
|
CREATE TABLE region (region_name VARCHAR, Label VARCHAR)
|
Show all distinct region names ordered by their labels.
|
<s>[INST] Given the following SQL query and context: Query: SELECT DISTINCT region_name FROM region ORDER BY Label Context: CREATE TABLE region (region_name VARCHAR, Label VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show all distinct region names ordered by their labels. The answer to your question is: SELECT DISTINCT region_name FROM region ORDER BY Label. [/s>
|
SELECT COUNT(DISTINCT party_name) FROM party
|
CREATE TABLE party (party_name VARCHAR)
|
How many parties do we have?
|
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(DISTINCT party_name) FROM party Context: CREATE TABLE party (party_name VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many parties do we have? The answer to your question is: SELECT COUNT(DISTINCT party_name) FROM party. [/s>
|
SELECT minister, took_office, left_office FROM party ORDER BY left_office
|
CREATE TABLE party (minister VARCHAR, took_office VARCHAR, left_office VARCHAR)
|
Show the ministers and the time they took and left office, listed by the time they left office.
|
<s>[INST] Given the following SQL query and context: Query: SELECT minister, took_office, left_office FROM party ORDER BY left_office Context: CREATE TABLE party (minister VARCHAR, took_office VARCHAR, left_office VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the ministers and the time they took and left office, listed by the time they left office. The answer to your question is: SELECT minister, took_office, left_office FROM party ORDER BY left_office. [/s>
|
SELECT minister FROM party WHERE took_office > 1961 OR took_office < 1959
|
CREATE TABLE party (minister VARCHAR, took_office VARCHAR)
|
Show the minister who took office after 1961 or before 1959.
|
<s>[INST] Given the following SQL query and context: Query: SELECT minister FROM party WHERE took_office > 1961 OR took_office < 1959 Context: CREATE TABLE party (minister VARCHAR, took_office VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the minister who took office after 1961 or before 1959. The answer to your question is: SELECT minister FROM party WHERE took_office > 1961 OR took_office < 1959. [/s>
|
SELECT minister FROM party WHERE party_name <> 'Progress Party'
|
CREATE TABLE party (minister VARCHAR, party_name VARCHAR)
|
Show all ministers who do not belong to Progress Party.
|
<s>[INST] Given the following SQL query and context: Query: SELECT minister FROM party WHERE party_name <> 'Progress Party' Context: CREATE TABLE party (minister VARCHAR, party_name VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show all ministers who do not belong to Progress Party. The answer to your question is: SELECT minister FROM party WHERE party_name <> 'Progress Party'. [/s>
|
SELECT minister, party_name FROM party ORDER BY took_office DESC
|
CREATE TABLE party (minister VARCHAR, party_name VARCHAR, took_office VARCHAR)
|
Show all ministers and parties they belong to in descending order of the time they took office.
|
<s>[INST] Given the following SQL query and context: Query: SELECT minister, party_name FROM party ORDER BY took_office DESC Context: CREATE TABLE party (minister VARCHAR, party_name VARCHAR, took_office VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show all ministers and parties they belong to in descending order of the time they took office. The answer to your question is: SELECT minister, party_name FROM party ORDER BY took_office DESC. [/s>
|
SELECT minister FROM party ORDER BY left_office DESC LIMIT 1
|
CREATE TABLE party (minister VARCHAR, left_office VARCHAR)
|
Return the minister who left office at the latest time.
|
<s>[INST] Given the following SQL query and context: Query: SELECT minister FROM party ORDER BY left_office DESC LIMIT 1 Context: CREATE TABLE party (minister VARCHAR, left_office VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Return the minister who left office at the latest time. The answer to your question is: SELECT minister FROM party ORDER BY left_office DESC LIMIT 1. [/s>
|
SELECT T1.member_name, T2.party_name FROM Member AS T1 JOIN party AS T2 ON T1.party_id = T2.party_id
|
CREATE TABLE party (party_name VARCHAR, party_id VARCHAR); CREATE TABLE Member (member_name VARCHAR, party_id VARCHAR)
|
List member names and their party names.
|
<s>[INST] Given the following SQL query and context: Query: SELECT T1.member_name, T2.party_name FROM Member AS T1 JOIN party AS T2 ON T1.party_id = T2.party_id Context: CREATE TABLE party (party_name VARCHAR, party_id VARCHAR); CREATE TABLE Member (member_name VARCHAR, party_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List member names and their party names. The answer to your question is: SELECT T1.member_name, T2.party_name FROM Member AS T1 JOIN party AS T2 ON T1.party_id = T2.party_id. [/s>
|
SELECT T2.party_name, COUNT(*) FROM Member AS T1 JOIN party AS T2 ON T1.party_id = T2.party_id GROUP BY T1.party_id
|
CREATE TABLE party (party_name VARCHAR, party_id VARCHAR); CREATE TABLE Member (party_id VARCHAR)
|
Show all party names and the number of members in each party.
|
<s>[INST] Given the following SQL query and context: Query: SELECT T2.party_name, COUNT(*) FROM Member AS T1 JOIN party AS T2 ON T1.party_id = T2.party_id GROUP BY T1.party_id Context: CREATE TABLE party (party_name VARCHAR, party_id VARCHAR); CREATE TABLE Member (party_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show all party names and the number of members in each party. The answer to your question is: SELECT T2.party_name, COUNT(*) FROM Member AS T1 JOIN party AS T2 ON T1.party_id = T2.party_id GROUP BY T1.party_id. [/s>
|
SELECT T2.party_name FROM Member AS T1 JOIN party AS T2 ON T1.party_id = T2.party_id GROUP BY T1.party_id ORDER BY COUNT(*) DESC LIMIT 1
|
CREATE TABLE party (party_name VARCHAR, party_id VARCHAR); CREATE TABLE Member (party_id VARCHAR)
|
What is the name of party with most number of members?
|
<s>[INST] Given the following SQL query and context: Query: SELECT T2.party_name FROM Member AS T1 JOIN party AS T2 ON T1.party_id = T2.party_id GROUP BY T1.party_id ORDER BY COUNT(*) DESC LIMIT 1 Context: CREATE TABLE party (party_name VARCHAR, party_id VARCHAR); CREATE TABLE Member (party_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is the name of party with most number of members? The answer to your question is: SELECT T2.party_name FROM Member AS T1 JOIN party AS T2 ON T1.party_id = T2.party_id GROUP BY T1.party_id ORDER BY COUNT(*) DESC LIMIT 1. [/s>
|
SELECT T1.party_name, T2.region_name FROM party AS T1 JOIN region AS T2 ON T1.region_id = T2.region_id
|
CREATE TABLE region (region_name VARCHAR, region_id VARCHAR); CREATE TABLE party (party_name VARCHAR, region_id VARCHAR)
|
Show all party names and their region names.
|
<s>[INST] Given the following SQL query and context: Query: SELECT T1.party_name, T2.region_name FROM party AS T1 JOIN region AS T2 ON T1.region_id = T2.region_id Context: CREATE TABLE region (region_name VARCHAR, region_id VARCHAR); CREATE TABLE party (party_name VARCHAR, region_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show all party names and their region names. The answer to your question is: SELECT T1.party_name, T2.region_name FROM party AS T1 JOIN region AS T2 ON T1.region_id = T2.region_id. [/s>
|
SELECT party_name FROM party WHERE NOT party_id IN (SELECT party_id FROM Member)
|
CREATE TABLE party (party_name VARCHAR, party_id VARCHAR); CREATE TABLE Member (party_name VARCHAR, party_id VARCHAR)
|
Show names of parties that does not have any members.
|
<s>[INST] Given the following SQL query and context: Query: SELECT party_name FROM party WHERE NOT party_id IN (SELECT party_id FROM Member) Context: CREATE TABLE party (party_name VARCHAR, party_id VARCHAR); CREATE TABLE Member (party_name VARCHAR, party_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show names of parties that does not have any members. The answer to your question is: SELECT party_name FROM party WHERE NOT party_id IN (SELECT party_id FROM Member). [/s>
|
SELECT member_name FROM member WHERE party_id = 3 INTERSECT SELECT member_name FROM member WHERE party_id = 1
|
CREATE TABLE member (member_name VARCHAR, party_id VARCHAR)
|
Show the member names which are in both the party with id 3 and the party with id 1.
|
<s>[INST] Given the following SQL query and context: Query: SELECT member_name FROM member WHERE party_id = 3 INTERSECT SELECT member_name FROM member WHERE party_id = 1 Context: CREATE TABLE member (member_name VARCHAR, party_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the member names which are in both the party with id 3 and the party with id 1. The answer to your question is: SELECT member_name FROM member WHERE party_id = 3 INTERSECT SELECT member_name FROM member WHERE party_id = 1. [/s>
|
SELECT T1.member_name FROM Member AS T1 JOIN party AS T2 ON T1.party_id = T2.party_id WHERE T2.Party_name <> "Progress Party"
|
CREATE TABLE party (party_id VARCHAR, Party_name VARCHAR); CREATE TABLE Member (member_name VARCHAR, party_id VARCHAR)
|
Show member names that are not in the Progress Party.
|
<s>[INST] Given the following SQL query and context: Query: SELECT T1.member_name FROM Member AS T1 JOIN party AS T2 ON T1.party_id = T2.party_id WHERE T2.Party_name <> "Progress Party" Context: CREATE TABLE party (party_id VARCHAR, Party_name VARCHAR); CREATE TABLE Member (member_name VARCHAR, party_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show member names that are not in the Progress Party. The answer to your question is: SELECT T1.member_name FROM Member AS T1 JOIN party AS T2 ON T1.party_id = T2.party_id WHERE T2.Party_name <> "Progress Party". [/s>
|
SELECT COUNT(*) FROM party_events
|
CREATE TABLE party_events (Id VARCHAR)
|
How many party events do we have?
|
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM party_events Context: CREATE TABLE party_events (Id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many party events do we have? The answer to your question is: SELECT COUNT(*) FROM party_events. [/s>
|
SELECT T2.party_name, COUNT(*) FROM party_events AS T1 JOIN party AS T2 ON T1.party_id = T2.party_id GROUP BY T1.party_id
|
CREATE TABLE party (party_name VARCHAR, party_id VARCHAR); CREATE TABLE party_events (party_id VARCHAR)
|
Show party names and the number of events for each party.
|
<s>[INST] Given the following SQL query and context: Query: SELECT T2.party_name, COUNT(*) FROM party_events AS T1 JOIN party AS T2 ON T1.party_id = T2.party_id GROUP BY T1.party_id Context: CREATE TABLE party (party_name VARCHAR, party_id VARCHAR); CREATE TABLE party_events (party_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show party names and the number of events for each party. The answer to your question is: SELECT T2.party_name, COUNT(*) FROM party_events AS T1 JOIN party AS T2 ON T1.party_id = T2.party_id GROUP BY T1.party_id. [/s>
|
SELECT member_name FROM member EXCEPT SELECT T1.member_name FROM member AS T1 JOIN party_events AS T2 ON T1.member_id = T2.member_in_charge_id
|
CREATE TABLE member (member_name VARCHAR); CREATE TABLE party_events (member_in_charge_id VARCHAR); CREATE TABLE member (member_name VARCHAR, member_id VARCHAR)
|
Show all member names who are not in charge of any event.
|
<s>[INST] Given the following SQL query and context: Query: SELECT member_name FROM member EXCEPT SELECT T1.member_name FROM member AS T1 JOIN party_events AS T2 ON T1.member_id = T2.member_in_charge_id Context: CREATE TABLE member (member_name VARCHAR); CREATE TABLE party_events (member_in_charge_id VARCHAR); CREATE TABLE member (member_name VARCHAR, member_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show all member names who are not in charge of any event. The answer to your question is: SELECT member_name FROM member EXCEPT SELECT T1.member_name FROM member AS T1 JOIN party_events AS T2 ON T1.member_id = T2.member_in_charge_id. [/s>
|
SELECT T2.party_name FROM party_events AS T1 JOIN party AS T2 ON T1.party_id = T2.party_id GROUP BY T1.party_id HAVING COUNT(*) >= 2
|
CREATE TABLE party (party_name VARCHAR, party_id VARCHAR); CREATE TABLE party_events (party_id VARCHAR)
|
What are the names of parties with at least 2 events?
|
<s>[INST] Given the following SQL query and context: Query: SELECT T2.party_name FROM party_events AS T1 JOIN party AS T2 ON T1.party_id = T2.party_id GROUP BY T1.party_id HAVING COUNT(*) >= 2 Context: CREATE TABLE party (party_name VARCHAR, party_id VARCHAR); CREATE TABLE party_events (party_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What are the names of parties with at least 2 events? The answer to your question is: SELECT T2.party_name FROM party_events AS T1 JOIN party AS T2 ON T1.party_id = T2.party_id GROUP BY T1.party_id HAVING COUNT(*) >= 2. [/s>
|
SELECT T1.member_name FROM member AS T1 JOIN party_events AS T2 ON T1.member_id = T2.member_in_charge_id GROUP BY T2.member_in_charge_id ORDER BY COUNT(*) DESC LIMIT 1
|
CREATE TABLE party_events (member_in_charge_id VARCHAR); CREATE TABLE member (member_name VARCHAR, member_id VARCHAR)
|
What is the name of member in charge of greatest number of events?
|
<s>[INST] Given the following SQL query and context: Query: SELECT T1.member_name FROM member AS T1 JOIN party_events AS T2 ON T1.member_id = T2.member_in_charge_id GROUP BY T2.member_in_charge_id ORDER BY COUNT(*) DESC LIMIT 1 Context: CREATE TABLE party_events (member_in_charge_id VARCHAR); CREATE TABLE member (member_name VARCHAR, member_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is the name of member in charge of greatest number of events? The answer to your question is: SELECT T1.member_name FROM member AS T1 JOIN party_events AS T2 ON T1.member_id = T2.member_in_charge_id GROUP BY T2.member_in_charge_id ORDER BY COUNT(*) DESC LIMIT 1. [/s>
|
SELECT event_name FROM party_events GROUP BY event_name HAVING COUNT(*) > 2
|
CREATE TABLE party_events (event_name VARCHAR)
|
find the event names that have more than 2 records.
|
<s>[INST] Given the following SQL query and context: Query: SELECT event_name FROM party_events GROUP BY event_name HAVING COUNT(*) > 2 Context: CREATE TABLE party_events (event_name VARCHAR) [/INST] Based on the provided SQL query and context, your question is: find the event names that have more than 2 records. The answer to your question is: SELECT event_name FROM party_events GROUP BY event_name HAVING COUNT(*) > 2. [/s>
|
SELECT COUNT(*) FROM region AS t1 JOIN party AS t2 ON t1.region_id = t2.region_id JOIN party_events AS t3 ON t2.party_id = t3.party_id WHERE t1.region_name = "United Kingdom" AND t3.Event_Name = "Annaual Meeting"
|
CREATE TABLE party_events (party_id VARCHAR, Event_Name VARCHAR); CREATE TABLE region (region_id VARCHAR, region_name VARCHAR); CREATE TABLE party (region_id VARCHAR, party_id VARCHAR)
|
How many Annual Meeting events happened in the United Kingdom region?
|
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM region AS t1 JOIN party AS t2 ON t1.region_id = t2.region_id JOIN party_events AS t3 ON t2.party_id = t3.party_id WHERE t1.region_name = "United Kingdom" AND t3.Event_Name = "Annaual Meeting" Context: CREATE TABLE party_events (party_id VARCHAR, Event_Name VARCHAR); CREATE TABLE region (region_id VARCHAR, region_name VARCHAR); CREATE TABLE party (region_id VARCHAR, party_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many Annual Meeting events happened in the United Kingdom region? The answer to your question is: SELECT COUNT(*) FROM region AS t1 JOIN party AS t2 ON t1.region_id = t2.region_id JOIN party_events AS t3 ON t2.party_id = t3.party_id WHERE t1.region_name = "United Kingdom" AND t3.Event_Name = "Annaual Meeting". [/s>
|
SELECT COUNT(*) FROM pilot
|
CREATE TABLE pilot (Id VARCHAR)
|
How many pilots are there?
|
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM pilot Context: CREATE TABLE pilot (Id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many pilots are there? The answer to your question is: SELECT COUNT(*) FROM pilot. [/s>
|
SELECT Pilot_name FROM pilot ORDER BY Rank
|
CREATE TABLE pilot (Pilot_name VARCHAR, Rank VARCHAR)
|
List the names of pilots in ascending order of rank.
|
<s>[INST] Given the following SQL query and context: Query: SELECT Pilot_name FROM pilot ORDER BY Rank Context: CREATE TABLE pilot (Pilot_name VARCHAR, Rank VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List the names of pilots in ascending order of rank. The answer to your question is: SELECT Pilot_name FROM pilot ORDER BY Rank. [/s>
|
SELECT POSITION, Team FROM pilot
|
CREATE TABLE pilot (POSITION VARCHAR, Team VARCHAR)
|
What are the positions and teams of pilots?
|
<s>[INST] Given the following SQL query and context: Query: SELECT POSITION, Team FROM pilot Context: CREATE TABLE pilot (POSITION VARCHAR, Team VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What are the positions and teams of pilots? The answer to your question is: SELECT POSITION, Team FROM pilot. [/s>
|
SELECT DISTINCT POSITION FROM pilot WHERE Age > 30
|
CREATE TABLE pilot (POSITION VARCHAR, Age INTEGER)
|
List the distinct positions of pilots older than 30.
|
<s>[INST] Given the following SQL query and context: Query: SELECT DISTINCT POSITION FROM pilot WHERE Age > 30 Context: CREATE TABLE pilot (POSITION VARCHAR, Age INTEGER) [/INST] Based on the provided SQL query and context, your question is: List the distinct positions of pilots older than 30. The answer to your question is: SELECT DISTINCT POSITION FROM pilot WHERE Age > 30. [/s>
|
SELECT Pilot_name FROM pilot WHERE Team = "Bradley" OR Team = "Fordham"
|
CREATE TABLE pilot (Pilot_name VARCHAR, Team VARCHAR)
|
Show the names of pilots from team "Bradley" or "Fordham".
|
<s>[INST] Given the following SQL query and context: Query: SELECT Pilot_name FROM pilot WHERE Team = "Bradley" OR Team = "Fordham" Context: CREATE TABLE pilot (Pilot_name VARCHAR, Team VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the names of pilots from team "Bradley" or "Fordham". The answer to your question is: SELECT Pilot_name FROM pilot WHERE Team = "Bradley" OR Team = "Fordham". [/s>
|
SELECT Join_Year FROM pilot ORDER BY Rank LIMIT 1
|
CREATE TABLE pilot (Join_Year VARCHAR, Rank VARCHAR)
|
What is the joined year of the pilot of the highest rank?
|
<s>[INST] Given the following SQL query and context: Query: SELECT Join_Year FROM pilot ORDER BY Rank LIMIT 1 Context: CREATE TABLE pilot (Join_Year VARCHAR, Rank VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is the joined year of the pilot of the highest rank? The answer to your question is: SELECT Join_Year FROM pilot ORDER BY Rank LIMIT 1. [/s>
|
SELECT Nationality, COUNT(*) FROM pilot GROUP BY Nationality
|
CREATE TABLE pilot (Nationality VARCHAR)
|
What are the different nationalities of pilots? Show each nationality and the number of pilots of each nationality.
|
<s>[INST] Given the following SQL query and context: Query: SELECT Nationality, COUNT(*) FROM pilot GROUP BY Nationality Context: CREATE TABLE pilot (Nationality VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What are the different nationalities of pilots? Show each nationality and the number of pilots of each nationality. The answer to your question is: SELECT Nationality, COUNT(*) FROM pilot GROUP BY Nationality. [/s>
|
SELECT Nationality FROM pilot GROUP BY Nationality ORDER BY COUNT(*) DESC LIMIT 1
|
CREATE TABLE pilot (Nationality VARCHAR)
|
Show the most common nationality of pilots.
|
<s>[INST] Given the following SQL query and context: Query: SELECT Nationality FROM pilot GROUP BY Nationality ORDER BY COUNT(*) DESC LIMIT 1 Context: CREATE TABLE pilot (Nationality VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the most common nationality of pilots. The answer to your question is: SELECT Nationality FROM pilot GROUP BY Nationality ORDER BY COUNT(*) DESC LIMIT 1. [/s>
|
SELECT POSITION FROM pilot WHERE Join_Year < 2000 INTERSECT SELECT POSITION FROM pilot WHERE Join_Year > 2005
|
CREATE TABLE pilot (POSITION VARCHAR, Join_Year INTEGER)
|
Show the pilot positions that have both pilots joining after year 2005 and pilots joining before 2000.
|
<s>[INST] Given the following SQL query and context: Query: SELECT POSITION FROM pilot WHERE Join_Year < 2000 INTERSECT SELECT POSITION FROM pilot WHERE Join_Year > 2005 Context: CREATE TABLE pilot (POSITION VARCHAR, Join_Year INTEGER) [/INST] Based on the provided SQL query and context, your question is: Show the pilot positions that have both pilots joining after year 2005 and pilots joining before 2000. The answer to your question is: SELECT POSITION FROM pilot WHERE Join_Year < 2000 INTERSECT SELECT POSITION FROM pilot WHERE Join_Year > 2005. [/s>
|
SELECT T3.Pilot_name, T2.Model FROM pilot_record AS T1 JOIN aircraft AS T2 ON T1.Aircraft_ID = T2.Aircraft_ID JOIN pilot AS T3 ON T1.Pilot_ID = T3.Pilot_ID
|
CREATE TABLE pilot_record (Aircraft_ID VARCHAR, Pilot_ID VARCHAR); CREATE TABLE pilot (Pilot_name VARCHAR, Pilot_ID VARCHAR); CREATE TABLE aircraft (Model VARCHAR, Aircraft_ID VARCHAR)
|
Show the names of pilots and models of aircrafts they have flied with.
|
<s>[INST] Given the following SQL query and context: Query: SELECT T3.Pilot_name, T2.Model FROM pilot_record AS T1 JOIN aircraft AS T2 ON T1.Aircraft_ID = T2.Aircraft_ID JOIN pilot AS T3 ON T1.Pilot_ID = T3.Pilot_ID Context: CREATE TABLE pilot_record (Aircraft_ID VARCHAR, Pilot_ID VARCHAR); CREATE TABLE pilot (Pilot_name VARCHAR, Pilot_ID VARCHAR); CREATE TABLE aircraft (Model VARCHAR, Aircraft_ID VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the names of pilots and models of aircrafts they have flied with. The answer to your question is: SELECT T3.Pilot_name, T2.Model FROM pilot_record AS T1 JOIN aircraft AS T2 ON T1.Aircraft_ID = T2.Aircraft_ID JOIN pilot AS T3 ON T1.Pilot_ID = T3.Pilot_ID. [/s>
|
SELECT T3.Pilot_name, T2.Fleet_Series FROM pilot_record AS T1 JOIN aircraft AS T2 ON T1.Aircraft_ID = T2.Aircraft_ID JOIN pilot AS T3 ON T1.Pilot_ID = T3.Pilot_ID ORDER BY T3.Rank
|
CREATE TABLE pilot (Pilot_name VARCHAR, Pilot_ID VARCHAR, Rank VARCHAR); CREATE TABLE pilot_record (Aircraft_ID VARCHAR, Pilot_ID VARCHAR); CREATE TABLE aircraft (Fleet_Series VARCHAR, Aircraft_ID VARCHAR)
|
Show the names of pilots and fleet series of the aircrafts they have flied with in ascending order of the rank of the pilot.
|
<s>[INST] Given the following SQL query and context: Query: SELECT T3.Pilot_name, T2.Fleet_Series FROM pilot_record AS T1 JOIN aircraft AS T2 ON T1.Aircraft_ID = T2.Aircraft_ID JOIN pilot AS T3 ON T1.Pilot_ID = T3.Pilot_ID ORDER BY T3.Rank Context: CREATE TABLE pilot (Pilot_name VARCHAR, Pilot_ID VARCHAR, Rank VARCHAR); CREATE TABLE pilot_record (Aircraft_ID VARCHAR, Pilot_ID VARCHAR); CREATE TABLE aircraft (Fleet_Series VARCHAR, Aircraft_ID VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the names of pilots and fleet series of the aircrafts they have flied with in ascending order of the rank of the pilot. The answer to your question is: SELECT T3.Pilot_name, T2.Fleet_Series FROM pilot_record AS T1 JOIN aircraft AS T2 ON T1.Aircraft_ID = T2.Aircraft_ID JOIN pilot AS T3 ON T1.Pilot_ID = T3.Pilot_ID ORDER BY T3.Rank. [/s>
|
SELECT T2.Fleet_Series FROM pilot_record AS T1 JOIN aircraft AS T2 ON T1.Aircraft_ID = T2.Aircraft_ID JOIN pilot AS T3 ON T1.Pilot_ID = T3.Pilot_ID WHERE T3.Age < 34
|
CREATE TABLE pilot_record (Aircraft_ID VARCHAR, Pilot_ID VARCHAR); CREATE TABLE pilot (Pilot_ID VARCHAR, Age INTEGER); CREATE TABLE aircraft (Fleet_Series VARCHAR, Aircraft_ID VARCHAR)
|
Show the fleet series of the aircrafts flied by pilots younger than 34
|
<s>[INST] Given the following SQL query and context: Query: SELECT T2.Fleet_Series FROM pilot_record AS T1 JOIN aircraft AS T2 ON T1.Aircraft_ID = T2.Aircraft_ID JOIN pilot AS T3 ON T1.Pilot_ID = T3.Pilot_ID WHERE T3.Age < 34 Context: CREATE TABLE pilot_record (Aircraft_ID VARCHAR, Pilot_ID VARCHAR); CREATE TABLE pilot (Pilot_ID VARCHAR, Age INTEGER); CREATE TABLE aircraft (Fleet_Series VARCHAR, Aircraft_ID VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the fleet series of the aircrafts flied by pilots younger than 34 The answer to your question is: SELECT T2.Fleet_Series FROM pilot_record AS T1 JOIN aircraft AS T2 ON T1.Aircraft_ID = T2.Aircraft_ID JOIN pilot AS T3 ON T1.Pilot_ID = T3.Pilot_ID WHERE T3.Age < 34. [/s>
|
SELECT T2.Pilot_name, COUNT(*) FROM pilot_record AS T1 JOIN pilot AS T2 ON T1.pilot_ID = T2.pilot_ID GROUP BY T2.Pilot_name
|
CREATE TABLE pilot (Pilot_name VARCHAR, pilot_ID VARCHAR); CREATE TABLE pilot_record (pilot_ID VARCHAR)
|
Show the names of pilots and the number of records they have.
|
<s>[INST] Given the following SQL query and context: Query: SELECT T2.Pilot_name, COUNT(*) FROM pilot_record AS T1 JOIN pilot AS T2 ON T1.pilot_ID = T2.pilot_ID GROUP BY T2.Pilot_name Context: CREATE TABLE pilot (Pilot_name VARCHAR, pilot_ID VARCHAR); CREATE TABLE pilot_record (pilot_ID VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show the names of pilots and the number of records they have. The answer to your question is: SELECT T2.Pilot_name, COUNT(*) FROM pilot_record AS T1 JOIN pilot AS T2 ON T1.pilot_ID = T2.pilot_ID GROUP BY T2.Pilot_name. [/s>
|
SELECT T2.Pilot_name, COUNT(*) FROM pilot_record AS T1 JOIN pilot AS T2 ON T1.pilot_ID = T2.pilot_ID GROUP BY T2.Pilot_name HAVING COUNT(*) > 1
|
CREATE TABLE pilot (Pilot_name VARCHAR, pilot_ID VARCHAR); CREATE TABLE pilot_record (pilot_ID VARCHAR)
|
Show names of pilots that have more than one record.
|
<s>[INST] Given the following SQL query and context: Query: SELECT T2.Pilot_name, COUNT(*) FROM pilot_record AS T1 JOIN pilot AS T2 ON T1.pilot_ID = T2.pilot_ID GROUP BY T2.Pilot_name HAVING COUNT(*) > 1 Context: CREATE TABLE pilot (Pilot_name VARCHAR, pilot_ID VARCHAR); CREATE TABLE pilot_record (pilot_ID VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Show names of pilots that have more than one record. The answer to your question is: SELECT T2.Pilot_name, COUNT(*) FROM pilot_record AS T1 JOIN pilot AS T2 ON T1.pilot_ID = T2.pilot_ID GROUP BY T2.Pilot_name HAVING COUNT(*) > 1. [/s>
|
SELECT Pilot_name FROM pilot WHERE NOT Pilot_ID IN (SELECT Pilot_ID FROM pilot_record)
|
CREATE TABLE pilot_record (Pilot_name VARCHAR, Pilot_ID VARCHAR); CREATE TABLE pilot (Pilot_name VARCHAR, Pilot_ID VARCHAR)
|
List the names of pilots that do not have any record.
|
<s>[INST] Given the following SQL query and context: Query: SELECT Pilot_name FROM pilot WHERE NOT Pilot_ID IN (SELECT Pilot_ID FROM pilot_record) Context: CREATE TABLE pilot_record (Pilot_name VARCHAR, Pilot_ID VARCHAR); CREATE TABLE pilot (Pilot_name VARCHAR, Pilot_ID VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List the names of pilots that do not have any record. The answer to your question is: SELECT Pilot_name FROM pilot WHERE NOT Pilot_ID IN (SELECT Pilot_ID FROM pilot_record). [/s>
|
SELECT document_status_code FROM Ref_Document_Status
|
CREATE TABLE Ref_Document_Status (document_status_code VARCHAR)
|
What document status codes do we have?
|
<s>[INST] Given the following SQL query and context: Query: SELECT document_status_code FROM Ref_Document_Status Context: CREATE TABLE Ref_Document_Status (document_status_code VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What document status codes do we have? The answer to your question is: SELECT document_status_code FROM Ref_Document_Status. [/s>
|
SELECT document_status_description FROM Ref_Document_Status WHERE document_status_code = "working"
|
CREATE TABLE Ref_Document_Status (document_status_description VARCHAR, document_status_code VARCHAR)
|
What is the description of document status code 'working'?
|
<s>[INST] Given the following SQL query and context: Query: SELECT document_status_description FROM Ref_Document_Status WHERE document_status_code = "working" Context: CREATE TABLE Ref_Document_Status (document_status_description VARCHAR, document_status_code VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is the description of document status code 'working'? The answer to your question is: SELECT document_status_description FROM Ref_Document_Status WHERE document_status_code = "working". [/s>
|
SELECT document_type_code FROM Ref_Document_Types
|
CREATE TABLE Ref_Document_Types (document_type_code VARCHAR)
|
What document type codes do we have?
|
<s>[INST] Given the following SQL query and context: Query: SELECT document_type_code FROM Ref_Document_Types Context: CREATE TABLE Ref_Document_Types (document_type_code VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What document type codes do we have? The answer to your question is: SELECT document_type_code FROM Ref_Document_Types. [/s>
|
SELECT document_type_description FROM Ref_Document_Types WHERE document_type_code = "Paper"
|
CREATE TABLE Ref_Document_Types (document_type_description VARCHAR, document_type_code VARCHAR)
|
What is the description of document type 'Paper'?
|
<s>[INST] Given the following SQL query and context: Query: SELECT document_type_description FROM Ref_Document_Types WHERE document_type_code = "Paper" Context: CREATE TABLE Ref_Document_Types (document_type_description VARCHAR, document_type_code VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is the description of document type 'Paper'? The answer to your question is: SELECT document_type_description FROM Ref_Document_Types WHERE document_type_code = "Paper". [/s>
|
SELECT shipping_agent_name FROM Ref_Shipping_Agents
|
CREATE TABLE Ref_Shipping_Agents (shipping_agent_name VARCHAR)
|
What are the shipping agent names?
|
<s>[INST] Given the following SQL query and context: Query: SELECT shipping_agent_name FROM Ref_Shipping_Agents Context: CREATE TABLE Ref_Shipping_Agents (shipping_agent_name VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What are the shipping agent names? The answer to your question is: SELECT shipping_agent_name FROM Ref_Shipping_Agents. [/s>
|
SELECT shipping_agent_code FROM Ref_Shipping_Agents WHERE shipping_agent_name = "UPS"
|
CREATE TABLE Ref_Shipping_Agents (shipping_agent_code VARCHAR, shipping_agent_name VARCHAR)
|
What is the shipping agent code of shipping agent UPS?
|
<s>[INST] Given the following SQL query and context: Query: SELECT shipping_agent_code FROM Ref_Shipping_Agents WHERE shipping_agent_name = "UPS" Context: CREATE TABLE Ref_Shipping_Agents (shipping_agent_code VARCHAR, shipping_agent_name VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is the shipping agent code of shipping agent UPS? The answer to your question is: SELECT shipping_agent_code FROM Ref_Shipping_Agents WHERE shipping_agent_name = "UPS". [/s>
|
SELECT role_code FROM ROLES
|
CREATE TABLE ROLES (role_code VARCHAR)
|
What are all role codes?
|
<s>[INST] Given the following SQL query and context: Query: SELECT role_code FROM ROLES Context: CREATE TABLE ROLES (role_code VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What are all role codes? The answer to your question is: SELECT role_code FROM ROLES. [/s>
|
SELECT role_description FROM ROLES WHERE role_code = "ED"
|
CREATE TABLE ROLES (role_description VARCHAR, role_code VARCHAR)
|
What is the description of role code ED?
|
<s>[INST] Given the following SQL query and context: Query: SELECT role_description FROM ROLES WHERE role_code = "ED" Context: CREATE TABLE ROLES (role_description VARCHAR, role_code VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is the description of role code ED? The answer to your question is: SELECT role_description FROM ROLES WHERE role_code = "ED". [/s>
|
SELECT COUNT(*) FROM Employees
|
CREATE TABLE Employees (Id VARCHAR)
|
How many employees do we have?
|
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM Employees Context: CREATE TABLE Employees (Id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many employees do we have? The answer to your question is: SELECT COUNT(*) FROM Employees. [/s>
|
SELECT T1.role_description FROM ROLES AS T1 JOIN Employees AS T2 ON T1.role_code = T2.role_code WHERE T2.employee_name = "Koby"
|
CREATE TABLE ROLES (role_description VARCHAR, role_code VARCHAR); CREATE TABLE Employees (role_code VARCHAR, employee_name VARCHAR)
|
What is the role of the employee named Koby?
|
<s>[INST] Given the following SQL query and context: Query: SELECT T1.role_description FROM ROLES AS T1 JOIN Employees AS T2 ON T1.role_code = T2.role_code WHERE T2.employee_name = "Koby" Context: CREATE TABLE ROLES (role_description VARCHAR, role_code VARCHAR); CREATE TABLE Employees (role_code VARCHAR, employee_name VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is the role of the employee named Koby? The answer to your question is: SELECT T1.role_description FROM ROLES AS T1 JOIN Employees AS T2 ON T1.role_code = T2.role_code WHERE T2.employee_name = "Koby". [/s>
|
SELECT document_id, receipt_date FROM Documents
|
CREATE TABLE Documents (document_id VARCHAR, receipt_date VARCHAR)
|
List all document ids and receipt dates of documents.
|
<s>[INST] Given the following SQL query and context: Query: SELECT document_id, receipt_date FROM Documents Context: CREATE TABLE Documents (document_id VARCHAR, receipt_date VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List all document ids and receipt dates of documents. The answer to your question is: SELECT document_id, receipt_date FROM Documents. [/s>
|
SELECT T1.role_description, T2.role_code, COUNT(*) FROM ROLES AS T1 JOIN Employees AS T2 ON T1.role_code = T2.role_code GROUP BY T2.role_code
|
CREATE TABLE ROLES (role_description VARCHAR, role_code VARCHAR); CREATE TABLE Employees (role_code VARCHAR)
|
How many employees does each role have? List role description, id and number of employees.
|
<s>[INST] Given the following SQL query and context: Query: SELECT T1.role_description, T2.role_code, COUNT(*) FROM ROLES AS T1 JOIN Employees AS T2 ON T1.role_code = T2.role_code GROUP BY T2.role_code Context: CREATE TABLE ROLES (role_description VARCHAR, role_code VARCHAR); CREATE TABLE Employees (role_code VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many employees does each role have? List role description, id and number of employees. The answer to your question is: SELECT T1.role_description, T2.role_code, COUNT(*) FROM ROLES AS T1 JOIN Employees AS T2 ON T1.role_code = T2.role_code GROUP BY T2.role_code. [/s>
|
SELECT Roles.role_description, COUNT(Employees.employee_id) FROM ROLES JOIN Employees ON Employees.role_code = Roles.role_code GROUP BY Employees.role_code HAVING COUNT(Employees.employee_id) > 1
|
CREATE TABLE ROLES (Id VARCHAR); CREATE TABLE Employees (Id VARCHAR)
|
List roles that have more than one employee. List the role description and number of employees.
|
<s>[INST] Given the following SQL query and context: Query: SELECT Roles.role_description, COUNT(Employees.employee_id) FROM ROLES JOIN Employees ON Employees.role_code = Roles.role_code GROUP BY Employees.role_code HAVING COUNT(Employees.employee_id) > 1 Context: CREATE TABLE ROLES (Id VARCHAR); CREATE TABLE Employees (Id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List roles that have more than one employee. List the role description and number of employees. The answer to your question is: SELECT Roles.role_description, COUNT(Employees.employee_id) FROM ROLES JOIN Employees ON Employees.role_code = Roles.role_code GROUP BY Employees.role_code HAVING COUNT(Employees.employee_id) > 1. [/s>
|
SELECT Ref_Document_Status.document_status_description FROM Ref_Document_Status JOIN Documents ON Documents.document_status_code = Ref_Document_Status.document_status_code WHERE Documents.document_id = 1
|
CREATE TABLE Documents (Id VARCHAR); CREATE TABLE Ref_Document_Status (Id VARCHAR)
|
What is the document status description of the document with id 1?
|
<s>[INST] Given the following SQL query and context: Query: SELECT Ref_Document_Status.document_status_description FROM Ref_Document_Status JOIN Documents ON Documents.document_status_code = Ref_Document_Status.document_status_code WHERE Documents.document_id = 1 Context: CREATE TABLE Documents (Id VARCHAR); CREATE TABLE Ref_Document_Status (Id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is the document status description of the document with id 1? The answer to your question is: SELECT Ref_Document_Status.document_status_description FROM Ref_Document_Status JOIN Documents ON Documents.document_status_code = Ref_Document_Status.document_status_code WHERE Documents.document_id = 1. [/s>
|
SELECT COUNT(*) FROM Documents WHERE document_status_code = "done"
|
CREATE TABLE Documents (document_status_code VARCHAR)
|
How many documents have the status code done?
|
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM Documents WHERE document_status_code = "done" Context: CREATE TABLE Documents (document_status_code VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many documents have the status code done? The answer to your question is: SELECT COUNT(*) FROM Documents WHERE document_status_code = "done". [/s>
|
SELECT document_type_code FROM Documents WHERE document_id = 2
|
CREATE TABLE Documents (document_type_code VARCHAR, document_id VARCHAR)
|
List the document type code for the document with the id 2.
|
<s>[INST] Given the following SQL query and context: Query: SELECT document_type_code FROM Documents WHERE document_id = 2 Context: CREATE TABLE Documents (document_type_code VARCHAR, document_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List the document type code for the document with the id 2. The answer to your question is: SELECT document_type_code FROM Documents WHERE document_id = 2. [/s>
|
SELECT document_id FROM Documents WHERE document_status_code = "done" AND document_type_code = "Paper"
|
CREATE TABLE Documents (document_id VARCHAR, document_status_code VARCHAR, document_type_code VARCHAR)
|
List the document ids for any documents with the status code done and the type code paper.
|
<s>[INST] Given the following SQL query and context: Query: SELECT document_id FROM Documents WHERE document_status_code = "done" AND document_type_code = "Paper" Context: CREATE TABLE Documents (document_id VARCHAR, document_status_code VARCHAR, document_type_code VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List the document ids for any documents with the status code done and the type code paper. The answer to your question is: SELECT document_id FROM Documents WHERE document_status_code = "done" AND document_type_code = "Paper". [/s>
|
SELECT Ref_Shipping_Agents.shipping_agent_name FROM Ref_Shipping_Agents JOIN Documents ON Documents.shipping_agent_code = Ref_Shipping_Agents.shipping_agent_code WHERE Documents.document_id = 2
|
CREATE TABLE Documents (Id VARCHAR); CREATE TABLE Ref_Shipping_Agents (Id VARCHAR)
|
What is the name of the shipping agent of the document with id 2?
|
<s>[INST] Given the following SQL query and context: Query: SELECT Ref_Shipping_Agents.shipping_agent_name FROM Ref_Shipping_Agents JOIN Documents ON Documents.shipping_agent_code = Ref_Shipping_Agents.shipping_agent_code WHERE Documents.document_id = 2 Context: CREATE TABLE Documents (Id VARCHAR); CREATE TABLE Ref_Shipping_Agents (Id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is the name of the shipping agent of the document with id 2? The answer to your question is: SELECT Ref_Shipping_Agents.shipping_agent_name FROM Ref_Shipping_Agents JOIN Documents ON Documents.shipping_agent_code = Ref_Shipping_Agents.shipping_agent_code WHERE Documents.document_id = 2. [/s>
|
SELECT COUNT(*) FROM Ref_Shipping_Agents JOIN Documents ON Documents.shipping_agent_code = Ref_Shipping_Agents.shipping_agent_code WHERE Ref_Shipping_Agents.shipping_agent_name = "USPS"
|
CREATE TABLE Documents (Id VARCHAR); CREATE TABLE Ref_Shipping_Agents (Id VARCHAR)
|
How many documents were shipped by USPS?
|
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM Ref_Shipping_Agents JOIN Documents ON Documents.shipping_agent_code = Ref_Shipping_Agents.shipping_agent_code WHERE Ref_Shipping_Agents.shipping_agent_name = "USPS" Context: CREATE TABLE Documents (Id VARCHAR); CREATE TABLE Ref_Shipping_Agents (Id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many documents were shipped by USPS? The answer to your question is: SELECT COUNT(*) FROM Ref_Shipping_Agents JOIN Documents ON Documents.shipping_agent_code = Ref_Shipping_Agents.shipping_agent_code WHERE Ref_Shipping_Agents.shipping_agent_name = "USPS". [/s>
|
SELECT Ref_Shipping_Agents.shipping_agent_name, COUNT(Documents.document_id) FROM Ref_Shipping_Agents JOIN Documents ON Documents.shipping_agent_code = Ref_Shipping_Agents.shipping_agent_code GROUP BY Ref_Shipping_Agents.shipping_agent_code ORDER BY COUNT(Documents.document_id) DESC LIMIT 1
|
CREATE TABLE Documents (Id VARCHAR); CREATE TABLE Ref_Shipping_Agents (Id VARCHAR)
|
Which shipping agent shipped the most documents? List the shipping agent name and the number of documents.
|
<s>[INST] Given the following SQL query and context: Query: SELECT Ref_Shipping_Agents.shipping_agent_name, COUNT(Documents.document_id) FROM Ref_Shipping_Agents JOIN Documents ON Documents.shipping_agent_code = Ref_Shipping_Agents.shipping_agent_code GROUP BY Ref_Shipping_Agents.shipping_agent_code ORDER BY COUNT(Documents.document_id) DESC LIMIT 1 Context: CREATE TABLE Documents (Id VARCHAR); CREATE TABLE Ref_Shipping_Agents (Id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Which shipping agent shipped the most documents? List the shipping agent name and the number of documents. The answer to your question is: SELECT Ref_Shipping_Agents.shipping_agent_name, COUNT(Documents.document_id) FROM Ref_Shipping_Agents JOIN Documents ON Documents.shipping_agent_code = Ref_Shipping_Agents.shipping_agent_code GROUP BY Ref_Shipping_Agents.shipping_agent_code ORDER BY COUNT(Documents.document_id) DESC LIMIT 1. [/s>
|
SELECT receipt_date FROM Documents WHERE document_id = 3
|
CREATE TABLE Documents (receipt_date VARCHAR, document_id VARCHAR)
|
What is the receipt date of the document with id 3?
|
<s>[INST] Given the following SQL query and context: Query: SELECT receipt_date FROM Documents WHERE document_id = 3 Context: CREATE TABLE Documents (receipt_date VARCHAR, document_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is the receipt date of the document with id 3? The answer to your question is: SELECT receipt_date FROM Documents WHERE document_id = 3. [/s>
|
SELECT Addresses.address_details FROM Addresses JOIN Documents_Mailed ON Documents_Mailed.mailed_to_address_id = Addresses.address_id WHERE document_id = 4
|
CREATE TABLE Addresses (document_id VARCHAR); CREATE TABLE Documents_Mailed (document_id VARCHAR)
|
What address was the document with id 4 mailed to?
|
<s>[INST] Given the following SQL query and context: Query: SELECT Addresses.address_details FROM Addresses JOIN Documents_Mailed ON Documents_Mailed.mailed_to_address_id = Addresses.address_id WHERE document_id = 4 Context: CREATE TABLE Addresses (document_id VARCHAR); CREATE TABLE Documents_Mailed (document_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What address was the document with id 4 mailed to? The answer to your question is: SELECT Addresses.address_details FROM Addresses JOIN Documents_Mailed ON Documents_Mailed.mailed_to_address_id = Addresses.address_id WHERE document_id = 4. [/s>
|
SELECT mailing_date FROM Documents_Mailed WHERE document_id = 7
|
CREATE TABLE Documents_Mailed (mailing_date VARCHAR, document_id VARCHAR)
|
What is the mail date of the document with id 7?
|
<s>[INST] Given the following SQL query and context: Query: SELECT mailing_date FROM Documents_Mailed WHERE document_id = 7 Context: CREATE TABLE Documents_Mailed (mailing_date VARCHAR, document_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is the mail date of the document with id 7? The answer to your question is: SELECT mailing_date FROM Documents_Mailed WHERE document_id = 7. [/s>
|
SELECT document_id FROM Documents WHERE document_status_code = "done" AND document_type_code = "Paper" EXCEPT SELECT document_id FROM Documents JOIN Ref_Shipping_Agents ON Documents.shipping_agent_code = Ref_Shipping_Agents.shipping_agent_code WHERE Ref_Shipping_Agents.shipping_agent_name = "USPS"
|
CREATE TABLE Ref_Shipping_Agents (document_id VARCHAR, document_status_code VARCHAR, document_type_code VARCHAR); CREATE TABLE Documents (document_id VARCHAR, document_status_code VARCHAR, document_type_code VARCHAR)
|
List the document ids of documents with the status done and type Paper, which not shipped by the shipping agent named USPS.
|
<s>[INST] Given the following SQL query and context: Query: SELECT document_id FROM Documents WHERE document_status_code = "done" AND document_type_code = "Paper" EXCEPT SELECT document_id FROM Documents JOIN Ref_Shipping_Agents ON Documents.shipping_agent_code = Ref_Shipping_Agents.shipping_agent_code WHERE Ref_Shipping_Agents.shipping_agent_name = "USPS" Context: CREATE TABLE Ref_Shipping_Agents (document_id VARCHAR, document_status_code VARCHAR, document_type_code VARCHAR); CREATE TABLE Documents (document_id VARCHAR, document_status_code VARCHAR, document_type_code VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List the document ids of documents with the status done and type Paper, which not shipped by the shipping agent named USPS. The answer to your question is: SELECT document_id FROM Documents WHERE document_status_code = "done" AND document_type_code = "Paper" EXCEPT SELECT document_id FROM Documents JOIN Ref_Shipping_Agents ON Documents.shipping_agent_code = Ref_Shipping_Agents.shipping_agent_code WHERE Ref_Shipping_Agents.shipping_agent_name = "USPS". [/s>
|
SELECT document_id FROM Documents WHERE document_status_code = "done" AND document_type_code = "Paper" INTERSECT SELECT document_id FROM Documents JOIN Ref_Shipping_Agents ON Documents.shipping_agent_code = Ref_Shipping_Agents.shipping_agent_code WHERE Ref_Shipping_Agents.shipping_agent_name = "USPS"
|
CREATE TABLE Ref_Shipping_Agents (document_id VARCHAR, document_status_code VARCHAR, document_type_code VARCHAR); CREATE TABLE Documents (document_id VARCHAR, document_status_code VARCHAR, document_type_code VARCHAR)
|
List document id of documents status is done and document type is Paper and the document is shipped by shipping agent named USPS.
|
<s>[INST] Given the following SQL query and context: Query: SELECT document_id FROM Documents WHERE document_status_code = "done" AND document_type_code = "Paper" INTERSECT SELECT document_id FROM Documents JOIN Ref_Shipping_Agents ON Documents.shipping_agent_code = Ref_Shipping_Agents.shipping_agent_code WHERE Ref_Shipping_Agents.shipping_agent_name = "USPS" Context: CREATE TABLE Ref_Shipping_Agents (document_id VARCHAR, document_status_code VARCHAR, document_type_code VARCHAR); CREATE TABLE Documents (document_id VARCHAR, document_status_code VARCHAR, document_type_code VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List document id of documents status is done and document type is Paper and the document is shipped by shipping agent named USPS. The answer to your question is: SELECT document_id FROM Documents WHERE document_status_code = "done" AND document_type_code = "Paper" INTERSECT SELECT document_id FROM Documents JOIN Ref_Shipping_Agents ON Documents.shipping_agent_code = Ref_Shipping_Agents.shipping_agent_code WHERE Ref_Shipping_Agents.shipping_agent_name = "USPS". [/s>
|
SELECT draft_details FROM Document_Drafts WHERE document_id = 7
|
CREATE TABLE Document_Drafts (draft_details VARCHAR, document_id VARCHAR)
|
What is draft detail of the document with id 7?
|
<s>[INST] Given the following SQL query and context: Query: SELECT draft_details FROM Document_Drafts WHERE document_id = 7 Context: CREATE TABLE Document_Drafts (draft_details VARCHAR, document_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is draft detail of the document with id 7? The answer to your question is: SELECT draft_details FROM Document_Drafts WHERE document_id = 7. [/s>
|
SELECT COUNT(*) FROM Draft_Copies WHERE document_id = 2
|
CREATE TABLE Draft_Copies (document_id VARCHAR)
|
How many draft copies does the document with id 2 have?
|
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM Draft_Copies WHERE document_id = 2 Context: CREATE TABLE Draft_Copies (document_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many draft copies does the document with id 2 have? The answer to your question is: SELECT COUNT(*) FROM Draft_Copies WHERE document_id = 2. [/s>
|
SELECT document_id, COUNT(copy_number) FROM Draft_Copies GROUP BY document_id ORDER BY COUNT(copy_number) DESC LIMIT 1
|
CREATE TABLE Draft_Copies (document_id VARCHAR, copy_number VARCHAR)
|
Which document has the most draft copies? List its document id and number of draft copies.
|
<s>[INST] Given the following SQL query and context: Query: SELECT document_id, COUNT(copy_number) FROM Draft_Copies GROUP BY document_id ORDER BY COUNT(copy_number) DESC LIMIT 1 Context: CREATE TABLE Draft_Copies (document_id VARCHAR, copy_number VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Which document has the most draft copies? List its document id and number of draft copies. The answer to your question is: SELECT document_id, COUNT(copy_number) FROM Draft_Copies GROUP BY document_id ORDER BY COUNT(copy_number) DESC LIMIT 1. [/s>
|
SELECT document_id, COUNT(*) FROM Draft_Copies GROUP BY document_id HAVING COUNT(*) > 1
|
CREATE TABLE Draft_Copies (document_id VARCHAR)
|
Which documents have more than 1 draft copies? List document id and number of draft copies.
|
<s>[INST] Given the following SQL query and context: Query: SELECT document_id, COUNT(*) FROM Draft_Copies GROUP BY document_id HAVING COUNT(*) > 1 Context: CREATE TABLE Draft_Copies (document_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Which documents have more than 1 draft copies? List document id and number of draft copies. The answer to your question is: SELECT document_id, COUNT(*) FROM Draft_Copies GROUP BY document_id HAVING COUNT(*) > 1. [/s>
|
SELECT Employees.employee_name FROM Employees JOIN Circulation_History ON Circulation_History.employee_id = Employees.employee_id WHERE Circulation_History.document_id = 1
|
CREATE TABLE Circulation_History (Id VARCHAR); CREATE TABLE Employees (Id VARCHAR)
|
List all employees in the circulation history of the document with id 1. List the employee's name.
|
<s>[INST] Given the following SQL query and context: Query: SELECT Employees.employee_name FROM Employees JOIN Circulation_History ON Circulation_History.employee_id = Employees.employee_id WHERE Circulation_History.document_id = 1 Context: CREATE TABLE Circulation_History (Id VARCHAR); CREATE TABLE Employees (Id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List all employees in the circulation history of the document with id 1. List the employee's name. The answer to your question is: SELECT Employees.employee_name FROM Employees JOIN Circulation_History ON Circulation_History.employee_id = Employees.employee_id WHERE Circulation_History.document_id = 1. [/s>
|
SELECT employee_name FROM Employees EXCEPT SELECT Employees.employee_name FROM Employees JOIN Circulation_History ON Circulation_History.employee_id = Employees.employee_id
|
CREATE TABLE Circulation_History (employee_name VARCHAR); CREATE TABLE Employees (employee_name VARCHAR)
|
List the employees who have not showed up in any circulation history of documents. List the employee's name.
|
<s>[INST] Given the following SQL query and context: Query: SELECT employee_name FROM Employees EXCEPT SELECT Employees.employee_name FROM Employees JOIN Circulation_History ON Circulation_History.employee_id = Employees.employee_id Context: CREATE TABLE Circulation_History (employee_name VARCHAR); CREATE TABLE Employees (employee_name VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List the employees who have not showed up in any circulation history of documents. List the employee's name. The answer to your question is: SELECT employee_name FROM Employees EXCEPT SELECT Employees.employee_name FROM Employees JOIN Circulation_History ON Circulation_History.employee_id = Employees.employee_id. [/s>
|
SELECT Employees.employee_name, COUNT(*) FROM Employees JOIN Circulation_History ON Circulation_History.employee_id = Employees.employee_id GROUP BY Circulation_History.document_id, Circulation_History.draft_number, Circulation_History.copy_number ORDER BY COUNT(*) DESC LIMIT 1
|
CREATE TABLE Circulation_History (Id VARCHAR); CREATE TABLE Employees (Id VARCHAR)
|
Which employee has showed up in most circulation history documents. List the employee's name and the number of drafts and copies.
|
<s>[INST] Given the following SQL query and context: Query: SELECT Employees.employee_name, COUNT(*) FROM Employees JOIN Circulation_History ON Circulation_History.employee_id = Employees.employee_id GROUP BY Circulation_History.document_id, Circulation_History.draft_number, Circulation_History.copy_number ORDER BY COUNT(*) DESC LIMIT 1 Context: CREATE TABLE Circulation_History (Id VARCHAR); CREATE TABLE Employees (Id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Which employee has showed up in most circulation history documents. List the employee's name and the number of drafts and copies. The answer to your question is: SELECT Employees.employee_name, COUNT(*) FROM Employees JOIN Circulation_History ON Circulation_History.employee_id = Employees.employee_id GROUP BY Circulation_History.document_id, Circulation_History.draft_number, Circulation_History.copy_number ORDER BY COUNT(*) DESC LIMIT 1. [/s>
|
SELECT document_id, COUNT(DISTINCT employee_id) FROM Circulation_History GROUP BY document_id
|
CREATE TABLE Circulation_History (document_id VARCHAR, employee_id VARCHAR)
|
For each document, list the number of employees who have showed up in the circulation history of that document. List the document ids and number of employees.
|
<s>[INST] Given the following SQL query and context: Query: SELECT document_id, COUNT(DISTINCT employee_id) FROM Circulation_History GROUP BY document_id Context: CREATE TABLE Circulation_History (document_id VARCHAR, employee_id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: For each document, list the number of employees who have showed up in the circulation history of that document. List the document ids and number of employees. The answer to your question is: SELECT document_id, COUNT(DISTINCT employee_id) FROM Circulation_History GROUP BY document_id. [/s>
|
SELECT dname FROM department ORDER BY mgr_start_date
|
CREATE TABLE department (dname VARCHAR, mgr_start_date VARCHAR)
|
List all department names ordered by their starting date.
|
<s>[INST] Given the following SQL query and context: Query: SELECT dname FROM department ORDER BY mgr_start_date Context: CREATE TABLE department (dname VARCHAR, mgr_start_date VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List all department names ordered by their starting date. The answer to your question is: SELECT dname FROM department ORDER BY mgr_start_date. [/s>
|
SELECT Dependent_name FROM dependent WHERE relationship = 'Spouse'
|
CREATE TABLE dependent (Dependent_name VARCHAR, relationship VARCHAR)
|
find all dependent names who have a spouse relation with some employee.
|
<s>[INST] Given the following SQL query and context: Query: SELECT Dependent_name FROM dependent WHERE relationship = 'Spouse' Context: CREATE TABLE dependent (Dependent_name VARCHAR, relationship VARCHAR) [/INST] Based on the provided SQL query and context, your question is: find all dependent names who have a spouse relation with some employee. The answer to your question is: SELECT Dependent_name FROM dependent WHERE relationship = 'Spouse'. [/s>
|
SELECT COUNT(*) FROM dependent WHERE sex = 'F'
|
CREATE TABLE dependent (sex VARCHAR)
|
how many female dependents are there?
|
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM dependent WHERE sex = 'F' Context: CREATE TABLE dependent (sex VARCHAR) [/INST] Based on the provided SQL query and context, your question is: how many female dependents are there? The answer to your question is: SELECT COUNT(*) FROM dependent WHERE sex = 'F'. [/s>
|
SELECT t1.dname FROM department AS t1 JOIN dept_locations AS t2 ON t1.dnumber = t2.dnumber WHERE t2.dlocation = 'Houston'
|
CREATE TABLE dept_locations (dnumber VARCHAR, dlocation VARCHAR); CREATE TABLE department (dname VARCHAR, dnumber VARCHAR)
|
Find the names of departments that are located in Houston.
|
<s>[INST] Given the following SQL query and context: Query: SELECT t1.dname FROM department AS t1 JOIN dept_locations AS t2 ON t1.dnumber = t2.dnumber WHERE t2.dlocation = 'Houston' Context: CREATE TABLE dept_locations (dnumber VARCHAR, dlocation VARCHAR); CREATE TABLE department (dname VARCHAR, dnumber VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the names of departments that are located in Houston. The answer to your question is: SELECT t1.dname FROM department AS t1 JOIN dept_locations AS t2 ON t1.dnumber = t2.dnumber WHERE t2.dlocation = 'Houston'. [/s>
|
SELECT fname, lname FROM employee WHERE salary > 30000
|
CREATE TABLE employee (fname VARCHAR, lname VARCHAR, salary INTEGER)
|
Return the first names and last names of employees who earn more than 30000 in salary.
|
<s>[INST] Given the following SQL query and context: Query: SELECT fname, lname FROM employee WHERE salary > 30000 Context: CREATE TABLE employee (fname VARCHAR, lname VARCHAR, salary INTEGER) [/INST] Based on the provided SQL query and context, your question is: Return the first names and last names of employees who earn more than 30000 in salary. The answer to your question is: SELECT fname, lname FROM employee WHERE salary > 30000. [/s>
|
SELECT COUNT(*), sex FROM employee WHERE salary < 50000 GROUP BY sex
|
CREATE TABLE employee (sex VARCHAR, salary INTEGER)
|
Find the number of employees of each gender whose salary is lower than 50000.
|
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*), sex FROM employee WHERE salary < 50000 GROUP BY sex Context: CREATE TABLE employee (sex VARCHAR, salary INTEGER) [/INST] Based on the provided SQL query and context, your question is: Find the number of employees of each gender whose salary is lower than 50000. The answer to your question is: SELECT COUNT(*), sex FROM employee WHERE salary < 50000 GROUP BY sex. [/s>
|
SELECT fname, lname, address FROM employee ORDER BY Bdate
|
CREATE TABLE employee (fname VARCHAR, lname VARCHAR, address VARCHAR, Bdate VARCHAR)
|
list the first and last names, and the addresses of all employees in the ascending order of their birth date.
|
<s>[INST] Given the following SQL query and context: Query: SELECT fname, lname, address FROM employee ORDER BY Bdate Context: CREATE TABLE employee (fname VARCHAR, lname VARCHAR, address VARCHAR, Bdate VARCHAR) [/INST] Based on the provided SQL query and context, your question is: list the first and last names, and the addresses of all employees in the ascending order of their birth date. The answer to your question is: SELECT fname, lname, address FROM employee ORDER BY Bdate. [/s>
|
SELECT T1.event_details FROM EVENTS AS T1 JOIN Services AS T2 ON T1.Service_ID = T2.Service_ID WHERE T2.Service_Type_Code = 'Marriage'
|
CREATE TABLE EVENTS (event_details VARCHAR, Service_ID VARCHAR); CREATE TABLE Services (Service_ID VARCHAR, Service_Type_Code VARCHAR)
|
what are the event details of the services that have the type code 'Marriage'?
|
<s>[INST] Given the following SQL query and context: Query: SELECT T1.event_details FROM EVENTS AS T1 JOIN Services AS T2 ON T1.Service_ID = T2.Service_ID WHERE T2.Service_Type_Code = 'Marriage' Context: CREATE TABLE EVENTS (event_details VARCHAR, Service_ID VARCHAR); CREATE TABLE Services (Service_ID VARCHAR, Service_Type_Code VARCHAR) [/INST] Based on the provided SQL query and context, your question is: what are the event details of the services that have the type code 'Marriage'? The answer to your question is: SELECT T1.event_details FROM EVENTS AS T1 JOIN Services AS T2 ON T1.Service_ID = T2.Service_ID WHERE T2.Service_Type_Code = 'Marriage'. [/s>
|
SELECT T1.event_id, T1.event_details FROM EVENTS AS T1 JOIN Participants_in_Events AS T2 ON T1.Event_ID = T2.Event_ID GROUP BY T1.Event_ID HAVING COUNT(*) > 1
|
CREATE TABLE EVENTS (event_id VARCHAR, event_details VARCHAR, Event_ID VARCHAR); CREATE TABLE Participants_in_Events (Event_ID VARCHAR)
|
What are the ids and details of events that have more than one participants?
|
<s>[INST] Given the following SQL query and context: Query: SELECT T1.event_id, T1.event_details FROM EVENTS AS T1 JOIN Participants_in_Events AS T2 ON T1.Event_ID = T2.Event_ID GROUP BY T1.Event_ID HAVING COUNT(*) > 1 Context: CREATE TABLE EVENTS (event_id VARCHAR, event_details VARCHAR, Event_ID VARCHAR); CREATE TABLE Participants_in_Events (Event_ID VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What are the ids and details of events that have more than one participants? The answer to your question is: SELECT T1.event_id, T1.event_details FROM EVENTS AS T1 JOIN Participants_in_Events AS T2 ON T1.Event_ID = T2.Event_ID GROUP BY T1.Event_ID HAVING COUNT(*) > 1. [/s>
|
SELECT T1.Participant_ID, T1.Participant_Type_Code, COUNT(*) FROM Participants AS T1 JOIN Participants_in_Events AS T2 ON T1.Participant_ID = T2.Participant_ID GROUP BY T1.Participant_ID
|
CREATE TABLE Participants (Participant_ID VARCHAR, Participant_Type_Code VARCHAR); CREATE TABLE Participants_in_Events (Participant_ID VARCHAR)
|
How many events have each participants attended? List the participant id, type and the number.
|
<s>[INST] Given the following SQL query and context: Query: SELECT T1.Participant_ID, T1.Participant_Type_Code, COUNT(*) FROM Participants AS T1 JOIN Participants_in_Events AS T2 ON T1.Participant_ID = T2.Participant_ID GROUP BY T1.Participant_ID Context: CREATE TABLE Participants (Participant_ID VARCHAR, Participant_Type_Code VARCHAR); CREATE TABLE Participants_in_Events (Participant_ID VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many events have each participants attended? List the participant id, type and the number. The answer to your question is: SELECT T1.Participant_ID, T1.Participant_Type_Code, COUNT(*) FROM Participants AS T1 JOIN Participants_in_Events AS T2 ON T1.Participant_ID = T2.Participant_ID GROUP BY T1.Participant_ID. [/s>
|
SELECT Participant_ID, Participant_Type_Code, Participant_Details FROM Participants
|
CREATE TABLE Participants (Participant_ID VARCHAR, Participant_Type_Code VARCHAR, Participant_Details VARCHAR)
|
What are all the the participant ids, type code and details?
|
<s>[INST] Given the following SQL query and context: Query: SELECT Participant_ID, Participant_Type_Code, Participant_Details FROM Participants Context: CREATE TABLE Participants (Participant_ID VARCHAR, Participant_Type_Code VARCHAR, Participant_Details VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What are all the the participant ids, type code and details? The answer to your question is: SELECT Participant_ID, Participant_Type_Code, Participant_Details FROM Participants. [/s>
|
SELECT COUNT(*) FROM participants WHERE participant_type_code = 'Organizer'
|
CREATE TABLE participants (participant_type_code VARCHAR)
|
How many participants belong to the type 'Organizer'?
|
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM participants WHERE participant_type_code = 'Organizer' Context: CREATE TABLE participants (participant_type_code VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many participants belong to the type 'Organizer'? The answer to your question is: SELECT COUNT(*) FROM participants WHERE participant_type_code = 'Organizer'. [/s>
|
SELECT service_type_code FROM services ORDER BY service_type_code
|
CREATE TABLE services (service_type_code VARCHAR)
|
List the type of the services in alphabetical order.
|
<s>[INST] Given the following SQL query and context: Query: SELECT service_type_code FROM services ORDER BY service_type_code Context: CREATE TABLE services (service_type_code VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List the type of the services in alphabetical order. The answer to your question is: SELECT service_type_code FROM services ORDER BY service_type_code. [/s>
|
SELECT service_id, event_details FROM EVENTS
|
CREATE TABLE EVENTS (service_id VARCHAR, event_details VARCHAR)
|
List the service id and details for the events.
|
<s>[INST] Given the following SQL query and context: Query: SELECT service_id, event_details FROM EVENTS Context: CREATE TABLE EVENTS (service_id VARCHAR, event_details VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List the service id and details for the events. The answer to your question is: SELECT service_id, event_details FROM EVENTS. [/s>
|
SELECT COUNT(*) FROM participants AS T1 JOIN Participants_in_Events AS T2 ON T1.Participant_ID = T2.Participant_ID WHERE T1.participant_details LIKE '%Dr.%'
|
CREATE TABLE participants (Participant_ID VARCHAR, participant_details VARCHAR); CREATE TABLE Participants_in_Events (Participant_ID VARCHAR)
|
How many events had participants whose details had the substring 'Dr.'
|
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM participants AS T1 JOIN Participants_in_Events AS T2 ON T1.Participant_ID = T2.Participant_ID WHERE T1.participant_details LIKE '%Dr.%' Context: CREATE TABLE participants (Participant_ID VARCHAR, participant_details VARCHAR); CREATE TABLE Participants_in_Events (Participant_ID VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many events had participants whose details had the substring 'Dr.' The answer to your question is: SELECT COUNT(*) FROM participants AS T1 JOIN Participants_in_Events AS T2 ON T1.Participant_ID = T2.Participant_ID WHERE T1.participant_details LIKE '%Dr.%'. [/s>
|
SELECT participant_type_code FROM participants GROUP BY participant_type_code ORDER BY COUNT(*) DESC LIMIT 1
|
CREATE TABLE participants (participant_type_code VARCHAR)
|
What is the most common participant type?
|
<s>[INST] Given the following SQL query and context: Query: SELECT participant_type_code FROM participants GROUP BY participant_type_code ORDER BY COUNT(*) DESC LIMIT 1 Context: CREATE TABLE participants (participant_type_code VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is the most common participant type? The answer to your question is: SELECT participant_type_code FROM participants GROUP BY participant_type_code ORDER BY COUNT(*) DESC LIMIT 1. [/s>
|
SELECT T3.service_id, T4.Service_Type_Code FROM participants AS T1 JOIN Participants_in_Events AS T2 ON T1.Participant_ID = T2.Participant_ID JOIN EVENTS AS T3 ON T2.Event_ID = T3.Event_ID JOIN services AS T4 ON T3.service_id = T4.service_id GROUP BY T3.service_id ORDER BY COUNT(*) LIMIT 1
|
CREATE TABLE Participants_in_Events (Participant_ID VARCHAR, Event_ID VARCHAR); CREATE TABLE services (Service_Type_Code VARCHAR, service_id VARCHAR); CREATE TABLE EVENTS (service_id VARCHAR, Event_ID VARCHAR); CREATE TABLE participants (Participant_ID VARCHAR)
|
Which service id and type has the least number of participants?
|
<s>[INST] Given the following SQL query and context: Query: SELECT T3.service_id, T4.Service_Type_Code FROM participants AS T1 JOIN Participants_in_Events AS T2 ON T1.Participant_ID = T2.Participant_ID JOIN EVENTS AS T3 ON T2.Event_ID = T3.Event_ID JOIN services AS T4 ON T3.service_id = T4.service_id GROUP BY T3.service_id ORDER BY COUNT(*) LIMIT 1 Context: CREATE TABLE Participants_in_Events (Participant_ID VARCHAR, Event_ID VARCHAR); CREATE TABLE services (Service_Type_Code VARCHAR, service_id VARCHAR); CREATE TABLE EVENTS (service_id VARCHAR, Event_ID VARCHAR); CREATE TABLE participants (Participant_ID VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Which service id and type has the least number of participants? The answer to your question is: SELECT T3.service_id, T4.Service_Type_Code FROM participants AS T1 JOIN Participants_in_Events AS T2 ON T1.Participant_ID = T2.Participant_ID JOIN EVENTS AS T3 ON T2.Event_ID = T3.Event_ID JOIN services AS T4 ON T3.service_id = T4.service_id GROUP BY T3.service_id ORDER BY COUNT(*) LIMIT 1. [/s>
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.