input stringlengths 667 7.62k | output stringlengths 41 600 | db_id stringlengths 3 31 | query stringlengths 18 577 | question stringlengths 3 224 | schema stringlengths 177 6.14k | primary_keys stringlengths 16 545 | foreign_keys stringlengths 16 1.48k |
|---|---|---|---|---|---|---|---|
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | flight_1 | flight : flno (text) , origin (number) , destination (text) , distance (text) , departure_date (number) , arrival_date (time) , price (time) , aid (number) | aircraft : aid (text) , name (number) , distance (text) | employee : eid (text) , name (number) , salary (text) | certificate : eid (text) , aid (number);</schema>"
<primary_keys>[Primary Keys]: flight : flno, aircraft : aid, employee : eid, certificate : eid</primary_keys>"
<foreign_keys>[Foreign Keys]: flight : aid = aircraft : aid | certificate : aid = aircraft : aid | certificate : eid = employee : eid</foreign_keys>"
Answer the following question with a SQL Statement:<question>What are the numbers of the shortest flights?</question>
[SQL]:
| <SQL_QUERY>SELECT flno FROM Flight ORDER BY distance ASC LIMIT 3</SQL_QUERY> | flight_1 | SELECT flno FROM Flight ORDER BY distance ASC LIMIT 3 | What are the numbers of the shortest flights? | [Schema (values) (types)]: | flight_1 | flight : flno (text) , origin (number) , destination (text) , distance (text) , departure_date (number) , arrival_date (time) , price (time) , aid (number) | aircraft : aid (text) , name (number) , distance (text) | employee : eid (text) , name (number) , salary (text) | certificate : eid (text) , aid (number); | [Primary Keys]: flight : flno, aircraft : aid, employee : eid, certificate : eid | [Foreign Keys]: flight : aid = aircraft : aid | certificate : aid = aircraft : aid | certificate : eid = employee : eid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | flight_1 | flight : flno (text) , origin (number) , destination (text) , distance (text) , departure_date (number) , arrival_date (time) , price (time) , aid (number) | aircraft : aid (text) , name (number) , distance (text) | employee : eid (text) , name (number) , salary (text) | certificate : eid (text) , aid (number);</schema>"
<primary_keys>[Primary Keys]: flight : flno, aircraft : aid, employee : eid, certificate : eid</primary_keys>"
<foreign_keys>[Foreign Keys]: flight : aid = aircraft : aid | certificate : aid = aircraft : aid | certificate : eid = employee : eid</foreign_keys>"
Answer the following question with a SQL Statement:<question>What is the average distance and average price for flights from Los Angeles.</question>
[SQL]:
| <SQL_QUERY>SELECT avg(distance) , avg(price) FROM Flight WHERE origin = "Los Angeles"</SQL_QUERY> | flight_1 | SELECT avg(distance) , avg(price) FROM Flight WHERE origin = "Los Angeles" | What is the average distance and average price for flights from Los Angeles. | [Schema (values) (types)]: | flight_1 | flight : flno (text) , origin (number) , destination (text) , distance (text) , departure_date (number) , arrival_date (time) , price (time) , aid (number) | aircraft : aid (text) , name (number) , distance (text) | employee : eid (text) , name (number) , salary (text) | certificate : eid (text) , aid (number); | [Primary Keys]: flight : flno, aircraft : aid, employee : eid, certificate : eid | [Foreign Keys]: flight : aid = aircraft : aid | certificate : aid = aircraft : aid | certificate : eid = employee : eid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | flight_1 | flight : flno (text) , origin (number) , destination (text) , distance (text) , departure_date (number) , arrival_date (time) , price (time) , aid (number) | aircraft : aid (text) , name (number) , distance (text) | employee : eid (text) , name (number) , salary (text) | certificate : eid (text) , aid (number);</schema>"
<primary_keys>[Primary Keys]: flight : flno, aircraft : aid, employee : eid, certificate : eid</primary_keys>"
<foreign_keys>[Foreign Keys]: flight : aid = aircraft : aid | certificate : aid = aircraft : aid | certificate : eid = employee : eid</foreign_keys>"
Answer the following question with a SQL Statement:<question>What is the average distance and price for all flights from LA?</question>
[SQL]:
| <SQL_QUERY>SELECT avg(distance) , avg(price) FROM Flight WHERE origin = "Los Angeles"</SQL_QUERY> | flight_1 | SELECT avg(distance) , avg(price) FROM Flight WHERE origin = "Los Angeles" | What is the average distance and price for all flights from LA? | [Schema (values) (types)]: | flight_1 | flight : flno (text) , origin (number) , destination (text) , distance (text) , departure_date (number) , arrival_date (time) , price (time) , aid (number) | aircraft : aid (text) , name (number) , distance (text) | employee : eid (text) , name (number) , salary (text) | certificate : eid (text) , aid (number); | [Primary Keys]: flight : flno, aircraft : aid, employee : eid, certificate : eid | [Foreign Keys]: flight : aid = aircraft : aid | certificate : aid = aircraft : aid | certificate : eid = employee : eid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | flight_1 | flight : flno (text) , origin (number) , destination (text) , distance (text) , departure_date (number) , arrival_date (time) , price (time) , aid (number) | aircraft : aid (text) , name (number) , distance (text) | employee : eid (text) , name (number) , salary (text) | certificate : eid (text) , aid (number);</schema>"
<primary_keys>[Primary Keys]: flight : flno, aircraft : aid, employee : eid, certificate : eid</primary_keys>"
<foreign_keys>[Foreign Keys]: flight : aid = aircraft : aid | certificate : aid = aircraft : aid | certificate : eid = employee : eid</foreign_keys>"
Answer the following question with a SQL Statement:<question>Show all origins and the number of flights from each origin.</question>
[SQL]:
| <SQL_QUERY>SELECT origin , count(*) FROM Flight GROUP BY origin</SQL_QUERY> | flight_1 | SELECT origin , count(*) FROM Flight GROUP BY origin | Show all origins and the number of flights from each origin. | [Schema (values) (types)]: | flight_1 | flight : flno (text) , origin (number) , destination (text) , distance (text) , departure_date (number) , arrival_date (time) , price (time) , aid (number) | aircraft : aid (text) , name (number) , distance (text) | employee : eid (text) , name (number) , salary (text) | certificate : eid (text) , aid (number); | [Primary Keys]: flight : flno, aircraft : aid, employee : eid, certificate : eid | [Foreign Keys]: flight : aid = aircraft : aid | certificate : aid = aircraft : aid | certificate : eid = employee : eid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | flight_1 | flight : flno (text) , origin (number) , destination (text) , distance (text) , departure_date (number) , arrival_date (time) , price (time) , aid (number) | aircraft : aid (text) , name (number) , distance (text) | employee : eid (text) , name (number) , salary (text) | certificate : eid (text) , aid (number);</schema>"
<primary_keys>[Primary Keys]: flight : flno, aircraft : aid, employee : eid, certificate : eid</primary_keys>"
<foreign_keys>[Foreign Keys]: flight : aid = aircraft : aid | certificate : aid = aircraft : aid | certificate : eid = employee : eid</foreign_keys>"
Answer the following question with a SQL Statement:<question>For each origin, how many flights came from there?</question>
[SQL]:
| <SQL_QUERY>SELECT origin , count(*) FROM Flight GROUP BY origin</SQL_QUERY> | flight_1 | SELECT origin , count(*) FROM Flight GROUP BY origin | For each origin, how many flights came from there? | [Schema (values) (types)]: | flight_1 | flight : flno (text) , origin (number) , destination (text) , distance (text) , departure_date (number) , arrival_date (time) , price (time) , aid (number) | aircraft : aid (text) , name (number) , distance (text) | employee : eid (text) , name (number) , salary (text) | certificate : eid (text) , aid (number); | [Primary Keys]: flight : flno, aircraft : aid, employee : eid, certificate : eid | [Foreign Keys]: flight : aid = aircraft : aid | certificate : aid = aircraft : aid | certificate : eid = employee : eid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | flight_1 | flight : flno (text) , origin (number) , destination (text) , distance (text) , departure_date (number) , arrival_date (time) , price (time) , aid (number) | aircraft : aid (text) , name (number) , distance (text) | employee : eid (text) , name (number) , salary (text) | certificate : eid (text) , aid (number);</schema>"
<primary_keys>[Primary Keys]: flight : flno, aircraft : aid, employee : eid, certificate : eid</primary_keys>"
<foreign_keys>[Foreign Keys]: flight : aid = aircraft : aid | certificate : aid = aircraft : aid | certificate : eid = employee : eid</foreign_keys>"
Answer the following question with a SQL Statement:<question>Show all destinations and the number of flights to each destination.</question>
[SQL]:
| <SQL_QUERY>SELECT destination , count(*) FROM Flight GROUP BY destination</SQL_QUERY> | flight_1 | SELECT destination , count(*) FROM Flight GROUP BY destination | Show all destinations and the number of flights to each destination. | [Schema (values) (types)]: | flight_1 | flight : flno (text) , origin (number) , destination (text) , distance (text) , departure_date (number) , arrival_date (time) , price (time) , aid (number) | aircraft : aid (text) , name (number) , distance (text) | employee : eid (text) , name (number) , salary (text) | certificate : eid (text) , aid (number); | [Primary Keys]: flight : flno, aircraft : aid, employee : eid, certificate : eid | [Foreign Keys]: flight : aid = aircraft : aid | certificate : aid = aircraft : aid | certificate : eid = employee : eid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | flight_1 | flight : flno (text) , origin (number) , destination (text) , distance (text) , departure_date (number) , arrival_date (time) , price (time) , aid (number) | aircraft : aid (text) , name (number) , distance (text) | employee : eid (text) , name (number) , salary (text) | certificate : eid (text) , aid (number);</schema>"
<primary_keys>[Primary Keys]: flight : flno, aircraft : aid, employee : eid, certificate : eid</primary_keys>"
<foreign_keys>[Foreign Keys]: flight : aid = aircraft : aid | certificate : aid = aircraft : aid | certificate : eid = employee : eid</foreign_keys>"
Answer the following question with a SQL Statement:<question>What are the destinations and number of flights to each one?</question>
[SQL]:
| <SQL_QUERY>SELECT destination , count(*) FROM Flight GROUP BY destination</SQL_QUERY> | flight_1 | SELECT destination , count(*) FROM Flight GROUP BY destination | What are the destinations and number of flights to each one? | [Schema (values) (types)]: | flight_1 | flight : flno (text) , origin (number) , destination (text) , distance (text) , departure_date (number) , arrival_date (time) , price (time) , aid (number) | aircraft : aid (text) , name (number) , distance (text) | employee : eid (text) , name (number) , salary (text) | certificate : eid (text) , aid (number); | [Primary Keys]: flight : flno, aircraft : aid, employee : eid, certificate : eid | [Foreign Keys]: flight : aid = aircraft : aid | certificate : aid = aircraft : aid | certificate : eid = employee : eid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | flight_1 | flight : flno (text) , origin (number) , destination (text) , distance (text) , departure_date (number) , arrival_date (time) , price (time) , aid (number) | aircraft : aid (text) , name (number) , distance (text) | employee : eid (text) , name (number) , salary (text) | certificate : eid (text) , aid (number);</schema>"
<primary_keys>[Primary Keys]: flight : flno, aircraft : aid, employee : eid, certificate : eid</primary_keys>"
<foreign_keys>[Foreign Keys]: flight : aid = aircraft : aid | certificate : aid = aircraft : aid | certificate : eid = employee : eid</foreign_keys>"
Answer the following question with a SQL Statement:<question>Which origin has most number of flights?</question>
[SQL]:
| <SQL_QUERY>SELECT origin FROM Flight GROUP BY origin ORDER BY count(*) DESC LIMIT 1</SQL_QUERY> | flight_1 | SELECT origin FROM Flight GROUP BY origin ORDER BY count(*) DESC LIMIT 1 | Which origin has most number of flights? | [Schema (values) (types)]: | flight_1 | flight : flno (text) , origin (number) , destination (text) , distance (text) , departure_date (number) , arrival_date (time) , price (time) , aid (number) | aircraft : aid (text) , name (number) , distance (text) | employee : eid (text) , name (number) , salary (text) | certificate : eid (text) , aid (number); | [Primary Keys]: flight : flno, aircraft : aid, employee : eid, certificate : eid | [Foreign Keys]: flight : aid = aircraft : aid | certificate : aid = aircraft : aid | certificate : eid = employee : eid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | flight_1 | flight : flno (text) , origin (number) , destination (text) , distance (text) , departure_date (number) , arrival_date (time) , price (time) , aid (number) | aircraft : aid (text) , name (number) , distance (text) | employee : eid (text) , name (number) , salary (text) | certificate : eid (text) , aid (number);</schema>"
<primary_keys>[Primary Keys]: flight : flno, aircraft : aid, employee : eid, certificate : eid</primary_keys>"
<foreign_keys>[Foreign Keys]: flight : aid = aircraft : aid | certificate : aid = aircraft : aid | certificate : eid = employee : eid</foreign_keys>"
Answer the following question with a SQL Statement:<question>What place has the most flights coming from there?</question>
[SQL]:
| <SQL_QUERY>SELECT origin FROM Flight GROUP BY origin ORDER BY count(*) DESC LIMIT 1</SQL_QUERY> | flight_1 | SELECT origin FROM Flight GROUP BY origin ORDER BY count(*) DESC LIMIT 1 | What place has the most flights coming from there? | [Schema (values) (types)]: | flight_1 | flight : flno (text) , origin (number) , destination (text) , distance (text) , departure_date (number) , arrival_date (time) , price (time) , aid (number) | aircraft : aid (text) , name (number) , distance (text) | employee : eid (text) , name (number) , salary (text) | certificate : eid (text) , aid (number); | [Primary Keys]: flight : flno, aircraft : aid, employee : eid, certificate : eid | [Foreign Keys]: flight : aid = aircraft : aid | certificate : aid = aircraft : aid | certificate : eid = employee : eid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | flight_1 | flight : flno (text) , origin (number) , destination (text) , distance (text) , departure_date (number) , arrival_date (time) , price (time) , aid (number) | aircraft : aid (text) , name (number) , distance (text) | employee : eid (text) , name (number) , salary (text) | certificate : eid (text) , aid (number);</schema>"
<primary_keys>[Primary Keys]: flight : flno, aircraft : aid, employee : eid, certificate : eid</primary_keys>"
<foreign_keys>[Foreign Keys]: flight : aid = aircraft : aid | certificate : aid = aircraft : aid | certificate : eid = employee : eid</foreign_keys>"
Answer the following question with a SQL Statement:<question>Which destination has least number of flights?</question>
[SQL]:
| <SQL_QUERY>SELECT destination FROM Flight GROUP BY destination ORDER BY count(*) LIMIT 1</SQL_QUERY> | flight_1 | SELECT destination FROM Flight GROUP BY destination ORDER BY count(*) LIMIT 1 | Which destination has least number of flights? | [Schema (values) (types)]: | flight_1 | flight : flno (text) , origin (number) , destination (text) , distance (text) , departure_date (number) , arrival_date (time) , price (time) , aid (number) | aircraft : aid (text) , name (number) , distance (text) | employee : eid (text) , name (number) , salary (text) | certificate : eid (text) , aid (number); | [Primary Keys]: flight : flno, aircraft : aid, employee : eid, certificate : eid | [Foreign Keys]: flight : aid = aircraft : aid | certificate : aid = aircraft : aid | certificate : eid = employee : eid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | flight_1 | flight : flno (text) , origin (number) , destination (text) , distance (text) , departure_date (number) , arrival_date (time) , price (time) , aid (number) | aircraft : aid (text) , name (number) , distance (text) | employee : eid (text) , name (number) , salary (text) | certificate : eid (text) , aid (number);</schema>"
<primary_keys>[Primary Keys]: flight : flno, aircraft : aid, employee : eid, certificate : eid</primary_keys>"
<foreign_keys>[Foreign Keys]: flight : aid = aircraft : aid | certificate : aid = aircraft : aid | certificate : eid = employee : eid</foreign_keys>"
Answer the following question with a SQL Statement:<question>What destination has the fewest number of flights?</question>
[SQL]:
| <SQL_QUERY>SELECT destination FROM Flight GROUP BY destination ORDER BY count(*) LIMIT 1</SQL_QUERY> | flight_1 | SELECT destination FROM Flight GROUP BY destination ORDER BY count(*) LIMIT 1 | What destination has the fewest number of flights? | [Schema (values) (types)]: | flight_1 | flight : flno (text) , origin (number) , destination (text) , distance (text) , departure_date (number) , arrival_date (time) , price (time) , aid (number) | aircraft : aid (text) , name (number) , distance (text) | employee : eid (text) , name (number) , salary (text) | certificate : eid (text) , aid (number); | [Primary Keys]: flight : flno, aircraft : aid, employee : eid, certificate : eid | [Foreign Keys]: flight : aid = aircraft : aid | certificate : aid = aircraft : aid | certificate : eid = employee : eid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | flight_1 | flight : flno (text) , origin (number) , destination (text) , distance (text) , departure_date (number) , arrival_date (time) , price (time) , aid (number) | aircraft : aid (text) , name (number) , distance (text) | employee : eid (text) , name (number) , salary (text) | certificate : eid (text) , aid (number);</schema>"
<primary_keys>[Primary Keys]: flight : flno, aircraft : aid, employee : eid, certificate : eid</primary_keys>"
<foreign_keys>[Foreign Keys]: flight : aid = aircraft : aid | certificate : aid = aircraft : aid | certificate : eid = employee : eid</foreign_keys>"
Answer the following question with a SQL Statement:<question>What is the aircraft name for the flight with number 99</question>
[SQL]:
| <SQL_QUERY>SELECT T2.name FROM Flight AS T1 JOIN Aircraft AS T2 ON T1.aid = T2.aid WHERE T1.flno = 99</SQL_QUERY> | flight_1 | SELECT T2.name FROM Flight AS T1 JOIN Aircraft AS T2 ON T1.aid = T2.aid WHERE T1.flno = 99 | What is the aircraft name for the flight with number 99 | [Schema (values) (types)]: | flight_1 | flight : flno (text) , origin (number) , destination (text) , distance (text) , departure_date (number) , arrival_date (time) , price (time) , aid (number) | aircraft : aid (text) , name (number) , distance (text) | employee : eid (text) , name (number) , salary (text) | certificate : eid (text) , aid (number); | [Primary Keys]: flight : flno, aircraft : aid, employee : eid, certificate : eid | [Foreign Keys]: flight : aid = aircraft : aid | certificate : aid = aircraft : aid | certificate : eid = employee : eid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | flight_1 | flight : flno (text) , origin (number) , destination (text) , distance (text) , departure_date (number) , arrival_date (time) , price (time) , aid (number) | aircraft : aid (text) , name (number) , distance (text) | employee : eid (text) , name (number) , salary (text) | certificate : eid (text) , aid (number);</schema>"
<primary_keys>[Primary Keys]: flight : flno, aircraft : aid, employee : eid, certificate : eid</primary_keys>"
<foreign_keys>[Foreign Keys]: flight : aid = aircraft : aid | certificate : aid = aircraft : aid | certificate : eid = employee : eid</foreign_keys>"
Answer the following question with a SQL Statement:<question>What is the name of the aircraft that was on flight number 99?</question>
[SQL]:
| <SQL_QUERY>SELECT T2.name FROM Flight AS T1 JOIN Aircraft AS T2 ON T1.aid = T2.aid WHERE T1.flno = 99</SQL_QUERY> | flight_1 | SELECT T2.name FROM Flight AS T1 JOIN Aircraft AS T2 ON T1.aid = T2.aid WHERE T1.flno = 99 | What is the name of the aircraft that was on flight number 99? | [Schema (values) (types)]: | flight_1 | flight : flno (text) , origin (number) , destination (text) , distance (text) , departure_date (number) , arrival_date (time) , price (time) , aid (number) | aircraft : aid (text) , name (number) , distance (text) | employee : eid (text) , name (number) , salary (text) | certificate : eid (text) , aid (number); | [Primary Keys]: flight : flno, aircraft : aid, employee : eid, certificate : eid | [Foreign Keys]: flight : aid = aircraft : aid | certificate : aid = aircraft : aid | certificate : eid = employee : eid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | flight_1 | flight : flno (text) , origin (number) , destination (text) , distance (text) , departure_date (number) , arrival_date (time) , price (time) , aid (number) | aircraft : aid (text) , name (number) , distance (text) | employee : eid (text) , name (number) , salary (text) | certificate : eid (text) , aid (number);</schema>"
<primary_keys>[Primary Keys]: flight : flno, aircraft : aid, employee : eid, certificate : eid</primary_keys>"
<foreign_keys>[Foreign Keys]: flight : aid = aircraft : aid | certificate : aid = aircraft : aid | certificate : eid = employee : eid</foreign_keys>"
Answer the following question with a SQL Statement:<question>Show all flight numbers with aircraft Airbus A340-300.</question>
[SQL]:
| <SQL_QUERY>SELECT T1.flno FROM Flight AS T1 JOIN Aircraft AS T2 ON T1.aid = T2.aid WHERE T2.name = "Airbus A340-300"</SQL_QUERY> | flight_1 | SELECT T1.flno FROM Flight AS T1 JOIN Aircraft AS T2 ON T1.aid = T2.aid WHERE T2.name = "Airbus A340-300" | Show all flight numbers with aircraft Airbus A340-300. | [Schema (values) (types)]: | flight_1 | flight : flno (text) , origin (number) , destination (text) , distance (text) , departure_date (number) , arrival_date (time) , price (time) , aid (number) | aircraft : aid (text) , name (number) , distance (text) | employee : eid (text) , name (number) , salary (text) | certificate : eid (text) , aid (number); | [Primary Keys]: flight : flno, aircraft : aid, employee : eid, certificate : eid | [Foreign Keys]: flight : aid = aircraft : aid | certificate : aid = aircraft : aid | certificate : eid = employee : eid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | flight_1 | flight : flno (text) , origin (number) , destination (text) , distance (text) , departure_date (number) , arrival_date (time) , price (time) , aid (number) | aircraft : aid (text) , name (number) , distance (text) | employee : eid (text) , name (number) , salary (text) | certificate : eid (text) , aid (number);</schema>"
<primary_keys>[Primary Keys]: flight : flno, aircraft : aid, employee : eid, certificate : eid</primary_keys>"
<foreign_keys>[Foreign Keys]: flight : aid = aircraft : aid | certificate : aid = aircraft : aid | certificate : eid = employee : eid</foreign_keys>"
Answer the following question with a SQL Statement:<question>What are the flight numbers for the aircraft Airbus A340-300?</question>
[SQL]:
| <SQL_QUERY>SELECT T1.flno FROM Flight AS T1 JOIN Aircraft AS T2 ON T1.aid = T2.aid WHERE T2.name = "Airbus A340-300"</SQL_QUERY> | flight_1 | SELECT T1.flno FROM Flight AS T1 JOIN Aircraft AS T2 ON T1.aid = T2.aid WHERE T2.name = "Airbus A340-300" | What are the flight numbers for the aircraft Airbus A340-300? | [Schema (values) (types)]: | flight_1 | flight : flno (text) , origin (number) , destination (text) , distance (text) , departure_date (number) , arrival_date (time) , price (time) , aid (number) | aircraft : aid (text) , name (number) , distance (text) | employee : eid (text) , name (number) , salary (text) | certificate : eid (text) , aid (number); | [Primary Keys]: flight : flno, aircraft : aid, employee : eid, certificate : eid | [Foreign Keys]: flight : aid = aircraft : aid | certificate : aid = aircraft : aid | certificate : eid = employee : eid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | flight_1 | flight : flno (text) , origin (number) , destination (text) , distance (text) , departure_date (number) , arrival_date (time) , price (time) , aid (number) | aircraft : aid (text) , name (number) , distance (text) | employee : eid (text) , name (number) , salary (text) | certificate : eid (text) , aid (number);</schema>"
<primary_keys>[Primary Keys]: flight : flno, aircraft : aid, employee : eid, certificate : eid</primary_keys>"
<foreign_keys>[Foreign Keys]: flight : aid = aircraft : aid | certificate : aid = aircraft : aid | certificate : eid = employee : eid</foreign_keys>"
Answer the following question with a SQL Statement:<question>Show aircraft names and number of flights for each aircraft.</question>
[SQL]:
| <SQL_QUERY>SELECT T2.name , count(*) FROM Flight AS T1 JOIN Aircraft AS T2 ON T1.aid = T2.aid GROUP BY T1.aid</SQL_QUERY> | flight_1 | SELECT T2.name , count(*) FROM Flight AS T1 JOIN Aircraft AS T2 ON T1.aid = T2.aid GROUP BY T1.aid | Show aircraft names and number of flights for each aircraft. | [Schema (values) (types)]: | flight_1 | flight : flno (text) , origin (number) , destination (text) , distance (text) , departure_date (number) , arrival_date (time) , price (time) , aid (number) | aircraft : aid (text) , name (number) , distance (text) | employee : eid (text) , name (number) , salary (text) | certificate : eid (text) , aid (number); | [Primary Keys]: flight : flno, aircraft : aid, employee : eid, certificate : eid | [Foreign Keys]: flight : aid = aircraft : aid | certificate : aid = aircraft : aid | certificate : eid = employee : eid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | flight_1 | flight : flno (text) , origin (number) , destination (text) , distance (text) , departure_date (number) , arrival_date (time) , price (time) , aid (number) | aircraft : aid (text) , name (number) , distance (text) | employee : eid (text) , name (number) , salary (text) | certificate : eid (text) , aid (number);</schema>"
<primary_keys>[Primary Keys]: flight : flno, aircraft : aid, employee : eid, certificate : eid</primary_keys>"
<foreign_keys>[Foreign Keys]: flight : aid = aircraft : aid | certificate : aid = aircraft : aid | certificate : eid = employee : eid</foreign_keys>"
Answer the following question with a SQL Statement:<question>What is the name of each aircraft and how many flights does each one complete?</question>
[SQL]:
| <SQL_QUERY>SELECT T2.name , count(*) FROM Flight AS T1 JOIN Aircraft AS T2 ON T1.aid = T2.aid GROUP BY T1.aid</SQL_QUERY> | flight_1 | SELECT T2.name , count(*) FROM Flight AS T1 JOIN Aircraft AS T2 ON T1.aid = T2.aid GROUP BY T1.aid | What is the name of each aircraft and how many flights does each one complete? | [Schema (values) (types)]: | flight_1 | flight : flno (text) , origin (number) , destination (text) , distance (text) , departure_date (number) , arrival_date (time) , price (time) , aid (number) | aircraft : aid (text) , name (number) , distance (text) | employee : eid (text) , name (number) , salary (text) | certificate : eid (text) , aid (number); | [Primary Keys]: flight : flno, aircraft : aid, employee : eid, certificate : eid | [Foreign Keys]: flight : aid = aircraft : aid | certificate : aid = aircraft : aid | certificate : eid = employee : eid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | flight_1 | flight : flno (text) , origin (number) , destination (text) , distance (text) , departure_date (number) , arrival_date (time) , price (time) , aid (number) | aircraft : aid (text) , name (number) , distance (text) | employee : eid (text) , name (number) , salary (text) | certificate : eid (text) , aid (number);</schema>"
<primary_keys>[Primary Keys]: flight : flno, aircraft : aid, employee : eid, certificate : eid</primary_keys>"
<foreign_keys>[Foreign Keys]: flight : aid = aircraft : aid | certificate : aid = aircraft : aid | certificate : eid = employee : eid</foreign_keys>"
Answer the following question with a SQL Statement:<question>Show names for all aircraft with at least two flights.</question>
[SQL]:
| <SQL_QUERY>SELECT T2.name FROM Flight AS T1 JOIN Aircraft AS T2 ON T1.aid = T2.aid GROUP BY T1.aid HAVING count(*) >= 2</SQL_QUERY> | flight_1 | SELECT T2.name FROM Flight AS T1 JOIN Aircraft AS T2 ON T1.aid = T2.aid GROUP BY T1.aid HAVING count(*) >= 2 | Show names for all aircraft with at least two flights. | [Schema (values) (types)]: | flight_1 | flight : flno (text) , origin (number) , destination (text) , distance (text) , departure_date (number) , arrival_date (time) , price (time) , aid (number) | aircraft : aid (text) , name (number) , distance (text) | employee : eid (text) , name (number) , salary (text) | certificate : eid (text) , aid (number); | [Primary Keys]: flight : flno, aircraft : aid, employee : eid, certificate : eid | [Foreign Keys]: flight : aid = aircraft : aid | certificate : aid = aircraft : aid | certificate : eid = employee : eid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | flight_1 | flight : flno (text) , origin (number) , destination (text) , distance (text) , departure_date (number) , arrival_date (time) , price (time) , aid (number) | aircraft : aid (text) , name (number) , distance (text) | employee : eid (text) , name (number) , salary (text) | certificate : eid (text) , aid (number);</schema>"
<primary_keys>[Primary Keys]: flight : flno, aircraft : aid, employee : eid, certificate : eid</primary_keys>"
<foreign_keys>[Foreign Keys]: flight : aid = aircraft : aid | certificate : aid = aircraft : aid | certificate : eid = employee : eid</foreign_keys>"
Answer the following question with a SQL Statement:<question>What are the names for all aircrafts with at least 2 flights?</question>
[SQL]:
| <SQL_QUERY>SELECT T2.name FROM Flight AS T1 JOIN Aircraft AS T2 ON T1.aid = T2.aid GROUP BY T1.aid HAVING count(*) >= 2</SQL_QUERY> | flight_1 | SELECT T2.name FROM Flight AS T1 JOIN Aircraft AS T2 ON T1.aid = T2.aid GROUP BY T1.aid HAVING count(*) >= 2 | What are the names for all aircrafts with at least 2 flights? | [Schema (values) (types)]: | flight_1 | flight : flno (text) , origin (number) , destination (text) , distance (text) , departure_date (number) , arrival_date (time) , price (time) , aid (number) | aircraft : aid (text) , name (number) , distance (text) | employee : eid (text) , name (number) , salary (text) | certificate : eid (text) , aid (number); | [Primary Keys]: flight : flno, aircraft : aid, employee : eid, certificate : eid | [Foreign Keys]: flight : aid = aircraft : aid | certificate : aid = aircraft : aid | certificate : eid = employee : eid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | flight_1 | flight : flno (text) , origin (number) , destination (text) , distance (text) , departure_date (number) , arrival_date (time) , price (time) , aid (number) | aircraft : aid (text) , name (number) , distance (text) | employee : eid (text) , name (number) , salary (text) | certificate : eid (text) , aid (number);</schema>"
<primary_keys>[Primary Keys]: flight : flno, aircraft : aid, employee : eid, certificate : eid</primary_keys>"
<foreign_keys>[Foreign Keys]: flight : aid = aircraft : aid | certificate : aid = aircraft : aid | certificate : eid = employee : eid</foreign_keys>"
Answer the following question with a SQL Statement:<question>How many employees have certificate.</question>
[SQL]:
| <SQL_QUERY>SELECT count(DISTINCT eid) FROM Certificate</SQL_QUERY> | flight_1 | SELECT count(DISTINCT eid) FROM Certificate | How many employees have certificate. | [Schema (values) (types)]: | flight_1 | flight : flno (text) , origin (number) , destination (text) , distance (text) , departure_date (number) , arrival_date (time) , price (time) , aid (number) | aircraft : aid (text) , name (number) , distance (text) | employee : eid (text) , name (number) , salary (text) | certificate : eid (text) , aid (number); | [Primary Keys]: flight : flno, aircraft : aid, employee : eid, certificate : eid | [Foreign Keys]: flight : aid = aircraft : aid | certificate : aid = aircraft : aid | certificate : eid = employee : eid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | flight_1 | flight : flno (text) , origin (number) , destination (text) , distance (text) , departure_date (number) , arrival_date (time) , price (time) , aid (number) | aircraft : aid (text) , name (number) , distance (text) | employee : eid (text) , name (number) , salary (text) | certificate : eid (text) , aid (number);</schema>"
<primary_keys>[Primary Keys]: flight : flno, aircraft : aid, employee : eid, certificate : eid</primary_keys>"
<foreign_keys>[Foreign Keys]: flight : aid = aircraft : aid | certificate : aid = aircraft : aid | certificate : eid = employee : eid</foreign_keys>"
Answer the following question with a SQL Statement:<question>What is the count of distinct employees with certificates?</question>
[SQL]:
| <SQL_QUERY>SELECT count(DISTINCT eid) FROM Certificate</SQL_QUERY> | flight_1 | SELECT count(DISTINCT eid) FROM Certificate | What is the count of distinct employees with certificates? | [Schema (values) (types)]: | flight_1 | flight : flno (text) , origin (number) , destination (text) , distance (text) , departure_date (number) , arrival_date (time) , price (time) , aid (number) | aircraft : aid (text) , name (number) , distance (text) | employee : eid (text) , name (number) , salary (text) | certificate : eid (text) , aid (number); | [Primary Keys]: flight : flno, aircraft : aid, employee : eid, certificate : eid | [Foreign Keys]: flight : aid = aircraft : aid | certificate : aid = aircraft : aid | certificate : eid = employee : eid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | flight_1 | flight : flno (text) , origin (number) , destination (text) , distance (text) , departure_date (number) , arrival_date (time) , price (time) , aid (number) | aircraft : aid (text) , name (number) , distance (text) | employee : eid (text) , name (number) , salary (text) | certificate : eid (text) , aid (number);</schema>"
<primary_keys>[Primary Keys]: flight : flno, aircraft : aid, employee : eid, certificate : eid</primary_keys>"
<foreign_keys>[Foreign Keys]: flight : aid = aircraft : aid | certificate : aid = aircraft : aid | certificate : eid = employee : eid</foreign_keys>"
Answer the following question with a SQL Statement:<question>Show ids for all employees who don't have a certificate.</question>
[SQL]:
| <SQL_QUERY>SELECT eid FROM Employee EXCEPT SELECT eid FROM Certificate</SQL_QUERY> | flight_1 | SELECT eid FROM Employee EXCEPT SELECT eid FROM Certificate | Show ids for all employees who don't have a certificate. | [Schema (values) (types)]: | flight_1 | flight : flno (text) , origin (number) , destination (text) , distance (text) , departure_date (number) , arrival_date (time) , price (time) , aid (number) | aircraft : aid (text) , name (number) , distance (text) | employee : eid (text) , name (number) , salary (text) | certificate : eid (text) , aid (number); | [Primary Keys]: flight : flno, aircraft : aid, employee : eid, certificate : eid | [Foreign Keys]: flight : aid = aircraft : aid | certificate : aid = aircraft : aid | certificate : eid = employee : eid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | flight_1 | flight : flno (text) , origin (number) , destination (text) , distance (text) , departure_date (number) , arrival_date (time) , price (time) , aid (number) | aircraft : aid (text) , name (number) , distance (text) | employee : eid (text) , name (number) , salary (text) | certificate : eid (text) , aid (number);</schema>"
<primary_keys>[Primary Keys]: flight : flno, aircraft : aid, employee : eid, certificate : eid</primary_keys>"
<foreign_keys>[Foreign Keys]: flight : aid = aircraft : aid | certificate : aid = aircraft : aid | certificate : eid = employee : eid</foreign_keys>"
Answer the following question with a SQL Statement:<question>What are the ids of all employees that don't have certificates?</question>
[SQL]:
| <SQL_QUERY>SELECT eid FROM Employee EXCEPT SELECT eid FROM Certificate</SQL_QUERY> | flight_1 | SELECT eid FROM Employee EXCEPT SELECT eid FROM Certificate | What are the ids of all employees that don't have certificates? | [Schema (values) (types)]: | flight_1 | flight : flno (text) , origin (number) , destination (text) , distance (text) , departure_date (number) , arrival_date (time) , price (time) , aid (number) | aircraft : aid (text) , name (number) , distance (text) | employee : eid (text) , name (number) , salary (text) | certificate : eid (text) , aid (number); | [Primary Keys]: flight : flno, aircraft : aid, employee : eid, certificate : eid | [Foreign Keys]: flight : aid = aircraft : aid | certificate : aid = aircraft : aid | certificate : eid = employee : eid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | flight_1 | flight : flno (text) , origin (number) , destination (text) , distance (text) , departure_date (number) , arrival_date (time) , price (time) , aid (number) | aircraft : aid (text) , name (number) , distance (text) | employee : eid (text) , name (number) , salary (text) | certificate : eid (text) , aid (number);</schema>"
<primary_keys>[Primary Keys]: flight : flno, aircraft : aid, employee : eid, certificate : eid</primary_keys>"
<foreign_keys>[Foreign Keys]: flight : aid = aircraft : aid | certificate : aid = aircraft : aid | certificate : eid = employee : eid</foreign_keys>"
Answer the following question with a SQL Statement:<question>Show names for all aircrafts of which John Williams has certificates.</question>
[SQL]:
| <SQL_QUERY>SELECT T3.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid = T2.eid JOIN Aircraft AS T3 ON T3.aid = T2.aid WHERE T1.name = "John Williams"</SQL_QUERY> | flight_1 | SELECT T3.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid = T2.eid JOIN Aircraft AS T3 ON T3.aid = T2.aid WHERE T1.name = "John Williams" | Show names for all aircrafts of which John Williams has certificates. | [Schema (values) (types)]: | flight_1 | flight : flno (text) , origin (number) , destination (text) , distance (text) , departure_date (number) , arrival_date (time) , price (time) , aid (number) | aircraft : aid (text) , name (number) , distance (text) | employee : eid (text) , name (number) , salary (text) | certificate : eid (text) , aid (number); | [Primary Keys]: flight : flno, aircraft : aid, employee : eid, certificate : eid | [Foreign Keys]: flight : aid = aircraft : aid | certificate : aid = aircraft : aid | certificate : eid = employee : eid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | flight_1 | flight : flno (text) , origin (number) , destination (text) , distance (text) , departure_date (number) , arrival_date (time) , price (time) , aid (number) | aircraft : aid (text) , name (number) , distance (text) | employee : eid (text) , name (number) , salary (text) | certificate : eid (text) , aid (number);</schema>"
<primary_keys>[Primary Keys]: flight : flno, aircraft : aid, employee : eid, certificate : eid</primary_keys>"
<foreign_keys>[Foreign Keys]: flight : aid = aircraft : aid | certificate : aid = aircraft : aid | certificate : eid = employee : eid</foreign_keys>"
Answer the following question with a SQL Statement:<question>What are the names of all aircrafts that John Williams have certificates to be able to fly?</question>
[SQL]:
| <SQL_QUERY>SELECT T3.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid = T2.eid JOIN Aircraft AS T3 ON T3.aid = T2.aid WHERE T1.name = "John Williams"</SQL_QUERY> | flight_1 | SELECT T3.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid = T2.eid JOIN Aircraft AS T3 ON T3.aid = T2.aid WHERE T1.name = "John Williams" | What are the names of all aircrafts that John Williams have certificates to be able to fly? | [Schema (values) (types)]: | flight_1 | flight : flno (text) , origin (number) , destination (text) , distance (text) , departure_date (number) , arrival_date (time) , price (time) , aid (number) | aircraft : aid (text) , name (number) , distance (text) | employee : eid (text) , name (number) , salary (text) | certificate : eid (text) , aid (number); | [Primary Keys]: flight : flno, aircraft : aid, employee : eid, certificate : eid | [Foreign Keys]: flight : aid = aircraft : aid | certificate : aid = aircraft : aid | certificate : eid = employee : eid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | flight_1 | flight : flno (text) , origin (number) , destination (text) , distance (text) , departure_date (number) , arrival_date (time) , price (time) , aid (number) | aircraft : aid (text) , name (number) , distance (text) | employee : eid (text) , name (number) , salary (text) | certificate : eid (text) , aid (number);</schema>"
<primary_keys>[Primary Keys]: flight : flno, aircraft : aid, employee : eid, certificate : eid</primary_keys>"
<foreign_keys>[Foreign Keys]: flight : aid = aircraft : aid | certificate : aid = aircraft : aid | certificate : eid = employee : eid</foreign_keys>"
Answer the following question with a SQL Statement:<question>Show names for all employees who have certificate of Boeing 737-800.</question>
[SQL]:
| <SQL_QUERY>SELECT T1.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid = T2.eid JOIN Aircraft AS T3 ON T3.aid = T2.aid WHERE T3.name = "Boeing 737-800"</SQL_QUERY> | flight_1 | SELECT T1.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid = T2.eid JOIN Aircraft AS T3 ON T3.aid = T2.aid WHERE T3.name = "Boeing 737-800" | Show names for all employees who have certificate of Boeing 737-800. | [Schema (values) (types)]: | flight_1 | flight : flno (text) , origin (number) , destination (text) , distance (text) , departure_date (number) , arrival_date (time) , price (time) , aid (number) | aircraft : aid (text) , name (number) , distance (text) | employee : eid (text) , name (number) , salary (text) | certificate : eid (text) , aid (number); | [Primary Keys]: flight : flno, aircraft : aid, employee : eid, certificate : eid | [Foreign Keys]: flight : aid = aircraft : aid | certificate : aid = aircraft : aid | certificate : eid = employee : eid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | flight_1 | flight : flno (text) , origin (number) , destination (text) , distance (text) , departure_date (number) , arrival_date (time) , price (time) , aid (number) | aircraft : aid (text) , name (number) , distance (text) | employee : eid (text) , name (number) , salary (text) | certificate : eid (text) , aid (number);</schema>"
<primary_keys>[Primary Keys]: flight : flno, aircraft : aid, employee : eid, certificate : eid</primary_keys>"
<foreign_keys>[Foreign Keys]: flight : aid = aircraft : aid | certificate : aid = aircraft : aid | certificate : eid = employee : eid</foreign_keys>"
Answer the following question with a SQL Statement:<question>What are the names of all employees who have a certificate to fly Boeing 737-800?</question>
[SQL]:
| <SQL_QUERY>SELECT T1.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid = T2.eid JOIN Aircraft AS T3 ON T3.aid = T2.aid WHERE T3.name = "Boeing 737-800"</SQL_QUERY> | flight_1 | SELECT T1.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid = T2.eid JOIN Aircraft AS T3 ON T3.aid = T2.aid WHERE T3.name = "Boeing 737-800" | What are the names of all employees who have a certificate to fly Boeing 737-800? | [Schema (values) (types)]: | flight_1 | flight : flno (text) , origin (number) , destination (text) , distance (text) , departure_date (number) , arrival_date (time) , price (time) , aid (number) | aircraft : aid (text) , name (number) , distance (text) | employee : eid (text) , name (number) , salary (text) | certificate : eid (text) , aid (number); | [Primary Keys]: flight : flno, aircraft : aid, employee : eid, certificate : eid | [Foreign Keys]: flight : aid = aircraft : aid | certificate : aid = aircraft : aid | certificate : eid = employee : eid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | flight_1 | flight : flno (text) , origin (number) , destination (text) , distance (text) , departure_date (number) , arrival_date (time) , price (time) , aid (number) | aircraft : aid (text) , name (number) , distance (text) | employee : eid (text) , name (number) , salary (text) | certificate : eid (text) , aid (number);</schema>"
<primary_keys>[Primary Keys]: flight : flno, aircraft : aid, employee : eid, certificate : eid</primary_keys>"
<foreign_keys>[Foreign Keys]: flight : aid = aircraft : aid | certificate : aid = aircraft : aid | certificate : eid = employee : eid</foreign_keys>"
Answer the following question with a SQL Statement:<question>Show names for all employees who have certificates on both Boeing 737-800 and Airbus A340-300.</question>
[SQL]:
| <SQL_QUERY>SELECT T1.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid = T2.eid JOIN Aircraft AS T3 ON T3.aid = T2.aid WHERE T3.name = "Boeing 737-800" INTERSECT SELECT T1.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid = T2.eid JOIN Aircraft AS T3 ON T3.aid = T2.aid WHERE T3.name = "Airbus A340-300"</SQL_QUERY> | flight_1 | SELECT T1.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid = T2.eid JOIN Aircraft AS T3 ON T3.aid = T2.aid WHERE T3.name = "Boeing 737-800" INTERSECT SELECT T1.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid = T2.eid JOIN Aircraft AS T3 ON T3.aid = T2.aid WHERE T3.name = "Airbus A340-300" | Show names for all employees who have certificates on both Boeing 737-800 and Airbus A340-300. | [Schema (values) (types)]: | flight_1 | flight : flno (text) , origin (number) , destination (text) , distance (text) , departure_date (number) , arrival_date (time) , price (time) , aid (number) | aircraft : aid (text) , name (number) , distance (text) | employee : eid (text) , name (number) , salary (text) | certificate : eid (text) , aid (number); | [Primary Keys]: flight : flno, aircraft : aid, employee : eid, certificate : eid | [Foreign Keys]: flight : aid = aircraft : aid | certificate : aid = aircraft : aid | certificate : eid = employee : eid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | flight_1 | flight : flno (text) , origin (number) , destination (text) , distance (text) , departure_date (number) , arrival_date (time) , price (time) , aid (number) | aircraft : aid (text) , name (number) , distance (text) | employee : eid (text) , name (number) , salary (text) | certificate : eid (text) , aid (number);</schema>"
<primary_keys>[Primary Keys]: flight : flno, aircraft : aid, employee : eid, certificate : eid</primary_keys>"
<foreign_keys>[Foreign Keys]: flight : aid = aircraft : aid | certificate : aid = aircraft : aid | certificate : eid = employee : eid</foreign_keys>"
Answer the following question with a SQL Statement:<question>What are the names of all employees who can fly both the Boeing 737-800 and the Airbus A340-300?</question>
[SQL]:
| <SQL_QUERY>SELECT T1.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid = T2.eid JOIN Aircraft AS T3 ON T3.aid = T2.aid WHERE T3.name = "Boeing 737-800" INTERSECT SELECT T1.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid = T2.eid JOIN Aircraft AS T3 ON T3.aid = T2.aid WHERE T3.name = "Airbus A340-300"</SQL_QUERY> | flight_1 | SELECT T1.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid = T2.eid JOIN Aircraft AS T3 ON T3.aid = T2.aid WHERE T3.name = "Boeing 737-800" INTERSECT SELECT T1.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid = T2.eid JOIN Aircraft AS T3 ON T3.aid = T2.aid WHERE T3.name = "Airbus A340-300" | What are the names of all employees who can fly both the Boeing 737-800 and the Airbus A340-300? | [Schema (values) (types)]: | flight_1 | flight : flno (text) , origin (number) , destination (text) , distance (text) , departure_date (number) , arrival_date (time) , price (time) , aid (number) | aircraft : aid (text) , name (number) , distance (text) | employee : eid (text) , name (number) , salary (text) | certificate : eid (text) , aid (number); | [Primary Keys]: flight : flno, aircraft : aid, employee : eid, certificate : eid | [Foreign Keys]: flight : aid = aircraft : aid | certificate : aid = aircraft : aid | certificate : eid = employee : eid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | flight_1 | flight : flno (text) , origin (number) , destination (text) , distance (text) , departure_date (number) , arrival_date (time) , price (time) , aid (number) | aircraft : aid (text) , name (number) , distance (text) | employee : eid (text) , name (number) , salary (text) | certificate : eid (text) , aid (number);</schema>"
<primary_keys>[Primary Keys]: flight : flno, aircraft : aid, employee : eid, certificate : eid</primary_keys>"
<foreign_keys>[Foreign Keys]: flight : aid = aircraft : aid | certificate : aid = aircraft : aid | certificate : eid = employee : eid</foreign_keys>"
Answer the following question with a SQL Statement:<question>Show names for all employees who do not have certificate of Boeing 737-800.</question>
[SQL]:
| <SQL_QUERY>SELECT name FROM Employee EXCEPT SELECT T1.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid = T2.eid JOIN Aircraft AS T3 ON T3.aid = T2.aid WHERE T3.name = "Boeing 737-800"</SQL_QUERY> | flight_1 | SELECT name FROM Employee EXCEPT SELECT T1.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid = T2.eid JOIN Aircraft AS T3 ON T3.aid = T2.aid WHERE T3.name = "Boeing 737-800" | Show names for all employees who do not have certificate of Boeing 737-800. | [Schema (values) (types)]: | flight_1 | flight : flno (text) , origin (number) , destination (text) , distance (text) , departure_date (number) , arrival_date (time) , price (time) , aid (number) | aircraft : aid (text) , name (number) , distance (text) | employee : eid (text) , name (number) , salary (text) | certificate : eid (text) , aid (number); | [Primary Keys]: flight : flno, aircraft : aid, employee : eid, certificate : eid | [Foreign Keys]: flight : aid = aircraft : aid | certificate : aid = aircraft : aid | certificate : eid = employee : eid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | flight_1 | flight : flno (text) , origin (number) , destination (text) , distance (text) , departure_date (number) , arrival_date (time) , price (time) , aid (number) | aircraft : aid (text) , name (number) , distance (text) | employee : eid (text) , name (number) , salary (text) | certificate : eid (text) , aid (number);</schema>"
<primary_keys>[Primary Keys]: flight : flno, aircraft : aid, employee : eid, certificate : eid</primary_keys>"
<foreign_keys>[Foreign Keys]: flight : aid = aircraft : aid | certificate : aid = aircraft : aid | certificate : eid = employee : eid</foreign_keys>"
Answer the following question with a SQL Statement:<question>What are the names of all employees who are not certified to fly Boeing 737-800s?</question>
[SQL]:
| <SQL_QUERY>SELECT name FROM Employee EXCEPT SELECT T1.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid = T2.eid JOIN Aircraft AS T3 ON T3.aid = T2.aid WHERE T3.name = "Boeing 737-800"</SQL_QUERY> | flight_1 | SELECT name FROM Employee EXCEPT SELECT T1.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid = T2.eid JOIN Aircraft AS T3 ON T3.aid = T2.aid WHERE T3.name = "Boeing 737-800" | What are the names of all employees who are not certified to fly Boeing 737-800s? | [Schema (values) (types)]: | flight_1 | flight : flno (text) , origin (number) , destination (text) , distance (text) , departure_date (number) , arrival_date (time) , price (time) , aid (number) | aircraft : aid (text) , name (number) , distance (text) | employee : eid (text) , name (number) , salary (text) | certificate : eid (text) , aid (number); | [Primary Keys]: flight : flno, aircraft : aid, employee : eid, certificate : eid | [Foreign Keys]: flight : aid = aircraft : aid | certificate : aid = aircraft : aid | certificate : eid = employee : eid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | flight_1 | flight : flno (text) , origin (number) , destination (text) , distance (text) , departure_date (number) , arrival_date (time) , price (time) , aid (number) | aircraft : aid (text) , name (number) , distance (text) | employee : eid (text) , name (number) , salary (text) | certificate : eid (text) , aid (number);</schema>"
<primary_keys>[Primary Keys]: flight : flno, aircraft : aid, employee : eid, certificate : eid</primary_keys>"
<foreign_keys>[Foreign Keys]: flight : aid = aircraft : aid | certificate : aid = aircraft : aid | certificate : eid = employee : eid</foreign_keys>"
Answer the following question with a SQL Statement:<question>Show the name of aircraft which fewest people have its certificate.</question>
[SQL]:
| <SQL_QUERY>SELECT T2.name FROM Certificate AS T1 JOIN Aircraft AS T2 ON T2.aid = T1.aid GROUP BY T1.aid ORDER BY count(*) DESC LIMIT 1</SQL_QUERY> | flight_1 | SELECT T2.name FROM Certificate AS T1 JOIN Aircraft AS T2 ON T2.aid = T1.aid GROUP BY T1.aid ORDER BY count(*) DESC LIMIT 1 | Show the name of aircraft which fewest people have its certificate. | [Schema (values) (types)]: | flight_1 | flight : flno (text) , origin (number) , destination (text) , distance (text) , departure_date (number) , arrival_date (time) , price (time) , aid (number) | aircraft : aid (text) , name (number) , distance (text) | employee : eid (text) , name (number) , salary (text) | certificate : eid (text) , aid (number); | [Primary Keys]: flight : flno, aircraft : aid, employee : eid, certificate : eid | [Foreign Keys]: flight : aid = aircraft : aid | certificate : aid = aircraft : aid | certificate : eid = employee : eid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | flight_1 | flight : flno (text) , origin (number) , destination (text) , distance (text) , departure_date (number) , arrival_date (time) , price (time) , aid (number) | aircraft : aid (text) , name (number) , distance (text) | employee : eid (text) , name (number) , salary (text) | certificate : eid (text) , aid (number);</schema>"
<primary_keys>[Primary Keys]: flight : flno, aircraft : aid, employee : eid, certificate : eid</primary_keys>"
<foreign_keys>[Foreign Keys]: flight : aid = aircraft : aid | certificate : aid = aircraft : aid | certificate : eid = employee : eid</foreign_keys>"
Answer the following question with a SQL Statement:<question>What are the names of the aircraft that the least people are certified to fly?</question>
[SQL]:
| <SQL_QUERY>SELECT T2.name FROM Certificate AS T1 JOIN Aircraft AS T2 ON T2.aid = T1.aid GROUP BY T1.aid ORDER BY count(*) DESC LIMIT 1</SQL_QUERY> | flight_1 | SELECT T2.name FROM Certificate AS T1 JOIN Aircraft AS T2 ON T2.aid = T1.aid GROUP BY T1.aid ORDER BY count(*) DESC LIMIT 1 | What are the names of the aircraft that the least people are certified to fly? | [Schema (values) (types)]: | flight_1 | flight : flno (text) , origin (number) , destination (text) , distance (text) , departure_date (number) , arrival_date (time) , price (time) , aid (number) | aircraft : aid (text) , name (number) , distance (text) | employee : eid (text) , name (number) , salary (text) | certificate : eid (text) , aid (number); | [Primary Keys]: flight : flno, aircraft : aid, employee : eid, certificate : eid | [Foreign Keys]: flight : aid = aircraft : aid | certificate : aid = aircraft : aid | certificate : eid = employee : eid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | flight_1 | flight : flno (text) , origin (number) , destination (text) , distance (text) , departure_date (number) , arrival_date (time) , price (time) , aid (number) | aircraft : aid (text) , name (number) , distance (text) | employee : eid (text) , name (number) , salary (text) | certificate : eid (text) , aid (number);</schema>"
<primary_keys>[Primary Keys]: flight : flno, aircraft : aid, employee : eid, certificate : eid</primary_keys>"
<foreign_keys>[Foreign Keys]: flight : aid = aircraft : aid | certificate : aid = aircraft : aid | certificate : eid = employee : eid</foreign_keys>"
Answer the following question with a SQL Statement:<question>Show the name and distance of the aircrafts with more than 5000 distance and which at least 5 people have its certificate.</question>
[SQL]:
| <SQL_QUERY>SELECT T2.name FROM Certificate AS T1 JOIN Aircraft AS T2 ON T2.aid = T1.aid WHERE T2.distance > 5000 GROUP BY T1.aid ORDER BY count(*) >= 5</SQL_QUERY> | flight_1 | SELECT T2.name FROM Certificate AS T1 JOIN Aircraft AS T2 ON T2.aid = T1.aid WHERE T2.distance > 5000 GROUP BY T1.aid ORDER BY count(*) >= 5 | Show the name and distance of the aircrafts with more than 5000 distance and which at least 5 people have its certificate. | [Schema (values) (types)]: | flight_1 | flight : flno (text) , origin (number) , destination (text) , distance (text) , departure_date (number) , arrival_date (time) , price (time) , aid (number) | aircraft : aid (text) , name (number) , distance (text) | employee : eid (text) , name (number) , salary (text) | certificate : eid (text) , aid (number); | [Primary Keys]: flight : flno, aircraft : aid, employee : eid, certificate : eid | [Foreign Keys]: flight : aid = aircraft : aid | certificate : aid = aircraft : aid | certificate : eid = employee : eid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | flight_1 | flight : flno (text) , origin (number) , destination (text) , distance (text) , departure_date (number) , arrival_date (time) , price (time) , aid (number) | aircraft : aid (text) , name (number) , distance (text) | employee : eid (text) , name (number) , salary (text) | certificate : eid (text) , aid (number);</schema>"
<primary_keys>[Primary Keys]: flight : flno, aircraft : aid, employee : eid, certificate : eid</primary_keys>"
<foreign_keys>[Foreign Keys]: flight : aid = aircraft : aid | certificate : aid = aircraft : aid | certificate : eid = employee : eid</foreign_keys>"
Answer the following question with a SQL Statement:<question>What is the name and distance of every aircraft that can cover a distance of more than 5000 and which at least 5 people can fly?</question>
[SQL]:
| <SQL_QUERY>SELECT T2.name FROM Certificate AS T1 JOIN Aircraft AS T2 ON T2.aid = T1.aid WHERE T2.distance > 5000 GROUP BY T1.aid ORDER BY count(*) >= 5</SQL_QUERY> | flight_1 | SELECT T2.name FROM Certificate AS T1 JOIN Aircraft AS T2 ON T2.aid = T1.aid WHERE T2.distance > 5000 GROUP BY T1.aid ORDER BY count(*) >= 5 | What is the name and distance of every aircraft that can cover a distance of more than 5000 and which at least 5 people can fly? | [Schema (values) (types)]: | flight_1 | flight : flno (text) , origin (number) , destination (text) , distance (text) , departure_date (number) , arrival_date (time) , price (time) , aid (number) | aircraft : aid (text) , name (number) , distance (text) | employee : eid (text) , name (number) , salary (text) | certificate : eid (text) , aid (number); | [Primary Keys]: flight : flno, aircraft : aid, employee : eid, certificate : eid | [Foreign Keys]: flight : aid = aircraft : aid | certificate : aid = aircraft : aid | certificate : eid = employee : eid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | flight_1 | flight : flno (text) , origin (number) , destination (text) , distance (text) , departure_date (number) , arrival_date (time) , price (time) , aid (number) | aircraft : aid (text) , name (number) , distance (text) | employee : eid (text) , name (number) , salary (text) | certificate : eid (text) , aid (number);</schema>"
<primary_keys>[Primary Keys]: flight : flno, aircraft : aid, employee : eid, certificate : eid</primary_keys>"
<foreign_keys>[Foreign Keys]: flight : aid = aircraft : aid | certificate : aid = aircraft : aid | certificate : eid = employee : eid</foreign_keys>"
Answer the following question with a SQL Statement:<question>what is the salary and name of the employee who has the most number of aircraft certificates?</question>
[SQL]:
| <SQL_QUERY>SELECT T1.name , T1.salary FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid = T2.eid GROUP BY T1.eid ORDER BY count(*) DESC LIMIT 1</SQL_QUERY> | flight_1 | SELECT T1.name , T1.salary FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid = T2.eid GROUP BY T1.eid ORDER BY count(*) DESC LIMIT 1 | what is the salary and name of the employee who has the most number of aircraft certificates? | [Schema (values) (types)]: | flight_1 | flight : flno (text) , origin (number) , destination (text) , distance (text) , departure_date (number) , arrival_date (time) , price (time) , aid (number) | aircraft : aid (text) , name (number) , distance (text) | employee : eid (text) , name (number) , salary (text) | certificate : eid (text) , aid (number); | [Primary Keys]: flight : flno, aircraft : aid, employee : eid, certificate : eid | [Foreign Keys]: flight : aid = aircraft : aid | certificate : aid = aircraft : aid | certificate : eid = employee : eid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | flight_1 | flight : flno (text) , origin (number) , destination (text) , distance (text) , departure_date (number) , arrival_date (time) , price (time) , aid (number) | aircraft : aid (text) , name (number) , distance (text) | employee : eid (text) , name (number) , salary (text) | certificate : eid (text) , aid (number);</schema>"
<primary_keys>[Primary Keys]: flight : flno, aircraft : aid, employee : eid, certificate : eid</primary_keys>"
<foreign_keys>[Foreign Keys]: flight : aid = aircraft : aid | certificate : aid = aircraft : aid | certificate : eid = employee : eid</foreign_keys>"
Answer the following question with a SQL Statement:<question>What is the salaray and name of the employee that is certified to fly the most planes?</question>
[SQL]:
| <SQL_QUERY>SELECT T1.name , T1.salary FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid = T2.eid GROUP BY T1.eid ORDER BY count(*) DESC LIMIT 1</SQL_QUERY> | flight_1 | SELECT T1.name , T1.salary FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid = T2.eid GROUP BY T1.eid ORDER BY count(*) DESC LIMIT 1 | What is the salaray and name of the employee that is certified to fly the most planes? | [Schema (values) (types)]: | flight_1 | flight : flno (text) , origin (number) , destination (text) , distance (text) , departure_date (number) , arrival_date (time) , price (time) , aid (number) | aircraft : aid (text) , name (number) , distance (text) | employee : eid (text) , name (number) , salary (text) | certificate : eid (text) , aid (number); | [Primary Keys]: flight : flno, aircraft : aid, employee : eid, certificate : eid | [Foreign Keys]: flight : aid = aircraft : aid | certificate : aid = aircraft : aid | certificate : eid = employee : eid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | flight_1 | flight : flno (text) , origin (number) , destination (text) , distance (text) , departure_date (number) , arrival_date (time) , price (time) , aid (number) | aircraft : aid (text) , name (number) , distance (text) | employee : eid (text) , name (number) , salary (text) | certificate : eid (text) , aid (number);</schema>"
<primary_keys>[Primary Keys]: flight : flno, aircraft : aid, employee : eid, certificate : eid</primary_keys>"
<foreign_keys>[Foreign Keys]: flight : aid = aircraft : aid | certificate : aid = aircraft : aid | certificate : eid = employee : eid</foreign_keys>"
Answer the following question with a SQL Statement:<question>What is the salary and name of the employee who has the most number of certificates on aircrafts with distance more than 5000?</question>
[SQL]:
| <SQL_QUERY>SELECT T1.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid = T2.eid JOIN Aircraft AS T3 ON T3.aid = T2.aid WHERE T3.distance > 5000 GROUP BY T1.eid ORDER BY count(*) DESC LIMIT 1</SQL_QUERY> | flight_1 | SELECT T1.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid = T2.eid JOIN Aircraft AS T3 ON T3.aid = T2.aid WHERE T3.distance > 5000 GROUP BY T1.eid ORDER BY count(*) DESC LIMIT 1 | What is the salary and name of the employee who has the most number of certificates on aircrafts with distance more than 5000? | [Schema (values) (types)]: | flight_1 | flight : flno (text) , origin (number) , destination (text) , distance (text) , departure_date (number) , arrival_date (time) , price (time) , aid (number) | aircraft : aid (text) , name (number) , distance (text) | employee : eid (text) , name (number) , salary (text) | certificate : eid (text) , aid (number); | [Primary Keys]: flight : flno, aircraft : aid, employee : eid, certificate : eid | [Foreign Keys]: flight : aid = aircraft : aid | certificate : aid = aircraft : aid | certificate : eid = employee : eid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | flight_1 | flight : flno (text) , origin (number) , destination (text) , distance (text) , departure_date (number) , arrival_date (time) , price (time) , aid (number) | aircraft : aid (text) , name (number) , distance (text) | employee : eid (text) , name (number) , salary (text) | certificate : eid (text) , aid (number);</schema>"
<primary_keys>[Primary Keys]: flight : flno, aircraft : aid, employee : eid, certificate : eid</primary_keys>"
<foreign_keys>[Foreign Keys]: flight : aid = aircraft : aid | certificate : aid = aircraft : aid | certificate : eid = employee : eid</foreign_keys>"
Answer the following question with a SQL Statement:<question>What is the salaray and name of the employee with the most certificates to fly planes more than 5000?</question>
[SQL]:
| <SQL_QUERY>SELECT T1.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid = T2.eid JOIN Aircraft AS T3 ON T3.aid = T2.aid WHERE T3.distance > 5000 GROUP BY T1.eid ORDER BY count(*) DESC LIMIT 1</SQL_QUERY> | flight_1 | SELECT T1.name FROM Employee AS T1 JOIN Certificate AS T2 ON T1.eid = T2.eid JOIN Aircraft AS T3 ON T3.aid = T2.aid WHERE T3.distance > 5000 GROUP BY T1.eid ORDER BY count(*) DESC LIMIT 1 | What is the salaray and name of the employee with the most certificates to fly planes more than 5000? | [Schema (values) (types)]: | flight_1 | flight : flno (text) , origin (number) , destination (text) , distance (text) , departure_date (number) , arrival_date (time) , price (time) , aid (number) | aircraft : aid (text) , name (number) , distance (text) | employee : eid (text) , name (number) , salary (text) | certificate : eid (text) , aid (number); | [Primary Keys]: flight : flno, aircraft : aid, employee : eid, certificate : eid | [Foreign Keys]: flight : aid = aircraft : aid | certificate : aid = aircraft : aid | certificate : eid = employee : eid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text);</schema>"
<primary_keys>[Primary Keys]: allergy_type : allergy, has_allergy : stuid</primary_keys>"
<foreign_keys>[Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid</foreign_keys>"
Answer the following question with a SQL Statement:<question>How many allergies are there?</question>
[SQL]:
| <SQL_QUERY>SELECT count(DISTINCT allergy) FROM Allergy_type</SQL_QUERY> | allergy_1 | SELECT count(DISTINCT allergy) FROM Allergy_type | How many allergies are there? | [Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text); | [Primary Keys]: allergy_type : allergy, has_allergy : stuid | [Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text);</schema>"
<primary_keys>[Primary Keys]: allergy_type : allergy, has_allergy : stuid</primary_keys>"
<foreign_keys>[Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid</foreign_keys>"
Answer the following question with a SQL Statement:<question>How many allergy entries are there?</question>
[SQL]:
| <SQL_QUERY>SELECT count(DISTINCT allergy) FROM Allergy_type</SQL_QUERY> | allergy_1 | SELECT count(DISTINCT allergy) FROM Allergy_type | How many allergy entries are there? | [Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text); | [Primary Keys]: allergy_type : allergy, has_allergy : stuid | [Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text);</schema>"
<primary_keys>[Primary Keys]: allergy_type : allergy, has_allergy : stuid</primary_keys>"
<foreign_keys>[Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid</foreign_keys>"
Answer the following question with a SQL Statement:<question>How many different allergy types exist?</question>
[SQL]:
| <SQL_QUERY>SELECT count(DISTINCT allergytype) FROM Allergy_type</SQL_QUERY> | allergy_1 | SELECT count(DISTINCT allergytype) FROM Allergy_type | How many different allergy types exist? | [Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text); | [Primary Keys]: allergy_type : allergy, has_allergy : stuid | [Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text);</schema>"
<primary_keys>[Primary Keys]: allergy_type : allergy, has_allergy : stuid</primary_keys>"
<foreign_keys>[Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid</foreign_keys>"
Answer the following question with a SQL Statement:<question>How many distinct allergies are there?</question>
[SQL]:
| <SQL_QUERY>SELECT count(DISTINCT allergytype) FROM Allergy_type</SQL_QUERY> | allergy_1 | SELECT count(DISTINCT allergytype) FROM Allergy_type | How many distinct allergies are there? | [Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text); | [Primary Keys]: allergy_type : allergy, has_allergy : stuid | [Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text);</schema>"
<primary_keys>[Primary Keys]: allergy_type : allergy, has_allergy : stuid</primary_keys>"
<foreign_keys>[Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid</foreign_keys>"
Answer the following question with a SQL Statement:<question>Show all allergy types.</question>
[SQL]:
| <SQL_QUERY>SELECT DISTINCT allergytype FROM Allergy_type</SQL_QUERY> | allergy_1 | SELECT DISTINCT allergytype FROM Allergy_type | Show all allergy types. | [Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text); | [Primary Keys]: allergy_type : allergy, has_allergy : stuid | [Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text);</schema>"
<primary_keys>[Primary Keys]: allergy_type : allergy, has_allergy : stuid</primary_keys>"
<foreign_keys>[Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid</foreign_keys>"
Answer the following question with a SQL Statement:<question>What are the different allergy types?</question>
[SQL]:
| <SQL_QUERY>SELECT DISTINCT allergytype FROM Allergy_type</SQL_QUERY> | allergy_1 | SELECT DISTINCT allergytype FROM Allergy_type | What are the different allergy types? | [Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text); | [Primary Keys]: allergy_type : allergy, has_allergy : stuid | [Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text);</schema>"
<primary_keys>[Primary Keys]: allergy_type : allergy, has_allergy : stuid</primary_keys>"
<foreign_keys>[Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid</foreign_keys>"
Answer the following question with a SQL Statement:<question>Show all allergies and their types.</question>
[SQL]:
| <SQL_QUERY>SELECT allergy , allergytype FROM Allergy_type</SQL_QUERY> | allergy_1 | SELECT allergy , allergytype FROM Allergy_type | Show all allergies and their types. | [Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text); | [Primary Keys]: allergy_type : allergy, has_allergy : stuid | [Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text);</schema>"
<primary_keys>[Primary Keys]: allergy_type : allergy, has_allergy : stuid</primary_keys>"
<foreign_keys>[Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid</foreign_keys>"
Answer the following question with a SQL Statement:<question>What are the allergies and their types?</question>
[SQL]:
| <SQL_QUERY>SELECT allergy , allergytype FROM Allergy_type</SQL_QUERY> | allergy_1 | SELECT allergy , allergytype FROM Allergy_type | What are the allergies and their types? | [Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text); | [Primary Keys]: allergy_type : allergy, has_allergy : stuid | [Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text);</schema>"
<primary_keys>[Primary Keys]: allergy_type : allergy, has_allergy : stuid</primary_keys>"
<foreign_keys>[Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid</foreign_keys>"
Answer the following question with a SQL Statement:<question>Show all allergies with type food.</question>
[SQL]:
| <SQL_QUERY>SELECT DISTINCT allergy FROM Allergy_type WHERE allergytype = "food"</SQL_QUERY> | allergy_1 | SELECT DISTINCT allergy FROM Allergy_type WHERE allergytype = "food" | Show all allergies with type food. | [Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text); | [Primary Keys]: allergy_type : allergy, has_allergy : stuid | [Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text);</schema>"
<primary_keys>[Primary Keys]: allergy_type : allergy, has_allergy : stuid</primary_keys>"
<foreign_keys>[Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid</foreign_keys>"
Answer the following question with a SQL Statement:<question>What are all the different food allergies?</question>
[SQL]:
| <SQL_QUERY>SELECT DISTINCT allergy FROM Allergy_type WHERE allergytype = "food"</SQL_QUERY> | allergy_1 | SELECT DISTINCT allergy FROM Allergy_type WHERE allergytype = "food" | What are all the different food allergies? | [Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text); | [Primary Keys]: allergy_type : allergy, has_allergy : stuid | [Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text);</schema>"
<primary_keys>[Primary Keys]: allergy_type : allergy, has_allergy : stuid</primary_keys>"
<foreign_keys>[Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid</foreign_keys>"
Answer the following question with a SQL Statement:<question>What is the type of allergy Cat?</question>
[SQL]:
| <SQL_QUERY>SELECT allergytype FROM Allergy_type WHERE allergy = "Cat"</SQL_QUERY> | allergy_1 | SELECT allergytype FROM Allergy_type WHERE allergy = "Cat" | What is the type of allergy Cat? | [Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text); | [Primary Keys]: allergy_type : allergy, has_allergy : stuid | [Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text);</schema>"
<primary_keys>[Primary Keys]: allergy_type : allergy, has_allergy : stuid</primary_keys>"
<foreign_keys>[Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid</foreign_keys>"
Answer the following question with a SQL Statement:<question>What is allergy type of a cat allergy?</question>
[SQL]:
| <SQL_QUERY>SELECT allergytype FROM Allergy_type WHERE allergy = "Cat"</SQL_QUERY> | allergy_1 | SELECT allergytype FROM Allergy_type WHERE allergy = "Cat" | What is allergy type of a cat allergy? | [Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text); | [Primary Keys]: allergy_type : allergy, has_allergy : stuid | [Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text);</schema>"
<primary_keys>[Primary Keys]: allergy_type : allergy, has_allergy : stuid</primary_keys>"
<foreign_keys>[Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid</foreign_keys>"
Answer the following question with a SQL Statement:<question>How many allergies have type animal?</question>
[SQL]:
| <SQL_QUERY>SELECT count(*) FROM Allergy_type WHERE allergytype = "animal"</SQL_QUERY> | allergy_1 | SELECT count(*) FROM Allergy_type WHERE allergytype = "animal" | How many allergies have type animal? | [Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text); | [Primary Keys]: allergy_type : allergy, has_allergy : stuid | [Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text);</schema>"
<primary_keys>[Primary Keys]: allergy_type : allergy, has_allergy : stuid</primary_keys>"
<foreign_keys>[Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid</foreign_keys>"
Answer the following question with a SQL Statement:<question>How many animal type allergies exist?</question>
[SQL]:
| <SQL_QUERY>SELECT count(*) FROM Allergy_type WHERE allergytype = "animal"</SQL_QUERY> | allergy_1 | SELECT count(*) FROM Allergy_type WHERE allergytype = "animal" | How many animal type allergies exist? | [Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text); | [Primary Keys]: allergy_type : allergy, has_allergy : stuid | [Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text);</schema>"
<primary_keys>[Primary Keys]: allergy_type : allergy, has_allergy : stuid</primary_keys>"
<foreign_keys>[Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid</foreign_keys>"
Answer the following question with a SQL Statement:<question>Show all allergy types and the number of allergies in each type.</question>
[SQL]:
| <SQL_QUERY>SELECT allergytype , count(*) FROM Allergy_type GROUP BY allergytype</SQL_QUERY> | allergy_1 | SELECT allergytype , count(*) FROM Allergy_type GROUP BY allergytype | Show all allergy types and the number of allergies in each type. | [Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text); | [Primary Keys]: allergy_type : allergy, has_allergy : stuid | [Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text);</schema>"
<primary_keys>[Primary Keys]: allergy_type : allergy, has_allergy : stuid</primary_keys>"
<foreign_keys>[Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid</foreign_keys>"
Answer the following question with a SQL Statement:<question>What are the allergy types and how many allergies correspond to each one?</question>
[SQL]:
| <SQL_QUERY>SELECT allergytype , count(*) FROM Allergy_type GROUP BY allergytype</SQL_QUERY> | allergy_1 | SELECT allergytype , count(*) FROM Allergy_type GROUP BY allergytype | What are the allergy types and how many allergies correspond to each one? | [Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text); | [Primary Keys]: allergy_type : allergy, has_allergy : stuid | [Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text);</schema>"
<primary_keys>[Primary Keys]: allergy_type : allergy, has_allergy : stuid</primary_keys>"
<foreign_keys>[Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid</foreign_keys>"
Answer the following question with a SQL Statement:<question>Which allergy type has most number of allergies?</question>
[SQL]:
| <SQL_QUERY>SELECT allergytype FROM Allergy_type GROUP BY allergytype ORDER BY count(*) DESC LIMIT 1</SQL_QUERY> | allergy_1 | SELECT allergytype FROM Allergy_type GROUP BY allergytype ORDER BY count(*) DESC LIMIT 1 | Which allergy type has most number of allergies? | [Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text); | [Primary Keys]: allergy_type : allergy, has_allergy : stuid | [Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text);</schema>"
<primary_keys>[Primary Keys]: allergy_type : allergy, has_allergy : stuid</primary_keys>"
<foreign_keys>[Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid</foreign_keys>"
Answer the following question with a SQL Statement:<question>Which allergy type is most common?</question>
[SQL]:
| <SQL_QUERY>SELECT allergytype FROM Allergy_type GROUP BY allergytype ORDER BY count(*) DESC LIMIT 1</SQL_QUERY> | allergy_1 | SELECT allergytype FROM Allergy_type GROUP BY allergytype ORDER BY count(*) DESC LIMIT 1 | Which allergy type is most common? | [Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text); | [Primary Keys]: allergy_type : allergy, has_allergy : stuid | [Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text);</schema>"
<primary_keys>[Primary Keys]: allergy_type : allergy, has_allergy : stuid</primary_keys>"
<foreign_keys>[Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid</foreign_keys>"
Answer the following question with a SQL Statement:<question>Which allergy type has least number of allergies?</question>
[SQL]:
| <SQL_QUERY>SELECT allergytype FROM Allergy_type GROUP BY allergytype ORDER BY count(*) ASC LIMIT 1</SQL_QUERY> | allergy_1 | SELECT allergytype FROM Allergy_type GROUP BY allergytype ORDER BY count(*) ASC LIMIT 1 | Which allergy type has least number of allergies? | [Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text); | [Primary Keys]: allergy_type : allergy, has_allergy : stuid | [Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text);</schema>"
<primary_keys>[Primary Keys]: allergy_type : allergy, has_allergy : stuid</primary_keys>"
<foreign_keys>[Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid</foreign_keys>"
Answer the following question with a SQL Statement:<question>Which allergy type is the least common?</question>
[SQL]:
| <SQL_QUERY>SELECT allergytype FROM Allergy_type GROUP BY allergytype ORDER BY count(*) ASC LIMIT 1</SQL_QUERY> | allergy_1 | SELECT allergytype FROM Allergy_type GROUP BY allergytype ORDER BY count(*) ASC LIMIT 1 | Which allergy type is the least common? | [Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text); | [Primary Keys]: allergy_type : allergy, has_allergy : stuid | [Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text);</schema>"
<primary_keys>[Primary Keys]: allergy_type : allergy, has_allergy : stuid</primary_keys>"
<foreign_keys>[Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid</foreign_keys>"
Answer the following question with a SQL Statement:<question>How many students are there?</question>
[SQL]:
| <SQL_QUERY>SELECT count(*) FROM Student</SQL_QUERY> | allergy_1 | SELECT count(*) FROM Student | How many students are there? | [Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text); | [Primary Keys]: allergy_type : allergy, has_allergy : stuid | [Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text);</schema>"
<primary_keys>[Primary Keys]: allergy_type : allergy, has_allergy : stuid</primary_keys>"
<foreign_keys>[Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid</foreign_keys>"
Answer the following question with a SQL Statement:<question>What is the total number of students?</question>
[SQL]:
| <SQL_QUERY>SELECT count(*) FROM Student</SQL_QUERY> | allergy_1 | SELECT count(*) FROM Student | What is the total number of students? | [Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text); | [Primary Keys]: allergy_type : allergy, has_allergy : stuid | [Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text);</schema>"
<primary_keys>[Primary Keys]: allergy_type : allergy, has_allergy : stuid</primary_keys>"
<foreign_keys>[Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid</foreign_keys>"
Answer the following question with a SQL Statement:<question>Show first name and last name for all students.</question>
[SQL]:
| <SQL_QUERY>SELECT Fname , Lname FROM Student</SQL_QUERY> | allergy_1 | SELECT Fname , Lname FROM Student | Show first name and last name for all students. | [Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text); | [Primary Keys]: allergy_type : allergy, has_allergy : stuid | [Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text);</schema>"
<primary_keys>[Primary Keys]: allergy_type : allergy, has_allergy : stuid</primary_keys>"
<foreign_keys>[Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid</foreign_keys>"
Answer the following question with a SQL Statement:<question>What are the full names of all students</question>
[SQL]:
| <SQL_QUERY>SELECT Fname , Lname FROM Student</SQL_QUERY> | allergy_1 | SELECT Fname , Lname FROM Student | What are the full names of all students | [Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text); | [Primary Keys]: allergy_type : allergy, has_allergy : stuid | [Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text);</schema>"
<primary_keys>[Primary Keys]: allergy_type : allergy, has_allergy : stuid</primary_keys>"
<foreign_keys>[Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid</foreign_keys>"
Answer the following question with a SQL Statement:<question>How many different advisors are listed?</question>
[SQL]:
| <SQL_QUERY>SELECT count(DISTINCT advisor) FROM Student</SQL_QUERY> | allergy_1 | SELECT count(DISTINCT advisor) FROM Student | How many different advisors are listed? | [Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text); | [Primary Keys]: allergy_type : allergy, has_allergy : stuid | [Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text);</schema>"
<primary_keys>[Primary Keys]: allergy_type : allergy, has_allergy : stuid</primary_keys>"
<foreign_keys>[Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid</foreign_keys>"
Answer the following question with a SQL Statement:<question>How many advisors are there?</question>
[SQL]:
| <SQL_QUERY>SELECT count(DISTINCT advisor) FROM Student</SQL_QUERY> | allergy_1 | SELECT count(DISTINCT advisor) FROM Student | How many advisors are there? | [Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text); | [Primary Keys]: allergy_type : allergy, has_allergy : stuid | [Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text);</schema>"
<primary_keys>[Primary Keys]: allergy_type : allergy, has_allergy : stuid</primary_keys>"
<foreign_keys>[Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid</foreign_keys>"
Answer the following question with a SQL Statement:<question>Show all majors.</question>
[SQL]:
| <SQL_QUERY>SELECT DISTINCT Major FROM Student</SQL_QUERY> | allergy_1 | SELECT DISTINCT Major FROM Student | Show all majors. | [Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text); | [Primary Keys]: allergy_type : allergy, has_allergy : stuid | [Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text);</schema>"
<primary_keys>[Primary Keys]: allergy_type : allergy, has_allergy : stuid</primary_keys>"
<foreign_keys>[Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid</foreign_keys>"
Answer the following question with a SQL Statement:<question>What are the different majors?</question>
[SQL]:
| <SQL_QUERY>SELECT DISTINCT Major FROM Student</SQL_QUERY> | allergy_1 | SELECT DISTINCT Major FROM Student | What are the different majors? | [Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text); | [Primary Keys]: allergy_type : allergy, has_allergy : stuid | [Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text);</schema>"
<primary_keys>[Primary Keys]: allergy_type : allergy, has_allergy : stuid</primary_keys>"
<foreign_keys>[Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid</foreign_keys>"
Answer the following question with a SQL Statement:<question>Show all cities where students live.</question>
[SQL]:
| <SQL_QUERY>SELECT DISTINCT city_code FROM Student</SQL_QUERY> | allergy_1 | SELECT DISTINCT city_code FROM Student | Show all cities where students live. | [Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text); | [Primary Keys]: allergy_type : allergy, has_allergy : stuid | [Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text);</schema>"
<primary_keys>[Primary Keys]: allergy_type : allergy, has_allergy : stuid</primary_keys>"
<foreign_keys>[Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid</foreign_keys>"
Answer the following question with a SQL Statement:<question>What cities do students live in?</question>
[SQL]:
| <SQL_QUERY>SELECT DISTINCT city_code FROM Student</SQL_QUERY> | allergy_1 | SELECT DISTINCT city_code FROM Student | What cities do students live in? | [Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text); | [Primary Keys]: allergy_type : allergy, has_allergy : stuid | [Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text);</schema>"
<primary_keys>[Primary Keys]: allergy_type : allergy, has_allergy : stuid</primary_keys>"
<foreign_keys>[Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid</foreign_keys>"
Answer the following question with a SQL Statement:<question>Show first name, last name, age for all female students. Their sex is F.</question>
[SQL]:
| <SQL_QUERY>SELECT Fname , Lname , Age FROM Student WHERE Sex = 'F'</SQL_QUERY> | allergy_1 | SELECT Fname , Lname , Age FROM Student WHERE Sex = 'F' | Show first name, last name, age for all female students. Their sex is F. | [Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text); | [Primary Keys]: allergy_type : allergy, has_allergy : stuid | [Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text);</schema>"
<primary_keys>[Primary Keys]: allergy_type : allergy, has_allergy : stuid</primary_keys>"
<foreign_keys>[Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid</foreign_keys>"
Answer the following question with a SQL Statement:<question>What are the full names and ages for all female students whose sex is F?</question>
[SQL]:
| <SQL_QUERY>SELECT Fname , Lname , Age FROM Student WHERE Sex = 'F'</SQL_QUERY> | allergy_1 | SELECT Fname , Lname , Age FROM Student WHERE Sex = 'F' | What are the full names and ages for all female students whose sex is F? | [Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text); | [Primary Keys]: allergy_type : allergy, has_allergy : stuid | [Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text);</schema>"
<primary_keys>[Primary Keys]: allergy_type : allergy, has_allergy : stuid</primary_keys>"
<foreign_keys>[Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid</foreign_keys>"
Answer the following question with a SQL Statement:<question>Show student ids for all male students.</question>
[SQL]:
| <SQL_QUERY>SELECT StuID FROM Student WHERE Sex = 'M'</SQL_QUERY> | allergy_1 | SELECT StuID FROM Student WHERE Sex = 'M' | Show student ids for all male students. | [Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text); | [Primary Keys]: allergy_type : allergy, has_allergy : stuid | [Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text);</schema>"
<primary_keys>[Primary Keys]: allergy_type : allergy, has_allergy : stuid</primary_keys>"
<foreign_keys>[Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid</foreign_keys>"
Answer the following question with a SQL Statement:<question>What are the student ids for all male students?</question>
[SQL]:
| <SQL_QUERY>SELECT StuID FROM Student WHERE Sex = 'M'</SQL_QUERY> | allergy_1 | SELECT StuID FROM Student WHERE Sex = 'M' | What are the student ids for all male students? | [Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text); | [Primary Keys]: allergy_type : allergy, has_allergy : stuid | [Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text);</schema>"
<primary_keys>[Primary Keys]: allergy_type : allergy, has_allergy : stuid</primary_keys>"
<foreign_keys>[Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid</foreign_keys>"
Answer the following question with a SQL Statement:<question>How many students are age 18?</question>
[SQL]:
| <SQL_QUERY>SELECT count(*) FROM Student WHERE age = 18</SQL_QUERY> | allergy_1 | SELECT count(*) FROM Student WHERE age = 18 | How many students are age 18? | [Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text); | [Primary Keys]: allergy_type : allergy, has_allergy : stuid | [Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text);</schema>"
<primary_keys>[Primary Keys]: allergy_type : allergy, has_allergy : stuid</primary_keys>"
<foreign_keys>[Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid</foreign_keys>"
Answer the following question with a SQL Statement:<question>How many students are 18 years old?</question>
[SQL]:
| <SQL_QUERY>SELECT count(*) FROM Student WHERE age = 18</SQL_QUERY> | allergy_1 | SELECT count(*) FROM Student WHERE age = 18 | How many students are 18 years old? | [Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text); | [Primary Keys]: allergy_type : allergy, has_allergy : stuid | [Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text);</schema>"
<primary_keys>[Primary Keys]: allergy_type : allergy, has_allergy : stuid</primary_keys>"
<foreign_keys>[Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid</foreign_keys>"
Answer the following question with a SQL Statement:<question>Show all student ids who are older than 20.</question>
[SQL]:
| <SQL_QUERY>SELECT StuID FROM Student WHERE age > 20</SQL_QUERY> | allergy_1 | SELECT StuID FROM Student WHERE age > 20 | Show all student ids who are older than 20. | [Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text); | [Primary Keys]: allergy_type : allergy, has_allergy : stuid | [Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text);</schema>"
<primary_keys>[Primary Keys]: allergy_type : allergy, has_allergy : stuid</primary_keys>"
<foreign_keys>[Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid</foreign_keys>"
Answer the following question with a SQL Statement:<question>What are the student ids for students over 20 years old?</question>
[SQL]:
| <SQL_QUERY>SELECT StuID FROM Student WHERE age > 20</SQL_QUERY> | allergy_1 | SELECT StuID FROM Student WHERE age > 20 | What are the student ids for students over 20 years old? | [Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text); | [Primary Keys]: allergy_type : allergy, has_allergy : stuid | [Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text);</schema>"
<primary_keys>[Primary Keys]: allergy_type : allergy, has_allergy : stuid</primary_keys>"
<foreign_keys>[Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid</foreign_keys>"
Answer the following question with a SQL Statement:<question>Which city does the student whose last name is "Kim" live in?</question>
[SQL]:
| <SQL_QUERY>SELECT city_code FROM Student WHERE LName = "Kim"</SQL_QUERY> | allergy_1 | SELECT city_code FROM Student WHERE LName = "Kim" | Which city does the student whose last name is "Kim" live in? | [Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text); | [Primary Keys]: allergy_type : allergy, has_allergy : stuid | [Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text);</schema>"
<primary_keys>[Primary Keys]: allergy_type : allergy, has_allergy : stuid</primary_keys>"
<foreign_keys>[Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid</foreign_keys>"
Answer the following question with a SQL Statement:<question>Give the city that the student whose family name is Kim lives in.</question>
[SQL]:
| <SQL_QUERY>SELECT city_code FROM Student WHERE LName = "Kim"</SQL_QUERY> | allergy_1 | SELECT city_code FROM Student WHERE LName = "Kim" | Give the city that the student whose family name is Kim lives in. | [Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text); | [Primary Keys]: allergy_type : allergy, has_allergy : stuid | [Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text);</schema>"
<primary_keys>[Primary Keys]: allergy_type : allergy, has_allergy : stuid</primary_keys>"
<foreign_keys>[Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid</foreign_keys>"
Answer the following question with a SQL Statement:<question>Who is the advisor of student with ID 1004?</question>
[SQL]:
| <SQL_QUERY>SELECT Advisor FROM Student WHERE StuID = 1004</SQL_QUERY> | allergy_1 | SELECT Advisor FROM Student WHERE StuID = 1004 | Who is the advisor of student with ID 1004? | [Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text); | [Primary Keys]: allergy_type : allergy, has_allergy : stuid | [Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text);</schema>"
<primary_keys>[Primary Keys]: allergy_type : allergy, has_allergy : stuid</primary_keys>"
<foreign_keys>[Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid</foreign_keys>"
Answer the following question with a SQL Statement:<question>Who advises student 1004?</question>
[SQL]:
| <SQL_QUERY>SELECT Advisor FROM Student WHERE StuID = 1004</SQL_QUERY> | allergy_1 | SELECT Advisor FROM Student WHERE StuID = 1004 | Who advises student 1004? | [Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text); | [Primary Keys]: allergy_type : allergy, has_allergy : stuid | [Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text);</schema>"
<primary_keys>[Primary Keys]: allergy_type : allergy, has_allergy : stuid</primary_keys>"
<foreign_keys>[Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid</foreign_keys>"
Answer the following question with a SQL Statement:<question>How many students live in HKG or CHI?</question>
[SQL]:
| <SQL_QUERY>SELECT count(*) FROM Student WHERE city_code = "HKG" OR city_code = "CHI"</SQL_QUERY> | allergy_1 | SELECT count(*) FROM Student WHERE city_code = "HKG" OR city_code = "CHI" | How many students live in HKG or CHI? | [Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text); | [Primary Keys]: allergy_type : allergy, has_allergy : stuid | [Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text);</schema>"
<primary_keys>[Primary Keys]: allergy_type : allergy, has_allergy : stuid</primary_keys>"
<foreign_keys>[Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid</foreign_keys>"
Answer the following question with a SQL Statement:<question>Give the number of students living in either HKG or CHI.</question>
[SQL]:
| <SQL_QUERY>SELECT count(*) FROM Student WHERE city_code = "HKG" OR city_code = "CHI"</SQL_QUERY> | allergy_1 | SELECT count(*) FROM Student WHERE city_code = "HKG" OR city_code = "CHI" | Give the number of students living in either HKG or CHI. | [Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text); | [Primary Keys]: allergy_type : allergy, has_allergy : stuid | [Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text);</schema>"
<primary_keys>[Primary Keys]: allergy_type : allergy, has_allergy : stuid</primary_keys>"
<foreign_keys>[Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid</foreign_keys>"
Answer the following question with a SQL Statement:<question>Show the minimum, average, and maximum age of all students.</question>
[SQL]:
| <SQL_QUERY>SELECT min(age) , avg(age) , max(age) FROM Student</SQL_QUERY> | allergy_1 | SELECT min(age) , avg(age) , max(age) FROM Student | Show the minimum, average, and maximum age of all students. | [Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text); | [Primary Keys]: allergy_type : allergy, has_allergy : stuid | [Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text);</schema>"
<primary_keys>[Primary Keys]: allergy_type : allergy, has_allergy : stuid</primary_keys>"
<foreign_keys>[Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid</foreign_keys>"
Answer the following question with a SQL Statement:<question>What is the minimum, mean, and maximum age across all students?</question>
[SQL]:
| <SQL_QUERY>SELECT min(age) , avg(age) , max(age) FROM Student</SQL_QUERY> | allergy_1 | SELECT min(age) , avg(age) , max(age) FROM Student | What is the minimum, mean, and maximum age across all students? | [Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text); | [Primary Keys]: allergy_type : allergy, has_allergy : stuid | [Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text);</schema>"
<primary_keys>[Primary Keys]: allergy_type : allergy, has_allergy : stuid</primary_keys>"
<foreign_keys>[Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid</foreign_keys>"
Answer the following question with a SQL Statement:<question>What is the last name of the youngest student?</question>
[SQL]:
| <SQL_QUERY>SELECT LName FROM Student WHERE age = (SELECT min(age) FROM Student)</SQL_QUERY> | allergy_1 | SELECT LName FROM Student WHERE age = (SELECT min(age) FROM Student) | What is the last name of the youngest student? | [Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text); | [Primary Keys]: allergy_type : allergy, has_allergy : stuid | [Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text);</schema>"
<primary_keys>[Primary Keys]: allergy_type : allergy, has_allergy : stuid</primary_keys>"
<foreign_keys>[Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid</foreign_keys>"
Answer the following question with a SQL Statement:<question>Provide the last name of the youngest student.</question>
[SQL]:
| <SQL_QUERY>SELECT LName FROM Student WHERE age = (SELECT min(age) FROM Student)</SQL_QUERY> | allergy_1 | SELECT LName FROM Student WHERE age = (SELECT min(age) FROM Student) | Provide the last name of the youngest student. | [Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text); | [Primary Keys]: allergy_type : allergy, has_allergy : stuid | [Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text);</schema>"
<primary_keys>[Primary Keys]: allergy_type : allergy, has_allergy : stuid</primary_keys>"
<foreign_keys>[Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid</foreign_keys>"
Answer the following question with a SQL Statement:<question>Show the student id of the oldest student.</question>
[SQL]:
| <SQL_QUERY>SELECT StuID FROM Student WHERE age = (SELECT max(age) FROM Student)</SQL_QUERY> | allergy_1 | SELECT StuID FROM Student WHERE age = (SELECT max(age) FROM Student) | Show the student id of the oldest student. | [Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text); | [Primary Keys]: allergy_type : allergy, has_allergy : stuid | [Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text);</schema>"
<primary_keys>[Primary Keys]: allergy_type : allergy, has_allergy : stuid</primary_keys>"
<foreign_keys>[Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid</foreign_keys>"
Answer the following question with a SQL Statement:<question>What student id corresponds to the oldest student?</question>
[SQL]:
| <SQL_QUERY>SELECT StuID FROM Student WHERE age = (SELECT max(age) FROM Student)</SQL_QUERY> | allergy_1 | SELECT StuID FROM Student WHERE age = (SELECT max(age) FROM Student) | What student id corresponds to the oldest student? | [Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text); | [Primary Keys]: allergy_type : allergy, has_allergy : stuid | [Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text);</schema>"
<primary_keys>[Primary Keys]: allergy_type : allergy, has_allergy : stuid</primary_keys>"
<foreign_keys>[Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid</foreign_keys>"
Answer the following question with a SQL Statement:<question>Show all majors and corresponding number of students.</question>
[SQL]:
| <SQL_QUERY>SELECT major , count(*) FROM Student GROUP BY major</SQL_QUERY> | allergy_1 | SELECT major , count(*) FROM Student GROUP BY major | Show all majors and corresponding number of students. | [Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text); | [Primary Keys]: allergy_type : allergy, has_allergy : stuid | [Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text);</schema>"
<primary_keys>[Primary Keys]: allergy_type : allergy, has_allergy : stuid</primary_keys>"
<foreign_keys>[Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid</foreign_keys>"
Answer the following question with a SQL Statement:<question>How many students are there for each major?</question>
[SQL]:
| <SQL_QUERY>SELECT major , count(*) FROM Student GROUP BY major</SQL_QUERY> | allergy_1 | SELECT major , count(*) FROM Student GROUP BY major | How many students are there for each major? | [Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text); | [Primary Keys]: allergy_type : allergy, has_allergy : stuid | [Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text);</schema>"
<primary_keys>[Primary Keys]: allergy_type : allergy, has_allergy : stuid</primary_keys>"
<foreign_keys>[Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid</foreign_keys>"
Answer the following question with a SQL Statement:<question>Which major has most number of students?</question>
[SQL]:
| <SQL_QUERY>SELECT major FROM Student GROUP BY major ORDER BY count(*) DESC LIMIT 1</SQL_QUERY> | allergy_1 | SELECT major FROM Student GROUP BY major ORDER BY count(*) DESC LIMIT 1 | Which major has most number of students? | [Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text); | [Primary Keys]: allergy_type : allergy, has_allergy : stuid | [Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text);</schema>"
<primary_keys>[Primary Keys]: allergy_type : allergy, has_allergy : stuid</primary_keys>"
<foreign_keys>[Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid</foreign_keys>"
Answer the following question with a SQL Statement:<question>What is the largest major?</question>
[SQL]:
| <SQL_QUERY>SELECT major FROM Student GROUP BY major ORDER BY count(*) DESC LIMIT 1</SQL_QUERY> | allergy_1 | SELECT major FROM Student GROUP BY major ORDER BY count(*) DESC LIMIT 1 | What is the largest major? | [Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text); | [Primary Keys]: allergy_type : allergy, has_allergy : stuid | [Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text);</schema>"
<primary_keys>[Primary Keys]: allergy_type : allergy, has_allergy : stuid</primary_keys>"
<foreign_keys>[Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid</foreign_keys>"
Answer the following question with a SQL Statement:<question>Show all ages and corresponding number of students.</question>
[SQL]:
| <SQL_QUERY>SELECT age , count(*) FROM Student GROUP BY age</SQL_QUERY> | allergy_1 | SELECT age , count(*) FROM Student GROUP BY age | Show all ages and corresponding number of students. | [Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text); | [Primary Keys]: allergy_type : allergy, has_allergy : stuid | [Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text);</schema>"
<primary_keys>[Primary Keys]: allergy_type : allergy, has_allergy : stuid</primary_keys>"
<foreign_keys>[Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid</foreign_keys>"
Answer the following question with a SQL Statement:<question>How old is each student and how many students are each age?</question>
[SQL]:
| <SQL_QUERY>SELECT age , count(*) FROM Student GROUP BY age</SQL_QUERY> | allergy_1 | SELECT age , count(*) FROM Student GROUP BY age | How old is each student and how many students are each age? | [Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text); | [Primary Keys]: allergy_type : allergy, has_allergy : stuid | [Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text);</schema>"
<primary_keys>[Primary Keys]: allergy_type : allergy, has_allergy : stuid</primary_keys>"
<foreign_keys>[Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid</foreign_keys>"
Answer the following question with a SQL Statement:<question>Show the average age for male and female students.</question>
[SQL]:
| <SQL_QUERY>SELECT avg(age) , sex FROM Student GROUP BY sex</SQL_QUERY> | allergy_1 | SELECT avg(age) , sex FROM Student GROUP BY sex | Show the average age for male and female students. | [Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text); | [Primary Keys]: allergy_type : allergy, has_allergy : stuid | [Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text);</schema>"
<primary_keys>[Primary Keys]: allergy_type : allergy, has_allergy : stuid</primary_keys>"
<foreign_keys>[Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid</foreign_keys>"
Answer the following question with a SQL Statement:<question>What are the average ages for male and female students?</question>
[SQL]:
| <SQL_QUERY>SELECT avg(age) , sex FROM Student GROUP BY sex</SQL_QUERY> | allergy_1 | SELECT avg(age) , sex FROM Student GROUP BY sex | What are the average ages for male and female students? | [Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text); | [Primary Keys]: allergy_type : allergy, has_allergy : stuid | [Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text);</schema>"
<primary_keys>[Primary Keys]: allergy_type : allergy, has_allergy : stuid</primary_keys>"
<foreign_keys>[Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid</foreign_keys>"
Answer the following question with a SQL Statement:<question>Show all cities and corresponding number of students.</question>
[SQL]:
| <SQL_QUERY>SELECT city_code , count(*) FROM Student GROUP BY city_code</SQL_QUERY> | allergy_1 | SELECT city_code , count(*) FROM Student GROUP BY city_code | Show all cities and corresponding number of students. | [Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text); | [Primary Keys]: allergy_type : allergy, has_allergy : stuid | [Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text);</schema>"
<primary_keys>[Primary Keys]: allergy_type : allergy, has_allergy : stuid</primary_keys>"
<foreign_keys>[Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid</foreign_keys>"
Answer the following question with a SQL Statement:<question>How many students live in each city?</question>
[SQL]:
| <SQL_QUERY>SELECT city_code , count(*) FROM Student GROUP BY city_code</SQL_QUERY> | allergy_1 | SELECT city_code , count(*) FROM Student GROUP BY city_code | How many students live in each city? | [Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text); | [Primary Keys]: allergy_type : allergy, has_allergy : stuid | [Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid |
This is a task converting text into SQL statements. We will first give the dataset schema and column types, primary keys and foreign keys and then ask a question in text. You are asked to generate SQL statement in SQLite.
<schema>[Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text);</schema>"
<primary_keys>[Primary Keys]: allergy_type : allergy, has_allergy : stuid</primary_keys>"
<foreign_keys>[Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid</foreign_keys>"
Answer the following question with a SQL Statement:<question>Show all advisors and corresponding number of students.</question>
[SQL]:
| <SQL_QUERY>SELECT advisor , count(*) FROM Student GROUP BY advisor</SQL_QUERY> | allergy_1 | SELECT advisor , count(*) FROM Student GROUP BY advisor | Show all advisors and corresponding number of students. | [Schema (values) (types)]: | allergy_1 | Allergy_Type : allergy (text) , allergytype (text) | Has_Allergy : stuid (text) , allergy (text) | Student : stuid (text) , lname (text) , fname (text) , age (number) , sex (text) , major (number) , advisor (text) , city_code (text); | [Primary Keys]: allergy_type : allergy, has_allergy : stuid | [Foreign Keys]: has_allergy : allergy = allergy_type : allergy | has_allergy : stuid = student : stuid |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.