Input:
[INST] Here is a database schema:
ACCOUNTS :
custid [ INT ] primary_key
name [ TEXT ]

SAVINGS :
custid [ INT ] primary_key SAVINGS.custid = ACCOUNTS.custid
balance [ INT ]

CHECKING :
custid [ INT ] primary_key CHECKING.custid = ACCOUNTS.custid
balance [ INT ]

Please write me a SQL statement that answers the following question: Find the name of accounts whose checking balance is higher than corresponding saving balance. [/INST]

Output: SELECT T1.name FROM accounts AS T1 JOIN checking AS T2 ON T1.custid  =  T2.custid JOIN savings AS T3 ON T1.custid  =  T3.custid WHERE T2.balance  >  T3.balance;


Input:
[INST] Here is a database schema:
ACCOUNTS :
custid [ INT ] primary_key
name [ TEXT ]

SAVINGS :
custid [ INT ] primary_key SAVINGS.custid = ACCOUNTS.custid
balance [ INT ]

CHECKING :
custid [ INT ] primary_key CHECKING.custid = ACCOUNTS.custid
balance [ INT ]

Please write me a SQL statement that answers the following question: What are the names of customers with a higher checking balance than savings balance? [/INST]

Output: SELECT T1.name FROM accounts AS T1 JOIN checking AS T2 ON T1.custid  =  T2.custid JOIN savings AS T3 ON T1.custid  =  T3.custid WHERE T2.balance  >  T3.balance;


Input:
[INST] Here is a database schema:
ACCOUNTS :
custid [ INT ] primary_key
name [ TEXT ]

SAVINGS :
custid [ INT ] primary_key SAVINGS.custid = ACCOUNTS.custid
balance [ INT ]

CHECKING :
custid [ INT ] primary_key CHECKING.custid = ACCOUNTS.custid
balance [ INT ]

Please write me a SQL statement that answers the following question: Find the name and total checking and savings balance of the accounts whose savings balance is lower than corresponding checking balance. [/INST]

Output: SELECT T1.name ,  T3.balance + T2.balance FROM accounts AS T1 JOIN checking AS T2 ON T1.custid  =  T2.custid JOIN savings AS T3 ON T1.custid  =  T3.custid WHERE T3.balance  <  T2.balance;


Input:
[INST] Here is a database schema:
ACCOUNTS :
custid [ INT ] primary_key
name [ TEXT ]

SAVINGS :
custid [ INT ] primary_key SAVINGS.custid = ACCOUNTS.custid
balance [ INT ]

CHECKING :
custid [ INT ] primary_key CHECKING.custid = ACCOUNTS.custid
balance [ INT ]

Please write me a SQL statement that answers the following question: What are the names of customers who have a savings balance lower than their checking balance, and what is the total of their checking and savings balances? [/INST]

Output: SELECT T1.name ,  T3.balance + T2.balance FROM accounts AS T1 JOIN checking AS T2 ON T1.custid  =  T2.custid JOIN savings AS T3 ON T1.custid  =  T3.custid WHERE T3.balance  <  T2.balance;


Input:
[INST] Here is a database schema:
ACCOUNTS :
custid [ INT ] primary_key
name [ TEXT ]

SAVINGS :
custid [ INT ] primary_key SAVINGS.custid = ACCOUNTS.custid
balance [ INT ]

CHECKING :
custid [ INT ] primary_key CHECKING.custid = ACCOUNTS.custid
balance [ INT ]

Please write me a SQL statement that answers the following question: Find the name and savings balance of the top 3 accounts with the highest saving balance sorted by savings balance in descending order. [/INST]

Output: SELECT T1.name ,  T2.balance FROM accounts AS T1 JOIN savings AS T2 ON T1.custid  =  T2.custid ORDER BY T2.balance DESC LIMIT 3;


Input:
[INST] Here is a database schema:
ACCOUNTS :
custid [ INT ] primary_key
name [ TEXT ]

SAVINGS :
custid [ INT ] primary_key SAVINGS.custid = ACCOUNTS.custid
balance [ INT ]

CHECKING :
custid [ INT ] primary_key CHECKING.custid = ACCOUNTS.custid
balance [ INT ]

Please write me a SQL statement that answers the following question: What are names and savings balances of the three accounts with the highest savings balances? [/INST]

Output: SELECT T1.name ,  T2.balance FROM accounts AS T1 JOIN savings AS T2 ON T1.custid  =  T2.custid ORDER BY T2.balance DESC LIMIT 3;


Input:
[INST] Here is a database schema:
Web_client_accelerator :
id [ INT ] primary_key
name [ TEXT ]
Operating_system [ TEXT ]
Client [ TEXT ]
Connection [ TEXT ]

browser :
id [ INT ] primary_key
name [ TEXT ]
market_share [ INT ]

accelerator_compatible_browser :
accelerator_id [ INT ] primary_key accelerator_compatible_browser.accelerator_id = Web_client_accelerator.id
browser_id [ INT ] accelerator_compatible_browser.browser_id = browser.id
compatible_since_year [ INT ]

Please write me a SQL statement that answers the following question: How many main stream browsers whose market share is at least 5 exist? [/INST]

Output: SELECT count(*) FROM browser WHERE market_share  >=  5;


Input:
[INST] Here is a database schema:
Web_client_accelerator :
id [ INT ] primary_key
name [ TEXT ]
Operating_system [ TEXT ]
Client [ TEXT ]
Connection [ TEXT ]

browser :
id [ INT ] primary_key
name [ TEXT ]
market_share [ INT ]

accelerator_compatible_browser :
accelerator_id [ INT ] primary_key accelerator_compatible_browser.accelerator_id = Web_client_accelerator.id
browser_id [ INT ] accelerator_compatible_browser.browser_id = browser.id
compatible_since_year [ INT ]

Please write me a SQL statement that answers the following question: List the name of browsers in descending order by market share. [/INST]

Output: SELECT name FROM browser ORDER BY market_share DESC;


Input:
[INST] Here is a database schema:
Web_client_accelerator :
id [ INT ] primary_key
name [ TEXT ]
Operating_system [ TEXT ]
Client [ TEXT ]
Connection [ TEXT ]

browser :
id [ INT ] primary_key
name [ TEXT ]
market_share [ INT ]

accelerator_compatible_browser :
accelerator_id [ INT ] primary_key accelerator_compatible_browser.accelerator_id = Web_client_accelerator.id
browser_id [ INT ] accelerator_compatible_browser.browser_id = browser.id
compatible_since_year [ INT ]

Please write me a SQL statement that answers the following question: List the ids, names and market shares of all browsers. [/INST]

Output: SELECT id ,  name ,  market_share FROM browser;


Input:
[INST] Here is a database schema:
Web_client_accelerator :
id [ INT ] primary_key
name [ TEXT ]
Operating_system [ TEXT ]
Client [ TEXT ]
Connection [ TEXT ]

browser :
id [ INT ] primary_key
name [ TEXT ]
market_share [ INT ]

accelerator_compatible_browser :
accelerator_id [ INT ] primary_key accelerator_compatible_browser.accelerator_id = Web_client_accelerator.id
browser_id [ INT ] accelerator_compatible_browser.browser_id = browser.id
compatible_since_year [ INT ]

Please write me a SQL statement that answers the following question: What is the maximum, minimum and average market share of the listed browsers? [/INST]

Output: SELECT max(market_share) ,  min(market_share) ,  avg(market_share) FROM browser;


Input:
[INST] Here is a database schema:
Web_client_accelerator :
id [ INT ] primary_key
name [ TEXT ]
Operating_system [ TEXT ]
Client [ TEXT ]
Connection [ TEXT ]

browser :
id [ INT ] primary_key
name [ TEXT ]
market_share [ INT ]

accelerator_compatible_browser :
accelerator_id [ INT ] primary_key accelerator_compatible_browser.accelerator_id = Web_client_accelerator.id
browser_id [ INT ] accelerator_compatible_browser.browser_id = browser.id
compatible_since_year [ INT ]

Please write me a SQL statement that answers the following question: What is the id and market share of the browser Safari? [/INST]

Output: SELECT id ,  market_share FROM browser WHERE name  =  'Safari';


Input:
[INST] Here is a database schema:
Web_client_accelerator :
id [ INT ] primary_key
name [ TEXT ]
Operating_system [ TEXT ]
Client [ TEXT ]
Connection [ TEXT ]

browser :
id [ INT ] primary_key
name [ TEXT ]
market_share [ INT ]

accelerator_compatible_browser :
accelerator_id [ INT ] primary_key accelerator_compatible_browser.accelerator_id = Web_client_accelerator.id
browser_id [ INT ] accelerator_compatible_browser.browser_id = browser.id
compatible_since_year [ INT ]

Please write me a SQL statement that answers the following question: What are the name and os of web client accelerators that do not work with only a 'Broadband' type connection? [/INST]

Output: SELECT name ,  operating_system FROM web_client_accelerator WHERE CONNECTION != 'Broadband';


Input:
[INST] Here is a database schema:
Web_client_accelerator :
id [ INT ] primary_key
name [ TEXT ]
Operating_system [ TEXT ]
Client [ TEXT ]
Connection [ TEXT ]

browser :
id [ INT ] primary_key
name [ TEXT ]
market_share [ INT ]

accelerator_compatible_browser :
accelerator_id [ INT ] primary_key accelerator_compatible_browser.accelerator_id = Web_client_accelerator.id
browser_id [ INT ] accelerator_compatible_browser.browser_id = browser.id
compatible_since_year [ INT ]

Please write me a SQL statement that answers the following question: What is the name of the browser that became compatible with the accelerator 'CProxy' after year 1998 ? [/INST]

Output: SELECT T1.name FROM browser AS T1 JOIN accelerator_compatible_browser AS T2 ON T1.id  =  T2.browser_id JOIN web_client_accelerator AS T3 ON T2.accelerator_id  =  T3.id WHERE T3.name  =  'CProxy' AND T2.compatible_since_year  >  1998;


Input:
[INST] Here is a database schema:
Web_client_accelerator :
id [ INT ] primary_key
name [ TEXT ]
Operating_system [ TEXT ]
Client [ TEXT ]
Connection [ TEXT ]

browser :
id [ INT ] primary_key
name [ TEXT ]
market_share [ INT ]

accelerator_compatible_browser :
accelerator_id [ INT ] primary_key accelerator_compatible_browser.accelerator_id = Web_client_accelerator.id
browser_id [ INT ] accelerator_compatible_browser.browser_id = browser.id
compatible_since_year [ INT ]

Please write me a SQL statement that answers the following question: What are the ids and names of the web accelerators that are compatible with two or more browsers? [/INST]

Output: SELECT T1.id ,  T1.Name FROM web_client_accelerator AS T1 JOIN accelerator_compatible_browser AS T2 ON T2.accelerator_id  =  T1.id GROUP BY T1.id HAVING count(*)  >=  2;


Input:
[INST] Here is a database schema:
Web_client_accelerator :
id [ INT ] primary_key
name [ TEXT ]
Operating_system [ TEXT ]
Client [ TEXT ]
Connection [ TEXT ]

browser :
id [ INT ] primary_key
name [ TEXT ]
market_share [ INT ]

accelerator_compatible_browser :
accelerator_id [ INT ] primary_key accelerator_compatible_browser.accelerator_id = Web_client_accelerator.id
browser_id [ INT ] accelerator_compatible_browser.browser_id = browser.id
compatible_since_year [ INT ]

Please write me a SQL statement that answers the following question: What is the id and name of the browser that is compatible with the most web accelerators? [/INST]

Output: SELECT T1.id ,  T1.name FROM browser AS T1 JOIN accelerator_compatible_browser AS T2 ON T1.id  =  T2.browser_id GROUP BY T1.id ORDER BY count(*) DESC LIMIT 1;


Input:
[INST] Here is a database schema:
Web_client_accelerator :
id [ INT ] primary_key
name [ TEXT ]
Operating_system [ TEXT ]
Client [ TEXT ]
Connection [ TEXT ]

browser :
id [ INT ] primary_key
name [ TEXT ]
market_share [ INT ]

accelerator_compatible_browser :
accelerator_id [ INT ] primary_key accelerator_compatible_browser.accelerator_id = Web_client_accelerator.id
browser_id [ INT ] accelerator_compatible_browser.browser_id = browser.id
compatible_since_year [ INT ]

Please write me a SQL statement that answers the following question: When did the web accelerator 'CACHEbox' and browser 'Internet Explorer' become compatible? [/INST]

Output: SELECT T1.compatible_since_year FROM accelerator_compatible_browser AS T1 JOIN browser AS T2 ON T1.browser_id  =  T2.id JOIN web_client_accelerator AS T3 ON T1.accelerator_id  =  T3.id WHERE T3.name  =  'CACHEbox' AND T2.name  =  'Internet Explorer';


Input:
[INST] Here is a database schema:
Web_client_accelerator :
id [ INT ] primary_key
name [ TEXT ]
Operating_system [ TEXT ]
Client [ TEXT ]
Connection [ TEXT ]

browser :
id [ INT ] primary_key
name [ TEXT ]
market_share [ INT ]

accelerator_compatible_browser :
accelerator_id [ INT ] primary_key accelerator_compatible_browser.accelerator_id = Web_client_accelerator.id
browser_id [ INT ] accelerator_compatible_browser.browser_id = browser.id
compatible_since_year [ INT ]

Please write me a SQL statement that answers the following question: How many different kinds of clients are supported by the web clients accelerators? [/INST]

Output: SELECT count(DISTINCT client) FROM web_client_accelerator;


Input:
[INST] Here is a database schema:
Web_client_accelerator :
id [ INT ] primary_key
name [ TEXT ]
Operating_system [ TEXT ]
Client [ TEXT ]
Connection [ TEXT ]

browser :
id [ INT ] primary_key
name [ TEXT ]
market_share [ INT ]

accelerator_compatible_browser :
accelerator_id [ INT ] primary_key accelerator_compatible_browser.accelerator_id = Web_client_accelerator.id
browser_id [ INT ] accelerator_compatible_browser.browser_id = browser.id
compatible_since_year [ INT ]

Please write me a SQL statement that answers the following question: How many accelerators are not compatible with the browsers listed ? [/INST]

Output: SELECT count(*) FROM web_client_accelerator WHERE id NOT IN ( SELECT accelerator_id FROM accelerator_compatible_browser );


Input:
[INST] Here is a database schema:
Web_client_accelerator :
id [ INT ] primary_key
name [ TEXT ]
Operating_system [ TEXT ]
Client [ TEXT ]
Connection [ TEXT ]

browser :
id [ INT ] primary_key
name [ TEXT ]
market_share [ INT ]

accelerator_compatible_browser :
accelerator_id [ INT ] primary_key accelerator_compatible_browser.accelerator_id = Web_client_accelerator.id
browser_id [ INT ] accelerator_compatible_browser.browser_id = browser.id
compatible_since_year [ INT ]

Please write me a SQL statement that answers the following question: What distinct accelerator names are compatible with the browswers that have market share higher than 15? [/INST]

Output: SELECT DISTINCT T1.name FROM web_client_accelerator AS T1 JOIN accelerator_compatible_browser AS T2 ON T2.accelerator_id  =  T1.id JOIN browser AS T3 ON T2.browser_id  =  T3.id WHERE T3.market_share  >  15;


Input:
[INST] Here is a database schema:
Web_client_accelerator :
id [ INT ] primary_key
name [ TEXT ]
Operating_system [ TEXT ]
Client [ TEXT ]
Connection [ TEXT ]

browser :
id [ INT ] primary_key
name [ TEXT ]
market_share [ INT ]

accelerator_compatible_browser :
accelerator_id [ INT ] primary_key accelerator_compatible_browser.accelerator_id = Web_client_accelerator.id
browser_id [ INT ] accelerator_compatible_browser.browser_id = browser.id
compatible_since_year [ INT ]

Please write me a SQL statement that answers the following question: List the names of the browser that are compatible with both 'CACHEbox' and 'Fasterfox'. [/INST]

Output: SELECT T3.name FROM web_client_accelerator AS T1 JOIN accelerator_compatible_browser AS T2 ON T2.accelerator_id  =  T1.id JOIN browser AS T3 ON T2.browser_id  =  T3.id WHERE T1.name  =  'CACHEbox' INTERSECT SELECT T3.name FROM web_client_accelerator AS T1 JOIN accelerator_compatible_browser AS T2 ON T2.accelerator_id  =  T1.id JOIN browser AS T3 ON T2.browser_id  =  T3.id WHERE T1.name  =  'Fasterfox';


Input:
[INST] Here is a database schema:
Web_client_accelerator :
id [ INT ] primary_key
name [ TEXT ]
Operating_system [ TEXT ]
Client [ TEXT ]
Connection [ TEXT ]

browser :
id [ INT ] primary_key
name [ TEXT ]
market_share [ INT ]

accelerator_compatible_browser :
accelerator_id [ INT ] primary_key accelerator_compatible_browser.accelerator_id = Web_client_accelerator.id
browser_id [ INT ] accelerator_compatible_browser.browser_id = browser.id
compatible_since_year [ INT ]

Please write me a SQL statement that answers the following question: Show the accelerator names and supporting operating systems that are not compatible with the browser named 'Opera'. [/INST]

Output: SELECT name ,  operating_system FROM web_client_accelerator EXCEPT SELECT T1.name ,  T1.operating_system FROM web_client_accelerator AS T1 JOIN accelerator_compatible_browser AS T2 ON T2.accelerator_id  =  T1.id JOIN browser AS T3 ON T2.browser_id  =  T3.id WHERE T3.name  =  'Opera';


Input:
[INST] Here is a database schema:
Web_client_accelerator :
id [ INT ] primary_key
name [ TEXT ]
Operating_system [ TEXT ]
Client [ TEXT ]
Connection [ TEXT ]

browser :
id [ INT ] primary_key
name [ TEXT ]
market_share [ INT ]

accelerator_compatible_browser :
accelerator_id [ INT ] primary_key accelerator_compatible_browser.accelerator_id = Web_client_accelerator.id
browser_id [ INT ] accelerator_compatible_browser.browser_id = browser.id
compatible_since_year [ INT ]

Please write me a SQL statement that answers the following question: Which accelerator name contains substring "Opera"? [/INST]

Output: SELECT name FROM web_client_accelerator WHERE name LIKE "%Opera%";


Input:
[INST] Here is a database schema:
Web_client_accelerator :
id [ INT ] primary_key
name [ TEXT ]
Operating_system [ TEXT ]
Client [ TEXT ]
Connection [ TEXT ]

browser :
id [ INT ] primary_key
name [ TEXT ]
market_share [ INT ]

accelerator_compatible_browser :
accelerator_id [ INT ] primary_key accelerator_compatible_browser.accelerator_id = Web_client_accelerator.id
browser_id [ INT ] accelerator_compatible_browser.browser_id = browser.id
compatible_since_year [ INT ]

Please write me a SQL statement that answers the following question: Find the number of web accelerators used for each Operating system. [/INST]

Output: SELECT Operating_system ,  count(*) FROM web_client_accelerator GROUP BY Operating_system;


Input:
[INST] Here is a database schema:
Web_client_accelerator :
id [ INT ] primary_key
name [ TEXT ]
Operating_system [ TEXT ]
Client [ TEXT ]
Connection [ TEXT ]

browser :
id [ INT ] primary_key
name [ TEXT ]
market_share [ INT ]

accelerator_compatible_browser :
accelerator_id [ INT ] primary_key accelerator_compatible_browser.accelerator_id = Web_client_accelerator.id
browser_id [ INT ] accelerator_compatible_browser.browser_id = browser.id
compatible_since_year [ INT ]

Please write me a SQL statement that answers the following question: give me names of all compatible browsers and accelerators in the descending order of compatible year [/INST]

Output: SELECT T2.name ,  T3.name FROM accelerator_compatible_browser AS T1 JOIN browser AS T2 ON T1.browser_id  =  T2.id JOIN web_client_accelerator AS T3 ON T1.accelerator_id  =  T3.id ORDER BY T1.compatible_since_year DESC;


Input:
[INST] Here is a database schema:
wrestler :
Wrestler_ID [ INT ] primary_key
Name [ TEXT ]
Reign [ TEXT ]
Days_held [ TEXT ]
Location [ TEXT ]
Event [ TEXT ]

Elimination :
Elimination_ID [ TEXT ] primary_key
Wrestler_ID [ TEXT ] Elimination.Wrestler_ID = wrestler.Wrestler_ID
Team [ TEXT ]
Eliminated_By [ TEXT ]
Elimination_Move [ TEXT ]
Time [ TEXT ]

Please write me a SQL statement that answers the following question: How many wrestlers are there? [/INST]

Output: SELECT count(*) FROM wrestler;


Input:
[INST] Here is a database schema:
wrestler :
Wrestler_ID [ INT ] primary_key
Name [ TEXT ]
Reign [ TEXT ]
Days_held [ TEXT ]
Location [ TEXT ]
Event [ TEXT ]

Elimination :
Elimination_ID [ TEXT ] primary_key
Wrestler_ID [ TEXT ] Elimination.Wrestler_ID = wrestler.Wrestler_ID
Team [ TEXT ]
Eliminated_By [ TEXT ]
Elimination_Move [ TEXT ]
Time [ TEXT ]

Please write me a SQL statement that answers the following question: Count the number of wrestlers. [/INST]

Output: SELECT count(*) FROM wrestler;


Input:
[INST] Here is a database schema:
wrestler :
Wrestler_ID [ INT ] primary_key
Name [ TEXT ]
Reign [ TEXT ]
Days_held [ TEXT ]
Location [ TEXT ]
Event [ TEXT ]

Elimination :
Elimination_ID [ TEXT ] primary_key
Wrestler_ID [ TEXT ] Elimination.Wrestler_ID = wrestler.Wrestler_ID
Team [ TEXT ]
Eliminated_By [ TEXT ]
Elimination_Move [ TEXT ]
Time [ TEXT ]

Please write me a SQL statement that answers the following question: List the names of wrestlers in descending order of days held. [/INST]

Output: SELECT Name FROM wrestler ORDER BY Days_held DESC;


Input:
[INST] Here is a database schema:
wrestler :
Wrestler_ID [ INT ] primary_key
Name [ TEXT ]
Reign [ TEXT ]
Days_held [ TEXT ]
Location [ TEXT ]
Event [ TEXT ]

Elimination :
Elimination_ID [ TEXT ] primary_key
Wrestler_ID [ TEXT ] Elimination.Wrestler_ID = wrestler.Wrestler_ID
Team [ TEXT ]
Eliminated_By [ TEXT ]
Elimination_Move [ TEXT ]
Time [ TEXT ]

Please write me a SQL statement that answers the following question: What are the names of the wrestlers, ordered descending by days held? [/INST]

Output: SELECT Name FROM wrestler ORDER BY Days_held DESC;


Input:
[INST] Here is a database schema:
wrestler :
Wrestler_ID [ INT ] primary_key
Name [ TEXT ]
Reign [ TEXT ]
Days_held [ TEXT ]
Location [ TEXT ]
Event [ TEXT ]

Elimination :
Elimination_ID [ TEXT ] primary_key
Wrestler_ID [ TEXT ] Elimination.Wrestler_ID = wrestler.Wrestler_ID
Team [ TEXT ]
Eliminated_By [ TEXT ]
Elimination_Move [ TEXT ]
Time [ TEXT ]

Please write me a SQL statement that answers the following question: What is the name of the wrestler with the fewest days held? [/INST]

Output: SELECT Name FROM wrestler ORDER BY Days_held ASC LIMIT 1;


Input:
[INST] Here is a database schema:
wrestler :
Wrestler_ID [ INT ] primary_key
Name [ TEXT ]
Reign [ TEXT ]
Days_held [ TEXT ]
Location [ TEXT ]
Event [ TEXT ]

Elimination :
Elimination_ID [ TEXT ] primary_key
Wrestler_ID [ TEXT ] Elimination.Wrestler_ID = wrestler.Wrestler_ID
Team [ TEXT ]
Eliminated_By [ TEXT ]
Elimination_Move [ TEXT ]
Time [ TEXT ]

Please write me a SQL statement that answers the following question: Return the name of the wrestler who had the lowest number of days held. [/INST]

Output: SELECT Name FROM wrestler ORDER BY Days_held ASC LIMIT 1;


Input:
[INST] Here is a database schema:
wrestler :
Wrestler_ID [ INT ] primary_key
Name [ TEXT ]
Reign [ TEXT ]
Days_held [ TEXT ]
Location [ TEXT ]
Event [ TEXT ]

Elimination :
Elimination_ID [ TEXT ] primary_key
Wrestler_ID [ TEXT ] Elimination.Wrestler_ID = wrestler.Wrestler_ID
Team [ TEXT ]
Eliminated_By [ TEXT ]
Elimination_Move [ TEXT ]
Time [ TEXT ]

Please write me a SQL statement that answers the following question: What are the distinct reigns of wrestlers whose location is not "Tokyo,Japan" ? [/INST]

Output: SELECT DISTINCT Reign FROM wrestler WHERE LOCATION != "Tokyo , Japan";


Input:
[INST] Here is a database schema:
wrestler :
Wrestler_ID [ INT ] primary_key
Name [ TEXT ]
Reign [ TEXT ]
Days_held [ TEXT ]
Location [ TEXT ]
Event [ TEXT ]

Elimination :
Elimination_ID [ TEXT ] primary_key
Wrestler_ID [ TEXT ] Elimination.Wrestler_ID = wrestler.Wrestler_ID
Team [ TEXT ]
Eliminated_By [ TEXT ]
Elimination_Move [ TEXT ]
Time [ TEXT ]

Please write me a SQL statement that answers the following question: Give the different reigns of wrestlers who are not located in Tokyo, Japan. [/INST]

Output: SELECT DISTINCT Reign FROM wrestler WHERE LOCATION != "Tokyo , Japan";


Input:
[INST] Here is a database schema:
wrestler :
Wrestler_ID [ INT ] primary_key
Name [ TEXT ]
Reign [ TEXT ]
Days_held [ TEXT ]
Location [ TEXT ]
Event [ TEXT ]

Elimination :
Elimination_ID [ TEXT ] primary_key
Wrestler_ID [ TEXT ] Elimination.Wrestler_ID = wrestler.Wrestler_ID
Team [ TEXT ]
Eliminated_By [ TEXT ]
Elimination_Move [ TEXT ]
Time [ TEXT ]

Please write me a SQL statement that answers the following question: What are the names and location of the wrestlers? [/INST]

Output: SELECT Name ,  LOCATION FROM wrestler;


Input:
[INST] Here is a database schema:
wrestler :
Wrestler_ID [ INT ] primary_key
Name [ TEXT ]
Reign [ TEXT ]
Days_held [ TEXT ]
Location [ TEXT ]
Event [ TEXT ]

Elimination :
Elimination_ID [ TEXT ] primary_key
Wrestler_ID [ TEXT ] Elimination.Wrestler_ID = wrestler.Wrestler_ID
Team [ TEXT ]
Eliminated_By [ TEXT ]
Elimination_Move [ TEXT ]
Time [ TEXT ]

Please write me a SQL statement that answers the following question: Give the names and locations of all wrestlers. [/INST]

Output: SELECT Name ,  LOCATION FROM wrestler;


Input:
[INST] Here is a database schema:
wrestler :
Wrestler_ID [ INT ] primary_key
Name [ TEXT ]
Reign [ TEXT ]
Days_held [ TEXT ]
Location [ TEXT ]
Event [ TEXT ]

Elimination :
Elimination_ID [ TEXT ] primary_key
Wrestler_ID [ TEXT ] Elimination.Wrestler_ID = wrestler.Wrestler_ID
Team [ TEXT ]
Eliminated_By [ TEXT ]
Elimination_Move [ TEXT ]
Time [ TEXT ]

Please write me a SQL statement that answers the following question: What are the elimination moves of wrestlers whose team is "Team Orton"? [/INST]

Output: SELECT Elimination_Move FROM Elimination WHERE Team  =  "Team Orton";


Input:
[INST] Here is a database schema:
wrestler :
Wrestler_ID [ INT ] primary_key
Name [ TEXT ]
Reign [ TEXT ]
Days_held [ TEXT ]
Location [ TEXT ]
Event [ TEXT ]

Elimination :
Elimination_ID [ TEXT ] primary_key
Wrestler_ID [ TEXT ] Elimination.Wrestler_ID = wrestler.Wrestler_ID
Team [ TEXT ]
Eliminated_By [ TEXT ]
Elimination_Move [ TEXT ]
Time [ TEXT ]

Please write me a SQL statement that answers the following question: Return the elimination movies of wrestlers on Team Orton. [/INST]

Output: SELECT Elimination_Move FROM Elimination WHERE Team  =  "Team Orton";


Input:
[INST] Here is a database schema:
wrestler :
Wrestler_ID [ INT ] primary_key
Name [ TEXT ]
Reign [ TEXT ]
Days_held [ TEXT ]
Location [ TEXT ]
Event [ TEXT ]

Elimination :
Elimination_ID [ TEXT ] primary_key
Wrestler_ID [ TEXT ] Elimination.Wrestler_ID = wrestler.Wrestler_ID
Team [ TEXT ]
Eliminated_By [ TEXT ]
Elimination_Move [ TEXT ]
Time [ TEXT ]

Please write me a SQL statement that answers the following question: What are the names of wrestlers and the elimination moves? [/INST]

Output: SELECT T2.Name ,  T1.Elimination_Move FROM elimination AS T1 JOIN wrestler AS T2 ON T1.Wrestler_ID  =  T2.Wrestler_ID;


Input:
[INST] Here is a database schema:
wrestler :
Wrestler_ID [ INT ] primary_key
Name [ TEXT ]
Reign [ TEXT ]
Days_held [ TEXT ]
Location [ TEXT ]
Event [ TEXT ]

Elimination :
Elimination_ID [ TEXT ] primary_key
Wrestler_ID [ TEXT ] Elimination.Wrestler_ID = wrestler.Wrestler_ID
Team [ TEXT ]
Eliminated_By [ TEXT ]
Elimination_Move [ TEXT ]
Time [ TEXT ]

Please write me a SQL statement that answers the following question: Give the names of wrestlers and their elimination moves. [/INST]

Output: SELECT T2.Name ,  T1.Elimination_Move FROM elimination AS T1 JOIN wrestler AS T2 ON T1.Wrestler_ID  =  T2.Wrestler_ID;


Input:
[INST] Here is a database schema:
wrestler :
Wrestler_ID [ INT ] primary_key
Name [ TEXT ]
Reign [ TEXT ]
Days_held [ TEXT ]
Location [ TEXT ]
Event [ TEXT ]

Elimination :
Elimination_ID [ TEXT ] primary_key
Wrestler_ID [ TEXT ] Elimination.Wrestler_ID = wrestler.Wrestler_ID
Team [ TEXT ]
Eliminated_By [ TEXT ]
Elimination_Move [ TEXT ]
Time [ TEXT ]

Please write me a SQL statement that answers the following question: List the names of wrestlers and the teams in elimination in descending order of days held. [/INST]

Output: SELECT T2.Name ,  T1.Team FROM elimination AS T1 JOIN wrestler AS T2 ON T1.Wrestler_ID  =  T2.Wrestler_ID ORDER BY T2.Days_held DESC;


Input:
[INST] Here is a database schema:
wrestler :
Wrestler_ID [ INT ] primary_key
Name [ TEXT ]
Reign [ TEXT ]
Days_held [ TEXT ]
Location [ TEXT ]
Event [ TEXT ]

Elimination :
Elimination_ID [ TEXT ] primary_key
Wrestler_ID [ TEXT ] Elimination.Wrestler_ID = wrestler.Wrestler_ID
Team [ TEXT ]
Eliminated_By [ TEXT ]
Elimination_Move [ TEXT ]
Time [ TEXT ]

Please write me a SQL statement that answers the following question: What are the names of wrestlers and their teams in elimination, ordered descending by days held? [/INST]

Output: SELECT T2.Name ,  T1.Team FROM elimination AS T1 JOIN wrestler AS T2 ON T1.Wrestler_ID  =  T2.Wrestler_ID ORDER BY T2.Days_held DESC;


Input:
[INST] Here is a database schema:
wrestler :
Wrestler_ID [ INT ] primary_key
Name [ TEXT ]
Reign [ TEXT ]
Days_held [ TEXT ]
Location [ TEXT ]
Event [ TEXT ]

Elimination :
Elimination_ID [ TEXT ] primary_key
Wrestler_ID [ TEXT ] Elimination.Wrestler_ID = wrestler.Wrestler_ID
Team [ TEXT ]
Eliminated_By [ TEXT ]
Elimination_Move [ TEXT ]
Time [ TEXT ]

Please write me a SQL statement that answers the following question: List the time of elimination of the wrestlers with largest days held. [/INST]

Output: SELECT T1.Time FROM elimination AS T1 JOIN wrestler AS T2 ON T1.Wrestler_ID  =  T2.Wrestler_ID ORDER BY T2.Days_held DESC LIMIT 1;


Input:
[INST] Here is a database schema:
wrestler :
Wrestler_ID [ INT ] primary_key
Name [ TEXT ]
Reign [ TEXT ]
Days_held [ TEXT ]
Location [ TEXT ]
Event [ TEXT ]

Elimination :
Elimination_ID [ TEXT ] primary_key
Wrestler_ID [ TEXT ] Elimination.Wrestler_ID = wrestler.Wrestler_ID
Team [ TEXT ]
Eliminated_By [ TEXT ]
Elimination_Move [ TEXT ]
Time [ TEXT ]

Please write me a SQL statement that answers the following question: What is the time of elimination for the wrestler with the most days held? [/INST]

Output: SELECT T1.Time FROM elimination AS T1 JOIN wrestler AS T2 ON T1.Wrestler_ID  =  T2.Wrestler_ID ORDER BY T2.Days_held DESC LIMIT 1;


Input:
[INST] Here is a database schema:
wrestler :
Wrestler_ID [ INT ] primary_key
Name [ TEXT ]
Reign [ TEXT ]
Days_held [ TEXT ]
Location [ TEXT ]
Event [ TEXT ]

Elimination :
Elimination_ID [ TEXT ] primary_key
Wrestler_ID [ TEXT ] Elimination.Wrestler_ID = wrestler.Wrestler_ID
Team [ TEXT ]
Eliminated_By [ TEXT ]
Elimination_Move [ TEXT ]
Time [ TEXT ]

Please write me a SQL statement that answers the following question: Show times of elimination of wrestlers with days held more than 50. [/INST]

Output: SELECT T1.Time FROM elimination AS T1 JOIN wrestler AS T2 ON T1.Wrestler_ID  =  T2.Wrestler_ID WHERE T2.Days_held  >  50;


Input:
[INST] Here is a database schema:
wrestler :
Wrestler_ID [ INT ] primary_key
Name [ TEXT ]
Reign [ TEXT ]
Days_held [ TEXT ]
Location [ TEXT ]
Event [ TEXT ]

Elimination :
Elimination_ID [ TEXT ] primary_key
Wrestler_ID [ TEXT ] Elimination.Wrestler_ID = wrestler.Wrestler_ID
Team [ TEXT ]
Eliminated_By [ TEXT ]
Elimination_Move [ TEXT ]
Time [ TEXT ]

Please write me a SQL statement that answers the following question: What are the times of elimination for wrestlers with over 50 days held? [/INST]

Output: SELECT T1.Time FROM elimination AS T1 JOIN wrestler AS T2 ON T1.Wrestler_ID  =  T2.Wrestler_ID WHERE T2.Days_held  >  50;


Input:
[INST] Here is a database schema:
wrestler :
Wrestler_ID [ INT ] primary_key
Name [ TEXT ]
Reign [ TEXT ]
Days_held [ TEXT ]
Location [ TEXT ]
Event [ TEXT ]

Elimination :
Elimination_ID [ TEXT ] primary_key
Wrestler_ID [ TEXT ] Elimination.Wrestler_ID = wrestler.Wrestler_ID
Team [ TEXT ]
Eliminated_By [ TEXT ]
Elimination_Move [ TEXT ]
Time [ TEXT ]

Please write me a SQL statement that answers the following question: Show different teams in eliminations and the number of eliminations from each team. [/INST]

Output: SELECT Team ,  COUNT(*) FROM elimination GROUP BY Team;


Input:
[INST] Here is a database schema:
wrestler :
Wrestler_ID [ INT ] primary_key
Name [ TEXT ]
Reign [ TEXT ]
Days_held [ TEXT ]
Location [ TEXT ]
Event [ TEXT ]

Elimination :
Elimination_ID [ TEXT ] primary_key
Wrestler_ID [ TEXT ] Elimination.Wrestler_ID = wrestler.Wrestler_ID
Team [ TEXT ]
Eliminated_By [ TEXT ]
Elimination_Move [ TEXT ]
Time [ TEXT ]

Please write me a SQL statement that answers the following question: How many eliminations did each team have? [/INST]

Output: SELECT Team ,  COUNT(*) FROM elimination GROUP BY Team;


Input:
[INST] Here is a database schema:
wrestler :
Wrestler_ID [ INT ] primary_key
Name [ TEXT ]
Reign [ TEXT ]
Days_held [ TEXT ]
Location [ TEXT ]
Event [ TEXT ]

Elimination :
Elimination_ID [ TEXT ] primary_key
Wrestler_ID [ TEXT ] Elimination.Wrestler_ID = wrestler.Wrestler_ID
Team [ TEXT ]
Eliminated_By [ TEXT ]
Elimination_Move [ TEXT ]
Time [ TEXT ]

Please write me a SQL statement that answers the following question: Show teams that have suffered more than three eliminations. [/INST]

Output: SELECT Team FROM elimination GROUP BY Team HAVING COUNT(*)  >  3;


Input:
[INST] Here is a database schema:
wrestler :
Wrestler_ID [ INT ] primary_key
Name [ TEXT ]
Reign [ TEXT ]
Days_held [ TEXT ]
Location [ TEXT ]
Event [ TEXT ]

Elimination :
Elimination_ID [ TEXT ] primary_key
Wrestler_ID [ TEXT ] Elimination.Wrestler_ID = wrestler.Wrestler_ID
Team [ TEXT ]
Eliminated_By [ TEXT ]
Elimination_Move [ TEXT ]
Time [ TEXT ]

Please write me a SQL statement that answers the following question: Which teams had more than 3 eliminations? [/INST]

Output: SELECT Team FROM elimination GROUP BY Team HAVING COUNT(*)  >  3;


Input:
[INST] Here is a database schema:
wrestler :
Wrestler_ID [ INT ] primary_key
Name [ TEXT ]
Reign [ TEXT ]
Days_held [ TEXT ]
Location [ TEXT ]
Event [ TEXT ]

Elimination :
Elimination_ID [ TEXT ] primary_key
Wrestler_ID [ TEXT ] Elimination.Wrestler_ID = wrestler.Wrestler_ID
Team [ TEXT ]
Eliminated_By [ TEXT ]
Elimination_Move [ TEXT ]
Time [ TEXT ]

Please write me a SQL statement that answers the following question: Show the reign and days held of wrestlers. [/INST]

Output: SELECT Reign ,  Days_held FROM wrestler;


Input:
[INST] Here is a database schema:
wrestler :
Wrestler_ID [ INT ] primary_key
Name [ TEXT ]
Reign [ TEXT ]
Days_held [ TEXT ]
Location [ TEXT ]
Event [ TEXT ]

Elimination :
Elimination_ID [ TEXT ] primary_key
Wrestler_ID [ TEXT ] Elimination.Wrestler_ID = wrestler.Wrestler_ID
Team [ TEXT ]
Eliminated_By [ TEXT ]
Elimination_Move [ TEXT ]
Time [ TEXT ]

Please write me a SQL statement that answers the following question: What are the reigns and days held of all wrestlers? [/INST]

Output: SELECT Reign ,  Days_held FROM wrestler;


Input:
[INST] Here is a database schema:
wrestler :
Wrestler_ID [ INT ] primary_key
Name [ TEXT ]
Reign [ TEXT ]
Days_held [ TEXT ]
Location [ TEXT ]
Event [ TEXT ]

Elimination :
Elimination_ID [ TEXT ] primary_key
Wrestler_ID [ TEXT ] Elimination.Wrestler_ID = wrestler.Wrestler_ID
Team [ TEXT ]
Eliminated_By [ TEXT ]
Elimination_Move [ TEXT ]
Time [ TEXT ]

Please write me a SQL statement that answers the following question: What are the names of wrestlers days held less than 100? [/INST]

Output: SELECT Name FROM wrestler WHERE Days_held  <  100;


Input:
[INST] Here is a database schema:
wrestler :
Wrestler_ID [ INT ] primary_key
Name [ TEXT ]
Reign [ TEXT ]
Days_held [ TEXT ]
Location [ TEXT ]
Event [ TEXT ]

Elimination :
Elimination_ID [ TEXT ] primary_key
Wrestler_ID [ TEXT ] Elimination.Wrestler_ID = wrestler.Wrestler_ID
Team [ TEXT ]
Eliminated_By [ TEXT ]
Elimination_Move [ TEXT ]
Time [ TEXT ]

Please write me a SQL statement that answers the following question: Return the names of wrestlers with fewer than 100 days held. [/INST]

Output: SELECT Name FROM wrestler WHERE Days_held  <  100;


Input:
[INST] Here is a database schema:
wrestler :
Wrestler_ID [ INT ] primary_key
Name [ TEXT ]
Reign [ TEXT ]
Days_held [ TEXT ]
Location [ TEXT ]
Event [ TEXT ]

Elimination :
Elimination_ID [ TEXT ] primary_key
Wrestler_ID [ TEXT ] Elimination.Wrestler_ID = wrestler.Wrestler_ID
Team [ TEXT ]
Eliminated_By [ TEXT ]
Elimination_Move [ TEXT ]
Time [ TEXT ]

Please write me a SQL statement that answers the following question: Please show the most common reigns of wrestlers. [/INST]

Output: SELECT Reign FROM wrestler GROUP BY Reign ORDER BY COUNT(*) DESC LIMIT 1;


Input:
[INST] Here is a database schema:
wrestler :
Wrestler_ID [ INT ] primary_key
Name [ TEXT ]
Reign [ TEXT ]
Days_held [ TEXT ]
Location [ TEXT ]
Event [ TEXT ]

Elimination :
Elimination_ID [ TEXT ] primary_key
Wrestler_ID [ TEXT ] Elimination.Wrestler_ID = wrestler.Wrestler_ID
Team [ TEXT ]
Eliminated_By [ TEXT ]
Elimination_Move [ TEXT ]
Time [ TEXT ]

Please write me a SQL statement that answers the following question: Which reign is the most common among wrestlers? [/INST]

Output: SELECT Reign FROM wrestler GROUP BY Reign ORDER BY COUNT(*) DESC LIMIT 1;


Input:
[INST] Here is a database schema:
wrestler :
Wrestler_ID [ INT ] primary_key
Name [ TEXT ]
Reign [ TEXT ]
Days_held [ TEXT ]
Location [ TEXT ]
Event [ TEXT ]

Elimination :
Elimination_ID [ TEXT ] primary_key
Wrestler_ID [ TEXT ] Elimination.Wrestler_ID = wrestler.Wrestler_ID
Team [ TEXT ]
Eliminated_By [ TEXT ]
Elimination_Move [ TEXT ]
Time [ TEXT ]

Please write me a SQL statement that answers the following question: List the locations that are shared by more than two wrestlers. [/INST]

Output: SELECT LOCATION FROM wrestler GROUP BY LOCATION HAVING COUNT(*)  >  2;


Input:
[INST] Here is a database schema:
wrestler :
Wrestler_ID [ INT ] primary_key
Name [ TEXT ]
Reign [ TEXT ]
Days_held [ TEXT ]
Location [ TEXT ]
Event [ TEXT ]

Elimination :
Elimination_ID [ TEXT ] primary_key
Wrestler_ID [ TEXT ] Elimination.Wrestler_ID = wrestler.Wrestler_ID
Team [ TEXT ]
Eliminated_By [ TEXT ]
Elimination_Move [ TEXT ]
Time [ TEXT ]

Please write me a SQL statement that answers the following question: Which locations are shared by more than two wrestlers? [/INST]

Output: SELECT LOCATION FROM wrestler GROUP BY LOCATION HAVING COUNT(*)  >  2;


Input:
[INST] Here is a database schema:
wrestler :
Wrestler_ID [ INT ] primary_key
Name [ TEXT ]
Reign [ TEXT ]
Days_held [ TEXT ]
Location [ TEXT ]
Event [ TEXT ]

Elimination :
Elimination_ID [ TEXT ] primary_key
Wrestler_ID [ TEXT ] Elimination.Wrestler_ID = wrestler.Wrestler_ID
Team [ TEXT ]
Eliminated_By [ TEXT ]
Elimination_Move [ TEXT ]
Time [ TEXT ]

Please write me a SQL statement that answers the following question: List the names of wrestlers that have not been eliminated. [/INST]

Output: SELECT Name FROM wrestler WHERE Wrestler_ID NOT IN (SELECT Wrestler_ID FROM elimination);


Input:
[INST] Here is a database schema:
wrestler :
Wrestler_ID [ INT ] primary_key
Name [ TEXT ]
Reign [ TEXT ]
Days_held [ TEXT ]
Location [ TEXT ]
Event [ TEXT ]

Elimination :
Elimination_ID [ TEXT ] primary_key
Wrestler_ID [ TEXT ] Elimination.Wrestler_ID = wrestler.Wrestler_ID
Team [ TEXT ]
Eliminated_By [ TEXT ]
Elimination_Move [ TEXT ]
Time [ TEXT ]

Please write me a SQL statement that answers the following question: What are the names of wrestlers who have never been eliminated? [/INST]

Output: SELECT Name FROM wrestler WHERE Wrestler_ID NOT IN (SELECT Wrestler_ID FROM elimination);


Input:
[INST] Here is a database schema:
wrestler :
Wrestler_ID [ INT ] primary_key
Name [ TEXT ]
Reign [ TEXT ]
Days_held [ TEXT ]
Location [ TEXT ]
Event [ TEXT ]

Elimination :
Elimination_ID [ TEXT ] primary_key
Wrestler_ID [ TEXT ] Elimination.Wrestler_ID = wrestler.Wrestler_ID
Team [ TEXT ]
Eliminated_By [ TEXT ]
Elimination_Move [ TEXT ]
Time [ TEXT ]

Please write me a SQL statement that answers the following question: Show the teams that have both wrestlers eliminated by "Orton" and wrestlers eliminated by "Benjamin". [/INST]

Output: SELECT Team FROM Elimination WHERE Eliminated_By  =  "Orton" INTERSECT SELECT Team FROM Elimination WHERE Eliminated_By  =  "Benjamin";


Input:
[INST] Here is a database schema:
wrestler :
Wrestler_ID [ INT ] primary_key
Name [ TEXT ]
Reign [ TEXT ]
Days_held [ TEXT ]
Location [ TEXT ]
Event [ TEXT ]

Elimination :
Elimination_ID [ TEXT ] primary_key
Wrestler_ID [ TEXT ] Elimination.Wrestler_ID = wrestler.Wrestler_ID
Team [ TEXT ]
Eliminated_By [ TEXT ]
Elimination_Move [ TEXT ]
Time [ TEXT ]

Please write me a SQL statement that answers the following question: What are the teams that have both wrestlers eliminated by Orton and wrestlers eliminated by Benjamin? [/INST]

Output: SELECT Team FROM Elimination WHERE Eliminated_By  =  "Orton" INTERSECT SELECT Team FROM Elimination WHERE Eliminated_By  =  "Benjamin";


Input:
[INST] Here is a database schema:
wrestler :
Wrestler_ID [ INT ] primary_key
Name [ TEXT ]
Reign [ TEXT ]
Days_held [ TEXT ]
Location [ TEXT ]
Event [ TEXT ]

Elimination :
Elimination_ID [ TEXT ] primary_key
Wrestler_ID [ TEXT ] Elimination.Wrestler_ID = wrestler.Wrestler_ID
Team [ TEXT ]
Eliminated_By [ TEXT ]
Elimination_Move [ TEXT ]
Time [ TEXT ]

Please write me a SQL statement that answers the following question: What is the number of distinct teams that suffer elimination? [/INST]

Output: SELECT COUNT (DISTINCT team) FROM elimination;


Input:
[INST] Here is a database schema:
wrestler :
Wrestler_ID [ INT ] primary_key
Name [ TEXT ]
Reign [ TEXT ]
Days_held [ TEXT ]
Location [ TEXT ]
Event [ TEXT ]

Elimination :
Elimination_ID [ TEXT ] primary_key
Wrestler_ID [ TEXT ] Elimination.Wrestler_ID = wrestler.Wrestler_ID
Team [ TEXT ]
Eliminated_By [ TEXT ]
Elimination_Move [ TEXT ]
Time [ TEXT ]

Please write me a SQL statement that answers the following question: How many different teams have had eliminated wrestlers? [/INST]

Output: SELECT COUNT (DISTINCT team) FROM elimination;


Input:
[INST] Here is a database schema:
wrestler :
Wrestler_ID [ INT ] primary_key
Name [ TEXT ]
Reign [ TEXT ]
Days_held [ TEXT ]
Location [ TEXT ]
Event [ TEXT ]

Elimination :
Elimination_ID [ TEXT ] primary_key
Wrestler_ID [ TEXT ] Elimination.Wrestler_ID = wrestler.Wrestler_ID
Team [ TEXT ]
Eliminated_By [ TEXT ]
Elimination_Move [ TEXT ]
Time [ TEXT ]

Please write me a SQL statement that answers the following question: Show the times of elimination by "Punk" or "Orton". [/INST]

Output: SELECT TIME FROM elimination WHERE Eliminated_By  =  "Punk" OR Eliminated_By  =  "Orton";


Input:
[INST] Here is a database schema:
wrestler :
Wrestler_ID [ INT ] primary_key
Name [ TEXT ]
Reign [ TEXT ]
Days_held [ TEXT ]
Location [ TEXT ]
Event [ TEXT ]

Elimination :
Elimination_ID [ TEXT ] primary_key
Wrestler_ID [ TEXT ] Elimination.Wrestler_ID = wrestler.Wrestler_ID
Team [ TEXT ]
Eliminated_By [ TEXT ]
Elimination_Move [ TEXT ]
Time [ TEXT ]

Please write me a SQL statement that answers the following question: What are the times of elimination for any instances in which the elimination was done by Punk or Orton? [/INST]

Output: SELECT TIME FROM elimination WHERE Eliminated_By  =  "Punk" OR Eliminated_By  =  "Orton";


Input:
[INST] Here is a database schema:
School :
School_id [ TEXT ] primary_key
School_name [ TEXT ]
Location [ TEXT ]
Mascot [ TEXT ]
Enrollment [ INT ]
IHSAA_Class [ TEXT ]
IHSAA_Football_Class [ TEXT ]
County [ TEXT ]

budget :
School_id [ INT ] primary_key budget.School_id = School.School_id
Year [ INT ]
Budgeted [ INT ]
total_budget_percent_budgeted [ INT ]
Invested [ INT ]
total_budget_percent_invested [ INT ]
Budget_invested_percent [ TEXT ]

endowment :
endowment_id [ INT ] primary_key
School_id [ INT ] endowment.School_id = School.School_id
donator_name [ TEXT ]
amount [ INT ]

Please write me a SQL statement that answers the following question: How many schools are there? [/INST]

Output: SELECT count(*) FROM school;


Input:
[INST] Here is a database schema:
School :
School_id [ TEXT ] primary_key
School_name [ TEXT ]
Location [ TEXT ]
Mascot [ TEXT ]
Enrollment [ INT ]
IHSAA_Class [ TEXT ]
IHSAA_Football_Class [ TEXT ]
County [ TEXT ]

budget :
School_id [ INT ] primary_key budget.School_id = School.School_id
Year [ INT ]
Budgeted [ INT ]
total_budget_percent_budgeted [ INT ]
Invested [ INT ]
total_budget_percent_invested [ INT ]
Budget_invested_percent [ TEXT ]

endowment :
endowment_id [ INT ] primary_key
School_id [ INT ] endowment.School_id = School.School_id
donator_name [ TEXT ]
amount [ INT ]

Please write me a SQL statement that answers the following question: Count the number of schools. [/INST]

Output: SELECT count(*) FROM school;


Input:
[INST] Here is a database schema:
School :
School_id [ TEXT ] primary_key
School_name [ TEXT ]
Location [ TEXT ]
Mascot [ TEXT ]
Enrollment [ INT ]
IHSAA_Class [ TEXT ]
IHSAA_Football_Class [ TEXT ]
County [ TEXT ]

budget :
School_id [ INT ] primary_key budget.School_id = School.School_id
Year [ INT ]
Budgeted [ INT ]
total_budget_percent_budgeted [ INT ]
Invested [ INT ]
total_budget_percent_invested [ INT ]
Budget_invested_percent [ TEXT ]

endowment :
endowment_id [ INT ] primary_key
School_id [ INT ] endowment.School_id = School.School_id
donator_name [ TEXT ]
amount [ INT ]

Please write me a SQL statement that answers the following question: Show all school names in alphabetical order. [/INST]

Output: SELECT school_name FROM school ORDER BY school_name;


Input:
[INST] Here is a database schema:
School :
School_id [ TEXT ] primary_key
School_name [ TEXT ]
Location [ TEXT ]
Mascot [ TEXT ]
Enrollment [ INT ]
IHSAA_Class [ TEXT ]
IHSAA_Football_Class [ TEXT ]
County [ TEXT ]

budget :
School_id [ INT ] primary_key budget.School_id = School.School_id
Year [ INT ]
Budgeted [ INT ]
total_budget_percent_budgeted [ INT ]
Invested [ INT ]
total_budget_percent_invested [ INT ]
Budget_invested_percent [ TEXT ]

endowment :
endowment_id [ INT ] primary_key
School_id [ INT ] endowment.School_id = School.School_id
donator_name [ TEXT ]
amount [ INT ]

Please write me a SQL statement that answers the following question: List the name, location, mascot for all schools. [/INST]

Output: SELECT school_name ,  LOCATION ,  mascot FROM school;


Input:
[INST] Here is a database schema:
School :
School_id [ TEXT ] primary_key
School_name [ TEXT ]
Location [ TEXT ]
Mascot [ TEXT ]
Enrollment [ INT ]
IHSAA_Class [ TEXT ]
IHSAA_Football_Class [ TEXT ]
County [ TEXT ]

budget :
School_id [ INT ] primary_key budget.School_id = School.School_id
Year [ INT ]
Budgeted [ INT ]
total_budget_percent_budgeted [ INT ]
Invested [ INT ]
total_budget_percent_invested [ INT ]
Budget_invested_percent [ TEXT ]

endowment :
endowment_id [ INT ] primary_key
School_id [ INT ] endowment.School_id = School.School_id
donator_name [ TEXT ]
amount [ INT ]

Please write me a SQL statement that answers the following question: What are the total and average enrollment of all schools? [/INST]

Output: SELECT sum(enrollment) ,  avg(enrollment) FROM school;


Input:
[INST] Here is a database schema:
School :
School_id [ TEXT ] primary_key
School_name [ TEXT ]
Location [ TEXT ]
Mascot [ TEXT ]
Enrollment [ INT ]
IHSAA_Class [ TEXT ]
IHSAA_Football_Class [ TEXT ]
County [ TEXT ]

budget :
School_id [ INT ] primary_key budget.School_id = School.School_id
Year [ INT ]
Budgeted [ INT ]
total_budget_percent_budgeted [ INT ]
Invested [ INT ]
total_budget_percent_invested [ INT ]
Budget_invested_percent [ TEXT ]

endowment :
endowment_id [ INT ] primary_key
School_id [ INT ] endowment.School_id = School.School_id
donator_name [ TEXT ]
amount [ INT ]

Please write me a SQL statement that answers the following question: What are the mascots for schools with enrollments above the average? [/INST]

Output: SELECT mascot FROM school WHERE enrollment  >  (SELECT avg(enrollment) FROM school);


Input:
[INST] Here is a database schema:
School :
School_id [ TEXT ] primary_key
School_name [ TEXT ]
Location [ TEXT ]
Mascot [ TEXT ]
Enrollment [ INT ]
IHSAA_Class [ TEXT ]
IHSAA_Football_Class [ TEXT ]
County [ TEXT ]

budget :
School_id [ INT ] primary_key budget.School_id = School.School_id
Year [ INT ]
Budgeted [ INT ]
total_budget_percent_budgeted [ INT ]
Invested [ INT ]
total_budget_percent_invested [ INT ]
Budget_invested_percent [ TEXT ]

endowment :
endowment_id [ INT ] primary_key
School_id [ INT ] endowment.School_id = School.School_id
donator_name [ TEXT ]
amount [ INT ]

Please write me a SQL statement that answers the following question: List the name of the school with the smallest enrollment. [/INST]

Output: SELECT school_name FROM school ORDER BY enrollment LIMIT 1;


Input:
[INST] Here is a database schema:
School :
School_id [ TEXT ] primary_key
School_name [ TEXT ]
Location [ TEXT ]
Mascot [ TEXT ]
Enrollment [ INT ]
IHSAA_Class [ TEXT ]
IHSAA_Football_Class [ TEXT ]
County [ TEXT ]

budget :
School_id [ INT ] primary_key budget.School_id = School.School_id
Year [ INT ]
Budgeted [ INT ]
total_budget_percent_budgeted [ INT ]
Invested [ INT ]
total_budget_percent_invested [ INT ]
Budget_invested_percent [ TEXT ]

endowment :
endowment_id [ INT ] primary_key
School_id [ INT ] endowment.School_id = School.School_id
donator_name [ TEXT ]
amount [ INT ]

Please write me a SQL statement that answers the following question: Show the average, maximum, minimum enrollment of all schools. [/INST]

Output: SELECT avg(enrollment) ,  max(enrollment) ,  min(enrollment) FROM school;


Input:
[INST] Here is a database schema:
School :
School_id [ TEXT ] primary_key
School_name [ TEXT ]
Location [ TEXT ]
Mascot [ TEXT ]
Enrollment [ INT ]
IHSAA_Class [ TEXT ]
IHSAA_Football_Class [ TEXT ]
County [ TEXT ]

budget :
School_id [ INT ] primary_key budget.School_id = School.School_id
Year [ INT ]
Budgeted [ INT ]
total_budget_percent_budgeted [ INT ]
Invested [ INT ]
total_budget_percent_invested [ INT ]
Budget_invested_percent [ TEXT ]

endowment :
endowment_id [ INT ] primary_key
School_id [ INT ] endowment.School_id = School.School_id
donator_name [ TEXT ]
amount [ INT ]

Please write me a SQL statement that answers the following question: Show each county along with the number of schools and total enrollment in each county. [/INST]

Output: SELECT county ,  count(*) ,  sum(enrollment) FROM school GROUP BY county;


Input:
[INST] Here is a database schema:
School :
School_id [ TEXT ] primary_key
School_name [ TEXT ]
Location [ TEXT ]
Mascot [ TEXT ]
Enrollment [ INT ]
IHSAA_Class [ TEXT ]
IHSAA_Football_Class [ TEXT ]
County [ TEXT ]

budget :
School_id [ INT ] primary_key budget.School_id = School.School_id
Year [ INT ]
Budgeted [ INT ]
total_budget_percent_budgeted [ INT ]
Invested [ INT ]
total_budget_percent_invested [ INT ]
Budget_invested_percent [ TEXT ]

endowment :
endowment_id [ INT ] primary_key
School_id [ INT ] endowment.School_id = School.School_id
donator_name [ TEXT ]
amount [ INT ]

Please write me a SQL statement that answers the following question: How many donors have endowment for school named "Glenn"? [/INST]

Output: SELECT count(DISTINCT T1.donator_name) FROM endowment AS T1 JOIN school AS T2 ON T1.school_id  =  T2.school_id WHERE T2.school_name  =  "Glenn";


Input:
[INST] Here is a database schema:
School :
School_id [ TEXT ] primary_key
School_name [ TEXT ]
Location [ TEXT ]
Mascot [ TEXT ]
Enrollment [ INT ]
IHSAA_Class [ TEXT ]
IHSAA_Football_Class [ TEXT ]
County [ TEXT ]

budget :
School_id [ INT ] primary_key budget.School_id = School.School_id
Year [ INT ]
Budgeted [ INT ]
total_budget_percent_budgeted [ INT ]
Invested [ INT ]
total_budget_percent_invested [ INT ]
Budget_invested_percent [ TEXT ]

endowment :
endowment_id [ INT ] primary_key
School_id [ INT ] endowment.School_id = School.School_id
donator_name [ TEXT ]
amount [ INT ]

Please write me a SQL statement that answers the following question: List each donator name and the amount of endowment in descending order of the amount of endowment. [/INST]

Output: SELECT donator_name ,  sum(amount) FROM endowment GROUP BY donator_name ORDER BY sum(amount) DESC;


Input:
[INST] Here is a database schema:
School :
School_id [ TEXT ] primary_key
School_name [ TEXT ]
Location [ TEXT ]
Mascot [ TEXT ]
Enrollment [ INT ]
IHSAA_Class [ TEXT ]
IHSAA_Football_Class [ TEXT ]
County [ TEXT ]

budget :
School_id [ INT ] primary_key budget.School_id = School.School_id
Year [ INT ]
Budgeted [ INT ]
total_budget_percent_budgeted [ INT ]
Invested [ INT ]
total_budget_percent_invested [ INT ]
Budget_invested_percent [ TEXT ]

endowment :
endowment_id [ INT ] primary_key
School_id [ INT ] endowment.School_id = School.School_id
donator_name [ TEXT ]
amount [ INT ]

Please write me a SQL statement that answers the following question: List the names of the schools without any endowment. [/INST]

Output: SELECT school_name FROM school WHERE school_id NOT IN (SELECT school_id FROM endowment);


Input:
[INST] Here is a database schema:
School :
School_id [ TEXT ] primary_key
School_name [ TEXT ]
Location [ TEXT ]
Mascot [ TEXT ]
Enrollment [ INT ]
IHSAA_Class [ TEXT ]
IHSAA_Football_Class [ TEXT ]
County [ TEXT ]

budget :
School_id [ INT ] primary_key budget.School_id = School.School_id
Year [ INT ]
Budgeted [ INT ]
total_budget_percent_budgeted [ INT ]
Invested [ INT ]
total_budget_percent_invested [ INT ]
Budget_invested_percent [ TEXT ]

endowment :
endowment_id [ INT ] primary_key
School_id [ INT ] endowment.School_id = School.School_id
donator_name [ TEXT ]
amount [ INT ]

Please write me a SQL statement that answers the following question: List all the names of schools with an endowment amount smaller than or equal to 10. [/INST]

Output: SELECT T2.school_name FROM endowment AS T1 JOIN school AS T2 ON T1.school_id  =  T2.school_id GROUP BY T1.school_id HAVING sum(T1.amount)  <=  10;


Input:
[INST] Here is a database schema:
School :
School_id [ TEXT ] primary_key
School_name [ TEXT ]
Location [ TEXT ]
Mascot [ TEXT ]
Enrollment [ INT ]
IHSAA_Class [ TEXT ]
IHSAA_Football_Class [ TEXT ]
County [ TEXT ]

budget :
School_id [ INT ] primary_key budget.School_id = School.School_id
Year [ INT ]
Budgeted [ INT ]
total_budget_percent_budgeted [ INT ]
Invested [ INT ]
total_budget_percent_invested [ INT ]
Budget_invested_percent [ TEXT ]

endowment :
endowment_id [ INT ] primary_key
School_id [ INT ] endowment.School_id = School.School_id
donator_name [ TEXT ]
amount [ INT ]

Please write me a SQL statement that answers the following question: Show the names of donors who donated to both school "Glenn" and "Triton." [/INST]

Output: SELECT T1.donator_name FROM endowment AS T1 JOIN school AS T2 ON T1.school_id  =  T2.school_id WHERE T2.school_name  =  'Glenn' INTERSECT SELECT T1.donator_name FROM endowment AS T1 JOIN school AS T2 ON T1.school_id  =  T2.school_id WHERE T2.school_name  =  'Triton';


Input:
[INST] Here is a database schema:
School :
School_id [ TEXT ] primary_key
School_name [ TEXT ]
Location [ TEXT ]
Mascot [ TEXT ]
Enrollment [ INT ]
IHSAA_Class [ TEXT ]
IHSAA_Football_Class [ TEXT ]
County [ TEXT ]

budget :
School_id [ INT ] primary_key budget.School_id = School.School_id
Year [ INT ]
Budgeted [ INT ]
total_budget_percent_budgeted [ INT ]
Invested [ INT ]
total_budget_percent_invested [ INT ]
Budget_invested_percent [ TEXT ]

endowment :
endowment_id [ INT ] primary_key
School_id [ INT ] endowment.School_id = School.School_id
donator_name [ TEXT ]
amount [ INT ]

Please write me a SQL statement that answers the following question: Show the names of all the donors except those whose donation amount less than 9. [/INST]

Output: SELECT donator_name FROM endowment EXCEPT SELECT donator_name FROM endowment WHERE amount  <  9;


Input:
[INST] Here is a database schema:
School :
School_id [ TEXT ] primary_key
School_name [ TEXT ]
Location [ TEXT ]
Mascot [ TEXT ]
Enrollment [ INT ]
IHSAA_Class [ TEXT ]
IHSAA_Football_Class [ TEXT ]
County [ TEXT ]

budget :
School_id [ INT ] primary_key budget.School_id = School.School_id
Year [ INT ]
Budgeted [ INT ]
total_budget_percent_budgeted [ INT ]
Invested [ INT ]
total_budget_percent_invested [ INT ]
Budget_invested_percent [ TEXT ]

endowment :
endowment_id [ INT ] primary_key
School_id [ INT ] endowment.School_id = School.School_id
donator_name [ TEXT ]
amount [ INT ]

Please write me a SQL statement that answers the following question: List the amount and donor name for the largest amount of donation. [/INST]

Output: SELECT amount ,  donator_name FROM endowment ORDER BY amount DESC LIMIT 1;


Input:
[INST] Here is a database schema:
School :
School_id [ TEXT ] primary_key
School_name [ TEXT ]
Location [ TEXT ]
Mascot [ TEXT ]
Enrollment [ INT ]
IHSAA_Class [ TEXT ]
IHSAA_Football_Class [ TEXT ]
County [ TEXT ]

budget :
School_id [ INT ] primary_key budget.School_id = School.School_id
Year [ INT ]
Budgeted [ INT ]
total_budget_percent_budgeted [ INT ]
Invested [ INT ]
total_budget_percent_invested [ INT ]
Budget_invested_percent [ TEXT ]

endowment :
endowment_id [ INT ] primary_key
School_id [ INT ] endowment.School_id = School.School_id
donator_name [ TEXT ]
amount [ INT ]

Please write me a SQL statement that answers the following question: How many budgets are above 3000 in year 2001 or before? [/INST]

Output: SELECT count(*) FROM budget WHERE budgeted  >  3000 AND YEAR  <=  2001;


Input:
[INST] Here is a database schema:
School :
School_id [ TEXT ] primary_key
School_name [ TEXT ]
Location [ TEXT ]
Mascot [ TEXT ]
Enrollment [ INT ]
IHSAA_Class [ TEXT ]
IHSAA_Football_Class [ TEXT ]
County [ TEXT ]

budget :
School_id [ INT ] primary_key budget.School_id = School.School_id
Year [ INT ]
Budgeted [ INT ]
total_budget_percent_budgeted [ INT ]
Invested [ INT ]
total_budget_percent_invested [ INT ]
Budget_invested_percent [ TEXT ]

endowment :
endowment_id [ INT ] primary_key
School_id [ INT ] endowment.School_id = School.School_id
donator_name [ TEXT ]
amount [ INT ]

Please write me a SQL statement that answers the following question: Count the number of budgets in year 2001 or before whose budgeted amount is greater than 3000 [/INST]

Output: SELECT count(*) FROM budget WHERE budgeted  >  3000 AND YEAR  <=  2001;


Input:
[INST] Here is a database schema:
School :
School_id [ TEXT ] primary_key
School_name [ TEXT ]
Location [ TEXT ]
Mascot [ TEXT ]
Enrollment [ INT ]
IHSAA_Class [ TEXT ]
IHSAA_Football_Class [ TEXT ]
County [ TEXT ]

budget :
School_id [ INT ] primary_key budget.School_id = School.School_id
Year [ INT ]
Budgeted [ INT ]
total_budget_percent_budgeted [ INT ]
Invested [ INT ]
total_budget_percent_invested [ INT ]
Budget_invested_percent [ TEXT ]

endowment :
endowment_id [ INT ] primary_key
School_id [ INT ] endowment.School_id = School.School_id
donator_name [ TEXT ]
amount [ INT ]

Please write me a SQL statement that answers the following question: Show each school name, its budgeted amount, and invested amount in year 2002 or after. [/INST]

Output: SELECT T2.school_name ,  T1.budgeted ,  T1.invested FROM budget AS T1 JOIN school AS T2 ON T1.school_id  =  T2.school_id WHERE T1.year  >=  2002;


Input:
[INST] Here is a database schema:
School :
School_id [ TEXT ] primary_key
School_name [ TEXT ]
Location [ TEXT ]
Mascot [ TEXT ]
Enrollment [ INT ]
IHSAA_Class [ TEXT ]
IHSAA_Football_Class [ TEXT ]
County [ TEXT ]

budget :
School_id [ INT ] primary_key budget.School_id = School.School_id
Year [ INT ]
Budgeted [ INT ]
total_budget_percent_budgeted [ INT ]
Invested [ INT ]
total_budget_percent_invested [ INT ]
Budget_invested_percent [ TEXT ]

endowment :
endowment_id [ INT ] primary_key
School_id [ INT ] endowment.School_id = School.School_id
donator_name [ TEXT ]
amount [ INT ]

Please write me a SQL statement that answers the following question: Show all donor names. [/INST]

Output: SELECT DISTINCT donator_name FROM endowment;


Input:
[INST] Here is a database schema:
School :
School_id [ TEXT ] primary_key
School_name [ TEXT ]
Location [ TEXT ]
Mascot [ TEXT ]
Enrollment [ INT ]
IHSAA_Class [ TEXT ]
IHSAA_Football_Class [ TEXT ]
County [ TEXT ]

budget :
School_id [ INT ] primary_key budget.School_id = School.School_id
Year [ INT ]
Budgeted [ INT ]
total_budget_percent_budgeted [ INT ]
Invested [ INT ]
total_budget_percent_invested [ INT ]
Budget_invested_percent [ TEXT ]

endowment :
endowment_id [ INT ] primary_key
School_id [ INT ] endowment.School_id = School.School_id
donator_name [ TEXT ]
amount [ INT ]

Please write me a SQL statement that answers the following question: How many budget record has a budget amount smaller than the invested amount? [/INST]

Output: SELECT count(*) FROM budget WHERE budgeted  <  invested;


Input:
[INST] Here is a database schema:
School :
School_id [ TEXT ] primary_key
School_name [ TEXT ]
Location [ TEXT ]
Mascot [ TEXT ]
Enrollment [ INT ]
IHSAA_Class [ TEXT ]
IHSAA_Football_Class [ TEXT ]
County [ TEXT ]

budget :
School_id [ INT ] primary_key budget.School_id = School.School_id
Year [ INT ]
Budgeted [ INT ]
total_budget_percent_budgeted [ INT ]
Invested [ INT ]
total_budget_percent_invested [ INT ]
Budget_invested_percent [ TEXT ]

endowment :
endowment_id [ INT ] primary_key
School_id [ INT ] endowment.School_id = School.School_id
donator_name [ TEXT ]
amount [ INT ]

Please write me a SQL statement that answers the following question: What is the total budget amount for school "Glenn" in all years? [/INST]

Output: SELECT sum(T1.budgeted) FROM budget AS T1 JOIN school AS T2 ON T1.school_id  =  T2.school_id WHERE T2.school_name  =  'Glenn';


Input:
[INST] Here is a database schema:
School :
School_id [ TEXT ] primary_key
School_name [ TEXT ]
Location [ TEXT ]
Mascot [ TEXT ]
Enrollment [ INT ]
IHSAA_Class [ TEXT ]
IHSAA_Football_Class [ TEXT ]
County [ TEXT ]

budget :
School_id [ INT ] primary_key budget.School_id = School.School_id
Year [ INT ]
Budgeted [ INT ]
total_budget_percent_budgeted [ INT ]
Invested [ INT ]
total_budget_percent_invested [ INT ]
Budget_invested_percent [ TEXT ]

endowment :
endowment_id [ INT ] primary_key
School_id [ INT ] endowment.School_id = School.School_id
donator_name [ TEXT ]
amount [ INT ]

Please write me a SQL statement that answers the following question: Show the names of schools with a total budget amount greater than 100 or a total endowment greater than 10. [/INST]

Output: SELECT T2.school_name FROM budget AS T1 JOIN school AS T2 ON T1.school_id  =  T2.school_id JOIN endowment AS T3 ON T2.school_id  =  T3.school_id GROUP BY T2.school_name HAVING sum(T1.budgeted)  >  100 OR sum(T3.amount)  >  10;


Input:
[INST] Here is a database schema:
School :
School_id [ TEXT ] primary_key
School_name [ TEXT ]
Location [ TEXT ]
Mascot [ TEXT ]
Enrollment [ INT ]
IHSAA_Class [ TEXT ]
IHSAA_Football_Class [ TEXT ]
County [ TEXT ]

budget :
School_id [ INT ] primary_key budget.School_id = School.School_id
Year [ INT ]
Budgeted [ INT ]
total_budget_percent_budgeted [ INT ]
Invested [ INT ]
total_budget_percent_invested [ INT ]
Budget_invested_percent [ TEXT ]

endowment :
endowment_id [ INT ] primary_key
School_id [ INT ] endowment.School_id = School.School_id
donator_name [ TEXT ]
amount [ INT ]

Please write me a SQL statement that answers the following question: Find the names of schools that have more than one donator with donation amount above 8.5. [/INST]

Output: SELECT T2.School_name FROM endowment AS T1 JOIN school AS T2 ON T1.school_id  =  T2.school_id WHERE T1.amount  >  8.5 GROUP BY T1.school_id HAVING count(*)  >  1;


Input:
[INST] Here is a database schema:
School :
School_id [ TEXT ] primary_key
School_name [ TEXT ]
Location [ TEXT ]
Mascot [ TEXT ]
Enrollment [ INT ]
IHSAA_Class [ TEXT ]
IHSAA_Football_Class [ TEXT ]
County [ TEXT ]

budget :
School_id [ INT ] primary_key budget.School_id = School.School_id
Year [ INT ]
Budgeted [ INT ]
total_budget_percent_budgeted [ INT ]
Invested [ INT ]
total_budget_percent_invested [ INT ]
Budget_invested_percent [ TEXT ]

endowment :
endowment_id [ INT ] primary_key
School_id [ INT ] endowment.School_id = School.School_id
donator_name [ TEXT ]
amount [ INT ]

Please write me a SQL statement that answers the following question: Find the number of schools that have more than one donator whose donation amount is less than 8.5. [/INST]

Output: SELECT count(*) FROM (SELECT * FROM endowment WHERE amount  >  8.5 GROUP BY school_id HAVING count(*)  >  1);


Input:
[INST] Here is a database schema:
School :
School_id [ TEXT ] primary_key
School_name [ TEXT ]
Location [ TEXT ]
Mascot [ TEXT ]
Enrollment [ INT ]
IHSAA_Class [ TEXT ]
IHSAA_Football_Class [ TEXT ]
County [ TEXT ]

budget :
School_id [ INT ] primary_key budget.School_id = School.School_id
Year [ INT ]
Budgeted [ INT ]
total_budget_percent_budgeted [ INT ]
Invested [ INT ]
total_budget_percent_invested [ INT ]
Budget_invested_percent [ TEXT ]

endowment :
endowment_id [ INT ] primary_key
School_id [ INT ] endowment.School_id = School.School_id
donator_name [ TEXT ]
amount [ INT ]

Please write me a SQL statement that answers the following question: List the name, IHSAA Football Class, and Mascot of the schools that have more than 6000 of budgeted amount or were founded before 2003, in the order of percent of total invested budget and total budgeted budget. [/INST]

Output: SELECT T1.School_name ,  T1.Mascot ,  T1.IHSAA_Football_Class FROM school AS T1 JOIN budget AS T2 ON T1.school_id  =  T2.school_id WHERE Budgeted  >  6000 OR YEAR  <  2003 ORDER BY T2.total_budget_percent_invested ,  T2.total_budget_percent_budgeted;


Input:
[INST] Here is a database schema:
building :
building_id [ TEXT ] primary_key
Name [ TEXT ]
Street_address [ TEXT ]
Years_as_tallest [ TEXT ]
Height_feet [ INT ]
Floors [ INT ]

Institution :
Institution_id [ TEXT ] primary_key
Institution [ TEXT ]
Location [ TEXT ]
Founded [ INT ]
Type [ TEXT ]
Enrollment [ INT ]
Team [ TEXT ]
Primary_Conference [ TEXT ]
building_id [ TEXT ] Institution.building_id = building.building_id

protein :
common_name [ TEXT ] primary_key
protein_name [ TEXT ]
divergence_from_human_lineage [ INT ]
accession_number [ TEXT ]
sequence_length [ INT ]
sequence_identity_to_human_protein [ TEXT ]
Institution_id [ TEXT ] protein.Institution_id = Institution.Institution_id

Please write me a SQL statement that answers the following question: How many buildings are there? [/INST]

Output: SELECT count(*) FROM building;


Input:
[INST] Here is a database schema:
building :
building_id [ TEXT ] primary_key
Name [ TEXT ]
Street_address [ TEXT ]
Years_as_tallest [ TEXT ]
Height_feet [ INT ]
Floors [ INT ]

Institution :
Institution_id [ TEXT ] primary_key
Institution [ TEXT ]
Location [ TEXT ]
Founded [ INT ]
Type [ TEXT ]
Enrollment [ INT ]
Team [ TEXT ]
Primary_Conference [ TEXT ]
building_id [ TEXT ] Institution.building_id = building.building_id

protein :
common_name [ TEXT ] primary_key
protein_name [ TEXT ]
divergence_from_human_lineage [ INT ]
accession_number [ TEXT ]
sequence_length [ INT ]
sequence_identity_to_human_protein [ TEXT ]
Institution_id [ TEXT ] protein.Institution_id = Institution.Institution_id

Please write me a SQL statement that answers the following question: Show the name, street address, and number of floors for all buildings ordered by the number of floors. [/INST]

Output: SELECT name ,  street_address ,  floors FROM building ORDER BY floors;


Input:
[INST] Here is a database schema:
building :
building_id [ TEXT ] primary_key
Name [ TEXT ]
Street_address [ TEXT ]
Years_as_tallest [ TEXT ]
Height_feet [ INT ]
Floors [ INT ]

Institution :
Institution_id [ TEXT ] primary_key
Institution [ TEXT ]
Location [ TEXT ]
Founded [ INT ]
Type [ TEXT ]
Enrollment [ INT ]
Team [ TEXT ]
Primary_Conference [ TEXT ]
building_id [ TEXT ] Institution.building_id = building.building_id

protein :
common_name [ TEXT ] primary_key
protein_name [ TEXT ]
divergence_from_human_lineage [ INT ]
accession_number [ TEXT ]
sequence_length [ INT ]
sequence_identity_to_human_protein [ TEXT ]
Institution_id [ TEXT ] protein.Institution_id = Institution.Institution_id

Please write me a SQL statement that answers the following question: What is the name of the tallest building? [/INST]

Output: SELECT name FROM building ORDER BY height_feet DESC LIMIT 1;


Input:
[INST] Here is a database schema:
building :
building_id [ TEXT ] primary_key
Name [ TEXT ]
Street_address [ TEXT ]
Years_as_tallest [ TEXT ]
Height_feet [ INT ]
Floors [ INT ]

Institution :
Institution_id [ TEXT ] primary_key
Institution [ TEXT ]
Location [ TEXT ]
Founded [ INT ]
Type [ TEXT ]
Enrollment [ INT ]
Team [ TEXT ]
Primary_Conference [ TEXT ]
building_id [ TEXT ] Institution.building_id = building.building_id

protein :
common_name [ TEXT ] primary_key
protein_name [ TEXT ]
divergence_from_human_lineage [ INT ]
accession_number [ TEXT ]
sequence_length [ INT ]
sequence_identity_to_human_protein [ TEXT ]
Institution_id [ TEXT ] protein.Institution_id = Institution.Institution_id

Please write me a SQL statement that answers the following question: What are the average, maximum, and minimum number of floors for all buildings? [/INST]

Output: SELECT avg(floors) ,  max(floors) ,  min(floors) FROM building;


Input:
[INST] Here is a database schema:
building :
building_id [ TEXT ] primary_key
Name [ TEXT ]
Street_address [ TEXT ]
Years_as_tallest [ TEXT ]
Height_feet [ INT ]
Floors [ INT ]

Institution :
Institution_id [ TEXT ] primary_key
Institution [ TEXT ]
Location [ TEXT ]
Founded [ INT ]
Type [ TEXT ]
Enrollment [ INT ]
Team [ TEXT ]
Primary_Conference [ TEXT ]
building_id [ TEXT ] Institution.building_id = building.building_id

protein :
common_name [ TEXT ] primary_key
protein_name [ TEXT ]
divergence_from_human_lineage [ INT ]
accession_number [ TEXT ]
sequence_length [ INT ]
sequence_identity_to_human_protein [ TEXT ]
Institution_id [ TEXT ] protein.Institution_id = Institution.Institution_id

Please write me a SQL statement that answers the following question: Show the number of buildings with a height above the average or a number of floors above the average. [/INST]

Output: SELECT count(*) FROM building WHERE height_feet  >  (SELECT avg(height_feet) FROM building) OR floors  >  (SELECT avg(floors) FROM building);


Input:
[INST] Here is a database schema:
building :
building_id [ TEXT ] primary_key
Name [ TEXT ]
Street_address [ TEXT ]
Years_as_tallest [ TEXT ]
Height_feet [ INT ]
Floors [ INT ]

Institution :
Institution_id [ TEXT ] primary_key
Institution [ TEXT ]
Location [ TEXT ]
Founded [ INT ]
Type [ TEXT ]
Enrollment [ INT ]
Team [ TEXT ]
Primary_Conference [ TEXT ]
building_id [ TEXT ] Institution.building_id = building.building_id

protein :
common_name [ TEXT ] primary_key
protein_name [ TEXT ]
divergence_from_human_lineage [ INT ]
accession_number [ TEXT ]
sequence_length [ INT ]
sequence_identity_to_human_protein [ TEXT ]
Institution_id [ TEXT ] protein.Institution_id = Institution.Institution_id

Please write me a SQL statement that answers the following question: List the names of buildings with at least 200 feet of height and with at least 20 floors. [/INST]

Output: SELECT name FROM building WHERE height_feet  >=  200 AND floors  >=  20;


Input:
[INST] Here is a database schema:
building :
building_id [ TEXT ] primary_key
Name [ TEXT ]
Street_address [ TEXT ]
Years_as_tallest [ TEXT ]
Height_feet [ INT ]
Floors [ INT ]

Institution :
Institution_id [ TEXT ] primary_key
Institution [ TEXT ]
Location [ TEXT ]
Founded [ INT ]
Type [ TEXT ]
Enrollment [ INT ]
Team [ TEXT ]
Primary_Conference [ TEXT ]
building_id [ TEXT ] Institution.building_id = building.building_id

protein :
common_name [ TEXT ] primary_key
protein_name [ TEXT ]
divergence_from_human_lineage [ INT ]
accession_number [ TEXT ]
sequence_length [ INT ]
sequence_identity_to_human_protein [ TEXT ]
Institution_id [ TEXT ] protein.Institution_id = Institution.Institution_id

Please write me a SQL statement that answers the following question: Show the names and locations of institutions that are founded after 1990 and have the type "Private". [/INST]

Output: SELECT institution ,  LOCATION FROM institution WHERE founded  >  1990 AND TYPE  =  'Private';


Input:
[INST] Here is a database schema:
building :
building_id [ TEXT ] primary_key
Name [ TEXT ]
Street_address [ TEXT ]
Years_as_tallest [ TEXT ]
Height_feet [ INT ]
Floors [ INT ]

Institution :
Institution_id [ TEXT ] primary_key
Institution [ TEXT ]
Location [ TEXT ]
Founded [ INT ]
Type [ TEXT ]
Enrollment [ INT ]
Team [ TEXT ]
Primary_Conference [ TEXT ]
building_id [ TEXT ] Institution.building_id = building.building_id

protein :
common_name [ TEXT ] primary_key
protein_name [ TEXT ]
divergence_from_human_lineage [ INT ]
accession_number [ TEXT ]
sequence_length [ INT ]
sequence_identity_to_human_protein [ TEXT ]
Institution_id [ TEXT ] protein.Institution_id = Institution.Institution_id

Please write me a SQL statement that answers the following question: Show institution types, along with the number of institutions and total enrollment for each type. [/INST]

Output: SELECT TYPE ,  count(*) ,  sum(enrollment) FROM institution GROUP BY TYPE;


Input:
[INST] Here is a database schema:
building :
building_id [ TEXT ] primary_key
Name [ TEXT ]
Street_address [ TEXT ]
Years_as_tallest [ TEXT ]
Height_feet [ INT ]
Floors [ INT ]

Institution :
Institution_id [ TEXT ] primary_key
Institution [ TEXT ]
Location [ TEXT ]
Founded [ INT ]
Type [ TEXT ]
Enrollment [ INT ]
Team [ TEXT ]
Primary_Conference [ TEXT ]
building_id [ TEXT ] Institution.building_id = building.building_id

protein :
common_name [ TEXT ] primary_key
protein_name [ TEXT ]
divergence_from_human_lineage [ INT ]
accession_number [ TEXT ]
sequence_length [ INT ]
sequence_identity_to_human_protein [ TEXT ]
Institution_id [ TEXT ] protein.Institution_id = Institution.Institution_id

Please write me a SQL statement that answers the following question: Show the institution type with the largest number of institutions. [/INST]

Output: SELECT TYPE FROM institution GROUP BY TYPE ORDER BY count(*) DESC LIMIT 1;


Input:
[INST] Here is a database schema:
building :
building_id [ TEXT ] primary_key
Name [ TEXT ]
Street_address [ TEXT ]
Years_as_tallest [ TEXT ]
Height_feet [ INT ]
Floors [ INT ]

Institution :
Institution_id [ TEXT ] primary_key
Institution [ TEXT ]
Location [ TEXT ]
Founded [ INT ]
Type [ TEXT ]
Enrollment [ INT ]
Team [ TEXT ]
Primary_Conference [ TEXT ]
building_id [ TEXT ] Institution.building_id = building.building_id

protein :
common_name [ TEXT ] primary_key
protein_name [ TEXT ]
divergence_from_human_lineage [ INT ]
accession_number [ TEXT ]
sequence_length [ INT ]
sequence_identity_to_human_protein [ TEXT ]
Institution_id [ TEXT ] protein.Institution_id = Institution.Institution_id

Please write me a SQL statement that answers the following question: Show the institution type with an institution founded after 1990 and an institution with at least 1000 enrollment. [/INST]

Output: SELECT TYPE FROM institution WHERE founded  >  1990 AND enrollment  >=  1000;


Input:
[INST] Here is a database schema:
building :
building_id [ TEXT ] primary_key
Name [ TEXT ]
Street_address [ TEXT ]
Years_as_tallest [ TEXT ]
Height_feet [ INT ]
Floors [ INT ]

Institution :
Institution_id [ TEXT ] primary_key
Institution [ TEXT ]
Location [ TEXT ]
Founded [ INT ]
Type [ TEXT ]
Enrollment [ INT ]
Team [ TEXT ]
Primary_Conference [ TEXT ]
building_id [ TEXT ] Institution.building_id = building.building_id

protein :
common_name [ TEXT ] primary_key
protein_name [ TEXT ]
divergence_from_human_lineage [ INT ]
accession_number [ TEXT ]
sequence_length [ INT ]
sequence_identity_to_human_protein [ TEXT ]
Institution_id [ TEXT ] protein.Institution_id = Institution.Institution_id

Please write me a SQL statement that answers the following question: Show the name of buildings that do not have any institution. [/INST]

Output: SELECT name FROM building WHERE building_id NOT IN (SELECT building_id FROM institution);


Input:
[INST] Here is a database schema:
building :
building_id [ TEXT ] primary_key
Name [ TEXT ]
Street_address [ TEXT ]
Years_as_tallest [ TEXT ]
Height_feet [ INT ]
Floors [ INT ]

Institution :
Institution_id [ TEXT ] primary_key
Institution [ TEXT ]
Location [ TEXT ]
Founded [ INT ]
Type [ TEXT ]
Enrollment [ INT ]
Team [ TEXT ]
Primary_Conference [ TEXT ]
building_id [ TEXT ] Institution.building_id = building.building_id

protein :
common_name [ TEXT ] primary_key
protein_name [ TEXT ]
divergence_from_human_lineage [ INT ]
accession_number [ TEXT ]
sequence_length [ INT ]
sequence_identity_to_human_protein [ TEXT ]
Institution_id [ TEXT ] protein.Institution_id = Institution.Institution_id

Please write me a SQL statement that answers the following question: Show the names of buildings except for those having an institution founded in 2003. [/INST]

Output: SELECT name FROM building EXCEPT SELECT T1.name FROM building AS T1 JOIN institution AS T2 ON T1.building_id  =  T2.building_id WHERE T2.founded  =  2003;


Input:
[INST] Here is a database schema:
building :
building_id [ TEXT ] primary_key
Name [ TEXT ]
Street_address [ TEXT ]
Years_as_tallest [ TEXT ]
Height_feet [ INT ]
Floors [ INT ]

Institution :
Institution_id [ TEXT ] primary_key
Institution [ TEXT ]
Location [ TEXT ]
Founded [ INT ]
Type [ TEXT ]
Enrollment [ INT ]
Team [ TEXT ]
Primary_Conference [ TEXT ]
building_id [ TEXT ] Institution.building_id = building.building_id

protein :
common_name [ TEXT ] primary_key
protein_name [ TEXT ]
divergence_from_human_lineage [ INT ]
accession_number [ TEXT ]
sequence_length [ INT ]
sequence_identity_to_human_protein [ TEXT ]
Institution_id [ TEXT ] protein.Institution_id = Institution.Institution_id

Please write me a SQL statement that answers the following question: For each building, show the name of the building and the number of institutions in it. [/INST]

Output: SELECT T1.name ,  count(*) FROM building AS T1 JOIN institution AS T2 ON T1.building_id  =  T2.building_id GROUP BY T1.building_id;


Input:
[INST] Here is a database schema:
building :
building_id [ TEXT ] primary_key
Name [ TEXT ]
Street_address [ TEXT ]
Years_as_tallest [ TEXT ]
Height_feet [ INT ]
Floors [ INT ]

Institution :
Institution_id [ TEXT ] primary_key
Institution [ TEXT ]
Location [ TEXT ]
Founded [ INT ]
Type [ TEXT ]
Enrollment [ INT ]
Team [ TEXT ]
Primary_Conference [ TEXT ]
building_id [ TEXT ] Institution.building_id = building.building_id

protein :
common_name [ TEXT ] primary_key
protein_name [ TEXT ]
divergence_from_human_lineage [ INT ]
accession_number [ TEXT ]
sequence_length [ INT ]
sequence_identity_to_human_protein [ TEXT ]
Institution_id [ TEXT ] protein.Institution_id = Institution.Institution_id

Please write me a SQL statement that answers the following question: Show the names and heights of buildings with at least two institutions founded after 1880. [/INST]

Output: SELECT T1.name ,  T1.height_feet FROM building AS T1 JOIN institution AS T2 ON T1.building_id  =  T2.building_id WHERE T2.founded  >  1880 GROUP BY T1.building_id HAVING count(*)  >=  2;


Input:
[INST] Here is a database schema:
building :
building_id [ TEXT ] primary_key
Name [ TEXT ]
Street_address [ TEXT ]
Years_as_tallest [ TEXT ]
Height_feet [ INT ]
Floors [ INT ]

Institution :
Institution_id [ TEXT ] primary_key
Institution [ TEXT ]
Location [ TEXT ]
Founded [ INT ]
Type [ TEXT ]
Enrollment [ INT ]
Team [ TEXT ]
Primary_Conference [ TEXT ]
building_id [ TEXT ] Institution.building_id = building.building_id

protein :
common_name [ TEXT ] primary_key
protein_name [ TEXT ]
divergence_from_human_lineage [ INT ]
accession_number [ TEXT ]
sequence_length [ INT ]
sequence_identity_to_human_protein [ TEXT ]
Institution_id [ TEXT ] protein.Institution_id = Institution.Institution_id

Please write me a SQL statement that answers the following question: Show all the distinct institution types. [/INST]

Output: SELECT DISTINCT TYPE FROM institution;


Input:
[INST] Here is a database schema:
building :
building_id [ TEXT ] primary_key
Name [ TEXT ]
Street_address [ TEXT ]
Years_as_tallest [ TEXT ]
Height_feet [ INT ]
Floors [ INT ]

Institution :
Institution_id [ TEXT ] primary_key
Institution [ TEXT ]
Location [ TEXT ]
Founded [ INT ]
Type [ TEXT ]
Enrollment [ INT ]
Team [ TEXT ]
Primary_Conference [ TEXT ]
building_id [ TEXT ] Institution.building_id = building.building_id

protein :
common_name [ TEXT ] primary_key
protein_name [ TEXT ]
divergence_from_human_lineage [ INT ]
accession_number [ TEXT ]
sequence_length [ INT ]
sequence_identity_to_human_protein [ TEXT ]
Institution_id [ TEXT ] protein.Institution_id = Institution.Institution_id

Please write me a SQL statement that answers the following question: Show institution names along with the number of proteins for each institution. [/INST]

Output: SELECT T1.institution ,  count(*) FROM institution AS T1 JOIN protein AS T2 ON T1.institution_id  =  T2.institution_id GROUP BY T1.institution_id;


Input:
[INST] Here is a database schema:
building :
building_id [ TEXT ] primary_key
Name [ TEXT ]
Street_address [ TEXT ]
Years_as_tallest [ TEXT ]
Height_feet [ INT ]
Floors [ INT ]

Institution :
Institution_id [ TEXT ] primary_key
Institution [ TEXT ]
Location [ TEXT ]
Founded [ INT ]
Type [ TEXT ]
Enrollment [ INT ]
Team [ TEXT ]
Primary_Conference [ TEXT ]
building_id [ TEXT ] Institution.building_id = building.building_id

protein :
common_name [ TEXT ] primary_key
protein_name [ TEXT ]
divergence_from_human_lineage [ INT ]
accession_number [ TEXT ]
sequence_length [ INT ]
sequence_identity_to_human_protein [ TEXT ]
Institution_id [ TEXT ] protein.Institution_id = Institution.Institution_id

Please write me a SQL statement that answers the following question: How many proteins are associated with an institution founded after 1880 or an institution with type "Private"? [/INST]

Output: SELECT count(*) FROM institution AS T1 JOIN protein AS T2 ON T1.institution_id  =  T2.institution_id WHERE T1.founded  >  1880 OR T1.type  =  'Private';


Input:
[INST] Here is a database schema:
building :
building_id [ TEXT ] primary_key
Name [ TEXT ]
Street_address [ TEXT ]
Years_as_tallest [ TEXT ]
Height_feet [ INT ]
Floors [ INT ]

Institution :
Institution_id [ TEXT ] primary_key
Institution [ TEXT ]
Location [ TEXT ]
Founded [ INT ]
Type [ TEXT ]
Enrollment [ INT ]
Team [ TEXT ]
Primary_Conference [ TEXT ]
building_id [ TEXT ] Institution.building_id = building.building_id

protein :
common_name [ TEXT ] primary_key
protein_name [ TEXT ]
divergence_from_human_lineage [ INT ]
accession_number [ TEXT ]
sequence_length [ INT ]
sequence_identity_to_human_protein [ TEXT ]
Institution_id [ TEXT ] protein.Institution_id = Institution.Institution_id

Please write me a SQL statement that answers the following question: Show the protein name and the institution name. [/INST]

Output: SELECT T2.protein_name ,  T1.institution FROM institution AS T1 JOIN protein AS T2 ON T1.institution_id  =  T2.institution_id;


Input:
[INST] Here is a database schema:
building :
building_id [ TEXT ] primary_key
Name [ TEXT ]
Street_address [ TEXT ]
Years_as_tallest [ TEXT ]
Height_feet [ INT ]
Floors [ INT ]

Institution :
Institution_id [ TEXT ] primary_key
Institution [ TEXT ]
Location [ TEXT ]
Founded [ INT ]
Type [ TEXT ]
Enrollment [ INT ]
Team [ TEXT ]
Primary_Conference [ TEXT ]
building_id [ TEXT ] Institution.building_id = building.building_id

protein :
common_name [ TEXT ] primary_key
protein_name [ TEXT ]
divergence_from_human_lineage [ INT ]
accession_number [ TEXT ]
sequence_length [ INT ]
sequence_identity_to_human_protein [ TEXT ]
Institution_id [ TEXT ] protein.Institution_id = Institution.Institution_id

Please write me a SQL statement that answers the following question: How many proteins are associated with an institution in a building with at least 20 floors? [/INST]

Output: SELECT count(*) FROM institution AS T1 JOIN protein AS T2 ON T1.institution_id  =  T2.institution_id JOIN building AS T3 ON T3.building_id  =  T1.building_id WHERE T3.floors  >=  20;


Input:
[INST] Here is a database schema:
building :
building_id [ TEXT ] primary_key
Name [ TEXT ]
Street_address [ TEXT ]
Years_as_tallest [ TEXT ]
Height_feet [ INT ]
Floors [ INT ]

Institution :
Institution_id [ TEXT ] primary_key
Institution [ TEXT ]
Location [ TEXT ]
Founded [ INT ]
Type [ TEXT ]
Enrollment [ INT ]
Team [ TEXT ]
Primary_Conference [ TEXT ]
building_id [ TEXT ] Institution.building_id = building.building_id

protein :
common_name [ TEXT ] primary_key
protein_name [ TEXT ]
divergence_from_human_lineage [ INT ]
accession_number [ TEXT ]
sequence_length [ INT ]
sequence_identity_to_human_protein [ TEXT ]
Institution_id [ TEXT ] protein.Institution_id = Institution.Institution_id

Please write me a SQL statement that answers the following question: How many institutions do not have an associated protein in our record? [/INST]

Output: SELECT count(*) FROM institution WHERE institution_id NOT IN (SELECT institution_id FROM protein);


Input:
[INST] Here is a database schema:
film :
Film_ID [ INT ] primary_key
Rank_in_series [ INT ]
Number_in_season [ INT ]
Title [ TEXT ]
Directed_by [ TEXT ]
Original_air_date [ TEXT ]
Production_code [ TEXT ]

cinema :
Cinema_ID [ INT ] primary_key
Name [ TEXT ]
Openning_year [ INT ]
Capacity [ INT ]
Location [ TEXT ]

schedule :
Cinema_ID [ INT ] primary_key schedule.Cinema_ID = cinema.Cinema_ID
Film_ID [ INT ] schedule.Film_ID = film.Film_ID
Date [ TEXT ]
Show_times_per_day [ INT ]
Price [ INT ]

Please write me a SQL statement that answers the following question: Show all the locations where no cinema has capacity over 800. [/INST]

Output: SELECT LOCATION FROM cinema EXCEPT SELECT LOCATION FROM cinema WHERE capacity  >  800;


Input:
[INST] Here is a database schema:
film :
Film_ID [ INT ] primary_key
Rank_in_series [ INT ]
Number_in_season [ INT ]
Title [ TEXT ]
Directed_by [ TEXT ]
Original_air_date [ TEXT ]
Production_code [ TEXT ]

cinema :
Cinema_ID [ INT ] primary_key
Name [ TEXT ]
Openning_year [ INT ]
Capacity [ INT ]
Location [ TEXT ]

schedule :
Cinema_ID [ INT ] primary_key schedule.Cinema_ID = cinema.Cinema_ID
Film_ID [ INT ] schedule.Film_ID = film.Film_ID
Date [ TEXT ]
Show_times_per_day [ INT ]
Price [ INT ]

Please write me a SQL statement that answers the following question: Show all the locations where some cinemas were opened in both year 2010 and year 2011. [/INST]

Output: SELECT LOCATION FROM cinema WHERE openning_year  =  2010 INTERSECT SELECT LOCATION FROM cinema WHERE openning_year  =  2011;


Input:
[INST] Here is a database schema:
film :
Film_ID [ INT ] primary_key
Rank_in_series [ INT ]
Number_in_season [ INT ]
Title [ TEXT ]
Directed_by [ TEXT ]
Original_air_date [ TEXT ]
Production_code [ TEXT ]

cinema :
Cinema_ID [ INT ] primary_key
Name [ TEXT ]
Openning_year [ INT ]
Capacity [ INT ]
Location [ TEXT ]

schedule :
Cinema_ID [ INT ] primary_key schedule.Cinema_ID = cinema.Cinema_ID
Film_ID [ INT ] schedule.Film_ID = film.Film_ID
Date [ TEXT ]
Show_times_per_day [ INT ]
Price [ INT ]

Please write me a SQL statement that answers the following question: How many cinema do we have? [/INST]

Output: SELECT count(*) FROM cinema;


Input:
[INST] Here is a database schema:
film :
Film_ID [ INT ] primary_key
Rank_in_series [ INT ]
Number_in_season [ INT ]
Title [ TEXT ]
Directed_by [ TEXT ]
Original_air_date [ TEXT ]
Production_code [ TEXT ]

cinema :
Cinema_ID [ INT ] primary_key
Name [ TEXT ]
Openning_year [ INT ]
Capacity [ INT ]
Location [ TEXT ]

schedule :
Cinema_ID [ INT ] primary_key schedule.Cinema_ID = cinema.Cinema_ID
Film_ID [ INT ] schedule.Film_ID = film.Film_ID
Date [ TEXT ]
Show_times_per_day [ INT ]
Price [ INT ]

Please write me a SQL statement that answers the following question: Count the number of cinemas. [/INST]

Output: SELECT count(*) FROM cinema;


Input:
[INST] Here is a database schema:
film :
Film_ID [ INT ] primary_key
Rank_in_series [ INT ]
Number_in_season [ INT ]
Title [ TEXT ]
Directed_by [ TEXT ]
Original_air_date [ TEXT ]
Production_code [ TEXT ]

cinema :
Cinema_ID [ INT ] primary_key
Name [ TEXT ]
Openning_year [ INT ]
Capacity [ INT ]
Location [ TEXT ]

schedule :
Cinema_ID [ INT ] primary_key schedule.Cinema_ID = cinema.Cinema_ID
Film_ID [ INT ] schedule.Film_ID = film.Film_ID
Date [ TEXT ]
Show_times_per_day [ INT ]
Price [ INT ]

Please write me a SQL statement that answers the following question: Show name, opening year, and capacity for each cinema. [/INST]

Output: SELECT name ,  openning_year ,  capacity FROM cinema;


Input:
[INST] Here is a database schema:
film :
Film_ID [ INT ] primary_key
Rank_in_series [ INT ]
Number_in_season [ INT ]
Title [ TEXT ]
Directed_by [ TEXT ]
Original_air_date [ TEXT ]
Production_code [ TEXT ]

cinema :
Cinema_ID [ INT ] primary_key
Name [ TEXT ]
Openning_year [ INT ]
Capacity [ INT ]
Location [ TEXT ]

schedule :
Cinema_ID [ INT ] primary_key schedule.Cinema_ID = cinema.Cinema_ID
Film_ID [ INT ] schedule.Film_ID = film.Film_ID
Date [ TEXT ]
Show_times_per_day [ INT ]
Price [ INT ]

Please write me a SQL statement that answers the following question: Show the cinema name and location for cinemas with capacity above average. [/INST]

Output: SELECT name ,  LOCATION FROM cinema WHERE capacity  >  (SELECT avg(capacity) FROM cinema);


Input:
[INST] Here is a database schema:
film :
Film_ID [ INT ] primary_key
Rank_in_series [ INT ]
Number_in_season [ INT ]
Title [ TEXT ]
Directed_by [ TEXT ]
Original_air_date [ TEXT ]
Production_code [ TEXT ]

cinema :
Cinema_ID [ INT ] primary_key
Name [ TEXT ]
Openning_year [ INT ]
Capacity [ INT ]
Location [ TEXT ]

schedule :
Cinema_ID [ INT ] primary_key schedule.Cinema_ID = cinema.Cinema_ID
Film_ID [ INT ] schedule.Film_ID = film.Film_ID
Date [ TEXT ]
Show_times_per_day [ INT ]
Price [ INT ]

Please write me a SQL statement that answers the following question: What are all the locations with a cinema? [/INST]

Output: SELECT DISTINCT LOCATION FROM cinema;


Input:
[INST] Here is a database schema:
film :
Film_ID [ INT ] primary_key
Rank_in_series [ INT ]
Number_in_season [ INT ]
Title [ TEXT ]
Directed_by [ TEXT ]
Original_air_date [ TEXT ]
Production_code [ TEXT ]

cinema :
Cinema_ID [ INT ] primary_key
Name [ TEXT ]
Openning_year [ INT ]
Capacity [ INT ]
Location [ TEXT ]

schedule :
Cinema_ID [ INT ] primary_key schedule.Cinema_ID = cinema.Cinema_ID
Film_ID [ INT ] schedule.Film_ID = film.Film_ID
Date [ TEXT ]
Show_times_per_day [ INT ]
Price [ INT ]

Please write me a SQL statement that answers the following question: Find the distinct locations that has a cinema. [/INST]

Output: SELECT DISTINCT LOCATION FROM cinema;


Input:
[INST] Here is a database schema:
film :
Film_ID [ INT ] primary_key
Rank_in_series [ INT ]
Number_in_season [ INT ]
Title [ TEXT ]
Directed_by [ TEXT ]
Original_air_date [ TEXT ]
Production_code [ TEXT ]

cinema :
Cinema_ID [ INT ] primary_key
Name [ TEXT ]
Openning_year [ INT ]
Capacity [ INT ]
Location [ TEXT ]

schedule :
Cinema_ID [ INT ] primary_key schedule.Cinema_ID = cinema.Cinema_ID
Film_ID [ INT ] schedule.Film_ID = film.Film_ID
Date [ TEXT ]
Show_times_per_day [ INT ]
Price [ INT ]

Please write me a SQL statement that answers the following question: Show all the cinema names and opening years in descending order of opening year. [/INST]

Output: SELECT name ,  openning_year FROM cinema ORDER BY openning_year DESC;


Input:
[INST] Here is a database schema:
film :
Film_ID [ INT ] primary_key
Rank_in_series [ INT ]
Number_in_season [ INT ]
Title [ TEXT ]
Directed_by [ TEXT ]
Original_air_date [ TEXT ]
Production_code [ TEXT ]

cinema :
Cinema_ID [ INT ] primary_key
Name [ TEXT ]
Openning_year [ INT ]
Capacity [ INT ]
Location [ TEXT ]

schedule :
Cinema_ID [ INT ] primary_key schedule.Cinema_ID = cinema.Cinema_ID
Film_ID [ INT ] schedule.Film_ID = film.Film_ID
Date [ TEXT ]
Show_times_per_day [ INT ]
Price [ INT ]

Please write me a SQL statement that answers the following question: What are the name and location of the cinema with the largest capacity? [/INST]

Output: SELECT name ,  LOCATION FROM cinema ORDER BY capacity DESC LIMIT 1;


Input:
[INST] Here is a database schema:
film :
Film_ID [ INT ] primary_key
Rank_in_series [ INT ]
Number_in_season [ INT ]
Title [ TEXT ]
Directed_by [ TEXT ]
Original_air_date [ TEXT ]
Production_code [ TEXT ]

cinema :
Cinema_ID [ INT ] primary_key
Name [ TEXT ]
Openning_year [ INT ]
Capacity [ INT ]
Location [ TEXT ]

schedule :
Cinema_ID [ INT ] primary_key schedule.Cinema_ID = cinema.Cinema_ID
Film_ID [ INT ] schedule.Film_ID = film.Film_ID
Date [ TEXT ]
Show_times_per_day [ INT ]
Price [ INT ]

Please write me a SQL statement that answers the following question: Show the average, minimum, and maximum capacity for all the cinemas opened in year 2011 or later. [/INST]

Output: SELECT avg(capacity) ,  min(capacity) ,  max(capacity) FROM cinema WHERE openning_year  >=  2011;


Input:
[INST] Here is a database schema:
film :
Film_ID [ INT ] primary_key
Rank_in_series [ INT ]
Number_in_season [ INT ]
Title [ TEXT ]
Directed_by [ TEXT ]
Original_air_date [ TEXT ]
Production_code [ TEXT ]

cinema :
Cinema_ID [ INT ] primary_key
Name [ TEXT ]
Openning_year [ INT ]
Capacity [ INT ]
Location [ TEXT ]

schedule :
Cinema_ID [ INT ] primary_key schedule.Cinema_ID = cinema.Cinema_ID
Film_ID [ INT ] schedule.Film_ID = film.Film_ID
Date [ TEXT ]
Show_times_per_day [ INT ]
Price [ INT ]

Please write me a SQL statement that answers the following question: Show each location and the number of cinemas there. [/INST]

Output: SELECT LOCATION ,  count(*) FROM cinema GROUP BY LOCATION;


Input:
[INST] Here is a database schema:
film :
Film_ID [ INT ] primary_key
Rank_in_series [ INT ]
Number_in_season [ INT ]
Title [ TEXT ]
Directed_by [ TEXT ]
Original_air_date [ TEXT ]
Production_code [ TEXT ]

cinema :
Cinema_ID [ INT ] primary_key
Name [ TEXT ]
Openning_year [ INT ]
Capacity [ INT ]
Location [ TEXT ]

schedule :
Cinema_ID [ INT ] primary_key schedule.Cinema_ID = cinema.Cinema_ID
Film_ID [ INT ] schedule.Film_ID = film.Film_ID
Date [ TEXT ]
Show_times_per_day [ INT ]
Price [ INT ]

Please write me a SQL statement that answers the following question: What is the location with the most cinemas opened in year 2010 or later? [/INST]

Output: SELECT LOCATION FROM cinema WHERE openning_year  >=  2010 GROUP BY LOCATION ORDER BY count(*) DESC LIMIT 1;


Input:
[INST] Here is a database schema:
film :
Film_ID [ INT ] primary_key
Rank_in_series [ INT ]
Number_in_season [ INT ]
Title [ TEXT ]
Directed_by [ TEXT ]
Original_air_date [ TEXT ]
Production_code [ TEXT ]

cinema :
Cinema_ID [ INT ] primary_key
Name [ TEXT ]
Openning_year [ INT ]
Capacity [ INT ]
Location [ TEXT ]

schedule :
Cinema_ID [ INT ] primary_key schedule.Cinema_ID = cinema.Cinema_ID
Film_ID [ INT ] schedule.Film_ID = film.Film_ID
Date [ TEXT ]
Show_times_per_day [ INT ]
Price [ INT ]

Please write me a SQL statement that answers the following question: Show all the locations with at least two cinemas with capacity above 300. [/INST]

Output: SELECT LOCATION FROM cinema WHERE capacity  >  300 GROUP BY LOCATION HAVING count(*)  >=  2;


Input:
[INST] Here is a database schema:
film :
Film_ID [ INT ] primary_key
Rank_in_series [ INT ]
Number_in_season [ INT ]
Title [ TEXT ]
Directed_by [ TEXT ]
Original_air_date [ TEXT ]
Production_code [ TEXT ]

cinema :
Cinema_ID [ INT ] primary_key
Name [ TEXT ]
Openning_year [ INT ]
Capacity [ INT ]
Location [ TEXT ]

schedule :
Cinema_ID [ INT ] primary_key schedule.Cinema_ID = cinema.Cinema_ID
Film_ID [ INT ] schedule.Film_ID = film.Film_ID
Date [ TEXT ]
Show_times_per_day [ INT ]
Price [ INT ]

Please write me a SQL statement that answers the following question: Which locations have 2 or more cinemas with capacity over 300? [/INST]

Output: SELECT LOCATION FROM cinema WHERE capacity  >  300 GROUP BY LOCATION HAVING count(*)  >=  2;


Input:
[INST] Here is a database schema:
film :
Film_ID [ INT ] primary_key
Rank_in_series [ INT ]
Number_in_season [ INT ]
Title [ TEXT ]
Directed_by [ TEXT ]
Original_air_date [ TEXT ]
Production_code [ TEXT ]

cinema :
Cinema_ID [ INT ] primary_key
Name [ TEXT ]
Openning_year [ INT ]
Capacity [ INT ]
Location [ TEXT ]

schedule :
Cinema_ID [ INT ] primary_key schedule.Cinema_ID = cinema.Cinema_ID
Film_ID [ INT ] schedule.Film_ID = film.Film_ID
Date [ TEXT ]
Show_times_per_day [ INT ]
Price [ INT ]

Please write me a SQL statement that answers the following question: Show the title and director for all films. [/INST]

Output: SELECT title ,  directed_by FROM film;


Input:
[INST] Here is a database schema:
film :
Film_ID [ INT ] primary_key
Rank_in_series [ INT ]
Number_in_season [ INT ]
Title [ TEXT ]
Directed_by [ TEXT ]
Original_air_date [ TEXT ]
Production_code [ TEXT ]

cinema :
Cinema_ID [ INT ] primary_key
Name [ TEXT ]
Openning_year [ INT ]
Capacity [ INT ]
Location [ TEXT ]

schedule :
Cinema_ID [ INT ] primary_key schedule.Cinema_ID = cinema.Cinema_ID
Film_ID [ INT ] schedule.Film_ID = film.Film_ID
Date [ TEXT ]
Show_times_per_day [ INT ]
Price [ INT ]

Please write me a SQL statement that answers the following question: What are the title and director of each film? [/INST]

Output: SELECT title ,  directed_by FROM film;


Input:
[INST] Here is a database schema:
film :
Film_ID [ INT ] primary_key
Rank_in_series [ INT ]
Number_in_season [ INT ]
Title [ TEXT ]
Directed_by [ TEXT ]
Original_air_date [ TEXT ]
Production_code [ TEXT ]

cinema :
Cinema_ID [ INT ] primary_key
Name [ TEXT ]
Openning_year [ INT ]
Capacity [ INT ]
Location [ TEXT ]

schedule :
Cinema_ID [ INT ] primary_key schedule.Cinema_ID = cinema.Cinema_ID
Film_ID [ INT ] schedule.Film_ID = film.Film_ID
Date [ TEXT ]
Show_times_per_day [ INT ]
Price [ INT ]

Please write me a SQL statement that answers the following question: Show all directors. [/INST]

Output: SELECT DISTINCT directed_by FROM film;


Input:
[INST] Here is a database schema:
film :
Film_ID [ INT ] primary_key
Rank_in_series [ INT ]
Number_in_season [ INT ]
Title [ TEXT ]
Directed_by [ TEXT ]
Original_air_date [ TEXT ]
Production_code [ TEXT ]

cinema :
Cinema_ID [ INT ] primary_key
Name [ TEXT ]
Openning_year [ INT ]
Capacity [ INT ]
Location [ TEXT ]

schedule :
Cinema_ID [ INT ] primary_key schedule.Cinema_ID = cinema.Cinema_ID
Film_ID [ INT ] schedule.Film_ID = film.Film_ID
Date [ TEXT ]
Show_times_per_day [ INT ]
Price [ INT ]

Please write me a SQL statement that answers the following question: Who are all the directors? [/INST]

Output: SELECT DISTINCT directed_by FROM film;


Input:
[INST] Here is a database schema:
film :
Film_ID [ INT ] primary_key
Rank_in_series [ INT ]
Number_in_season [ INT ]
Title [ TEXT ]
Directed_by [ TEXT ]
Original_air_date [ TEXT ]
Production_code [ TEXT ]

cinema :
Cinema_ID [ INT ] primary_key
Name [ TEXT ]
Openning_year [ INT ]
Capacity [ INT ]
Location [ TEXT ]

schedule :
Cinema_ID [ INT ] primary_key schedule.Cinema_ID = cinema.Cinema_ID
Film_ID [ INT ] schedule.Film_ID = film.Film_ID
Date [ TEXT ]
Show_times_per_day [ INT ]
Price [ INT ]

Please write me a SQL statement that answers the following question: List all directors along with the number of films directed by each director. [/INST]

Output: SELECT directed_by ,  count(*) FROM film GROUP BY directed_by;


Input:
[INST] Here is a database schema:
film :
Film_ID [ INT ] primary_key
Rank_in_series [ INT ]
Number_in_season [ INT ]
Title [ TEXT ]
Directed_by [ TEXT ]
Original_air_date [ TEXT ]
Production_code [ TEXT ]

cinema :
Cinema_ID [ INT ] primary_key
Name [ TEXT ]
Openning_year [ INT ]
Capacity [ INT ]
Location [ TEXT ]

schedule :
Cinema_ID [ INT ] primary_key schedule.Cinema_ID = cinema.Cinema_ID
Film_ID [ INT ] schedule.Film_ID = film.Film_ID
Date [ TEXT ]
Show_times_per_day [ INT ]
Price [ INT ]

Please write me a SQL statement that answers the following question: What is total number of show times per dat for each cinema? [/INST]

Output: SELECT T2.name ,  sum(T1.show_times_per_day) FROM schedule AS T1 JOIN cinema AS T2 ON T1.cinema_id  =  T2.cinema_id GROUP BY T1.cinema_id;


Input:
[INST] Here is a database schema:
film :
Film_ID [ INT ] primary_key
Rank_in_series [ INT ]
Number_in_season [ INT ]
Title [ TEXT ]
Directed_by [ TEXT ]
Original_air_date [ TEXT ]
Production_code [ TEXT ]

cinema :
Cinema_ID [ INT ] primary_key
Name [ TEXT ]
Openning_year [ INT ]
Capacity [ INT ]
Location [ TEXT ]

schedule :
Cinema_ID [ INT ] primary_key schedule.Cinema_ID = cinema.Cinema_ID
Film_ID [ INT ] schedule.Film_ID = film.Film_ID
Date [ TEXT ]
Show_times_per_day [ INT ]
Price [ INT ]

Please write me a SQL statement that answers the following question: What are the title and maximum price of each film? [/INST]

Output: SELECT T2.title ,  max(T1.price) FROM schedule AS T1 JOIN film AS T2 ON T1.film_id  =  T2.film_id GROUP BY T1.film_id;