aherntech/sparc huggingface dataset:
Database: cre_Doc_Template_Mgt
Question sequence:
Show the template ids used by any document.
Also show the template type code for those ids.
How about their template type descriptions?
Show the distinct values among them.
SQL query sequence:
select Template_ID from Documents
select T2.Template_ID, T1.template_type_code from Templates AS T1 JOIN Documents AS T2 ON T1.Template_ID  =  T2.template_ID
SELECT T1.template_type_description FROM Ref_template_types AS T1 JOIN Templates AS T2 ON T1.template_type_code  = T2.template_type_code JOIN Documents AS T3 ON T2.Template_ID  =  T3.template_ID
SELECT DISTINCT T1.template_type_description FROM Ref_template_types AS T1 JOIN Templates AS T2 ON T1.template_type_code  = T2.template_type_code JOIN Documents AS T3 ON T2.Template_ID  =  T3.template_ID
Final question: What are the distinct template type descriptions for the templates ever used by any document?
Final SQL: SELECT DISTINCT T1.template_type_description FROM Ref_template_types AS T1 JOIN Templates AS T2 ON T1.template_type_code  = T2.template_type_code JOIN Documents AS T3 ON T2.Template_ID  =  T3.template_ID
Database: cre_Doc_Template_Mgt
Question sequence:
Show the template id for all templates.
Also show their template type description.
What are the template ids with description "Presentation"?
SQL query sequence:
SELECT template_id from Templates
SELECT T2.template_id, T1.template_type_description FROM Ref_template_types AS T1 JOIN Templates AS T2 ON T1.template_type_code  = T2.template_type_code
SELECT T2.template_id FROM Ref_template_types AS T1 JOIN Templates AS T2 ON T1.template_type_code  = T2.template_type_code WHERE T1.template_type_description  =  "Presentation"
Final question: What are the template ids with template type description "Presentation".
Final SQL: SELECT T2.template_id FROM Ref_template_types AS T1 JOIN Templates AS T2 ON T1.template_type_code  = T2.template_type_code WHERE T1.template_type_description  =  "Presentation"
Database: cre_Doc_Template_Mgt
Question sequence:
Show the info for all paragraphs.
How many are there?
SQL query sequence:
SELECT * FROM Paragraphs
SELECT count(*) FROM Paragraphs
Final question: How many paragraphs in total?
Final SQL: SELECT count(*) FROM Paragraphs
Database: cre_Doc_Template_Mgt
Question sequence:
Show the id for all paragraphs.
Also show their document names.
Only show the id for all paragraphs in the document named 'Summer Show'.
How many such paragraphs are there?
SQL query sequence:
SELECT paragraph_id FROM Paragraphs
SELECT T1.paragraph_id, T2.document_name FROM Paragraphs AS T1 JOIN Documents AS T2 ON T1.document_ID  =  T2.document_ID
SELECT T1.paragraph_id FROM Paragraphs AS T1 JOIN Documents AS T2 ON T1.document_ID  =  T2.document_ID WHERE T2.document_name  =  'Summer Show'
SELECT count(*) FROM Paragraphs AS T1 JOIN Documents AS T2 ON T1.document_ID  =  T2.document_ID WHERE T2.document_name  =  'Summer Show'
Final question: How many paragraphs for the document with name 'Summer Show'?
Final SQL: SELECT count(*) FROM Paragraphs AS T1 JOIN Documents AS T2 ON T1.document_ID  =  T2.document_ID WHERE T2.document_name  =  'Summer Show'
Database: cre_Doc_Template_Mgt
Question sequence:
Show the parapraph text for all paragraphs.
Also show their paragraph details.
What are the details for the paragraph containing 'Korea'?
SQL query sequence:
SELECT paragraph_text FROM Paragraphs
SELECT Other_Details, paragraph_text FROM Paragraphs
SELECT Other_Details FROM Paragraphs WHERE paragraph_text  =  'Korea'
Final question: Show paragraph details for paragraph with text 'Korea'.
Final SQL: SELECT Other_Details FROM Paragraphs WHERE paragraph_text  =  'Korea'
Database: cre_Doc_Template_Mgt
Question sequence:
Show all paragraph ids and texts.
For each of them, also show their document name.
What are the ids and texts for the paragraph in the document with name 'Welcome to NY'?
SQL query sequence:
SELECT paragraph_id ,  paragraph_text FROM Paragraphs
SELECT T1.paragraph_id ,   T1.paragraph_text, T2.Document_Name FROM Paragraphs AS T1 JOIN Documents AS T2 ON T1.document_id  =  T2.document_id
SELECT T1.paragraph_id ,   T1.paragraph_text FROM Paragraphs AS T1 JOIN Documents AS T2 ON T1.document_id  =  T2.document_id WHERE T2.Document_Name  =  'Welcome to NY'
Final question: Show all paragraph ids and texts for the document with name 'Welcome to NY'.
Final SQL: SELECT T1.paragraph_id ,   T1.paragraph_text FROM Paragraphs AS T1 JOIN Documents AS T2 ON T1.document_id  =  T2.document_id WHERE T2.Document_Name  =  'Welcome to NY'
Database: cre_Doc_Template_Mgt
Question sequence:
Show all paragraph text.
For each of them, also show the document name.
What is the text for the document "Customer reviews"?
SQL query sequence:
SELECT paragraph_text FROM Paragraphs
SELECT T1.paragraph_text, T2.document_name FROM Paragraphs AS T1 JOIN Documents AS T2 ON T1.document_id  =  T2.document_id
SELECT T1.paragraph_text FROM Paragraphs AS T1 JOIN Documents AS T2 ON T1.document_id  =  T2.document_id WHERE T2.document_name  =  "Customer reviews"
Final question: Show all paragraph texts for the document "Customer reviews".
Final SQL: SELECT T1.paragraph_text FROM Paragraphs AS T1 JOIN Documents AS T2 ON T1.document_id  =  T2.document_id WHERE T2.document_name  =  "Customer reviews"
Database: cre_Doc_Template_Mgt
Question sequence:
Show the document id for all paragraphs.
For each id, show the number of paragraphs.
Order by document id.
SQL query sequence:
SELECT document_id FROM Paragraphs
SELECT document_id ,  count(*) FROM Paragraphs GROUP BY document_id
SELECT document_id ,  count(*) FROM Paragraphs GROUP BY document_id ORDER BY document_id
Final question: Show all document ids and the number of paragraphs in each document. Order by document id.
Final SQL: SELECT document_id ,  count(*) FROM Paragraphs GROUP BY document_id ORDER BY document_id
Database: cre_Doc_Template_Mgt
Question sequence:
Show all document ids and names.
For each of them, count the number of paragraphs in each document.
SQL query sequence:
SELECT document_id ,  document_name FROM Documents
SELECT T1.document_id ,  T2.document_name ,  count(*) FROM Paragraphs AS T1 JOIN Documents AS T2 ON T1.document_id  =  T2.document_id GROUP BY T1.document_id
Final question: Show all document ids, names and the number of paragraphs in each document.
Final SQL: SELECT T1.document_id ,  T2.document_name ,  count(*) FROM Paragraphs AS T1 JOIN Documents AS T2 ON T1.document_id  =  T2.document_id GROUP BY T1.document_id
Database: cre_Doc_Template_Mgt
Question sequence:
Show the document id for all paragraphs.
For each of these document ids, count the number of paragraphs.
Which of them have at least two paragraphs?
SQL query sequence:
SELECT document_id FROM Paragraphs
SELECT document_id, count(*) FROM Paragraphs GROUP BY document_id
SELECT document_id FROM Paragraphs GROUP BY document_id HAVING count(*)  >=  2
Final question: List all document ids with at least two paragraphs.
Final SQL: SELECT document_id FROM Paragraphs GROUP BY document_id HAVING count(*)  >=  2
Database: cre_Doc_Template_Mgt
Question sequence:
Show the id number and name for all documents.
Also show the paragraph id for those documents.
For each of these results, count the number of paragraphs.
Which of them is the longest?
SQL query sequence:
SELECT document_id ,  document_name FROM Documents
SELECT T1.document_id ,  T2.document_name , T1.paragraph_id FROM Paragraphs AS T1 JOIN Documents AS T2 ON T1.document_id  =  T2.document_id
SELECT T1.document_id ,  T2.document_name , count(*) FROM Paragraphs AS T1 JOIN Documents AS T2 ON T1.document_id  =  T2.document_id GROUP BY T1.document_id
SELECT T1.document_id ,  T2.document_name FROM Paragraphs AS T1 JOIN Documents AS T2 ON T1.document_id  =  T2.document_id GROUP BY T1.document_id ORDER BY count(*) DESC LIMIT 1
Final question: What is the document id and name with greatest number of paragraphs?
Final SQL: SELECT T1.document_id ,  T2.document_name FROM Paragraphs AS T1 JOIN Documents AS T2 ON T1.document_id  =  T2.document_id GROUP BY T1.document_id ORDER BY count(*) DESC LIMIT 1
Database: cre_Doc_Template_Mgt
Question sequence:
Show the document id for all paragraphs.
For each of them, count the number of paragraphs.
Sort them by these counts.
Which has the fewest?
SQL query sequence:
SELECT document_id FROM Paragraphs
SELECT document_id , count(*) FROM Paragraphs GROUP BY document_id
SELECT document_id FROM Paragraphs GROUP BY document_id ORDER BY count(*)
SELECT document_id FROM Paragraphs GROUP BY document_id ORDER BY count(*) ASC LIMIT 1
Final question: What is the document id with least number of paragraphs?
Final SQL: SELECT document_id FROM Paragraphs GROUP BY document_id ORDER BY count(*) ASC LIMIT 1
Database: cre_Doc_Template_Mgt
Question sequence:
Show the document id for all paragraphs.
For each of these ids, show the number of paragraphs.
Which of them have between 1 and 2 paragraphs?
SQL query sequence:
SELECT document_id FROM Paragraphs
SELECT document_id, count(*) FROM Paragraphs GROUP BY document_id
SELECT document_id FROM Paragraphs GROUP BY document_id HAVING count(*) BETWEEN 1 AND 2
Final question: What is the document id with 1 to 2 paragraphs?
Final SQL: SELECT document_id FROM Paragraphs GROUP BY document_id HAVING count(*) BETWEEN 1 AND 2
Database: concert_singer
Question sequence:
Show information for all singers.
How many are there?
SQL query sequence:
SELECT * FROM singer
SELECT count(*) FROM singer
Final question: How many singers do we have?
Final SQL: SELECT count(*) FROM singer
Database: concert_singer
Question sequence:
Show names of all singers.
For each of them, also show country and age.
List the results in descending order of their age.
SQL query sequence:
SELECT name FROM singer
SELECT name ,  country ,  age FROM singer
SELECT name ,  country ,  age FROM singer ORDER BY age DESC
Final question: Show name, country, age for all singers ordered by age from the oldest to the youngest.
Final SQL: SELECT name ,  country ,  age FROM singer ORDER BY age DESC
Database: concert_singer
Question sequence:
Show age for all singers.
What about age for those from France?
What is the average, minimum, and maximum age for those?
SQL query sequence:
select age from singer
select age from singer WHERE country  =  'France'
SELECT avg(age) ,  min(age) ,  max(age) FROM singer WHERE country  =  'France'
Final question: What is the average, minimum, and maximum age of all singers from France?
Final SQL: SELECT avg(age) ,  min(age) ,  max(age) FROM singer WHERE country  =  'France'
Database: concert_singer
Question sequence:
Show the names of all songs.
Also show the release year for each of them.
Order the result by the age of their singers.
What is the result for the song by the yongest?
SQL query sequence:
select song_name from singer
SELECT song_name ,  song_release_year FROM singer
SELECT song_name ,  song_release_year FROM singer ORDER BY age
SELECT song_name ,  song_release_year FROM singer ORDER BY age LIMIT 1
Final question: Show the name and the release year of the song by the youngest singer.
Final SQL: SELECT song_name ,  song_release_year FROM singer ORDER BY age LIMIT 1
Database: concert_singer
Question sequence:
Show country for all singers.
Only show the results for those above 20.
What are all distinct countries for them?
SQL query sequence:
SELECT country FROM singer
SELECT country FROM singer WHERE age  >  20
SELECT DISTINCT country FROM singer WHERE age  >  20
Final question: What are all distinct countries where singers above age 20 are from?
Final SQL: SELECT DISTINCT country FROM singer WHERE age  >  20
Database: concert_singer
Question sequence:
Show the country for all singers.
For each of them, what is the number of singers?
SQL query sequence:
SELECT country FROM singer
SELECT country ,  count(*) FROM singer GROUP BY country
Final question: Show all countries and the number of singers in each country.
Final SQL: SELECT country ,  count(*) FROM singer GROUP BY country
Database: concert_singer
Question sequence:
What is the average age for all singers?
Show the name for songs by singers older than that.
SQL query sequence:
SELECT avg(age) FROM singer
SELECT song_name FROM singer WHERE age  >  (SELECT avg(age) FROM singer)
Final question: List all song names by singers above the average age.
Final SQL: SELECT song_name FROM singer WHERE age  >  (SELECT avg(age) FROM singer)
Database: concert_singer
Question sequence:
Show the name for all stadiums.
What about those with a capacity between 5000 and 10000?
Also list the location for them.
SQL query sequence:
SELECT name FROM stadium
SELECT name FROM stadium WHERE capacity BETWEEN 5000 AND 10000
SELECT LOCATION ,  name FROM stadium WHERE capacity BETWEEN 5000 AND 10000
Final question: Show location and name for all stadiums with a capacity between 5000 and 10000.
Final SQL: SELECT LOCATION ,  name FROM stadium WHERE capacity BETWEEN 5000 AND 10000
Database: concert_singer
Question sequence:
Show the capacity for all stadiums.
What is the average of them?
Also show the maximum.
SQL query sequence:
select capacity FROM stadium
SELECT avg(capacity) FROM stadium
SELECT avg(capacity) ,  max(capacity) FROM stadium
Final question: What is the average and the maximum capacity of all stadiums?
Final SQL: SELECT avg(capacity) ,  max(capacity) FROM stadium
Database: concert_singer
Question sequence:
Show the name and capacity for all stadiums.
Show the result in descending order of their average attendance.
Which one has the highest?
SQL query sequence:
SELECT name ,  capacity FROM stadium
SELECT name ,  capacity FROM stadium ORDER BY average DESC
SELECT name ,  capacity FROM stadium ORDER BY average DESC LIMIT 1
Final question: What is the name and capacity for the stadium with highest average attendance?
Final SQL: SELECT name ,  capacity FROM stadium ORDER BY average DESC LIMIT 1
Database: concert_singer
Question sequence:
Show the concert information in year 2014.
Also show those in year 2015.
How many are there in total?
SQL query sequence:
SELECT * FROM concert WHERE YEAR  =  2014
SELECT * FROM concert WHERE YEAR  =  2014 OR YEAR  =  2015
SELECT count(*) FROM concert WHERE YEAR  =  2014 OR YEAR  =  2015
Final question: How many concerts are there in year 2014 or 2015?
Final SQL: SELECT count(*) FROM concert WHERE YEAR  =  2014 OR YEAR  =  2015
Database: concert_singer
Question sequence:
Show the names of stadiums.
For each of them, also show the number of concerts.
SQL query sequence:
SELECT name from stadium
SELECT T2.name ,  count(*) FROM concert AS T1 JOIN stadium AS T2 ON T1.stadium_id  =  T2.stadium_id GROUP BY T1.stadium_id
Final question: Show the stadium name and the number of concerts in each stadium.
Final SQL: SELECT T2.name ,  count(*) FROM concert AS T1 JOIN stadium AS T2 ON T1.stadium_id  =  T2.stadium_id GROUP BY T1.stadium_id
Database: concert_singer
Question sequence:
Show all stadium names and their capacities.
Order the results in descending order of the number of concerts in year 2014 or after.
Which one has the most?
SQL query sequence:
SELECT name ,  capacity FROM stadium
SELECT T2.name ,  T2.capacity FROM concert AS T1 JOIN stadium AS T2 ON T1.stadium_id  =  T2.stadium_id WHERE T1.year  >=  2014 GROUP BY T2.stadium_id ORDER BY count(*) DESC
SELECT T2.name ,  T2.capacity FROM concert AS T1 JOIN stadium AS T2 ON T1.stadium_id  =  T2.stadium_id WHERE T1.year  >=  2014 GROUP BY T2.stadium_id ORDER BY count(*) DESC LIMIT 1
Final question: Show the stadium name and capacity with most number of concerts in year 2014 or after.
Final SQL: SELECT T2.name ,  T2.capacity FROM concert AS T1 JOIN stadium AS T2 ON T1.stadium_id  =  T2.stadium_id WHERE T1.year  >=  2014 GROUP BY T2.stadium_id ORDER BY count(*) DESC LIMIT 1
Database: concert_singer
Question sequence:
Show the year for all concerts.
Order them in descending order of the number of concerts
Which year has the most?
SQL query sequence:
SELECT YEAR FROM concert
SELECT YEAR FROM concert GROUP BY YEAR ORDER BY count(*) DESC
SELECT YEAR FROM concert GROUP BY YEAR ORDER BY count(*) DESC LIMIT 1
Final question: Which year has most number of concerts?
Final SQL: SELECT YEAR FROM concert GROUP BY YEAR ORDER BY count(*) DESC LIMIT 1
Database: concert_singer
Question sequence:
Show all stadium ids of concerts.
Show the stadium names without any concert.
SQL query sequence:
SELECT stadium_id FROM concert
SELECT name FROM stadium WHERE stadium_id NOT IN (SELECT stadium_id FROM concert)
Final question: Show the stadium names without any concert.
Final SQL: SELECT name FROM stadium WHERE stadium_id NOT IN (SELECT stadium_id FROM concert)
Database: concert_singer
Question sequence:
Show the country for all singers.
How about those for singers above age 40?
How about those for singers below 30?
How about countries with both?
SQL query sequence:
SELECT country FROM singer
SELECT country FROM singer WHERE age  >  40
SELECT country FROM singer WHERE age  <  30
SELECT country FROM singer WHERE age  >  40 INTERSECT SELECT country FROM singer WHERE age  <  30
Final question: Show countries where a singer above age 40 and a singer below 30 are from.
Final SQL: SELECT country FROM singer WHERE age  >  40 INTERSECT SELECT country FROM singer WHERE age  <  30
Database: concert_singer
Question sequence:
Show name for stadiums that had a concert in year 2014.
Show names for all stadiums except for those.
SQL query sequence:
SELECT T2.name FROM concert AS T1 JOIN stadium AS T2 ON T1.stadium_id  =  T2.stadium_id WHERE T1.year  =  2014
SELECT name FROM stadium EXCEPT SELECT T2.name FROM concert AS T1 JOIN stadium AS T2 ON T1.stadium_id  =  T2.stadium_id WHERE T1.year  =  2014
Final question: Show names for all stadiums except for stadiums having a concert in year 2014.
Final SQL: SELECT name FROM stadium EXCEPT SELECT T2.name FROM concert AS T1 JOIN stadium AS T2 ON T1.stadium_id  =  T2.stadium_id WHERE T1.year  =  2014
Database: concert_singer
Question sequence:
Show the name and theme for all concerts.
For each of those, also show the number of singers.
SQL query sequence:
SELECT concert_name ,  theme from concert
SELECT T2.concert_name ,  T2.theme ,  count(*) FROM singer_in_concert AS T1 JOIN concert AS T2 ON T1.concert_id  =  T2.concert_id GROUP BY T2.concert_id
Final question: Show the name and theme for all concerts and the number of singers in each concert.
Final SQL: SELECT T2.concert_name ,  T2.theme ,  count(*) FROM singer_in_concert AS T1 JOIN concert AS T2 ON T1.concert_id  =  T2.concert_id GROUP BY T2.concert_id
Database: concert_singer
Question sequence:
Show the name for all singers.
For each of them, also show the number of concerts
SQL query sequence:
SELECT name FROM singer
SELECT T2.name ,  count(*) FROM singer_in_concert AS T1 JOIN singer AS T2 ON T1.singer_id  =  T2.singer_id GROUP BY T2.singer_id
Final question: List singer names and number of concerts for each singer.
Final SQL: SELECT T2.name ,  count(*) FROM singer_in_concert AS T1 JOIN singer AS T2 ON T1.singer_id  =  T2.singer_id GROUP BY T2.singer_id
Database: concert_singer
Question sequence:
List all singer names.
How about those performing concerts in year 2014?
SQL query sequence:
select name from singer
SELECT T2.name FROM singer_in_concert AS T1 JOIN singer AS T2 ON T1.singer_id  =  T2.singer_id JOIN concert AS T3 ON T1.concert_id  =  T3.concert_id WHERE T3.year  =  2014
Final question: List all singer names in concerts in year 2014.
Final SQL: SELECT T2.name FROM singer_in_concert AS T1 JOIN singer AS T2 ON T1.singer_id  =  T2.singer_id JOIN concert AS T3 ON T1.concert_id  =  T3.concert_id WHERE T3.year  =  2014
Database: concert_singer
Question sequence:
What are the names of all singers?
Show the names for those having a song having 'Hey' in its name.
Also show the nation for those singers.
SQL query sequence:
SELECT name FROM singer
SELECT name FROM singer WHERE song_name LIKE '%Hey%'
SELECT name ,  country FROM singer WHERE song_name LIKE '%Hey%'
Final question: what is the name and nation of the singer who have a song having 'Hey' in its name?
Final SQL: SELECT name ,  country FROM singer WHERE song_name LIKE '%Hey%'
Database: concert_singer
Question sequence:
Show the name and location for the stadiums.
How about those with some concerts happened in the year 2014?
Among those, what are stadiums also holding some concerts in the year 2015?
SQL query sequence:
SELECT name ,  location FROM stadium
SELECT T2.name ,  T2.location FROM concert AS T1 JOIN stadium AS T2 ON T1.stadium_id  =  T2.stadium_id WHERE T1.Year  =  2014
SELECT T2.name ,  T2.location FROM concert AS T1 JOIN stadium AS T2 ON T1.stadium_id  =  T2.stadium_id WHERE T1.Year  =  2014 INTERSECT SELECT T2.name ,  T2.location FROM concert AS T1 JOIN stadium AS T2 ON T1.stadium_id  =  T2.stadium_id WHERE T1.Year  =  2015
Final question: Find the name and location of the stadiums which some concerts happened in the years of both 2014 and 2015.
Final SQL: SELECT T2.name ,  T2.location FROM concert AS T1 JOIN stadium AS T2 ON T1.stadium_id  =  T2.stadium_id WHERE T1.Year  =  2014 INTERSECT SELECT T2.name ,  T2.location FROM concert AS T1 JOIN stadium AS T2 ON T1.stadium_id  =  T2.stadium_id WHERE T1.Year  =  2015
Database: singer
Question sequence:
Show the names and birth years of singers
Only for the ones born in 1948.
Show the name of singers whose birth year is either 1948 or 1949?
SQL query sequence:
SELECT Name, Birth_Year from singer
SELECT Name, Birth_Year from singer WHERE Birth_Year = 1948
SELECT Name FROM singer WHERE Birth_Year  =  1948 OR Birth_Year  =  1949
Final question: Show the name of singers whose birth year is either 1948 or 1949?
Final SQL: SELECT Name FROM singer WHERE Birth_Year  =  1948 OR Birth_Year  =  1949
Database: singer
Question sequence:
Show the name and net worth of the singers.
Order by richest first.
What is the name of the singer with the largest net worth?
SQL query sequence:
SELECT Name, Net_Worth_Millions FROM singer
SELECT Name FROM singer ORDER BY Net_Worth_Millions DESC
SELECT Name FROM singer ORDER BY Net_Worth_Millions DESC LIMIT 1
Final question: What is the name of the singer with the largest net worth?
Final SQL: SELECT Name FROM singer ORDER BY Net_Worth_Millions DESC LIMIT 1
Database: singer
Question sequence:
Show the names and citizenships of singers.
Show citizenship counts.
Sort that by most common first.
Limit it to one.
SQL query sequence:
SELECT Name, Citizenship FROM singer
SELECT Citizenship, COUNT(*) FROM singer GROUP BY Citizenship
SELECT Citizenship FROM singer GROUP BY Citizenship ORDER BY COUNT(*) DESC
SELECT Citizenship FROM singer GROUP BY Citizenship ORDER BY COUNT(*) DESC LIMIT 1
Final question: Please show the most common citizenship of singers.
Final SQL: SELECT Citizenship FROM singer GROUP BY Citizenship ORDER BY COUNT(*) DESC LIMIT 1
Database: singer
Question sequence:
Join singer names with their song titles.
Limit the entries to where song sales exceed 300000.
Which are the distinct names in that list?
SQL query sequence:
SELECT t1.name, t2.title from singer as t1 join song as t2 on t1.Singer_ID = t2.Singer_ID
SELECT t1.name, t2.title from singer as t1 join song as t2 on t1.Singer_ID = t2.Singer_ID WHERE t2.Sales > 300000
SELECT DISTINCT T1.Name FROM singer AS T1 JOIN song AS T2 ON T1.Singer_ID  =  T2.Singer_ID WHERE T2.Sales  >  300000
Final question: Show distinct names of singers that have songs with sales more than 300000.
Final SQL: SELECT DISTINCT T1.Name FROM singer AS T1 JOIN song AS T2 ON T1.Singer_ID  =  T2.Singer_ID WHERE T2.Sales  >  300000
Database: singer
Question sequence:
Show the names and song counts of singers.
Show the names of singers that have more than one song.
SQL query sequence:
SELECT T1.Name, COUNT(*) FROM singer AS T1 JOIN song AS T2 ON T1.Singer_ID  =  T2.Singer_ID GROUP BY T1.Name
SELECT T1.Name FROM singer AS T1 JOIN song AS T2 ON T1.Singer_ID  =  T2.Singer_ID GROUP BY T1.Name HAVING COUNT(*)  >  1
Final question: Show the names of singers that have more than one song.
Final SQL: SELECT T1.Name FROM singer AS T1 JOIN song AS T2 ON T1.Singer_ID  =  T2.Singer_ID GROUP BY T1.Name HAVING COUNT(*)  >  1