sharkiefff/RBAC-Text2SQL-Benchmark huggingface dataset:
##Instruction:
Database: entrepreneur
Total Tables: 2
Total Columns: 10

Table Schemas:

entrepreneur contains tables such as entrepreneur, people.
Table entrepreneur has columns such as Entrepreneur_ID, People_ID, Company, Money_Requested, Investor.
Entrepreneur_ID is the primary key.
Table people has columns such as People_ID, Name, Height, Weight, Date_of_Birth.
People_ID is the primary key.
The People_ID of entrepreneur is the foreign key of People_ID of people.

##Role Access Policy (Column-Level):
Role: DataOperator_2
Accessible Columns:
  - entrepreneur: * (all columns)
  - people: * (all columns)

Question: Which company was started by the entrepreneur with the greatest height?
Answer: SELECT T1.Company FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID  =  T2.People_ID ORDER BY T2.Height DESC LIMIT 1
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT T1.Company FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID  =  T2.People_ID ORDER BY T2.Height DESC LIMIT 1
##Instruction:
Database: election_representative
Total Tables: 2
Total Columns: 12

Table Schemas:

election_representative contains tables such as election, representative.
Table election has columns such as Election_ID, Representative_ID, Date, Votes, Vote_Percent, Seats, Place.
Election_ID is the primary key.
Table representative has columns such as Representative_ID, Name, State, Party, Lifespan.
Representative_ID is the primary key.
The Representative_ID of election is the foreign key of Representative_ID of representative.

##Role Access Policy (Column-Level):
Role: DataOperator_1
Accessible Columns:
  - election: * (all columns)
  - representative: * (all columns)

Question: How many elections are there?
Answer: SELECT count(*) FROM election
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT count(*) FROM election
##Instruction:
Database: election_representative
Total Tables: 2
Total Columns: 12

Table Schemas:

election_representative contains tables such as election, representative.
Table election has columns such as Election_ID, Representative_ID, Date, Votes, Vote_Percent, Seats, Place.
Election_ID is the primary key.
Table representative has columns such as Representative_ID, Name, State, Party, Lifespan.
Representative_ID is the primary key.
The Representative_ID of election is the foreign key of Representative_ID of representative.

##Role Access Policy (Column-Level):
Role: DataOperator_1
Accessible Columns:
  - election: * (all columns)
  - representative: * (all columns)

Question: List the votes of elections in descending order.
Answer: SELECT Votes FROM election ORDER BY Votes DESC
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT Votes FROM election ORDER BY Votes DESC
##Instruction:
Database: election_representative
Total Tables: 2
Total Columns: 12

Table Schemas:

election_representative contains tables such as election, representative.
Table election has columns such as Election_ID, Representative_ID, Date, Votes, Vote_Percent, Seats, Place.
Election_ID is the primary key.
Table representative has columns such as Representative_ID, Name, State, Party, Lifespan.
Representative_ID is the primary key.
The Representative_ID of election is the foreign key of Representative_ID of representative.

##Role Access Policy (Column-Level):
Role: DataOperator_1
Accessible Columns:
  - election: * (all columns)
  - representative: * (all columns)

Question: List the dates and vote percents of elections.
Answer: SELECT Date ,  Vote_Percent FROM election
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT Date ,  Vote_Percent FROM election
##Instruction:
Database: election_representative
Total Tables: 2
Total Columns: 12

Table Schemas:

election_representative contains tables such as election, representative.
Table election has columns such as Election_ID, Representative_ID, Date, Votes, Vote_Percent, Seats, Place.
Election_ID is the primary key.
Table representative has columns such as Representative_ID, Name, State, Party, Lifespan.
Representative_ID is the primary key.
The Representative_ID of election is the foreign key of Representative_ID of representative.

##Role Access Policy (Column-Level):
Role: DataOperator_1
Accessible Columns:
  - election: * (all columns)
  - representative: * (all columns)

Question: What are the minimum and maximum vote percents of elections?
Answer: SELECT min(Vote_Percent) ,  max(Vote_Percent) FROM election
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT min(Vote_Percent) ,  max(Vote_Percent) FROM election
##Instruction:
Database: election_representative
Total Tables: 2
Total Columns: 12

Table Schemas:

election_representative contains tables such as election, representative.
Table election has columns such as Election_ID, Representative_ID, Date, Votes, Vote_Percent, Seats, Place.
Election_ID is the primary key.
Table representative has columns such as Representative_ID, Name, State, Party, Lifespan.
Representative_ID is the primary key.
The Representative_ID of election is the foreign key of Representative_ID of representative.

##Role Access Policy (Column-Level):
Role: DataOperator_1
Accessible Columns:
  - election: * (all columns)
  - representative: * (all columns)

Question: What are the names and parties of representatives?
Answer: SELECT Name ,  Party FROM representative
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT Name ,  Party FROM representative
##Instruction:
Database: election_representative
Total Tables: 2
Total Columns: 12

Table Schemas:

election_representative contains tables such as election, representative.
Table election has columns such as Election_ID, Representative_ID, Date, Votes, Vote_Percent, Seats, Place.
Election_ID is the primary key.
Table representative has columns such as Representative_ID, Name, State, Party, Lifespan.
Representative_ID is the primary key.
The Representative_ID of election is the foreign key of Representative_ID of representative.

##Role Access Policy (Column-Level):
Role: DataOperator_1
Accessible Columns:
  - election: * (all columns)
  - representative: * (all columns)

Question: What are the names of representatives whose party is not "Republican"?
Answer: SELECT Name FROM Representative WHERE Party != "Republican"
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT Name FROM Representative WHERE Party != "Republican"
##Instruction:
Database: election_representative
Total Tables: 2
Total Columns: 12

Table Schemas:

election_representative contains tables such as election, representative.
Table election has columns such as Election_ID, Representative_ID, Date, Votes, Vote_Percent, Seats, Place.
Election_ID is the primary key.
Table representative has columns such as Representative_ID, Name, State, Party, Lifespan.
Representative_ID is the primary key.
The Representative_ID of election is the foreign key of Representative_ID of representative.

##Role Access Policy (Column-Level):
Role: DataOperator_1
Accessible Columns:
  - election: * (all columns)
  - representative: * (all columns)

Question: What are the life spans of representatives from New York state or Indiana state?
Answer: SELECT Lifespan FROM representative WHERE State  =  "New York" OR State  =  "Indiana"
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT Lifespan FROM representative WHERE State  =  "New York" OR State  =  "Indiana"
##Instruction:
Database: election_representative
Total Tables: 2
Total Columns: 12

Table Schemas:

election_representative contains tables such as election, representative.
Table election has columns such as Election_ID, Representative_ID, Date, Votes, Vote_Percent, Seats, Place.
Election_ID is the primary key.
Table representative has columns such as Representative_ID, Name, State, Party, Lifespan.
Representative_ID is the primary key.
The Representative_ID of election is the foreign key of Representative_ID of representative.

##Role Access Policy (Column-Level):
Role: DataOperator_1
Accessible Columns:
  - election: * (all columns)
  - representative: * (all columns)

Question: What are the names of representatives and the dates of elections they participated in.
Answer: SELECT T2.Name ,  T1.Date FROM election AS T1 JOIN representative AS T2 ON T1.Representative_ID  =  T2.Representative_ID
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT T2.Name ,  T1.Date FROM election AS T1 JOIN representative AS T2 ON T1.Representative_ID  =  T2.Representative_ID
##Instruction:
Database: election_representative
Total Tables: 2
Total Columns: 12

Table Schemas:

election_representative contains tables such as election, representative.
Table election has columns such as Election_ID, Representative_ID, Date, Votes, Vote_Percent, Seats, Place.
Election_ID is the primary key.
Table representative has columns such as Representative_ID, Name, State, Party, Lifespan.
Representative_ID is the primary key.
The Representative_ID of election is the foreign key of Representative_ID of representative.

##Role Access Policy (Column-Level):
Role: DataOperator_1
Accessible Columns:
  - election: * (all columns)
  - representative: * (all columns)

Question: What are the names of representatives with more than 10000 votes in election?
Answer: SELECT T2.Name FROM election AS T1 JOIN representative AS T2 ON T1.Representative_ID  =  T2.Representative_ID WHERE Votes  >  10000
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT T2.Name FROM election AS T1 JOIN representative AS T2 ON T1.Representative_ID  =  T2.Representative_ID WHERE Votes  >  10000
##Instruction:
Database: election_representative
Total Tables: 2
Total Columns: 12

Table Schemas:

election_representative contains tables such as election, representative.
Table election has columns such as Election_ID, Representative_ID, Date, Votes, Vote_Percent, Seats, Place.
Election_ID is the primary key.
Table representative has columns such as Representative_ID, Name, State, Party, Lifespan.
Representative_ID is the primary key.
The Representative_ID of election is the foreign key of Representative_ID of representative.

##Role Access Policy (Column-Level):
Role: DataOperator_1
Accessible Columns:
  - election: * (all columns)
  - representative: * (all columns)

Question: What are the names of representatives in descending order of votes?
Answer: SELECT T2.Name FROM election AS T1 JOIN representative AS T2 ON T1.Representative_ID  =  T2.Representative_ID ORDER BY votes DESC
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT T2.Name FROM election AS T1 JOIN representative AS T2 ON T1.Representative_ID  =  T2.Representative_ID ORDER BY votes DESC
##Instruction:
Database: election_representative
Total Tables: 2
Total Columns: 12

Table Schemas:

election_representative contains tables such as election, representative.
Table election has columns such as Election_ID, Representative_ID, Date, Votes, Vote_Percent, Seats, Place.
Election_ID is the primary key.
Table representative has columns such as Representative_ID, Name, State, Party, Lifespan.
Representative_ID is the primary key.
The Representative_ID of election is the foreign key of Representative_ID of representative.

##Role Access Policy (Column-Level):
Role: DataOperator_1
Accessible Columns:
  - election: * (all columns)
  - representative: * (all columns)

Question: What is the party of the representative that has the smallest number of votes.
Answer: SELECT T2.Party FROM election AS T1 JOIN representative AS T2 ON T1.Representative_ID  =  T2.Representative_ID ORDER BY votes ASC LIMIT 1
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT T2.Party FROM election AS T1 JOIN representative AS T2 ON T1.Representative_ID  =  T2.Representative_ID ORDER BY votes ASC LIMIT 1
##Instruction:
Database: election_representative
Total Tables: 2
Total Columns: 12

Table Schemas:

election_representative contains tables such as election, representative.
Table election has columns such as Election_ID, Representative_ID, Date, Votes, Vote_Percent, Seats, Place.
Election_ID is the primary key.
Table representative has columns such as Representative_ID, Name, State, Party, Lifespan.
Representative_ID is the primary key.
The Representative_ID of election is the foreign key of Representative_ID of representative.

##Role Access Policy (Column-Level):
Role: DataOperator_1
Accessible Columns:
  - election: * (all columns)
  - representative: * (all columns)

Question: What are the lifespans of representatives in descending order of vote percent?
Answer: SELECT T2.Lifespan FROM election AS T1 JOIN representative AS T2 ON T1.Representative_ID  =  T2.Representative_ID ORDER BY Vote_Percent DESC
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT T2.Lifespan FROM election AS T1 JOIN representative AS T2 ON T1.Representative_ID  =  T2.Representative_ID ORDER BY Vote_Percent DESC
##Instruction:
Database: election_representative
Total Tables: 2
Total Columns: 12

Table Schemas:

election_representative contains tables such as election, representative.
Table election has columns such as Election_ID, Representative_ID, Date, Votes, Vote_Percent, Seats, Place.
Election_ID is the primary key.
Table representative has columns such as Representative_ID, Name, State, Party, Lifespan.
Representative_ID is the primary key.
The Representative_ID of election is the foreign key of Representative_ID of representative.

##Role Access Policy (Column-Level):
Role: DataOperator_1
Accessible Columns:
  - election: * (all columns)
  - representative: * (all columns)

Question: What is the average number of votes of representatives from party "Republican"?
Answer: SELECT avg(T1.Votes) FROM election AS T1 JOIN representative AS T2 ON T1.Representative_ID  =  T2.Representative_ID WHERE T2.Party  =  "Republican"
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT avg(T1.Votes) FROM election AS T1 JOIN representative AS T2 ON T1.Representative_ID  =  T2.Representative_ID WHERE T2.Party  =  "Republican"
##Instruction:
Database: election_representative
Total Tables: 2
Total Columns: 12

Table Schemas:

election_representative contains tables such as election, representative.
Table election has columns such as Election_ID, Representative_ID, Date, Votes, Vote_Percent, Seats, Place.
Election_ID is the primary key.
Table representative has columns such as Representative_ID, Name, State, Party, Lifespan.
Representative_ID is the primary key.
The Representative_ID of election is the foreign key of Representative_ID of representative.

##Role Access Policy (Column-Level):
Role: DataOperator_1
Accessible Columns:
  - election: * (all columns)
  - representative: * (all columns)

Question: What are the different parties of representative? Show the party name and the number of representatives in each party.
Answer: SELECT Party ,  COUNT(*) FROM representative GROUP BY Party
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT Party ,  COUNT(*) FROM representative GROUP BY Party
##Instruction:
Database: election_representative
Total Tables: 2
Total Columns: 12

Table Schemas:

election_representative contains tables such as election, representative.
Table election has columns such as Election_ID, Representative_ID, Date, Votes, Vote_Percent, Seats, Place.
Election_ID is the primary key.
Table representative has columns such as Representative_ID, Name, State, Party, Lifespan.
Representative_ID is the primary key.
The Representative_ID of election is the foreign key of Representative_ID of representative.

##Role Access Policy (Column-Level):
Role: DataOperator_1
Accessible Columns:
  - election: * (all columns)
  - representative: * (all columns)

Question: What is the party that has the largest number of representatives?
Answer: SELECT Party ,  COUNT(*) FROM representative GROUP BY Party ORDER BY COUNT(*) DESC LIMIT 1
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT Party ,  COUNT(*) FROM representative GROUP BY Party ORDER BY COUNT(*) DESC LIMIT 1
##Instruction:
Database: election_representative
Total Tables: 2
Total Columns: 12

Table Schemas:

election_representative contains tables such as election, representative.
Table election has columns such as Election_ID, Representative_ID, Date, Votes, Vote_Percent, Seats, Place.
Election_ID is the primary key.
Table representative has columns such as Representative_ID, Name, State, Party, Lifespan.
Representative_ID is the primary key.
The Representative_ID of election is the foreign key of Representative_ID of representative.

##Role Access Policy (Column-Level):
Role: DataOperator_1
Accessible Columns:
  - election: * (all columns)
  - representative: * (all columns)

Question: What parties have at least three representatives?
Answer: SELECT Party FROM representative GROUP BY Party HAVING COUNT(*)  >=  3
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT Party FROM representative GROUP BY Party HAVING COUNT(*)  >=  3
##Instruction:
Database: election_representative
Total Tables: 2
Total Columns: 12

Table Schemas:

election_representative contains tables such as election, representative.
Table election has columns such as Election_ID, Representative_ID, Date, Votes, Vote_Percent, Seats, Place.
Election_ID is the primary key.
Table representative has columns such as Representative_ID, Name, State, Party, Lifespan.
Representative_ID is the primary key.
The Representative_ID of election is the foreign key of Representative_ID of representative.

##Role Access Policy (Column-Level):
Role: DataOperator_1
Accessible Columns:
  - election: * (all columns)
  - representative: * (all columns)

Question: What states have at least two representatives?
Answer: SELECT State FROM representative GROUP BY State HAVING COUNT(*)  >=  2
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT State FROM representative GROUP BY State HAVING COUNT(*)  >=  2
##Instruction:
Database: election_representative
Total Tables: 2
Total Columns: 12

Table Schemas:

election_representative contains tables such as election, representative.
Table election has columns such as Election_ID, Representative_ID, Date, Votes, Vote_Percent, Seats, Place.
Election_ID is the primary key.
Table representative has columns such as Representative_ID, Name, State, Party, Lifespan.
Representative_ID is the primary key.
The Representative_ID of election is the foreign key of Representative_ID of representative.

##Role Access Policy (Column-Level):
Role: DataOperator_1
Accessible Columns:
  - election: * (all columns)
  - representative: * (all columns)

Question: List the names of representatives that have not participated in elections listed here.
Answer: SELECT Name FROM representative WHERE Representative_ID NOT IN (SELECT Representative_ID FROM election)
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT Name FROM representative WHERE Representative_ID NOT IN (SELECT Representative_ID FROM election)
##Instruction:
Database: election_representative
Total Tables: 2
Total Columns: 12

Table Schemas:

election_representative contains tables such as election, representative.
Table election has columns such as Election_ID, Representative_ID, Date, Votes, Vote_Percent, Seats, Place.
Election_ID is the primary key.
Table representative has columns such as Representative_ID, Name, State, Party, Lifespan.
Representative_ID is the primary key.
The Representative_ID of election is the foreign key of Representative_ID of representative.

##Role Access Policy (Column-Level):
Role: DataOperator_1
Accessible Columns:
  - election: * (all columns)
  - representative: * (all columns)

Question: Show the parties that have both representatives in New York state and representatives in Pennsylvania state.
Answer: SELECT Party FROM representative WHERE State  =  "New York" INTERSECT SELECT Party FROM representative WHERE State  =  "Pennsylvania"
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT Party FROM representative WHERE State  =  "New York" INTERSECT SELECT Party FROM representative WHERE State  =  "Pennsylvania"
##Instruction:
Database: election_representative
Total Tables: 2
Total Columns: 12

Table Schemas:

election_representative contains tables such as election, representative.
Table election has columns such as Election_ID, Representative_ID, Date, Votes, Vote_Percent, Seats, Place.
Election_ID is the primary key.
Table representative has columns such as Representative_ID, Name, State, Party, Lifespan.
Representative_ID is the primary key.
The Representative_ID of election is the foreign key of Representative_ID of representative.

##Role Access Policy (Column-Level):
Role: DataOperator_1
Accessible Columns:
  - election: * (all columns)
  - representative: * (all columns)

Question: How many distinct parties are there for representatives?
Answer: SELECT count(DISTINCT Party) FROM representative
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT count(DISTINCT Party) FROM representative
##Instruction:
Database: election_representative
Total Tables: 2
Total Columns: 12

Table Schemas:

election_representative contains tables such as election, representative.
Table election has columns such as Election_ID, Representative_ID, Date, Votes, Vote_Percent, Seats, Place.
Election_ID is the primary key.
Table representative has columns such as Representative_ID, Name, State, Party, Lifespan.
Representative_ID is the primary key.
The Representative_ID of election is the foreign key of Representative_ID of representative.

##Role Access Policy (Column-Level):
Role: DataOperator_2
Accessible Columns:
  - election: * (all columns)
  - representative: Lifespan

Question: How many elections are there?
Answer: SELECT count(*) FROM election
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT count(*) FROM election
##Instruction:
Database: election_representative
Total Tables: 2
Total Columns: 12

Table Schemas:

election_representative contains tables such as election, representative.
Table election has columns such as Election_ID, Representative_ID, Date, Votes, Vote_Percent, Seats, Place.
Election_ID is the primary key.
Table representative has columns such as Representative_ID, Name, State, Party, Lifespan.
Representative_ID is the primary key.
The Representative_ID of election is the foreign key of Representative_ID of representative.

##Role Access Policy (Column-Level):
Role: DataOperator_2
Accessible Columns:
  - election: * (all columns)
  - representative: Lifespan

Question: List the votes of elections in descending order.
Answer: SELECT Votes FROM election ORDER BY Votes DESC
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT Votes FROM election ORDER BY Votes DESC
##Instruction:
Database: election_representative
Total Tables: 2
Total Columns: 12

Table Schemas:

election_representative contains tables such as election, representative.
Table election has columns such as Election_ID, Representative_ID, Date, Votes, Vote_Percent, Seats, Place.
Election_ID is the primary key.
Table representative has columns such as Representative_ID, Name, State, Party, Lifespan.
Representative_ID is the primary key.
The Representative_ID of election is the foreign key of Representative_ID of representative.

##Role Access Policy (Column-Level):
Role: DataOperator_2
Accessible Columns:
  - election: * (all columns)
  - representative: Lifespan

Question: List the dates and vote percents of elections.
Answer: SELECT Date ,  Vote_Percent FROM election
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT Date ,  Vote_Percent FROM election