aherntech/sparc huggingface dataset:
Database: sports_competition
Question sequence:
How many unique competition types are there?
How many competitions are there for each type?
What are the top 3 competition types?
What about the ones that have at most five competitions of that type.
SQL query sequence:
SELECT count (distinct Competition_type) FROM competition
SELECT Competition_type, count(*) FROM competition GROUP BY Competition_type
SELECT Competition_type FROM competition GROUP BY Competition_type ORDER BY COUNT(*) DESC LIMIT 3
SELECT Competition_type FROM competition GROUP BY Competition_type HAVING COUNT(*)  <=  5
Final question: List the types of competition that have at most five competitions of that type.
Final SQL: SELECT Competition_type FROM competition GROUP BY Competition_type HAVING COUNT(*)  <=  5
Database: sports_competition
Question sequence:
What are the club names?
How many of them have at least one player?
Which ones have no players at all?
SQL query sequence:
SELECT name FROM CLub
SELECT count(name) FROM CLub WHERE Club_ID IN (SELECT Club_ID FROM player)
SELECT name FROM CLub WHERE Club_ID NOT IN (SELECT Club_ID FROM player)
Final question: List the names of clubs that do not have any players.
Final SQL: SELECT name FROM CLub WHERE Club_ID NOT IN (SELECT Club_ID FROM player)
Database: sports_competition
Question sequence:
What is the average value of points?
How many players have points less than 20.0?
What are the positions of those players?
What about the positions of those players who have more than 20 points and less than 10 points.
SQL query sequence:
SELECT avg(Points) FROM player
SELECT count(*) FROM player WHERE Points  <  20
SELECT POSITION FROM player WHERE Points  <  20
SELECT POSITION FROM player WHERE Points  >  20 INTERSECT SELECT POSITION FROM player WHERE Points  <  10
Final question: What are the positions with both players having more than 20 points and less than 10 points.
Final SQL: SELECT POSITION FROM player WHERE Points  >  20 INTERSECT SELECT POSITION FROM player WHERE Points  <  10
Database: sports_competition
Question sequence:
What are the maximum and mean values of the points?
What are the player names of those who have more points than the average?
SQL query sequence:
SELECT max(points), avg(points) FROM player
SELECT name FROM player WHERE points  >  (SELECT avg(points) FROM player)
Final question: what are the name of players who get more than the average points.
Final SQL: SELECT name FROM player WHERE points  >  (SELECT avg(points) FROM player)
Database: sports_competition
Question sequence:
What are the minimum and mean values of the points?
What are the player names of those who have fewer points than the average?
How many are there?
How many players are there whose points are lower than 30?
Among those, how many players are there for each position?
SQL query sequence:
SELECT min(points), avg(points) FROM player
SELECT name FROM player WHERE points  <  (SELECT avg(points) FROM player)
SELECT count(*) FROM player WHERE points  <  (SELECT avg(points) FROM player)
SELECT count(*)  FROM player WHERE points  <  30
SELECT count(*) ,  POSITION FROM player WHERE points  <  30 GROUP BY POSITION
Final question: find the number of players whose points are lower than 30 in each position.
Final SQL: SELECT count(*) ,  POSITION FROM player WHERE points  <  30 GROUP BY POSITION
Database: sports_competition
Question sequence:
How many competitions are there where the competition type is 'Friendly'?
What about for the type 'Tournament'?
Among those results, how many competitions are there for each country?
Which one is the most popular country?
SQL query sequence:
SELECT count(*) FROM competition WHERE competition_type  =  'Friendly'
SELECT count(*)  FROM competition WHERE competition_type  =  'Tournament'
SELECT country FROM competition WHERE competition_type  =  'Tournament' GROUP BY country
SELECT country FROM competition WHERE competition_type  =  'Tournament' GROUP BY country ORDER BY count(*) DESC LIMIT 1
Final question: which country did participated in the most number of Tournament competitions?
Final SQL: SELECT country FROM competition WHERE competition_type  =  'Tournament' GROUP BY country ORDER BY count(*) DESC LIMIT 1
Database: sports_competition
Question sequence:
How many competitions are there where the  competition type is 'Friendly'?
Among those results, how many competitions are there for each country?
What about for type 'Tournament'?
Which countries held both types of competitions?
SQL query sequence:
SELECT count(*) FROM competition WHERE competition_type  =  'Friendly'
SELECT country FROM competition WHERE competition_type  =  'Friendly' GROUP BY country
SELECT country FROM competition WHERE competition_type  =  'Tournament' GROUP BY country
SELECT country FROM competition WHERE competition_type  =  'Friendly' INTERSECT SELECT country FROM competition WHERE competition_type  =  'Tournament'
Final question: which countries did participated in both Friendly and Tournament type competitions.
Final SQL: SELECT country FROM competition WHERE competition_type  =  'Friendly' INTERSECT SELECT country FROM competition WHERE competition_type  =  'Tournament'
Database: assets_maintenance
Question sequence:
Which assets have 2 parts? Show me its id and details.
Which assets have less than 2 fault logs? Show me its id and details.
Which assets fulfill both of those conditions? Show me asset id and details.
SQL query sequence:
SELECT T1.asset_id ,  T1.asset_details FROM Assets AS T1 JOIN Asset_Parts AS T2 ON T1.asset_id  =  T2.asset_id GROUP BY T1.asset_id HAVING count(*)  =  2
SELECT T1.asset_id ,  T1.asset_details FROM Assets AS T1 JOIN Fault_Log AS T2 ON T1.asset_id  =  T2.asset_id GROUP BY T1.asset_id HAVING count(*)  <  2
SELECT T1.asset_id ,  T1.asset_details FROM Assets AS T1 JOIN Asset_Parts AS T2 ON T1.asset_id  =  T2.asset_id GROUP BY T1.asset_id HAVING count(*)  =  2 INTERSECT SELECT T1.asset_id ,  T1.asset_details FROM Assets AS T1 JOIN Fault_Log AS T2 ON T1.asset_id  =  T2.asset_id GROUP BY T1.asset_id HAVING count(*)  <  2
Final question: Which assets have 2 parts and have less than 2 fault logs? List the asset id and detail.
Final SQL: SELECT T1.asset_id ,  T1.asset_details FROM Assets AS T1 JOIN Asset_Parts AS T2 ON T1.asset_id  =  T2.asset_id GROUP BY T1.asset_id HAVING count(*)  =  2 INTERSECT SELECT T1.asset_id ,  T1.asset_details FROM Assets AS T1 JOIN Fault_Log AS T2 ON T1.asset_id  =  T2.asset_id GROUP BY T1.asset_id HAVING count(*)  <  2
Database: assets_maintenance
Question sequence:
Show me assets each maintenance contract contains.
Show me the number of assets and contract id.
SQL query sequence:
SELECT * FROM Maintenance_Contracts AS T1 JOIN Assets AS T2 ON T1.maintenance_contract_id  =  T2.maintenance_contract_id GROUP BY T1.maintenance_contract_id
SELECT count(*) ,  T1.maintenance_contract_id FROM Maintenance_Contracts AS T1 JOIN Assets AS T2 ON T1.maintenance_contract_id  =  T2.maintenance_contract_id GROUP BY T1.maintenance_contract_id
Final question: How many assets does each maintenance contract contain? List the number and the contract id.
Final SQL: SELECT count(*) ,  T1.maintenance_contract_id FROM Maintenance_Contracts AS T1 JOIN Assets AS T2 ON T1.maintenance_contract_id  =  T2.maintenance_contract_id GROUP BY T1.maintenance_contract_id
Database: assets_maintenance
Question sequence:
Show me assets supplied by each third party company.
How many are there for each third party company? Show me the company id as well.
SQL query sequence:
SELECT * FROM Third_Party_Companies AS T1 JOIN Assets AS T2 ON T1.company_id  =  T2.supplier_company_id GROUP BY T1.company_id
SELECT count(*) ,  T1.company_id FROM Third_Party_Companies AS T1 JOIN Assets AS T2 ON T1.company_id  =  T2.supplier_company_id GROUP BY T1.company_id
Final question: How many assets does each third party company supply? List the count and the company id.
Final SQL: SELECT count(*) ,  T1.company_id FROM Third_Party_Companies AS T1 JOIN Assets AS T2 ON T1.company_id  =  T2.supplier_company_id GROUP BY T1.company_id
Database: assets_maintenance
Question sequence:
Which third party companies have at least 2 maintenance engineers? List the id and name of that company.
Show me names and ids of third party companies that have at least 2 maintenance contracts as well, along with the previous result.
SQL query sequence:
SELECT T1.company_id ,  T1.company_name FROM Third_Party_Companies AS T1 JOIN Maintenance_Engineers AS T2 ON T1.company_id  =  T2.company_id GROUP BY T1.company_id HAVING count(*)  >=  2
SELECT T1.company_id ,  T1.company_name FROM Third_Party_Companies AS T1 JOIN Maintenance_Engineers AS T2 ON T1.company_id  =  T2.company_id GROUP BY T1.company_id HAVING count(*)  >=  2 UNION SELECT T3.company_id ,  T3.company_name FROM Third_Party_Companies AS T3 JOIN Maintenance_Contracts AS T4 ON T3.company_id  =  T4.maintenance_contract_company_id GROUP BY T3.company_id HAVING count(*)  >=  2
Final question: Which third party companies have at least 2 maintenance engineers or have at least 2 maintenance contracts? List the company id and name.
Final SQL: SELECT T1.company_id ,  T1.company_name FROM Third_Party_Companies AS T1 JOIN Maintenance_Engineers AS T2 ON T1.company_id  =  T2.company_id GROUP BY T1.company_id HAVING count(*)  >=  2 UNION SELECT T3.company_id ,  T3.company_name FROM Third_Party_Companies AS T3 JOIN Maintenance_Contracts AS T4 ON T3.company_id  =  T4.maintenance_contract_company_id GROUP BY T3.company_id HAVING count(*)  >=  2
Database: assets_maintenance
Question sequence:
What is the name and id of the staff who recorded the fault log?
Among those staff members, only show the name and id of staff who has not contacted any visiting engineers.
SQL query sequence:
SELECT T1.staff_name ,  T1.staff_id FROM Staff AS T1 JOIN Fault_Log AS T2 ON T1.staff_id  =  T2.recorded_by_staff_id
SELECT T1.staff_name ,  T1.staff_id FROM Staff AS T1 JOIN Fault_Log AS T2 ON T1.staff_id  =  T2.recorded_by_staff_id EXCEPT SELECT T3.staff_name ,  T3.staff_id FROM Staff AS T3 JOIN Engineer_Visits AS T4 ON T3.staff_id  =  T4.contact_staff_id
Final question: What is the name and id of the staff who recorded the fault log but has not contacted any visiting engineers?
Final SQL: SELECT T1.staff_name ,  T1.staff_id FROM Staff AS T1 JOIN Fault_Log AS T2 ON T1.staff_id  =  T2.recorded_by_staff_id EXCEPT SELECT T3.staff_name ,  T3.staff_id FROM Staff AS T3 JOIN Engineer_Visits AS T4 ON T3.staff_id  =  T4.contact_staff_id
Database: assets_maintenance
Question sequence:
Which engineer has visited the least number of times? Show the id, first and last names of that engineer.
Do the same for the engineer who has visited the most times.
SQL query sequence:
SELECT T1.engineer_id ,  T1.first_name ,  T1.last_name FROM Maintenance_Engineers AS T1 JOIN Engineer_Visits AS T2 GROUP BY T1.engineer_id ORDER BY count(*) ASC LIMIT 1
SELECT T1.engineer_id ,  T1.first_name ,  T1.last_name FROM Maintenance_Engineers AS T1 JOIN Engineer_Visits AS T2 GROUP BY T1.engineer_id ORDER BY count(*) DESC LIMIT 1
Final question: Which engineer has visited the most times? Show the engineer id, first name and last name.
Final SQL: SELECT T1.engineer_id ,  T1.first_name ,  T1.last_name FROM Maintenance_Engineers AS T1 JOIN Engineer_Visits AS T2 GROUP BY T1.engineer_id ORDER BY count(*) DESC LIMIT 1
Database: assets_maintenance
Question sequence:
Which parts have less than 2 faults? Show the id and name of that part.
Do the same for parts with more than 2 faults.
SQL query sequence:
SELECT T1.part_name ,  T1.part_id FROM Parts AS T1 JOIN Part_Faults AS T2 ON T1.part_id  =  T2.part_id GROUP BY T1.part_id HAVING count(*)  <  2
SELECT T1.part_name ,  T1.part_id FROM Parts AS T1 JOIN Part_Faults AS T2 ON T1.part_id  =  T2.part_id GROUP BY T1.part_id HAVING count(*)  >  2
Final question: Which parts have more than 2 faults? Show the part name and id.
Final SQL: SELECT T1.part_name ,  T1.part_id FROM Parts AS T1 JOIN Part_Faults AS T2 ON T1.part_id  =  T2.part_id GROUP BY T1.part_id HAVING count(*)  >  2
Database: assets_maintenance
Question sequence:
List all engineers' first and last names.
List the details of each engineer and corresponding skill descriptions as well, along with the names.
SQL query sequence:
SELECT T1.first_name ,  T1.last_name FROM Maintenance_Engineers AS T1 JOIN Engineer_Skills AS T2 ON T1.engineer_id  =  T2.engineer_id
SELECT T1.first_name ,  T1.last_name ,  T1.other_details ,  T3.skill_description FROM Maintenance_Engineers AS T1 JOIN Engineer_Skills AS T2 ON T1.engineer_id  =  T2.engineer_id JOIN Skills AS T3 ON T2.skill_id  =  T3.skill_id
Final question: List all every engineer's first name, last name, details and coresponding skill description.
Final SQL: SELECT T1.first_name ,  T1.last_name ,  T1.other_details ,  T3.skill_description FROM Maintenance_Engineers AS T1 JOIN Engineer_Skills AS T2 ON T1.engineer_id  =  T2.engineer_id JOIN Skills AS T3 ON T2.skill_id  =  T3.skill_id
Database: assets_maintenance
Question sequence:
Show me all faults of different parts.
Give me descriptions of skills required to fix those faults, along with the names of those faults.
SQL query sequence:
SELECT fault_short_name FROM Part_Faults
SELECT T1.fault_short_name ,  T3.skill_description FROM Part_Faults AS T1 JOIN Skills_Required_To_Fix AS T2 ON T1.part_fault_id  =  T2.part_fault_id JOIN Skills AS T3 ON T2.skill_id  =  T3.skill_id
Final question: For all the faults of different parts, what are all the decriptions of the skills required to fix them? List the name of the faults and the skill description.
Final SQL: SELECT T1.fault_short_name ,  T3.skill_description FROM Part_Faults AS T1 JOIN Skills_Required_To_Fix AS T2 ON T1.part_fault_id  =  T2.part_fault_id JOIN Skills AS T3 ON T2.skill_id  =  T3.skill_id
Database: assets_maintenance
Question sequence:
Show me all assets each part can be used in. List the part name and the asset details.
How many assets can each part be used in? Show me the count and the part name.
SQL query sequence:
SELECT T1.part_name ,  T3.asset_details FROM Parts AS T1 JOIN Asset_Parts AS T2 ON T1.part_id  =  T2.part_id JOIN assets AS T3 ON T2.asset_id = T3.asset_id GROUP BY T1.part_name
SELECT T1.part_name ,  count(*) FROM Parts AS T1 JOIN Asset_Parts AS T2 ON T1.part_id  =  T2.part_id GROUP BY T1.part_name
Final question: How many assets can each parts be used in? List the part name and the number.
Final SQL: SELECT T1.part_name ,  count(*) FROM Parts AS T1 JOIN Asset_Parts AS T2 ON T1.part_id  =  T2.part_id GROUP BY T1.part_name
Database: assets_maintenance
Question sequence:
What is the lowest number of engineer visits for a single fault log? List the number and log entry id.
Do the same for the highest number of engineer visits for a single fault log?
SQL query sequence:
SELECT count(*) ,  T1.fault_log_entry_id FROM Fault_Log AS T1 JOIN Engineer_Visits AS T2 ON T1.fault_log_entry_id  =  T2.fault_log_entry_id GROUP BY T1.fault_log_entry_id ORDER BY count(*) ASC LIMIT 1
SELECT count(*) ,  T1.fault_log_entry_id FROM Fault_Log AS T1 JOIN Engineer_Visits AS T2 ON T1.fault_log_entry_id  =  T2.fault_log_entry_id GROUP BY T1.fault_log_entry_id ORDER BY count(*) DESC LIMIT 1
Final question: How many engineer visits are required at most for a single fault log? List the number and the log entry id.
Final SQL: SELECT count(*) ,  T1.fault_log_entry_id FROM Fault_Log AS T1 JOIN Engineer_Visits AS T2 ON T1.fault_log_entry_id  =  T2.fault_log_entry_id GROUP BY T1.fault_log_entry_id ORDER BY count(*) DESC LIMIT 1
Database: assets_maintenance
Question sequence:
How many engineers have never visited to maintain the assets?
Show me their first and last names.
SQL query sequence:
SELECT count(*) FROM Maintenance_Engineers WHERE engineer_id NOT IN (SELECT engineer_id FROM Engineer_Visits)
SELECT first_name ,  last_name FROM Maintenance_Engineers WHERE engineer_id NOT IN (SELECT engineer_id FROM Engineer_Visits)
Final question: Which engineers have never visited to maintain the assets? List the engineer first name and last name.
Final SQL: SELECT first_name ,  last_name FROM Maintenance_Engineers WHERE engineer_id NOT IN (SELECT engineer_id FROM Engineer_Visits)
Database: assets_maintenance
Question sequence:
When was the latest date that an asset was acquired?
How about the oldest date?
SQL query sequence:
SELECT asset_acquired_date FROM Assets ORDER BY asset_acquired_date DESC LIMIT 1
SELECT asset_acquired_date FROM Assets ORDER BY asset_acquired_date ASC LIMIT 1
Final question: When was the first asset acquired?
Final SQL: SELECT asset_acquired_date FROM Assets ORDER BY asset_acquired_date ASC LIMIT 1
Database: assets_maintenance
Question sequence:
Show me the id and name of a fault that needs the least number of skills to be fixed.
How about the fault that requires the most number of skills to fix?
SQL query sequence:
SELECT T1.part_id ,  T1.part_name FROM Parts AS T1 JOIN Part_Faults AS T2 ON T1.part_id  =  T2.part_id JOIN Skills_Required_To_Fix AS T3 ON T2.part_fault_id  =  T3.part_fault_id GROUP BY T1.part_id ORDER BY count(*) ASC LIMIT 1
SELECT T1.part_id ,  T1.part_name FROM Parts AS T1 JOIN Part_Faults AS T2 ON T1.part_id  =  T2.part_id JOIN Skills_Required_To_Fix AS T3 ON T2.part_fault_id  =  T3.part_fault_id GROUP BY T1.part_id ORDER BY count(*) DESC LIMIT 1
Final question: Which part fault requires the most number of skills to fix? List part id and name.
Final SQL: SELECT T1.part_id ,  T1.part_name FROM Parts AS T1 JOIN Part_Faults AS T2 ON T1.part_id  =  T2.part_id JOIN Skills_Required_To_Fix AS T3 ON T2.part_fault_id  =  T3.part_fault_id GROUP BY T1.part_id ORDER BY count(*) DESC LIMIT 1
Database: assets_maintenance
Question sequence:
Show me the name of each part with the number of faults it has.
Show me the name of part with the least number of faults.
SQL query sequence:
SELECT T1.part_name, count(*) FROM Parts AS T1 JOIN Part_Faults AS T2 ON T1.part_id  =  T2.part_id GROUP BY T1.part_name
SELECT T1.part_name FROM Parts AS T1 JOIN Part_Faults AS T2 ON T1.part_id  =  T2.part_id GROUP BY T1.part_name ORDER BY count(*) ASC LIMIT 1
Final question: Which kind of part has the least number of faults? List the part name.
Final SQL: SELECT T1.part_name FROM Parts AS T1 JOIN Part_Faults AS T2 ON T1.part_id  =  T2.part_id GROUP BY T1.part_name ORDER BY count(*) ASC LIMIT 1
Database: assets_maintenance
Question sequence:
Show me all the engineers.
Show me id, first and last names of engineers who have visited.
Among those, which one made the least number of visits.
SQL query sequence:
SELECT * FROM Maintenance_Engineers
SELECT T1.engineer_id ,  T1.first_name ,  T1.last_name FROM Maintenance_Engineers AS T1 JOIN Engineer_Visits AS T2 ON T1.engineer_id  =  T2.engineer_id GROUP BY T1.engineer_id
SELECT T1.engineer_id ,  T1.first_name ,  T1.last_name FROM Maintenance_Engineers AS T1 JOIN Engineer_Visits AS T2 ON T1.engineer_id  =  T2.engineer_id GROUP BY T1.engineer_id ORDER BY count(*) ASC LIMIT 1
Final question: Among those engineers who have visited, which engineer makes the least number of visits? List the engineer id, first name and last name.
Final SQL: SELECT T1.engineer_id ,  T1.first_name ,  T1.last_name FROM Maintenance_Engineers AS T1 JOIN Engineer_Visits AS T2 ON T1.engineer_id  =  T2.engineer_id GROUP BY T1.engineer_id ORDER BY count(*) ASC LIMIT 1
Database: assets_maintenance
Question sequence:
Show me names of all the staff members.
List the first and last names of engineers each staff member has contacted.
SQL query sequence:
SELECT staff_name FROM Staff
SELECT T1.staff_name ,  T3.first_name ,  T3.last_name FROM Staff AS T1 JOIN Engineer_Visits AS T2 ON T1.staff_id  =  T2.contact_staff_id JOIN Maintenance_Engineers AS T3 ON T2.engineer_id  =  T3.engineer_id
Final question: Which staff have contacted which engineers? List the staff name and the engineer first name and last name.
Final SQL: SELECT T1.staff_name ,  T3.first_name ,  T3.last_name FROM Staff AS T1 JOIN Engineer_Visits AS T2 ON T1.staff_id  =  T2.contact_staff_id JOIN Maintenance_Engineers AS T3 ON T2.engineer_id  =  T3.engineer_id
Database: assets_maintenance
Question sequence:
Which fault log included the least number of faulty parts? List the id, description, and record time of that fault log.
Show the same for the fault log with most number of faulty parts.
SQL query sequence:
SELECT T1.fault_log_entry_id ,  T1.fault_description ,  T1.fault_log_entry_datetime FROM Fault_Log AS T1 JOIN Fault_Log_Parts AS T2 ON T1.fault_log_entry_id  =  T2.fault_log_entry_id GROUP BY T1.fault_log_entry_id ORDER BY count(*) ASC LIMIT 1
SELECT T1.fault_log_entry_id ,  T1.fault_description ,  T1.fault_log_entry_datetime FROM Fault_Log AS T1 JOIN Fault_Log_Parts AS T2 ON T1.fault_log_entry_id  =  T2.fault_log_entry_id GROUP BY T1.fault_log_entry_id ORDER BY count(*) DESC LIMIT 1
Final question: Which fault log included the most number of faulty parts? List the fault log id, description and record time.
Final SQL: SELECT T1.fault_log_entry_id ,  T1.fault_description ,  T1.fault_log_entry_datetime FROM Fault_Log AS T1 JOIN Fault_Log_Parts AS T2 ON T1.fault_log_entry_id  =  T2.fault_log_entry_id GROUP BY T1.fault_log_entry_id ORDER BY count(*) DESC LIMIT 1
Database: assets_maintenance
Question sequence:
Show me id and descriptions of all the skills.
For each of those skills, show the number of faults each skill is used to fix.
Which skill is used to fix the most number of faults?
SQL query sequence:
SELECT skill_id, skill_description FROM Skills
SELECT T1.skill_id ,  T1.skill_description, count(*) FROM Skills AS T1 JOIN Skills_Required_To_Fix AS T2 ON T1.skill_id  =  T2.skill_id GROUP BY T1.skill_id ORDER BY count(*) DESC LIMIT 1
SELECT T1.skill_id ,  T1.skill_description FROM Skills AS T1 JOIN Skills_Required_To_Fix AS T2 ON T1.skill_id  =  T2.skill_id GROUP BY T1.skill_id ORDER BY count(*) DESC LIMIT 1
Final question: Which skill is used in fixing the most number of faults? List the skill id and description.
Final SQL: SELECT T1.skill_id ,  T1.skill_description FROM Skills AS T1 JOIN Skills_Required_To_Fix AS T2 ON T1.skill_id  =  T2.skill_id GROUP BY T1.skill_id ORDER BY count(*) DESC LIMIT 1
Database: assets_maintenance
Question sequence:
Show chargeable amount for every part.
Order them by chargeable amount in ascending order.
Show me the id and chargeable amount of the part with the least chargeable amount.
SQL query sequence:
SELECT chargeable_amount FROM Parts
SELECT chargeable_amount FROM Parts ORDER BY chargeable_amount ASC
SELECT part_id ,  chargeable_amount FROM Parts ORDER BY chargeable_amount ASC LIMIT 1
Final question: Which part has the least chargeable amount? List the part id and amount.
Final SQL: SELECT part_id ,  chargeable_amount FROM Parts ORDER BY chargeable_amount ASC LIMIT 1
Database: assets_maintenance
Question sequence:
Show me the names of companies that started the five earliest maintenance contracts.
Show me the same for the earliest one.
SQL query sequence:
SELECT T1.company_name FROM Third_Party_Companies AS T1 JOIN Maintenance_Contracts AS T2 ON T1.company_id  =  T2.maintenance_contract_company_id ORDER BY T2.contract_start_date ASC LIMIT 5
SELECT T1.company_name FROM Third_Party_Companies AS T1 JOIN Maintenance_Contracts AS T2 ON T1.company_id  =  T2.maintenance_contract_company_id ORDER BY T2.contract_start_date ASC LIMIT 1
Final question: Which company started the earliest the maintenance contract? Show the company name.
Final SQL: SELECT T1.company_name FROM Third_Party_Companies AS T1 JOIN Maintenance_Contracts AS T2 ON T1.company_id  =  T2.maintenance_contract_company_id ORDER BY T2.contract_start_date ASC LIMIT 1
Database: assets_maintenance
Question sequence:
List gender of each staff.
Which gender do most staff members have?
SQL query sequence:
SELECT gender FROM staff
SELECT gender FROM staff GROUP BY gender ORDER BY count(*) DESC LIMIT 1
Final question: Which gender makes up the majority of the staff?
Final SQL: SELECT gender FROM staff GROUP BY gender ORDER BY count(*) DESC LIMIT 1