sert121/SpiderSQL huggingface dataset:
-- Language PostgreSQL
        -- Tables: 
             -- Table: accounts 
columns : [['account id', 'number'], ['customer id', 'number'], ['account name', 'text'], ['other account details', 'text']]

 -- Table: customers 
columns : [['customer id', 'number'], ['customer first name', 'text'], ['customer last name', 'text'], ['customer address', 'text'], ['customer phone', 'text'], ['customer email', 'text'], ['other customer details', 'text']]

 -- Table: customers cards 
columns : [['card id', 'number'], ['customer id', 'number'], ['card type code', 'text'], ['card number', 'text'], ['date valid from', 'time'], ['date valid to', 'time'], ['other card details', 'text']]

 -- Table: financial transactions 
columns : [['transaction id', 'number'], ['previous transaction id', 'number'], ['account id', 'number'], ['card id', 'number'], ['transaction type', 'text'], ['transaction date', 'time'], ['transaction amount', 'number'], ['transaction comment', 'text'], ['other transaction details', 'text']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: Return the average transaction amount, as well as the total amount of all transactions.
SQL: SELECT avg(transaction_amount) ,  sum(transaction_amount) FROM Financial_transactions
-- Language PostgreSQL
        -- Tables: 
             -- Table: accounts 
columns : [['account id', 'number'], ['customer id', 'number'], ['account name', 'text'], ['other account details', 'text']]

 -- Table: customers 
columns : [['customer id', 'number'], ['customer first name', 'text'], ['customer last name', 'text'], ['customer address', 'text'], ['customer phone', 'text'], ['customer email', 'text'], ['other customer details', 'text']]

 -- Table: customers cards 
columns : [['card id', 'number'], ['customer id', 'number'], ['card type code', 'text'], ['card number', 'text'], ['date valid from', 'time'], ['date valid to', 'time'], ['other card details', 'text']]

 -- Table: financial transactions 
columns : [['transaction id', 'number'], ['previous transaction id', 'number'], ['account id', 'number'], ['card id', 'number'], ['transaction type', 'text'], ['transaction date', 'time'], ['transaction amount', 'number'], ['transaction comment', 'text'], ['other transaction details', 'text']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: Show the card type codes and the number of transactions.
SQL: SELECT T2.card_type_code ,  count(*) FROM Financial_transactions AS T1 JOIN Customers_cards AS T2 ON T1.card_id  =  T2.card_id GROUP BY T2.card_type_code
-- Language PostgreSQL
        -- Tables: 
             -- Table: accounts 
columns : [['account id', 'number'], ['customer id', 'number'], ['account name', 'text'], ['other account details', 'text']]

 -- Table: customers 
columns : [['customer id', 'number'], ['customer first name', 'text'], ['customer last name', 'text'], ['customer address', 'text'], ['customer phone', 'text'], ['customer email', 'text'], ['other customer details', 'text']]

 -- Table: customers cards 
columns : [['card id', 'number'], ['customer id', 'number'], ['card type code', 'text'], ['card number', 'text'], ['date valid from', 'time'], ['date valid to', 'time'], ['other card details', 'text']]

 -- Table: financial transactions 
columns : [['transaction id', 'number'], ['previous transaction id', 'number'], ['account id', 'number'], ['card id', 'number'], ['transaction type', 'text'], ['transaction date', 'time'], ['transaction amount', 'number'], ['transaction comment', 'text'], ['other transaction details', 'text']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: What are the different card types, and how many transactions have been made with each?
SQL: SELECT T2.card_type_code ,  count(*) FROM Financial_transactions AS T1 JOIN Customers_cards AS T2 ON T1.card_id  =  T2.card_id GROUP BY T2.card_type_code
-- Language PostgreSQL
        -- Tables: 
             -- Table: accounts 
columns : [['account id', 'number'], ['customer id', 'number'], ['account name', 'text'], ['other account details', 'text']]

 -- Table: customers 
columns : [['customer id', 'number'], ['customer first name', 'text'], ['customer last name', 'text'], ['customer address', 'text'], ['customer phone', 'text'], ['customer email', 'text'], ['other customer details', 'text']]

 -- Table: customers cards 
columns : [['card id', 'number'], ['customer id', 'number'], ['card type code', 'text'], ['card number', 'text'], ['date valid from', 'time'], ['date valid to', 'time'], ['other card details', 'text']]

 -- Table: financial transactions 
columns : [['transaction id', 'number'], ['previous transaction id', 'number'], ['account id', 'number'], ['card id', 'number'], ['transaction type', 'text'], ['transaction date', 'time'], ['transaction amount', 'number'], ['transaction comment', 'text'], ['other transaction details', 'text']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: Show the transaction type and the number of transactions.
SQL: SELECT transaction_type ,  count(*) FROM Financial_transactions GROUP BY transaction_type
-- Language PostgreSQL
        -- Tables: 
             -- Table: accounts 
columns : [['account id', 'number'], ['customer id', 'number'], ['account name', 'text'], ['other account details', 'text']]

 -- Table: customers 
columns : [['customer id', 'number'], ['customer first name', 'text'], ['customer last name', 'text'], ['customer address', 'text'], ['customer phone', 'text'], ['customer email', 'text'], ['other customer details', 'text']]

 -- Table: customers cards 
columns : [['card id', 'number'], ['customer id', 'number'], ['card type code', 'text'], ['card number', 'text'], ['date valid from', 'time'], ['date valid to', 'time'], ['other card details', 'text']]

 -- Table: financial transactions 
columns : [['transaction id', 'number'], ['previous transaction id', 'number'], ['account id', 'number'], ['card id', 'number'], ['transaction type', 'text'], ['transaction date', 'time'], ['transaction amount', 'number'], ['transaction comment', 'text'], ['other transaction details', 'text']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: What are the different transaction types, and how many transactions of each have taken place?
SQL: SELECT transaction_type ,  count(*) FROM Financial_transactions GROUP BY transaction_type
-- Language PostgreSQL
        -- Tables: 
             -- Table: accounts 
columns : [['account id', 'number'], ['customer id', 'number'], ['account name', 'text'], ['other account details', 'text']]

 -- Table: customers 
columns : [['customer id', 'number'], ['customer first name', 'text'], ['customer last name', 'text'], ['customer address', 'text'], ['customer phone', 'text'], ['customer email', 'text'], ['other customer details', 'text']]

 -- Table: customers cards 
columns : [['card id', 'number'], ['customer id', 'number'], ['card type code', 'text'], ['card number', 'text'], ['date valid from', 'time'], ['date valid to', 'time'], ['other card details', 'text']]

 -- Table: financial transactions 
columns : [['transaction id', 'number'], ['previous transaction id', 'number'], ['account id', 'number'], ['card id', 'number'], ['transaction type', 'text'], ['transaction date', 'time'], ['transaction amount', 'number'], ['transaction comment', 'text'], ['other transaction details', 'text']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: What is the transaction type that has processed the greatest total amount in transactions?
SQL: SELECT transaction_type FROM Financial_transactions GROUP BY transaction_type ORDER BY sum(transaction_amount) DESC LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: accounts 
columns : [['account id', 'number'], ['customer id', 'number'], ['account name', 'text'], ['other account details', 'text']]

 -- Table: customers 
columns : [['customer id', 'number'], ['customer first name', 'text'], ['customer last name', 'text'], ['customer address', 'text'], ['customer phone', 'text'], ['customer email', 'text'], ['other customer details', 'text']]

 -- Table: customers cards 
columns : [['card id', 'number'], ['customer id', 'number'], ['card type code', 'text'], ['card number', 'text'], ['date valid from', 'time'], ['date valid to', 'time'], ['other card details', 'text']]

 -- Table: financial transactions 
columns : [['transaction id', 'number'], ['previous transaction id', 'number'], ['account id', 'number'], ['card id', 'number'], ['transaction type', 'text'], ['transaction date', 'time'], ['transaction amount', 'number'], ['transaction comment', 'text'], ['other transaction details', 'text']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: Return the type of transaction with the highest total amount.
SQL: SELECT transaction_type FROM Financial_transactions GROUP BY transaction_type ORDER BY sum(transaction_amount) DESC LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: accounts 
columns : [['account id', 'number'], ['customer id', 'number'], ['account name', 'text'], ['other account details', 'text']]

 -- Table: customers 
columns : [['customer id', 'number'], ['customer first name', 'text'], ['customer last name', 'text'], ['customer address', 'text'], ['customer phone', 'text'], ['customer email', 'text'], ['other customer details', 'text']]

 -- Table: customers cards 
columns : [['card id', 'number'], ['customer id', 'number'], ['card type code', 'text'], ['card number', 'text'], ['date valid from', 'time'], ['date valid to', 'time'], ['other card details', 'text']]

 -- Table: financial transactions 
columns : [['transaction id', 'number'], ['previous transaction id', 'number'], ['account id', 'number'], ['card id', 'number'], ['transaction type', 'text'], ['transaction date', 'time'], ['transaction amount', 'number'], ['transaction comment', 'text'], ['other transaction details', 'text']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: Show the account id and the number of transactions for each account
SQL: SELECT account_id ,  count(*) FROM Financial_transactions GROUP BY account_id
-- Language PostgreSQL
        -- Tables: 
             -- Table: accounts 
columns : [['account id', 'number'], ['customer id', 'number'], ['account name', 'text'], ['other account details', 'text']]

 -- Table: customers 
columns : [['customer id', 'number'], ['customer first name', 'text'], ['customer last name', 'text'], ['customer address', 'text'], ['customer phone', 'text'], ['customer email', 'text'], ['other customer details', 'text']]

 -- Table: customers cards 
columns : [['card id', 'number'], ['customer id', 'number'], ['card type code', 'text'], ['card number', 'text'], ['date valid from', 'time'], ['date valid to', 'time'], ['other card details', 'text']]

 -- Table: financial transactions 
columns : [['transaction id', 'number'], ['previous transaction id', 'number'], ['account id', 'number'], ['card id', 'number'], ['transaction type', 'text'], ['transaction date', 'time'], ['transaction amount', 'number'], ['transaction comment', 'text'], ['other transaction details', 'text']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: What are the different account ids that have made financial transactions, as well as how many transactions correspond to each?
SQL: SELECT account_id ,  count(*) FROM Financial_transactions GROUP BY account_id
-- Language PostgreSQL
        -- Tables: 
             -- Table: race 
columns : [['race id', 'number'], ['name', 'text'], ['class', 'text'], ['date', 'text'], ['track id', 'text']]

 -- Table: track 
columns : [['track id', 'number'], ['name', 'text'], ['location', 'text'], ['seating', 'number'], ['year opened', 'number']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: How many tracks do we have?
SQL: SELECT count(*) FROM track
-- Language PostgreSQL
        -- Tables: 
             -- Table: race 
columns : [['race id', 'number'], ['name', 'text'], ['class', 'text'], ['date', 'text'], ['track id', 'text']]

 -- Table: track 
columns : [['track id', 'number'], ['name', 'text'], ['location', 'text'], ['seating', 'number'], ['year opened', 'number']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: Count the number of tracks.
SQL: SELECT count(*) FROM track
-- Language PostgreSQL
        -- Tables: 
             -- Table: race 
columns : [['race id', 'number'], ['name', 'text'], ['class', 'text'], ['date', 'text'], ['track id', 'text']]

 -- Table: track 
columns : [['track id', 'number'], ['name', 'text'], ['location', 'text'], ['seating', 'number'], ['year opened', 'number']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: Show the name and location for all tracks.
SQL: SELECT name ,  LOCATION FROM track
-- Language PostgreSQL
        -- Tables: 
             -- Table: race 
columns : [['race id', 'number'], ['name', 'text'], ['class', 'text'], ['date', 'text'], ['track id', 'text']]

 -- Table: track 
columns : [['track id', 'number'], ['name', 'text'], ['location', 'text'], ['seating', 'number'], ['year opened', 'number']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: What are the names and locations of all tracks?
SQL: SELECT name ,  LOCATION FROM track
-- Language PostgreSQL
        -- Tables: 
             -- Table: race 
columns : [['race id', 'number'], ['name', 'text'], ['class', 'text'], ['date', 'text'], ['track id', 'text']]

 -- Table: track 
columns : [['track id', 'number'], ['name', 'text'], ['location', 'text'], ['seating', 'number'], ['year opened', 'number']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: Show names and seatings, ordered by seating for all tracks opened after 2000.
SQL: SELECT name ,  seating FROM track WHERE year_opened  >  2000 ORDER BY seating
-- Language PostgreSQL
        -- Tables: 
             -- Table: race 
columns : [['race id', 'number'], ['name', 'text'], ['class', 'text'], ['date', 'text'], ['track id', 'text']]

 -- Table: track 
columns : [['track id', 'number'], ['name', 'text'], ['location', 'text'], ['seating', 'number'], ['year opened', 'number']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: What are the names and seatings for all tracks opened after 2000, ordered by seating?
SQL: SELECT name ,  seating FROM track WHERE year_opened  >  2000 ORDER BY seating
-- Language PostgreSQL
        -- Tables: 
             -- Table: race 
columns : [['race id', 'number'], ['name', 'text'], ['class', 'text'], ['date', 'text'], ['track id', 'text']]

 -- Table: track 
columns : [['track id', 'number'], ['name', 'text'], ['location', 'text'], ['seating', 'number'], ['year opened', 'number']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: What is the name, location and seating for the most recently opened track?
SQL: SELECT name ,  LOCATION ,  seating FROM track ORDER BY year_opened DESC LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: race 
columns : [['race id', 'number'], ['name', 'text'], ['class', 'text'], ['date', 'text'], ['track id', 'text']]

 -- Table: track 
columns : [['track id', 'number'], ['name', 'text'], ['location', 'text'], ['seating', 'number'], ['year opened', 'number']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: Return the name, location, and seating of the track that was opened in the most recent year.
SQL: SELECT name ,  LOCATION ,  seating FROM track ORDER BY year_opened DESC LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: race 
columns : [['race id', 'number'], ['name', 'text'], ['class', 'text'], ['date', 'text'], ['track id', 'text']]

 -- Table: track 
columns : [['track id', 'number'], ['name', 'text'], ['location', 'text'], ['seating', 'number'], ['year opened', 'number']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: What is the minimum, maximum, and average seating for all tracks.
SQL: SELECT min(seating) ,  max(seating) ,  avg(seating) FROM track
-- Language PostgreSQL
        -- Tables: 
             -- Table: race 
columns : [['race id', 'number'], ['name', 'text'], ['class', 'text'], ['date', 'text'], ['track id', 'text']]

 -- Table: track 
columns : [['track id', 'number'], ['name', 'text'], ['location', 'text'], ['seating', 'number'], ['year opened', 'number']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: Return the minimum, maximum, and average seating across all tracks.
SQL: SELECT min(seating) ,  max(seating) ,  avg(seating) FROM track
-- Language PostgreSQL
        -- Tables: 
             -- Table: race 
columns : [['race id', 'number'], ['name', 'text'], ['class', 'text'], ['date', 'text'], ['track id', 'text']]

 -- Table: track 
columns : [['track id', 'number'], ['name', 'text'], ['location', 'text'], ['seating', 'number'], ['year opened', 'number']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: Show the name, location, open year for all tracks with a seating higher than the average.
SQL: SELECT name ,  LOCATION ,  year_opened FROM track WHERE seating  >  (SELECT avg(seating) FROM track)
-- Language PostgreSQL
        -- Tables: 
             -- Table: race 
columns : [['race id', 'number'], ['name', 'text'], ['class', 'text'], ['date', 'text'], ['track id', 'text']]

 -- Table: track 
columns : [['track id', 'number'], ['name', 'text'], ['location', 'text'], ['seating', 'number'], ['year opened', 'number']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: What are the names, locations, and years of opening for tracks with seating higher than average?
SQL: SELECT name ,  LOCATION ,  year_opened FROM track WHERE seating  >  (SELECT avg(seating) FROM track)
-- Language PostgreSQL
        -- Tables: 
             -- Table: race 
columns : [['race id', 'number'], ['name', 'text'], ['class', 'text'], ['date', 'text'], ['track id', 'text']]

 -- Table: track 
columns : [['track id', 'number'], ['name', 'text'], ['location', 'text'], ['seating', 'number'], ['year opened', 'number']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: What are distinct locations where tracks are located?
SQL: SELECT DISTINCT LOCATION FROM track
-- Language PostgreSQL
        -- Tables: 
             -- Table: race 
columns : [['race id', 'number'], ['name', 'text'], ['class', 'text'], ['date', 'text'], ['track id', 'text']]

 -- Table: track 
columns : [['track id', 'number'], ['name', 'text'], ['location', 'text'], ['seating', 'number'], ['year opened', 'number']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: Give the different locations of tracks.
SQL: SELECT DISTINCT LOCATION FROM track
-- Language PostgreSQL
        -- Tables: 
             -- Table: race 
columns : [['race id', 'number'], ['name', 'text'], ['class', 'text'], ['date', 'text'], ['track id', 'text']]

 -- Table: track 
columns : [['track id', 'number'], ['name', 'text'], ['location', 'text'], ['seating', 'number'], ['year opened', 'number']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: How many races are there?
SQL: SELECT count(*) FROM race
-- Language PostgreSQL
        -- Tables: 
             -- Table: race 
columns : [['race id', 'number'], ['name', 'text'], ['class', 'text'], ['date', 'text'], ['track id', 'text']]

 -- Table: track 
columns : [['track id', 'number'], ['name', 'text'], ['location', 'text'], ['seating', 'number'], ['year opened', 'number']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: Count the number of races.
SQL: SELECT count(*) FROM race
-- Language PostgreSQL
        -- Tables: 
             -- Table: race 
columns : [['race id', 'number'], ['name', 'text'], ['class', 'text'], ['date', 'text'], ['track id', 'text']]

 -- Table: track 
columns : [['track id', 'number'], ['name', 'text'], ['location', 'text'], ['seating', 'number'], ['year opened', 'number']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: What are the distinct classes that races can have?
SQL: SELECT DISTINCT CLASS FROM race
-- Language PostgreSQL
        -- Tables: 
             -- Table: race 
columns : [['race id', 'number'], ['name', 'text'], ['class', 'text'], ['date', 'text'], ['track id', 'text']]

 -- Table: track 
columns : [['track id', 'number'], ['name', 'text'], ['location', 'text'], ['seating', 'number'], ['year opened', 'number']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: Return the different classes of races.
SQL: SELECT DISTINCT CLASS FROM race
-- Language PostgreSQL
        -- Tables: 
             -- Table: race 
columns : [['race id', 'number'], ['name', 'text'], ['class', 'text'], ['date', 'text'], ['track id', 'text']]

 -- Table: track 
columns : [['track id', 'number'], ['name', 'text'], ['location', 'text'], ['seating', 'number'], ['year opened', 'number']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: Show name, class, and date for all races.
SQL: SELECT name ,  CLASS ,  date FROM race
-- Language PostgreSQL
        -- Tables: 
             -- Table: race 
columns : [['race id', 'number'], ['name', 'text'], ['class', 'text'], ['date', 'text'], ['track id', 'text']]

 -- Table: track 
columns : [['track id', 'number'], ['name', 'text'], ['location', 'text'], ['seating', 'number'], ['year opened', 'number']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: What are the names, classes, and dates for all races?
SQL: SELECT name ,  CLASS ,  date FROM race
-- Language PostgreSQL
        -- Tables: 
             -- Table: race 
columns : [['race id', 'number'], ['name', 'text'], ['class', 'text'], ['date', 'text'], ['track id', 'text']]

 -- Table: track 
columns : [['track id', 'number'], ['name', 'text'], ['location', 'text'], ['seating', 'number'], ['year opened', 'number']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: Show the race class and number of races in each class.
SQL: SELECT CLASS ,  count(*) FROM race GROUP BY CLASS
-- Language PostgreSQL
        -- Tables: 
             -- Table: race 
columns : [['race id', 'number'], ['name', 'text'], ['class', 'text'], ['date', 'text'], ['track id', 'text']]

 -- Table: track 
columns : [['track id', 'number'], ['name', 'text'], ['location', 'text'], ['seating', 'number'], ['year opened', 'number']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: What are the different classes of races, and how many races correspond to each?
SQL: SELECT CLASS ,  count(*) FROM race GROUP BY CLASS
-- Language PostgreSQL
        -- Tables: 
             -- Table: race 
columns : [['race id', 'number'], ['name', 'text'], ['class', 'text'], ['date', 'text'], ['track id', 'text']]

 -- Table: track 
columns : [['track id', 'number'], ['name', 'text'], ['location', 'text'], ['seating', 'number'], ['year opened', 'number']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: What is the race class with most number of races.
SQL: SELECT CLASS FROM race GROUP BY CLASS ORDER BY count(*) DESC LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: race 
columns : [['race id', 'number'], ['name', 'text'], ['class', 'text'], ['date', 'text'], ['track id', 'text']]

 -- Table: track 
columns : [['track id', 'number'], ['name', 'text'], ['location', 'text'], ['seating', 'number'], ['year opened', 'number']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: Give the class of races that is most common.
SQL: SELECT CLASS FROM race GROUP BY CLASS ORDER BY count(*) DESC LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: race 
columns : [['race id', 'number'], ['name', 'text'], ['class', 'text'], ['date', 'text'], ['track id', 'text']]

 -- Table: track 
columns : [['track id', 'number'], ['name', 'text'], ['location', 'text'], ['seating', 'number'], ['year opened', 'number']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: List the race class with at least two races.
SQL: SELECT CLASS FROM race GROUP BY CLASS HAVING count(*)  >=  2
-- Language PostgreSQL
        -- Tables: 
             -- Table: race 
columns : [['race id', 'number'], ['name', 'text'], ['class', 'text'], ['date', 'text'], ['track id', 'text']]

 -- Table: track 
columns : [['track id', 'number'], ['name', 'text'], ['location', 'text'], ['seating', 'number'], ['year opened', 'number']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: What are the classes of races that have two or more corresponding races?
SQL: SELECT CLASS FROM race GROUP BY CLASS HAVING count(*)  >=  2
-- Language PostgreSQL
        -- Tables: 
             -- Table: race 
columns : [['race id', 'number'], ['name', 'text'], ['class', 'text'], ['date', 'text'], ['track id', 'text']]

 -- Table: track 
columns : [['track id', 'number'], ['name', 'text'], ['location', 'text'], ['seating', 'number'], ['year opened', 'number']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: What are the names for tracks without a race in class 'GT'.
SQL: SELECT name FROM track EXCEPT SELECT T2.name FROM race AS T1 JOIN track AS T2 ON T1.track_id  =  T2.track_id WHERE T1.class  =  'GT'
-- Language PostgreSQL
        -- Tables: 
             -- Table: race 
columns : [['race id', 'number'], ['name', 'text'], ['class', 'text'], ['date', 'text'], ['track id', 'text']]

 -- Table: track 
columns : [['track id', 'number'], ['name', 'text'], ['location', 'text'], ['seating', 'number'], ['year opened', 'number']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: Give the names of tracks that do not have a race in the class 'GT'.
SQL: SELECT name FROM track EXCEPT SELECT T2.name FROM race AS T1 JOIN track AS T2 ON T1.track_id  =  T2.track_id WHERE T1.class  =  'GT'
-- Language PostgreSQL
        -- Tables: 
             -- Table: race 
columns : [['race id', 'number'], ['name', 'text'], ['class', 'text'], ['date', 'text'], ['track id', 'text']]

 -- Table: track 
columns : [['track id', 'number'], ['name', 'text'], ['location', 'text'], ['seating', 'number'], ['year opened', 'number']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: Show all track names that have had no races.
SQL: SELECT name FROM track WHERE track_id NOT IN (SELECT track_id FROM race)
-- Language PostgreSQL
        -- Tables: 
             -- Table: race 
columns : [['race id', 'number'], ['name', 'text'], ['class', 'text'], ['date', 'text'], ['track id', 'text']]

 -- Table: track 
columns : [['track id', 'number'], ['name', 'text'], ['location', 'text'], ['seating', 'number'], ['year opened', 'number']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: Return the names of tracks that have no had any races.
SQL: SELECT name FROM track WHERE track_id NOT IN (SELECT track_id FROM race)
-- Language PostgreSQL
        -- Tables: 
             -- Table: race 
columns : [['race id', 'number'], ['name', 'text'], ['class', 'text'], ['date', 'text'], ['track id', 'text']]

 -- Table: track 
columns : [['track id', 'number'], ['name', 'text'], ['location', 'text'], ['seating', 'number'], ['year opened', 'number']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: Show year where a track with a seating at least 5000 opened and a track with seating no more than 4000 opened.
SQL: SELECT year_opened FROM track WHERE seating BETWEEN 4000 AND 5000
-- Language PostgreSQL
        -- Tables: 
             -- Table: race 
columns : [['race id', 'number'], ['name', 'text'], ['class', 'text'], ['date', 'text'], ['track id', 'text']]

 -- Table: track 
columns : [['track id', 'number'], ['name', 'text'], ['location', 'text'], ['seating', 'number'], ['year opened', 'number']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: What are the years of opening for tracks with seating between 4000 and 5000?
SQL: SELECT year_opened FROM track WHERE seating BETWEEN 4000 AND 5000
-- Language PostgreSQL
        -- Tables: 
             -- Table: race 
columns : [['race id', 'number'], ['name', 'text'], ['class', 'text'], ['date', 'text'], ['track id', 'text']]

 -- Table: track 
columns : [['track id', 'number'], ['name', 'text'], ['location', 'text'], ['seating', 'number'], ['year opened', 'number']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: Show the name of track and the number of races in each track.
SQL: SELECT T2.name ,  count(*) FROM race AS T1 JOIN track AS T2 ON T1.track_id  =  T2.track_id GROUP BY T1.track_id
-- Language PostgreSQL
        -- Tables: 
             -- Table: race 
columns : [['race id', 'number'], ['name', 'text'], ['class', 'text'], ['date', 'text'], ['track id', 'text']]

 -- Table: track 
columns : [['track id', 'number'], ['name', 'text'], ['location', 'text'], ['seating', 'number'], ['year opened', 'number']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: What are the names of different tracks, and how many races has each had?
SQL: SELECT T2.name ,  count(*) FROM race AS T1 JOIN track AS T2 ON T1.track_id  =  T2.track_id GROUP BY T1.track_id
-- Language PostgreSQL
        -- Tables: 
             -- Table: race 
columns : [['race id', 'number'], ['name', 'text'], ['class', 'text'], ['date', 'text'], ['track id', 'text']]

 -- Table: track 
columns : [['track id', 'number'], ['name', 'text'], ['location', 'text'], ['seating', 'number'], ['year opened', 'number']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: Show the name of track with most number of races.
SQL: SELECT T2.name FROM race AS T1 JOIN track AS T2 ON T1.track_id  =  T2.track_id GROUP BY T1.track_id ORDER BY count(*) DESC LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: race 
columns : [['race id', 'number'], ['name', 'text'], ['class', 'text'], ['date', 'text'], ['track id', 'text']]

 -- Table: track 
columns : [['track id', 'number'], ['name', 'text'], ['location', 'text'], ['seating', 'number'], ['year opened', 'number']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: What is the name of the track that has had the greatest number of races?
SQL: SELECT T2.name FROM race AS T1 JOIN track AS T2 ON T1.track_id  =  T2.track_id GROUP BY T1.track_id ORDER BY count(*) DESC LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: race 
columns : [['race id', 'number'], ['name', 'text'], ['class', 'text'], ['date', 'text'], ['track id', 'text']]

 -- Table: track 
columns : [['track id', 'number'], ['name', 'text'], ['location', 'text'], ['seating', 'number'], ['year opened', 'number']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: Show the name and date for each race and its track name.
SQL: SELECT T1.name ,  T1.date ,  T2.name FROM race AS T1 JOIN track AS T2 ON T1.track_id  =  T2.track_id
-- Language PostgreSQL
        -- Tables: 
             -- Table: race 
columns : [['race id', 'number'], ['name', 'text'], ['class', 'text'], ['date', 'text'], ['track id', 'text']]

 -- Table: track 
columns : [['track id', 'number'], ['name', 'text'], ['location', 'text'], ['seating', 'number'], ['year opened', 'number']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: What are the names and dates of races, and the names of the tracks where they are held?
SQL: SELECT T1.name ,  T1.date ,  T2.name FROM race AS T1 JOIN track AS T2 ON T1.track_id  =  T2.track_id
-- Language PostgreSQL
        -- Tables: 
             -- Table: race 
columns : [['race id', 'number'], ['name', 'text'], ['class', 'text'], ['date', 'text'], ['track id', 'text']]

 -- Table: track 
columns : [['track id', 'number'], ['name', 'text'], ['location', 'text'], ['seating', 'number'], ['year opened', 'number']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: Show the name and location of track with 1 race.
SQL: SELECT T2.name ,  T2.location FROM race AS T1 JOIN track AS T2 ON T1.track_id  =  T2.track_id GROUP BY T1.track_id HAVING count(*)  =  1
-- Language PostgreSQL
        -- Tables: 
             -- Table: race 
columns : [['race id', 'number'], ['name', 'text'], ['class', 'text'], ['date', 'text'], ['track id', 'text']]

 -- Table: track 
columns : [['track id', 'number'], ['name', 'text'], ['location', 'text'], ['seating', 'number'], ['year opened', 'number']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: What are the names and locations of tracks that have had exactly 1 race?
SQL: SELECT T2.name ,  T2.location FROM race AS T1 JOIN track AS T2 ON T1.track_id  =  T2.track_id GROUP BY T1.track_id HAVING count(*)  =  1
-- Language PostgreSQL
        -- Tables: 
             -- Table: race 
columns : [['race id', 'number'], ['name', 'text'], ['class', 'text'], ['date', 'text'], ['track id', 'text']]

 -- Table: track 
columns : [['track id', 'number'], ['name', 'text'], ['location', 'text'], ['seating', 'number'], ['year opened', 'number']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: Find the locations where have both tracks with more than 90000 seats and tracks with less than 70000 seats.
SQL: SELECT LOCATION FROM track WHERE seating  >  90000 INTERSECT SELECT LOCATION FROM track WHERE seating  <  70000
-- Language PostgreSQL
        -- Tables: 
             -- Table: race 
columns : [['race id', 'number'], ['name', 'text'], ['class', 'text'], ['date', 'text'], ['track id', 'text']]

 -- Table: track 
columns : [['track id', 'number'], ['name', 'text'], ['location', 'text'], ['seating', 'number'], ['year opened', 'number']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: What are the locations that have both tracks with more than 90000 seats, and tracks with fewer than 70000 seats?
SQL: SELECT LOCATION FROM track WHERE seating  >  90000 INTERSECT SELECT LOCATION FROM track WHERE seating  <  70000
-- Language PostgreSQL
        -- Tables: 
             -- Table: shop 
columns : [['shop id', 'number'], ['address', 'text'], ['num of staff', 'text'], ['score', 'number'], ['open year', 'text']]

 -- Table: member 
columns : [['member id', 'number'], ['name', 'text'], ['membership card', 'text'], ['age', 'number'], ['time of purchase', 'number'], ['level of membership', 'number'], ['address', 'text']]

 -- Table: happy hour 
columns : [['hh id', 'number'], ['shop id', 'number'], ['month', 'text'], ['num of shaff in charge', 'number']]

 -- Table: happy hour member 
columns : [['hh id', 'number'], ['member id', 'number'], ['total amount', 'number']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: How many members have the black membership card?
SQL: SELECT count(*) FROM member WHERE Membership_card  =  'Black'