context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_11255 (
"Language/dialect" text,
"Mana" text,
"Kamu" text,
"Mahu" text,
"Pergi" text,
"Dengan" text,
"Basikal" text,
"Boleh" text,
"-kah (atau tidak)" text,
"Saya" text,
"Ikut" text
) | what is the language/dialect when basikal is sepeda and boleh is bulih? | SELECT "Language/dialect" FROM table_11255 WHERE "Basikal" = 'sepeda' AND "Boleh" = 'bulih' | wikisql |
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
outtime time
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CR... | which are the four most frequently given procedures for patients who were diagnosed with fall nos previously within the same hospital visit during this year? | SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime, admissions.hadm_id FROM diagnoses_icd JOIN admissions ON diagnoses_i... | mimic_iii |
CREATE TABLE table_name_51 (
played INTEGER,
points VARCHAR,
goals_conceded VARCHAR
) | When goals conceded is greater than 17 with 37 points, what is the greatest played? | SELECT MAX(played) FROM table_name_51 WHERE points = 37 AND goals_conceded > 17 | sql_create_context |
CREATE TABLE jyjgzbb (
JYZBLSH text,
YLJGDM text,
BGDH text,
BGRQ time,
JYRQ time,
JCRGH text,
JCRXM text,
SHRGH text,
SHRXM text,
JCXMMC text,
JCZBDM text,
JCFF text,
JCZBMC text,
JCZBJGDX text,
JCZBJGDL number,
JCZBJGDW text,
SBBM text,
YQBH text... | 看一下门诊43110591340就诊的诊断编码和名称是什么 | SELECT JZZDBM, JZZDSM FROM mzjzjlb WHERE JZLSH = '43110591340' | css |
CREATE TABLE table_19449 (
"Position" text,
"Number" real,
"Name" text,
"Height" text,
"Weight" text,
"Class" text,
"Hometown" text,
"Games\u2191" real
) | What are all names for the position FS? | SELECT "Name" FROM table_19449 WHERE "Position" = 'FS' | wikisql |
CREATE TABLE table_204_309 (
id number,
"model" text,
"released" number,
"usage" text,
"features" text,
"storage" text
) | the most recent version to be released was in 1989 , what was it called ? | SELECT "model" FROM table_204_309 WHERE "released" = 1989 | squall |
CREATE TABLE course_offering (
offering_id int,
course_id int,
semester int,
section_number int,
start_time time,
end_time time,
monday varchar,
tuesday varchar,
wednesday varchar,
thursday varchar,
friday varchar,
saturday varchar,
sunday varchar,
has_final_proje... | To meet the Core requirement which courses can I take in the Fall or Winter semester ? | SELECT DISTINCT COURSEalias0.department, COURSEalias0.name, COURSEalias0.number, SEMESTERalias0.semester FROM (SELECT course_id FROM student_record WHERE earn_credit = 'Y' AND student_id = 1) AS DERIVED_TABLEalias0, course AS COURSEalias0, course_offering AS COURSE_OFFERINGalias0, program_course AS PROGRAM_COURSEalias0... | advising |
CREATE TABLE table_4432 (
"Pick" text,
"Player" text,
"Position" text,
"Nationality" text,
"NHL team" text,
"College/junior/club team" text
) | What is the pick number for Ray Giroux? | SELECT "Pick" FROM table_4432 WHERE "Player" = 'ray giroux' | wikisql |
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
) | List the first and last name of the students who do not have any food type allergy. | 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") | sql_create_context |
CREATE TABLE table_28235 (
"NSG Nr." real,
"Name of the nature reserve" text,
"District / Town" text,
"Area (ha)" text,
"Date established" text
) | What Nature reserve number was established on 19961220 20.12.1996 | SELECT MIN("NSG Nr.") FROM table_28235 WHERE "Date established" = '19961220 20.12.1996' | wikisql |
CREATE TABLE College (
cName varchar(20),
state varchar(2),
enr numeric(5,0)
)
CREATE TABLE Tryout (
pID numeric(5,0),
cName varchar(20),
pPos varchar(8),
decision varchar(3)
)
CREATE TABLE Player (
pID numeric(5,0),
pName varchar(20),
yCard varchar(3),
HS numeric(5,0)
) | Show the smallest enrollment of each state, and could you rank in ascending by the total number? | SELECT state, MIN(enr) FROM College GROUP BY state ORDER BY MIN(enr) | nvbench |
CREATE TABLE table_80228 (
"Year" text,
"Start" text,
"Qual" text,
"Rank" text,
"Finish" text,
"Laps" real
) | In 1939, what was the finish? | SELECT "Finish" FROM table_80228 WHERE "Year" = '1939' | wikisql |
CREATE TABLE jybgb (
YLJGDM text,
YLJGDM_MZJZJLB text,
YLJGDM_ZYJZJLB text,
BGDH text,
BGRQ time,
JYLX number,
JZLSH text,
JZLSH_MZJZJLB text,
JZLSH_ZYJZJLB text,
JZLX number,
KSBM text,
KSMC text,
SQRGH text,
SQRXM text,
BGRGH text,
BGRXM text,
SHRGH ... | 在医疗就诊40465384086中给许慧英这个病人做检验的科室是哪些?对应的编码是什么 | SELECT JYKSBM, JYKSMC FROM jybgb WHERE JZLSH = '40465384086' | css |
CREATE TABLE table_49276 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Record" text,
"Points" real
) | What was the score on november 21? | SELECT "Score" FROM table_49276 WHERE "Date" = 'november 21' | wikisql |
CREATE TABLE table_28077 (
"No." real,
"#" real,
"Episode" text,
"Writer" text,
"Director" text,
"Original air date" text,
"Viewing figure" real
) | Who directed the episode directed by colin teague? | SELECT "Writer" FROM table_28077 WHERE "Director" = 'Colin Teague' | wikisql |
CREATE TABLE state (
state_code text,
state_name text,
country_name text
)
CREATE TABLE ground_service (
city_code text,
airport_code text,
transport_type text,
ground_fare int
)
CREATE TABLE days (
days_code varchar,
day_name varchar
)
CREATE TABLE restriction (
restriction_c... | list all AA flights from PHOENIX to MILWAUKEE which arrive on wednesday after 1600 | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE (((((((flight.arrival_time < 41 OR flight.time_elapsed >= 60) AND flight.departure_time > flight.arrival_time) AND date_day.day_number = 23 AND d... | atis |
CREATE TABLE table_name_17 (
haat VARCHAR,
channels_tv___rf VARCHAR
) | Which HAAT has a Channels TV / RF of 31 (psip) 44 (uhf) | SELECT haat FROM table_name_17 WHERE channels_tv___rf = "31 (psip) 44 (uhf)" | sql_create_context |
CREATE TABLE table_name_27 (
score VARCHAR,
leading_scorer VARCHAR
) | What is the score of the game with Manu gin bili (44) as the leading scorer? | SELECT score FROM table_name_27 WHERE leading_scorer = "manu ginóbili (44)" | sql_create_context |
CREATE TABLE table_name_84 (
byes INTEGER,
draws INTEGER
) | How many byes when the draws are fewer than 0? | SELECT AVG(byes) FROM table_name_84 WHERE draws < 0 | sql_create_context |
CREATE TABLE Rooms (
RoomId TEXT,
roomName TEXT,
beds INTEGER,
bedType TEXT,
maxOccupancy INTEGER,
basePrice INTEGER,
decor TEXT
)
CREATE TABLE Reservations (
Code INTEGER,
Room TEXT,
CheckIn TEXT,
CheckOut TEXT,
Rate REAL,
LastName TEXT,
FirstName TEXT,
Adul... | Compare the frequency of the decor of rooms that have a king bed using a bar chart. | SELECT decor, COUNT(decor) FROM Rooms WHERE bedType = 'King' GROUP BY decor ORDER BY basePrice | nvbench |
CREATE TABLE student (
stu_num number,
stu_lname text,
stu_fname text,
stu_init text,
stu_dob time,
stu_hrs number,
stu_class text,
stu_gpa number,
stu_transfer number,
dept_code text,
stu_phone text,
prof_num number
)
CREATE TABLE professor (
emp_num number,
dep... | What is the first name, gpa and phone number of the top 5 students with highest gpa? | SELECT stu_gpa, stu_phone, stu_fname FROM student ORDER BY stu_gpa DESC LIMIT 5 | spider |
CREATE TABLE table_45500 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | What is High Assists, when Date is 'November 1'? | SELECT "High assists" FROM table_45500 WHERE "Date" = 'november 1' | wikisql |
CREATE TABLE table_37612 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" real,
"Record" text
) | Who's the opponent of the game with the record 64-51? | SELECT "Opponent" FROM table_37612 WHERE "Record" = '64-51' | wikisql |
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
outtime time
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
... | calculate the number of times patient 1862 has been tested in the total protein, body fluid laboratory until 4 years ago. | SELECT COUNT(*) FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'total protein, body fluid') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 1862) AND DATETIME(labevents.charttime) <= DATETIME(CURRENT_TIME(), '... | mimic_iii |
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescription text,
CreationDate time,
CreationModeratorId number,
ApprovalDa... | Where did I meet this user (only comments). | SELECT * FROM (SELECT * FROM (SELECT (CASE WHEN PostTypeId = 2 THEN ParentId ELSE P.Id END) AS Id FROM Posts AS P JOIN Comments AS C1 ON C1.PostId = P.Id LEFT JOIN Comments AS C2 ON C2.PostId = P.Id WHERE (P.PostTypeId = 1 OR P.PostTypeId = 2) AND ((P.OwnerUserId = '##UserId##' AND C1.UserId = '##OtherUser##') OR (P.Ow... | sede |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | find the number of male patients who have black/african american ethnic background. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "M" AND demographic.ethnicity = "BLACK/AFRICAN AMERICAN" | mimicsql_data |
CREATE TABLE table_name_69 (
president VARCHAR,
elected VARCHAR
) | What president was elected in 2010? | SELECT president FROM table_name_69 WHERE elected = 2010 | sql_create_context |
CREATE TABLE table_49105 (
"Rider" text,
"Manufacturer" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
) | How many Laps have a Grid larger than 9, and a Time/Retired of +32.354? | SELECT COUNT("Laps") FROM table_49105 WHERE "Grid" > '9' AND "Time/Retired" = '+32.354' | wikisql |
CREATE TABLE railway (
LOCATION VARCHAR
) | Show the locations that have more than one railways. | SELECT LOCATION FROM railway GROUP BY LOCATION HAVING COUNT(*) > 1 | sql_create_context |
CREATE TABLE table_name_80 (
time_to_ft__m__at_40 VARCHAR,
shell__lb_ VARCHAR,
max_height__ft_ VARCHAR
) | What is the amount of time (sum) at 40 that it takes a 16 lb shell to reach a maximum of no more than 22,000 ft? | SELECT COUNT(time_to_ft__m__at_40) AS °__seconds_ FROM table_name_80 WHERE shell__lb_ = 16 AND max_height__ft_ < 22 OFFSET 000 | sql_create_context |
CREATE TABLE table_name_50 (
record VARCHAR,
number VARCHAR
) | What's the record of game number 23? | SELECT record FROM table_name_50 WHERE number = 23 | sql_create_context |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | what is procedure short title of procedure icd9 code 540? | SELECT procedures.short_title FROM procedures WHERE procedures.icd9_code = "540" | mimicsql_data |
CREATE TABLE table_name_21 (
open_cup VARCHAR,
reg_season VARCHAR
) | What open cup did they play in when they finished 2nd, northeast in the reg. season? | SELECT open_cup FROM table_name_21 WHERE reg_season = "2nd, northeast" | sql_create_context |
CREATE TABLE table_name_33 (
chassis VARCHAR,
engine VARCHAR,
year VARCHAR,
team VARCHAR
) | What is the Chassis of the Cooper Car Company after 1965 when the engine was a Maserati v12? | SELECT chassis FROM table_name_33 WHERE year > 1965 AND team = "cooper car company" AND engine = "maserati v12" | sql_create_context |
CREATE TABLE table_4102 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | What is the location for the game on October 20 with it's corresponding attendance? | SELECT "Location Attendance" FROM table_4102 WHERE "Date" = 'October 20' | wikisql |
CREATE TABLE table_31393 (
"Season" text,
"Season premiere" text,
"Season finale" text,
"TV season" text,
"Ranking" text,
"Viewers (in millions)" text
) | When did the season finale for the January 9, 2000 season premiere first air? | SELECT "Season finale" FROM table_31393 WHERE "Season premiere" = 'January 9, 2000' | wikisql |
CREATE TABLE enrollments (
campus number,
year number,
totalenrollment_ay number,
fte_ay number
)
CREATE TABLE discipline_enrollments (
campus number,
discipline number,
year number,
undergraduate number,
graduate number
)
CREATE TABLE faculty (
campus number,
year number,
... | How many universities have a campus fee greater than the average? | SELECT COUNT(*) FROM csu_fees WHERE campusfee > (SELECT AVG(campusfee) FROM csu_fees) | spider |
CREATE TABLE table_name_49 (
first_pref_votes VARCHAR,
_percentage_of_seats VARCHAR
) | Which First Pref votes have a % of seats of 0.8? | SELECT first_pref_votes FROM table_name_49 WHERE _percentage_of_seats = "0.8" | sql_create_context |
CREATE TABLE table_203_614 (
id number,
"#" number,
"date" text,
"venue" text,
"opponent" text,
"score" text,
"result" text,
"competition" text
) | where was the last venue before the opponent colombia ? | SELECT "venue" FROM table_203_614 WHERE "date" < (SELECT "date" FROM table_203_614 WHERE "opponent" = 'colombia') ORDER BY "date" DESC LIMIT 1 | squall |
CREATE TABLE table_name_83 (
pick INTEGER,
school VARCHAR,
round VARCHAR
) | What is the lowest pick from the Furman School that is a round smaller than 8? | SELECT MIN(pick) FROM table_name_83 WHERE school = "furman" AND round < 8 | sql_create_context |
CREATE TABLE table_204_445 (
id number,
"year" number,
"competition" text,
"venue" text,
"position" text,
"notes" text
) | how many championships did he compete in ? | SELECT COUNT("competition") FROM table_204_445 | squall |
CREATE TABLE table_train_170 (
"id" int,
"alt" float,
"hemoglobin_a1c_hba1c" float,
"ast" float,
"allergy_to_peanuts" bool,
"a1c" float,
"bilirubin" float,
"NOUSE" float
) | a1c = 9 _ 12 % | SELECT * FROM table_train_170 WHERE a1c >= 9 AND a1c <= 12 | criteria2sql |
CREATE TABLE table_22899 (
"Series No." real,
"Season No." real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"U.K. viewers (million)" text
) | When did the episode titled 'The Fashion Show' air for the first time? | SELECT "Original air date" FROM table_22899 WHERE "Title" = 'The Fashion Show' | wikisql |
CREATE TABLE table_26615633_3 (
sweet VARCHAR,
voice_actor VARCHAR
) | what is the sweet for voice actor saki fujita? | SELECT sweet FROM table_26615633_3 WHERE voice_actor = "Saki Fujita" | sql_create_context |
CREATE TABLE jybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH text,
BGJGDM text,
BGJGMC text,
BGRGH text,
BGRQ time,
BGRXM text,
BGSJ time,
CJRQ time,
JSBBRQSJ time,
JSBBSJ time,
JYBBH text,
JYJGMC text,
JYJSGH text,
JYJSQM text,
JY... | 有多少病人被门诊诊断为阿尔茨海默病?列出他们的籍贯代码、名称以及相应人数 | SELECT hz_info.person_info_JGDM, hz_info.person_info_JGMC, COUNT(hz_info.RYBH) FROM hz_info JOIN mzjzjlb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE mzjzjlb.JZZDSM = '阿尔茨海默病' GROUP BY hz_info.person_info_JGDM | css |
CREATE TABLE table_68471 (
"!Aces" real,
"Player" real,
"Opponent" text,
"Round" text,
"Year" text,
"Event" real,
"Surface" text,
"Sets" text
) | Who was the opponent in the 2011 event with less than 113 players? | SELECT "Opponent" FROM table_68471 WHERE "Player" < '113' AND "Event" = '2011' | wikisql |
CREATE TABLE table_26771 (
"Conference" text,
"Regular Season Winner" text,
"Conference Player of the Year" text,
"Conference Tournament" text,
"Tournament Venue (City)" text,
"Tournament Winner" text
) | List the tournament that kent state won? | SELECT "Conference Tournament" FROM table_26771 WHERE "Tournament Winner" = 'Kent State' | wikisql |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
C... | find the number of living patients who had procedure icd9 code 3891. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.expire_flag = "0" AND procedures.icd9_code = "3891" | mimicsql_data |
CREATE TABLE table_41888 (
"Month, year" text,
"Sunk by U-Boat" real,
"Sunk by aircraft" real,
"Sunk by warship or raider" real,
"Sunk by mines" real,
"German submarines lost" real
) | What is the month and year less than 106005 were sunk by aircraft and 61857 were sunk by warship or raider? | SELECT "Month, year" FROM table_41888 WHERE "Sunk by aircraft" < '106005' AND "Sunk by warship or raider" = '61857' | wikisql |
CREATE TABLE table_203_195 (
id number,
"pump type and source" text,
"typical use" text,
"35 \u00b0c\n(e.g. heated screed floor)" number,
"45 \u00b0c\n(e.g. heated screed floor)" number,
"55 \u00b0c\n(e.g. heated timber floor)" number,
"65 \u00b0c\n(e.g. radiator or dhw)" number,
"75 \u0... | which pump had the top cop variation at 35 degrees celsius ? | SELECT "pump type and source" FROM table_203_195 ORDER BY "35 \u00b0c\n(e.g. heated screed floor)" DESC LIMIT 1 | squall |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | what is the number of patients whose diagnoses long title is personal history of malignant neoplasm of rectum, rectosigmoid junction, and anus and drug type is base? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.long_title = "Personal history of malignant neoplasm of rectum, rectosigmoid junction, and anus" AND pres... | mimicsql_data |
CREATE TABLE Student (
Advisor VARCHAR,
StuID VARCHAR
) | Who is the advisor of student with ID 1004? | SELECT Advisor FROM Student WHERE StuID = 1004 | sql_create_context |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures (
... | what is the drug type of the drug hydrocerin? | SELECT prescriptions.drug_type FROM prescriptions WHERE prescriptions.drug = "Hydrocerin" | mimicsql_data |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
... | what were the five most commonly prescribed drugs for patients who had received administration of electrolytes - intravenous earlier in the same month since 6 years ago? | SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'administration of electrolytes - intravenous' AND ... | eicu |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE vitalperiodic (
vitalperio... | how many patients have received a stress ulcer prophylaxis - ranitidine two times? | SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, COUNT(*) AS c1 FROM patient WHERE patient.patientunitstayid = (SELECT treatment.patientunitstayid FROM treatment WHERE treatment.treatmentname = 'stress ulcer prophylaxis - ranitidine') GROUP BY patient.uniquepid) AS t1 WHERE t1.c1 = 2 | eicu |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code tex... | tell me the first specimen test that patient 031-3355 was given in this hospital encounter? | SELECT microlab.culturesite FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-3355' AND patient.hospitaldischargetime IS NULL)) ORDER BY microla... | eicu |
CREATE TABLE table_2370579_1 (
directed_by VARCHAR,
written_by VARCHAR
) | Who directed the episode written by Tony O'Grady (pseudonym of brian clemens)? | SELECT directed_by FROM table_2370579_1 WHERE written_by = "Tony O'Grady (pseudonym of Brian Clemens)" | sql_create_context |
CREATE TABLE table_66904 (
"Territory" text,
"Broadcaster" text,
"Channel" real,
"Launched" text,
"Closed" text
) | When did channel 83 in singapore launch? | SELECT "Launched" FROM table_66904 WHERE "Territory" = 'singapore' AND "Channel" = '83' | wikisql |
CREATE TABLE course (
course_id int,
name varchar,
department varchar,
number varchar,
credits varchar,
advisory_requirement varchar,
enforced_requirement varchar,
description varchar,
num_semesters int,
num_enrolled int,
has_discussion varchar,
has_lab varchar,
has_p... | When is the CAAS 216 morning course ? | SELECT DISTINCT course_offering.end_time, course_offering.start_time, semester.semester, semester.year FROM course, course_offering, semester WHERE course_offering.start_time < '12:00:00' AND course_offering.start_time >= '08:00:00' AND course.course_id = course_offering.course_id AND course.department = 'CAAS' AND cou... | advising |
CREATE TABLE table_10321124_1 (
salmonella VARCHAR,
shigella VARCHAR
) | what's the salmonella with shigella being ipgc | SELECT salmonella FROM table_10321124_1 WHERE shigella = "IpgC" | sql_create_context |
CREATE TABLE people (
Birth_Place VARCHAR
) | What are the birth places that are shared by at least two people? | SELECT Birth_Place FROM people GROUP BY Birth_Place HAVING COUNT(*) >= 2 | sql_create_context |
CREATE TABLE table_name_23 (
score VARCHAR,
home VARCHAR,
visitor VARCHAR
) | What was the score of the game that Washington played at home against Florida? | SELECT score FROM table_name_23 WHERE home = "washington" AND visitor = "florida" | sql_create_context |
CREATE TABLE fgwyjzb (
CLINIC_ID text,
CLINIC_TYPE text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
... | 列出在医院8013694中方语诗患者就诊科室名称包含全科的所有医疗就诊记录都有什么? | SELECT * FROM gwyjzb WHERE gwyjzb.PERSON_NM = '方语诗' AND gwyjzb.MED_SER_ORG_NO = '8013694' AND gwyjzb.MED_ORG_DEPT_NM LIKE '%全科%' UNION SELECT * FROM fgwyjzb WHERE fgwyjzb.PERSON_NM = '方语诗' AND fgwyjzb.MED_SER_ORG_NO = '8013694' AND fgwyjzb.MED_ORG_DEPT_NM LIKE '%全科%' | css |
CREATE TABLE table_name_27 (
driver VARCHAR,
chassis VARCHAR,
rounds VARCHAR
) | What was the driver with chassis of t45 t44 and rounds of 7? | SELECT driver FROM table_name_27 WHERE chassis = "t45 t44" AND rounds = "7" | sql_create_context |
CREATE TABLE table_name_90 (
elimination VARCHAR,
team VARCHAR
) | Which Elimination Move is listed at Elimination 8 for Team Batista? | SELECT elimination AS Move FROM table_name_90 WHERE team = "team batista" AND elimination = "8" | sql_create_context |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | what is the number of patients whose age is less than 45 and lab test fluid is other body fluid? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "45" AND lab.fluid = "Other Body Fluid" | mimicsql_data |
CREATE TABLE paperdataset (
paperid int,
datasetid int
)
CREATE TABLE cite (
citingpaperid int,
citedpaperid int
)
CREATE TABLE writes (
paperid int,
authorid int
)
CREATE TABLE paperkeyphrase (
paperid int,
keyphraseid int
)
CREATE TABLE paperfield (
fieldid int,
paperid int... | What papers are authored by Donald E Knuth ? | SELECT DISTINCT writes.paperid FROM author, writes WHERE author.authorname = 'Donald E Knuth' AND writes.authorid = author.authorid | scholar |
CREATE TABLE table_name_7 (
surface VARCHAR,
opponents VARCHAR
) | What was the surface on the game with margit r tel anett schutting as the opponent? | SELECT surface FROM table_name_7 WHERE opponents = "margit rüütel anett schutting" | sql_create_context |
CREATE TABLE compartment_class (
compartment varchar,
class_type varchar
)
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
dual_airline varchar,
service_na... | is there a flight on AA from BOSTON to DENVER | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'DENVER' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BOSTON... | atis |
CREATE TABLE table_25675509_1 (
latitude VARCHAR,
longitude VARCHAR
) | If the longitude is 157.941 e, what is the latitude? | SELECT latitude FROM table_25675509_1 WHERE longitude = "157.941° E" | sql_create_context |
CREATE TABLE table_16554 (
"#" real,
"Episode" text,
"Air Date" text,
"Timeslot" text,
"Viewers" text,
"Weekly Rank for Living" text
) | what is the most # that aired on september 29, 2008? | SELECT MAX("#") FROM table_16554 WHERE "Air Date" = 'September 29, 2008' | wikisql |
CREATE TABLE table_59358 (
"Publication" text,
"Country" text,
"Accolade" text,
"Year" real,
"Rank" text
) | What rank is the publication the observer music monthly? | SELECT "Rank" FROM table_59358 WHERE "Publication" = 'the observer music monthly' | wikisql |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
... | what is drug type and drug dose of subject id 65652? | SELECT prescriptions.drug_type, prescriptions.drug_dose FROM prescriptions WHERE prescriptions.subject_id = "65652" | mimicsql_data |
CREATE TABLE table_80418 (
"Year" text,
"Carries" real,
"Rushing Yards" real,
"Average" real,
"Touchdowns" real,
"Points" real
) | What is the average number of carries that have more than 72 touchdowns? | SELECT AVG("Carries") FROM table_80418 WHERE "Touchdowns" > '72' | wikisql |
CREATE TABLE table_49725 (
"Name" text,
"Country" text,
"Total" text,
"60mH" real,
"800m" real
) | What is the 60mH that has a Country of russia, and a 800m of 883? | SELECT "60mH" FROM table_49725 WHERE "Country" = 'russia' AND "800m" = '883' | wikisql |
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
outtime time
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE chart... | was there any organism that was observed in patient 8005's last serology/blood microbiology testing until 2104? | SELECT COUNT(*) > 0 FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 8005) AND microbiologyevents.spec_type_desc = 'serology/blood' AND NOT microbiologyevents.org_name IS NULL AND STRFTIME('%y', microbiologyevents.charttime) <= '2104' O... | mimic_iii |
CREATE TABLE jyjgzbb (
BGDH text,
BGRQ time,
CKZFWDX text,
CKZFWSX number,
CKZFWXX number,
JCFF text,
JCRGH text,
JCRXM text,
JCXMMC text,
JCZBDM text,
JCZBJGDL number,
JCZBJGDW text,
JCZBJGDX text,
JCZBMC text,
JLDW text,
JYRQ time,
JYZBLSH text,
... | 把患者章清懿在医院0923275住院就诊的所有记录中,出院时科室名字里有眼睛的住院就诊记录列出 | SELECT * FROM person_info JOIN hz_info JOIN zyjzjlb JOIN person_info_hz_info ON person_info.RYBH = person_info_hz_info.RYBH AND hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX AND person_info_hz_info.KH = hz_info.KH AND person_info_hz_info.KLX = hz_info.KLX AND person_info_hz_i... | css |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,... | how many patients aged below 70 years had the diagnosis short title hemochromatos-rbc-trans | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.age < "70" AND diagnoses.short_title = "Hemochromatos-rbc trans" | mimicsql_data |
CREATE TABLE table_name_8 (
games INTEGER,
name VARCHAR,
rank VARCHAR
) | How many Games for Rank 2 Terrell McIntyre? | SELECT MIN(games) FROM table_name_8 WHERE name = "terrell mcintyre" AND rank > 2 | sql_create_context |
CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHAR(12),
Age INTEGER,
Sex VARCHAR(1),
Major INTEGER,
Advisor INTEGER,
city_code VARCHAR(3)
)
CREATE TABLE Lives_in (
stuid INTEGER,
dormid INTEGER,
room_number INTEGER
)
CREATE TABLE Dorm_amenity (
ameni... | What are the first names of all students in Smith Hall, and count them by a bar chart | SELECT Fname, COUNT(Fname) FROM Student AS T1 JOIN Lives_in AS T2 ON T1.stuid = T2.stuid JOIN Dorm AS T3 ON T3.dormid = T2.dormid WHERE T3.dorm_name = 'Smith Hall' GROUP BY Fname | nvbench |
CREATE TABLE table_23995075_2 (
qualifying_end_date VARCHAR
) | What is the qualifying end date when the qualifying start date is qualifying start date? | SELECT qualifying_end_date FROM table_23995075_2 WHERE "qualifying_start_date" = "qualifying_start_date" | sql_create_context |
CREATE TABLE table_32789 (
"Year" real,
"Player" text,
"Country" text,
"Team" text,
"Position" text
) | What is the first year that Mario Lemieux from Canada won playing center? | SELECT MIN("Year") FROM table_32789 WHERE "Country" = 'canada' AND "Position" = 'center' AND "Player" = 'mario lemieux' | wikisql |
CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
CREATE TABLE flight (
aircraft_code_sequence text,
airline_code varchar,
airline_flight text,
arrival_time int,
connections int,
departure_time int,
dual_carrier text,
flight_days text,
flight_id int,
flight_number ... | show me flights on monday from PHILADELPHIA to BOSTON after 700 | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE ((date_day.day_number = 21 AND date_day.month_number = 2 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.departure_time... | atis |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
... | tell me the time and type of admission of patient josette orr. | SELECT demographic.admission_type, demographic.admittime FROM demographic WHERE demographic.name = "Josette Orr" | mimicsql_data |
CREATE TABLE table_name_63 (
silver VARCHAR,
nation VARCHAR,
rank VARCHAR
) | What is the total number of Silvers held by France when their rank was over 14? | SELECT COUNT(silver) FROM table_name_63 WHERE nation = "france" AND rank > 14 | sql_create_context |
CREATE TABLE table_name_95 (
tf1__number INTEGER,
official__number VARCHAR,
air_date__france_ VARCHAR
) | What is the most elevated TF1 # that has an Official # larger than 47, and an Air date (France) of 13 july 2010? | SELECT MAX(tf1__number) FROM table_name_95 WHERE official__number > 47 AND air_date__france_ = "13 july 2010" | sql_create_context |
CREATE TABLE table_name_62 (
episode VARCHAR,
share VARCHAR,
viewers__millions_ VARCHAR,
weekly_rank VARCHAR
) | Which Episode has a Viewers (millions) larger than 11.26, a Weekly Rank of #8, and a Share of 12? | SELECT episode FROM table_name_62 WHERE viewers__millions_ > 11.26 AND weekly_rank = "#8" AND share = 12 | sql_create_context |
CREATE TABLE repair_assignment (
technician_id int,
repair_ID int,
Machine_ID int
)
CREATE TABLE machine (
Machine_ID int,
Making_Year int,
Class text,
Team text,
Machine_series text,
value_points real,
quality_rank int
)
CREATE TABLE repair (
repair_ID int,
name text,
... | Display a bar chart for what are the names of the technicians and how many machines are they assigned to repair?, and list from low to high by the total number please. | SELECT Name, COUNT(*) FROM repair_assignment AS T1 JOIN technician AS T2 ON T1.technician_id = T2.technician_id GROUP BY T2.Name ORDER BY COUNT(*) | nvbench |
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
discharge_location text,
insurance text,
language text,
marital_status text,
ethnicity text,
age number
)
CREATE ... | was the chloride value of patient 23930 second measured on the first hospital visit less than the value that was first measured on the first hospital visit. | SELECT (SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 23930 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label ... | mimic_iii |
CREATE TABLE table_train_188 (
"id" int,
"systolic_blood_pressure_sbp" int,
"hemoglobin_a1c_hba1c" float,
"diastolic_blood_pressure_dbp" int,
"body_mass_index_bmi" float,
"age" float,
"NOUSE" float
) | hba1c 7 to 10 % | SELECT * FROM table_train_188 WHERE hemoglobin_a1c_hba1c >= 7 AND hemoglobin_a1c_hba1c <= 10 | criteria2sql |
CREATE TABLE table_11745 (
"Series #" real,
"Season #" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" real
) | What is the production code of the episode written by Gary Sturgis that is bigger than season number 23 and smaller than series number 126? | SELECT "Production code" FROM table_11745 WHERE "Season #" > '23' AND "Series #" < '126' AND "Written by" = 'gary sturgis' | wikisql |
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
... | For those employees who was hired before 2002-06-21, return a bar chart about the distribution of job_id and the sum of employee_id , and group by attribute job_id, and list names in asc order. | SELECT JOB_ID, SUM(EMPLOYEE_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' GROUP BY JOB_ID ORDER BY JOB_ID | nvbench |
CREATE TABLE table_name_92 (
birthplace VARCHAR,
birthdate VARCHAR
) | Where was the birthplace of the person born on March 21, 1979? | SELECT birthplace FROM table_name_92 WHERE birthdate = "march 21, 1979" | sql_create_context |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemics... | how many times has a o2 sat (%) test been given to patient 005-4044 in 2101? | SELECT COUNT(*) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '005-4044')) AND lab.labname = 'o2 sat (%)' AND STRFTIME('%y', lab.labresulttime) = '2101' | eicu |
CREATE TABLE table_name_22 (
Id VARCHAR
) | What is 1997, when 2003 is 0 / 4? | SELECT 1997 FROM table_name_22 WHERE 2003 = "0 / 4" | sql_create_context |
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
HIRE_DATE date,
JOB_ID varchar(10),
SALARY decimal(8,2),
COMMISSION_PCT decimal(2,2),
MANAGER_ID decimal(6,0),
DEPARTMENT_ID decimal(... | For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, give me the comparison about the average of department_id over the hire_date bin hire_date by time by a bar chart. | SELECT HIRE_DATE, AVG(DEPARTMENT_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 | nvbench |
CREATE TABLE table_2102898_1 (
archive VARCHAR,
broadcast_date VARCHAR
) | What is the archive of the show that aired on 18april1970? | SELECT archive FROM table_2102898_1 WHERE broadcast_date = "18April1970" | sql_create_context |
CREATE TABLE table_name_34 (
away_team VARCHAR,
home_team VARCHAR
) | Who is the away side when collingwood is at home? | SELECT away_team FROM table_name_34 WHERE home_team = "collingwood" | sql_create_context |
CREATE TABLE table_26429658_1 (
title VARCHAR,
production_code VARCHAR
) | What was the title of the episode with a production code of 2010? | SELECT title FROM table_26429658_1 WHERE production_code = 2010 | sql_create_context |
CREATE TABLE table_name_13 (
total_produced INTEGER,
builder’s_model VARCHAR,
wheel_arrangement VARCHAR,
prr_class VARCHAR
) | How many total units were built of Model ds-4-4-660 with a b-b wheel arrangement and a PRR Class of bs6? | SELECT SUM(total_produced) FROM table_name_13 WHERE wheel_arrangement = "b-b" AND prr_class = "bs6" AND builder’s_model = "ds-4-4-660" | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.