context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_11677691_2 (
school VARCHAR,
player VARCHAR
) | WHAT SCHOOL DOES HA'SEAN CLINTON-DIX BELONG TO? | SELECT school FROM table_11677691_2 WHERE player = "Ha'Sean Clinton-Dix" | sql_create_context |
CREATE TABLE mzb (
CLINIC_ID 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,
INSU_TYPE text,
IN... | 编码为48885255的病患不少于7137.7元的药物在哪几次医疗记录中被开出?列出医疗就诊号码都是什么? | SELECT qtb.MED_CLINIC_ID FROM qtb WHERE qtb.PERSON_ID = '48885255' AND NOT qtb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT < 7137.7) UNION SELECT gyb.MED_CLINIC_ID FROM gyb WHERE gyb.PERSON_ID = '48885255' AND NOT gyb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc... | css |
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 ... | what is lidocaine 5% ointment's way of ingesting it? | SELECT DISTINCT prescriptions.route FROM prescriptions WHERE prescriptions.drug = 'lidocaine 5% ointment' | mimic_iii |
CREATE TABLE table_45558 (
"Position" real,
"Club" text,
"Played" real,
"Points" real,
"Wins" real,
"Draws" real,
"Losses" real,
"Goals for" real,
"Goals against" real,
"Goal Difference" real
) | what is the goals when the goal difference is more than -3, the club is real avil s cf and the goals against is more than 60? | SELECT SUM("Goals for") FROM table_45558 WHERE "Goal Difference" > '-3' AND "Club" = 'real avilés cf' AND "Goals against" > '60' | wikisql |
CREATE TABLE table_62591 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Date" text
) | What is the Tie no for Away Team Ipswich Town? | SELECT "Tie no" FROM table_62591 WHERE "Away team" = 'ipswich town' | wikisql |
CREATE TABLE table_name_13 (
score VARCHAR,
away_team VARCHAR
) | What was the score for the away team southport? | SELECT score FROM table_name_13 WHERE away_team = "southport" | sql_create_context |
CREATE TABLE table_56836 (
"Name" text,
"COSPAR ID SATCAT \u2116" text,
"Launch date (UTC)" text,
"Launch vehicle" text,
"Launch site" text,
"Launch designation" text,
"Longitude" text
) | What is the launch designation of the satellite with a 2009-001a COSPAR ID? | SELECT "Launch designation" FROM table_56836 WHERE "COSPAR ID SATCAT \u2116" = '2009-001a' | wikisql |
CREATE TABLE field (
fieldid int
)
CREATE TABLE dataset (
datasetid int,
datasetname varchar
)
CREATE TABLE author (
authorid int,
authorname varchar
)
CREATE TABLE venue (
venueid int,
venuename varchar
)
CREATE TABLE paperfield (
fieldid int,
paperid int
)
CREATE TABLE paperda... | author who wrote papers with emina torlak | SELECT DISTINCT AUTHOR_1.authorid FROM author AS AUTHOR_0, author AS AUTHOR_1, writes AS WRITES_0, writes AS WRITES_1 WHERE AUTHOR_0.authorname = 'emina torlak' AND WRITES_0.authorid = AUTHOR_0.authorid AND WRITES_1.authorid = AUTHOR_1.authorid AND WRITES_1.paperid = WRITES_0.paperid | scholar |
CREATE TABLE Documents_to_be_destroyed (
Destroyed_by_Employee_ID VARCHAR
) | Show the employee ids and the number of documents destroyed by each employee. | SELECT Destroyed_by_Employee_ID, COUNT(*) FROM Documents_to_be_destroyed GROUP BY Destroyed_by_Employee_ID | sql_create_context |
CREATE TABLE table_204_292 (
id number,
"no." number,
"name" text,
"class" number,
"games" number,
"minutes" number,
"points" number,
"2 points\n(made/attempts)" text,
"2 points\n(%)" number,
"3 points\n(made/attempts)" text,
"3 points\n(%)" number,
"free throws\n(made/at... | who is the first person on the list to play less than 20 minutes ? | SELECT "name" FROM table_204_292 WHERE "minutes" < 20 ORDER BY id LIMIT 1 | squall |
CREATE TABLE table_62767 (
"Game" real,
"Date" text,
"Opponent" text,
"Result" text,
"Dolphins points" real,
"Opponents" real,
"Record" text,
"Attendance" real
) | What's the most in attendance when the Dolphins points were less than 24 and, they played the New England Patriots? | SELECT MAX("Attendance") FROM table_62767 WHERE "Dolphins points" < '24' AND "Opponent" = 'new england patriots' | wikisql |
CREATE TABLE table_name_2 (
event VARCHAR,
year VARCHAR
) | What event was in 2006? | SELECT event FROM table_name_2 WHERE year = 2006 | sql_create_context |
CREATE TABLE table_name_33 (
to_par VARCHAR,
score VARCHAR,
player VARCHAR
) | Which To Par has a Score smaller than 70, and a Player of matt kowal? | SELECT to_par FROM table_name_33 WHERE score < 70 AND player = "matt kowal" | sql_create_context |
CREATE TABLE table_25017530_5 (
pick__number INTEGER,
player VARCHAR
) | Name the least pick number for steven turner | SELECT MIN(pick__number) FROM table_25017530_5 WHERE player = "Steven Turner" | sql_create_context |
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 demographic (... | count the number of patients whose diagnoses icd9 code is e9300 and drug type is main? | 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.icd9_code = "E9300" AND prescriptions.drug_type = "MAIN" | mimicsql_data |
CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Per... | Show me about the distribution of All_Games and Team_ID in a bar chart, and list Team_ID from low to high order please. | SELECT All_Games, Team_ID FROM basketball_match ORDER BY Team_ID | nvbench |
CREATE TABLE table_name_44 (
record VARCHAR,
loss VARCHAR
) | Which Record has a Loss of o'connor (0-1)? | SELECT record FROM table_name_44 WHERE loss = "o'connor (0-1)" | sql_create_context |
CREATE TABLE table_name_72 (
rank VARCHAR,
round2 VARCHAR,
round3 VARCHAR,
total_points VARCHAR,
round4 VARCHAR
) | what is the rank when the total points is more than 194, round4 is less than 64, round3 is more than 51 and round 2 is less than 66? | SELECT COUNT(rank) FROM table_name_72 WHERE total_points > 194 AND round4 < 64 AND round3 > 51 AND round2 < 66 | sql_create_context |
CREATE TABLE table_23619005_3 (
position VARCHAR,
cfl_team VARCHAR
) | What was the position of the player from Saskatchewan Roughriders? | SELECT position FROM table_23619005_3 WHERE cfl_team = "Saskatchewan Roughriders" | sql_create_context |
CREATE TABLE table_name_9 (
totaltk INTEGER,
yards INTEGER
) | what is the sum of totaltk when yards is less than 0? | SELECT SUM(totaltk) FROM table_name_9 WHERE yards < 0 | sql_create_context |
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... | Is UC 475 available for me during Spring ? | SELECT COUNT(*) > 0 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, semester AS SEMESTERalias0 WHERE COURSEalias0.course_id = COURSE_OFFERINGalias0.course_id AND NOT COURSEalias0.course_id IN... | advising |
CREATE TABLE table_65236 (
"Title" text,
"Series" text,
"Characters" text,
"Production Num." real,
"Release date" text
) | With 4645 as the production number what was the title? | SELECT "Title" FROM table_65236 WHERE "Production Num." = '4645' | wikisql |
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 wdmzjzjlb (
CYBQDM text,
CYBQ... | 在06年4月14日到2019年11月24日之间患者16067327所有检验结果指标记录中的检测方法都有什么? | SELECT jyjgzbb.JCFF FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE hz_in... | css |
CREATE TABLE table_name_54 (
against VARCHAR,
opposing_teams VARCHAR
) | What is the against when the opposing team is Italy? | SELECT COUNT(against) FROM table_name_54 WHERE opposing_teams = "italy" | sql_create_context |
CREATE TABLE table_24543 (
"Year" real,
"Horse" text,
"Driver" text,
"Trainer" text,
"Country of owner" text,
"Odds of winner" text,
"Winning time (km rate)" text
) | When were the odds of winner 16.66? | SELECT "Year" FROM table_24543 WHERE "Odds of winner" = '16.66' | wikisql |
CREATE TABLE region (
Region_ID int,
Region_name text,
Date text,
Label text,
Format text,
Catalogue text
)
CREATE TABLE party_events (
Event_ID int,
Event_Name text,
Party_ID int,
Member_in_charge_ID int
)
CREATE TABLE member (
Member_ID int,
Member_Name text,
Part... | Bar chart x axis left office y axis the number of left office, order by the total number in descending. | SELECT Left_office, COUNT(Left_office) FROM party ORDER BY COUNT(Left_office) DESC | nvbench |
CREATE TABLE table_name_24 (
score VARCHAR,
date VARCHAR
) | What is the score on 22 September 1972? | SELECT score FROM table_name_24 WHERE date = "22 september 1972" | sql_create_context |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
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,
... | 看看患者水清懿过往的门诊诊断证明 | SELECT mzjzjlb.JZZDBM, mzjzjlb.JZZDSM FROM person_info JOIN hz_info JOIN mzjzjlb JOIN hz_info_mzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.YLJGDM = hz_info_mz... | css |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number... | tell me patient 027-25994's maximum respiration on the last intensive care unit visit? | SELECT MAX(vitalperiodic.respiration) FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-25994') AND NOT patient.unitdischargetime IS N... | eicu |
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... | 看一下病患鲁同济的医疗记录中哪几次开的药品金额大于8376.61元?列出医疗就诊编码 | SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_NM = '鲁同济' AND t_kc22.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT > 8376.61) | css |
CREATE TABLE table_41309 (
"Album" text,
"Release date" text,
"Label" text,
"Format" text,
"Covered Song" text,
"Original Song" text
) | What is the Label for the Covered Song named ' sign o' the times ' by prince .? | SELECT "Label" FROM table_41309 WHERE "Covered Song" = ' sign o'' the times " by prince .' | wikisql |
CREATE TABLE table_42161 (
"Team #1" text,
"Agg." text,
"Team #2" text,
"1st leg" text,
"2nd leg" text
) | Which Team #2 has a 1st leg of 70 - 44? | SELECT "Team #2" FROM table_42161 WHERE "1st leg" = '70 - 44' | wikisql |
CREATE TABLE table_55886 (
"Software" text,
"Latest stable date (version)" text,
"Cost ( USD )" text,
"Open source" text,
"License" text
) | Name the software with the latest stable date of 0.6.1 | SELECT "Software" FROM table_55886 WHERE "Latest stable date (version)" = '0.6.1' | wikisql |
CREATE TABLE table_5199 (
"Pick #" real,
"MLS Team" text,
"Player" text,
"Position" text,
"Affiliation" text
) | How many picks did Mike Zaher have? | SELECT SUM("Pick #") FROM table_5199 WHERE "Player" = 'mike zaher' | wikisql |
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 admission type is emergency and diagnoses long title is accidental fall on or from other stairs or steps? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND diagnoses.long_title = "Accidental fall on or from other stairs or steps" | mimicsql_data |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE vitalperiodi... | when was the last time that patient 022-31513 had the urine output since 03/14/2101? | 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 = '022-31513')) AND intakeoutput.cellpath LIKE '%output%... | eicu |
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,
... | 患者许涵映在2012年7月16日之后做过的检验报告在哪些住院门诊?列出这些住院就诊的流水编码 | SELECT zyjzjlb.JZLSH FROM person_info JOIN hz_info JOIN zyjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE person_info.XM = '许涵映' AND NOT zyjzjlb.JZLSH IN (SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ <= '2012-07-16') | css |
CREATE TABLE table_name_41 (
fa_cup_goals VARCHAR,
name VARCHAR,
league_cup_goals VARCHAR
) | How many FA cup goals have Jimmy Nicholson as the name, and league cup goals greater than 0? | SELECT COUNT(fa_cup_goals) FROM table_name_41 WHERE name = "jimmy nicholson" AND league_cup_goals > 0 | sql_create_context |
CREATE TABLE table_16275828_4 (
program VARCHAR,
location VARCHAR
) | What programs were held in charleston, illinois? | SELECT program FROM table_16275828_4 WHERE location = "Charleston, Illinois" | sql_create_context |
CREATE TABLE table_20668 (
"Code" real,
"County" text,
"Former Province" text,
"Area (km 2 )" text,
"Population Census 2009" real,
"Capital" text
) | What capital's county had a population of 730129 as of 2009? | SELECT "Capital" FROM table_20668 WHERE "Population Census 2009" = '730129' | wikisql |
CREATE TABLE table_name_38 (
position VARCHAR,
round VARCHAR
) | A round of 4 is in what position? | SELECT position FROM table_name_38 WHERE round = 4 | sql_create_context |
CREATE TABLE table_name_90 (
week INTEGER,
opponent VARCHAR
) | What is the largest week with the Atlanta Falcons as the opponent? | SELECT MAX(week) FROM table_name_90 WHERE opponent = "atlanta falcons" | sql_create_context |
CREATE TABLE table_name_55 (
location VARCHAR,
event VARCHAR
) | The event rip curl pro mademoiselle is in which location? | SELECT location FROM table_name_55 WHERE event = "rip curl pro mademoiselle" | sql_create_context |
CREATE TABLE table_38753 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Ground" text,
"Crowd" real,
"Date" text,
"Report" text
) | What was the crowd size for the Home team of melbourne? | SELECT COUNT("Crowd") FROM table_38753 WHERE "Home team" = 'melbourne' | wikisql |
CREATE TABLE table_22973 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" real,
"U.S. viewers (millions)" text
) | What's the title of the episode with production code 10018? | SELECT "Title" FROM table_22973 WHERE "Production code" = '10018' | 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 procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses (
... | what is maximum age of patients whose marital status is divorced and admission type is emergency? | SELECT MAX(demographic.age) FROM demographic WHERE demographic.marital_status = "DIVORCED" AND demographic.admission_type = "EMERGENCY" | mimicsql_data |
CREATE TABLE table_26974 (
"DS Division" text,
"Main Town" text,
"GN Divisions" real,
"Area (km 2 )" real,
"Sri Lankan Tamil" real,
"Sri Lankan Moors" real,
"Sinhalese" real,
"Indian Tamil" real,
"Other" real,
"Total" real,
"Population Density (/km 2 )" real
) | Name the popultion density being manthai west | SELECT "Population Density (/km 2 )" FROM table_26974 WHERE "DS Division" = 'Manthai West' | wikisql |
CREATE TABLE table_70445 (
"Year" real,
"Champion" text,
"City" text,
"LLWS" text,
"Record" text
) | What is the total number of Years when the LLWS is 4th place, and when the City is Westport? | SELECT COUNT("Year") FROM table_70445 WHERE "LLWS" = '4th place' AND "City" = 'westport' | wikisql |
CREATE TABLE table_name_76 (
iata VARCHAR,
icao VARCHAR
) | What is RJCM's IATA? | SELECT iata FROM table_name_76 WHERE icao = "rjcm" | sql_create_context |
CREATE TABLE table_2534578_1 (
language VARCHAR,
reading VARCHAR
) | What was the language score when the reading score was 94.47? | SELECT language FROM table_2534578_1 WHERE reading = "94.47" | sql_create_context |
CREATE TABLE performance (
performance_id number,
date text,
host text,
location text,
attendance number
)
CREATE TABLE member_attendance (
member_id number,
performance_id number,
num_of_pieces number
)
CREATE TABLE member (
member_id text,
name text,
nationality text,
... | What is the average number of attendees for performances? | SELECT AVG(attendance) FROM performance | spider |
CREATE TABLE table_50346 (
"Callsign" text,
"Area served" text,
"Band" text,
"Freq currently" text,
"Purpose" text
) | What is the Purpose of the Callsign with a Freq currently of 4rph? | SELECT "Purpose" FROM table_50346 WHERE "Freq currently" = '4rph' | wikisql |
CREATE TABLE table_23872 (
"Game" real,
"Date" text,
"Opponent" text,
"Result" text,
"Tar Heels points" real,
"Opponents" real,
"Record" text
) | How many games were against Furman? | SELECT MAX("Game") FROM table_23872 WHERE "Opponent" = 'Furman' | wikisql |
CREATE TABLE table_51367 (
"Year" real,
"Property Taxes" text,
"Investment Earnings" text,
"Other Local Sources" text,
"State & Federal" text,
"Total Revenue" text
) | What were the investment earnings in a year when total revenue was $21,779,618? | SELECT "Investment Earnings" FROM table_51367 WHERE "Total Revenue" = '21,779,618' | wikisql |
CREATE TABLE table_name_41 (
jockey VARCHAR,
winner VARCHAR
) | Who was the jockey for the winning horse Helioptic? | SELECT jockey FROM table_name_41 WHERE winner = "helioptic" | sql_create_context |
CREATE TABLE table_name_73 (
director VARCHAR,
nomination VARCHAR
) | Tell me the director nominated for best actor in a leading role | SELECT director FROM table_name_73 WHERE nomination = "best actor in a leading role" | sql_create_context |
CREATE TABLE table_name_60 (
Id VARCHAR
) | What is the 2004 value with 2r in 1994? | SELECT 2004 FROM table_name_60 WHERE 1994 = "2r" | sql_create_context |
CREATE TABLE table_name_13 (
drawn INTEGER,
points VARCHAR,
played VARCHAR
) | What was the drawn amount for teams with points of 12 and played smaller than 10? | SELECT AVG(drawn) FROM table_name_13 WHERE points = 12 AND played < 10 | sql_create_context |
CREATE TABLE table_42201 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" text
) | How many weeks had the Green Bay packers as opponents? | SELECT SUM("Week") FROM table_42201 WHERE "Opponent" = 'green bay packers' | wikisql |
CREATE TABLE table_name_7 (
total_foreign_born__1000_ INTEGER,
country VARCHAR,
born_in_other_eu_state__1000_ VARCHAR
) | How many Foreign-born (1000) are from Sweden and born in some other EU state (1000) larger than 477? | SELECT SUM(total_foreign_born__1000_) FROM table_name_7 WHERE country = "sweden" AND born_in_other_eu_state__1000_ > 477 | sql_create_context |
CREATE TABLE person_info (
RYBH text,
XBDM number,
XBMC text,
XM text,
CSRQ time,
CSD text,
MZDM text,
MZMC text,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
XLDM text,
XLMC text,
ZYLBDM text,
ZYMC text
)
CREATE TABLE zyjzjlb (
YLJGDM text,
JZLSH ... | 患者周庆生自二零零二年二月十日开始,截止到二零二一年九月二十七日,由哪几位医务人员为其检测指标093591的,查查这些医务人员的工号及姓名 | (SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND j... | css |
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... | Bar chart x axis sex y axis how many sex, and order in desc by the how many sex. | SELECT Sex, COUNT(Sex) FROM people GROUP BY Sex ORDER BY COUNT(Sex) DESC | nvbench |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeri... | how many hours had it been since patient 006-47576 received her first potassium chloride 20 meq in 50 ml ivpb **locked dose prescription on their current hospital encounter? | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', medication.drugstarttime)) FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-47... | eicu |
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId number,
PostId number,
SuggestedEditId number,
CompletedByReviewTaskId number
)
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId... | Unselfish - Those who answer and never ask.. Query of users who answer but never asked a question.
Sorted by number of answers for a user. | SELECT COUNT(u.DisplayName) FROM Users AS u WHERE (SELECT COUNT(*) FROM Posts WHERE OwnerUserId = u.Id AND PostTypeId = 2) = 0 AND (SELECT COUNT(*) FROM Posts WHERE OwnerUserId = u.Id AND PostTypeId = 1) != 0 | sede |
CREATE TABLE table_23285805_8 (
high_assists VARCHAR,
team VARCHAR
) | Who has the high assists when the team is Oklahoma City? | SELECT high_assists FROM table_23285805_8 WHERE team = "Oklahoma City" | sql_create_context |
CREATE TABLE table_19170 (
"Song title" text,
"Artist" text,
"Language" text,
"Decade" text,
"Genre" text,
"Exportable" text,
"Family Friendly" text
) | What language for the glam genre? | SELECT "Language" FROM table_19170 WHERE "Genre" = 'Glam' | 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 diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures (
... | find out the procedure icd9 code and drug name of patient with patient id 10317. | SELECT procedures.icd9_code, prescriptions.drug FROM procedures INNER JOIN prescriptions ON procedures.hadm_id = prescriptions.hadm_id WHERE procedures.subject_id = "10317" | mimicsql_data |
CREATE TABLE table_train_91 (
"id" int,
"mini_mental_state_examination_mmse" int,
"stroke" bool,
"rosen_modified_hachinski_ischemic_score" int,
"NOUSE" float
) | rosen modified hachinski ischemic score less than or equal to 4 | SELECT * FROM table_train_91 WHERE rosen_modified_hachinski_ischemic_score <= 4 | criteria2sql |
CREATE TABLE table_22985 (
"Name" text,
"Completions" real,
"Attempts" real,
"Completion %" text,
"Yards" real,
"Touchdowns" real,
"Interceptions" real,
"QB Rating" text
) | What is the highest number of interceptions? | SELECT MAX("Interceptions") FROM table_22985 | wikisql |
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDat... | Asked Questions per month for a given Tag. | SELECT t.TagName, YEAR(p.CreationDate), MONTH(p.CreationDate), COUNT(t.TagName) AS d FROM Tags AS t INNER JOIN PostTags AS pt ON t.Id = pt.TagId INNER JOIN Posts AS P ON p.Id = pt.PostId WHERE t.TagName = '##TagNam##' AND NOT p.ClosedDate IS NULL GROUP BY YEAR(p.CreationDate), MONTH(p.CreationDate), t.TagName ORDER BY ... | sede |
CREATE TABLE table_name_62 (
venue VARCHAR,
goal VARCHAR
) | Which venue has a Goal of 4? | SELECT venue FROM table_name_62 WHERE goal = 4 | 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 lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,... | count the number of patients whose primary disease is s/p fall and year of birth is less than 2085? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "S/P FALL" AND demographic.dob_year < "2085" | mimicsql_data |
CREATE TABLE table_76810 (
"Place" text,
"Player" text,
"Country" text,
"Score" real,
"To par" text
) | What is the average score for the player who is T5 in the United States? | SELECT AVG("Score") FROM table_76810 WHERE "Place" = 't5' AND "Country" = 'united states' | wikisql |
CREATE TABLE table_15703 (
"Rank" real,
"Lane" real,
"Name" text,
"Nationality" text,
"Time" real
) | What is the lowest rank with poland as the nationality and a time greater than 55.34? | SELECT MIN("Rank") FROM table_15703 WHERE "Nationality" = 'poland' AND "Time" > '55.34' | wikisql |
CREATE TABLE table_3814 (
"Sd" real,
"Rk" real,
"Player" text,
"Points" real,
"Points defending" text,
"Points won" real,
"New points" real,
"Status" text
) | What's Kaia Kanepi's Sd? | SELECT MIN("Sd") FROM table_3814 WHERE "Player" = 'Kaia Kanepi' | wikisql |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | how many patients whose ethnicity is black/haitian and drug route is sc? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "BLACK/HAITIAN" AND prescriptions.route = "SC" | mimicsql_data |
CREATE TABLE addresses (
address_id text,
line_1 text,
line_2 text,
city_town text,
state_county text,
other_details text
)
CREATE TABLE performers_in_bookings (
order_id number,
performer_id number
)
CREATE TABLE bookings (
booking_id number,
customer_id number,
workshop_g... | What is the description of the marketing region China? | SELECT marketing_region_descriptrion FROM marketing_regions WHERE marketing_region_name = "China" | spider |
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Percent text,
ACC_Home text,
ACC_Road text,
All_Games text,
All_Games_Percent int,
All_Home text,
All_Road text,
All_Neutral text
)
CREATE TABLE university (
Scho... | Give me the comparison about the amount of ACC_Road over the ACC_Road , and group by attribute ACC_Road, display x-axis in desc order. | SELECT ACC_Road, COUNT(ACC_Road) FROM basketball_match GROUP BY ACC_Road ORDER BY ACC_Road DESC | nvbench |
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END... | Plot salary by grouped by email as a bar graph | SELECT EMAIL, SALARY FROM employees | nvbench |
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,... | get me the number of female patients who left against medical advice. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "F" AND demographic.discharge_location = "LEFT AGAINST MEDICAL ADVI" | mimicsql_data |
CREATE TABLE table_6061 (
"Game" real,
"April" real,
"Opponent" text,
"Score" text,
"Record" text
) | Which game took place April 6? | SELECT "Game" FROM table_6061 WHERE "April" = '6' | wikisql |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE vitalperiodi... | when did patient 027-106613 first take a tv lab test in 04/2103? | SELECT lab.labresulttime FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-106613')) AND lab.labname = 'tv' AND STRFTIME('%y-%m', lab.labresulttime) = '21... | eicu |
CREATE TABLE gwyjzb (
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,
... | 查查患者88565682之前的全部治疗方案 | SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM gwyjzb JOIN t_kc22 ON gwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gwyjzb.PERSON_ID = '88565682' AND t_kc22.MED_INV_ITEM_TYPE = '治疗费' UNION SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM fgwyjzb JOIN t_kc22 ON fgwyjzb.MED_CLINIC_ID = t_kc22.MED... | css |
CREATE TABLE table_name_70 (
home__1st_leg_ VARCHAR,
aggregate VARCHAR
) | Which team played their first leg at home with an aggregate score of 3-4? | SELECT home__1st_leg_ FROM table_name_70 WHERE aggregate = "3-4" | sql_create_context |
CREATE TABLE table_25525 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text
) | When 129 is the number in the series who is the writer? | SELECT "Written by" FROM table_25525 WHERE "No. in series" = '129' | wikisql |
CREATE TABLE table_name_69 (
category VARCHAR,
tournament VARCHAR
) | What is the Category of the Rodez, France Tournament? | SELECT category FROM table_name_69 WHERE tournament = "rodez, france" | sql_create_context |
CREATE TABLE table_24725951_1 (
episode VARCHAR,
celebrities VARCHAR
) | Which episode had celebrities Nick Hewer and Saira Khan in them? | SELECT episode FROM table_24725951_1 WHERE celebrities = "Nick Hewer and Saira Khan" | sql_create_context |
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,... | For those employees who did not have any job in the past, give me the comparison about the sum of salary over the hire_date bin hire_date by time, could you sort by the Y in desc? | SELECT HIRE_DATE, SUM(SALARY) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY SUM(SALARY) DESC | nvbench |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
... | provide the number of patients whose diagnoses short title is trnspl status-bne marrow and drug route is im? | 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.short_title = "Trnspl status-bne marrow" AND prescriptions.route = "IM" | mimicsql_data |
CREATE TABLE table_name_92 (
rating INTEGER,
rank__timeslot_ VARCHAR,
rank__night_ VARCHAR
) | what is the rating when the rank (timeslot) is less than 3 and the rank (night) is less than 8? | SELECT SUM(rating) FROM table_name_92 WHERE rank__timeslot_ < 3 AND rank__night_ < 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 procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
... | provide the number of patients whose admission year is less than 2139 and lab test name is bilirubin, indirect? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2139" AND lab.label = "Bilirubin, Indirect" | mimicsql_data |
CREATE TABLE table_name_70 (
points INTEGER,
entrant VARCHAR,
year VARCHAR
) | What is the total points that an 1951 Entrant alfa romeo spa have? | SELECT SUM(points) FROM table_name_70 WHERE entrant = "alfa romeo spa" AND year < 1951 | sql_create_context |
CREATE TABLE table_name_15 (
goals_scored VARCHAR,
points VARCHAR,
draws VARCHAR,
loses VARCHAR
) | What is the total number of goals scored of the club with more than 3 draws, more than 1 loses, and less than 26 points? | SELECT COUNT(goals_scored) FROM table_name_15 WHERE draws > 3 AND loses > 1 AND points < 26 | sql_create_context |
CREATE TABLE table_23032 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"U.S. viewers (millions)" text
) | Name the title for us viewers being 18.29 | SELECT "Title" FROM table_23032 WHERE "U.S. viewers (millions)" = '18.29' | wikisql |
CREATE TABLE table_name_29 (
Id VARCHAR
) | What 2006 has 0-0 as the 2011? | SELECT 2006 FROM table_name_29 WHERE 2011 = "0-0" | sql_create_context |
CREATE TABLE table_name_33 (
competition VARCHAR,
score VARCHAR,
opponents VARCHAR
) | Which Competition has a Score of 0-1, and Opponents of pkns fc? | SELECT competition FROM table_name_33 WHERE score = "0-1" AND opponents = "pkns fc" | sql_create_context |
CREATE TABLE table_25517718_3 (
extra_points INTEGER,
position VARCHAR
) | What is the smallest number of extra points for a left halfback? | SELECT MIN(extra_points) FROM table_25517718_3 WHERE position = "Left halfback" | sql_create_context |
CREATE TABLE table_name_27 (
venue VARCHAR,
away_team VARCHAR
) | What venue featured north melbourne as the away side? | SELECT venue FROM table_name_27 WHERE away_team = "north melbourne" | sql_create_context |
CREATE TABLE table_16400 (
"Pick #" real,
"CFL Team" text,
"Player" text,
"Position" text,
"College" text
) | What is the highest selection number for the saskatchewan roughriders team? | SELECT MAX("Pick #") FROM table_16400 WHERE "CFL Team" = 'Saskatchewan Roughriders' | wikisql |
CREATE TABLE table_18012 (
"Release" text,
"Title" text,
"Windows" text,
"5th Gen" text,
"6th Gen" text,
"Handheld" text
) | Was the release on April 8 available on Windows? | SELECT "Windows" FROM table_18012 WHERE "Release" = 'April 8' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.