aherntech/sparc huggingface dataset:
Database: gas_company
Question sequence:
Show all headquarters.
Show headquarters with a company in the banking industry.
How about headquarters with a company in oil and gas?
Show headquarters with both.
SQL query sequence:
SELECT headquarters FROM company
SELECT headquarters FROM company WHERE main_industry  =  'Banking'
SELECT headquarters FROM company WHERE main_industry  =  'Oil and gas'
SELECT headquarters FROM company WHERE main_industry  =  'Banking' INTERSECT SELECT headquarters FROM company WHERE main_industry  =  'Oil and gas'
Final question: Show all headquarters with both a company in banking industry and a company in Oil and gas.
Final SQL: SELECT headquarters FROM company WHERE main_industry  =  'Banking' INTERSECT SELECT headquarters FROM company WHERE main_industry  =  'Oil and gas'
Database: gas_company
Question sequence:
Show the headquarters with a company in banking industry.
How about those without any such company?
SQL query sequence:
SELECT headquarters FROM company WHERE main_industry  =  'Banking'
SELECT headquarters FROM company EXCEPT SELECT headquarters FROM company WHERE main_industry  =  'Banking'
Final question: Show all headquarters without a company in banking industry.
Final SQL: SELECT headquarters FROM company EXCEPT SELECT headquarters FROM company WHERE main_industry  =  'Banking'
Database: gas_company
Question sequence:
Show the company name.
For each of them, also show the number of gas station.
SQL query sequence:
select company from 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
Final question: Show the company name with the number of gas station.
Final SQL: 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
Database: gas_company
Question sequence:
What are company ids with a gas station.
Show the company name without a gas station.
Show also their main industry.
SQL query sequence:
SELECT company_id FROM station_company
SELECT company  FROM company WHERE company_id NOT IN (SELECT company_id FROM station_company)
SELECT company ,  main_industry FROM company WHERE company_id NOT IN (SELECT company_id FROM station_company)
Final question: Show company name and main industry without a gas station.
Final SQL: SELECT company ,  main_industry FROM company WHERE company_id NOT IN (SELECT company_id FROM station_company)
Database: gas_company
Question sequence:
Show the manager name for all gas stations.
Show those for gas stations belonging to the ExxonMobil company.
SQL query sequence:
SELECT manager_name FROM gas_station
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'
Final question: Show the manager name for gas stations belonging to the ExxonMobil company.
Final SQL: 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'
Database: gas_company
Question sequence:
Show locations for all gas stations.
Show locations whose company has a market value greater than 100.
SQL query sequence:
SELECT location FROM gas_station
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
Final question: Show all locations where a gas station for company with market value greater than 100 is located.
Final SQL: 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
Database: gas_company
Question sequence:
Show the manager name for all gas stations.
For each of them, also count the number of gas stations opened after 2000.
Show the results in the descending order of their count.
Which manager name has the most?
SQL query sequence:
SELECT manager_name FROM gas_station
SELECT manager_name, count(*) FROM gas_station WHERE open_year  >  2000 GROUP BY manager_name
SELECT manager_name, count(*) FROM gas_station WHERE open_year  >  2000 GROUP BY manager_name ORDER BY count(*) DESC
SELECT manager_name FROM gas_station WHERE open_year  >  2000 GROUP BY manager_name ORDER BY count(*) DESC LIMIT 1
Final question: Show the manager name with most number of gas stations opened after 2000.
Final SQL: SELECT manager_name FROM gas_station WHERE open_year  >  2000 GROUP BY manager_name ORDER BY count(*) DESC LIMIT 1
Database: gas_company
Question sequence:
Show the location for all gas stations.
Order them by their opening year.
SQL query sequence:
SELECT LOCATION FROM gas_station
SELECT LOCATION FROM gas_station ORDER BY open_year
Final question: order all gas station locations by the opening year.
Final SQL: SELECT LOCATION FROM gas_station ORDER BY open_year
Database: gas_company
Question sequence:
Show the rank, company names, market values of all the companies.
What about the results for those in the banking industry?
Order the results by their sales and profits in billion.
SQL query sequence:
SELECT rank ,  company ,  market_value FROM company
SELECT rank ,  company ,  market_value FROM company WHERE main_industry  =  'Banking'
SELECT rank ,  company ,  market_value FROM company WHERE main_industry  =  'Banking' ORDER BY sales_billion ,  profits_billion
Final question: find the rank, company names, market values of the companies in the banking industry order by their sales and profits in billion.
Final SQL: SELECT rank ,  company ,  market_value FROM company WHERE main_industry  =  'Banking' ORDER BY sales_billion ,  profits_billion
Database: solvency_ii
Question sequence:
What are the prices of products called "Trading Policy"?
How bout "Dining"?
Show those together, please.
SQL query sequence:
SELECT Product_Price FROM Products WHERE Product_Name  =  "Trading Policy"
SELECT Product_Price FROM Products WHERE Product_Name  =  "Dining"
SELECT Product_Price FROM Products WHERE Product_Name  =  "Dining" OR Product_Name  =  "Trading Policy"
Final question: Show the prices of the products named "Dining" or "Trading Policy".
Final SQL: SELECT Product_Price FROM Products WHERE Product_Name  =  "Dining" OR Product_Name  =  "Trading Policy"
Database: solvency_ii
Question sequence:
What are the prices of the products?
Can you sort that by descending product price?
Just show the product name with the highest price
SQL query sequence:
SELECT Product_Name, Product_Price FROM Products
SELECT Product_Name, Product_Price FROM Products ORDER BY Product_Price DESC
SELECT Product_Name FROM Products ORDER BY Product_Price DESC LIMIT 1
Final question: What is the name of the product with the highest price?
Final SQL: SELECT Product_Name FROM Products ORDER BY Product_Price DESC LIMIT 1
Database: solvency_ii
Question sequence:
What are the type codes for products?
Can you count the products for each type code?
Which is most common?
Show the ones with at least two products.
Show those ones that have products with price higher than 4500 and products with price lower than 3000.
SQL query sequence:
SELECT Product_Name, Product_Type_Code FROM Products
SELECT Product_Type_Code, COUNT(*) FROM Products group by product_type_code
SELECT Product_Type_Code FROM Products GROUP BY Product_Type_Code ORDER BY COUNT(*) DESC LIMIT 1
SELECT Product_Type_Code FROM Products GROUP BY Product_Type_Code HAVING COUNT(*)  >=  2
SELECT Product_Type_Code FROM Products WHERE Product_Price  >  4500 INTERSECT SELECT Product_Type_Code FROM Products WHERE Product_Price  <  3000
Final question: Show the most common type code across products.
Final SQL: SELECT Product_Type_Code FROM Products GROUP BY Product_Type_Code ORDER BY COUNT(*) DESC LIMIT 1
Database: cinema
Question sequence:
Show the locations for all cinemas.
What are the locations for the cinemas that have a capacity over 800?
Show all locations except for those.
SQL query sequence:
SELECT LOCATION FROM cinema
SELECT LOCATION FROM cinema WHERE capacity  >  800
SELECT LOCATION FROM cinema EXCEPT SELECT LOCATION FROM cinema WHERE capacity  >  800
Final question: Show all the locations where no cinema has capacity over 800.
Final SQL: SELECT LOCATION FROM cinema EXCEPT SELECT LOCATION FROM cinema WHERE capacity  >  800
Database: cinema
Question sequence:
List the locations where a cinema was opened in 2010.
How about the locations where of cinema was opened in 2011?
Show the locations that belong to both groups.
SQL query sequence:
SELECT LOCATION FROM cinema WHERE openning_year  =  2010
SELECT LOCATION FROM cinema WHERE openning_year  =  2011
SELECT LOCATION FROM cinema WHERE openning_year  =  2010 INTERSECT SELECT LOCATION FROM cinema WHERE openning_year  =  2011
Final question: Show all the locations where some cinemas were opened in both year 2010 and year 2011.
Final SQL: SELECT LOCATION FROM cinema WHERE openning_year  =  2010 INTERSECT SELECT LOCATION FROM cinema WHERE openning_year  =  2011
Database: cinema
Question sequence:
Show all cinemas.
How many are there?
SQL query sequence:
SELECT * FROM cinema
SELECT count(*) FROM cinema
Final question: How many cinema do we have?
Final SQL: SELECT count(*) FROM cinema
Database: cinema
Question sequence:
Show all information for cinemas.
Only list name, opening year, and capacity for them.
SQL query sequence:
SELECT * FROM cinema
SELECT name ,  openning_year ,  capacity FROM cinema
Final question: Show name, opening year, and capacity for each cinema.
Final SQL: SELECT name ,  openning_year ,  capacity FROM cinema
Database: cinema
Question sequence:
What is are the capacities for cinemas?
What is the average?
Show the name and location for any cinemas with a capacity above this.
SQL query sequence:
SELECT capacity FROM cinema
SELECT avg(capacity) FROM cinema
SELECT name ,  LOCATION FROM cinema WHERE capacity  >  (SELECT avg(capacity) FROM cinema)
Final question: Show the cinema name and location for cinemas with capacity above average.
Final SQL: SELECT name ,  LOCATION FROM cinema WHERE capacity  >  (SELECT avg(capacity) FROM cinema)
Database: cinema
Question sequence:
Show all information for cinemas.
Show all distinct locations containing cinemas.
SQL query sequence:
SELECT * FROM cinema
SELECT DISTINCT LOCATION FROM cinema
Final question: What are all the locations with a cinema?
Final SQL: SELECT DISTINCT LOCATION FROM cinema
Database: cinema
Question sequence:
Show name and opening year for each cinema.
Sort them in descending order by opening year.
SQL query sequence:
SELECT name ,  openning_year FROM cinema
SELECT name ,  openning_year FROM cinema ORDER BY openning_year DESC
Final question: Show all the cinema names and opening years in descending order of opening year.
Final SQL: SELECT name ,  openning_year FROM cinema ORDER BY openning_year DESC
Database: cinema
Question sequence:
Show name and location for all cinemas.
Order by them their capacity in descending order.
What is the top cinema in the list?
SQL query sequence:
SELECT name ,  LOCATION FROM cinema
SELECT name ,  LOCATION FROM cinema ORDER BY capacity DESC
SELECT name ,  LOCATION FROM cinema ORDER BY capacity DESC LIMIT 1
Final question: What are the name and location of the cinema with the largest capacity?
Final SQL: SELECT name ,  LOCATION FROM cinema ORDER BY capacity DESC LIMIT 1
Database: cinema
Question sequence:
Show the capacities for all cinemas.
How about the capacities for those that opened in 2011 or later?
What is the average, minimum, and maximum among these?
SQL query sequence:
Select capacity from cinema
Select capacity from cinema WHERE openning_year  >=  2011
SELECT avg(capacity) ,  min(capacity) ,  max(capacity) FROM cinema WHERE openning_year  >=  2011
Final question: Show the average, minimum, and maximum capacity for all the cinemas opened in year 2011 or later.
Final SQL: SELECT avg(capacity) ,  min(capacity) ,  max(capacity) FROM cinema WHERE openning_year  >=  2011
Database: cinema
Question sequence:
Show all locations for cinemas.
Also show the number of cinemas in each location.
SQL query sequence:
select location from cinema
SELECT LOCATION ,  count(*) FROM cinema GROUP BY LOCATION
Final question: Show each location and the number of cinemas there.
Final SQL: SELECT LOCATION ,  count(*) FROM cinema GROUP BY LOCATION
Database: cinema
Question sequence:
Show all locations with cinemas.
How about locations for those that opened in year 2010 or later?
What is the location with the most such cinemas?
SQL query sequence:
SELECT LOCATION FROM cinema
SELECT LOCATION FROM cinema WHERE openning_year  >=  2010
SELECT LOCATION FROM cinema WHERE openning_year  >=  2010 GROUP BY LOCATION ORDER BY count(*) DESC LIMIT 1
Final question: What is the location with the most cinemas opened in year 2010 or later?
Final SQL: SELECT LOCATION FROM cinema WHERE openning_year  >=  2010 GROUP BY LOCATION ORDER BY count(*) DESC LIMIT 1
Database: cinema
Question sequence:
Show all locations of cinemas.
What are locations for the cinemas with a capacity above 300?
What are locations with at least two such cinemas?
SQL query sequence:
SELECT LOCATION FROM cinema
SELECT LOCATION FROM cinema WHERE capacity  >  300
SELECT LOCATION FROM cinema WHERE capacity  >  300 GROUP BY LOCATION HAVING count(*)  >=  2
Final question: Show all the locations with at least two cinemas with capacity above 300.
Final SQL: SELECT LOCATION FROM cinema WHERE capacity  >  300 GROUP BY LOCATION HAVING count(*)  >=  2
Database: cinema
Question sequence:
Show all information of films.
How about the title and director for those?
SQL query sequence:
SELECT * FROM film
SELECT title ,  directed_by FROM film
Final question: Show the title and director for all films.
Final SQL: SELECT title ,  directed_by FROM film
Database: cinema
Question sequence:
Show the information for all films.
Who are the directors for those?
SQL query sequence:
SELECT * FROM film
SELECT DISTINCT directed_by FROM film
Final question: Show all directors.
Final SQL: SELECT DISTINCT directed_by FROM film
Database: cinema
Question sequence:
Show directors for all films.
Also show the number of films made by each director.
SQL query sequence:
SELECT directed_by FROM film
SELECT directed_by ,  count(*) FROM film GROUP BY directed_by
Final question: List all directors along with the number of films directed by each director.
Final SQL: SELECT directed_by ,  count(*) FROM film GROUP BY directed_by
Database: cinema
Question sequence:
Show the names for all cinemas.
Also show the showtimes per day for those cinemas.
For each cinema, also show the total number of showtimes per day.
SQL query sequence:
select name from cinema
SELECT T2.name ,  T1.show_times_per_day FROM schedule AS T1 JOIN cinema AS T2 ON T1.cinema_id  =  T2.cinema_id
SELECT T2.name ,  sum(T1.show_times_per_day) FROM schedule AS T1 JOIN cinema AS T2 ON T1.cinema_id  =  T2.cinema_id GROUP BY T1.cinema_id
Final question: What is total number of show times per day for each cinema?
Final SQL: SELECT T2.name ,  sum(T1.show_times_per_day) FROM schedule AS T1 JOIN cinema AS T2 ON T1.cinema_id  =  T2.cinema_id GROUP BY T1.cinema_id
Database: cinema
Question sequence:
Show the title for each film.
Also show the prices for each of them.
What is the maximum price for each?
SQL query sequence:
select title from film
SELECT T2.title ,  T1.price FROM schedule AS T1 JOIN film AS T2 ON T1.film_id  =  T2.film_id
SELECT T2.title ,  max(T1.price) FROM schedule AS T1 JOIN film AS T2 ON T1.film_id  =  T2.film_id GROUP BY T1.film_id
Final question: What are the title and maximum price of each film?
Final SQL: SELECT T2.title ,  max(T1.price) FROM schedule AS T1 JOIN film AS T2 ON T1.film_id  =  T2.film_id GROUP BY T1.film_id
Database: cinema
Question sequence:
Show the title for films.
Show the name for cinemas.
Show all the schedule record.
How about the date and the price for each of those records along with the film title and cinema name.
SQL query sequence:
select title from film
select name from cinema
select * from schedule
SELECT T3.name ,  T2.title ,  T1.date ,  T1.price FROM schedule AS T1 JOIN film AS T2 ON T1.film_id  =  T2.film_id JOIN cinema AS T3 ON T1.cinema_id  =  T3.cinema_id
Final question: Show cinema name, film title, date, and price for each record in schedule.
Final SQL: SELECT T3.name ,  T2.title ,  T1.date ,  T1.price FROM schedule AS T1 JOIN film AS T2 ON T1.film_id  =  T2.film_id JOIN cinema AS T3 ON T1.cinema_id  =  T3.cinema_id
Database: cinema
Question sequence:
Show all film ids in the schedule.
Show the title and director for all films.
Only show the title and director for films not in the schedule.
SQL query sequence:
SELECT film_id FROM schedule
SELECT title ,  directed_by FROM film
SELECT title ,  directed_by FROM film WHERE film_id NOT IN (SELECT film_id FROM schedule)
Final question: What are the title and director of the films without any schedule?
Final SQL: SELECT title ,  directed_by FROM film WHERE film_id NOT IN (SELECT film_id FROM schedule)
Database: cinema
Question sequence:
Show all the directors.
List those directors in descending order by the total number of showtimes.
Who has the most?
SQL query sequence:
select directed_by from film
SELECT T2.directed_by FROM schedule AS T1 JOIN film AS T2 ON T1.film_id  =  T2.film_id GROUP BY T2.directed_by ORDER BY sum(T1.show_times_per_day) DESC
SELECT T2.directed_by FROM schedule AS T1 JOIN film AS T2 ON T1.film_id  =  T2.film_id GROUP BY T2.directed_by ORDER BY sum(T1.show_times_per_day) DESC LIMIT 1
Final question: Show director with the largest number of show times in total.
Final SQL: SELECT T2.directed_by FROM schedule AS T1 JOIN film AS T2 ON T1.film_id  =  T2.film_id GROUP BY T2.directed_by ORDER BY sum(T1.show_times_per_day) DESC LIMIT 1
Database: cinema
Question sequence:
Show all locations for the cinemas.
Only show locations of cinemas with a capacity above 300.
How about locations with more than one such cinema?
SQL query sequence:
SELECT LOCATION FROM cinema
SELECT LOCATION FROM cinema WHERE capacity  >  300
SELECT LOCATION FROM cinema WHERE capacity  >  300 GROUP BY LOCATION HAVING count(*)  >  1
Final question: Find the locations that have more than one movie theater with capacity above 300.
Final SQL: SELECT LOCATION FROM cinema WHERE capacity  >  300 GROUP BY LOCATION HAVING count(*)  >  1
Database: cre_Drama_Workshop_Groups
Question sequence:
What are all the bookings?
How many are there?
SQL query sequence:
SELECT * FROM BOOKINGS
SELECT count(*) FROM BOOKINGS
Final question: How many bookings do we have?
Final SQL: SELECT count(*) FROM BOOKINGS
Database: cre_Drama_Workshop_Groups
Question sequence:
What are all the bookings?
What are their order dates?
SQL query sequence:
SELECT * FROM BOOKINGS
SELECT Order_Date FROM BOOKINGS
Final question: List the order dates of all the bookings.
Final SQL: SELECT Order_Date FROM BOOKINGS
Database: cre_Drama_Workshop_Groups
Question sequence:
What are all the bookings?
What are their planned delivery dates and actual delivery dates?
SQL query sequence:
SELECT * FROM BOOKINGS
SELECT Planned_Delivery_Date ,  Actual_Delivery_Date FROM BOOKINGS
Final question: Show all the planned delivery dates and actual delivery dates of bookings.
Final SQL: SELECT Planned_Delivery_Date ,  Actual_Delivery_Date FROM BOOKINGS
Database: cre_Drama_Workshop_Groups
Question sequence:
What are all the customers?
How many are there?
SQL query sequence:
SELECT * FROM CUSTOMERS
SELECT count(*) FROM CUSTOMERS
Final question: How many customers do we have?
Final SQL: SELECT count(*) FROM CUSTOMERS
Database: cre_Drama_Workshop_Groups
Question sequence:
What are all the customers?
Who is Harold?
Show Harold's phone and email.
SQL query sequence:
SELECT * FROM CUSTOMERS
SELECT * FROM CUSTOMERS WHERE Customer_Name  =  "Harold"
SELECT Customer_Phone ,  Customer_Email_Address FROM CUSTOMERS WHERE Customer_Name  =  "Harold"
Final question: What are the phone and email for customer Harold?
Final SQL: SELECT Customer_Phone ,  Customer_Email_Address FROM CUSTOMERS WHERE Customer_Name  =  "Harold"
Database: cre_Drama_Workshop_Groups
Question sequence:
What are all the drama workshop groups?
What are their names?
SQL query sequence:
SELECT * FROM Drama_Workshop_Groups
SELECT Store_Name FROM Drama_Workshop_Groups
Final question: Show all the Store_Name of drama workshop groups.
Final SQL: SELECT Store_Name FROM Drama_Workshop_Groups
Database: cre_Drama_Workshop_Groups
Question sequence:
What are all the invoices?
What are their order quantities?
Show the minimum, average, maximum of them.
SQL query sequence:
SELECT * FROM INVOICES
SELECT Order_Quantity FROM INVOICES
SELECT min(Order_Quantity) ,  avg(Order_Quantity) ,  max(Order_Quantity) FROM INVOICES
Final question: Show the minimum, average, maximum order quantity of all invoices.
Final SQL: SELECT min(Order_Quantity) ,  avg(Order_Quantity) ,  max(Order_Quantity) FROM INVOICES
Database: cre_Drama_Workshop_Groups
Question sequence:
What are all the invoices?
What are their payment method codes?
Only show the distinct ones.
SQL query sequence:
SELECT * FROM INVOICES
SELECT payment_method_code FROM INVOICES
SELECT DISTINCT payment_method_code FROM INVOICES
Final question: What are the distinct payment method codes in all the invoices?
Final SQL: SELECT DISTINCT payment_method_code FROM INVOICES
Database: cre_Drama_Workshop_Groups
Question sequence:
What are all the marketing regions?
Show me the region named China.
Show the description of it.
SQL query sequence:
SELECT * FROM Marketing_Regions
SELECT * FROM Marketing_Regions WHERE Marketing_Region_Name  =  "China"
SELECT Marketing_Region_Descriptrion FROM Marketing_Regions WHERE Marketing_Region_Name  =  "China"
Final question: What is the description of the marketing region China?
Final SQL: SELECT Marketing_Region_Descriptrion FROM Marketing_Regions WHERE Marketing_Region_Name  =  "China"
Database: cre_Drama_Workshop_Groups
Question sequence:
What are all the products?
What about those with price higher than average?
Show their distinct names.
SQL query sequence:
SELECT * FROM PRODUCTS
SELECT * FROM PRODUCTS WHERE Product_Price  >  (SELECT avg(Product_Price) FROM PRODUCTS)
SELECT DISTINCT Product_Name FROM PRODUCTS WHERE Product_Price  >  (SELECT avg(Product_Price) FROM PRODUCTS)
Final question: Show all the distinct product names with price higher than the average.
Final SQL: SELECT DISTINCT Product_Name FROM PRODUCTS WHERE Product_Price  >  (SELECT avg(Product_Price) FROM PRODUCTS)
Database: cre_Drama_Workshop_Groups
Question sequence:
What are all the products?
which is the one with the highest price?
Only show its name.
SQL query sequence:
SELECT * FROM PRODUCTS
SELECT * FROM PRODUCTS ORDER BY Product_Price DESC LIMIT 1
SELECT Product_Name FROM PRODUCTS ORDER BY Product_Price DESC LIMIT 1
Final question: What is the name of the most expensive product?
Final SQL: SELECT Product_Name FROM PRODUCTS ORDER BY Product_Price DESC LIMIT 1
Database: cre_Drama_Workshop_Groups
Question sequence:
What are all the performers?
Show the phone number of the performer whose name is Ashley.
SQL query sequence:
SELECT * FROM PERFORMERS
SELECT Customer_Phone FROM PERFORMERS WHERE Customer_Name  =  "Ashley"
Final question: What is the phone number of the performer Ashley?
Final SQL: SELECT Customer_Phone FROM PERFORMERS WHERE Customer_Name  =  "Ashley"
Database: cre_Drama_Workshop_Groups
Question sequence:
What are all the invoices?
Show all kinds of payment method codes among them.
How many orders are there for each of them?
SQL query sequence:
SELECT * FROM INVOICES
SELECT payment_method_code FROM INVOICES GROUP BY payment_method_code
SELECT payment_method_code ,  count(*) FROM INVOICES GROUP BY payment_method_code
Final question: Show all payment method codes and the number of orders for each code.
Final SQL: SELECT payment_method_code ,  count(*) FROM INVOICES GROUP BY payment_method_code