hujudev/spider-text-2-sql huggingface dataset:
Schema:
CREATE TABLE "people" (
"People_ID" int,
"District" text,
"Name" text,
"Party" text,
"Age" int,
PRIMARY KEY ("People_ID")
);
CREATE TABLE "debate" (
"Debate_ID" int,
"Date" text,
"Venue" text,
"Num_of_Audience" int,
PRIMARY KEY ("Debate_ID")
);
CREATE TABLE "debate_people" (
"Debate_ID" int,
"Affirmative" int,
"Negative" int,
"If_Affirmative_Win" bool,
PRIMARY KEY ("Debate_ID","Affirmative","Negative"),
FOREIGN KEY ("Debate_ID") REFERENCES `debate`("Debate_ID"),
FOREIGN KEY ("Affirmative") REFERENCES `people`("People_ID"),
FOREIGN KEY ("Negative") REFERENCES `people`("People_ID")
);

Question: How many debates are there?
SQL:
SELECT count(*) FROM debate

Question: List the venues of debates in ascending order of the number of audience.
SQL:
SELECT Venue FROM debate ORDER BY Num_of_Audience ASC

Question: What are the date and venue of each debate?
SQL:
SELECT Date ,  Venue FROM debate

Question: List the dates of debates with number of audience bigger than 150
SQL:
SELECT Date FROM debate WHERE Num_of_Audience  >  150

Question: Show the names of people aged either 35 or 36.
SQL:
SELECT Name FROM  people WHERE Age  =  35 OR Age  =  36

Question: What is the party of the youngest people?
SQL:
SELECT Party FROM people ORDER BY Age ASC LIMIT 1

Question: Show different parties of people along with the number of people in each party.
SQL:
SELECT Party ,  COUNT(*) FROM people GROUP BY Party

Question: Show the party that has the most people.
SQL:
SELECT Party FROM people GROUP BY Party ORDER BY COUNT(*) DESC LIMIT 1

Question: Show the distinct venues of debates
SQL:
SELECT DISTINCT Venue FROM debate

Question: Show the names of people, and dates and venues of debates they are on the affirmative side.
SQL:
SELECT T3.Name ,  T2.Date ,  T2.Venue FROM debate_people AS T1 JOIN debate AS T2 ON T1.Debate_ID  =  T2.Debate_ID JOIN people AS T3 ON T1.Affirmative  =  T3.People_ID

Question: Show the names of people, and dates and venues of debates they are on the negative side, ordered in ascending alphabetical order of name.
SQL:
SELECT T3.Name ,  T2.Date ,  T2.Venue FROM debate_people AS T1 JOIN debate AS T2 ON T1.Debate_ID  =  T2.Debate_ID JOIN people AS T3 ON T1.Negative  =  T3.People_ID ORDER BY T3.Name ASC

Question: Show the names of people that are on affirmative side of debates with number of audience bigger than 200.
SQL:
SELECT T3.Name FROM debate_people AS T1 JOIN debate AS T2 ON T1.Debate_ID  =  T2.Debate_ID JOIN people AS T3 ON T1.Affirmative  =  T3.People_ID WHERE T2.Num_of_Audience  >  200

Question: Show the names of people and the number of times they have been on the affirmative side of debates.
SQL:
SELECT T2.Name ,  COUNT(*) FROM debate_people AS T1 JOIN people AS T2 ON T1.Affirmative  =  T2.People_ID GROUP BY T2.Name

Question: Show the names of people who have been on the negative side of debates at least twice.
SQL:
SELECT T2.Name FROM debate_people AS T1 JOIN people AS T2 ON T1.Negative  =  T2.People_ID GROUP BY T2.Name HAVING COUNT(*)  >=  2

Question: List the names of people that have not been on the affirmative side of debates.
SQL:
SELECT Name FROM people WHERE People_id NOT IN (SELECT Affirmative FROM debate_people)
Schema:
CREATE TABLE works_on(
Essn INTEGER,
Pno INTEGER,
Hours REAL,
PRIMARY KEY(Essn, Pno));
CREATE TABLE employee(
Fname TEXT,
Minit TEXT,
Lname TEXT,
Ssn INTEGER PRIMARY KEY,
Bdate TEXT,
Address TEXT,
Sex TEXT,
Salary INTEGER,
Super_ssn INTEGER, 
Dno INTEGER);
CREATE TABLE department(
Dname TEXT,
Dnumber INTEGER PRIMARY KEY,
Mgr_ssn INTEGER,
Mgr_start_date TEXT);
CREATE TABLE project(
Pname Text,
Pnumber INTEGER PRIMARY KEY,
Plocation TEXT,
Dnum INTEGER);
CREATE TABLE dependent(
Essn INTEGER,
Dependent_name TEXT,
Sex TEXT,
Bdate TEXT,
Relationship TEXT,
PRIMARY KEY(Essn, Dependent_name));
CREATE TABLE dept_locations(
Dnumber INTEGER,
Dlocation TEXT,
PRIMARY KEY(Dnumber, Dlocation));

Question: List all department names ordered by their starting date.
SQL:
SELECT dname FROM department ORDER BY mgr_start_date

Question: find all dependent names who have a spouse relation with some employee.
SQL:
SELECT Dependent_name FROM dependent WHERE relationship  =  'Spouse'

Question: how many female dependents are there?
SQL:
SELECT count(*) FROM dependent WHERE sex  =  'F'

Question: Find the names of departments that are located in Houston.
SQL:
SELECT t1.dname FROM department AS t1 JOIN dept_locations AS t2 ON t1.dnumber  =  t2.dnumber WHERE t2.dlocation  =  'Houston'

Question: Return the first names and last names of employees who earn more than 30000 in salary.
SQL:
SELECT fname ,  lname FROM employee WHERE salary  >  30000

Question: Find the number of employees of each gender whose salary is lower than 50000.
SQL:
SELECT count(*) ,  sex FROM employee WHERE salary  <  50000 GROUP BY sex

Question: list the first and last names, and the addresses of all employees in the ascending order of their birth date.
SQL:
SELECT fname ,  lname ,  address FROM employee ORDER BY Bdate
Schema:
CREATE TABLE "college" (
"College_ID" int,
"Name" text,
"Leader_Name" text,
"College_Location" text,
PRIMARY KEY ("College_ID")
);
CREATE TABLE "member" (
"Member_ID" int,
"Name" text,
"Country" text,
"College_ID" int,
PRIMARY KEY ("Member_ID"),
FOREIGN KEY ("College_ID") REFERENCES `college`("College_ID")
);
CREATE TABLE "round" (
"Round_ID" int,
"Member_ID" int,
"Decoration_Theme" text,
"Rank_in_Round" int,
PRIMARY KEY ("Member_ID","Round_ID"),
FOREIGN KEY ("Member_ID") REFERENCES "member"("Member_ID")
);

Question: How many members are there?
SQL:
SELECT count(*) FROM member

Question: List the names of members in ascending alphabetical order.
SQL:
SELECT Name FROM member ORDER BY Name ASC

Question: What are the names and countries of members?
SQL:
SELECT Name ,  Country FROM member

Question: Show the names of members whose country is "United States" or "Canada".
SQL:
SELECT Name FROM member WHERE Country  =  "United States" OR Country  =  "Canada"

Question: Show the different countries and the number of members from each.
SQL:
SELECT Country ,  COUNT(*) FROM member GROUP BY Country

Question: Show the most common country across members.
SQL:
SELECT Country FROM member GROUP BY Country ORDER BY COUNT(*) DESC LIMIT 1

Question: Which countries have more than two members?
SQL:
SELECT Country FROM member GROUP BY Country HAVING COUNT(*)  >  2

Question: Show the leader names and locations of colleges.
SQL:
SELECT Leader_Name ,  College_Location FROM college

Question: Show the names of members and names of colleges they go to.
SQL:
SELECT T2.Name ,  T1.Name FROM college AS T1 JOIN member AS T2 ON T1.College_ID  =  T2.College_ID

Question: Show the names of members and the locations of colleges they go to in ascending alphabetical order of member names.
SQL:
SELECT T2.Name ,  T1.College_Location FROM college AS T1 JOIN member AS T2 ON T1.College_ID  =  T2.College_ID ORDER BY T2.Name ASC

Question: Show the distinct leader names of colleges associated with members from country "Canada".
SQL:
SELECT DISTINCT T1.Leader_Name FROM college AS T1 JOIN member AS T2 ON T1.College_ID  =  T2.College_ID WHERE T2.Country  =  "Canada"

Question: Show the names of members and the decoration themes they have.
SQL:
SELECT T1.Name ,  T2.Decoration_Theme FROM member AS T1 JOIN round AS T2 ON T1.Member_ID  =  T2.Member_ID

Question: Show the names of members that have a rank in round higher than 3.
SQL:
SELECT T1.Name FROM member AS T1 JOIN round AS T2 ON T1.Member_ID  =  T2.Member_ID WHERE T2.Rank_in_Round  >  3

Question: Show the names of members in ascending order of their rank in rounds.
SQL:
SELECT T1.Name FROM member AS T1 JOIN round AS T2 ON T1.Member_ID  =  T2.Member_ID ORDER BY Rank_in_Round ASC

Question: List the names of members who did not participate in any round.
SQL:
SELECT Name FROM member WHERE Member_ID NOT IN (SELECT Member_ID FROM round)