aherntech/sparc huggingface dataset:
Database: flight_1
Question sequence:
Show the name for all aircraft.
Which one of them is being taken on flight 99?
SQL query sequence:
SELECT name FROM Aircraft
SELECT T2.name FROM Flight AS T1 JOIN Aircraft AS T2 ON T1.aid  =  T2.aid WHERE T1.flno  =  99
Final question: What is the aircraft name for the flight with number 99
Final SQL: SELECT T2.name FROM Flight AS T1 JOIN Aircraft AS T2 ON T1.aid  =  T2.aid WHERE T1.flno  =  99
Database: flight_1
Question sequence:
Show all flight numbers.
Which of them are on aircraft Airbus A340-300?
SQL query sequence:
SELECT flno FROM Flight
SELECT T1.flno FROM Flight AS T1 JOIN Aircraft AS T2 ON T1.aid  =  T2.aid WHERE T2.name  =  "Airbus A340-300"
Final question: Show all flight numbers with aircraft Airbus A340-300.
Final SQL: SELECT T1.flno FROM Flight AS T1 JOIN Aircraft AS T2 ON T1.aid  =  T2.aid WHERE T2.name  =  "Airbus A340-300"
Database: flight_1
Question sequence:
Show the name for all aircraft.
For each of them, count the number of flights.
SQL query sequence:
Select name from Aircraft
SELECT T2.name ,  count(*) FROM Flight AS T1 JOIN Aircraft AS T2 ON T1.aid  =  T2.aid GROUP BY T1.aid
Final question: Show aircraft names and number of flights for each aircraft.
Final SQL: SELECT T2.name ,  count(*) FROM Flight AS T1 JOIN Aircraft AS T2 ON T1.aid  =  T2.aid GROUP BY T1.aid
Database: flight_1
Question sequence:
Show names for all aircraft.
For each of them, also show the number of flights.
Which two have the fewest?
SQL query sequence:
SELECT name FROM Aircraft
SELECT T2.name, count(*) FROM Flight AS T1 JOIN Aircraft AS T2 ON T1.aid  =  T2.aid GROUP BY T1.aid
SELECT T2.name FROM Flight AS T1 JOIN Aircraft AS T2 ON T1.aid  =  T2.aid GROUP BY T1.aid HAVING count(*)  >= 2
Final question: Show names for all aircraft with at least two flights.
Final SQL: SELECT T2.name FROM Flight AS T1 JOIN Aircraft AS T2 ON T1.aid  =  T2.aid GROUP BY T1.aid HAVING count(*)  >= 2
Database: flight_1
Question sequence:
Show employee ids for all certificates.
What are the distinct ids among them?
How many are there?
SQL query sequence:
select eid FROM Certificate
SELECT DISTINCT eid FROM Certificate
SELECT count(DISTINCT eid) FROM Certificate
Final question: How many employees have certificate.
Final SQL: SELECT count(DISTINCT eid) FROM Certificate
Database: flight_1
Question sequence:
Show the employee ids with a certificate.
Show the employee ids without any.
SQL query sequence:
SELECT eid FROM Certificate
SELECT eid FROM Employee EXCEPT SELECT eid FROM Certificate
Final question: Show ids for all employees who do not have a certificate.
Final SQL: SELECT eid FROM Employee EXCEPT SELECT eid FROM Certificate
Database: flight_1
Question sequence:
Show the name for all aircraft.
For each, also show the names of employees with a certificate on it.
What are the names of aircraft of which John Williams has certificates?
SQL query sequence:
SELECT name FROM Aircraft
SELECT T3.name, T1.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid  =  T2.eid JOIN Aircraft AS T3 ON T3.aid  =  T2.aid
SELECT T3.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid  =  T2.eid JOIN Aircraft AS T3 ON T3.aid  =  T2.aid WHERE T1.name  =  "John Williams"
Final question: Show names for all aircrafts of which John Williams has certificates.
Final SQL: SELECT T3.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid  =  T2.eid JOIN Aircraft AS T3 ON T3.aid  =  T2.aid WHERE T1.name  =  "John Williams"
Database: flight_1
Question sequence:
Show names for all employees.
Also show the name of aircraft on which they have a certificate.
Which of those employees have certificate of Boeing 737-800?
SQL query sequence:
SELECT name FROM Employee
SELECT T1.name, T3.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid  =  T2.eid JOIN Aircraft AS T3 ON T3.aid  =  T2.aid
SELECT T1.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid  =  T2.eid JOIN Aircraft AS T3 ON T3.aid  =  T2.aid WHERE T3.name  =  "Boeing 737-800"
Final question: Show names for all employees who have certificate of Boeing 737-800.
Final SQL: SELECT T1.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid  =  T2.eid JOIN Aircraft AS T3 ON T3.aid  =  T2.aid WHERE T3.name  =  "Boeing 737-800"
Database: flight_1
Question sequence:
Show names for all employees.
Which of those have certificates on Boeing 737-800?
How about those with certificates on Airbus A340-300?
Who have both?
SQL query sequence:
SELECT name FROM Employee
SELECT T1.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid  =  T2.eid JOIN Aircraft AS T3 ON T3.aid  =  T2.aid WHERE T3.name  =  "Boeing 737-800"
SELECT T1.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid  =  T2.eid JOIN Aircraft AS T3 ON T3.aid  =  T2.aid WHERE T3.name  =  "Airbus A340-300"
SELECT T1.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid  =  T2.eid JOIN Aircraft AS T3 ON T3.aid  =  T2.aid WHERE T3.name  =  "Boeing 737-800" INTERSECT SELECT T1.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid  =  T2.eid JOIN Aircraft AS T3 ON T3.aid  =  T2.aid WHERE T3.name  =  "Airbus A340-300"
Final question: Show names for all employees who have certificates on both Boeing 737-800 and Airbus A340-300.
Final SQL: SELECT T1.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid  =  T2.eid JOIN Aircraft AS T3 ON T3.aid  =  T2.aid WHERE T3.name  =  "Boeing 737-800" INTERSECT SELECT T1.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid  =  T2.eid JOIN Aircraft AS T3 ON T3.aid  =  T2.aid WHERE T3.name  =  "Airbus A340-300"
Database: flight_1
Question sequence:
Show the names of employees with a certificate.
Which of them have a certificate on Boeing 737-800?
Show the names for all employees without this particular certificate.
SQL query sequence:
SELECT T1.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid  =  T2.eid
SELECT T1.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid  =  T2.eid JOIN Aircraft AS T3 ON T3.aid  =  T2.aid WHERE T3.name  =  "Boeing 737-800"
SELECT name FROM Employee EXCEPT SELECT T1.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid  =  T2.eid JOIN Aircraft AS T3 ON T3.aid  =  T2.aid WHERE T3.name  =  "Boeing 737-800"
Final question: Show names for all employees who do not have certificate of Boeing 737-800.
Final SQL: SELECT name FROM Employee EXCEPT SELECT T1.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid  =  T2.eid JOIN Aircraft AS T3 ON T3.aid  =  T2.aid WHERE T3.name  =  "Boeing 737-800"
Database: flight_1
Question sequence:
Show the name of all aircrafts.
Also show the number of people with a certificate on each one.
Order the aircraft by these counts.
Which of them has the fewest?
SQL query sequence:
select name from Aircraft
SELECT T2.name, count(*) FROM Certificate AS T1 JOIN Aircraft AS T2 ON T2.aid  =  T1.aid GROUP BY T1.aid
SELECT T2.name FROM Certificate AS T1 JOIN Aircraft AS T2 ON T2.aid  =  T1.aid GROUP BY T1.aid ORDER BY count(*)
SELECT T2.name FROM Certificate AS T1 JOIN Aircraft AS T2 ON T2.aid  =  T1.aid GROUP BY T1.aid ORDER BY count(*) LIMIT 1
Final question: Show the name of aircraft which fewest people have its certificate.
Final SQL: SELECT T2.name FROM Certificate AS T1 JOIN Aircraft AS T2 ON T2.aid  =  T1.aid GROUP BY T1.aid ORDER BY count(*) LIMIT 1
Database: flight_1
Question sequence:
Show the name and distance of the aircrafts.
How about those with a distance longer than 5000?
Which also have at least 5 people with the certificate?
SQL query sequence:
SELECT name, distance FROM Aircraft
SELECT name, distance FROM Aircraft WHERE distance  >  5000
SELECT T2.name, T2.distance FROM Certificate AS T1 JOIN Aircraft AS T2 ON T2.aid  =  T1.aid WHERE T2.distance  >  5000 GROUP BY T1.aid ORDER BY count(*)  >=  5
Final question: Show the name and distance of the aircrafts with more than 5000 distance and which at least 5 people have its certificate.
Final SQL: SELECT T2.name, T2.distance FROM Certificate AS T1 JOIN Aircraft AS T2 ON T2.aid  =  T1.aid WHERE T2.distance  >  5000 GROUP BY T1.aid ORDER BY count(*)  >=  5
Database: flight_1
Question sequence:
Show the employee names with their corresponding counts of aircraft certificates.
Order the employees by these counts.
Who has the most certificates?
what is the name and salary of this employee?
SQL query sequence:
select T1.name, count(*) FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid  =  T2.eid GROUP BY T1.eid
select T1.name, count(*) FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid  =  T2.eid GROUP BY T1.eid ORDER BY count(*)
select T1.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid  =  T2.eid GROUP BY T1.eid ORDER BY count(*) DESC LIMIT 1
SELECT T1.name ,  T1.salary FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid  =  T2.eid GROUP BY T1.eid ORDER BY count(*) DESC LIMIT 1
Final question: what is the salary and name of the employee who has the most number of aircraft certificates?
Final SQL: SELECT T1.name ,  T1.salary FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid  =  T2.eid GROUP BY T1.eid ORDER BY count(*) DESC LIMIT 1
Database: party_people
Question sequence:
Show me a list of party ministers.
Which ones took office between 1959 and 1961?
How about the others except those?
SQL query sequence:
SELECT minister FROM party
SELECT minister FROM party WHERE took_office  >=  1959 AND took_office  <=  1961
SELECT minister FROM party WHERE took_office  >  1961 OR took_office  <  1959
Final question: Show the minister who took office after 1961 or before 1959.
Final SQL: SELECT minister FROM party WHERE took_office  >  1961 OR took_office  <  1959
Database: party_people
Question sequence:
Who are all the ministers?
When did they each start?
When did they each leave?
Who left most recently?
SQL query sequence:
SELECT minister FROM party
SELECT minister, took_office FROM party
SELECT minister, left_office FROM party
SELECT minister FROM party ORDER BY left_office DESC LIMIT 1
Final question: Return the minister who left office at the latest time.
Final SQL: SELECT minister FROM party ORDER BY left_office DESC LIMIT 1
Database: party_people
Question sequence:
What are all the party names?
Show me all the members each have.
How many does each party have?
SQL query sequence:
SELECT party_name FROM party
SELECT * FROM Member AS T1 JOIN party AS T2 ON T1.party_id  =  T2.party_id
SELECT T2.party_name, count(*) FROM Member AS T1 JOIN party AS T2 ON T1.party_id  =  T2.party_id group by party_name
Final question: Show all party names and the number of members in each party.
Final SQL: 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
Database: party_people
Question sequence:
What about the least number?
How about the max?
What is the name of the party that has this number per party?
SQL query sequence:
SELECT count(*) FROM Member AS T1 JOIN party AS T2 ON T1.party_id  =  T2.party_id GROUP BY T1.party_id ORDER BY count(*) ASC LIMIT 1
SELECT count(*) 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
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
Final question: What is the name of party with most number of members?
Final SQL: 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
Database: party_people
Question sequence:
What are the names of all parties?
How many have no members?
Which ones?
SQL query sequence:
SELECT party_name FROM party
SELECT count(*) FROM party WHERE party_id NOT IN (SELECT party_id FROM Member)
SELECT party_name FROM party WHERE party_id NOT IN (SELECT party_id FROM Member)
Final question: Show names of parties that does not have any members.
Final SQL: SELECT party_name FROM party WHERE party_id NOT IN (SELECT party_id FROM Member)
Database: party_people
Question sequence:
What are all the member names?
Which ones are in party with id 1?
How about in party with id 3?
Can you show me those in both?
SQL query sequence:
SELECT member_name FROM member
SELECT member_name FROM member WHERE party_id  =  1
SELECT member_name FROM member WHERE party_id  =  3
SELECT member_name FROM member WHERE party_id  =  3 INTERSECT SELECT member_name FROM member WHERE party_id  =  1
Final question: Show the member names which are in both the party with id 3 and the party with id 1.
Final SQL: SELECT member_name FROM member WHERE party_id  =  3 INTERSECT SELECT member_name FROM member WHERE party_id  =  1
Database: party_people
Question sequence:
How many members are there?
How many are in the Progressive party?
How many are not?
What are their names?
SQL query sequence:
SELECT count(*) FROM member
SELECT count(*) FROM Member AS T1 JOIN party AS T2 ON T1.party_id  =  T2.party_id WHERE T2.Party_name = "Progress Party"
SELECT count(*) FROM Member AS T1 JOIN party AS T2 ON T1.party_id  =  T2.party_id WHERE T2.Party_name != "Progress Party"
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"
Final question: Show member names that are not in the Progress Party.
Final SQL: 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"
Database: party_people
Question sequence:
What are the names and ids of all the party events?
What parties are each event affiliated with?
Just show me a distinct list of the names these parties.
Also show how many events each of them!
SQL query sequence:
SELECT event_id, event_name FROM party_events
SELECT event_id, event_name, party_id FROM party_events
SELECT distinct T2.party_name FROM party_events AS T1 JOIN party AS T2 ON T1.party_id  =  T2.party_id
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
Final question: Show party names and the number of events for each party.
Final SQL: 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
Database: party_people
Question sequence:
Show me all the information for all the party events?
Also show all the distinct member information of those in charge of them?
Now just show me the distinct members information for all the members other than those?
Just show me their names!
SQL query sequence:
SELECT * FROM party_events
SELECT * FROM member AS T1 JOIN party_events AS T2 ON T1.member_id  =  T2.member_in_charge_id
SELECT * FROM member EXCEPT SELECT * FROM member AS T1 JOIN party_events AS T2 ON T1.member_id  =  T2.member_in_charge_id
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
Final question: Show all member names who are not in charge of any event.
Final SQL: 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
Database: party_people
Question sequence:
What parties do not host any events?
Which ones host at least one event?
How about 2?
Show just the names of these!
SQL query sequence:
SELECT * FROM party except SELECT * FROM party_events AS T1 JOIN party AS T2 ON T1.party_id  =  T2.party_id
SELECT distinct * FROM party_events AS T1 JOIN party AS T2 ON T1.party_id  =  T2.party_id
SELECT * FROM party_events AS T1 JOIN party AS T2 ON T1.party_id  =  T2.party_id GROUP BY T1.party_id HAVING count(*)  >=  2
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
Final question: What are the names of parties with at least 2 events?
Final SQL: 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
Database: party_people
Question sequence:
How many different member in charges are there for all party_events?
What are their names?
How many events are they each in charge of?
Who has the greatest number?
SQL query sequence:
SELECT count(distinct member_in_charge_id) FROM party_events
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
SELECT T1.member_name, count(*) 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
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
Final question: What is the name of member in charge of greatest number of events?
Final SQL: 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
Database: party_people
Question sequence:
Show me all the event ids, event names and party id for each party_event.
How events are there for every party?
How about for every event name?
Which event names have at least 2?
SQL query sequence:
SELECT event_id, event_name, party_id FROM party_events
SELECT party_id, count(*) FROM party_events GROUP BY party_id
SELECT event_name, count(*) FROM party_events GROUP BY event_name
SELECT event_name FROM party_events GROUP BY event_name HAVING count(*)  >  2
Final question: find the event names that have more than 2 records.
Final SQL: SELECT event_name FROM party_events GROUP BY event_name HAVING count(*)  >  2
Database: architecture
Question sequence:
List the names and nationalities of all architects.
Include their ids as well.
Only include architects who are male.
List the names alphabetically.
SQL query sequence:
SELECT name, nationality FROM architect
SELECT name, nationality, id FROM architect
SELECT name, nationality, id FROM architect WHERE gender = "male"
SELECT name, nationality, id FROM architect WHERE gender = "male" ORDER BY name
Final question: List the name, nationality and id of all male architects ordered by their names lexicographically.
Final SQL: SELECT name ,  nationality ,  id FROM architect WHERE gender  =  'male' ORDER BY name
Database: architecture
Question sequence:
What are the different types of mills?
Which ones were built by American architects?
Include those built by Canadian architects as well.
SQL query sequence:
SELECT DISTINCT type FROM mill
SELECT DISTINCT T1.type FROM mill AS T1 JOIN architect AS t2 ON T1.architect_id  =  T2.id WHERE T2.nationality  =  'American'
SELECT DISTINCT T1.type FROM mill AS T1 JOIN architect AS t2 ON T1.architect_id  =  T2.id WHERE T2.nationality  =  'American' OR T2.nationality  =  'Canadian'
Final question: What are the distinct types of mills that are built by American or Canadian architects?
Final SQL: SELECT DISTINCT T1.type FROM mill AS T1 JOIN architect AS t2 ON T1.architect_id  =  T2.id WHERE T2.nationality  =  'American' OR T2.nationality  =  'Canadian'
Database: architecture
Question sequence:
What are the ids and names of all architects?
How many of those architects built less than 3 bridges?
How many built 3 or more bridges?
Please list their ids and names.
SQL query sequence:
SELECT id, name FROM architect
SELECT count(*) FROM (SELECT T1.id ,  T1.name FROM architect AS T1 JOIN bridge AS T2 ON T1.id  =  T2.architect_id GROUP BY T1.id HAVING count(*)  <  3)
SELECT count(*) FROM (SELECT T1.id ,  T1.name FROM architect AS T1 JOIN bridge AS T2 ON T1.id  =  T2.architect_id GROUP BY T1.id HAVING count(*)  >=  3)
SELECT T1.id ,  T1.name FROM architect AS T1 JOIN bridge AS T2 ON T1.id  =  T2.architect_id GROUP BY T1.id HAVING count(*)  >=  3
Final question: What are the ids and names of the architects who built at least 3 bridges ?
Final SQL: SELECT T1.id ,  T1.name FROM architect AS T1 JOIN bridge AS T2 ON T1.id  =  T2.architect_id GROUP BY T1.id HAVING count(*)  >=  3
Database: architecture
Question sequence:
How many mills did each architect build?
Order by decreasing number of mills built.
Which architect built the most mills?
Please list his id and nationality as well.
SQL query sequence:
SELECT T1.name , count(*) FROM architect AS T1 JOIN mill AS T2 ON T1.id  =  T2.architect_id GROUP BY T1.id ORDER BY count(*)
SELECT T1.name , count(*) FROM architect AS T1 JOIN mill AS T2 ON T1.id  =  T2.architect_id GROUP BY T1.id ORDER BY count(*) DESC
SELECT T1.name FROM architect AS T1 JOIN mill AS T2 ON T1.id  =  T2.architect_id GROUP BY T1.id ORDER BY count(*) DESC LIMIT 1
SELECT T1.id ,  T1.name ,  T1.nationality FROM architect AS T1 JOIN mill AS T2 ON T1.id  =  T2.architect_id GROUP BY T1.id ORDER BY count(*) DESC LIMIT 1
Final question: What is the id, name and nationality of the architect who built most mills?
Final SQL: SELECT T1.id ,  T1.name ,  T1.nationality FROM architect AS T1 JOIN mill AS T2 ON T1.id  =  T2.architect_id GROUP BY T1.id ORDER BY count(*) DESC LIMIT 1
Database: architecture
Question sequence:
List the names of architects who built 2 bridges.
Include architects who built 1 mill.
Include their ids and genders as well.
SQL query sequence:
SELECT T1.name FROM architect AS T1 JOIN bridge AS T2 ON T1.id  =  T2.architect_id GROUP BY T1.id HAVING count(*)  =  2
SELECT T1.name FROM architect AS T1 JOIN bridge AS T2 ON T1.id  =  T2.architect_id GROUP BY T1.id HAVING count(*)  =  2 UNION SELECT T1.name FROM architect AS T1 JOIN mill AS T2 ON T1.id  =  T2.architect_id GROUP BY T1.id HAVING count(*)  =  1
SELECT T1.id ,  T1.name ,  T1.gender FROM architect AS T1 JOIN bridge AS T2 ON T1.id  =  T2.architect_id GROUP BY T1.id HAVING count(*)  =  2 UNION SELECT T1.id ,  T1.name ,  T1.gender FROM architect AS T1 JOIN mill AS T2 ON T1.id  =  T2.architect_id GROUP BY T1.id HAVING count(*)  =  1
Final question: What are the ids, names and genders of the architects who built two bridges or one mill?
Final SQL: SELECT T1.id ,  T1.name ,  T1.gender FROM architect AS T1 JOIN bridge AS T2 ON T1.id  =  T2.architect_id GROUP BY T1.id HAVING count(*)  =  2 UNION SELECT T1.id ,  T1.name ,  T1.gender FROM architect AS T1 JOIN mill AS T2 ON T1.id  =  T2.architect_id GROUP BY T1.id HAVING count(*)  =  1
Database: architecture
Question sequence:
List the locations of all bridges.
Where is the bridge named ‘Kolob Arch’ located?
Include the location of the bridge named ‘Rainbow Bridge’.
SQL query sequence:
SELECT DISTINCT LOCATION FROM bridge
SELECT LOCATION FROM bridge WHERE name  =  'Kolob Arch'
SELECT LOCATION FROM bridge WHERE name  =  'Kolob Arch' OR name  =  'Rainbow Bridge'
Final question: What is the location of the bridge named 'Kolob Arch' or 'Rainbow Bridge'?
Final SQL: SELECT LOCATION FROM bridge WHERE name  =  'Kolob Arch' OR name  =  'Rainbow Bridge'
Database: architecture
Question sequence:
List all of the mill names.
Just show mill names that contain the word ‘Moulin’.
SQL query sequence:
SELECT name FROM mill
SELECT name FROM mill WHERE name LIKE '%Moulin%'
Final question: Which of the mill names contains the french word 'Moulin'?
Final SQL: SELECT name FROM mill WHERE name LIKE '%Moulin%'
Database: architecture
Question sequence:
Which architects have built bridges?
Which of them have built bridges longer than 80 meters?
How many of those architects have also built mills?
Please list the names of those mills.
SQL query sequence:
SELECT DISTINCT T1.name FROM architect AS T1 JOIN bridge AS T2 ON T1.id  =  T2.architect_id
SELECT DISTINCT T1.name FROM architect AS T1 JOIN bridge AS T2 ON T1.id  =  T2.architect_id WHERE T2.length_meters > 80
SELECT count(DISTINCT T2.name) FROM mill AS T1 JOIN architect AS T2 ON T1.architect_id  =  T2.id JOIN bridge AS T3 ON T3.architect_id  =  T2.id WHERE T3.length_meters  >  80
SELECT DISTINCT T1.name FROM mill AS T1 JOIN architect AS t2 ON T1.architect_id  =  T2.id JOIN bridge AS T3 ON T3.architect_id  =  T2.id WHERE T3.length_meters  >  80
Final question: What are the distinct name of the mills built by the architects who have also built a bridge longer than 80 meters?
Final SQL: SELECT DISTINCT T1.name FROM mill AS T1 JOIN architect AS t2 ON T1.architect_id  =  T2.id JOIN bridge AS T3 ON T3.architect_id  =  T2.id WHERE T3.length_meters  >  80