Unnamed: 0
int64
0
78.6k
answer
stringlengths
18
557
question
stringlengths
12
244
context
stringlengths
27
489
translated_answer
stringlengths
12
992
200
SELECT date_of_latest_revision FROM Catalogs GROUP BY date_of_latest_revision HAVING COUNT(*) > 1
Find the dates on which more than one revisions were made.
CREATE TABLE Catalogs (date_of_latest_revision VARCHAR)
Encontre as datas em que mais de uma revisão foi feita.
201
SELECT COUNT(*) FROM catalog_contents
How many products are there in the records?
CREATE TABLE catalog_contents (Id VARCHAR)
Quantos produtos existem nos registros?
202
SELECT catalog_entry_name FROM catalog_contents WHERE next_entry_id > 8
Name all the products with next entry ID greater than 8.
CREATE TABLE catalog_contents (catalog_entry_name VARCHAR, next_entry_id INTEGER)
Nomeie todos os produtos com o próximo ID de entrada maior que 8.
203
SELECT COUNT(*) FROM Aircraft
How many aircrafts do we have?
CREATE TABLE Aircraft (Id VARCHAR)
Quantos aviões temos?
204
SELECT name, distance FROM Aircraft
Show name and distance for all aircrafts.
CREATE TABLE Aircraft (name VARCHAR, distance VARCHAR)
Mostrar nome e distância para todas as aeronaves.
205
SELECT aid FROM Aircraft WHERE distance > 1000
Show ids for all aircrafts with more than 1000 distance.
CREATE TABLE Aircraft (aid VARCHAR, distance INTEGER)
Mostrar IDs para todas as aeronaves com mais de 1000 distâncias.
206
SELECT COUNT(*) FROM Aircraft WHERE distance BETWEEN 1000 AND 5000
How many aircrafts have distance between 1000 and 5000?
CREATE TABLE Aircraft (distance INTEGER)
Quantas aeronaves têm distância entre 1000 e 5000?
207
SELECT name, distance FROM Aircraft WHERE aid = 12
What is the name and distance for aircraft with id 12?
CREATE TABLE Aircraft (name VARCHAR, distance VARCHAR, aid VARCHAR)
Qual é o nome e a distância para aeronaves com id 12?
208
SELECT MIN(distance), AVG(distance), MAX(distance) FROM Aircraft
What is the minimum, average, and maximum distance of all aircrafts.
CREATE TABLE Aircraft (distance INTEGER)
Qual é a distância mínima, média e máxima de todas as aeronaves?
209
SELECT aid, name FROM Aircraft ORDER BY distance DESC LIMIT 1
Show the id and name of the aircraft with the maximum distance.
CREATE TABLE Aircraft (aid VARCHAR, name VARCHAR, distance VARCHAR)
Mostre o ID e o nome da aeronave com a distância máxima.
210
SELECT name FROM Aircraft ORDER BY distance LIMIT 3
Show the name of aircrafts with top three lowest distances.
CREATE TABLE Aircraft (name VARCHAR, distance VARCHAR)
Mostre o nome das aeronaves com as três distâncias mais baixas.
211
SELECT name FROM Aircraft WHERE distance > (SELECT AVG(distance) FROM Aircraft)
Show names for all aircrafts with distances more than the average.
CREATE TABLE Aircraft (name VARCHAR, distance INTEGER)
Mostrar nomes para todas as aeronaves com distâncias superiores à média.
212
SELECT COUNT(*) FROM Employee
How many employees do we have?
CREATE TABLE Employee (Id VARCHAR)
Quantos funcionários temos?
213
SELECT name, salary FROM Employee ORDER BY salary
Show name and salary for all employees sorted by salary.
CREATE TABLE Employee (name VARCHAR, salary VARCHAR)
Mostrar nome e salário para todos os funcionários classificados por salário.
214
SELECT eid FROM Employee WHERE salary > 100000
Show ids for all employees with at least 100000 salary.
CREATE TABLE Employee (eid VARCHAR, salary INTEGER)
Mostre IDs para todos os funcionários com pelo menos 100 mil salários.
215
SELECT COUNT(*) FROM Employee WHERE salary BETWEEN 100000 AND 200000
How many employees have salary between 100000 and 200000?
CREATE TABLE Employee (salary INTEGER)
Quantos funcionários têm salário entre 100000 e 200000?
216
SELECT name, salary FROM Employee WHERE eid = 242518965
What is the name and salary for employee with id 242518965?
CREATE TABLE Employee (name VARCHAR, salary VARCHAR, eid VARCHAR)
Qual é o nome e o salário do funcionário com a identificação 242518965?
217
SELECT AVG(salary), MAX(salary) FROM Employee
What is average and maximum salary of all employees.
CREATE TABLE Employee (salary INTEGER)
O que é salário médio e máximo de todos os funcionários.
218
SELECT eid, name FROM Employee ORDER BY salary DESC LIMIT 1
Show the id and name of the employee with maximum salary.
CREATE TABLE Employee (eid VARCHAR, name VARCHAR, salary VARCHAR)
Mostre o ID e o nome do funcionário com salário máximo.
219
SELECT name FROM Employee ORDER BY salary LIMIT 3
Show the name of employees with three lowest salaries.
CREATE TABLE Employee (name VARCHAR, salary VARCHAR)
Mostre o nome dos funcionários com três salários mais baixos.
220
SELECT name FROM Employee WHERE salary > (SELECT AVG(salary) FROM Employee)
Show names for all employees with salary more than the average.
CREATE TABLE Employee (name VARCHAR, salary INTEGER)
Mostre nomes para todos os funcionários com salário mais do que a média.
221
SELECT eid, salary FROM Employee WHERE name = 'Mark Young'
Show the id and salary of Mark Young.
CREATE TABLE Employee (eid VARCHAR, salary VARCHAR, name VARCHAR)
Mostre a identidade e o salário de Mark Young.
222
SELECT COUNT(*) FROM Flight
How many flights do we have?
CREATE TABLE Flight (Id VARCHAR)
Quantos voos temos?
223
SELECT flno, origin, destination FROM Flight ORDER BY origin
Show flight number, origin, destination of all flights in the alphabetical order of the departure cities.
CREATE TABLE Flight (flno VARCHAR, origin VARCHAR, destination VARCHAR)
Mostrar o número do voo, origem, destino de todos os voos na ordem alfabética das cidades de partida.
224
SELECT flno FROM Flight WHERE origin = "Los Angeles"
Show all flight number from Los Angeles.
CREATE TABLE Flight (flno VARCHAR, origin VARCHAR)
Mostrar todo o número de voo de Los Angeles.
225
SELECT origin FROM Flight WHERE destination = "Honolulu"
Show origins of all flights with destination Honolulu.
CREATE TABLE Flight (origin VARCHAR, destination VARCHAR)
Mostrar as origens de todos os voos com destino Honolulu.
226
SELECT departure_date, arrival_date FROM Flight WHERE origin = "Los Angeles" AND destination = "Honolulu"
Show me the departure date and arrival date for all flights from Los Angeles to Honolulu.
CREATE TABLE Flight (departure_date VARCHAR, arrival_date VARCHAR, origin VARCHAR, destination VARCHAR)
Mostre-me a data de partida e a data de chegada de todos os voos de Los Angeles para Honolulu.
227
SELECT flno FROM Flight WHERE distance > 2000
Show flight number for all flights with more than 2000 distance.
CREATE TABLE Flight (flno VARCHAR, distance INTEGER)
Mostrar número de voo para todos os voos com mais de 2000 distâncias.
228
SELECT AVG(price) FROM Flight WHERE origin = "Los Angeles" AND destination = "Honolulu"
What is the average price for flights from Los Angeles to Honolulu.
CREATE TABLE Flight (price INTEGER, origin VARCHAR, destination VARCHAR)
Qual é o preço médio para voos de Porto para Honolulu.
229
SELECT origin, destination FROM Flight WHERE price > 300
Show origin and destination for flights with price higher than 300.
CREATE TABLE Flight (origin VARCHAR, destination VARCHAR, price INTEGER)
Mostrar origem e destino para voos com preço superior a 300.
230
SELECT flno, distance FROM Flight ORDER BY price DESC LIMIT 1
Show the flight number and distance of the flight with maximum price.
CREATE TABLE Flight (flno VARCHAR, distance VARCHAR, price VARCHAR)
Mostrar o número de voo e a distância do voo com o preço máximo.
231
SELECT flno FROM Flight ORDER BY distance LIMIT 3
Show the flight number of flights with three lowest distances.
CREATE TABLE Flight (flno VARCHAR, distance VARCHAR)
Mostre o número de voos com três distâncias mais baixas.
232
SELECT AVG(distance), AVG(price) FROM Flight WHERE origin = "Los Angeles"
What is the average distance and average price for flights from Los Angeles.
CREATE TABLE Flight (distance INTEGER, price INTEGER, origin VARCHAR)
Qual é a distância média e preço médio para voos de Los Angeles?
233
SELECT origin, COUNT(*) FROM Flight GROUP BY origin
Show all origins and the number of flights from each origin.
CREATE TABLE Flight (origin VARCHAR)
Mostre todas as origens e o número de voos de cada origem.
234
SELECT destination, COUNT(*) FROM Flight GROUP BY destination
Show all destinations and the number of flights to each destination.
CREATE TABLE Flight (destination VARCHAR)
Mostrar todos os destinos e o número de voos para cada destino.
235
SELECT origin FROM Flight GROUP BY origin ORDER BY COUNT(*) DESC LIMIT 1
Which origin has most number of flights?
CREATE TABLE Flight (origin VARCHAR)
Qual é a origem do maior número de voos?
236
SELECT destination FROM Flight GROUP BY destination ORDER BY COUNT(*) LIMIT 1
Which destination has least number of flights?
CREATE TABLE Flight (destination VARCHAR)
Qual destino tem o menor número de voos?
237
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
CREATE TABLE Flight (aid VARCHAR, flno VARCHAR); CREATE TABLE Aircraft (name VARCHAR, aid VARCHAR)
Qual é o nome da aeronave para o voo com o número 99
238
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.
CREATE TABLE Flight (flno VARCHAR, aid VARCHAR); CREATE TABLE Aircraft (aid VARCHAR, name VARCHAR)
Mostrar todos os números de voo com a aeronave Airbus A340-300.
239
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.
CREATE TABLE Aircraft (name VARCHAR, aid VARCHAR); CREATE TABLE Flight (aid VARCHAR)
Mostre os nomes das aeronaves e o número de voos para cada aeronave.
240
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.
CREATE TABLE Aircraft (name VARCHAR, aid VARCHAR); CREATE TABLE Flight (aid VARCHAR)
Mostrar nomes para todas as aeronaves com pelo menos dois voos.
241
SELECT COUNT(DISTINCT eid) FROM Certificate
How many employees have certificate.
CREATE TABLE Certificate (eid VARCHAR)
Quantos funcionários têm certificado?
242
SELECT eid FROM Employee EXCEPT SELECT eid FROM Certificate
Show ids for all employees who don't have a certificate.
CREATE TABLE Employee (eid VARCHAR); CREATE TABLE Certificate (eid VARCHAR)
Mostre IDs para todos os funcionários que não têm um certificado.
243
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.
CREATE TABLE Aircraft (name VARCHAR, aid VARCHAR); CREATE TABLE Employee (eid VARCHAR, name VARCHAR); CREATE TABLE Certificate (eid VARCHAR, aid VARCHAR)
Mostre nomes para todas as aeronaves das quais John Williams possui certificados.
244
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.
CREATE TABLE Employee (name VARCHAR, eid VARCHAR); CREATE TABLE Certificate (eid VARCHAR, aid VARCHAR); CREATE TABLE Aircraft (aid VARCHAR, name VARCHAR)
Mostrar nomes para todos os funcionários que têm certificado de Boeing 737-800.
245
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.
CREATE TABLE Employee (name VARCHAR, eid VARCHAR); CREATE TABLE Certificate (eid VARCHAR, aid VARCHAR); CREATE TABLE Aircraft (aid VARCHAR, name VARCHAR)
Mostrar nomes para todos os funcionários que têm certificados no Boeing 737-800 e Airbus A340-300.
246
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.
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)
Mostrar nomes para todos os funcionários que não têm certificado de Boeing 737-800.
247
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.
CREATE TABLE Certificate (aid VARCHAR); CREATE TABLE Aircraft (name VARCHAR, aid VARCHAR)
Mostre o nome da aeronave que menos pessoas têm seu certificado.
248
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.
CREATE TABLE Certificate (aid VARCHAR); CREATE TABLE Aircraft (name VARCHAR, aid VARCHAR, distance INTEGER)
Mostre o nome e a distância das aeronaves com mais de 5000 distâncias e que pelo menos 5 pessoas têm seu certificado.
249
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?
CREATE TABLE Certificate (eid VARCHAR); CREATE TABLE Employee (name VARCHAR, salary VARCHAR, eid VARCHAR)
Qual é o salário e o nome do funcionário que tem o maior número de certificados de aeronave?
250
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?
CREATE TABLE Aircraft (aid VARCHAR, distance INTEGER); CREATE TABLE Employee (name VARCHAR, eid VARCHAR); CREATE TABLE Certificate (eid VARCHAR, aid VARCHAR)
Qual é o salário e o nome do funcionário que tem o maior número de certificados em aeronaves com distância superior a 5000?
251
SELECT COUNT(DISTINCT allergy) FROM Allergy_type
How many allergies are there?
CREATE TABLE Allergy_type (allergy VARCHAR)
Quantas alergias existem?
252
SELECT COUNT(DISTINCT allergytype) FROM Allergy_type
How many different allergy types exist?
CREATE TABLE Allergy_type (allergytype VARCHAR)
Quantos tipos diferentes de alergia existem?
253
SELECT DISTINCT allergytype FROM Allergy_type
Show all allergy types.
CREATE TABLE Allergy_type (allergytype VARCHAR)
Mostrar todos os tipos de alergia.
254
SELECT allergy, allergytype FROM Allergy_type
Show all allergies and their types.
CREATE TABLE Allergy_type (allergy VARCHAR, allergytype VARCHAR)
Mostre todas as alergias e seus tipos.
255
SELECT DISTINCT allergy FROM Allergy_type WHERE allergytype = "food"
Show all allergies with type food.
CREATE TABLE Allergy_type (allergy VARCHAR, allergytype VARCHAR)
Mostre todas as alergias com o tipo de alimento.
256
SELECT allergytype FROM Allergy_type WHERE allergy = "Cat"
What is the type of allergy Cat?
CREATE TABLE Allergy_type (allergytype VARCHAR, allergy VARCHAR)
Qual é o tipo de alergia Cat?
257
SELECT COUNT(*) FROM Allergy_type WHERE allergytype = "animal"
How many allergies have type animal?
CREATE TABLE Allergy_type (allergytype VARCHAR)
Quantas alergias têm o tipo animal?
258
SELECT allergytype, COUNT(*) FROM Allergy_type GROUP BY allergytype
Show all allergy types and the number of allergies in each type.
CREATE TABLE Allergy_type (allergytype VARCHAR)
Mostre todos os tipos de alergia e o número de alergias em cada tipo.
259
SELECT allergytype FROM Allergy_type GROUP BY allergytype ORDER BY COUNT(*) DESC LIMIT 1
Which allergy type has most number of allergies?
CREATE TABLE Allergy_type (allergytype VARCHAR)
Que tipo de alergia tem o maior número de alergias?
260
SELECT allergytype FROM Allergy_type GROUP BY allergytype ORDER BY COUNT(*) LIMIT 1
Which allergy type has least number of allergies?
CREATE TABLE Allergy_type (allergytype VARCHAR)
Que tipo de alergia tem o menor número de alergias?
261
SELECT COUNT(*) FROM Student
How many students are there?
CREATE TABLE Student (Id VARCHAR)
Quantos alunos existem?
262
SELECT Fname, Lname FROM Student
Show first name and last name for all students.
CREATE TABLE Student (Fname VARCHAR, Lname VARCHAR)
Mostre o primeiro e o último nome para todos os alunos.
263
SELECT COUNT(DISTINCT advisor) FROM Student
How many different advisors are listed?
CREATE TABLE Student (advisor VARCHAR)
Quantos conselheiros diferentes estão listados?
264
SELECT DISTINCT Major FROM Student
Show all majors.
CREATE TABLE Student (Major VARCHAR)
Mostre todos os majors.
265
SELECT DISTINCT city_code FROM Student
Show all cities where students live.
CREATE TABLE Student (city_code VARCHAR)
Mostre todas as cidades onde os alunos vivem.
266
SELECT Fname, Lname, Age FROM Student WHERE Sex = 'F'
Show first name, last name, age for all female students. Their sex is F.
CREATE TABLE Student (Fname VARCHAR, Lname VARCHAR, Age VARCHAR, Sex VARCHAR)
Mostrar primeiro nome, sobrenome, idade para todas as estudantes do sexo feminino. Seu sexo é F.
267
SELECT StuID FROM Student WHERE Sex = 'M'
Show student ids for all male students.
CREATE TABLE Student (StuID VARCHAR, Sex VARCHAR)
Mostre IDs de estudantes para todos os estudantes do sexo masculino.
268
SELECT COUNT(*) FROM Student WHERE age = 18
How many students are age 18?
CREATE TABLE Student (age VARCHAR)
Quantos alunos têm 18 anos?
269
SELECT StuID FROM Student WHERE age > 20
Show all student ids who are older than 20.
CREATE TABLE Student (StuID VARCHAR, age INTEGER)
Mostre a todos os alunos com mais de 20 anos.
270
SELECT city_code FROM Student WHERE LName = "Kim"
Which city does the student whose last name is "Kim" live in?
CREATE TABLE Student (city_code VARCHAR, LName VARCHAR)
Em que cidade vive o estudante cujo sobrenome é "Kim"?
271
SELECT Advisor FROM Student WHERE StuID = 1004
Who is the advisor of student with ID 1004?
CREATE TABLE Student (Advisor VARCHAR, StuID VARCHAR)
Quem é o orientador do aluno com ID 1004?
272
SELECT COUNT(*) FROM Student WHERE city_code = "HKG" OR city_code = "CHI"
How many students live in HKG or CHI?
CREATE TABLE Student (city_code VARCHAR)
Quantos estudantes vivem em HKG ou CHI?
273
SELECT MIN(age), AVG(age), MAX(age) FROM Student
Show the minimum, average, and maximum age of all students.
CREATE TABLE Student (age INTEGER)
Mostre a idade mínima, média e máxima de todos os alunos.
274
SELECT LName FROM Student WHERE age = (SELECT MIN(age) FROM Student)
What is the last name of the youngest student?
CREATE TABLE Student (LName VARCHAR, age INTEGER)
Qual é o sobrenome do aluno mais novo?
275
SELECT StuID FROM Student WHERE age = (SELECT MAX(age) FROM Student)
Show the student id of the oldest student.
CREATE TABLE Student (StuID VARCHAR, age INTEGER)
Mostre o ID do aluno mais velho.
276
SELECT major, COUNT(*) FROM Student GROUP BY major
Show all majors and corresponding number of students.
CREATE TABLE Student (major VARCHAR)
Mostrar todos os majors e número correspondente de alunos.
277
SELECT major FROM Student GROUP BY major ORDER BY COUNT(*) DESC LIMIT 1
Which major has most number of students?
CREATE TABLE Student (major VARCHAR)
Qual é o maior número de alunos?
278
SELECT age, COUNT(*) FROM Student GROUP BY age
Show all ages and corresponding number of students.
CREATE TABLE Student (age VARCHAR)
Mostrar todas as idades e número correspondente de alunos.
279
SELECT AVG(age), sex FROM Student GROUP BY sex
Show the average age for male and female students.
CREATE TABLE Student (sex VARCHAR, age INTEGER)
Mostrar a idade média para estudantes do sexo masculino e feminino.
280
SELECT city_code, COUNT(*) FROM Student GROUP BY city_code
Show all cities and corresponding number of students.
CREATE TABLE Student (city_code VARCHAR)
Mostre todas as cidades e o número correspondente de alunos.
281
SELECT advisor, COUNT(*) FROM Student GROUP BY advisor
Show all advisors and corresponding number of students.
CREATE TABLE Student (advisor VARCHAR)
Mostre todos os conselheiros e o número correspondente de alunos.
282
SELECT advisor FROM Student GROUP BY advisor ORDER BY COUNT(*) DESC LIMIT 1
Which advisor has most number of students?
CREATE TABLE Student (advisor VARCHAR)
Qual é o conselheiro que tem o maior número de alunos?
283
SELECT COUNT(*) FROM Has_allergy WHERE Allergy = "Cat"
How many students have cat allergies?
CREATE TABLE Has_allergy (Allergy VARCHAR)
Quantos estudantes têm alergia a gatos?
284
SELECT StuID FROM Has_allergy GROUP BY StuID HAVING COUNT(*) >= 2
Show all student IDs who have at least two allergies.
CREATE TABLE Has_allergy (StuID VARCHAR)
Mostre todos os IDs dos alunos que têm pelo menos duas alergias.
285
SELECT StuID FROM Student EXCEPT SELECT StuID FROM Has_allergy
What are the student ids of students who don't have any allergies?
CREATE TABLE Has_allergy (StuID VARCHAR); CREATE TABLE Student (StuID VARCHAR)
Quais são os IDs dos estudantes que não têm alergias?
286
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"
How many female students have milk or egg allergies?
CREATE TABLE Student (StuID VARCHAR, sex VARCHAR); CREATE TABLE has_allergy (StuID VARCHAR, allergy VARCHAR)
Quantas estudantes do sexo feminino têm alergias ao leite ou ao ovo?
287
SELECT COUNT(*) FROM Has_allergy AS T1 JOIN Allergy_type AS T2 ON T1.allergy = T2.allergy WHERE T2.allergytype = "food"
How many students have a food allergy?
CREATE TABLE Has_allergy (allergy VARCHAR); CREATE TABLE Allergy_type (allergy VARCHAR, allergytype VARCHAR)
Quantos estudantes têm alergia alimentar?
288
SELECT Allergy FROM Has_allergy GROUP BY Allergy ORDER BY COUNT(*) DESC LIMIT 1
Which allergy has most number of students affected?
CREATE TABLE Has_allergy (Allergy VARCHAR)
Qual alergia tem mais estudantes afetados?
289
SELECT Allergy, COUNT(*) FROM Has_allergy GROUP BY Allergy
Show all allergies with number of students affected.
CREATE TABLE Has_allergy (Allergy VARCHAR)
Mostre todas as alergias com o número de alunos afetados.
290
SELECT T2.allergytype, COUNT(*) FROM Has_allergy AS T1 JOIN Allergy_type AS T2 ON T1.allergy = T2.allergy GROUP BY T2.allergytype
Show all allergy type with number of students affected.
CREATE TABLE Has_allergy (allergy VARCHAR); CREATE TABLE Allergy_type (allergytype VARCHAR, allergy VARCHAR)
Mostrar todos os tipos de alergia com o número de alunos afetados.
291
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")
Find the last name and age of the student who has allergy to both milk and cat.
CREATE TABLE Has_allergy (lname VARCHAR, age VARCHAR, StuID VARCHAR, Allergy VARCHAR); CREATE TABLE Student (lname VARCHAR, age VARCHAR, StuID VARCHAR, Allergy VARCHAR)
Encontre o sobrenome e a idade do aluno que tem alergia ao leite e ao gato.
292
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
What are the allergies and their types that the student with first name Lisa has? And order the result by name of allergies.
CREATE TABLE Has_allergy (Allergy VARCHAR, StuID VARCHAR); CREATE TABLE Student (StuID VARCHAR, Fname VARCHAR); CREATE TABLE Allergy_type (Allergy VARCHAR, AllergyType VARCHAR)
Quais são as alergias e seus tipos que o aluno com o primeiro nome Lisa tem? E encomende o resultado pelo nome de alergias.
293
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")
Find the first name and gender of the student who has allergy to milk but not cat.
CREATE TABLE Student (fname VARCHAR, sex VARCHAR, StuID VARCHAR, Allergy VARCHAR); CREATE TABLE Has_allergy (fname VARCHAR, sex VARCHAR, StuID VARCHAR, Allergy VARCHAR)
Encontre o primeiro nome e o gênero do aluno que tem alergia ao leite, mas não ao gato.
294
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")
Find the average age of the students who have allergies with food and animal types.
CREATE TABLE Student (age INTEGER, StuID VARCHAR); CREATE TABLE Allergy_Type (Allergy VARCHAR, allergytype VARCHAR); CREATE TABLE Has_allergy (StuID VARCHAR, Allergy VARCHAR)
Encontre a idade média dos alunos que têm alergias com alimentos e tipos de animais.
295
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")
List the first and last name of the students who do not have any food type allergy.
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)
Listar o primeiro e último nome dos alunos que não têm qualquer tipo de alergia alimentar.
296
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")
Find the number of male (sex is 'M') students who have some food type allery.
CREATE TABLE Has_allergy (Allergy VARCHAR); CREATE TABLE Allergy_Type (Allergy VARCHAR, allergytype VARCHAR); CREATE TABLE Student (sex VARCHAR, StuID VARCHAR)
Encontre o número de homens (sexo é 'M') estudantes que têm algum tipo de alimento allery.
297
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"
Find the different first names and cities of the students who have allergy to milk or cat.
CREATE TABLE Has_Allergy (stuid VARCHAR, Allergy VARCHAR); CREATE TABLE Student (fname VARCHAR, city_code VARCHAR, stuid VARCHAR)
Encontre os diferentes nomes e cidades dos alunos que têm alergia ao leite ou gato.
298
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")
Find the number of students who are older than 18 and do not have allergy to either food or animal.
CREATE TABLE Allergy_Type (Allergy VARCHAR, allergytype VARCHAR); CREATE TABLE Has_allergy (Allergy VARCHAR); CREATE TABLE Student (age VARCHAR, StuID VARCHAR)
Encontre o número de estudantes com mais de 18 anos e que não têm alergia a alimentos ou animais.
299
SELECT fname, major FROM Student WHERE NOT StuID IN (SELECT StuID FROM Has_allergy WHERE Allergy = "Soy")
Find the first name and major of the students who are not allegry to soy.
CREATE TABLE Has_allergy (fname VARCHAR, major VARCHAR, StuID VARCHAR, Allergy VARCHAR); CREATE TABLE Student (fname VARCHAR, major VARCHAR, StuID VARCHAR, Allergy VARCHAR)
Encontre o primeiro nome e o maior dos alunos que não são alegorias à soja.