aherntech/sparc huggingface dataset:
Database: baseball_1
Question sequence:
Show the player ids of the players in the team Boston Red Stockings in 2001.
How about in 2000?
How many players were there that year?
SQL query sequence:
SELECT player_id FROM salary AS T1 JOIN team AS T2 ON T1.team_id  =  T2.team_id_br WHERE T2.name  = 'Boston Red Stockings' AND T1.year  =  2001 GROUP BY player_id
SELECT player_id FROM salary AS T1 JOIN team AS T2 ON T1.team_id  =  T2.team_id_br WHERE T2.name  = 'Boston Red Stockings' AND T1.year  =  2000 GROUP BY player_id
SELECT count(*) FROM salary AS T1 JOIN team AS T2 ON T1.team_id  =  T2.team_id_br WHERE T2.name  = 'Boston Red Stockings' AND T1.year  =  2000 GROUP BY player_id
Final question: How many players were in the team Boston Red Stockings in 2000?
Final SQL: SELECT count(*) FROM salary AS T1 JOIN team AS T2 ON T1.team_id  =  T2.team_id_br WHERE T2.name  = 'Boston Red Stockings' AND T1.year  =  2000
Database: baseball_1
Question sequence:
What is the highest salary out of all the players?
How about in 2001?
Could you please give the top three highest salaries from that year?
SQL query sequence:
SELECT MAX(salary) FROM salary
SELECT MAX(salary) FROM salary WHERE YEAR  =  2001
SELECT salary FROM salary WHERE YEAR  =  2001 ORDER BY salary DESC LIMIT 3;
Final question: List the 3 highest salaries of the players in 2001?
Final SQL: SELECT salary FROM salary WHERE YEAR  =  2001 ORDER BY salary DESC LIMIT 3;
Database: baseball_1
Question sequence:
What were all the salary values of players in 2012?
How about in 2010?
What is the average number of these results?
Could please give all the salary values of players in 2010 and 2001?
SQL query sequence:
SELECT salary FROM salary WHERE YEAR  =  2012
SELECT salary FROM salary WHERE YEAR  =  2010
SELECT avg(salary) FROM salary WHERE YEAR  =  2010
SELECT salary FROM salary WHERE YEAR  =  2010 UNION SELECT salary FROM salary WHERE YEAR  =  2001
Final question: What were all the salary values of players in 2010 and 2001?
Final SQL: SELECT salary FROM salary WHERE YEAR  =  2010 UNION SELECT salary FROM salary WHERE YEAR  =  2001
Database: baseball_1
Question sequence:
How many players are there in the hall of fame?
How many of them entered each year?
Which year has the fewest people?
SQL query sequence:
SELECT COUNT(*) FROM hall_of_fame
SELECT yearid, COUNT(*) FROM hall_of_fame GROUP BY yearid
SELECT yearid FROM hall_of_fame GROUP BY yearid ORDER BY count(*) ASC LIMIT 1
Final question: In which year did the least people enter hall of fame?
Final SQL: SELECT yearid FROM hall_of_fame GROUP BY yearid ORDER BY count(*) ASC LIMIT 1;
Database: baseball_1
Question sequence:
Which city is "Columbia Park" located in?
How many games were played in this park?
How about in year 1908?
How about in year 1907?
SQL query sequence:
SELECT city FROM park WHERE park_name = "Columbia Park"
SELECT count(*) FROM home_game AS T1 JOIN park AS T2 ON T1.park_id  =  T2.park_id WHERE T2.park_name = 'Columbia Park';
SELECT count(*) FROM home_game AS T1 JOIN park AS T2 ON T1.park_id  =  T2.park_id WHERE T1.year = 1908 AND T2.park_name = 'Columbia Park';
SELECT count(*) FROM home_game AS T1 JOIN park AS T2 ON T1.park_id  =  T2.park_id WHERE T1.year = 1907 AND T2.park_name = 'Columbia Park';
Final question: How many games were played in park "Columbia Park" in 1907?
Final SQL: SELECT count(*) FROM home_game AS T1 JOIN park AS T2 ON T1.park_id  =  T2.park_id WHERE T1.year = 1907 AND T2.park_name = 'Columbia Park';
Database: baseball_1
Question sequence:
Which park is located in Atlanta?
How many games were played in this city?
How about the number in 2010?
How about the number in 2000?
SQL query sequence:
SELECT park_name FROM park WHERE city  =  'Atlanta'
SELECT count(*) FROM home_game AS T1 JOIN park AS T2 ON T1.park_id  =  T2.park_id WHERE  T2.city  =  'Atlanta';
SELECT count(*) FROM home_game AS T1 JOIN park AS T2 ON T1.park_id  =  T2.park_id WHERE T1.year  =  2010 AND T2.city  =  'Atlanta';
SELECT count(*) FROM home_game AS T1 JOIN park AS T2 ON T1.park_id  =  T2.park_id WHERE T1.year  =  2000 AND T2.city  =  'Atlanta';
Final question: How many games were played in city Atlanta in 2000?
Final SQL: SELECT count(*) FROM home_game AS T1 JOIN park AS T2 ON T1.park_id  =  T2.park_id WHERE T1.year  =  2000 AND T2.city  =  'Atlanta';
Database: baseball_1
Question sequence:
What is the total home game attendance of team Cleveland Forest Citys?
How about the number for Boston Red Stockings?
Can you please give the results for 2005?
How about the number from 2000 to 2010?
SQL query sequence:
SELECT sum(T1.attendance) FROM home_game AS T1 JOIN team AS T2 ON T1.team_id  =  T2.team_id_br WHERE T2.name  =  'Cleveland Forest Citys'
SELECT sum(T1.attendance) FROM home_game AS T1 JOIN team AS T2 ON T1.team_id  =  T2.team_id_br WHERE T2.name  =  'Boston Red Stockings'
SELECT sum(T1.attendance) FROM home_game AS T1 JOIN team AS T2 ON T1.team_id  =  T2.team_id_br WHERE T2.name  =  'Boston Red Stockings' AND T1.year = 2005;
SELECT sum(T1.attendance) FROM home_game AS T1 JOIN team AS T2 ON T1.team_id  =  T2.team_id_br WHERE T2.name  =  'Boston Red Stockings' AND T1.year BETWEEN 2000 AND 2010;
Final question: What is the total home game attendance of team Boston Red Stockings from 2000 to 2010?
Final SQL: SELECT sum(T1.attendance) FROM home_game AS T1 JOIN team AS T2 ON T1.team_id  =  T2.team_id_br WHERE T2.name  =  'Boston Red Stockings' AND T1.year BETWEEN 2000 AND 2010;
Database: baseball_1
Question sequence:
How many players with first name Len and last name Barker are there?
What is the average salary that he won in his career?
What is the total salary that he won in his career?
How about the total salary between 1985 to 1990?
SQL query sequence:
SELECT COUNT(*) FROM player WHERE name_first  =  'Len' AND name_last = 'Barker'
SELECT avg(T1.salary) FROM salary AS T1 JOIN player AS T2 ON T1.player_id = T2.player_id WHERE T2.name_first  =  'Len' AND T2.name_last = 'Barker'
SELECT sum(T1.salary) FROM salary AS T1 JOIN player AS T2 ON T1.player_id = T2.player_id WHERE T2.name_first  =  'Len' AND T2.name_last = 'Barker'
SELECT sum(T1.salary) FROM salary AS T1 JOIN player AS T2 ON T1.player_id = T2.player_id WHERE T2.name_first  =  'Len' AND T2.name_last = 'Barker' AND T1.year BETWEEN 1985 AND 1990;
Final question: How much did the the player with first name Len and last name Barker earn between 1985 to 1990 in total?
Final SQL: SELECT sum(T1.salary) FROM salary AS T1 JOIN player AS T2 ON T1.player_id = T2.player_id WHERE T2.name_first  =  'Len' AND T2.name_last = 'Barker' AND T1.year BETWEEN 1985 AND 1990;
Database: baseball_1
Question sequence:
In which parks does the team "Washington Nationals" play games?
How many players have played for this team?
Could you please list their full names?
How about names of the players that played for this team in both 2005 and 2007
SQL query sequence:
SELECT park FROM team WHERE name = "Washington Nationals" GROUP BY park
SELECT COUNT(*) FROM salary AS T1 JOIN player AS T2 ON T1.player_id = T2.player_id JOIN team AS T3 ON T3.team_id_br = T1.team_id WHERE T3.name = 'Washington Nationals'
SELECT T2.name_first ,  T2.name_last FROM salary AS T1 JOIN player AS T2 ON T1.player_id = T2.player_id JOIN team AS T3 ON T3.team_id_br = T1.team_id WHERE T3.name = 'Washington Nationals' GROUP BY T2.player_id
SELECT T2.name_first ,  T2.name_last FROM salary AS T1 JOIN player AS T2 ON T1.player_id = T2.player_id JOIN team AS T3 ON T3.team_id_br = T1.team_id WHERE T1.year = 2005 AND T3.name = 'Washington Nationals' INTERSECT SELECT T2.name_first , T2.name_last FROM salary AS T1 JOIN player AS T2 ON T1.player_id = T2.player_id JOIN team AS T3 ON T3.team_id_br = T1.team_id WHERE T1.year = 2007 AND T3.name = 'Washington Nationals'
Final question: List players' first name and last name who received salary from team Washington Nationals in both 2005 and 2007.
Final SQL: SELECT T2.name_first ,  T2.name_last FROM salary AS T1 JOIN player AS T2 ON T1.player_id = T2.player_id JOIN team AS T3 ON T3.team_id_br = T1.team_id WHERE T1.year = 2005 AND T3.name = 'Washington Nationals' INTERSECT SELECT T2.name_first , T2.name_last FROM salary AS T1 JOIN player AS T2 ON T1.player_id = T2.player_id JOIN team AS T3 ON T3.team_id_br = T1.team_id WHERE T1.year = 2007 AND T3.name = 'Washington Nationals'
Database: baseball_1
Question sequence:
In which parks does the team "Boston Red Stockings" play games?
How many home games did the team Boston Red Stockings play?
How about the number from 1990 to 2000?
SQL query sequence:
SELECT park FROM team WHERE name = "Boston Red Stockings" GROUP BY park
SELECT sum(T1.games) FROM home_game AS T1 JOIN team AS T2 ON T1.team_id = T2.team_id_br WHERE T2.name = 'Boston Red Stockings'
SELECT sum(T1.games) FROM home_game AS T1 JOIN team AS T2 ON T1.team_id = T2.team_id_br WHERE T2.name = 'Boston Red Stockings' AND T1.year BETWEEN 1990 AND 2000;
Final question: How many home games did the team Boston Red Stockings play from 1990 to 2000 in total?
Final SQL: SELECT sum(T1.games) FROM home_game AS T1 JOIN team AS T2 ON T1.team_id = T2.team_id_br WHERE T2.name = 'Boston Red Stockings' AND T1.year BETWEEN 1990 AND 2000;
Database: baseball_1
Question sequence:
How many attendances did each team have in 1980?
Could you please order the results by the attendance?
Which team had the least number of attendances?
SQL query sequence:
SELECT T2.name, T1.attendance FROM home_game AS T1 JOIN team AS T2 ON T1.team_id = T2.team_id_br WHERE T1.year = 1980 GROUP BY T2.name
SELECT T2.name FROM home_game AS T1 JOIN team AS T2 ON T1.team_id = T2.team_id_br WHERE T1.year = 1980 GROUP BY T2.name ORDER BY T1.attendance ASC
SELECT T2.name FROM home_game AS T1 JOIN team AS T2 ON T1.team_id = T2.team_id_br WHERE T1.year = 1980 ORDER BY T1.attendance ASC LIMIT 1;
Final question: Which team had the least number of attendances in home games in 1980?
Final SQL: SELECT T2.name FROM home_game AS T1 JOIN team AS T2 ON T1.team_id = T2.team_id_br WHERE T1.year = 1980 ORDER BY T1.attendance ASC LIMIT 1;
Database: baseball_1
Question sequence:
How many parks does each state have?
Which states have more than 3 parks?
Which states have more than 2 parks?
SQL query sequence:
SELECT state, count(*) FROM park GROUP BY state
SELECT state FROM park GROUP BY state HAVING count(*)  >  3;
SELECT state FROM park GROUP BY state HAVING count(*)  >  2;
Final question: List the names of states that have more than 2 parks.
Final SQL: SELECT state FROM park GROUP BY state HAVING count(*)  >  2;
Database: baseball_1
Question sequence:
How many parks does each city have?
Which cities have 2 or more parks?
Which cities have 3 or more parks?
How about those with 2 to 4 parks?
SQL query sequence:
SELECT city, count(*) FROM park GROUP BY city
SELECT city FROM park GROUP BY city HAVING count(*) >= 2;
SELECT city FROM park GROUP BY city HAVING count(*) >= 3;
SELECT city FROM park GROUP BY city HAVING count(*) BETWEEN 2 AND 4;
Final question: Which cities have 2 to 4 parks?
Final SQL: SELECT city FROM park GROUP BY city HAVING count(*) BETWEEN 2 AND 4;
Database: university_basketball
Question sequence:
What is the average enrollment?
Which school was founded the earliest?
Which school has the largest enrollment?
When was it founded?
SQL query sequence:
SELECT AVG(enrollment) FROM university
SELECT School FROM university ORDER BY founded ASC LIMIT 1
SELECT School FROM university ORDER BY enrollment DESC LIMIT 1
SELECT founded FROM university ORDER BY enrollment DESC LIMIT 1
Final question: When was the school with the largest enrollment founded?
Final SQL: SELECT founded FROM university ORDER BY enrollment DESC LIMIT 1
Database: university_basketball
Question sequence:
Which one is the the newest school?
Among the schools, which ones were founded before 1800?
Can you list the school names ordered by year founded in decreasing order?
Please give the year that the first non public school was founded.
SQL query sequence:
SELECT School FROM university ORDER BY founded DESC LIMIT 1
SELECT School FROM university WHERE founded < 1800
SELECT School FROM university ORDER BY founded DESC
SELECT founded FROM university WHERE affiliation != 'Public' ORDER BY founded DESC LIMIT 1
Final question: Find the founded year of the newest non public school.
Final SQL: SELECT founded FROM university WHERE affiliation != 'Public' ORDER BY founded DESC LIMIT 1
Database: university_basketball
Question sequence:
How many games are there?
What is the lowest acc percent among the competitions?
Can you order the schools by acc percent in descending order?
What is the highest acc percent socre?
SQL query sequence:
SELECT COUNT(*) FROM basketball_match
SELECT MIN(acc_percent) FROM basketball_match
SELECT Team_Name FROM basketball_match ORDER BY acc_percent DESC
SELECT acc_percent FROM basketball_match ORDER BY acc_percent DESC LIMIT 1
Final question: What is the highest acc percent score in the competition?
Final SQL: SELECT acc_percent FROM basketball_match ORDER BY acc_percent DESC LIMIT 1
Database: university_basketball
Question sequence:
Please give me all the acc percent scores.
Which school has the lowest acc percent score?
What is its primary conference?
SQL query sequence:
SELECT ACC_Percent FROM basketball_match
SELECT t1.School FROM university AS t1 JOIN basketball_match AS t2 ON t1.school_id  =  t2.school_id ORDER BY t2.acc_percent LIMIT 1
SELECT t1.Primary_conference FROM university AS t1 JOIN basketball_match AS t2 ON t1.school_id  =  t2.school_id ORDER BY t2.acc_percent LIMIT 1
Final question: What is the primary conference of the school that has the lowest acc percent score in the competition?
Final SQL: SELECT t1.Primary_conference FROM university AS t1 JOIN basketball_match AS t2 ON t1.school_id  =  t2.school_id ORDER BY t2.acc_percent LIMIT 1
Database: university_basketball
Question sequence:
Which schools have participated in a basketball match?
How many are there?
Which one has been founded for the longest time?
Please list its team name and acc regular season score
SQL query sequence:
SELECT t1.school FROM university AS t1 JOIN basketball_match AS t2 ON t1.school_id  =  t2.school_id
SELECT COUNT(t1.school) FROM university AS t1 JOIN basketball_match AS t2 ON t1.school_id  =  t2.school_id
SELECT t1.school FROM university AS t1 JOIN basketball_match AS t2 ON t1.school_id  =  t2.school_id ORDER BY t1.founded LIMIT 1
SELECT t2.team_name ,  t2.ACC_Regular_Season FROM university AS t1 JOIN basketball_match AS t2 ON t1.school_id  =  t2.school_id ORDER BY t1.founded LIMIT 1
Final question: What is the team name and acc regular season score of the school that was founded for the longest time?
Final SQL: SELECT t2.team_name ,  t2.ACC_Regular_Season FROM university AS t1 JOIN basketball_match AS t2 ON t1.school_id  =  t2.school_id ORDER BY t1.founded LIMIT 1
Database: university_basketball
Question sequence:
Which school has North Carolina as its team name?
What is its location?
How about the school that has Clemson as its team name?
Please list its location and all games score.
SQL query sequence:
SELECT t1.School FROM university AS t1 JOIN basketball_match AS t2 ON t1.school_id  =  t2.school_id WHERE team_name  =  'North Carolina'
SELECT t1.location FROM university AS t1 JOIN basketball_match AS t2 ON t1.school_id  =  t2.school_id WHERE team_name  =  'North Carolina'
SELECT t1.school FROM university AS t1 JOIN basketball_match AS t2 ON t1.school_id  =  t2.school_id WHERE team_name  =  'Clemson'
SELECT t2.All_Games ,  t1.location FROM university AS t1 JOIN basketball_match AS t2 ON t1.school_id  =  t2.school_id WHERE team_name  =  'Clemson'
Final question: Find the location and all games score of the school that has Clemson as its team name.
Final SQL: SELECT t2.All_Games ,  t1.location FROM university AS t1 JOIN basketball_match AS t2 ON t1.school_id  =  t2.school_id WHERE team_name  =  'Clemson'
Database: university_basketball
Question sequence:
How many colleges are there?
Please order them by founding year.
Which one is the oldest?
Please list its enrollment and primary_conference.
SQL query sequence:
SELECT COUNT(*) FROM university
SELECT School FROM university ORDER BY founded
SELECT School FROM university ORDER BY founded LIMIT 1
SELECT enrollment ,  primary_conference FROM university ORDER BY founded LIMIT 1
Final question: Show the enrollment and primary_conference of the oldest college.
Final SQL: SELECT enrollment ,  primary_conference FROM university ORDER BY founded LIMIT 1
Database: university_basketball
Question sequence:
What is the average enrollment of all schools?
Could you please order the schools by their enrollment?
What is the total enrollment of all schools?
Please also list the minimum enrollment.
SQL query sequence:
SELECT avg(enrollment) FROM university
SELECT School FROM university ORDER BY enrollment
SELECT sum(enrollment) FROM university
SELECT sum(enrollment) ,  min(enrollment) FROM university
Final question: What is the total and minimum enrollment of all schools?
Final SQL: SELECT sum(enrollment) ,  min(enrollment) FROM university
Database: university_basketball
Question sequence:
Which schools have participated in a basketball match?
How many are there?
How about the schools that have not participated in a basketball match?
How many are there?
SQL query sequence:
SELECT School FROM university as T1 JOIN basketball_match as T2 ON T1.School_ID = T2.School_ID
SELECT COUNT(School) FROM university as T1 JOIN basketball_match as T2 ON T1.School_ID = T2.School_ID
SELECT School FROM university WHERE school_id NOT IN (SELECT school_id FROM basketball_match)
SELECT count(*) FROM university WHERE school_id NOT IN (SELECT school_id FROM basketball_match)
Final question: How many schools do not participate in the basketball match?
Final SQL: SELECT count(*) FROM university WHERE school_id NOT IN (SELECT school_id FROM basketball_match)
Database: university_basketball
Question sequence:
How many public schools are there?
Please list their names.
Please also list the schools that were founded after 1850.
SQL query sequence:
SELECT COUNT(school) FROM university WHERE affiliation  =  'Public'
SELECT school FROM university WHERE affiliation  =  'Public'
SELECT school FROM university WHERE founded  >  1850 OR affiliation  =  'Public'
Final question: Find the schools that were either founded after 1850 or public.
Final SQL: SELECT school FROM university WHERE founded  >  1850 OR affiliation  =  'Public'
Database: university_basketball
Question sequence:
How many schools are there?
Please list the years they were founded.
Please list their locations.
how many of them are in NY?
SQL query sequence:
SELECT COUNT(school) FROM university
SELECT Founded FROM university
SELECT LOCATION FROM university
SELECT count(*) FROM university WHERE LOCATION LIKE "%NY%"
Final question: Find how many school locations have the word 'NY'.
Final SQL: SELECT count(*) FROM university WHERE LOCATION LIKE "%NY%"
Database: university_basketball
Question sequence:
What is the average enrollment size?
Which schools have basketball team?
Please list the enrollment of these schools.
Which of them have enrollments that are smaller than the average enrollment size?
Please list their team names.
SQL query sequence:
SELECT avg(enrollment) FROM university
SELECT School FROM university as T1 JOIN basketball_match as T2 ON T1.School_ID = T2.School_ID
SELECT School, Enrollment FROM university as T1 JOIN basketball_match as T2 ON T1.School_ID = T2.School_ID
SELECT School FROM university AS t1 JOIN basketball_match AS t2 ON t1.school_id  =  t2.school_id WHERE enrollment  <  (SELECT avg(enrollment) FROM university)
SELECT t2.team_name FROM university AS t1 JOIN basketball_match AS t2 ON t1.school_id  =  t2.school_id WHERE enrollment  <  (SELECT avg(enrollment) FROM university)
Final question: Find the team names of the universities whose enrollments are smaller than the average enrollment size.
Final SQL: SELECT t2.team_name FROM university AS t1 JOIN basketball_match AS t2 ON t1.school_id  =  t2.school_id WHERE enrollment  <  (SELECT avg(enrollment) FROM university)
Database: university_basketball
Question sequence:
What are the different affiliation types of these schools?
Which universities have over a 20000 enrollment size?
Can you also list their affiliation type?
How many are there in each affiliation group?
SQL query sequence:
SELECT DISTINCT affiliation FROM university
SELECT School FROM university WHERE enrollment  >  20000
SELECT School, affiliation FROM university WHERE enrollment  >  20000
SELECT count(*) ,  affiliation FROM university WHERE enrollment  >  20000 GROUP BY affiliation
Final question: Find the number of universities that have over a 20000 enrollment size for each affiliation type.
Final SQL: SELECT count(*) ,  affiliation FROM university WHERE enrollment  >  20000 GROUP BY affiliation
Database: e_learning
Question sequence:
Tell me Wilson's date of registration.
Tell me the date of his latest logon.
How about the dates of the latest logon of the students with family name "Jaskolski" or "Langosh"?
SQL query sequence:
SELECT date_of_registration FROM Students WHERE personal_name = "Wilson"
SELECT date_of_latest_logon FROM Students WHERE personal_name = "Wilson"
SELECT date_of_latest_logon FROM Students WHERE family_name  =  "Jaskolski" OR family_name  =  "Langosh"
Final question: What are the dates of the latest logon of the students with family name "Jaskolski" or "Langosh"?
Final SQL: SELECT date_of_latest_logon FROM Students WHERE family_name  =  "Jaskolski" OR family_name  =  "Langosh"
Database: e_learning
Question sequence:
How many students are there?
How many students have personal names that contain the word "wel"?
How many students have personal names that contain the word "son"?
SQL query sequence:
SELECT COUNT(*) FROM Students
SELECT COUNT(*) FROM Students WHERE personal_name LIKE "%wel%"
SELECT COUNT(*) FROM Students WHERE personal_name LIKE "%son%"
Final question: How many students have personal names that contain the word "son"?
Final SQL: SELECT COUNT(*) FROM Students WHERE personal_name LIKE "%son%"
Database: e_learning
Question sequence:
Tell me the number of tests with result "Pass".
Tell me the number of tests with result "Fail".
List each test result and its count in descending order of count.
SQL query sequence:
SELECT COUNT(*) FROM Student_Tests_Taken WHERE test_result = "Pass"
SELECT COUNT(*) FROM Student_Tests_Taken WHERE test_result = "Fail"
SELECT test_result ,  COUNT(*) FROM Student_Tests_Taken GROUP BY test_result ORDER BY COUNT(*) DESC
Final question: List each test result and its count in descending order of count.
Final SQL: SELECT test_result ,  COUNT(*) FROM Student_Tests_Taken GROUP BY test_result ORDER BY COUNT(*) DESC
Database: e_learning
Question sequence:
Tell me the personal name of the course author that teaches the course with name "advanced database".
Tell me the login name of the course author that teaches the course with name "advanced database".
SQL query sequence:
SELECT T1.personal_name FROM Course_Authors_and_Tutors AS T1 JOIN Courses AS T2 ON T1.author_id  =  T2.author_id WHERE T2.course_name  =  "advanced database"
SELECT T1.login_name FROM Course_Authors_and_Tutors AS T1 JOIN Courses AS T2 ON T1.author_id  =  T2.author_id WHERE T2.course_name  =  "advanced database"
Final question: Find the login name of the course author that teaches the course with name "advanced database".
Final SQL: SELECT T1.login_name FROM Course_Authors_and_Tutors AS T1 JOIN Courses AS T2 ON T1.author_id  =  T2.author_id WHERE T2.course_name  =  "advanced database"