text
stringlengths 380
1.33k
|
---|
<s> [INST] <<SYS>> You are a powerful text-to-SQL model. Your job is to answer questions about a database. You are given a question and context regarding one or more tables. You must output the SQL query that answers the question. <</SYS>>
### Input:
Find the dates on which more than one revisions were made.
### Context:
CREATE TABLE Catalogs (date_of_latest_revision VARCHAR) [/INST]
### Response:
SELECT date_of_latest_revision FROM Catalogs GROUP BY date_of_latest_revision HAVING COUNT(*) > 1 </s> |
<s> [INST] <<SYS>> You are a powerful text-to-SQL model. Your job is to answer questions about a database. You are given a question and context regarding one or more tables. You must output the SQL query that answers the question. <</SYS>>
### Input:
How many products are there in the records?
### Context:
CREATE TABLE catalog_contents (Id VARCHAR) [/INST]
### Response:
SELECT COUNT(*) FROM catalog_contents </s> |
<s> [INST] <<SYS>> You are a powerful text-to-SQL model. Your job is to answer questions about a database. You are given a question and context regarding one or more tables. You must output the SQL query that answers the question. <</SYS>>
### Input:
Name all the products with next entry ID greater than 8.
### Context:
CREATE TABLE catalog_contents (catalog_entry_name VARCHAR, next_entry_id INTEGER) [/INST]
### Response:
SELECT catalog_entry_name FROM catalog_contents WHERE next_entry_id > 8 </s> |
<s> [INST] <<SYS>> You are a powerful text-to-SQL model. Your job is to answer questions about a database. You are given a question and context regarding one or more tables. You must output the SQL query that answers the question. <</SYS>>
### Input:
How many aircrafts do we have?
### Context:
CREATE TABLE Aircraft (Id VARCHAR) [/INST]
### Response:
SELECT COUNT(*) FROM Aircraft </s> |
<s> [INST] <<SYS>> You are a powerful text-to-SQL model. Your job is to answer questions about a database. You are given a question and context regarding one or more tables. You must output the SQL query that answers the question. <</SYS>>
### Input:
Show name and distance for all aircrafts.
### Context:
CREATE TABLE Aircraft (name VARCHAR, distance VARCHAR) [/INST]
### Response:
SELECT name, distance FROM Aircraft </s> |
<s> [INST] <<SYS>> You are a powerful text-to-SQL model. Your job is to answer questions about a database. You are given a question and context regarding one or more tables. You must output the SQL query that answers the question. <</SYS>>
### Input:
Show ids for all aircrafts with more than 1000 distance.
### Context:
CREATE TABLE Aircraft (aid VARCHAR, distance INTEGER) [/INST]
### Response:
SELECT aid FROM Aircraft WHERE distance > 1000 </s> |
<s> [INST] <<SYS>> You are a powerful text-to-SQL model. Your job is to answer questions about a database. You are given a question and context regarding one or more tables. You must output the SQL query that answers the question. <</SYS>>
### Input:
How many aircrafts have distance between 1000 and 5000?
### Context:
CREATE TABLE Aircraft (distance INTEGER) [/INST]
### Response:
SELECT COUNT(*) FROM Aircraft WHERE distance BETWEEN 1000 AND 5000 </s> |
<s> [INST] <<SYS>> You are a powerful text-to-SQL model. Your job is to answer questions about a database. You are given a question and context regarding one or more tables. You must output the SQL query that answers the question. <</SYS>>
### Input:
What is the name and distance for aircraft with id 12?
### Context:
CREATE TABLE Aircraft (name VARCHAR, distance VARCHAR, aid VARCHAR) [/INST]
### Response:
SELECT name, distance FROM Aircraft WHERE aid = 12 </s> |
<s> [INST] <<SYS>> You are a powerful text-to-SQL model. Your job is to answer questions about a database. You are given a question and context regarding one or more tables. You must output the SQL query that answers the question. <</SYS>>
### Input:
What is the minimum, average, and maximum distance of all aircrafts.
### Context:
CREATE TABLE Aircraft (distance INTEGER) [/INST]
### Response:
SELECT MIN(distance), AVG(distance), MAX(distance) FROM Aircraft </s> |
<s> [INST] <<SYS>> You are a powerful text-to-SQL model. Your job is to answer questions about a database. You are given a question and context regarding one or more tables. You must output the SQL query that answers the question. <</SYS>>
### Input:
Show the id and name of the aircraft with the maximum distance.
### Context:
CREATE TABLE Aircraft (aid VARCHAR, name VARCHAR, distance VARCHAR) [/INST]
### Response:
SELECT aid, name FROM Aircraft ORDER BY distance DESC LIMIT 1 </s> |
<s> [INST] <<SYS>> You are a powerful text-to-SQL model. Your job is to answer questions about a database. You are given a question and context regarding one or more tables. You must output the SQL query that answers the question. <</SYS>>
### Input:
Show the name of aircrafts with top three lowest distances.
### Context:
CREATE TABLE Aircraft (name VARCHAR, distance VARCHAR) [/INST]
### Response:
SELECT name FROM Aircraft ORDER BY distance LIMIT 3 </s> |
<s> [INST] <<SYS>> You are a powerful text-to-SQL model. Your job is to answer questions about a database. You are given a question and context regarding one or more tables. You must output the SQL query that answers the question. <</SYS>>
### Input:
Show names for all aircrafts with distances more than the average.
### Context:
CREATE TABLE Aircraft (name VARCHAR, distance INTEGER) [/INST]
### Response:
SELECT name FROM Aircraft WHERE distance > (SELECT AVG(distance) FROM Aircraft) </s> |
<s> [INST] <<SYS>> You are a powerful text-to-SQL model. Your job is to answer questions about a database. You are given a question and context regarding one or more tables. You must output the SQL query that answers the question. <</SYS>>
### Input:
How many employees do we have?
### Context:
CREATE TABLE Employee (Id VARCHAR) [/INST]
### Response:
SELECT COUNT(*) FROM Employee </s> |
<s> [INST] <<SYS>> You are a powerful text-to-SQL model. Your job is to answer questions about a database. You are given a question and context regarding one or more tables. You must output the SQL query that answers the question. <</SYS>>
### Input:
Show name and salary for all employees sorted by salary.
### Context:
CREATE TABLE Employee (name VARCHAR, salary VARCHAR) [/INST]
### Response:
SELECT name, salary FROM Employee ORDER BY salary </s> |
<s> [INST] <<SYS>> You are a powerful text-to-SQL model. Your job is to answer questions about a database. You are given a question and context regarding one or more tables. You must output the SQL query that answers the question. <</SYS>>
### Input:
Show ids for all employees with at least 100000 salary.
### Context:
CREATE TABLE Employee (eid VARCHAR, salary INTEGER) [/INST]
### Response:
SELECT eid FROM Employee WHERE salary > 100000 </s> |
<s> [INST] <<SYS>> You are a powerful text-to-SQL model. Your job is to answer questions about a database. You are given a question and context regarding one or more tables. You must output the SQL query that answers the question. <</SYS>>
### Input:
How many employees have salary between 100000 and 200000?
### Context:
CREATE TABLE Employee (salary INTEGER) [/INST]
### Response:
SELECT COUNT(*) FROM Employee WHERE salary BETWEEN 100000 AND 200000 </s> |
<s> [INST] <<SYS>> You are a powerful text-to-SQL model. Your job is to answer questions about a database. You are given a question and context regarding one or more tables. You must output the SQL query that answers the question. <</SYS>>
### Input:
What is the name and salary for employee with id 242518965?
### Context:
CREATE TABLE Employee (name VARCHAR, salary VARCHAR, eid VARCHAR) [/INST]
### Response:
SELECT name, salary FROM Employee WHERE eid = 242518965 </s> |
<s> [INST] <<SYS>> You are a powerful text-to-SQL model. Your job is to answer questions about a database. You are given a question and context regarding one or more tables. You must output the SQL query that answers the question. <</SYS>>
### Input:
What is average and maximum salary of all employees.
### Context:
CREATE TABLE Employee (salary INTEGER) [/INST]
### Response:
SELECT AVG(salary), MAX(salary) FROM Employee </s> |
<s> [INST] <<SYS>> You are a powerful text-to-SQL model. Your job is to answer questions about a database. You are given a question and context regarding one or more tables. You must output the SQL query that answers the question. <</SYS>>
### Input:
Show the id and name of the employee with maximum salary.
### Context:
CREATE TABLE Employee (eid VARCHAR, name VARCHAR, salary VARCHAR) [/INST]
### Response:
SELECT eid, name FROM Employee ORDER BY salary DESC LIMIT 1 </s> |
<s> [INST] <<SYS>> You are a powerful text-to-SQL model. Your job is to answer questions about a database. You are given a question and context regarding one or more tables. You must output the SQL query that answers the question. <</SYS>>
### Input:
Show the name of employees with three lowest salaries.
### Context:
CREATE TABLE Employee (name VARCHAR, salary VARCHAR) [/INST]
### Response:
SELECT name FROM Employee ORDER BY salary LIMIT 3 </s> |
<s> [INST] <<SYS>> You are a powerful text-to-SQL model. Your job is to answer questions about a database. You are given a question and context regarding one or more tables. You must output the SQL query that answers the question. <</SYS>>
### Input:
Show names for all employees with salary more than the average.
### Context:
CREATE TABLE Employee (name VARCHAR, salary INTEGER) [/INST]
### Response:
SELECT name FROM Employee WHERE salary > (SELECT AVG(salary) FROM Employee) </s> |
<s> [INST] <<SYS>> You are a powerful text-to-SQL model. Your job is to answer questions about a database. You are given a question and context regarding one or more tables. You must output the SQL query that answers the question. <</SYS>>
### Input:
Show the id and salary of Mark Young.
### Context:
CREATE TABLE Employee (eid VARCHAR, salary VARCHAR, name VARCHAR) [/INST]
### Response:
SELECT eid, salary FROM Employee WHERE name = 'Mark Young' </s> |
<s> [INST] <<SYS>> You are a powerful text-to-SQL model. Your job is to answer questions about a database. You are given a question and context regarding one or more tables. You must output the SQL query that answers the question. <</SYS>>
### Input:
How many flights do we have?
### Context:
CREATE TABLE Flight (Id VARCHAR) [/INST]
### Response:
SELECT COUNT(*) FROM Flight </s> |
<s> [INST] <<SYS>> You are a powerful text-to-SQL model. Your job is to answer questions about a database. You are given a question and context regarding one or more tables. You must output the SQL query that answers the question. <</SYS>>
### Input:
Show flight number, origin, destination of all flights in the alphabetical order of the departure cities.
### Context:
CREATE TABLE Flight (flno VARCHAR, origin VARCHAR, destination VARCHAR) [/INST]
### Response:
SELECT flno, origin, destination FROM Flight ORDER BY origin </s> |
<s> [INST] <<SYS>> You are a powerful text-to-SQL model. Your job is to answer questions about a database. You are given a question and context regarding one or more tables. You must output the SQL query that answers the question. <</SYS>>
### Input:
Show all flight number from Los Angeles.
### Context:
CREATE TABLE Flight (flno VARCHAR, origin VARCHAR) [/INST]
### Response:
SELECT flno FROM Flight WHERE origin = "Los Angeles" </s> |
<s> [INST] <<SYS>> You are a powerful text-to-SQL model. Your job is to answer questions about a database. You are given a question and context regarding one or more tables. You must output the SQL query that answers the question. <</SYS>>
### Input:
Show origins of all flights with destination Honolulu.
### Context:
CREATE TABLE Flight (origin VARCHAR, destination VARCHAR) [/INST]
### Response:
SELECT origin FROM Flight WHERE destination = "Honolulu" </s> |
<s> [INST] <<SYS>> You are a powerful text-to-SQL model. Your job is to answer questions about a database. You are given a question and context regarding one or more tables. You must output the SQL query that answers the question. <</SYS>>
### Input:
Show me the departure date and arrival date for all flights from Los Angeles to Honolulu.
### Context:
CREATE TABLE Flight (departure_date VARCHAR, arrival_date VARCHAR, origin VARCHAR, destination VARCHAR) [/INST]
### Response:
SELECT departure_date, arrival_date FROM Flight WHERE origin = "Los Angeles" AND destination = "Honolulu" </s> |
<s> [INST] <<SYS>> You are a powerful text-to-SQL model. Your job is to answer questions about a database. You are given a question and context regarding one or more tables. You must output the SQL query that answers the question. <</SYS>>
### Input:
Show flight number for all flights with more than 2000 distance.
### Context:
CREATE TABLE Flight (flno VARCHAR, distance INTEGER) [/INST]
### Response:
SELECT flno FROM Flight WHERE distance > 2000 </s> |
<s> [INST] <<SYS>> You are a powerful text-to-SQL model. Your job is to answer questions about a database. You are given a question and context regarding one or more tables. You must output the SQL query that answers the question. <</SYS>>
### Input:
What is the average price for flights from Los Angeles to Honolulu.
### Context:
CREATE TABLE Flight (price INTEGER, origin VARCHAR, destination VARCHAR) [/INST]
### Response:
SELECT AVG(price) FROM Flight WHERE origin = "Los Angeles" AND destination = "Honolulu" </s> |
<s> [INST] <<SYS>> You are a powerful text-to-SQL model. Your job is to answer questions about a database. You are given a question and context regarding one or more tables. You must output the SQL query that answers the question. <</SYS>>
### Input:
Show origin and destination for flights with price higher than 300.
### Context:
CREATE TABLE Flight (origin VARCHAR, destination VARCHAR, price INTEGER) [/INST]
### Response:
SELECT origin, destination FROM Flight WHERE price > 300 </s> |
<s> [INST] <<SYS>> You are a powerful text-to-SQL model. Your job is to answer questions about a database. You are given a question and context regarding one or more tables. You must output the SQL query that answers the question. <</SYS>>
### Input:
Show the flight number and distance of the flight with maximum price.
### Context:
CREATE TABLE Flight (flno VARCHAR, distance VARCHAR, price VARCHAR) [/INST]
### Response:
SELECT flno, distance FROM Flight ORDER BY price DESC LIMIT 1 </s> |
<s> [INST] <<SYS>> You are a powerful text-to-SQL model. Your job is to answer questions about a database. You are given a question and context regarding one or more tables. You must output the SQL query that answers the question. <</SYS>>
### Input:
Show the flight number of flights with three lowest distances.
### Context:
CREATE TABLE Flight (flno VARCHAR, distance VARCHAR) [/INST]
### Response:
SELECT flno FROM Flight ORDER BY distance LIMIT 3 </s> |
<s> [INST] <<SYS>> You are a powerful text-to-SQL model. Your job is to answer questions about a database. You are given a question and context regarding one or more tables. You must output the SQL query that answers the question. <</SYS>>
### Input:
What is the average distance and average price for flights from Los Angeles.
### Context:
CREATE TABLE Flight (distance INTEGER, price INTEGER, origin VARCHAR) [/INST]
### Response:
SELECT AVG(distance), AVG(price) FROM Flight WHERE origin = "Los Angeles" </s> |
<s> [INST] <<SYS>> You are a powerful text-to-SQL model. Your job is to answer questions about a database. You are given a question and context regarding one or more tables. You must output the SQL query that answers the question. <</SYS>>
### Input:
Show all origins and the number of flights from each origin.
### Context:
CREATE TABLE Flight (origin VARCHAR) [/INST]
### Response:
SELECT origin, COUNT(*) FROM Flight GROUP BY origin </s> |
<s> [INST] <<SYS>> You are a powerful text-to-SQL model. Your job is to answer questions about a database. You are given a question and context regarding one or more tables. You must output the SQL query that answers the question. <</SYS>>
### Input:
Show all destinations and the number of flights to each destination.
### Context:
CREATE TABLE Flight (destination VARCHAR) [/INST]
### Response:
SELECT destination, COUNT(*) FROM Flight GROUP BY destination </s> |
<s> [INST] <<SYS>> You are a powerful text-to-SQL model. Your job is to answer questions about a database. You are given a question and context regarding one or more tables. You must output the SQL query that answers the question. <</SYS>>
### Input:
Which origin has most number of flights?
### Context:
CREATE TABLE Flight (origin VARCHAR) [/INST]
### Response:
SELECT origin FROM Flight GROUP BY origin ORDER BY COUNT(*) DESC LIMIT 1 </s> |
<s> [INST] <<SYS>> You are a powerful text-to-SQL model. Your job is to answer questions about a database. You are given a question and context regarding one or more tables. You must output the SQL query that answers the question. <</SYS>>
### Input:
Which destination has least number of flights?
### Context:
CREATE TABLE Flight (destination VARCHAR) [/INST]
### Response:
SELECT destination FROM Flight GROUP BY destination ORDER BY COUNT(*) LIMIT 1 </s> |
<s> [INST] <<SYS>> You are a powerful text-to-SQL model. Your job is to answer questions about a database. You are given a question and context regarding one or more tables. You must output the SQL query that answers the question. <</SYS>>
### Input:
What is the aircraft name for the flight with number 99
### Context:
CREATE TABLE Flight (aid VARCHAR, flno VARCHAR); CREATE TABLE Aircraft (name VARCHAR, aid VARCHAR) [/INST]
### Response:
SELECT T2.name FROM Flight AS T1 JOIN Aircraft AS T2 ON T1.aid = T2.aid WHERE T1.flno = 99 </s> |
<s> [INST] <<SYS>> You are a powerful text-to-SQL model. Your job is to answer questions about a database. You are given a question and context regarding one or more tables. You must output the SQL query that answers the question. <</SYS>>
### Input:
Show all flight numbers with aircraft Airbus A340-300.
### Context:
CREATE TABLE Flight (flno VARCHAR, aid VARCHAR); CREATE TABLE Aircraft (aid VARCHAR, name VARCHAR) [/INST]
### Response:
SELECT T1.flno FROM Flight AS T1 JOIN Aircraft AS T2 ON T1.aid = T2.aid WHERE T2.name = "Airbus A340-300" </s> |
<s> [INST] <<SYS>> You are a powerful text-to-SQL model. Your job is to answer questions about a database. You are given a question and context regarding one or more tables. You must output the SQL query that answers the question. <</SYS>>
### Input:
Show aircraft names and number of flights for each aircraft.
### Context:
CREATE TABLE Aircraft (name VARCHAR, aid VARCHAR); CREATE TABLE Flight (aid VARCHAR) [/INST]
### Response:
SELECT T2.name, COUNT(*) FROM Flight AS T1 JOIN Aircraft AS T2 ON T1.aid = T2.aid GROUP BY T1.aid </s> |
<s> [INST] <<SYS>> You are a powerful text-to-SQL model. Your job is to answer questions about a database. You are given a question and context regarding one or more tables. You must output the SQL query that answers the question. <</SYS>>
### Input:
Show names for all aircraft with at least two flights.
### Context:
CREATE TABLE Aircraft (name VARCHAR, aid VARCHAR); CREATE TABLE Flight (aid VARCHAR) [/INST]
### Response:
SELECT T2.name FROM Flight AS T1 JOIN Aircraft AS T2 ON T1.aid = T2.aid GROUP BY T1.aid HAVING COUNT(*) >= 2 </s> |
<s> [INST] <<SYS>> You are a powerful text-to-SQL model. Your job is to answer questions about a database. You are given a question and context regarding one or more tables. You must output the SQL query that answers the question. <</SYS>>
### Input:
How many employees have certificate.
### Context:
CREATE TABLE Certificate (eid VARCHAR) [/INST]
### Response:
SELECT COUNT(DISTINCT eid) FROM Certificate </s> |
<s> [INST] <<SYS>> You are a powerful text-to-SQL model. Your job is to answer questions about a database. You are given a question and context regarding one or more tables. You must output the SQL query that answers the question. <</SYS>>
### Input:
Show ids for all employees who don't have a certificate.
### Context:
CREATE TABLE Employee (eid VARCHAR); CREATE TABLE Certificate (eid VARCHAR) [/INST]
### Response:
SELECT eid FROM Employee EXCEPT SELECT eid FROM Certificate </s> |
<s> [INST] <<SYS>> You are a powerful text-to-SQL model. Your job is to answer questions about a database. You are given a question and context regarding one or more tables. You must output the SQL query that answers the question. <</SYS>>
### Input:
Show names for all aircrafts of which John Williams has certificates.
### Context:
CREATE TABLE Aircraft (name VARCHAR, aid VARCHAR); CREATE TABLE Employee (eid VARCHAR, name VARCHAR); CREATE TABLE Certificate (eid VARCHAR, aid VARCHAR) [/INST]
### Response:
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" </s> |
<s> [INST] <<SYS>> You are a powerful text-to-SQL model. Your job is to answer questions about a database. You are given a question and context regarding one or more tables. You must output the SQL query that answers the question. <</SYS>>
### Input:
Show names for all employees who have certificate of Boeing 737-800.
### Context:
CREATE TABLE Employee (name VARCHAR, eid VARCHAR); CREATE TABLE Certificate (eid VARCHAR, aid VARCHAR); CREATE TABLE Aircraft (aid VARCHAR, name VARCHAR) [/INST]
### Response:
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" </s> |
<s> [INST] <<SYS>> You are a powerful text-to-SQL model. Your job is to answer questions about a database. You are given a question and context regarding one or more tables. You must output the SQL query that answers the question. <</SYS>>
### Input:
Show names for all employees who have certificates on both Boeing 737-800 and Airbus A340-300.
### Context:
CREATE TABLE Employee (name VARCHAR, eid VARCHAR); CREATE TABLE Certificate (eid VARCHAR, aid VARCHAR); CREATE TABLE Aircraft (aid VARCHAR, name VARCHAR) [/INST]
### Response:
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" </s> |
<s> [INST] <<SYS>> You are a powerful text-to-SQL model. Your job is to answer questions about a database. You are given a question and context regarding one or more tables. You must output the SQL query that answers the question. <</SYS>>
### Input:
Show names for all employees who do not have certificate of Boeing 737-800.
### Context:
CREATE TABLE Certificate (eid VARCHAR, aid VARCHAR); CREATE TABLE Employee (name VARCHAR, eid VARCHAR); CREATE TABLE Employee (name VARCHAR); CREATE TABLE Aircraft (aid VARCHAR, name VARCHAR) [/INST]
### Response:
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" </s> |
<s> [INST] <<SYS>> You are a powerful text-to-SQL model. Your job is to answer questions about a database. You are given a question and context regarding one or more tables. You must output the SQL query that answers the question. <</SYS>>
### Input:
Show the name of aircraft which fewest people have its certificate.
### Context:
CREATE TABLE Certificate (aid VARCHAR); CREATE TABLE Aircraft (name VARCHAR, aid VARCHAR) [/INST]
### Response:
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 </s> |
<s> [INST] <<SYS>> You are a powerful text-to-SQL model. Your job is to answer questions about a database. You are given a question and context regarding one or more tables. You must output the SQL query that answers the question. <</SYS>>
### Input:
Show the name and distance of the aircrafts with more than 5000 distance and which at least 5 people have its certificate.
### Context:
CREATE TABLE Certificate (aid VARCHAR); CREATE TABLE Aircraft (name VARCHAR, aid VARCHAR, distance INTEGER) [/INST]
### Response:
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 </s> |
<s> [INST] <<SYS>> You are a powerful text-to-SQL model. Your job is to answer questions about a database. You are given a question and context regarding one or more tables. You must output the SQL query that answers the question. <</SYS>>
### Input:
what is the salary and name of the employee who has the most number of aircraft certificates?
### Context:
CREATE TABLE Certificate (eid VARCHAR); CREATE TABLE Employee (name VARCHAR, salary VARCHAR, eid VARCHAR) [/INST]
### Response:
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 </s> |
<s> [INST] <<SYS>> You are a powerful text-to-SQL model. Your job is to answer questions about a database. You are given a question and context regarding one or more tables. You must output the SQL query that answers the question. <</SYS>>
### Input:
What is the salary and name of the employee who has the most number of certificates on aircrafts with distance more than 5000?
### Context:
CREATE TABLE Aircraft (aid VARCHAR, distance INTEGER); CREATE TABLE Employee (name VARCHAR, eid VARCHAR); CREATE TABLE Certificate (eid VARCHAR, aid VARCHAR) [/INST]
### Response:
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 </s> |
<s> [INST] <<SYS>> You are a powerful text-to-SQL model. Your job is to answer questions about a database. You are given a question and context regarding one or more tables. You must output the SQL query that answers the question. <</SYS>>
### Input:
How many allergies are there?
### Context:
CREATE TABLE Allergy_type (allergy VARCHAR) [/INST]
### Response:
SELECT COUNT(DISTINCT allergy) FROM Allergy_type </s> |
<s> [INST] <<SYS>> You are a powerful text-to-SQL model. Your job is to answer questions about a database. You are given a question and context regarding one or more tables. You must output the SQL query that answers the question. <</SYS>>
### Input:
How many different allergy types exist?
### Context:
CREATE TABLE Allergy_type (allergytype VARCHAR) [/INST]
### Response:
SELECT COUNT(DISTINCT allergytype) FROM Allergy_type </s> |
<s> [INST] <<SYS>> You are a powerful text-to-SQL model. Your job is to answer questions about a database. You are given a question and context regarding one or more tables. You must output the SQL query that answers the question. <</SYS>>
### Input:
Show all allergy types.
### Context:
CREATE TABLE Allergy_type (allergytype VARCHAR) [/INST]
### Response:
SELECT DISTINCT allergytype FROM Allergy_type </s> |
<s> [INST] <<SYS>> You are a powerful text-to-SQL model. Your job is to answer questions about a database. You are given a question and context regarding one or more tables. You must output the SQL query that answers the question. <</SYS>>
### Input:
Show all allergies and their types.
### Context:
CREATE TABLE Allergy_type (allergy VARCHAR, allergytype VARCHAR) [/INST]
### Response:
SELECT allergy, allergytype FROM Allergy_type </s> |
<s> [INST] <<SYS>> You are a powerful text-to-SQL model. Your job is to answer questions about a database. You are given a question and context regarding one or more tables. You must output the SQL query that answers the question. <</SYS>>
### Input:
Show all allergies with type food.
### Context:
CREATE TABLE Allergy_type (allergy VARCHAR, allergytype VARCHAR) [/INST]
### Response:
SELECT DISTINCT allergy FROM Allergy_type WHERE allergytype = "food" </s> |
<s> [INST] <<SYS>> You are a powerful text-to-SQL model. Your job is to answer questions about a database. You are given a question and context regarding one or more tables. You must output the SQL query that answers the question. <</SYS>>
### Input:
What is the type of allergy Cat?
### Context:
CREATE TABLE Allergy_type (allergytype VARCHAR, allergy VARCHAR) [/INST]
### Response:
SELECT allergytype FROM Allergy_type WHERE allergy = "Cat" </s> |
<s> [INST] <<SYS>> You are a powerful text-to-SQL model. Your job is to answer questions about a database. You are given a question and context regarding one or more tables. You must output the SQL query that answers the question. <</SYS>>
### Input:
How many allergies have type animal?
### Context:
CREATE TABLE Allergy_type (allergytype VARCHAR) [/INST]
### Response:
SELECT COUNT(*) FROM Allergy_type WHERE allergytype = "animal" </s> |
<s> [INST] <<SYS>> You are a powerful text-to-SQL model. Your job is to answer questions about a database. You are given a question and context regarding one or more tables. You must output the SQL query that answers the question. <</SYS>>
### Input:
Show all allergy types and the number of allergies in each type.
### Context:
CREATE TABLE Allergy_type (allergytype VARCHAR) [/INST]
### Response:
SELECT allergytype, COUNT(*) FROM Allergy_type GROUP BY allergytype </s> |
<s> [INST] <<SYS>> You are a powerful text-to-SQL model. Your job is to answer questions about a database. You are given a question and context regarding one or more tables. You must output the SQL query that answers the question. <</SYS>>
### Input:
Which allergy type has most number of allergies?
### Context:
CREATE TABLE Allergy_type (allergytype VARCHAR) [/INST]
### Response:
SELECT allergytype FROM Allergy_type GROUP BY allergytype ORDER BY COUNT(*) DESC LIMIT 1 </s> |
<s> [INST] <<SYS>> You are a powerful text-to-SQL model. Your job is to answer questions about a database. You are given a question and context regarding one or more tables. You must output the SQL query that answers the question. <</SYS>>
### Input:
Which allergy type has least number of allergies?
### Context:
CREATE TABLE Allergy_type (allergytype VARCHAR) [/INST]
### Response:
SELECT allergytype FROM Allergy_type GROUP BY allergytype ORDER BY COUNT(*) LIMIT 1 </s> |
<s> [INST] <<SYS>> You are a powerful text-to-SQL model. Your job is to answer questions about a database. You are given a question and context regarding one or more tables. You must output the SQL query that answers the question. <</SYS>>
### Input:
How many students are there?
### Context:
CREATE TABLE Student (Id VARCHAR) [/INST]
### Response:
SELECT COUNT(*) FROM Student </s> |
<s> [INST] <<SYS>> You are a powerful text-to-SQL model. Your job is to answer questions about a database. You are given a question and context regarding one or more tables. You must output the SQL query that answers the question. <</SYS>>
### Input:
Show first name and last name for all students.
### Context:
CREATE TABLE Student (Fname VARCHAR, Lname VARCHAR) [/INST]
### Response:
SELECT Fname, Lname FROM Student </s> |
<s> [INST] <<SYS>> You are a powerful text-to-SQL model. Your job is to answer questions about a database. You are given a question and context regarding one or more tables. You must output the SQL query that answers the question. <</SYS>>
### Input:
How many different advisors are listed?
### Context:
CREATE TABLE Student (advisor VARCHAR) [/INST]
### Response:
SELECT COUNT(DISTINCT advisor) FROM Student </s> |
<s> [INST] <<SYS>> You are a powerful text-to-SQL model. Your job is to answer questions about a database. You are given a question and context regarding one or more tables. You must output the SQL query that answers the question. <</SYS>>
### Input:
Show all majors.
### Context:
CREATE TABLE Student (Major VARCHAR) [/INST]
### Response:
SELECT DISTINCT Major FROM Student </s> |
<s> [INST] <<SYS>> You are a powerful text-to-SQL model. Your job is to answer questions about a database. You are given a question and context regarding one or more tables. You must output the SQL query that answers the question. <</SYS>>
### Input:
Show all cities where students live.
### Context:
CREATE TABLE Student (city_code VARCHAR) [/INST]
### Response:
SELECT DISTINCT city_code FROM Student </s> |
<s> [INST] <<SYS>> You are a powerful text-to-SQL model. Your job is to answer questions about a database. You are given a question and context regarding one or more tables. You must output the SQL query that answers the question. <</SYS>>
### Input:
Show first name, last name, age for all female students. Their sex is F.
### Context:
CREATE TABLE Student (Fname VARCHAR, Lname VARCHAR, Age VARCHAR, Sex VARCHAR) [/INST]
### Response:
SELECT Fname, Lname, Age FROM Student WHERE Sex = 'F' </s> |
<s> [INST] <<SYS>> You are a powerful text-to-SQL model. Your job is to answer questions about a database. You are given a question and context regarding one or more tables. You must output the SQL query that answers the question. <</SYS>>
### Input:
Show student ids for all male students.
### Context:
CREATE TABLE Student (StuID VARCHAR, Sex VARCHAR) [/INST]
### Response:
SELECT StuID FROM Student WHERE Sex = 'M' </s> |
<s> [INST] <<SYS>> You are a powerful text-to-SQL model. Your job is to answer questions about a database. You are given a question and context regarding one or more tables. You must output the SQL query that answers the question. <</SYS>>
### Input:
How many students are age 18?
### Context:
CREATE TABLE Student (age VARCHAR) [/INST]
### Response:
SELECT COUNT(*) FROM Student WHERE age = 18 </s> |
<s> [INST] <<SYS>> You are a powerful text-to-SQL model. Your job is to answer questions about a database. You are given a question and context regarding one or more tables. You must output the SQL query that answers the question. <</SYS>>
### Input:
Show all student ids who are older than 20.
### Context:
CREATE TABLE Student (StuID VARCHAR, age INTEGER) [/INST]
### Response:
SELECT StuID FROM Student WHERE age > 20 </s> |
<s> [INST] <<SYS>> You are a powerful text-to-SQL model. Your job is to answer questions about a database. You are given a question and context regarding one or more tables. You must output the SQL query that answers the question. <</SYS>>
### Input:
Which city does the student whose last name is "Kim" live in?
### Context:
CREATE TABLE Student (city_code VARCHAR, LName VARCHAR) [/INST]
### Response:
SELECT city_code FROM Student WHERE LName = "Kim" </s> |
<s> [INST] <<SYS>> You are a powerful text-to-SQL model. Your job is to answer questions about a database. You are given a question and context regarding one or more tables. You must output the SQL query that answers the question. <</SYS>>
### Input:
Who is the advisor of student with ID 1004?
### Context:
CREATE TABLE Student (Advisor VARCHAR, StuID VARCHAR) [/INST]
### Response:
SELECT Advisor FROM Student WHERE StuID = 1004 </s> |
<s> [INST] <<SYS>> You are a powerful text-to-SQL model. Your job is to answer questions about a database. You are given a question and context regarding one or more tables. You must output the SQL query that answers the question. <</SYS>>
### Input:
How many students live in HKG or CHI?
### Context:
CREATE TABLE Student (city_code VARCHAR) [/INST]
### Response:
SELECT COUNT(*) FROM Student WHERE city_code = "HKG" OR city_code = "CHI" </s> |
<s> [INST] <<SYS>> You are a powerful text-to-SQL model. Your job is to answer questions about a database. You are given a question and context regarding one or more tables. You must output the SQL query that answers the question. <</SYS>>
### Input:
Show the minimum, average, and maximum age of all students.
### Context:
CREATE TABLE Student (age INTEGER) [/INST]
### Response:
SELECT MIN(age), AVG(age), MAX(age) FROM Student </s> |
<s> [INST] <<SYS>> You are a powerful text-to-SQL model. Your job is to answer questions about a database. You are given a question and context regarding one or more tables. You must output the SQL query that answers the question. <</SYS>>
### Input:
What is the last name of the youngest student?
### Context:
CREATE TABLE Student (LName VARCHAR, age INTEGER) [/INST]
### Response:
SELECT LName FROM Student WHERE age = (SELECT MIN(age) FROM Student) </s> |
<s> [INST] <<SYS>> You are a powerful text-to-SQL model. Your job is to answer questions about a database. You are given a question and context regarding one or more tables. You must output the SQL query that answers the question. <</SYS>>
### Input:
Show the student id of the oldest student.
### Context:
CREATE TABLE Student (StuID VARCHAR, age INTEGER) [/INST]
### Response:
SELECT StuID FROM Student WHERE age = (SELECT MAX(age) FROM Student) </s> |
<s> [INST] <<SYS>> You are a powerful text-to-SQL model. Your job is to answer questions about a database. You are given a question and context regarding one or more tables. You must output the SQL query that answers the question. <</SYS>>
### Input:
Show all majors and corresponding number of students.
### Context:
CREATE TABLE Student (major VARCHAR) [/INST]
### Response:
SELECT major, COUNT(*) FROM Student GROUP BY major </s> |
<s> [INST] <<SYS>> You are a powerful text-to-SQL model. Your job is to answer questions about a database. You are given a question and context regarding one or more tables. You must output the SQL query that answers the question. <</SYS>>
### Input:
Which major has most number of students?
### Context:
CREATE TABLE Student (major VARCHAR) [/INST]
### Response:
SELECT major FROM Student GROUP BY major ORDER BY COUNT(*) DESC LIMIT 1 </s> |
<s> [INST] <<SYS>> You are a powerful text-to-SQL model. Your job is to answer questions about a database. You are given a question and context regarding one or more tables. You must output the SQL query that answers the question. <</SYS>>
### Input:
Show all ages and corresponding number of students.
### Context:
CREATE TABLE Student (age VARCHAR) [/INST]
### Response:
SELECT age, COUNT(*) FROM Student GROUP BY age </s> |
<s> [INST] <<SYS>> You are a powerful text-to-SQL model. Your job is to answer questions about a database. You are given a question and context regarding one or more tables. You must output the SQL query that answers the question. <</SYS>>
### Input:
Show the average age for male and female students.
### Context:
CREATE TABLE Student (sex VARCHAR, age INTEGER) [/INST]
### Response:
SELECT AVG(age), sex FROM Student GROUP BY sex </s> |
<s> [INST] <<SYS>> You are a powerful text-to-SQL model. Your job is to answer questions about a database. You are given a question and context regarding one or more tables. You must output the SQL query that answers the question. <</SYS>>
### Input:
Show all cities and corresponding number of students.
### Context:
CREATE TABLE Student (city_code VARCHAR) [/INST]
### Response:
SELECT city_code, COUNT(*) FROM Student GROUP BY city_code </s> |
<s> [INST] <<SYS>> You are a powerful text-to-SQL model. Your job is to answer questions about a database. You are given a question and context regarding one or more tables. You must output the SQL query that answers the question. <</SYS>>
### Input:
Show all advisors and corresponding number of students.
### Context:
CREATE TABLE Student (advisor VARCHAR) [/INST]
### Response:
SELECT advisor, COUNT(*) FROM Student GROUP BY advisor </s> |
<s> [INST] <<SYS>> You are a powerful text-to-SQL model. Your job is to answer questions about a database. You are given a question and context regarding one or more tables. You must output the SQL query that answers the question. <</SYS>>
### Input:
Which advisor has most number of students?
### Context:
CREATE TABLE Student (advisor VARCHAR) [/INST]
### Response:
SELECT advisor FROM Student GROUP BY advisor ORDER BY COUNT(*) DESC LIMIT 1 </s> |
<s> [INST] <<SYS>> You are a powerful text-to-SQL model. Your job is to answer questions about a database. You are given a question and context regarding one or more tables. You must output the SQL query that answers the question. <</SYS>>
### Input:
How many students have cat allergies?
### Context:
CREATE TABLE Has_allergy (Allergy VARCHAR) [/INST]
### Response:
SELECT COUNT(*) FROM Has_allergy WHERE Allergy = "Cat" </s> |
<s> [INST] <<SYS>> You are a powerful text-to-SQL model. Your job is to answer questions about a database. You are given a question and context regarding one or more tables. You must output the SQL query that answers the question. <</SYS>>
### Input:
Show all student IDs who have at least two allergies.
### Context:
CREATE TABLE Has_allergy (StuID VARCHAR) [/INST]
### Response:
SELECT StuID FROM Has_allergy GROUP BY StuID HAVING COUNT(*) >= 2 </s> |
<s> [INST] <<SYS>> You are a powerful text-to-SQL model. Your job is to answer questions about a database. You are given a question and context regarding one or more tables. You must output the SQL query that answers the question. <</SYS>>
### Input:
What are the student ids of students who don't have any allergies?
### Context:
CREATE TABLE Has_allergy (StuID VARCHAR); CREATE TABLE Student (StuID VARCHAR) [/INST]
### Response:
SELECT StuID FROM Student EXCEPT SELECT StuID FROM Has_allergy </s> |
<s> [INST] <<SYS>> You are a powerful text-to-SQL model. Your job is to answer questions about a database. You are given a question and context regarding one or more tables. You must output the SQL query that answers the question. <</SYS>>
### Input:
How many female students have milk or egg allergies?
### Context:
CREATE TABLE Student (StuID VARCHAR, sex VARCHAR); CREATE TABLE has_allergy (StuID VARCHAR, allergy VARCHAR) [/INST]
### Response:
SELECT COUNT(*) FROM has_allergy AS T1 JOIN Student AS T2 ON T1.StuID = T2.StuID WHERE T2.sex = "F" AND T1.allergy = "Milk" OR T1.allergy = "Eggs" </s> |
<s> [INST] <<SYS>> You are a powerful text-to-SQL model. Your job is to answer questions about a database. You are given a question and context regarding one or more tables. You must output the SQL query that answers the question. <</SYS>>
### Input:
How many students have a food allergy?
### Context:
CREATE TABLE Has_allergy (allergy VARCHAR); CREATE TABLE Allergy_type (allergy VARCHAR, allergytype VARCHAR) [/INST]
### Response:
SELECT COUNT(*) FROM Has_allergy AS T1 JOIN Allergy_type AS T2 ON T1.allergy = T2.allergy WHERE T2.allergytype = "food" </s> |
<s> [INST] <<SYS>> You are a powerful text-to-SQL model. Your job is to answer questions about a database. You are given a question and context regarding one or more tables. You must output the SQL query that answers the question. <</SYS>>
### Input:
Which allergy has most number of students affected?
### Context:
CREATE TABLE Has_allergy (Allergy VARCHAR) [/INST]
### Response:
SELECT Allergy FROM Has_allergy GROUP BY Allergy ORDER BY COUNT(*) DESC LIMIT 1 </s> |
<s> [INST] <<SYS>> You are a powerful text-to-SQL model. Your job is to answer questions about a database. You are given a question and context regarding one or more tables. You must output the SQL query that answers the question. <</SYS>>
### Input:
Show all allergies with number of students affected.
### Context:
CREATE TABLE Has_allergy (Allergy VARCHAR) [/INST]
### Response:
SELECT Allergy, COUNT(*) FROM Has_allergy GROUP BY Allergy </s> |
<s> [INST] <<SYS>> You are a powerful text-to-SQL model. Your job is to answer questions about a database. You are given a question and context regarding one or more tables. You must output the SQL query that answers the question. <</SYS>>
### Input:
Show all allergy type with number of students affected.
### Context:
CREATE TABLE Has_allergy (allergy VARCHAR); CREATE TABLE Allergy_type (allergytype VARCHAR, allergy VARCHAR) [/INST]
### Response:
SELECT T2.allergytype, COUNT(*) FROM Has_allergy AS T1 JOIN Allergy_type AS T2 ON T1.allergy = T2.allergy GROUP BY T2.allergytype </s> |
<s> [INST] <<SYS>> You are a powerful text-to-SQL model. Your job is to answer questions about a database. You are given a question and context regarding one or more tables. You must output the SQL query that answers the question. <</SYS>>
### Input:
Find the last name and age of the student who has allergy to both milk and cat.
### Context:
CREATE TABLE Has_allergy (lname VARCHAR, age VARCHAR, StuID VARCHAR, Allergy VARCHAR); CREATE TABLE Student (lname VARCHAR, age VARCHAR, StuID VARCHAR, Allergy VARCHAR) [/INST]
### Response:
SELECT lname, age FROM Student WHERE StuID IN (SELECT StuID FROM Has_allergy WHERE Allergy = "Milk" INTERSECT SELECT StuID FROM Has_allergy WHERE Allergy = "Cat") </s> |
<s> [INST] <<SYS>> You are a powerful text-to-SQL model. Your job is to answer questions about a database. You are given a question and context regarding one or more tables. You must output the SQL query that answers the question. <</SYS>>
### Input:
What are the allergies and their types that the student with first name Lisa has? And order the result by name of allergies.
### Context:
CREATE TABLE Has_allergy (Allergy VARCHAR, StuID VARCHAR); CREATE TABLE Student (StuID VARCHAR, Fname VARCHAR); CREATE TABLE Allergy_type (Allergy VARCHAR, AllergyType VARCHAR) [/INST]
### Response:
SELECT T1.Allergy, T1.AllergyType FROM Allergy_type AS T1 JOIN Has_allergy AS T2 ON T1.Allergy = T2.Allergy JOIN Student AS T3 ON T3.StuID = T2.StuID WHERE T3.Fname = "Lisa" ORDER BY T1.Allergy </s> |
<s> [INST] <<SYS>> You are a powerful text-to-SQL model. Your job is to answer questions about a database. You are given a question and context regarding one or more tables. You must output the SQL query that answers the question. <</SYS>>
### Input:
Find the first name and gender of the student who has allergy to milk but not cat.
### Context:
CREATE TABLE Student (fname VARCHAR, sex VARCHAR, StuID VARCHAR, Allergy VARCHAR); CREATE TABLE Has_allergy (fname VARCHAR, sex VARCHAR, StuID VARCHAR, Allergy VARCHAR) [/INST]
### Response:
SELECT fname, sex FROM Student WHERE StuID IN (SELECT StuID FROM Has_allergy WHERE Allergy = "Milk" EXCEPT SELECT StuID FROM Has_allergy WHERE Allergy = "Cat") </s> |
<s> [INST] <<SYS>> You are a powerful text-to-SQL model. Your job is to answer questions about a database. You are given a question and context regarding one or more tables. You must output the SQL query that answers the question. <</SYS>>
### Input:
Find the average age of the students who have allergies with food and animal types.
### Context:
CREATE TABLE Student (age INTEGER, StuID VARCHAR); CREATE TABLE Allergy_Type (Allergy VARCHAR, allergytype VARCHAR); CREATE TABLE Has_allergy (StuID VARCHAR, Allergy VARCHAR) [/INST]
### Response:
SELECT AVG(age) FROM Student WHERE StuID IN (SELECT T1.StuID FROM Has_allergy AS T1 JOIN Allergy_Type AS T2 ON T1.Allergy = T2.Allergy WHERE T2.allergytype = "food" INTERSECT SELECT T1.StuID FROM Has_allergy AS T1 JOIN Allergy_Type AS T2 ON T1.Allergy = T2.Allergy WHERE T2.allergytype = "animal") </s> |
<s> [INST] <<SYS>> You are a powerful text-to-SQL model. Your job is to answer questions about a database. You are given a question and context regarding one or more tables. You must output the SQL query that answers the question. <</SYS>>
### Input:
List the first and last name of the students who do not have any food type allergy.
### Context:
CREATE TABLE Student (fname VARCHAR, lname VARCHAR, StuID VARCHAR); CREATE TABLE Allergy_Type (Allergy VARCHAR, allergytype VARCHAR); CREATE TABLE Has_allergy (StuID VARCHAR, Allergy VARCHAR) [/INST]
### Response:
SELECT fname, lname FROM Student WHERE NOT StuID IN (SELECT T1.StuID FROM Has_allergy AS T1 JOIN Allergy_Type AS T2 ON T1.Allergy = T2.Allergy WHERE T2.allergytype = "food") </s> |
<s> [INST] <<SYS>> You are a powerful text-to-SQL model. Your job is to answer questions about a database. You are given a question and context regarding one or more tables. You must output the SQL query that answers the question. <</SYS>>
### Input:
Find the number of male (sex is 'M') students who have some food type allery.
### Context:
CREATE TABLE Has_allergy (Allergy VARCHAR); CREATE TABLE Allergy_Type (Allergy VARCHAR, allergytype VARCHAR); CREATE TABLE Student (sex VARCHAR, StuID VARCHAR) [/INST]
### Response:
SELECT COUNT(*) FROM Student WHERE sex = "M" AND StuID IN (SELECT StuID FROM Has_allergy AS T1 JOIN Allergy_Type AS T2 ON T1.Allergy = T2.Allergy WHERE T2.allergytype = "food") </s> |
<s> [INST] <<SYS>> You are a powerful text-to-SQL model. Your job is to answer questions about a database. You are given a question and context regarding one or more tables. You must output the SQL query that answers the question. <</SYS>>
### Input:
Find the different first names and cities of the students who have allergy to milk or cat.
### Context:
CREATE TABLE Has_Allergy (stuid VARCHAR, Allergy VARCHAR); CREATE TABLE Student (fname VARCHAR, city_code VARCHAR, stuid VARCHAR) [/INST]
### Response:
SELECT DISTINCT T1.fname, T1.city_code FROM Student AS T1 JOIN Has_Allergy AS T2 ON T1.stuid = T2.stuid WHERE T2.Allergy = "Milk" OR T2.Allergy = "Cat" </s> |
<s> [INST] <<SYS>> You are a powerful text-to-SQL model. Your job is to answer questions about a database. You are given a question and context regarding one or more tables. You must output the SQL query that answers the question. <</SYS>>
### Input:
Find the number of students who are older than 18 and do not have allergy to either food or animal.
### Context:
CREATE TABLE Allergy_Type (Allergy VARCHAR, allergytype VARCHAR); CREATE TABLE Has_allergy (Allergy VARCHAR); CREATE TABLE Student (age VARCHAR, StuID VARCHAR) [/INST]
### Response:
SELECT COUNT(*) FROM Student WHERE age > 18 AND NOT StuID IN (SELECT StuID FROM Has_allergy AS T1 JOIN Allergy_Type AS T2 ON T1.Allergy = T2.Allergy WHERE T2.allergytype = "food" OR T2.allergytype = "animal") </s> |
<s> [INST] <<SYS>> You are a powerful text-to-SQL model. Your job is to answer questions about a database. You are given a question and context regarding one or more tables. You must output the SQL query that answers the question. <</SYS>>
### Input:
Find the first name and major of the students who are not allegry to soy.
### Context:
CREATE TABLE Has_allergy (fname VARCHAR, major VARCHAR, StuID VARCHAR, Allergy VARCHAR); CREATE TABLE Student (fname VARCHAR, major VARCHAR, StuID VARCHAR, Allergy VARCHAR) [/INST]
### Response:
SELECT fname, major FROM Student WHERE NOT StuID IN (SELECT StuID FROM Has_allergy WHERE Allergy = "Soy") </s> |