db_id
stringlengths
4
31
SQL
stringlengths
18
1.45k
input_sequence
stringlengths
148
11k
question
stringlengths
16
325
gas_company
select company , headquarters from company order by market_value desc
Question: what are the names and headquarters of all companies ordered by descending market value? | Tables: company -> Company_ID, Rank, Company, Headquarters, Main_Industry, Sales_billion, Profits_billion, Assets_billion, Market_Value. gas_station -> Station_ID, Open_Year, Location, Manager_Name, Vice_Manager_Name, R...
what are the names and headquarters of all companies ordered by descending market value?
gas_company
select min(market_value) , max(market_value) , avg(market_value) from company
Question: show minimum, maximum, and average market value for all companies. | Tables: company -> Company_ID, Rank, Company, Headquarters, Main_Industry, Sales_billion, Profits_billion, Assets_billion, Market_Value. gas_station -> Station_ID, Open_Year, Location, Manager_Name, Vice_Manager_Name, Representative_Name. st...
show minimum, maximum, and average market value for all companies.
gas_company
select min(market_value) , max(market_value) , avg(market_value) from company
Question: what is the minimum, maximum, and average market value for every company? | Tables: company -> Company_ID, Rank, Company, Headquarters, Main_Industry, Sales_billion, Profits_billion, Assets_billion, Market_Value. gas_station -> Station_ID, Open_Year, Location, Manager_Name, Vice_Manager_Name, Representative_N...
what is the minimum, maximum, and average market value for every company?
gas_company
select distinct main_industry from company
Question: show all main industry for all companies. | Tables: company -> Company_ID, Rank, Company, Headquarters, Main_Industry, Sales_billion, Profits_billion, Assets_billion, Market_Value. gas_station -> Station_ID, Open_Year, Location, Manager_Name, Vice_Manager_Name, Representative_Name. station_company -> Station_...
show all main industry for all companies.
gas_company
select distinct main_industry from company
Question: what are the different main industries for all companies? | Tables: company -> Company_ID, Rank, Company, Headquarters, Main_Industry, Sales_billion, Profits_billion, Assets_billion, Market_Value. gas_station -> Station_ID, Open_Year, Location, Manager_Name, Vice_Manager_Name, Representative_Name. station_com...
what are the different main industries for all companies?
gas_company
select headquarters , count(*) from company group by headquarters
Question: list all headquarters and the number of companies in each headquarter. | Tables: company -> Company_ID, Rank, Company, Headquarters, Main_Industry, Sales_billion, Profits_billion, Assets_billion, Market_Value. gas_station -> Station_ID, Open_Year, Location, Manager_Name, Vice_Manager_Name, Representative_Name...
list all headquarters and the number of companies in each headquarter.
gas_company
select headquarters , count(*) from company group by headquarters
Question: for each headquarter, what are the headquarter and how many companies are centered there? | Tables: company -> Company_ID, Rank, Company, Headquarters, Main_Industry, Sales_billion, Profits_billion, Assets_billion, Market_Value. gas_station -> Station_ID, Open_Year, Location, Manager_Name, Vice_Manager_Name, ...
for each headquarter, what are the headquarter and how many companies are centered there?
gas_company
select main_industry , sum(market_value) from company group by main_industry
Question: show all main industry and total market value in each industry. | Tables: company -> Company_ID, Rank, Company, Headquarters, Main_Industry, Sales_billion, Profits_billion, Assets_billion, Market_Value. gas_station -> Station_ID, Open_Year, Location, Manager_Name, Vice_Manager_Name, Representative_Name. stati...
show all main industry and total market value in each industry.
gas_company
select main_industry , sum(market_value) from company group by main_industry
Question: what are the main indstries and total market value for each industry? | Tables: company -> Company_ID, Rank, Company, Headquarters, Main_Industry, Sales_billion, Profits_billion, Assets_billion, Market_Value. gas_station -> Station_ID, Open_Year, Location, Manager_Name, Vice_Manager_Name, Representative_Name....
what are the main indstries and total market value for each industry?
gas_company
select main_industry , count(*) from company group by main_industry order by sum(market_value) desc limit 1
Question: list the main industry with highest total market value and its number of companies. | Tables: company -> Company_ID, Rank, Company, Headquarters, Main_Industry, Sales_billion, Profits_billion, Assets_billion, Market_Value. gas_station -> Station_ID, Open_Year, Location, Manager_Name, Vice_Manager_Name, Repres...
list the main industry with highest total market value and its number of companies.
gas_company
select main_industry , count(*) from company group by main_industry order by sum(market_value) desc limit 1
Question: for each main industry, what is the total number of companies for the industry with the highest total market value? | Tables: company -> Company_ID, Rank, Company, Headquarters, Main_Industry, Sales_billion, Profits_billion, Assets_billion, Market_Value. gas_station -> Station_ID, Open_Year, Location, Manager...
for each main industry, what is the total number of companies for the industry with the highest total market value?
gas_company
select headquarters from company where main_industry = 'banking' group by headquarters having count(*) >= 2
Question: show headquarters with at least two companies in the banking industry. | Tables: company -> Company_ID, Rank, Company, Headquarters, Main_Industry, Sales_billion, Profits_billion, Assets_billion, Market_Value. gas_station -> Station_ID, Open_Year, Location, Manager_Name, Vice_Manager_Name, Representative_Name...
show headquarters with at least two companies in the banking industry.
gas_company
select headquarters from company where main_industry = 'banking' group by headquarters having count(*) >= 2
Question: what are the headquarters with at least two companies in the banking industry? | Tables: company -> Company_ID, Rank, Company, Headquarters, Main_Industry, Sales_billion, Profits_billion, Assets_billion, Market_Value. gas_station -> Station_ID, Open_Year, Location, Manager_Name, Vice_Manager_Name, Representat...
what are the headquarters with at least two companies in the banking industry?
gas_company
select station_id , location , manager_name from gas_station order by open_year
Question: show gas station id, location, and manager_name for all gas stations ordered by open year. | Tables: company -> Company_ID, Rank, Company, Headquarters, Main_Industry, Sales_billion, Profits_billion, Assets_billion, Market_Value. gas_station -> Station_ID, Open_Year, Location, Manager_Name, Vice_Manager_Name,...
show gas station id, location, and manager_name for all gas stations ordered by open year.
gas_company
select station_id , location , manager_name from gas_station order by open_year
Question: what are the gas station ids, locations, and manager names for the gas stations ordered by opening year? | Tables: company -> Company_ID, Rank, Company, Headquarters, Main_Industry, Sales_billion, Profits_billion, Assets_billion, Market_Value. gas_station -> Station_ID, Open_Year, Location, Manager_Name, Vice...
what are the gas station ids, locations, and manager names for the gas stations ordered by opening year?
gas_company
select count(*) from gas_station where open_year between 2000 and 2005
Question: how many gas station are opened between 2000 and 2005? | Tables: company -> Company_ID, Rank, Company, Headquarters, Main_Industry, Sales_billion, Profits_billion, Assets_billion, Market_Value. gas_station -> Station_ID, Open_Year, Location, Manager_Name, Vice_Manager_Name, Representative_Name. station_compan...
how many gas station are opened between 2000 and 2005?
gas_company
select count(*) from gas_station where open_year between 2000 and 2005
Question: what is the total number of gas stations that opened between 2000 and 2005? | Tables: company -> Company_ID, Rank, Company, Headquarters, Main_Industry, Sales_billion, Profits_billion, Assets_billion, Market_Value. gas_station -> Station_ID, Open_Year, Location, Manager_Name, Vice_Manager_Name, Representative...
what is the total number of gas stations that opened between 2000 and 2005?
gas_company
select location , count(*) from gas_station group by location order by count(*)
Question: show all locations and the number of gas stations in each location ordered by the count. | Tables: company -> Company_ID, Rank, Company, Headquarters, Main_Industry, Sales_billion, Profits_billion, Assets_billion, Market_Value. gas_station -> Station_ID, Open_Year, Location, Manager_Name, Vice_Manager_Name, R...
show all locations and the number of gas stations in each location ordered by the count.
gas_company
select location , count(*) from gas_station group by location order by count(*)
Question: for each location, how many gas stations are there in order? | Tables: company -> Company_ID, Rank, Company, Headquarters, Main_Industry, Sales_billion, Profits_billion, Assets_billion, Market_Value. gas_station -> Station_ID, Open_Year, Location, Manager_Name, Vice_Manager_Name, Representative_Name. station_...
for each location, how many gas stations are there in order?
gas_company
select headquarters from company where main_industry = 'banking' intersect select headquarters from company where main_industry = 'oil and gas'
Question: show all headquarters with both a company in banking industry and a company in oil and gas. | Tables: company -> Company_ID, Rank, Company, Headquarters, Main_Industry, Sales_billion, Profits_billion, Assets_billion, Market_Value. gas_station -> Station_ID, Open_Year, Location, Manager_Name, Vice_Manager_Name...
show all headquarters with both a company in banking industry and a company in oil and gas.
gas_company
select headquarters from company where main_industry = 'banking' intersect select headquarters from company where main_industry = 'oil and gas'
Question: what are the headquarters that have both a company in the banking and 'oil and gas' industries? | Tables: company -> Company_ID, Rank, Company, Headquarters, Main_Industry, Sales_billion, Profits_billion, Assets_billion, Market_Value. gas_station -> Station_ID, Open_Year, Location, Manager_Name, Vice_Manager_...
what are the headquarters that have both a company in the banking and 'oil and gas' industries?
gas_company
select headquarters from company except select headquarters from company where main_industry = 'banking'
Question: show all headquarters without a company in banking industry. | Tables: company -> Company_ID, Rank, Company, Headquarters, Main_Industry, Sales_billion, Profits_billion, Assets_billion, Market_Value. gas_station -> Station_ID, Open_Year, Location, Manager_Name, Vice_Manager_Name, Representative_Name. station_...
show all headquarters without a company in banking industry.
gas_company
select headquarters from company except select headquarters from company where main_industry = 'banking'
Question: what are the headquarters without companies that are in the banking industry? | Tables: company -> Company_ID, Rank, Company, Headquarters, Main_Industry, Sales_billion, Profits_billion, Assets_billion, Market_Value. gas_station -> Station_ID, Open_Year, Location, Manager_Name, Vice_Manager_Name, Representati...
what are the headquarters without companies that are in the banking industry?
gas_company
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
Question: show the company name with the number of gas station. | Tables: company -> Company_ID, Rank, Company, Headquarters, Main_Industry, Sales_billion, Profits_billion, Assets_billion, Market_Value. gas_station -> Station_ID, Open_Year, Location, Manager_Name, Vice_Manager_Name, Representative_Name. station_company...
show the company name with the number of gas station.
gas_company
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
Question: for each company id, what are the companies and how many gas stations does each one operate? | Tables: company -> Company_ID, Rank, Company, Headquarters, Main_Industry, Sales_billion, Profits_billion, Assets_billion, Market_Value. gas_station -> Station_ID, Open_Year, Location, Manager_Name, Vice_Manager_Nam...
for each company id, what are the companies and how many gas stations does each one operate?
gas_company
select company , main_industry from company where company_id not in (select company_id from station_company)
Question: show company name and main industry without a gas station. | Tables: company -> Company_ID, Rank, Company, Headquarters, Main_Industry, Sales_billion, Profits_billion, Assets_billion, Market_Value. gas_station -> Station_ID, Open_Year, Location, Manager_Name, Vice_Manager_Name, Representative_Name. station_co...
show company name and main industry without a gas station.
gas_company
select company , main_industry from company where company_id not in (select company_id from station_company)
Question: what are the main industries of the companies without gas stations and what are the companies? | Tables: company -> Company_ID, Rank, Company, Headquarters, Main_Industry, Sales_billion, Profits_billion, Assets_billion, Market_Value. gas_station -> Station_ID, Open_Year, Location, Manager_Name, Vice_Manager_N...
what are the main industries of the companies without gas stations and what are the companies?
gas_company
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'
Question: show the manager name for gas stations belonging to the exxonmobil company. | Tables: company -> Company_ID, Rank, Company, Headquarters, Main_Industry, Sales_billion, Profits_billion, Assets_billion, Market_Value. gas_station -> Station_ID, Open_Year, Location, Manager_Name, Vice_Manager_Name, Representative...
show the manager name for gas stations belonging to the exxonmobil company.
gas_company
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'
Question: what are the names of the managers for gas stations that are operated by the exxonmobil company? | Tables: company -> Company_ID, Rank, Company, Headquarters, Main_Industry, Sales_billion, Profits_billion, Assets_billion, Market_Value. gas_station -> Station_ID, Open_Year, Location, Manager_Name, Vice_Manager...
what are the names of the managers for gas stations that are operated by the exxonmobil company?
gas_company
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
Question: show all locations where a gas station for company with market value greater than 100 is located. | Tables: company -> Company_ID, Rank, Company, Headquarters, Main_Industry, Sales_billion, Profits_billion, Assets_billion, Market_Value. gas_station -> Station_ID, Open_Year, Location, Manager_Name, Vice_Manage...
show all locations where a gas station for company with market value greater than 100 is located.
gas_company
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
Question: what are the locations that have gas stations owned by a company with a market value greater than 100? | Tables: company -> Company_ID, Rank, Company, Headquarters, Main_Industry, Sales_billion, Profits_billion, Assets_billion, Market_Value. gas_station -> Station_ID, Open_Year, Location, Manager_Name, Vice_M...
what are the locations that have gas stations owned by a company with a market value greater than 100?
gas_company
select manager_name from gas_station where open_year > 2000 group by manager_name order by count(*) desc limit 1
Question: show the manager name with most number of gas stations opened after 2000. | Tables: company -> Company_ID, Rank, Company, Headquarters, Main_Industry, Sales_billion, Profits_billion, Assets_billion, Market_Value. gas_station -> Station_ID, Open_Year, Location, Manager_Name, Vice_Manager_Name, Representative_N...
show the manager name with most number of gas stations opened after 2000.
gas_company
select manager_name from gas_station where open_year > 2000 group by manager_name order by count(*) desc limit 1
Question: what is the name of the manager with the most gas stations that opened after 2000? | Tables: company -> Company_ID, Rank, Company, Headquarters, Main_Industry, Sales_billion, Profits_billion, Assets_billion, Market_Value. gas_station -> Station_ID, Open_Year, Location, Manager_Name, Vice_Manager_Name, Represe...
what is the name of the manager with the most gas stations that opened after 2000?
gas_company
select location from gas_station order by open_year
Question: order all gas station locations by the opening year. | Tables: company -> Company_ID, Rank, Company, Headquarters, Main_Industry, Sales_billion, Profits_billion, Assets_billion, Market_Value. gas_station -> Station_ID, Open_Year, Location, Manager_Name, Vice_Manager_Name, Representative_Name. station_company ...
order all gas station locations by the opening year.
gas_company
select location from gas_station order by open_year
Question: what are the locations of all the gas stations ordered by opening year? | Tables: company -> Company_ID, Rank, Company, Headquarters, Main_Industry, Sales_billion, Profits_billion, Assets_billion, Market_Value. gas_station -> Station_ID, Open_Year, Location, Manager_Name, Vice_Manager_Name, Representative_Nam...
what are the locations of all the gas stations ordered by opening year?
gas_company
select rank , company , market_value from company where main_industry = 'banking' order by sales_billion , profits_billion
Question: find the rank, company names, market values of the companies in the banking industry order by their sales and profits in billion. | Tables: company -> Company_ID, Rank, Company, Headquarters, Main_Industry, Sales_billion, Profits_billion, Assets_billion, Market_Value. gas_station -> Station_ID, Open_Year, Loc...
find the rank, company names, market values of the companies in the banking industry order by their sales and profits in billion.
gas_company
select rank , company , market_value from company where main_industry = 'banking' order by sales_billion , profits_billion
Question: what is the rank, company, and market value of every comapny in the banking industry ordered by sales and profits? | Tables: company -> Company_ID, Rank, Company, Headquarters, Main_Industry, Sales_billion, Profits_billion, Assets_billion, Market_Value. gas_station -> Station_ID, Open_Year, Location, Manager_...
what is the rank, company, and market value of every comapny in the banking industry ordered by sales and profits?
gas_company
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
Question: find the location and representative name of the gas stations owned by the companies with top 3 asset amounts. | Tables: company -> Company_ID, Rank, Company, Headquarters, Main_Industry, Sales_billion, Profits_billion, Assets_billion, Market_Value. gas_station -> Station_ID, Open_Year, Location, Manager_Name...
find the location and representative name of the gas stations owned by the companies with top 3 asset amounts.
gas_company
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
Question: what are the locations and representatives' names of the gas stations owned by the companies with the 3 largest amounts of assets? | Tables: company -> Company_ID, Rank, Company, Headquarters, Main_Industry, Sales_billion, Profits_billion, Assets_billion, Market_Value. gas_station -> Station_ID, Open_Year, Lo...
what are the locations and representatives' names of the gas stations owned by the companies with the 3 largest amounts of assets?
party_people
select count(*) from region
Question: how many regions do we have? | Tables: region -> Region_ID, Region_name, Date, Label, Format, Catalogue. party -> Party_ID, Minister, Took_office, Left_office, Region_ID, Party_name. member -> Member_ID, Member_Name, Party_ID, In_office. party_events -> Event_ID, Event_Name, Party_ID, Member_in_charge_ID. | J...
how many regions do we have?
party_people
select count(*) from region
Question: count the number of regions. | Tables: region -> Region_ID, Region_name, Date, Label, Format, Catalogue. party -> Party_ID, Minister, Took_office, Left_office, Region_ID, Party_name. member -> Member_ID, Member_Name, Party_ID, In_office. party_events -> Event_ID, Event_Name, Party_ID, Member_in_charge_ID. | J...
count the number of regions.
party_people
select distinct region_name from region order by label
Question: show all distinct region names ordered by their labels. | Tables: region -> Region_ID, Region_name, Date, Label, Format, Catalogue. party -> Party_ID, Minister, Took_office, Left_office, Region_ID, Party_name. member -> Member_ID, Member_Name, Party_ID, In_office. party_events -> Event_ID, Event_Name, Party_I...
show all distinct region names ordered by their labels.
party_people
select distinct region_name from region order by label
Question: what are the different region names, ordered by labels? | Tables: region -> Region_ID, Region_name, Date, Label, Format, Catalogue. party -> Party_ID, Minister, Took_office, Left_office, Region_ID, Party_name. member -> Member_ID, Member_Name, Party_ID, In_office. party_events -> Event_ID, Event_Name, Party_I...
what are the different region names, ordered by labels?
party_people
select count(distinct party_name) from party
Question: how many parties do we have? | Tables: region -> Region_ID, Region_name, Date, Label, Format, Catalogue. party -> Party_ID, Minister, Took_office, Left_office, Region_ID, Party_name. member -> Member_ID, Member_Name, Party_ID, In_office. party_events -> Event_ID, Event_Name, Party_ID, Member_in_charge_ID. | J...
how many parties do we have?
party_people
select count(distinct party_name) from party
Question: count the number of different parties. | Tables: region -> Region_ID, Region_name, Date, Label, Format, Catalogue. party -> Party_ID, Minister, Took_office, Left_office, Region_ID, Party_name. member -> Member_ID, Member_Name, Party_ID, In_office. party_events -> Event_ID, Event_Name, Party_ID, Member_in_char...
count the number of different parties.
party_people
select minister , took_office , left_office from party order by left_office
Question: show the ministers and the time they took and left office, listed by the time they left office. | Tables: region -> Region_ID, Region_name, Date, Label, Format, Catalogue. party -> Party_ID, Minister, Took_office, Left_office, Region_ID, Party_name. member -> Member_ID, Member_Name, Party_ID, In_office. party...
show the ministers and the time they took and left office, listed by the time they left office.
party_people
select minister , took_office , left_office from party order by left_office
Question: who are the ministers, when did they take office, and when did they leave office, ordered by when they left office? | Tables: region -> Region_ID, Region_name, Date, Label, Format, Catalogue. party -> Party_ID, Minister, Took_office, Left_office, Region_ID, Party_name. member -> Member_ID, Member_Name, Party_...
who are the ministers, when did they take office, and when did they leave office, ordered by when they left office?
party_people
select minister from party where took_office > 1961 or took_office < 1959
Question: show the minister who took office after 1961 or before 1959. | Tables: region -> Region_ID, Region_name, Date, Label, Format, Catalogue. party -> Party_ID, Minister, Took_office, Left_office, Region_ID, Party_name. member -> Member_ID, Member_Name, Party_ID, In_office. party_events -> Event_ID, Event_Name, Pa...
show the minister who took office after 1961 or before 1959.
party_people
select minister from party where took_office > 1961 or took_office < 1959
Question: who are the ministers who took office after 1961 or before 1959? | Tables: region -> Region_ID, Region_name, Date, Label, Format, Catalogue. party -> Party_ID, Minister, Took_office, Left_office, Region_ID, Party_name. member -> Member_ID, Member_Name, Party_ID, In_office. party_events -> Event_ID, Event_Name...
who are the ministers who took office after 1961 or before 1959?
party_people
select minister from party where party_name != 'progress party'
Question: show all ministers who do not belong to progress party. | Tables: region -> Region_ID, Region_name, Date, Label, Format, Catalogue. party -> Party_ID, Minister, Took_office, Left_office, Region_ID, Party_name. member -> Member_ID, Member_Name, Party_ID, In_office. party_events -> Event_ID, Event_Name, Party_I...
show all ministers who do not belong to progress party.
party_people
select minister from party where party_name != 'progress party'
Question: which ministers are not a part of the progress party? | Tables: region -> Region_ID, Region_name, Date, Label, Format, Catalogue. party -> Party_ID, Minister, Took_office, Left_office, Region_ID, Party_name. member -> Member_ID, Member_Name, Party_ID, In_office. party_events -> Event_ID, Event_Name, Party_ID,...
which ministers are not a part of the progress party?
party_people
select minister , party_name from party order by took_office desc
Question: show all ministers and parties they belong to in descending order of the time they took office. | Tables: region -> Region_ID, Region_name, Date, Label, Format, Catalogue. party -> Party_ID, Minister, Took_office, Left_office, Region_ID, Party_name. member -> Member_ID, Member_Name, Party_ID, In_office. party...
show all ministers and parties they belong to in descending order of the time they took office.
party_people
select minister , party_name from party order by took_office desc
Question: who are the ministers and what parties do they belong to, listed descending by the times they took office? | Tables: region -> Region_ID, Region_name, Date, Label, Format, Catalogue. party -> Party_ID, Minister, Took_office, Left_office, Region_ID, Party_name. member -> Member_ID, Member_Name, Party_ID, In_of...
who are the ministers and what parties do they belong to, listed descending by the times they took office?
party_people
select minister from party order by left_office desc limit 1
Question: return the minister who left office at the latest time. | Tables: region -> Region_ID, Region_name, Date, Label, Format, Catalogue. party -> Party_ID, Minister, Took_office, Left_office, Region_ID, Party_name. member -> Member_ID, Member_Name, Party_ID, In_office. party_events -> Event_ID, Event_Name, Party_I...
return the minister who left office at the latest time.
party_people
select minister from party order by left_office desc limit 1
Question: which minister left office the latest? | Tables: region -> Region_ID, Region_name, Date, Label, Format, Catalogue. party -> Party_ID, Minister, Took_office, Left_office, Region_ID, Party_name. member -> Member_ID, Member_Name, Party_ID, In_office. party_events -> Event_ID, Event_Name, Party_ID, Member_in_char...
which minister left office the latest?
party_people
select t1.member_name , t2.party_name from member as t1 join party as t2 on t1.party_id = t2.party_id
Question: list member names and their party names. | Tables: region -> Region_ID, Region_name, Date, Label, Format, Catalogue. party -> Party_ID, Minister, Took_office, Left_office, Region_ID, Party_name. member -> Member_ID, Member_Name, Party_ID, In_office. party_events -> Event_ID, Event_Name, Party_ID, Member_in_ch...
list member names and their party names.
party_people
select t1.member_name , t2.party_name from member as t1 join party as t2 on t1.party_id = t2.party_id
Question: what are the names of members and their corresponding parties? | Tables: region -> Region_ID, Region_name, Date, Label, Format, Catalogue. party -> Party_ID, Minister, Took_office, Left_office, Region_ID, Party_name. member -> Member_ID, Member_Name, Party_ID, In_office. party_events -> Event_ID, Event_Name, ...
what are the names of members and their corresponding parties?
party_people
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
Question: show all party names and the number of members in each party. | Tables: region -> Region_ID, Region_name, Date, Label, Format, Catalogue. party -> Party_ID, Minister, Took_office, Left_office, Region_ID, Party_name. member -> Member_ID, Member_Name, Party_ID, In_office. party_events -> Event_ID, Event_Name, P...
show all party names and the number of members in each party.
party_people
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
Question: how many members are in each party? | Tables: region -> Region_ID, Region_name, Date, Label, Format, Catalogue. party -> Party_ID, Minister, Took_office, Left_office, Region_ID, Party_name. member -> Member_ID, Member_Name, Party_ID, In_office. party_events -> Event_ID, Event_Name, Party_ID, Member_in_charge_...
how many members are in each party?
party_people
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
Question: what is the name of party with most number of members? | Tables: region -> Region_ID, Region_name, Date, Label, Format, Catalogue. party -> Party_ID, Minister, Took_office, Left_office, Region_ID, Party_name. member -> Member_ID, Member_Name, Party_ID, In_office. party_events -> Event_ID, Event_Name, Party_ID...
what is the name of party with most number of members?
party_people
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
Question: return the name of the party with the most members. | Tables: region -> Region_ID, Region_name, Date, Label, Format, Catalogue. party -> Party_ID, Minister, Took_office, Left_office, Region_ID, Party_name. member -> Member_ID, Member_Name, Party_ID, In_office. party_events -> Event_ID, Event_Name, Party_ID, M...
return the name of the party with the most members.
party_people
select t1.party_name , t2.region_name from party as t1 join region as t2 on t1.region_id = t2.region_id
Question: show all party names and their region names. | Tables: region -> Region_ID, Region_name, Date, Label, Format, Catalogue. party -> Party_ID, Minister, Took_office, Left_office, Region_ID, Party_name. member -> Member_ID, Member_Name, Party_ID, In_office. party_events -> Event_ID, Event_Name, Party_ID, Member_i...
show all party names and their region names.
party_people
select t1.party_name , t2.region_name from party as t1 join region as t2 on t1.region_id = t2.region_id
Question: what are the names of parties and their respective regions? | Tables: region -> Region_ID, Region_name, Date, Label, Format, Catalogue. party -> Party_ID, Minister, Took_office, Left_office, Region_ID, Party_name. member -> Member_ID, Member_Name, Party_ID, In_office. party_events -> Event_ID, Event_Name, Par...
what are the names of parties and their respective regions?
party_people
select party_name from party where party_id not in (select party_id from member)
Question: show names of parties that does not have any members. | Tables: region -> Region_ID, Region_name, Date, Label, Format, Catalogue. party -> Party_ID, Minister, Took_office, Left_office, Region_ID, Party_name. member -> Member_ID, Member_Name, Party_ID, In_office. party_events -> Event_ID, Event_Name, Party_ID,...
show names of parties that does not have any members.
party_people
select party_name from party where party_id not in (select party_id from member)
Question: what are the names of parties that have no members? | Tables: region -> Region_ID, Region_name, Date, Label, Format, Catalogue. party -> Party_ID, Minister, Took_office, Left_office, Region_ID, Party_name. member -> Member_ID, Member_Name, Party_ID, In_office. party_events -> Event_ID, Event_Name, Party_ID, M...
what are the names of parties that have no members?
party_people
select member_name from member where party_id = 3 intersect select member_name from member where party_id = 1
Question: show the member names which are in both the party with id 3 and the party with id 1. | Tables: region -> Region_ID, Region_name, Date, Label, Format, Catalogue. party -> Party_ID, Minister, Took_office, Left_office, Region_ID, Party_name. member -> Member_ID, Member_Name, Party_ID, In_office. party_events -> ...
show the member names which are in both the party with id 3 and the party with id 1.
party_people
select member_name from member where party_id = 3 intersect select member_name from member where party_id = 1
Question: which member names are shared among members in the party with the id 3 and the party with the id 1? | Tables: region -> Region_ID, Region_name, Date, Label, Format, Catalogue. party -> Party_ID, Minister, Took_office, Left_office, Region_ID, Party_name. member -> Member_ID, Member_Name, Party_ID, In_office. p...
which member names are shared among members in the party with the id 3 and the party with the id 1?
party_people
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'
Question: show member names that are not in the progress party. | Tables: region -> Region_ID, Region_name, Date, Label, Format, Catalogue. party -> Party_ID, Minister, Took_office, Left_office, Region_ID, Party_name. member -> Member_ID, Member_Name, Party_ID, In_office. party_events -> Event_ID, Event_Name, Party_ID,...
show member names that are not in the progress party.
party_people
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'
Question: which member names corresponding to members who are not in the progress party? | Tables: region -> Region_ID, Region_name, Date, Label, Format, Catalogue. party -> Party_ID, Minister, Took_office, Left_office, Region_ID, Party_name. member -> Member_ID, Member_Name, Party_ID, In_office. party_events -> Event_...
which member names corresponding to members who are not in the progress party?
party_people
select count(*) from party_events
Question: how many party events do we have? | Tables: region -> Region_ID, Region_name, Date, Label, Format, Catalogue. party -> Party_ID, Minister, Took_office, Left_office, Region_ID, Party_name. member -> Member_ID, Member_Name, Party_ID, In_office. party_events -> Event_ID, Event_Name, Party_ID, Member_in_charge_ID...
how many party events do we have?
party_people
select count(*) from party_events
Question: count the number of party events. | Tables: region -> Region_ID, Region_name, Date, Label, Format, Catalogue. party -> Party_ID, Minister, Took_office, Left_office, Region_ID, Party_name. member -> Member_ID, Member_Name, Party_ID, In_office. party_events -> Event_ID, Event_Name, Party_ID, Member_in_charge_ID...
count the number of party events.
party_people
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
Question: show party names and the number of events for each party. | Tables: region -> Region_ID, Region_name, Date, Label, Format, Catalogue. party -> Party_ID, Minister, Took_office, Left_office, Region_ID, Party_name. member -> Member_ID, Member_Name, Party_ID, In_office. party_events -> Event_ID, Event_Name, Party...
show party names and the number of events for each party.
party_people
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
Question: how many events are there for each party? | Tables: region -> Region_ID, Region_name, Date, Label, Format, Catalogue. party -> Party_ID, Minister, Took_office, Left_office, Region_ID, Party_name. member -> Member_ID, Member_Name, Party_ID, In_office. party_events -> Event_ID, Event_Name, Party_ID, Member_in_c...
how many events are there for each party?
party_people
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
Question: show all member names who are not in charge of any event. | Tables: region -> Region_ID, Region_name, Date, Label, Format, Catalogue. party -> Party_ID, Minister, Took_office, Left_office, Region_ID, Party_name. member -> Member_ID, Member_Name, Party_ID, In_office. party_events -> Event_ID, Event_Name, Party...
show all member names who are not in charge of any event.
party_people
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
Question: what are the names of members who are not in charge of any events? | Tables: region -> Region_ID, Region_name, Date, Label, Format, Catalogue. party -> Party_ID, Minister, Took_office, Left_office, Region_ID, Party_name. member -> Member_ID, Member_Name, Party_ID, In_office. party_events -> Event_ID, Event_Na...
what are the names of members who are not in charge of any events?
party_people
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
Question: what are the names of parties with at least 2 events? | Tables: region -> Region_ID, Region_name, Date, Label, Format, Catalogue. party -> Party_ID, Minister, Took_office, Left_office, Region_ID, Party_name. member -> Member_ID, Member_Name, Party_ID, In_office. party_events -> Event_ID, Event_Name, Party_ID,...
what are the names of parties with at least 2 events?
party_people
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
Question: return the names of parties that have two or more events. | Tables: region -> Region_ID, Region_name, Date, Label, Format, Catalogue. party -> Party_ID, Minister, Took_office, Left_office, Region_ID, Party_name. member -> Member_ID, Member_Name, Party_ID, In_office. party_events -> Event_ID, Event_Name, Party...
return the names of parties that have two or more events.
party_people
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
Question: what is the name of member in charge of greatest number of events? | Tables: region -> Region_ID, Region_name, Date, Label, Format, Catalogue. party -> Party_ID, Minister, Took_office, Left_office, Region_ID, Party_name. member -> Member_ID, Member_Name, Party_ID, In_office. party_events -> Event_ID, Event_Na...
what is the name of member in charge of greatest number of events?
party_people
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
Question: return the name of the member who is in charge of the most events. | Tables: region -> Region_ID, Region_name, Date, Label, Format, Catalogue. party -> Party_ID, Minister, Took_office, Left_office, Region_ID, Party_name. member -> Member_ID, Member_Name, Party_ID, In_office. party_events -> Event_ID, Event_Na...
return the name of the member who is in charge of the most events.
party_people
select event_name from party_events group by event_name having count(*) > 2
Question: find the event names that have more than 2 records. | Tables: region -> Region_ID, Region_name, Date, Label, Format, Catalogue. party -> Party_ID, Minister, Took_office, Left_office, Region_ID, Party_name. member -> Member_ID, Member_Name, Party_ID, In_office. party_events -> Event_ID, Event_Name, Party_ID, M...
find the event names that have more than 2 records.
party_people
select event_name from party_events group by event_name having count(*) > 2
Question: which event names were used more than twice for party events? | Tables: region -> Region_ID, Region_name, Date, Label, Format, Catalogue. party -> Party_ID, Minister, Took_office, Left_office, Region_ID, Party_name. member -> Member_ID, Member_Name, Party_ID, In_office. party_events -> Event_ID, Event_Name, P...
which event names were used more than twice for party events?
party_people
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'
Question: how many annual meeting events happened in the united kingdom region? | Tables: region -> Region_ID, Region_name, Date, Label, Format, Catalogue. party -> Party_ID, Minister, Took_office, Left_office, Region_ID, Party_name. member -> Member_ID, Member_Name, Party_ID, In_office. party_events -> Event_ID, Event...
how many annual meeting events happened in the united kingdom region?
party_people
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'
Question: count the number of annual meeting events that took place in the region of the united kingdom. | Tables: region -> Region_ID, Region_name, Date, Label, Format, Catalogue. party -> Party_ID, Minister, Took_office, Left_office, Region_ID, Party_name. member -> Member_ID, Member_Name, Party_ID, In_office. party_...
count the number of annual meeting events that took place in the region of the united kingdom.
pilot_record
select count(*) from pilot
Question: how many pilots are there? | Tables: aircraft -> Aircraft_ID, Order_Year, Manufacturer, Model, Fleet_Series, Powertrain, Fuel_Propulsion. pilot -> Pilot_ID, Pilot_name, Rank, Age, Nationality, Position, Join_Year, Team. pilot_record -> Record_ID, Pilot_ID, Aircraft_ID, Date. | Joins: pilot_record.Aircraft_ID ...
how many pilots are there?
pilot_record
select pilot_name from pilot order by rank asc
Question: list the names of pilots in ascending order of rank. | Tables: aircraft -> Aircraft_ID, Order_Year, Manufacturer, Model, Fleet_Series, Powertrain, Fuel_Propulsion. pilot -> Pilot_ID, Pilot_name, Rank, Age, Nationality, Position, Join_Year, Team. pilot_record -> Record_ID, Pilot_ID, Aircraft_ID, Date. | Joins:...
list the names of pilots in ascending order of rank.
pilot_record
select position , team from pilot
Question: what are the positions and teams of pilots? | Tables: aircraft -> Aircraft_ID, Order_Year, Manufacturer, Model, Fleet_Series, Powertrain, Fuel_Propulsion. pilot -> Pilot_ID, Pilot_name, Rank, Age, Nationality, Position, Join_Year, Team. pilot_record -> Record_ID, Pilot_ID, Aircraft_ID, Date. | Joins: pilot_re...
what are the positions and teams of pilots?
pilot_record
select distinct position from pilot where age > 30
Question: list the distinct positions of pilots older than 30. | Tables: aircraft -> Aircraft_ID, Order_Year, Manufacturer, Model, Fleet_Series, Powertrain, Fuel_Propulsion. pilot -> Pilot_ID, Pilot_name, Rank, Age, Nationality, Position, Join_Year, Team. pilot_record -> Record_ID, Pilot_ID, Aircraft_ID, Date. | Joins:...
list the distinct positions of pilots older than 30.
pilot_record
select pilot_name from pilot where team = 'bradley' or team = 'fordham'
Question: show the names of pilots from team 'bradley' or 'fordham'. | Tables: aircraft -> Aircraft_ID, Order_Year, Manufacturer, Model, Fleet_Series, Powertrain, Fuel_Propulsion. pilot -> Pilot_ID, Pilot_name, Rank, Age, Nationality, Position, Join_Year, Team. pilot_record -> Record_ID, Pilot_ID, Aircraft_ID, Date. | ...
show the names of pilots from team 'bradley' or 'fordham'.
pilot_record
select join_year from pilot order by rank asc limit 1
Question: what is the joined year of the pilot of the highest rank? | Tables: aircraft -> Aircraft_ID, Order_Year, Manufacturer, Model, Fleet_Series, Powertrain, Fuel_Propulsion. pilot -> Pilot_ID, Pilot_name, Rank, Age, Nationality, Position, Join_Year, Team. pilot_record -> Record_ID, Pilot_ID, Aircraft_ID, Date. | J...
what is the joined year of the pilot of the highest rank?
pilot_record
select nationality , count(*) from pilot group by nationality
Question: what are the different nationalities of pilots? show each nationality and the number of pilots of each nationality. | Tables: aircraft -> Aircraft_ID, Order_Year, Manufacturer, Model, Fleet_Series, Powertrain, Fuel_Propulsion. pilot -> Pilot_ID, Pilot_name, Rank, Age, Nationality, Position, Join_Year, Team. p...
what are the different nationalities of pilots? show each nationality and the number of pilots of each nationality.
pilot_record
select nationality from pilot group by nationality order by count(*) desc limit 1
Question: show the most common nationality of pilots. | Tables: aircraft -> Aircraft_ID, Order_Year, Manufacturer, Model, Fleet_Series, Powertrain, Fuel_Propulsion. pilot -> Pilot_ID, Pilot_name, Rank, Age, Nationality, Position, Join_Year, Team. pilot_record -> Record_ID, Pilot_ID, Aircraft_ID, Date. | Joins: pilot_re...
show the most common nationality of pilots.
pilot_record
select position from pilot where join_year < 2000 intersect select position from pilot where join_year > 2005
Question: show the pilot positions that have both pilots joining after year 2005 and pilots joining before 2000. | Tables: aircraft -> Aircraft_ID, Order_Year, Manufacturer, Model, Fleet_Series, Powertrain, Fuel_Propulsion. pilot -> Pilot_ID, Pilot_name, Rank, Age, Nationality, Position, Join_Year, Team. pilot_record -...
show the pilot positions that have both pilots joining after year 2005 and pilots joining before 2000.
pilot_record
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
Question: show the names of pilots and models of aircrafts they have flied with. | Tables: aircraft -> Aircraft_ID, Order_Year, Manufacturer, Model, Fleet_Series, Powertrain, Fuel_Propulsion. pilot -> Pilot_ID, Pilot_name, Rank, Age, Nationality, Position, Join_Year, Team. pilot_record -> Record_ID, Pilot_ID, Aircraft_...
show the names of pilots and models of aircrafts they have flied with.
pilot_record
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
Question: show the names of pilots and fleet series of the aircrafts they have flied with in ascending order of the rank of the pilot. | Tables: aircraft -> Aircraft_ID, Order_Year, Manufacturer, Model, Fleet_Series, Powertrain, Fuel_Propulsion. pilot -> Pilot_ID, Pilot_name, Rank, Age, Nationality, Position, Join_Year...
show the names of pilots and fleet series of the aircrafts they have flied with in ascending order of the rank of the pilot.
pilot_record
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
Question: show the fleet series of the aircrafts flied by pilots younger than 34 | Tables: aircraft -> Aircraft_ID, Order_Year, Manufacturer, Model, Fleet_Series, Powertrain, Fuel_Propulsion. pilot -> Pilot_ID, Pilot_name, Rank, Age, Nationality, Position, Join_Year, Team. pilot_record -> Record_ID, Pilot_ID, Aircraft_...
show the fleet series of the aircrafts flied by pilots younger than 34
pilot_record
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
Question: show the names of pilots and the number of records they have. | Tables: aircraft -> Aircraft_ID, Order_Year, Manufacturer, Model, Fleet_Series, Powertrain, Fuel_Propulsion. pilot -> Pilot_ID, Pilot_name, Rank, Age, Nationality, Position, Join_Year, Team. pilot_record -> Record_ID, Pilot_ID, Aircraft_ID, Date....
show the names of pilots and the number of records they have.
pilot_record
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
Question: show names of pilots that have more than one record. | Tables: aircraft -> Aircraft_ID, Order_Year, Manufacturer, Model, Fleet_Series, Powertrain, Fuel_Propulsion. pilot -> Pilot_ID, Pilot_name, Rank, Age, Nationality, Position, Join_Year, Team. pilot_record -> Record_ID, Pilot_ID, Aircraft_ID, Date. | Joins:...
show names of pilots that have more than one record.
pilot_record
select pilot_name from pilot where pilot_id not in (select pilot_id from pilot_record)
Question: list the names of pilots that do not have any record. | Tables: aircraft -> Aircraft_ID, Order_Year, Manufacturer, Model, Fleet_Series, Powertrain, Fuel_Propulsion. pilot -> Pilot_ID, Pilot_name, Rank, Age, Nationality, Position, Join_Year, Team. pilot_record -> Record_ID, Pilot_ID, Aircraft_ID, Date. | Joins...
list the names of pilots that do not have any record.
cre_Doc_Control_Systems
select document_status_code from ref_document_status;
Question: what document status codes do we have? | Tables: Ref_Document_Types -> document_type_code, document_type_description. Roles -> role_code, role_description. Addresses -> address_id, address_details. Ref_Document_Status -> document_status_code, document_status_description. Ref_Shipping_Agents -> shipping_agent_...
what document status codes do we have?
cre_Doc_Control_Systems
select document_status_description from ref_document_status where document_status_code = 'working';
Question: what is the description of document status code 'working'? | Tables: Ref_Document_Types -> document_type_code, document_type_description. Roles -> role_code, role_description. Addresses -> address_id, address_details. Ref_Document_Status -> document_status_code, document_status_description. Ref_Shipping_Agent...
what is the description of document status code 'working'?