context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_29077342_19 (
mountains_classification VARCHAR,
team_classification VARCHAR,
general_classification VARCHAR
) | Name the mountains classification for rabobank and damiano cunego | SELECT mountains_classification FROM table_29077342_19 WHERE team_classification = "Rabobank" AND general_classification = "Damiano Cunego" | sql_create_context |
CREATE TABLE table_69593 (
"Name" text,
"Circuit" text,
"Date" text,
"Winning drivers" text,
"Winning constructor" text,
"Report" text
) | What was the date for the French Grand Prix? | SELECT "Date" FROM table_69593 WHERE "Name" = 'french grand prix' | wikisql |
CREATE TABLE table_51274 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" real,
"Series" text,
"Arena" text
) | What was the record of the series at the game attended by 17,181 and a loss of Giguere (0 1)? | SELECT "Series" FROM table_51274 WHERE "Attendance" > '17,181' AND "Loss" = 'giguere (0–1)' | wikisql |
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... | What is the average base price of rooms, for each bed type Plot them as bar chart, and display total number in asc order. | SELECT bedType, AVG(basePrice) FROM Rooms GROUP BY bedType ORDER BY AVG(basePrice) | nvbench |
CREATE TABLE table_name_58 (
away_team VARCHAR,
home_team VARCHAR
) | What is the score for the away team when South Melbourne was the home team? | SELECT away_team AS score FROM table_name_58 WHERE home_team = "south melbourne" | sql_create_context |
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE icustays (
row_id number,
s... | how much does a medical diagnosis of poisoning-barbiturates cost? | SELECT DISTINCT cost.cost FROM cost WHERE cost.event_type = 'diagnoses_icd' AND cost.event_id IN (SELECT diagnoses_icd.row_id FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'poisoning-barbiturates')) | mimic_iii |
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description t... | 100k rep users eligible for swag. | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC), ROW_NUMBER() OVER (ORDER BY CreationDate), * FROM Users WHERE Reputation >= 100000 ORDER BY Reputation DESC | sede |
CREATE TABLE table_name_70 (
final_position VARCHAR,
season VARCHAR
) | What is the final position for the season 2012? | SELECT final_position FROM table_name_70 WHERE season = "2012" | sql_create_context |
CREATE TABLE table_14455 (
"Week" text,
"Opponent" text,
"Result" text,
"Game site" text,
"Attendance" text
) | Where did they play in week 14? | SELECT "Game site" FROM table_14455 WHERE "Week" = '14' | wikisql |
CREATE TABLE table_name_78 (
margin_of_victory VARCHAR,
runner_s__up VARCHAR,
winning_score VARCHAR
) | what is the margin of victory when the runner-up is amy alcott and the winning score is 9 (72-68-67=207)? | SELECT margin_of_victory FROM table_name_78 WHERE runner_s__up = "amy alcott" AND winning_score = –9(72 - 68 - 67 = 207) | sql_create_context |
CREATE TABLE candidate (
Candidate_ID int,
People_ID int,
Poll_Source text,
Date text,
Support_rate real,
Consider_rate real,
Oppose_rate real,
Unsure_rate real
)
CREATE TABLE people (
People_ID int,
Sex text,
Name text,
Date_of_Birth text,
Height real,
Weight re... | Show the average of weight from each sex, show by the Sex in desc. | SELECT Sex, AVG(Weight) FROM people GROUP BY Sex ORDER BY Sex DESC | nvbench |
CREATE TABLE table_24905 (
"Team" text,
"Outgoing manager" text,
"Manner of departure" text,
"Date of vacancy" text,
"Replaced by" text,
"Date of appointment" text
) | Which outgoing manager was replaced by Jafar Fatahi? | SELECT "Outgoing manager" FROM table_24905 WHERE "Replaced by" = 'Jafar Fatahi' | wikisql |
CREATE TABLE table_74645 (
"Entrant" text,
"Constructor" text,
"Chassis" text,
"Engine" text,
"Driver" text
) | Who built the Jim Crawford car? | SELECT "Constructor" FROM table_74645 WHERE "Driver" = 'jim crawford' | wikisql |
CREATE TABLE table_name_53 (
Id VARCHAR
) | What's the 1996 if 1986 has a 1R? | SELECT 1996 FROM table_name_53 WHERE 1986 = "1r" | sql_create_context |
CREATE TABLE table_41704 (
"Album title" text,
"Format" text,
"Year" real,
"Original label" text,
"Chart positions" text
) | What is the format of the album with a year less than 1992? | SELECT "Format" FROM table_41704 WHERE "Year" < '1992' | wikisql |
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
... | how many patients received analgesics - non-narcotic analgesic after the first procedure of the cultures - blood within 2 months until 4 years ago? | SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'cultures - blood' AND DATETIME(treatment.treatmenttime) <= DATETIME(CURRENT_TIME(), '-4 year')) AS t1 JOIN (... | eicu |
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime tim... | what was the difference in the weight of patient 2518 measured at 2105-12-30 09:00:00 compared to the value measured at 2105-12-29 21:00:00. | SELECT (SELECT chartevents.valuenum FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 2518)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'ad... | mimic_iii |
CREATE TABLE table_57427 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
) | What's the average Grid with Laps of 88? | SELECT AVG("Grid") FROM table_57427 WHERE "Laps" = '88' | wikisql |
CREATE TABLE table_52484 (
"Date" text,
"Venue" text,
"Result" text,
"Scored" real,
"Competition" text
) | Which venue has a Result of 1 2? | SELECT "Venue" FROM table_52484 WHERE "Result" = '1–2' | wikisql |
CREATE TABLE month (
month_number int,
month_name text
)
CREATE TABLE class_of_service (
booking_class varchar,
rank int,
class_description text
)
CREATE TABLE aircraft (
aircraft_code varchar,
aircraft_description varchar,
manufacturer varchar,
basic_type varchar,
engines int,... | show me the latest DINNER flight from BALTIMORE to OAKLAND | 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, food_service WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'OAKLAND' AND flight.to_airport = AIRPORT_SERVICE_1.airport_code AND food_s... | atis |
CREATE TABLE table_name_74 (
entered VARCHAR,
time VARCHAR
) | What is the entered number for the person with a time of 29:28? | SELECT entered FROM table_name_74 WHERE time = "29:28" | sql_create_context |
CREATE TABLE table_name_55 (
release_date VARCHAR,
sspec_number VARCHAR
) | Which Release date has a sSpec number of sr0pk(e1)? | SELECT release_date FROM table_name_55 WHERE sspec_number = "sr0pk(e1)" | sql_create_context |
CREATE TABLE t_kc22 (
AMOUNT number,
CHA_ITEM_LEV number,
DATA_ID text,
DIRE_TYPE number,
DOSE_FORM text,
DOSE_UNIT text,
EACH_DOSAGE text,
EXP_OCC_DATE time,
FLX_MED_ORG_ID text,
FXBZ number,
HOSP_DOC_CD text,
HOSP_DOC_NM text,
MED_CLINIC_ID text,
MED_DIRE_CD tex... | 名字是陶成化投保人一年门诊医疗费用总额一共是多少元钱? | SELECT SUM(t_kc21.MED_AMOUT) FROM t_kc21 WHERE t_kc21.PERSON_NM = '陶成化' AND t_kc21.CLINIC_TYPE = '门诊' | css |
CREATE TABLE t_kc21 (
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,
... | 药品687379在医疗就诊39706468602中的剂型是什么?规格是什么? | SELECT t_kc22.DOSE_FORM, t_kc22.SPEC FROM t_kc22 JOIN t_kc21_t_kc22 JOIN t_kc21 ON t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID AND t_kc21_t_kc22.MED_CLINIC_ID = t_kc21.MED_CLINIC_ID WHERE t_kc21.MED_CLINIC_ID = '39706468602' AND t_kc22.SOC_SRT_DIRE_CD = '687379' | css |
CREATE TABLE table_204_975 (
id number,
"year" number,
"competition" text,
"location" text,
"event" text,
"final-rank" text,
"final-score" number,
"qualifying rank" number,
"qualifying score" number
) | what was the average qualifying score for the u.s. championships ? | SELECT AVG("qualifying score") FROM table_204_975 WHERE "competition" = 'u.s. championships' | squall |
CREATE TABLE table_47052 (
"Volume:Issue" text,
"Issue Date(s)" text,
"Weeks on Top" text,
"Song" text,
"Artist" text
) | What is the song name with a Volume:Issue was 70:8-9? | SELECT "Song" FROM table_47052 WHERE "Volume:Issue" = '70:8-9' | wikisql |
CREATE TABLE entrepreneur (
People_ID VARCHAR,
Investor VARCHAR
)
CREATE TABLE people (
Date_of_Birth VARCHAR,
People_ID VARCHAR
) | What are the dates of birth of entrepreneurs with investor 'Simon Woodroffe' or 'Peter Jones'? | SELECT T2.Date_of_Birth FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID WHERE T1.Investor = "Simon Woodroffe" OR T1.Investor = "Peter Jones" | sql_create_context |
CREATE TABLE table_19312274_3 (
fastest_laps INTEGER
) | What is the smallest number of fastest laps listed? | SELECT MIN(fastest_laps) FROM table_19312274_3 | sql_create_context |
CREATE TABLE table_58792 (
"Name" text,
"Tournaments" real,
"Pro Debut" text,
"Top division debut" text,
"Highest rank" text
) | What is the lowest Tournaments, when Name is 'Baruto'? | SELECT MIN("Tournaments") FROM table_58792 WHERE "Name" = 'baruto' | wikisql |
CREATE TABLE class_of_service (
booking_class varchar,
rank int,
class_description text
)
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
CREATE TABLE month (
month_number int,
month_name text
)
CREATE TABLE ground_service (
city_code text,
airport_co... | find travel arrangements for a round trip flight from DALLAS to PITTSBURGH | 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, fare, flight, flight_fare WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PITTSBURGH' AND NOT fare.round_trip_cost IS NULL AND flight_fare.fare_... | atis |
CREATE TABLE station (
Station_ID int,
Name text,
Annual_entry_exit real,
Annual_interchanges real,
Total_Passengers real,
Location text,
Main_Services text,
Number_of_Platforms int
)
CREATE TABLE train_station (
Train_ID int,
Station_ID int
)
CREATE TABLE train (
Train_ID ... | Compute the total total number of total passengers across location as a pie chart. | SELECT Location, SUM(Total_Passengers) FROM station GROUP BY Location | nvbench |
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
... | count the number of patients who were diagnosed with acute necrosis of liver in the same hospital visit after they were diagnosed with nb obsrv suspct infect during this year. | SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, diagnoses_icd.charttime, admissions.hadm_id FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title =... | mimic_iii |
CREATE TABLE table_24060 (
"Episode No." real,
"Title" text,
"Directed by" text,
"Written by" text,
"Viewers (millions)" text,
"Original airdate" text
) | How many episodes were written by Kirstie Falkous & John Regier? | SELECT COUNT("Episode No.") FROM table_24060 WHERE "Written by" = 'Kirstie Falkous & John Regier' | wikisql |
CREATE TABLE table_name_16 (
weeks_on_top VARCHAR,
artist VARCHAR
) | How many weeks on top was the single from Savage Garden? | SELECT weeks_on_top FROM table_name_16 WHERE artist = "savage garden" | sql_create_context |
CREATE TABLE musical (
Nominee VARCHAR,
Award VARCHAR
) | Show the musical nominee with award 'Bob Fosse' or 'Cleavant Derricks'. | SELECT Nominee FROM musical WHERE Award = "Tony Award" OR Award = "Cleavant Derricks" | sql_create_context |
CREATE TABLE table_13414 (
"Round" real,
"Date" text,
"Home" text,
"Result" text,
"Visitor" text,
"Venue" text,
"Attendance" real
) | Which Result has a Venue of kinnarps arena, and a Date of thursday, february 19? | SELECT "Result" FROM table_13414 WHERE "Venue" = 'kinnarps arena' AND "Date" = 'thursday, february 19' | wikisql |
CREATE TABLE table_36466 (
"School" text,
"Team" text,
"City" text,
"State" text,
"Conference" text
) | What city has trojans as the team, and taylor as the school? | SELECT "City" FROM table_36466 WHERE "Team" = 'trojans' AND "School" = 'taylor' | wikisql |
CREATE TABLE student (
student_id int,
lastname varchar,
firstname varchar,
program_id int,
declare_major varchar,
total_credit int,
total_gpa float,
entered_as varchar,
admit_term int,
predicted_graduation_semester int,
degree varchar,
minor varchar,
internship varch... | What courses in Fall or Winter will satisfy my Core requirement ? | 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_23918997_1 (
no VARCHAR,
us_viewers__million_ VARCHAR
) | How many episodes were viewed by 1.29 million people? | SELECT COUNT(no) FROM table_23918997_1 WHERE us_viewers__million_ = "1.29" | sql_create_context |
CREATE TABLE table_name_54 (
height VARCHAR,
weight VARCHAR,
year VARCHAR,
position VARCHAR
) | What is the Height of the Sophomore Guard weighing 185? | SELECT height FROM table_name_54 WHERE year = "sophomore" AND position = "guard" AND weight = 185 | sql_create_context |
CREATE TABLE table_38091 (
"7:00" text,
"7:30" text,
"8:00" text,
"8:30" text,
"9:00" text,
"9:30" text,
"10:00" text,
"10:30" text
) | What is the 8:30 feature with a 7:00 feature Loft Story? | SELECT "8:30" FROM table_38091 WHERE "7:00" = 'loft story' | wikisql |
CREATE TABLE table_203_803 (
id number,
"draw" number,
"country" text,
"language" text,
"artist" text,
"song" text,
"english translation" text,
"place" number,
"points" number
) | which ranked higher in place , israel or the united kingdom ? | SELECT "country" FROM table_203_803 WHERE "country" IN ('israel', 'united kingdom') ORDER BY "place" LIMIT 1 | squall |
CREATE TABLE table_name_48 (
race VARCHAR,
circuit VARCHAR
) | How many races were in the Mallala Motor Sport Park circuit? | SELECT COUNT(race) FROM table_name_48 WHERE circuit = "mallala motor sport park" | sql_create_context |
CREATE TABLE table_8922 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
) | Which player was from England with a to par of +1? | SELECT "Player" FROM table_8922 WHERE "To par" = '+1' AND "Country" = 'england' | wikisql |
CREATE TABLE table_16696 (
"Year" real,
"Winners" text,
"Grand Finalist" text,
"Scores" text,
"Venue" text,
"Crowd" real,
"Margin" real,
"Season Result" text
) | who is the winners where season result is 7th | SELECT "Winners" FROM table_16696 WHERE "Season Result" = '7th' | wikisql |
CREATE TABLE table_7994 (
"Date" text,
"Season" text,
"Playing for" text,
"Opponent" text,
"Final score" text
) | What is the final score when the opponent was Real Espa a, in the 2008 09 season? | SELECT "Final score" FROM table_7994 WHERE "Opponent" = 'real españa' AND "Season" = '2008–09' | wikisql |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
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... | give me the number of patients whose drug type is main and lab test name is total protein, urine? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE prescriptions.drug_type = "MAIN" AND lab.label = "Total Protein, Urine" | mimicsql_data |
CREATE TABLE Behavior_Incident (
incident_id INTEGER,
incident_type_code VARCHAR(10),
student_id INTEGER,
date_incident_start DATETIME,
date_incident_end DATETIME,
incident_summary VARCHAR(255),
recommendations VARCHAR(255),
other_details VARCHAR(255)
)
CREATE TABLE Teachers (
teach... | A bar chart shows the distribution of date_address_to and the sum of monthly_rental bin date_address_to by time. | SELECT date_address_to, SUM(monthly_rental) FROM Student_Addresses ORDER BY monthly_rental DESC | nvbench |
CREATE TABLE table_name_85 (
enrollment INTEGER,
ihsaa_football_class VARCHAR
) | What is the enrollment for the AAAA class in IHSAA? | SELECT SUM(enrollment) FROM table_name_85 WHERE ihsaa_football_class = "aaaa" | sql_create_context |
CREATE TABLE table_1341672_14 (
candidates VARCHAR,
district VARCHAR
) | Name the candidates for illinois 15 | SELECT candidates FROM table_1341672_14 WHERE district = "Illinois 15" | sql_create_context |
CREATE TABLE table_name_64 (
county VARCHAR,
peak VARCHAR,
elevation__m_ VARCHAR,
isolation__km_ VARCHAR
) | What country has an Elevation less than 1833 and an Isolation (km) larger than 18, and a Peak of store lenangstind? | SELECT county FROM table_name_64 WHERE elevation__m_ < 1833 AND isolation__km_ > 18 AND peak = "store lenangstind" | sql_create_context |
CREATE TABLE mzjzjlb_jybgb (
YLJGDM_MZJZJLB text,
BGDH number,
YLJGDM number
)
CREATE TABLE mzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH text,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
... | 从11年4月24日到2015年10月6日这一段时间,患者33303356被开出的所有检验报告单的检验报告单号都有哪些? | SELECT jybgb.BGDH FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN mzjzjlb_jybgb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND mzjzjlb_jybgb.YLJGDM = jybgb.YLJGDM AND mzjzjlb_jybgb.BGDH ... | css |
CREATE TABLE table_7602 (
"Publication" text,
"Country" text,
"Accolade" text,
"Year" real,
"Rank" real
) | What is Accolade, when Year is less than 2009, and when Country is Germany? | SELECT "Accolade" FROM table_7602 WHERE "Year" < '2009' AND "Country" = 'germany' | wikisql |
CREATE TABLE table_33808 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Time" text,
"Att." text,
"Record" text
) | What score has 3-7 as the record? | SELECT "Score" FROM table_33808 WHERE "Record" = '3-7' | wikisql |
CREATE TABLE t_kc21_t_kc22 (
MED_CLINIC_ID text,
MED_EXP_DET_ID number
)
CREATE TABLE t_kc24 (
ACCOUNT_DASH_DATE time,
ACCOUNT_DASH_FLG number,
CASH_PAY number,
CIVIL_SUBSIDY number,
CKC102 number,
CLINIC_ID text,
CLINIC_SLT_DATE time,
COMP_ID text,
COM_ACC_PAY number,
C... | 医疗机构3780652在04年1月2日到2015年4月17日内入院诊断疾病结果与出院诊断疾病结果不同的次数一共有几次? | SELECT COUNT(*) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '3780652' AND t_kc21.IN_HOSP_DATE BETWEEN '2004-01-02' AND '2015-04-17' AND t_kc21.IN_DIAG_DIS_CD <> t_kc21.OUT_DIAG_DIS_CD | css |
CREATE TABLE table_26203 (
"Country" text,
"% of all immigrants 2008" text,
"% of all immigrants 2007" text,
"% of all immigrants 2006" text,
"% of all immigrants 2005" text,
"% of all immigrants 2004" text
) | How many different percentages of immigrants in 2006 can there be for Morocco? | SELECT COUNT("% of all immigrants 2006") FROM table_26203 WHERE "Country" = 'Morocco' | wikisql |
CREATE TABLE table_name_53 (
opponent VARCHAR,
save VARCHAR
) | Who was the opponent that also has a save of Smith (26)? | SELECT opponent FROM table_name_53 WHERE save = "smith (26)" | sql_create_context |
CREATE TABLE t_kc21 (
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,
... | 在医疗就诊过程中编号47926784262的8439这一药品的收费项目等级排多少? | SELECT t_kc22.CHA_ITEM_LEV FROM t_kc22 JOIN t_kc21_t_kc22 JOIN t_kc21 ON t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID AND t_kc21_t_kc22.MED_CLINIC_ID = t_kc21.MED_CLINIC_ID WHERE t_kc21.MED_CLINIC_ID = '47926784262' AND t_kc22.SOC_SRT_DIRE_CD = '8439' | css |
CREATE TABLE table_name_7 (
team_1 VARCHAR
) | What 2nd leg has pelister as team 1? | SELECT 2 AS nd_leg FROM table_name_7 WHERE team_1 = "pelister" | sql_create_context |
CREATE TABLE table_77504 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Series" text
) | What is the High rebounds with a High assists with bryant (7), and a Team of @ utah? | SELECT "High rebounds" FROM table_77504 WHERE "High assists" = 'bryant (7)' AND "Team" = '@ utah' | wikisql |
CREATE TABLE student (
student_id int,
lastname varchar,
firstname varchar,
program_id int,
declare_major varchar,
total_credit int,
total_gpa float,
entered_as varchar,
admit_term int,
predicted_graduation_semester int,
degree varchar,
minor varchar,
internship varch... | When is the next offering of Computational Economics ? | SELECT DISTINCT semester.semester, semester.year FROM semester INNER JOIN course_offering ON semester.semester_id = course_offering.semester INNER JOIN course ON course.course_id = course_offering.course_id WHERE course.name LIKE '%Computational Economics%' AND semester.semester_id > (SELECT SEMESTERalias1.semester_id ... | advising |
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 state (
state_code text,
state_name text,
country_name text
)
CREATE TABLE class_of_service (
booking_... | is there a red eye flight from SAN JOSE to NASHVILLE on wednesday the nineteenth of may | 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.departure_time <= 2359 AND flight.departure_time >= 2100) OR (flight.departure_time <= 300 AND flight.departure_time >= 0)) AND (flig... | atis |
CREATE TABLE table_48502 (
"Result" text,
"Record" text,
"Opponent" text,
"Method" text,
"Event" text,
"Round" real,
"Time" text,
"Location" text
) | What time was the event k-1 the challenge 1999? | SELECT "Time" FROM table_48502 WHERE "Event" = 'k-1 the challenge 1999' | wikisql |
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_typ... | among patients who have been diagnosed with prim cardiomyopathy nec tell me the one year survival rate. | SELECT SUM(CASE WHEN patients.dod IS NULL THEN 1 WHEN STRFTIME('%j', patients.dod) - STRFTIME('%j', t2.charttime) > 1 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t1.subject_id, t1.charttime FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id... | mimic_iii |
CREATE TABLE table_52134 (
"Crew" real,
"Open 1st VIII" text,
"Open 2nd VIII" text,
"Open 3rd VIII" text,
"U16 1st VIII" text,
"U16 2nd VIII" text,
"U16 3rd VIII" text,
"U15 1st Quad" text,
"U15 2nd Quad" text,
"U15 3rd Quad" text,
"U15 4th Quad" text,
"U15 5th Quad" text... | Which Open 2nd VIII had a U15 6th Quad of BGS and a U16 1st VII of TSS? | SELECT "Open 2nd VIII" FROM table_52134 WHERE "U15 6th Quad" = 'bgs' AND "U16 1st VIII" = 'tss' | wikisql |
CREATE TABLE table_20928 (
"Antibody" text,
"Brand name" text,
"Approval date" real,
"Type" text,
"Target" text,
"Approved treatment(s)" text
) | How many targets are there with an approval date of 1997? | SELECT COUNT("Target") FROM table_20928 WHERE "Approval date" = '1997' | wikisql |
CREATE TABLE t_kc24 (
ACCOUNT_DASH_DATE time,
ACCOUNT_DASH_FLG number,
CASH_PAY number,
CIVIL_SUBSIDY number,
CKC102 number,
CLINIC_ID text,
CLINIC_SLT_DATE time,
COMP_ID text,
COM_ACC_PAY number,
COM_PAY number,
DATA_ID text,
ENT_ACC_PAY number,
ENT_PAY number,
F... | 统计医疗记录中的入院诊断为C22.756在医院3153932的最低医疗费总额是多少?最高医疗费总额是多少? | SELECT MIN(t_kc24.MED_AMOUT), MAX(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '3153932' AND t_kc21.IN_DIAG_DIS_CD = 'C22.756') | css |
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... | provide the number of patients whose language is span and age is less than 76? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.language = "SPAN" AND demographic.age < "76" | mimicsql_data |
CREATE TABLE table_43762 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Leading scorer" text,
"Attendance" text,
"Record" text
) | For the game that was 76-85, what was the record? | SELECT "Record" FROM table_43762 WHERE "Score" = '76-85' | wikisql |
CREATE TABLE member (
member_id number,
member_name text,
party_id text,
in_office text
)
CREATE TABLE party_events (
event_id number,
event_name text,
party_id number,
member_in_charge_id number
)
CREATE TABLE region (
region_id number,
region_name text,
date text,
lab... | Show the member names which are in both the party with id 3 and the party with id 1. | SELECT member_name FROM member WHERE party_id = 3 INTERSECT SELECT member_name FROM member WHERE party_id = 1 | spider |
CREATE TABLE zyjybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH number,
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,
... | 在2009-05-30到2018-11-28的这几年里,查一下医疗机构8228050开出多少检验报告单 | SELECT COUNT(*) FROM zyjybgb WHERE zyjybgb.YLJGDM = '8228050' AND zyjybgb.BGRQ BETWEEN '2009-05-30' AND '2018-11-28' UNION SELECT COUNT(*) FROM mzjybgb WHERE mzjybgb.YLJGDM = '8228050' AND mzjybgb.BGRQ BETWEEN '2009-05-30' AND '2018-11-28' | css |
CREATE TABLE school_performance (
school_id number,
school_year text,
class_a text,
class_aa text
)
CREATE TABLE school_details (
school_id number,
nickname text,
colors text,
league text,
class text,
division text
)
CREATE TABLE school (
school_id number,
school text,
... | Show the denomination shared by more than one school. | SELECT denomination FROM school GROUP BY denomination HAVING COUNT(*) > 1 | spider |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE microlab (
microlabid number,
... | when did the first intake of patient 002-13510 have been since 08/14/2102? | SELECT intakeoutput.intakeoutputtime FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-13510')) AND intakeoutput.cellpath LIKE '%intake%... | eicu |
CREATE TABLE table_36294 (
"Game" real,
"November" real,
"Opponent" text,
"Score" text,
"Record" text,
"Points" real
) | Which Points have a Record of 12 2 4 1, and a November larger than 22? | SELECT AVG("Points") FROM table_36294 WHERE "Record" = '12–2–4–1' AND "November" > '22' | wikisql |
CREATE TABLE table_25711913_8 (
touchdowns INTEGER,
position VARCHAR
) | How many touchdowns did the fullback score? | SELECT MIN(touchdowns) FROM table_25711913_8 WHERE position = "Fullback" | sql_create_context |
CREATE TABLE table_name_78 (
votes VARCHAR,
occupation VARCHAR
) | How many votes did the security guard get? | SELECT votes FROM table_name_78 WHERE occupation = "security guard" | sql_create_context |
CREATE TABLE table_name_15 (
home_team VARCHAR,
away_team VARCHAR
) | Who was the home team when the away team was Hawthorn? | SELECT home_team FROM table_name_15 WHERE away_team = "hawthorn" | sql_create_context |
CREATE TABLE table_name_33 (
result VARCHAR,
week VARCHAR,
opponent VARCHAR
) | What was the result before week 13 when they played the Oakland Raiders? | SELECT result FROM table_name_33 WHERE week < 13 AND opponent = "oakland raiders" | sql_create_context |
CREATE TABLE table_1782 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" text,
"U.S. viewers (million)" text
) | How many episodes did Cliff Bole directed in season 3? | SELECT COUNT("Title") FROM table_1782 WHERE "Directed by" = 'Cliff Bole' | wikisql |
CREATE TABLE table_name_51 (
away_team VARCHAR,
home_team VARCHAR
) | During melbourne's home game, who was the away team? | SELECT away_team FROM table_name_51 WHERE home_team = "melbourne" | sql_create_context |
CREATE TABLE table_train_255 (
"id" int,
"ldl_cholesterol" int,
"hemoglobin_a1c_hba1c" float,
"body_weight" float,
"urine_albumin_to_creatinine_ratio_uacr" int,
"hba1c" float,
"body_mass_index_bmi" float,
"triglyceride_tg" float,
"age" float,
"NOUSE" float
) | participant's triglyceride level is < 250 mg / dl and ldl cholesterol is <= 150 mg / dl at screening. | SELECT * FROM table_train_255 WHERE triglyceride_tg < 250 AND ldl_cholesterol <= 150 | criteria2sql |
CREATE TABLE table_12220 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Record" text
) | What is Visitor, when Date is 'April 24'? | SELECT "Visitor" FROM table_12220 WHERE "Date" = 'april 24' | wikisql |
CREATE TABLE fare_basis (
fare_basis_code text,
booking_class text,
class_type text,
premium text,
economy text,
discounted text,
night text,
season text,
basis_days text
)
CREATE TABLE restriction (
restriction_code text,
advance_purchase int,
stopovers text,
saturd... | i would like to see the flights from DENVER to PHILADELPHIA | 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 = 'PHILADE... | atis |
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... | how many patients whose age is less than 27 and drug route is left eye? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "27" AND prescriptions.route = "LEFT EYE" | mimicsql_data |
CREATE TABLE person_info (
CSD text,
CSRQ time,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
MZDM text,
MZMC text,
RYBH text,
XBDM number,
XBMC text,
XLDM text,
XLMC text,
XM text,
ZYLBDM text,
ZYMC text
)
CREATE TABLE jybgb (
BBCJBW text,
BBDM tex... | 哪些住院就诊记录的病患63342045对应的检验报告单的报告日期均在2007年8月10日之后还有住院就诊的流水号是啥? | SELECT zyjzjlb.JZLSH FROM hz_info JOIN zyjzjlb ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE hz_info.RYBH = '63342045' AND NOT zyjzjlb.JZLSH IN (SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ <= '2007-08-10') | css |
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... | how many patients stayed in hospital for more than 17 days and tested for fibrinogen, functional in lab? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.days_stay > "17" AND lab.label = "Fibrinogen, Functional" | mimicsql_data |
CREATE TABLE technician (
technician_id number,
name text,
team text,
starting_year number,
age number
)
CREATE TABLE repair_assignment (
technician_id number,
repair_id number,
machine_id number
)
CREATE TABLE machine (
machine_id number,
making_year number,
class text,
... | What are the names of technicians and the machine series that they repair? | SELECT T3.name, T2.machine_series FROM repair_assignment AS T1 JOIN machine AS T2 ON T1.machine_id = T2.machine_id JOIN technician AS T3 ON T1.technician_id = T3.technician_id | spider |
CREATE TABLE table_203_691 (
id number,
"week" number,
"date" text,
"opponent" text,
"result" text,
"attendance" number
) | what week had the most attendance ? | SELECT "week" FROM table_203_691 ORDER BY "attendance" DESC LIMIT 1 | squall |
CREATE TABLE person_info (
CSD text,
CSRQ time,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
MZDM text,
MZMC text,
RYBH text,
XBDM number,
XBMC text,
XLDM text,
XLMC text,
XM text,
ZYLBDM text,
ZYMC text
)
CREATE TABLE mzjybgb (
BBCJBW text,
BBDM t... | 需要查询患者杨飞鸣的检验报告单,就是11083339230的这次医疗就诊 | SELECT * FROM zyjybgb WHERE zyjybgb.JZLSH = '11083339230' UNION SELECT * FROM mzjybgb WHERE mzjybgb.JZLSH = '11083339230' | css |
CREATE TABLE table_52223 (
"Tournament" text,
"Wins" real,
"Top-5" real,
"Top-10" real,
"Top-25" real,
"Events" real,
"Cuts made" real
) | Tell me the sum of wins for top 5 less than 1 | SELECT SUM("Wins") FROM table_52223 WHERE "Top-5" < '1' | wikisql |
CREATE TABLE table_39343 (
"Round" real,
"Pick #" real,
"Overall" real,
"Name" text,
"Position" text,
"College" text
) | How many rounds had an overall of 211? | SELECT COUNT("Round") FROM table_39343 WHERE "Overall" = '211' | wikisql |
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,
... | 在77422400113的这次医疗就诊中,为奚雅娴这个患者检验的科室和编码是什么 | SELECT jybgb.JYKSBM, jybgb.JYKSMC FROM jybgb WHERE jybgb.JZLSH = '77422400113' | css |
CREATE TABLE table_79702 (
"Town" text,
"Fianna F\u00e1il" real,
"Fine Gael" real,
"Labour Party" real,
"Green Party" real,
"Total" real
) | How many are in the Green Party with a Fine Gael of less than 4 and a Fianna Fail of less than 2 in Athy? | SELECT SUM("Green Party") FROM table_79702 WHERE "Fine Gael" < '4' AND "Fianna F\u00e1il" < '2' AND "Town" = 'athy' | wikisql |
CREATE TABLE table_36755 (
"Games" real,
"Drawn" real,
"Lost" real,
"Points difference" text,
"Points" real
) | What is the lowest number of games loss with a Points difference of 40 - 17, and over 6 games? | SELECT MIN("Lost") FROM table_36755 WHERE "Points difference" = '40 - 17' AND "Games" > '6' | wikisql |
CREATE TABLE table_2417395_4 (
reason_for_change VARCHAR,
date_successor_seated VARCHAR
) | What was the reason for change to the successor that was seated on December 13, 1880? | SELECT reason_for_change FROM table_2417395_4 WHERE date_successor_seated = "December 13, 1880" | sql_create_context |
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId number,
PostId number,
SuggestedEditId number,
CompletedByReviewTaskId number
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId... | Find questions containing the given tag. | SELECT q.Id AS "post_link", q.Tags, q.CreationDate, q.LastActivityDate FROM Posts AS q INNER JOIN PostTags AS pt ON q.Id = pt.PostId INNER JOIN Tags AS t ON t.Id = pt.TagId WHERE t.TagName = '##tagName:string?geometry##' ORDER BY q.CreationDate DESC | sede |
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,
... | 查查8883529的医疗机构,就诊记录里住院天数超过22天的病人数是多少 | SELECT COUNT(hz_info.RYBH) FROM hz_info JOIN zyjzjlb ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE zyjzjlb.YLJGDM = '8883529' AND DATEDIFF(zyjzjlb.CYSJ, zyjzjlb.RYSJ) > 22 | css |
CREATE TABLE table_204_395 (
id number,
"year" number,
"competition" text,
"venue" text,
"position" text,
"notes" text
) | how long was the relay at the 1997 world championships that ken harden ran | SELECT "notes" FROM table_204_395 WHERE "year" = 1997 AND "competition" = 'world championships' | squall |
CREATE TABLE table_24538587_11 (
i_o_bus VARCHAR,
brand_name__list_ VARCHAR
) | What i/o buses are associated with the brand name Core i3-21xxt? | SELECT i_o_bus FROM table_24538587_11 WHERE brand_name__list_ = "Core i3-21xxT" | sql_create_context |
CREATE TABLE Enrolled_in (
StuID INTEGER,
CID VARCHAR(7),
Grade VARCHAR(2)
)
CREATE TABLE Course (
CID VARCHAR(7),
CName VARCHAR(40),
Credits INTEGER,
Instructor INTEGER,
Days VARCHAR(5),
Hours VARCHAR(11),
DNO INTEGER
)
CREATE TABLE Gradeconversion (
lettergrade VARCHAR(2)... | What is the relationship between CID and Instructor ? | SELECT CID, Instructor FROM Course ORDER BY Credits | nvbench |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.