db_id
stringclasses
66 values
question
stringlengths
24
325
evidence
stringlengths
1
673
gold_query
stringlengths
23
804
db_schema
stringclasses
66 values
bike_share_1
What is the location coordinates of the bike station from which the bike for the trip that last the longest was borrowed?
location coordinates refers to (lat, long); bike that was borrowed the longest refers to MAX(duration);
SELECT T2.lat, T2.long FROM trip AS T1 INNER JOIN station AS T2 ON T2.name = T1.start_station_name WHERE T1.duration = ( SELECT MAX(T1.duration) FROM trip AS T1 INNER JOIN station AS T2 ON T2.name = T1.start_station_name )
CREATE TABLE weather ( zip_code TEXT, -- Example Values: `94107`, `94063`, `94301`, `94041`, `95113` | Value Statics: Total count 3665 - Distinct count 5 - Null count 0 max_visibility_miles INTEGER, -- Example Values: `10`, `9`, `8`, `20`, `15` | Value Statics: Total count 3652 - Distinct count 11 - Null count 13 ...
hockey
Among the players who had 10 empty net goals in their career, who is the tallest? Show his full name.
10 empty net goals refers to ENG = 10; the tallest refers to max(height)
SELECT T1.firstName, T1.lastName FROM Master AS T1 INNER JOIN Goalies AS T2 ON T1.playerID = T2.playerID GROUP BY T2.playerID, T1.height HAVING SUM(T2.ENG) > 10 ORDER BY T1.height DESC LIMIT 1
CREATE TABLE Scoring ( tmID TEXT, -- PIM INTEGER, -- PostA TEXT, -- GTG TEXT, -- Example Values: `0`, `1`, `3`, `2`, `5` | Value Statics: Total count 28106 - Distinct count 8 - Null count 17861 PostGP TEXT, -- GP INTEGER, -- lgID TEXT, -- Example Values: `NHL`, `WHA`, `PCHA`, `WCHL`, `NHA` | Value S...
synthea
How old was Mrs. Laronda Bernier at the time of her most recent medical encounter?
how old = SUBTRACT(MIN(encounters.DATE), patients.birthdate); most recent medical encounter refers to MIN(encounters.DATE);
SELECT T2.DATE - T1.birthdate AS age FROM patients AS T1 INNER JOIN encounters AS T2 ON T1.patient = T2.PATIENT WHERE T1.first = 'Laronda' AND T1.last = 'Bernier' ORDER BY T2.DATE DESC LIMIT 1
CREATE TABLE immunizations ( foreign key (ENCOUNTER) references encounters(ID), CODE INTEGER, -- Example Values: `8`, `62`, `140`, `113`, `83` | Value Statics: Total count 13189 - Distinct count 16 - Null count 0 foreign key (PATIENT) references patients(patient), ENCOUNTER TEXT, -- PATIENT TEXT, -- DATE D...
cs_semester
What is the average gpa of Ogdon Zywicki's research assistants?
research assistant refers to the student who serves for research where the abbreviation is RA; prof_id refers to professor’s ID; GPA is an abbreviated name of Grade Point Average where average = AVG(gpa);
SELECT SUM(T3.gpa) / COUNT(T1.student_id) FROM RA AS T1 INNER JOIN prof AS T2 ON T1.prof_id = T2.prof_id INNER JOIN student AS T3 ON T1.student_id = T3.student_id WHERE T2.first_name = 'Ogdon' AND T2.last_name = 'Zywicki'
CREATE TABLE prof ( teachingability INTEGER, -- Example Values: `5`, `1`, `2`, `3`, `4` | Value Statics: Total count 10 - Distinct count 5 - Null count 0 gender TEXT, -- Example Values: `Male`, `Female` | Value Statics: Total count 10 - Distinct count 2 - Null count 0 email TEXT, -- Example Values: `npigford0@...
bike_share_1
How many trips made by a subscriber started in August, 2013 from a station that can hold more than 20 bikes?
subscriber refers to subscription_type = 'Subscriber'; in August 2013 refers to start_date LIKE'8%' AND start_date LIKE'%2013%'; station that can hold more than 20 bikes refers to dock_count>20;
SELECT COUNT(T2.id) FROM station AS T1 INNER JOIN trip AS T2 ON T1.id = T2.start_station_id WHERE T2.subscription_type = 'Subscriber' AND T2.start_date LIKE '8/%/2013%' AND T1.dock_count > 20
CREATE TABLE weather ( zip_code TEXT, -- Example Values: `94107`, `94063`, `94301`, `94041`, `95113` | Value Statics: Total count 3665 - Distinct count 5 - Null count 0 max_visibility_miles INTEGER, -- Example Values: `10`, `9`, `8`, `20`, `15` | Value Statics: Total count 3652 - Distinct count 11 - Null count 13 ...
hockey
Which player who showed as the third goalie in a game has the biggest weight? Give the full name of the player.
the third goalie refers to stint = 3; the biggest weight refers to max(weight)
SELECT T1.firstName, T1.lastName FROM Master AS T1 INNER JOIN Goalies AS T2 ON T1.playerID = T2.playerID WHERE T2.stint = 3 ORDER BY T1.weight DESC LIMIT 1
CREATE TABLE Scoring ( tmID TEXT, -- PIM INTEGER, -- PostA TEXT, -- GTG TEXT, -- Example Values: `0`, `1`, `3`, `2`, `5` | Value Statics: Total count 28106 - Distinct count 8 - Null count 17861 PostGP TEXT, -- GP INTEGER, -- lgID TEXT, -- Example Values: `NHL`, `WHA`, `PCHA`, `WCHL`, `NHA` | Value S...
cs_semester
Which student has the highest gpa? Give the full name.
GPA is an abbreviated name of Grade Point Average where highest GPA = MAX(gpa); full name refers to f_name and l_name;
SELECT f_name, l_name FROM student WHERE gpa = ( SELECT MAX(gpa) FROM student )
CREATE TABLE prof ( teachingability INTEGER, -- Example Values: `5`, `1`, `2`, `3`, `4` | Value Statics: Total count 10 - Distinct count 5 - Null count 0 gender TEXT, -- Example Values: `Male`, `Female` | Value Statics: Total count 10 - Distinct count 2 - Null count 0 email TEXT, -- Example Values: `npigford0@...
bike_share_1
Please list the starting stations of the bike trips made on a day with a max humidity over 80 in 2013 in the area where the zip code is 94107.
starting stations refers to start_station_name; day with a max humidity over 80 refers to max_humidity>80; in 2013 refers to date LIKE'%2013';
SELECT DISTINCT T1.start_station_name FROM trip AS T1 INNER JOIN weather AS T2 ON T2.zip_code = T1.zip_code WHERE SUBSTR(CAST(T2.date AS TEXT), -4) = '2013' AND T2.zip_code = 94107 AND T2.max_temperature_f > 80
CREATE TABLE weather ( zip_code TEXT, -- Example Values: `94107`, `94063`, `94301`, `94041`, `95113` | Value Statics: Total count 3665 - Distinct count 5 - Null count 0 max_visibility_miles INTEGER, -- Example Values: `10`, `9`, `8`, `20`, `15` | Value Statics: Total count 3652 - Distinct count 11 - Null count 13 ...
hockey
For the coach who co-coached with Dave Lewis in 1998, where was his birth place?
co-coached refers to notes = 'co-coach'; birth place refers to 'birthCountry-birthState-birthCity'
SELECT T1.birthCountry FROM Master AS T1 INNER JOIN Coaches AS T2 ON T1.coachID = T2.coachID WHERE T2.year = 1998 AND T2.notes = 'co-coach with Dave Lewis'
CREATE TABLE Scoring ( tmID TEXT, -- PIM INTEGER, -- PostA TEXT, -- GTG TEXT, -- Example Values: `0`, `1`, `3`, `2`, `5` | Value Statics: Total count 28106 - Distinct count 8 - Null count 17861 PostGP TEXT, -- GP INTEGER, -- lgID TEXT, -- Example Values: `NHL`, `WHA`, `PCHA`, `WCHL`, `NHA` | Value S...
cs_semester
Which professor is Oliy Spratling working with? Give the full name.
research assistant refers to the student who serves for research where the abbreviation is RA; full name refers to f_name and l_name;
SELECT T1.first_name, T1.last_name FROM prof AS T1 INNER JOIN RA AS T2 ON T1.prof_id = T2.prof_id INNER JOIN student AS T3 ON T2.student_id = T3.student_id WHERE T3.f_name = 'Oliy' AND T3.l_name = 'Spratling'
CREATE TABLE prof ( teachingability INTEGER, -- Example Values: `5`, `1`, `2`, `3`, `4` | Value Statics: Total count 10 - Distinct count 5 - Null count 0 gender TEXT, -- Example Values: `Male`, `Female` | Value Statics: Total count 10 - Distinct count 2 - Null count 0 email TEXT, -- Example Values: `npigford0@...
bike_share_1
How many bike trips started on the days in September, 2013 with the hottest temperature over 70 degrees Fahrenheit in the area where the zip code is 94107?
started on the days in September, 2013 refers to date LIKE'9%'AND date LIKE'%2013' hottest temperature over 70 degrees Fahrenheit refers to max_temperature_f>70;
SELECT COUNT(T1.id) FROM trip AS T1 INNER JOIN weather AS T2 ON T2.zip_code = T1.zip_code WHERE T2.date LIKE '9/%/2013' AND T2.zip_code = 94107 AND T2.max_temperature_f > 70
CREATE TABLE weather ( zip_code TEXT, -- Example Values: `94107`, `94063`, `94301`, `94041`, `95113` | Value Statics: Total count 3665 - Distinct count 5 - Null count 0 max_visibility_miles INTEGER, -- Example Values: `10`, `9`, `8`, `20`, `15` | Value Statics: Total count 3652 - Distinct count 11 - Null count 13 ...
hockey
Which position did Mike Antonovich play?
pos = 'LW' refers to left winger; pos = 'RW' refers to right winger; pos = 'C' refers to center; pos = 'G' refers to goalie; pos = 'D' refers to defenceman; pos = 'W' refers to winger; pos = 'F' refers to forward
SELECT T1.pos FROM Master AS T1 INNER JOIN AwardsPlayers AS T2 ON T1.playerID = T2.playerID WHERE T1.firstName = 'Mike' AND T1.lastName = 'Antonovich'
CREATE TABLE Scoring ( tmID TEXT, -- PIM INTEGER, -- PostA TEXT, -- GTG TEXT, -- Example Values: `0`, `1`, `3`, `2`, `5` | Value Statics: Total count 28106 - Distinct count 8 - Null count 17861 PostGP TEXT, -- GP INTEGER, -- lgID TEXT, -- Example Values: `NHL`, `WHA`, `PCHA`, `WCHL`, `NHA` | Value S...
synthea
Give me the immunization codes and dates on which Ms. Jacquelyn Shanahan was immunized with influenza seasonal injectable preservative-free vaccine.
immunization codes refers to immunizations.CODE; immunization dates refers to immunizations.DATE; immunized with influenza seasonal injectable preservative-free vaccine refers to immunizations.DESCRIPTION = 'Influenza seasonal injectable preservative free'; 4 consecutive years refers to 4 succeeding years;
SELECT DISTINCT T2.CODE, T2.DATE FROM patients AS T1 INNER JOIN immunizations AS T2 ON T1.patient = T2.PATIENT WHERE T1.prefix = 'Ms.' AND T1.first = 'Jacquelyn' AND T1.last = 'Shanahan' AND T2.DESCRIPTION = 'Influenza seasonal injectable preservative free'
CREATE TABLE immunizations ( foreign key (ENCOUNTER) references encounters(ID), CODE INTEGER, -- Example Values: `8`, `62`, `140`, `113`, `83` | Value Statics: Total count 13189 - Distinct count 16 - Null count 0 foreign key (PATIENT) references patients(patient), ENCOUNTER TEXT, -- PATIENT TEXT, -- DATE D...
social_media
Tweet with ID tw-682723090279841798 was posted from which country?
"tw-682723090279841798" is the TweetID
SELECT T2.Country FROM twitter AS T1 INNER JOIN location AS T2 ON T1.LocationID = T2.LocationID WHERE T1.TweetID = 'tw-682723090279841798'
CREATE TABLE location ( StateCode TEXT, -- LocationID INTEGER constraint location_pk primary key, City TEXT, -- Country TEXT, -- State TEXT, -- ); CREATE TABLE twitter ( Reach INTEGER, -- Lang TEXT, -- Klout INTEGER, -- foreign key (LocationID) references location(LocationID), Hour INTEGER, -- ...
bike_share_1
In which city's station is a bike borrowed on trip ID4069?
bike is borrowed from refers to start_station_id;
SELECT T2.city FROM trip AS T1 INNER JOIN station AS T2 ON T2.name = T1.start_station_name WHERE T1.id = 4069
CREATE TABLE weather ( zip_code TEXT, -- Example Values: `94107`, `94063`, `94301`, `94041`, `95113` | Value Statics: Total count 3665 - Distinct count 5 - Null count 0 max_visibility_miles INTEGER, -- Example Values: `10`, `9`, `8`, `20`, `15` | Value Statics: Total count 3652 - Distinct count 11 - Null count 13 ...
hockey
Did legendsID "P194502" personally attend his Hall of Fame dedication?
note = 'posthumous'refers to "didn't personally attend"
SELECT IIF(T1.note = 'posthumous', 'YES', 'NO') FROM AwardsMisc AS T1 RIGHT JOIN Master AS T2 ON T1.ID = T2.playerID WHERE T2.legendsID = 'P194502'
CREATE TABLE Scoring ( tmID TEXT, -- PIM INTEGER, -- PostA TEXT, -- GTG TEXT, -- Example Values: `0`, `1`, `3`, `2`, `5` | Value Statics: Total count 28106 - Distinct count 8 - Null count 17861 PostGP TEXT, -- GP INTEGER, -- lgID TEXT, -- Example Values: `NHL`, `WHA`, `PCHA`, `WCHL`, `NHA` | Value S...
cs_semester
How many research assistants does the female professor with the lowest teaching ability have?
research assistant refers to the student who serves for research where the abbreviation is RA; professor with the lowest teaching ability refers to prof_id where teachability = '1';
SELECT COUNT(T1.student_id) FROM RA AS T1 INNER JOIN prof AS T2 ON T1.prof_id = T2.prof_id WHERE T2.teachingability = '1' AND T2.gender = 'Female'
CREATE TABLE prof ( teachingability INTEGER, -- Example Values: `5`, `1`, `2`, `3`, `4` | Value Statics: Total count 10 - Distinct count 5 - Null count 0 gender TEXT, -- Example Values: `Male`, `Female` | Value Statics: Total count 10 - Distinct count 2 - Null count 0 email TEXT, -- Example Values: `npigford0@...
bike_share_1
How many bikes can be borrowed in San Jose Diridon Caltrain Station at 12:06:01 on 2013/8/29?
number of bikes that can be borrowed refers to bikes_available; San Jose Diridon Caltrain Station refers to name = 'San Jose Diridon Caltrain Station'; time = '2013/8/29 12:06:01'
SELECT T2.bikes_available FROM station AS T1 INNER JOIN status AS T2 ON T1.id = T2.station_id WHERE T1.name = 'San Jose Diridon Caltrain Station' AND T2.time = '2013/08/29 12:06:01'
CREATE TABLE weather ( zip_code TEXT, -- Example Values: `94107`, `94063`, `94301`, `94041`, `95113` | Value Statics: Total count 3665 - Distinct count 5 - Null count 0 max_visibility_miles INTEGER, -- Example Values: `10`, `9`, `8`, `20`, `15` | Value Statics: Total count 3652 - Distinct count 11 - Null count 13 ...
hockey
For the coach who won Second Team All-Star in 1933, how many wins did he have that year?
the number of wins refers to count(w)
SELECT SUM(T1.W) FROM Coaches AS T1 INNER JOIN AwardsCoaches AS T2 ON T1.coachID = T2.coachID WHERE T2.year = 1933 AND T2.award = 'Second Team All-Star'
CREATE TABLE Scoring ( tmID TEXT, -- PIM INTEGER, -- PostA TEXT, -- GTG TEXT, -- Example Values: `0`, `1`, `3`, `2`, `5` | Value Statics: Total count 28106 - Distinct count 8 - Null count 17861 PostGP TEXT, -- GP INTEGER, -- lgID TEXT, -- Example Values: `NHL`, `WHA`, `PCHA`, `WCHL`, `NHA` | Value S...
synthea
How long did Elly Koss have to take Acetaminophen 160 MG?
how long = SUBTRACT(julianday(medications.stop), julianday(medications.START)); Acetaminophen 160 MG refers to medications.DESCRIPTION = 'Acetaminophen 160 MG';
SELECT strftime('%J', T2.STOP) - strftime('%J', T2.START) AS days FROM patients AS T1 INNER JOIN medications AS T2 ON T1.patient = T2.PATIENT WHERE T1.first = 'Elly' AND last = 'Koss' AND T2.DESCRIPTION = 'Acetaminophen 160 MG'
CREATE TABLE immunizations ( foreign key (ENCOUNTER) references encounters(ID), CODE INTEGER, -- Example Values: `8`, `62`, `140`, `113`, `83` | Value Statics: Total count 13189 - Distinct count 16 - Null count 0 foreign key (PATIENT) references patients(patient), ENCOUNTER TEXT, -- PATIENT TEXT, -- DATE D...
cs_semester
How many students took the hardest course?
diff refers to difficulty; diff is higher means the course is more difficult in which hardest difficulty is expressed as diff = 5;
SELECT COUNT(T1.student_id) FROM registration AS T1 INNER JOIN course AS T2 ON T1.course_id = T2.course_id WHERE T2.diff = 5
CREATE TABLE prof ( teachingability INTEGER, -- Example Values: `5`, `1`, `2`, `3`, `4` | Value Statics: Total count 10 - Distinct count 5 - Null count 0 gender TEXT, -- Example Values: `Male`, `Female` | Value Statics: Total count 10 - Distinct count 2 - Null count 0 email TEXT, -- Example Values: `npigford0@...
bike_share_1
What is the difference between the hottest temperature and the coldest temperature in in Fahrenheit on 8/29/2013 for the area where the zip code is 94107?
hottest temperature refers to max_temperatutre_f; coldest temperature refers to min_temperature_f; difference = SUBTRACT(max_temperature_f, min_temperature_f); date = '8/29/2013'
SELECT SUM(IIF(zip_code = 94107 AND date = '8/29/2013', max_temperature_f - min_temperature_f, 0)) FROM weather
CREATE TABLE weather ( zip_code TEXT, -- Example Values: `94107`, `94063`, `94301`, `94041`, `95113` | Value Statics: Total count 3665 - Distinct count 5 - Null count 0 max_visibility_miles INTEGER, -- Example Values: `10`, `9`, `8`, `20`, `15` | Value Statics: Total count 3652 - Distinct count 11 - Null count 13 ...
hockey
In how many games did player Id "vernomi01" end up with a tie or an overtime loss in the 1998 season?
end up with a tie or an overtime loss refers to T/OL
SELECT `T/OL` FROM Goalies WHERE playerID = 'vernomi01' AND year = 1998
CREATE TABLE Scoring ( tmID TEXT, -- PIM INTEGER, -- PostA TEXT, -- GTG TEXT, -- Example Values: `0`, `1`, `3`, `2`, `5` | Value Statics: Total count 28106 - Distinct count 8 - Null count 17861 PostGP TEXT, -- GP INTEGER, -- lgID TEXT, -- Example Values: `NHL`, `WHA`, `PCHA`, `WCHL`, `NHA` | Value S...
cs_semester
Give the grade score for Rik Unsworth in "Computer Network".
Academic grades awarded for participation in a course are A, B, C, D and F where Grade 'A' means excellent, Grade 'B' means good, Grade 'C' means fair, Grade 'D' means poorly pass, if grade is null or empty, it means that this student fails to pass this course in which grade = NULL;
SELECT CASE grade WHEN 'A' THEN 4 WHEN 'B' THEN 3 WHEN 'C' THEN 2 ELSE 1 END AS result FROM registration WHERE student_id IN ( SELECT student_id FROM student WHERE f_name = 'Rik' AND l_name = 'Unsworth' AND course_id IN ( SELECT course_id FROM course WHERE name = 'Computer Network' ) )
CREATE TABLE prof ( teachingability INTEGER, -- Example Values: `5`, `1`, `2`, `3`, `4` | Value Statics: Total count 10 - Distinct count 5 - Null count 0 gender TEXT, -- Example Values: `Male`, `Female` | Value Statics: Total count 10 - Distinct count 2 - Null count 0 email TEXT, -- Example Values: `npigford0@...
bike_share_1
What is the mean temperature in Fahrenheit on 8/29/2013 for the area where the zip code is 94107?
mean temperature in Fahrenheit refers to mean_temperature_f; on 8/29/2013 refers to date = '8/29/2013';
SELECT SUM(IIF(zip_code = 94107 AND date = '8/29/2013', mean_temperature_f, 0)) FROM weather
CREATE TABLE weather ( zip_code TEXT, -- Example Values: `94107`, `94063`, `94301`, `94041`, `95113` | Value Statics: Total count 3665 - Distinct count 5 - Null count 0 max_visibility_miles INTEGER, -- Example Values: `10`, `9`, `8`, `20`, `15` | Value Statics: Total count 3652 - Distinct count 11 - Null count 13 ...
hockey
How many games did player Id "vanbijo01" win in the 1990 season?
the number of wins refers to W
SELECT W FROM Goalies WHERE playerID = 'vanbijo01' AND year = 1990
CREATE TABLE Scoring ( tmID TEXT, -- PIM INTEGER, -- PostA TEXT, -- GTG TEXT, -- Example Values: `0`, `1`, `3`, `2`, `5` | Value Statics: Total count 28106 - Distinct count 8 - Null count 17861 PostGP TEXT, -- GP INTEGER, -- lgID TEXT, -- Example Values: `NHL`, `WHA`, `PCHA`, `WCHL`, `NHA` | Value S...
synthea
Identify the allergy period for Isadora Moen and what triggered it.
allergy period = SUBTRACT(allergies.START, allergies.STOP); what triggered the allergy refers to allergies.DESCRIPTION;
SELECT T2.START, T2.STOP, T2.DESCRIPTION FROM patients AS T1 INNER JOIN allergies AS T2 ON T1.patient = T2.PATIENT WHERE T1.first = 'Isadora' AND T1.last = 'Moen'
CREATE TABLE immunizations ( foreign key (ENCOUNTER) references encounters(ID), CODE INTEGER, -- Example Values: `8`, `62`, `140`, `113`, `83` | Value Statics: Total count 13189 - Distinct count 16 - Null count 0 foreign key (PATIENT) references patients(patient), ENCOUNTER TEXT, -- PATIENT TEXT, -- DATE D...
cs_semester
For the professor who is working with Harrietta Lydford, how is his popularity?
research assistant refers to the student who serves for research where the abbreviation is RA; higher popularity means more popular; prof_id refers to professor’s ID;
SELECT T1.popularity FROM prof AS T1 INNER JOIN RA AS T2 ON T1.prof_id = T2.prof_id INNER JOIN student AS T3 ON T2.student_id = T3.student_id WHERE T3.f_name = 'Harrietta' AND T3.l_name = 'Lydford'
CREATE TABLE prof ( teachingability INTEGER, -- Example Values: `5`, `1`, `2`, `3`, `4` | Value Statics: Total count 10 - Distinct count 5 - Null count 0 gender TEXT, -- Example Values: `Male`, `Female` | Value Statics: Total count 10 - Distinct count 2 - Null count 0 email TEXT, -- Example Values: `npigford0@...
bike_share_1
How many bike stations are installed after August, 2013 in San Jose?
installed after August, 2013 refers to year(installation_date)>2013; in San Jose refers to city = 'San Jose';
SELECT COUNT(installation_date) FROM station WHERE city = 'San Jose' AND (SUBSTR(CAST(installation_date AS TEXT), 1, INSTR(installation_date, '/') - 1) IN ('8', '9', '10', '11', '12') AND SUBSTR(CAST(installation_date AS TEXT), -4) = '2013') OR SUBSTR(CAST(installation_date AS TEXT), -4) > '2013'
CREATE TABLE weather ( zip_code TEXT, -- Example Values: `94107`, `94063`, `94301`, `94041`, `95113` | Value Statics: Total count 3665 - Distinct count 5 - Null count 0 max_visibility_miles INTEGER, -- Example Values: `10`, `9`, `8`, `20`, `15` | Value Statics: Total count 3652 - Distinct count 11 - Null count 13 ...
hockey
Show me how many minutes player Id "valiqst01" played in the game in 2007 season.
show me how many minutes refers to Min
SELECT Min FROM Goalies WHERE playerID = 'valiqst01' AND year = 2007
CREATE TABLE Scoring ( tmID TEXT, -- PIM INTEGER, -- PostA TEXT, -- GTG TEXT, -- Example Values: `0`, `1`, `3`, `2`, `5` | Value Statics: Total count 28106 - Distinct count 8 - Null count 17861 PostGP TEXT, -- GP INTEGER, -- lgID TEXT, -- Example Values: `NHL`, `WHA`, `PCHA`, `WCHL`, `NHA` | Value S...
synthea
When did Mrs. Joye Homenick receive her most recent influenza seasonal vaccine?
when a patient received her most recent vaccine refers to MAX(immunications.DATE); influenza seasonal vaccine refers to immunizations.DESCRIPTION = 'Influenza seasonal injectable preservative free';
SELECT T2.DATE FROM patients AS T1 INNER JOIN immunizations AS T2 ON T1.patient = T2.PATIENT WHERE T2.DESCRIPTION = 'Influenza seasonal injectable preservative free' AND T1.first = 'Joye' AND T1.last = 'Homenick' ORDER BY T2.DATE DESC LIMIT 1
CREATE TABLE immunizations ( foreign key (ENCOUNTER) references encounters(ID), CODE INTEGER, -- Example Values: `8`, `62`, `140`, `113`, `83` | Value Statics: Total count 13189 - Distinct count 16 - Null count 0 foreign key (PATIENT) references patients(patient), ENCOUNTER TEXT, -- PATIENT TEXT, -- DATE D...
cs_semester
Provide the number of students enrolled in the "Statistical Learning" course.
null
SELECT COUNT(T2.student_id) FROM course AS T1 INNER JOIN registration AS T2 ON T1.course_id = T2.course_id WHERE T1.name = 'Statistical learning'
CREATE TABLE prof ( teachingability INTEGER, -- Example Values: `5`, `1`, `2`, `3`, `4` | Value Statics: Total count 10 - Distinct count 5 - Null count 0 gender TEXT, -- Example Values: `Male`, `Female` | Value Statics: Total count 10 - Distinct count 2 - Null count 0 email TEXT, -- Example Values: `npigford0@...
bike_share_1
In 2015, what percentage of trips that had the subscription type was Customer and ended on a rainy day?
in 2015 refers to end_date like '%2015%'; percentage = DIVIDE(COUNT(events = 'Rain'), COUNT(events));
SELECT CAST(SUM(CASE WHEN T2.events = 'Rain' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.id) FROM trip AS T1 INNER JOIN weather AS T2 ON T2.zip_code = T1.zip_code WHERE SUBSTR(CAST(T2.date AS TEXT), -4) = '2015' AND T1.subscription_type = 'Customer'
CREATE TABLE weather ( zip_code TEXT, -- Example Values: `94107`, `94063`, `94301`, `94041`, `95113` | Value Statics: Total count 3665 - Distinct count 5 - Null count 0 max_visibility_miles INTEGER, -- Example Values: `10`, `9`, `8`, `20`, `15` | Value Statics: Total count 3652 - Distinct count 11 - Null count 13 ...
hockey
What was the total number of the games that player Id "rutlewa01" played in 1967?
total number of the games refers to GP
SELECT GP FROM Goalies WHERE playerID = 'rutlewa01' AND year = 1967
CREATE TABLE Scoring ( tmID TEXT, -- PIM INTEGER, -- PostA TEXT, -- GTG TEXT, -- Example Values: `0`, `1`, `3`, `2`, `5` | Value Statics: Total count 28106 - Distinct count 8 - Null count 17861 PostGP TEXT, -- GP INTEGER, -- lgID TEXT, -- Example Values: `NHL`, `WHA`, `PCHA`, `WCHL`, `NHA` | Value S...
synthea
How long did Berry Keebler take the Acetaminophen 160 MG when he was admitted due to acute bronchitis?
how long = SUBTRACT(medications.STOP, medications.START); Acetaminophen 160 MG refers to medications.DESCRIPTION = 'Acetaminophen 160 MG'; acute bronchitis refers to medications.REASONDESCRIPTION = 'Acute bronchitis (disorder)';
SELECT strftime('%J', T2.STOP) - strftime('%J', T2.START) AS takenDays FROM patients AS T1 INNER JOIN medications AS T2 ON T1.patient = T2.PATIENT WHERE T1.first = 'Berry' AND T1.last = 'Keebler' AND T2.REASONDESCRIPTION = 'Acute bronchitis (disorder)' AND T2.DESCRIPTION = 'Acetaminophen 160 MG'
CREATE TABLE immunizations ( foreign key (ENCOUNTER) references encounters(ID), CODE INTEGER, -- Example Values: `8`, `62`, `140`, `113`, `83` | Value Statics: Total count 13189 - Distinct count 16 - Null count 0 foreign key (PATIENT) references patients(patient), ENCOUNTER TEXT, -- PATIENT TEXT, -- DATE D...
cs_semester
For the professors who advise more than 2 students, which professor has a higher teaching ability? Give the full name.
professor advising more than 2 students refers to COUNT(student_id) > 2; higher teachability refers to MAX(teachingability); full name refers to f_name and l_name;
SELECT T.first_name, T.last_name FROM ( SELECT T2.first_name, T2.last_name, T2.teachingability FROM RA AS T1 INNER JOIN prof AS T2 ON T1.prof_id = T2.prof_id GROUP BY T1.prof_id HAVING COUNT(student_id) > 2 ) T ORDER BY T.teachingability DESC LIMIT 1
CREATE TABLE prof ( teachingability INTEGER, -- Example Values: `5`, `1`, `2`, `3`, `4` | Value Statics: Total count 10 - Distinct count 5 - Null count 0 gender TEXT, -- Example Values: `Male`, `Female` | Value Statics: Total count 10 - Distinct count 2 - Null count 0 email TEXT, -- Example Values: `npigford0@...
bike_share_1
What was the mean humidity of a trip with id 4275?
mean humidity refers to mean_humidity;
SELECT T2.mean_humidity FROM trip AS T1 INNER JOIN weather AS T2 ON T2.zip_code = T1.zip_code WHERE T1.id = 4275
CREATE TABLE weather ( zip_code TEXT, -- Example Values: `94107`, `94063`, `94301`, `94041`, `95113` | Value Statics: Total count 3665 - Distinct count 5 - Null count 0 max_visibility_miles INTEGER, -- Example Values: `10`, `9`, `8`, `20`, `15` | Value Statics: Total count 3652 - Distinct count 11 - Null count 13 ...
hockey
Which team did player Id "roypa01" play in 1992? Give the team id.
team id refers to tmID
SELECT tmID FROM Goalies WHERE playerID = 'roypa01' AND year = 1992
CREATE TABLE Scoring ( tmID TEXT, -- PIM INTEGER, -- PostA TEXT, -- GTG TEXT, -- Example Values: `0`, `1`, `3`, `2`, `5` | Value Statics: Total count 28106 - Distinct count 8 - Null count 17861 PostGP TEXT, -- GP INTEGER, -- lgID TEXT, -- Example Values: `NHL`, `WHA`, `PCHA`, `WCHL`, `NHA` | Value S...
synthea
Among all patients who sought medical attention in 2010 due to contact dermatitis, identify the percentage of females.
in 2010 refers to substr(encounters.DATE, 1, 4) = '2010'; contact dermatitis refers to encounters.REASONDESCRIPTION = 'Contact dermatitis'; percentage = MULTIPLY(DIVIDE(COUNT(encounters.PATIENT WHERE gender = 'F'), count(encounters.PATIENT) WHERE encounters.REASONDESCRIPTION = 'Contact dermatitis'), 1.0) females refers...
SELECT CAST(SUM(CASE WHEN T2.gender = 'F' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.PATIENT) FROM encounters AS T1 INNER JOIN patients AS T2 ON T1.PATIENT = T2.patient WHERE strftime('%Y', T1.DATE) = '2010' AND T1.REASONDESCRIPTION = 'Contact dermatitis'
CREATE TABLE immunizations ( foreign key (ENCOUNTER) references encounters(ID), CODE INTEGER, -- Example Values: `8`, `62`, `140`, `113`, `83` | Value Statics: Total count 13189 - Distinct count 16 - Null count 0 foreign key (PATIENT) references patients(patient), ENCOUNTER TEXT, -- PATIENT TEXT, -- DATE D...
cs_semester
State the name of research postgraduate student among Professor Zhihua Zhou's research assistants.
research postgraduate student refers to type = 'RPG'; research assistant refers to the student who serves for research where the abbreviation is RA;
SELECT T3.f_name, T3.l_name FROM prof AS T1 INNER JOIN RA AS T2 ON T1.prof_id = T2.prof_id INNER JOIN student AS T3 ON T2.student_id = T3.student_id WHERE T1.first_name = 'Zhihua' AND T3.type = 'RPG' AND T1.last_name = 'Zhou'
CREATE TABLE prof ( teachingability INTEGER, -- Example Values: `5`, `1`, `2`, `3`, `4` | Value Statics: Total count 10 - Distinct count 5 - Null count 0 gender TEXT, -- Example Values: `Male`, `Female` | Value Statics: Total count 10 - Distinct count 2 - Null count 0 email TEXT, -- Example Values: `npigford0@...
bike_share_1
Please calculate the average temperature of those trips that started at Market at 4th in 2013.
started at refers to start_station_name; start station_name = 'Market at 4th'; in 2013 refers to start_date like '%2013%'; temperature refers to mean_temperature_f; average temperature = DIVIDE(SUM(mean_temperature_f), COUNT(mean_temperature_f));
SELECT AVG(T2.mean_temperature_f) FROM trip AS T1 INNER JOIN weather AS T2 ON T2.zip_code = T1.zip_code WHERE SUBSTR(CAST(T2.date AS TEXT), -4) = '2013' AND T1.start_station_name = 'Market at 4th'
CREATE TABLE weather ( zip_code TEXT, -- Example Values: `94107`, `94063`, `94301`, `94041`, `95113` | Value Statics: Total count 3665 - Distinct count 5 - Null count 0 max_visibility_miles INTEGER, -- Example Values: `10`, `9`, `8`, `20`, `15` | Value Statics: Total count 3652 - Distinct count 11 - Null count 13 ...
hockey
How many years did player Id "healygl01" play?
years of playing = MAX(year)-MIN(year)
SELECT COUNT(year) FROM Goalies WHERE playerID = 'healygl01'
CREATE TABLE Scoring ( tmID TEXT, -- PIM INTEGER, -- PostA TEXT, -- GTG TEXT, -- Example Values: `0`, `1`, `3`, `2`, `5` | Value Statics: Total count 28106 - Distinct count 8 - Null count 17861 PostGP TEXT, -- GP INTEGER, -- lgID TEXT, -- Example Values: `NHL`, `WHA`, `PCHA`, `WCHL`, `NHA` | Value S...
social_media
What gender of users posted the most tweets in `en`?
"en" is the language and refers to Lang = 'en'; most tweet in 'en' refers to Max(Count(text where Lang = 'en'))
SELECT T.Gender FROM ( SELECT T2.Gender, COUNT( text) AS num FROM twitter AS T1 INNER JOIN user AS T2 ON T1.UserID = T2.UserID WHERE T1.Lang = 'en' GROUP BY T2.Gender ) T ORDER BY T.num DESC LIMIT 1
CREATE TABLE location ( StateCode TEXT, -- LocationID INTEGER constraint location_pk primary key, City TEXT, -- Country TEXT, -- State TEXT, -- ); CREATE TABLE twitter ( Reach INTEGER, -- Lang TEXT, -- Klout INTEGER, -- foreign key (LocationID) references location(LocationID), Hour INTEGER, -- ...
bike_share_1
What was duration of the longest trip started on the day that has a maximum wind speed of 30 mph?
longest trip refers to MAX(duration); started on the day refers to start_date; maximum wind speed refers to max_wind_speed_mph; max_wind_speed_mph = 30;
SELECT T1.duration FROM trip AS T1 INNER JOIN weather AS T2 ON T2.zip_code = T1.zip_code WHERE T2.max_wind_Speed_mph = 30 ORDER BY T1.duration DESC LIMIT 1
CREATE TABLE weather ( zip_code TEXT, -- Example Values: `94107`, `94063`, `94301`, `94041`, `95113` | Value Statics: Total count 3665 - Distinct count 5 - Null count 0 max_visibility_miles INTEGER, -- Example Values: `10`, `9`, `8`, `20`, `15` | Value Statics: Total count 3652 - Distinct count 11 - Null count 13 ...
hockey
What is the percentage of American players among all the players who have gotten in the Hall of Fame?
percentage of American players = divide(count(hofID where birthCountry = 'USA'), count(hofID))*100%
SELECT CAST(COUNT(CASE WHEN T1.birthCountry = 'USA' THEN T1.playerID ELSE NULL END) AS REAL) * 100 / COUNT(T1.playerID) FROM Master AS T1 INNER JOIN HOF AS T2 ON T1.hofID = T2.hofID
CREATE TABLE Scoring ( tmID TEXT, -- PIM INTEGER, -- PostA TEXT, -- GTG TEXT, -- Example Values: `0`, `1`, `3`, `2`, `5` | Value Statics: Total count 28106 - Distinct count 8 - Null count 17861 PostGP TEXT, -- GP INTEGER, -- lgID TEXT, -- Example Values: `NHL`, `WHA`, `PCHA`, `WCHL`, `NHA` | Value S...
synthea
What condition forced Mrs. Joye Homenick to seek medical attention in 2017?
condition refers to conditions.DESCRIPTION; in 2017 refers to substr(conditions.START, 1, 4) = '2017';
SELECT T2.DESCRIPTION FROM patients AS T1 INNER JOIN conditions AS T2 ON T1.patient = T2.PATIENT WHERE T1.first = 'Joye' AND T1.last = 'Homenick' AND strftime('%Y', T2.START) = '2017'
CREATE TABLE immunizations ( foreign key (ENCOUNTER) references encounters(ID), CODE INTEGER, -- Example Values: `8`, `62`, `140`, `113`, `83` | Value Statics: Total count 13189 - Distinct count 16 - Null count 0 foreign key (PATIENT) references patients(patient), ENCOUNTER TEXT, -- PATIENT TEXT, -- DATE D...
cs_semester
Give the phone number of the only student who obtained "A" in the course "Intro to BlockChain".
A refers to an excellent grade in which grade = 'A' for the course;
SELECT T1.phone_number FROM student AS T1 INNER JOIN registration AS T2 ON T1.student_id = T2.student_id INNER JOIN course AS T3 ON T2.course_id = T3.course_id WHERE T3.name = 'Intro to BlockChain' AND T2.grade = 'A'
CREATE TABLE prof ( teachingability INTEGER, -- Example Values: `5`, `1`, `2`, `3`, `4` | Value Statics: Total count 10 - Distinct count 5 - Null count 0 gender TEXT, -- Example Values: `Male`, `Female` | Value Statics: Total count 10 - Distinct count 2 - Null count 0 email TEXT, -- Example Values: `npigford0@...
bike_share_1
What is the average duration of trips that ended on a foggy day?
ended on a foggy day refers to end_date where events = 'fog'; average duration = DIVIDE(SUM(duration), COUNT(duration));
SELECT AVG(T1.duration) FROM trip AS T1 INNER JOIN weather AS T2 ON T2.zip_code = T1.zip_code WHERE T2.events = 'Fog'
CREATE TABLE weather ( zip_code TEXT, -- Example Values: `94107`, `94063`, `94301`, `94041`, `95113` | Value Statics: Total count 3665 - Distinct count 5 - Null count 0 max_visibility_miles INTEGER, -- Example Values: `10`, `9`, `8`, `20`, `15` | Value Statics: Total count 3652 - Distinct count 11 - Null count 13 ...
hockey
What is the average BMI of all the coaches who have gotten in the Hall of Fame?
average BMI = divide(sum(divide(weight, multiply(height, height))), count(coachID))
SELECT SUM(T1.weight / (T1.height * T1.height)) / COUNT(T1.coachID) FROM Master AS T1 INNER JOIN HOF AS T2 ON T1.hofID = T2.hofID
CREATE TABLE Scoring ( tmID TEXT, -- PIM INTEGER, -- PostA TEXT, -- GTG TEXT, -- Example Values: `0`, `1`, `3`, `2`, `5` | Value Statics: Total count 28106 - Distinct count 8 - Null count 17861 PostGP TEXT, -- GP INTEGER, -- lgID TEXT, -- Example Values: `NHL`, `WHA`, `PCHA`, `WCHL`, `NHA` | Value S...
synthea
What is the start date of the care plan of the patient whose maiden name is Adams?
start date of the care plan refers to careplans.START;
SELECT DISTINCT T1.START FROM careplans AS T1 INNER JOIN patients AS T2 ON T1.PATIENT = T2.patient WHERE T2.maiden = 'Adams'
CREATE TABLE immunizations ( foreign key (ENCOUNTER) references encounters(ID), CODE INTEGER, -- Example Values: `8`, `62`, `140`, `113`, `83` | Value Statics: Total count 13189 - Distinct count 16 - Null count 0 foreign key (PATIENT) references patients(patient), ENCOUNTER TEXT, -- PATIENT TEXT, -- DATE D...
cs_semester
How many courses does Alvera McQuillin take?
null
SELECT COUNT(T1.course_id) FROM registration AS T1 INNER JOIN student AS T2 ON T1.student_id = T2.student_id WHERE T2.f_name = 'Alvera' AND T2.l_name = 'McQuillin'
CREATE TABLE prof ( teachingability INTEGER, -- Example Values: `5`, `1`, `2`, `3`, `4` | Value Statics: Total count 10 - Distinct count 5 - Null count 0 gender TEXT, -- Example Values: `Male`, `Female` | Value Statics: Total count 10 - Distinct count 2 - Null count 0 email TEXT, -- Example Values: `npigford0@...
bike_share_1
Which were the trips that started at Mountain View City Hall and ended on a rainy day?
started at refers to start_station_name; start_station_name = 'Mountain View City Hall'; ended on a rainy day refers to end_date where events = 'rain';
SELECT T1.id FROM trip AS T1 INNER JOIN weather AS T2 WHERE T2.events = 'Rain' AND T1.start_station_name = 'Mountain View City Hall'
CREATE TABLE weather ( zip_code TEXT, -- Example Values: `94107`, `94063`, `94301`, `94041`, `95113` | Value Statics: Total count 3665 - Distinct count 5 - Null count 0 max_visibility_miles INTEGER, -- Example Values: `10`, `9`, `8`, `20`, `15` | Value Statics: Total count 3652 - Distinct count 11 - Null count 13 ...
hockey
Please list the positions of the players who were born in Canada and have won the All-Rookie award.
born in Canada refers to birthCountry = 'Canada'; pos = 'LW' refers to left winger; pos = 'RW' refers to right winger; pos = 'C' refers to center; pos = 'G' refers to goalie; pos = 'D' refers to defenceman; pos = 'W' refers to winger; pos = 'F' refers to forward
SELECT DISTINCT T1.pos FROM Master AS T1 INNER JOIN AwardsPlayers AS T2 ON T1.playerID = T2.playerID WHERE T1.birthCountry = 'Canada' AND T2.award = 'All-Rookie'
CREATE TABLE Scoring ( tmID TEXT, -- PIM INTEGER, -- PostA TEXT, -- GTG TEXT, -- Example Values: `0`, `1`, `3`, `2`, `5` | Value Statics: Total count 28106 - Distinct count 8 - Null count 17861 PostGP TEXT, -- GP INTEGER, -- lgID TEXT, -- Example Values: `NHL`, `WHA`, `PCHA`, `WCHL`, `NHA` | Value S...
cs_semester
What is the percentage of students who get a "B" in the course "Computer Network"?
DIVIDE(COUNT(student_id(grade = 'B' and name = 'Computer Network')), COUNT(student_id where name = ' Computer Network')) as percentage;
SELECT CAST(SUM(CASE WHEN T1.grade = 'B' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.student_id) FROM registration AS T1 INNER JOIN course AS T2 ON T1.course_id = T2.course_id WHERE T2.name = 'Computer Network'
CREATE TABLE prof ( teachingability INTEGER, -- Example Values: `5`, `1`, `2`, `3`, `4` | Value Statics: Total count 10 - Distinct count 5 - Null count 0 gender TEXT, -- Example Values: `Male`, `Female` | Value Statics: Total count 10 - Distinct count 2 - Null count 0 email TEXT, -- Example Values: `npigford0@...
bike_share_1
Please list trips id started on the hottest day.
started refers to start_date; the hottest day refers to max_temperature_f;
SELECT T1.id FROM trip AS T1 INNER JOIN weather AS T2 ON T2.zip_code = T1.zip_code ORDER BY T2.max_temperature_f DESC LIMIT 1
CREATE TABLE weather ( zip_code TEXT, -- Example Values: `94107`, `94063`, `94301`, `94041`, `95113` | Value Statics: Total count 3665 - Distinct count 5 - Null count 0 max_visibility_miles INTEGER, -- Example Values: `10`, `9`, `8`, `20`, `15` | Value Statics: Total count 3652 - Distinct count 11 - Null count 13 ...
hockey
Which country has the most players in the Hall of Fame?
country refers to birthCountry
SELECT T1.birthCountry FROM Master AS T1 INNER JOIN HOF AS T2 ON T1.hofID = T2.hofID GROUP BY T1.birthCountry ORDER BY COUNT(T1.playerID) DESC LIMIT 1
CREATE TABLE Scoring ( tmID TEXT, -- PIM INTEGER, -- PostA TEXT, -- GTG TEXT, -- Example Values: `0`, `1`, `3`, `2`, `5` | Value Statics: Total count 28106 - Distinct count 8 - Null count 17861 PostGP TEXT, -- GP INTEGER, -- lgID TEXT, -- Example Values: `NHL`, `WHA`, `PCHA`, `WCHL`, `NHA` | Value S...
synthea
How many patients sought medical attention due to a second-degree burn? Describe the care plan recommended to them.
second-degree burn refers to encounters.REASONDESCRIPTION = 'Second degree burn'; ;
SELECT COUNT(DISTINCT T2.PATIENT), T2.DESCRIPTION FROM encounters AS T1 INNER JOIN careplans AS T2 ON T1.PATIENT = T2.PATIENT WHERE T2.REASONDESCRIPTION = 'Second degree burn'
CREATE TABLE immunizations ( foreign key (ENCOUNTER) references encounters(ID), CODE INTEGER, -- Example Values: `8`, `62`, `140`, `113`, `83` | Value Statics: Total count 13189 - Distinct count 16 - Null count 0 foreign key (PATIENT) references patients(patient), ENCOUNTER TEXT, -- PATIENT TEXT, -- DATE D...
cs_semester
Who were the students who failed the course "Applied Deep Learning"? Give the full name.
If grade is null or empty, it means that this student fails to pass the course in which grade = NULL;
SELECT T1.f_name, T1.l_name FROM student AS T1 INNER JOIN registration AS T2 ON T1.student_id = T2.student_id INNER JOIN course AS T3 ON T2.course_id = T3.course_id WHERE T3.name = 'Applied Deep Learning ' AND T2.grade IS NULL
CREATE TABLE prof ( teachingability INTEGER, -- Example Values: `5`, `1`, `2`, `3`, `4` | Value Statics: Total count 10 - Distinct count 5 - Null count 0 gender TEXT, -- Example Values: `Male`, `Female` | Value Statics: Total count 10 - Distinct count 2 - Null count 0 email TEXT, -- Example Values: `npigford0@...
bike_share_1
How many trips which start station and end station are the same?
start station refers to start_station_id; end station refers to end_station_id; start station and end station are the same refers to start_station_id = end_station_id;
SELECT SUM(IIF(start_station_id = end_station_id, 1, 0)) FROM trip
CREATE TABLE weather ( zip_code TEXT, -- Example Values: `94107`, `94063`, `94301`, `94041`, `95113` | Value Statics: Total count 3665 - Distinct count 5 - Null count 0 max_visibility_miles INTEGER, -- Example Values: `10`, `9`, `8`, `20`, `15` | Value Statics: Total count 3652 - Distinct count 11 - Null count 13 ...
hockey
Which country is the most award-winning player from?
most award-winning refers to max(count(award)); country player is from refers to birthCountry
SELECT T1.birthCountry FROM Master AS T1 INNER JOIN AwardsPlayers AS T2 ON T1.playerID = T2.playerID GROUP BY T1.birthCountry ORDER BY COUNT(T2.award) DESC LIMIT 1
CREATE TABLE Scoring ( tmID TEXT, -- PIM INTEGER, -- PostA TEXT, -- GTG TEXT, -- Example Values: `0`, `1`, `3`, `2`, `5` | Value Statics: Total count 28106 - Distinct count 8 - Null count 17861 PostGP TEXT, -- GP INTEGER, -- lgID TEXT, -- Example Values: `NHL`, `WHA`, `PCHA`, `WCHL`, `NHA` | Value S...
synthea
State description of medication taken by Joe Homenick.
description of medication refers to medications.DESCRIPTION;
SELECT T1.DESCRIPTION FROM medications AS T1 INNER JOIN patients AS T2 ON T1.PATIENT = T2.patient WHERE T2.first = 'Joye' AND T2.last = 'Homenick'
CREATE TABLE immunizations ( foreign key (ENCOUNTER) references encounters(ID), CODE INTEGER, -- Example Values: `8`, `62`, `140`, `113`, `83` | Value Statics: Total count 13189 - Distinct count 16 - Null count 0 foreign key (PATIENT) references patients(patient), ENCOUNTER TEXT, -- PATIENT TEXT, -- DATE D...
cs_semester
Among the most important courses, what is the name of the most difficult course?
Higher credit means more important in which most important refers to MAX(credit); diff refers to difficulty; the most difficult course refers to MAX(diff);
SELECT name FROM course WHERE credit = ( SELECT MAX(credit) FROM course ) AND diff = ( SELECT MAX(diff) FROM course )
CREATE TABLE prof ( teachingability INTEGER, -- Example Values: `5`, `1`, `2`, `3`, `4` | Value Statics: Total count 10 - Distinct count 5 - Null count 0 gender TEXT, -- Example Values: `Male`, `Female` | Value Statics: Total count 10 - Distinct count 2 - Null count 0 email TEXT, -- Example Values: `npigford0@...
bike_share_1
Please calculate the average duration of trips started at South Van Ness at Market in 2015.
started at refers to start_station_name; start_station_name = 'South Van Ness at Market'; average duration = DIVIDE(SUM(duration), COUNT(duration));
SELECT AVG(duration) FROM trip WHERE start_date LIKE '%2015%' AND start_station_name = 'South Van Ness at Market'
CREATE TABLE weather ( zip_code TEXT, -- Example Values: `94107`, `94063`, `94301`, `94041`, `95113` | Value Statics: Total count 3665 - Distinct count 5 - Null count 0 max_visibility_miles INTEGER, -- Example Values: `10`, `9`, `8`, `20`, `15` | Value Statics: Total count 3652 - Distinct count 11 - Null count 13 ...
hockey
Players born in which year have received the most awards in total?
received the most awards in total refers to max(count(award))
SELECT T1.birthYear FROM Master AS T1 INNER JOIN AwardsPlayers AS T2 ON T1.playerID = T2.playerID GROUP BY T1.birthYear ORDER BY COUNT(T2.award) DESC LIMIT 1
CREATE TABLE Scoring ( tmID TEXT, -- PIM INTEGER, -- PostA TEXT, -- GTG TEXT, -- Example Values: `0`, `1`, `3`, `2`, `5` | Value Statics: Total count 28106 - Distinct count 8 - Null count 17861 PostGP TEXT, -- GP INTEGER, -- lgID TEXT, -- Example Values: `NHL`, `WHA`, `PCHA`, `WCHL`, `NHA` | Value S...
cs_semester
What is the percentage of Professor Ogdon Zywicki's research assistants are taught postgraduate students?
research assistant refers to the student who serves for research where the abbreviation is RA; taught postgraduate student refers to type = 'TPG'; DIVIDE(COUNT(student_id where type = 'TPG' and first_name = 'Ogdon', last_name = 'Zywicki'), COUNT(first_name = 'Ogdon', last_name = 'Zywicki')) as percentage;
SELECT CAST(SUM(CASE WHEN T3.type = 'TPG' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.student_id) FROM RA AS T1 INNER JOIN prof AS T2 ON T1.prof_id = T2.prof_id INNER JOIN student AS T3 ON T1.student_id = T3.student_id WHERE T2.first_name = 'Ogdon' AND T2.last_name = 'Zywicki'
CREATE TABLE prof ( teachingability INTEGER, -- Example Values: `5`, `1`, `2`, `3`, `4` | Value Statics: Total count 10 - Distinct count 5 - Null count 0 gender TEXT, -- Example Values: `Male`, `Female` | Value Statics: Total count 10 - Distinct count 2 - Null count 0 email TEXT, -- Example Values: `npigford0@...
bike_share_1
How many trips in 2013 had durations longer than 1000 seconds?
trips in 2013 refers to start_date like'%2013%'; duration>1000;
SELECT COUNT(duration) FROM trip WHERE start_date LIKE '%/%/2013%' AND duration > 1000
CREATE TABLE weather ( zip_code TEXT, -- Example Values: `94107`, `94063`, `94301`, `94041`, `95113` | Value Statics: Total count 3665 - Distinct count 5 - Null count 0 max_visibility_miles INTEGER, -- Example Values: `10`, `9`, `8`, `20`, `15` | Value Statics: Total count 3652 - Distinct count 11 - Null count 13 ...
hockey
In which month was the player who has won the most awards born?
who has won the most awards refers to max(count(award)); the month player was born refers to birthMon
SELECT T1.birthMon FROM Master AS T1 INNER JOIN AwardsPlayers AS T2 ON T1.playerID = T2.playerID GROUP BY T2.playerID ORDER BY COUNT(T2.award) DESC LIMIT 1
CREATE TABLE Scoring ( tmID TEXT, -- PIM INTEGER, -- PostA TEXT, -- GTG TEXT, -- Example Values: `0`, `1`, `3`, `2`, `5` | Value Statics: Total count 28106 - Distinct count 8 - Null count 17861 PostGP TEXT, -- GP INTEGER, -- lgID TEXT, -- Example Values: `NHL`, `WHA`, `PCHA`, `WCHL`, `NHA` | Value S...
synthea
Please provide the dates on which Elly Koss was immunized with the influenza seasonal injectable preservative-free vaccine.
date of immunization refers to immunizations.DATE; immunized with the influenza seasonal injectable preservative-free vaccine refers to immunizations.DESCRIPTION = 'Influenza seasonal injectable preservative free';
SELECT T2.DATE FROM patients AS T1 INNER JOIN immunizations AS T2 ON T1.patient = T2.PATIENT WHERE T2.DESCRIPTION = 'Influenza seasonal injectable preservative free' AND T1.first = 'Elly' AND T1.last = 'Koss'
CREATE TABLE immunizations ( foreign key (ENCOUNTER) references encounters(ID), CODE INTEGER, -- Example Values: `8`, `62`, `140`, `113`, `83` | Value Statics: Total count 13189 - Distinct count 16 - Null count 0 foreign key (PATIENT) references patients(patient), ENCOUNTER TEXT, -- PATIENT TEXT, -- DATE D...
cs_semester
What is the full name of the professor who graduated from an Ivy League School?
Ivy League school is assembled by 8 universities: Brown University, Columbia University, Cornell University, Dartmouth College, Harvard University, Princeton University, University of Pennsylvania and Yale University;
SELECT first_name, last_name FROM prof WHERE graduate_from IN ( 'Brown University', 'Columbia University', 'Cornell University', 'Dartmouth College', 'Harvard University', 'Princeton University', 'University of Pennsylvania', 'Yale University' )
CREATE TABLE prof ( teachingability INTEGER, -- Example Values: `5`, `1`, `2`, `3`, `4` | Value Statics: Total count 10 - Distinct count 5 - Null count 0 gender TEXT, -- Example Values: `Male`, `Female` | Value Statics: Total count 10 - Distinct count 2 - Null count 0 email TEXT, -- Example Values: `npigford0@...
bike_share_1
What is the percentage of trips that started in San Jose and durations were longer than 800 seconds?
percentage of trips = DIVIDE(COUNT(duration>800), COUNT(duration)) as percentage; San Jose refers to city = 'San Jose'; duration>800;
SELECT CAST(SUM(CASE WHEN T1.duration > 800 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.id) FROM trip AS T1 INNER JOIN station AS T2 ON T2.name = T1.start_station_name WHERE T2.city = 'San Jose'
CREATE TABLE weather ( zip_code TEXT, -- Example Values: `94107`, `94063`, `94301`, `94041`, `95113` | Value Statics: Total count 3665 - Distinct count 5 - Null count 0 max_visibility_miles INTEGER, -- Example Values: `10`, `9`, `8`, `20`, `15` | Value Statics: Total count 3652 - Distinct count 11 - Null count 13 ...
hockey
Among the players who were born in July and August, how many of them got in the Hall of Fame?
born in July and August refers to birthMon IN('7','8')
SELECT COUNT(T1.playerID) FROM Master AS T1 INNER JOIN HOF AS T2 ON T1.hofID = T2.hofID WHERE T1.birthMon IN (7, 8)
CREATE TABLE Scoring ( tmID TEXT, -- PIM INTEGER, -- PostA TEXT, -- GTG TEXT, -- Example Values: `0`, `1`, `3`, `2`, `5` | Value Statics: Total count 28106 - Distinct count 8 - Null count 17861 PostGP TEXT, -- GP INTEGER, -- lgID TEXT, -- Example Values: `NHL`, `WHA`, `PCHA`, `WCHL`, `NHA` | Value S...
synthea
What is the percentage of Hispanic patients who stopped their care plan in 2011?
Hispanic patients refers to ethnicity = 'hispanic'; percentage = MULTIPLY(DIVIDE(COUNT(careplans.PATIENT WHERE ethnicity = 'hispanic'), COUNT(careplans.PATIENT)), 1.0); stopped their care plan in 2011 refers to substr(careplans.stop, 1, 4) = '2011';
SELECT CAST(SUM(CASE WHEN T2.race = 'hispanic' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.PATIENT) FROM careplans AS T1 INNER JOIN patients AS T2 ON T1.PATIENT = T2.patient WHERE strftime('%Y', T1.stop) = '2011'
CREATE TABLE immunizations ( foreign key (ENCOUNTER) references encounters(ID), CODE INTEGER, -- Example Values: `8`, `62`, `140`, `113`, `83` | Value Statics: Total count 13189 - Distinct count 16 - Null count 0 foreign key (PATIENT) references patients(patient), ENCOUNTER TEXT, -- PATIENT TEXT, -- DATE D...
social_media
How many female users reshared their tweets?
female users refers to Gender = 'Female'; reshare refers to IsReshare = 'TRUE'
SELECT COUNT(T1.UserID) FROM twitter AS T1 INNER JOIN user AS T2 ON T1.UserID = T2.UserID WHERE T2.Gender = 'Female' AND T1.IsReshare = 'TRUE'
CREATE TABLE location ( StateCode TEXT, -- LocationID INTEGER constraint location_pk primary key, City TEXT, -- Country TEXT, -- State TEXT, -- ); CREATE TABLE twitter ( Reach INTEGER, -- Lang TEXT, -- Klout INTEGER, -- foreign key (LocationID) references location(LocationID), Hour INTEGER, -- ...
bike_share_1
Which year had the most number of trips that started at stations in San Francisco?
started at station refers to start_station_name; San Francisco refers to city = 'San Francisco'; year that had the most number of trips refers to MAX(year(start_date));
SELECT SUBSTR(CAST(T1.start_date AS TEXT), INSTR(T1.start_date, ' '), -4) FROM trip AS T1 INNER JOIN station AS T2 ON T2.name = T1.start_station_name WHERE T2.city = 'San Francisco' GROUP BY T1.start_station_name ORDER BY COUNT(T1.id) DESC LIMIT 1
CREATE TABLE weather ( zip_code TEXT, -- Example Values: `94107`, `94063`, `94301`, `94041`, `95113` | Value Statics: Total count 3665 - Distinct count 5 - Null count 0 max_visibility_miles INTEGER, -- Example Values: `10`, `9`, `8`, `20`, `15` | Value Statics: Total count 3652 - Distinct count 11 - Null count 13 ...
hockey
Please list the nicknames of the players who have won the All-Rookie award and are born in March.
born in March refers to birthMon = '3'; nicknames refers to nameNick
SELECT DISTINCT T1.nameNick FROM Master AS T1 INNER JOIN AwardsPlayers AS T2 ON T1.playerID = T2.playerID WHERE T2.award = 'All-Rookie' AND T1.birthMon = 3
CREATE TABLE Scoring ( tmID TEXT, -- PIM INTEGER, -- PostA TEXT, -- GTG TEXT, -- Example Values: `0`, `1`, `3`, `2`, `5` | Value Statics: Total count 28106 - Distinct count 8 - Null count 17861 PostGP TEXT, -- GP INTEGER, -- lgID TEXT, -- Example Values: `NHL`, `WHA`, `PCHA`, `WCHL`, `NHA` | Value S...
cs_semester
Among the most popular professors, how many are females?
the most popular professors refers to prof_id where MAX(popularity); female refers to gender;
SELECT COUNT(prof_id) FROM prof WHERE gender = 'Female' AND popularity = ( SELECT MAX(popularity) FROM prof )
CREATE TABLE prof ( teachingability INTEGER, -- Example Values: `5`, `1`, `2`, `3`, `4` | Value Statics: Total count 10 - Distinct count 5 - Null count 0 gender TEXT, -- Example Values: `Male`, `Female` | Value Statics: Total count 10 - Distinct count 2 - Null count 0 email TEXT, -- Example Values: `npigford0@...
bike_share_1
Which trip had the shortest duration and started at the station that can hold 15 bikes?
shortest duration refers to MIN(duration); started at the station refers to start_station_name; can hold 15 bikes refers to dock_count = 15;
SELECT T1.id FROM trip AS T1 INNER JOIN station AS T2 ON T2.name = T1.start_station_name WHERE T2.dock_count = 15 AND T1.duration = ( SELECT MIN(T1.duration) FROM trip AS T1 LEFT JOIN station AS T2 ON T2.name = T1.start_station_name WHERE T2.dock_count = 15 )
CREATE TABLE weather ( zip_code TEXT, -- Example Values: `94107`, `94063`, `94301`, `94041`, `95113` | Value Statics: Total count 3665 - Distinct count 5 - Null count 0 max_visibility_miles INTEGER, -- Example Values: `10`, `9`, `8`, `20`, `15` | Value Statics: Total count 3652 - Distinct count 11 - Null count 13 ...
hockey
Please list the awards the players who died in Arlington have won.
died in Arlington refers to deathCity = 'Arlington'
SELECT T2.award FROM Master AS T1 INNER JOIN AwardsPlayers AS T2 ON T1.playerID = T2.playerID WHERE T1.deathCity = 'Kemptville'
CREATE TABLE Scoring ( tmID TEXT, -- PIM INTEGER, -- PostA TEXT, -- GTG TEXT, -- Example Values: `0`, `1`, `3`, `2`, `5` | Value Statics: Total count 28106 - Distinct count 8 - Null count 17861 PostGP TEXT, -- GP INTEGER, -- lgID TEXT, -- Example Values: `NHL`, `WHA`, `PCHA`, `WCHL`, `NHA` | Value S...
synthea
How many interactions did Lorri Simons have with medical professionals between 2010 and 2017? What percentage of encounters are attributed to prenatal visits?
between 2010 and 2017 refers to substr(encounters.DATE, 1, 4) between '2010' and '2017'; percentage = MULTIPLY(DIVIDE(COUNT(encounters.ID WHERE DESCRIPTION = 'Prenatal visit'), count(encounters.ID)), 1.0); prenatal visits refers to encounters.DESCRIPTION = 'Prenatal visit';
SELECT COUNT(T1.patient) , CAST(SUM(CASE WHEN T2.DESCRIPTION = 'Prenatal visit' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.patient) FROM patients AS T1 INNER JOIN encounters AS T2 ON T1.patient = T2.PATIENT WHERE T1.first = 'Lorri' AND T1.last = 'Simonis' AND strftime('%Y', T2.DATE) BETWEEN '2010' AND '2017'
CREATE TABLE immunizations ( foreign key (ENCOUNTER) references encounters(ID), CODE INTEGER, -- Example Values: `8`, `62`, `140`, `113`, `83` | Value Statics: Total count 13189 - Distinct count 16 - Null count 0 foreign key (PATIENT) references patients(patient), ENCOUNTER TEXT, -- PATIENT TEXT, -- DATE D...
cs_semester
How many courses have the highest difficulty?
diff refers to difficulty; diff is higher means the course is more difficult in which highest difficulty is expessed as diff = 5;
SELECT COUNT(course_id) FROM course WHERE diff = 5
CREATE TABLE prof ( teachingability INTEGER, -- Example Values: `5`, `1`, `2`, `3`, `4` | Value Statics: Total count 10 - Distinct count 5 - Null count 0 gender TEXT, -- Example Values: `Male`, `Female` | Value Statics: Total count 10 - Distinct count 2 - Null count 0 email TEXT, -- Example Values: `npigford0@...
bike_share_1
How many trips which subscription types were Subscriber and ended in San Jose city?
ended in refers to end_station_name;
SELECT COUNT(T1.subscription_type) FROM trip AS T1 INNER JOIN station AS T2 ON T2.name = T1.end_station_name WHERE T1.subscription_type = 'Subscriber' AND T2.city = 'San Jose'
CREATE TABLE weather ( zip_code TEXT, -- Example Values: `94107`, `94063`, `94301`, `94041`, `95113` | Value Statics: Total count 3665 - Distinct count 5 - Null count 0 max_visibility_miles INTEGER, -- Example Values: `10`, `9`, `8`, `20`, `15` | Value Statics: Total count 3652 - Distinct count 11 - Null count 13 ...
hockey
Among the players who died in Massachussets, how many of them have won an award?
died in Massachussets refers to deathState = 'Massachussets'
SELECT COUNT(DISTINCT T1.playerID) FROM Master AS T1 INNER JOIN AwardsPlayers AS T2 ON T1.playerID = T2.playerID WHERE T1.deathState = 'MA'
CREATE TABLE Scoring ( tmID TEXT, -- PIM INTEGER, -- PostA TEXT, -- GTG TEXT, -- Example Values: `0`, `1`, `3`, `2`, `5` | Value Statics: Total count 28106 - Distinct count 8 - Null count 17861 PostGP TEXT, -- GP INTEGER, -- lgID TEXT, -- Example Values: `NHL`, `WHA`, `PCHA`, `WCHL`, `NHA` | Value S...
synthea
What are the medical encounter ids of patients who were born in Pembroke MA US?
medical encounter ids careplans.ID; born in Pembroke MA US refers to birthplace = 'Pembroke MA US';
SELECT DISTINCT T1.ENCOUNTER FROM careplans AS T1 INNER JOIN patients AS T2 ON T1.PATIENT = T2.patient WHERE T2.birthplace = 'Pembroke MA US'
CREATE TABLE immunizations ( foreign key (ENCOUNTER) references encounters(ID), CODE INTEGER, -- Example Values: `8`, `62`, `140`, `113`, `83` | Value Statics: Total count 13189 - Distinct count 16 - Null count 0 foreign key (PATIENT) references patients(patient), ENCOUNTER TEXT, -- PATIENT TEXT, -- DATE D...
cs_semester
How many students got an A in Applied Deep Learning?
A refers to an excellent grade in which grade = 'A' for the course;
SELECT COUNT(T2.student_id) FROM course AS T1 INNER JOIN registration AS T2 ON T1.course_id = T2.course_id WHERE T2.grade = 'A' AND T1.name = 'Applied Deep Learning '
CREATE TABLE prof ( teachingability INTEGER, -- Example Values: `5`, `1`, `2`, `3`, `4` | Value Statics: Total count 10 - Distinct count 5 - Null count 0 gender TEXT, -- Example Values: `Male`, `Female` | Value Statics: Total count 10 - Distinct count 2 - Null count 0 email TEXT, -- Example Values: `npigford0@...
bike_share_1
Please list bikes id were used in trips which start station were installed in 2013.
start station refers to start_station_name; installed in 2013 refers to installation_date LIKE '%2013';
SELECT DISTINCT T1.bike_id FROM trip AS T1 INNER JOIN station AS T2 ON T2.name = T1.start_station_name WHERE T2.installation_date LIKE '%2013'
CREATE TABLE weather ( zip_code TEXT, -- Example Values: `94107`, `94063`, `94301`, `94041`, `95113` | Value Statics: Total count 3665 - Distinct count 5 - Null count 0 max_visibility_miles INTEGER, -- Example Values: `10`, `9`, `8`, `20`, `15` | Value Statics: Total count 3652 - Distinct count 11 - Null count 13 ...
hockey
Among the players who have won the All-Rookie award, how many of them have died?
have died refers to deathYear IS NOT NULL
SELECT COUNT(T1.playerID) FROM Master AS T1 INNER JOIN AwardsPlayers AS T2 ON T1.playerID = T2.playerID WHERE T2.award = 'All-Rookie' AND T1.deathYear IS NOT NULL
CREATE TABLE Scoring ( tmID TEXT, -- PIM INTEGER, -- PostA TEXT, -- GTG TEXT, -- Example Values: `0`, `1`, `3`, `2`, `5` | Value Statics: Total count 28106 - Distinct count 8 - Null count 17861 PostGP TEXT, -- GP INTEGER, -- lgID TEXT, -- Example Values: `NHL`, `WHA`, `PCHA`, `WCHL`, `NHA` | Value S...
cs_semester
How many students have the highest intelligence among those taking a bachelor's degree?
bachelor's degree is an undergraduate degree in which type = 'UG'; the highest intelligence refers to MAX(intelligence);
SELECT COUNT(student_id) FROM student WHERE type = 'UG' AND intelligence = ( SELECT MAX(intelligence) FROM student )
CREATE TABLE prof ( teachingability INTEGER, -- Example Values: `5`, `1`, `2`, `3`, `4` | Value Statics: Total count 10 - Distinct count 5 - Null count 0 gender TEXT, -- Example Values: `Male`, `Female` | Value Statics: Total count 10 - Distinct count 2 - Null count 0 email TEXT, -- Example Values: `npigford0@...
bike_share_1
Which trip id had the longest duration and the start station is in Redwood City?
longest duration refers to MAX(duration); start station refers to start_station_name;
SELECT T1.id FROM trip AS T1 LEFT JOIN station AS T2 ON T2.name = T1.start_station_name WHERE T2.city = 'Redwood City' AND T1.duration = ( SELECT MAX(T1.duration) FROM trip AS T1 LEFT JOIN station AS T2 ON T2.name = T1.start_station_name WHERE T2.city = 'Redwood City' )
CREATE TABLE weather ( zip_code TEXT, -- Example Values: `94107`, `94063`, `94301`, `94041`, `95113` | Value Statics: Total count 3665 - Distinct count 5 - Null count 0 max_visibility_miles INTEGER, -- Example Values: `10`, `9`, `8`, `20`, `15` | Value Statics: Total count 3652 - Distinct count 11 - Null count 13 ...
hockey
How many players born in Toronto have won the All-Rookie award?
born in Toronto refers to birthCity = 'Toronto'
SELECT COUNT(T1.playerID) FROM Master AS T1 INNER JOIN AwardsPlayers AS T2 ON T1.playerID = T2.playerID WHERE T2.award = 'All-Rookie' AND T1.birthCity = 'Toronto'
CREATE TABLE Scoring ( tmID TEXT, -- PIM INTEGER, -- PostA TEXT, -- GTG TEXT, -- Example Values: `0`, `1`, `3`, `2`, `5` | Value Statics: Total count 28106 - Distinct count 8 - Null count 17861 PostGP TEXT, -- GP INTEGER, -- lgID TEXT, -- Example Values: `NHL`, `WHA`, `PCHA`, `WCHL`, `NHA` | Value S...
synthea
Among the male patients, who has the earliest starting date of the care plan?
male patients refers to gender = 'M'; earliest starting date of the care plan refers to MIN(careplans.START);
SELECT T2.first, T2.last FROM careplans AS T1 INNER JOIN patients AS T2 ON T1.PATIENT = T2.patient WHERE T2.gender = 'M' ORDER BY T1.START LIMIT 1
CREATE TABLE immunizations ( foreign key (ENCOUNTER) references encounters(ID), CODE INTEGER, -- Example Values: `8`, `62`, `140`, `113`, `83` | Value Statics: Total count 13189 - Distinct count 16 - Null count 0 foreign key (PATIENT) references patients(patient), ENCOUNTER TEXT, -- PATIENT TEXT, -- DATE D...
cs_semester
How many courses does the student with the highest GPA this semester take?
student with the highest GPA refers to student_id where MAX(gpa);
SELECT COUNT(course_id) FROM registration WHERE student_id IN ( SELECT student_id FROM student WHERE gpa = ( SELECT MAX(gpa) FROM student ) )
CREATE TABLE prof ( teachingability INTEGER, -- Example Values: `5`, `1`, `2`, `3`, `4` | Value Statics: Total count 10 - Distinct count 5 - Null count 0 gender TEXT, -- Example Values: `Male`, `Female` | Value Statics: Total count 10 - Distinct count 2 - Null count 0 email TEXT, -- Example Values: `npigford0@...
bike_share_1
In 2006, how many trips ended at stations in Mountain View?
in 2006 refers to start_date LIKE'%2006%'; ended at station refers to end_station_name; Mountain View refers to city = 'Mountain View';
SELECT COUNT(T2.city) FROM trip AS T1 INNER JOIN station AS T2 ON T2.name = T1.end_station_name WHERE T2.city = 'Mountain View' AND T1.start_date LIKE '%2006%'
CREATE TABLE weather ( zip_code TEXT, -- Example Values: `94107`, `94063`, `94301`, `94041`, `95113` | Value Statics: Total count 3665 - Distinct count 5 - Null count 0 max_visibility_miles INTEGER, -- Example Values: `10`, `9`, `8`, `20`, `15` | Value Statics: Total count 3652 - Distinct count 11 - Null count 13 ...
hockey
Please list the birth cities of the players who have won an award in the year 1970.
null
SELECT DISTINCT T1.birthCity FROM Master AS T1 INNER JOIN AwardsPlayers AS T2 ON T1.playerID = T2.playerID WHERE T2.year = 1970
CREATE TABLE Scoring ( tmID TEXT, -- PIM INTEGER, -- PostA TEXT, -- GTG TEXT, -- Example Values: `0`, `1`, `3`, `2`, `5` | Value Statics: Total count 28106 - Distinct count 8 - Null count 17861 PostGP TEXT, -- GP INTEGER, -- lgID TEXT, -- Example Values: `NHL`, `WHA`, `PCHA`, `WCHL`, `NHA` | Value S...
cs_semester
How many research postgraduate students are there?
research postgraduate student refers to type = 'RPG';
SELECT COUNT(student_id) FROM student WHERE type = 'RPG'
CREATE TABLE prof ( teachingability INTEGER, -- Example Values: `5`, `1`, `2`, `3`, `4` | Value Statics: Total count 10 - Distinct count 5 - Null count 0 gender TEXT, -- Example Values: `Male`, `Female` | Value Statics: Total count 10 - Distinct count 2 - Null count 0 email TEXT, -- Example Values: `npigford0@...
bike_share_1
How many stations in San Francisco are installed in 2014?
stations refers to name; San Francisco refers to city = 'San Francisco'; installed in 2004 refers to installation_date like'%2014';
SELECT SUM(CASE WHEN city = 'San Francisco' AND SUBSTR(installation_date, -4) = '2014' THEN 1 ELSE 0 END) FROM station
CREATE TABLE weather ( zip_code TEXT, -- Example Values: `94107`, `94063`, `94301`, `94041`, `95113` | Value Statics: Total count 3665 - Distinct count 5 - Null count 0 max_visibility_miles INTEGER, -- Example Values: `10`, `9`, `8`, `20`, `15` | Value Statics: Total count 3652 - Distinct count 11 - Null count 13 ...
hockey
Among the players who became coaches, how many of them have gotten in the Hall of Fame?
players who became coaches refers to playerID IS NOT NULL AND coachID IS NOT NULL
SELECT COUNT(T1.playerID) FROM Master AS T1 INNER JOIN HOF AS T2 ON T1.hofID = T2.hofID WHERE T1.playerID IS NOT NULL AND T1.coachID IS NOT NULL
CREATE TABLE Scoring ( tmID TEXT, -- PIM INTEGER, -- PostA TEXT, -- GTG TEXT, -- Example Values: `0`, `1`, `3`, `2`, `5` | Value Statics: Total count 28106 - Distinct count 8 - Null count 17861 PostGP TEXT, -- GP INTEGER, -- lgID TEXT, -- Example Values: `NHL`, `WHA`, `PCHA`, `WCHL`, `NHA` | Value S...
synthea
Mention the description of the care plan of American patients.
American refers to ethnicity = 'american';
SELECT DISTINCT T1.DESCRIPTION FROM careplans AS T1 INNER JOIN patients AS T2 ON T1.PATIENT = T2.patient WHERE T2.ethnicity = 'american'
CREATE TABLE immunizations ( foreign key (ENCOUNTER) references encounters(ID), CODE INTEGER, -- Example Values: `8`, `62`, `140`, `113`, `83` | Value Statics: Total count 13189 - Distinct count 16 - Null count 0 foreign key (PATIENT) references patients(patient), ENCOUNTER TEXT, -- PATIENT TEXT, -- DATE D...
cs_semester
Among the easiest courses, what is the name of the course where most students got an A?
diff refers to difficulty; the easiest courses refers to diff = 1; A refers to an excellent grade in which grade = 'A' for the course;
SELECT T2.name FROM registration AS T1 INNER JOIN course AS T2 ON T1.course_id = T2.course_id WHERE T1.grade = 'A' AND T2.diff = 1 GROUP BY T2.name ORDER BY COUNT(T1.student_id) DESC LIMIT 1
CREATE TABLE prof ( teachingability INTEGER, -- Example Values: `5`, `1`, `2`, `3`, `4` | Value Statics: Total count 10 - Distinct count 5 - Null count 0 gender TEXT, -- Example Values: `Male`, `Female` | Value Statics: Total count 10 - Distinct count 2 - Null count 0 email TEXT, -- Example Values: `npigford0@...
bike_share_1
List the name and city of starting stations which has an above-average duration trips.
starting stations refers to start_station_name; above average duration trips = DIVIDE(SUM(duration), COUNT(main_trip.id))<duration;
SELECT DISTINCT T1.start_station_name, T2.city FROM trip AS T1 INNER JOIN station AS T2 ON T2.name = T1.start_station_name WHERE T1.duration > ( SELECT AVG(T1.duration) FROM trip AS T1 LEFT JOIN station AS T2 ON T2.name = T1.start_station_name )
CREATE TABLE weather ( zip_code TEXT, -- Example Values: `94107`, `94063`, `94301`, `94041`, `95113` | Value Statics: Total count 3665 - Distinct count 5 - Null count 0 max_visibility_miles INTEGER, -- Example Values: `10`, `9`, `8`, `20`, `15` | Value Statics: Total count 3652 - Distinct count 11 - Null count 13 ...
hockey
Please list the first name of the players who are good at both left hands and right hands for goalie and have gotten in the Hall of Fame.
good at both left hands and right hands for goalie refers to shootCatch IS NULL
SELECT DISTINCT T1.firstName, T1.lastName FROM Master AS T1 INNER JOIN HOF AS T2 ON T1.hofID = T2.hofID WHERE T1.shootCatch IS NULL
CREATE TABLE Scoring ( tmID TEXT, -- PIM INTEGER, -- PostA TEXT, -- GTG TEXT, -- Example Values: `0`, `1`, `3`, `2`, `5` | Value Statics: Total count 28106 - Distinct count 8 - Null count 17861 PostGP TEXT, -- GP INTEGER, -- lgID TEXT, -- Example Values: `NHL`, `WHA`, `PCHA`, `WCHL`, `NHA` | Value S...