context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_25275 (
"Constituency" text,
"Winner" text,
"Party" text,
"Margin" real,
"Runner-up a" text,
"Party a" text
) | Name the most margin for nco party and p. ramachandran won | SELECT MAX("Margin") FROM table_25275 WHERE "Party" = 'NCO' AND "Winner" = 'P. Ramachandran' | wikisql |
CREATE TABLE complaints (
complaint_status_code VARCHAR
) | Which complaint status has more than 3 records on file? | SELECT complaint_status_code FROM complaints GROUP BY complaint_status_code HAVING COUNT(*) > 3 | sql_create_context |
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 prescriptions (
subject_id text,
hadm_id... | how many inpatient hospital admission patients have prescription for gentamicin medication? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_location = "TRANSFER FROM HOSP/EXTRAM" AND prescriptions.drug = "Gentamicin" | mimicsql_data |
CREATE TABLE table_54393 (
"Entrant" text,
"Constructor" text,
"Chassis" text,
"Engine" text,
"Tyres" text,
"Driver" text,
"Rounds" text
) | I want the tyres for hans binder | SELECT "Tyres" FROM table_54393 WHERE "Driver" = 'hans binder' | wikisql |
CREATE TABLE table_name_71 (
nationality VARCHAR,
goals VARCHAR
) | What country is the player who scored 27 goals from? | SELECT nationality FROM table_name_71 WHERE goals = 27 | sql_create_context |
CREATE TABLE table_name_84 (
team_name VARCHAR,
schools VARCHAR
) | What is the name of the team from cisne fairfield school? | SELECT team_name FROM table_name_84 WHERE schools = "cisne fairfield" | sql_create_context |
CREATE TABLE table_name_7 (
total VARCHAR,
finish VARCHAR
) | Name the total number of total with finish of t45 | SELECT COUNT(total) FROM table_name_7 WHERE finish = "t45" | sql_create_context |
CREATE TABLE table_59419 (
"Place" text,
"Player" text,
"Country" text,
"Score" real,
"To par" text
) | Which player has a place of t2? | SELECT "Player" FROM table_59419 WHERE "Place" = 't2' | wikisql |
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
dual_airline varchar,
service_name text
)
CREATE TABLE days (
days_code varchar,
day_name varchar
)
CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
CREATE TABLE fare (
fare... | show me all TW flights please | SELECT DISTINCT flight_id FROM flight WHERE airline_code = 'TW' | atis |
CREATE TABLE zyjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
HZXM text,
JZKSDM text,
JZKSMC text,
JZLSH text,
KH text,
KLX number,
MZBMLX number,
MZJZLSH text,
MZZDBM text,
MZZDMC text,
MZZYZDZZBM... | 门诊诊断01248413这个病人患有精神抑郁症,611743检测指标的结果定量是什么?对应的单位呢 | SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN hz_info_mzjzjlb ON hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM... | css |
CREATE TABLE table_11207040_6 (
team VARCHAR,
outgoing_manager VARCHAR
) | What teams does jim mcinally manage? | SELECT team FROM table_11207040_6 WHERE outgoing_manager = "Jim McInally" | sql_create_context |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TA... | tell me the name of the specimen test patient 031-3355 last got this month? | 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 DATETIME(microlab.culturetakentime, 'start of month') ... | eicu |
CREATE TABLE table_name_98 (
date VARCHAR,
venue VARCHAR
) | What date was the match at mcg played? | SELECT date FROM table_name_98 WHERE venue = "mcg" | sql_create_context |
CREATE TABLE table_1206114_2 (
netflow_version VARCHAR,
vendor_and_type VARCHAR
) | What is the netflow version when vendor and type is pc and servers? | SELECT netflow_version FROM table_1206114_2 WHERE vendor_and_type = "PC and Servers" | sql_create_context |
CREATE TABLE table_8508 (
"White" text,
"Black" text,
"Year" real,
"Result" text,
"Moves" real,
"Tournament" text,
"Opening" text
) | What year had a black of Kramnik, opening of E05 Catalan Opening, moves greater than 38, and a result of ? | SELECT MAX("Year") FROM table_8508 WHERE "Result" = '½–½' AND "Black" = 'kramnik' AND "Opening" = 'e05 catalan opening' AND "Moves" > '38' | wikisql |
CREATE TABLE table_264 (
"Date" text,
"Tournament" text,
"Location" text,
"Purse( $ )" real,
"Winner" text,
"Score" text,
"1st Prize( $ )" real
) | What is the tournament of aug 29? | SELECT "Tournament" FROM table_264 WHERE "Date" = 'Aug 29' | wikisql |
CREATE TABLE table_9527 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text,
"Money ( $ )" real
) | what is the to par when the place is 8? | SELECT "To par" FROM table_9527 WHERE "Place" = '8' | wikisql |
CREATE TABLE airport (
airport_code varchar,
airport_name text,
airport_location text,
state_code varchar,
country_name varchar,
time_zone_code varchar,
minimum_connect_time int
)
CREATE TABLE compartment_class (
compartment varchar,
class_type varchar
)
CREATE TABLE restriction (
... | what is the earliest flight from MEMPHIS to CINCINNATI on 6 30 | 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 ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'CINCINNATI' AND date_day.day_number = 30 AND date_day.month_number = 6 A... | atis |
CREATE TABLE ship (
Ship_ID int,
Name text,
Type text,
Nationality text,
Tonnage int
)
CREATE TABLE mission (
Mission_ID int,
Ship_ID int,
Code text,
Launched_Year int,
Location text,
Speed_knots int,
Fate text
) | Return a bar chart showing the total number of ships' nationalities, and order Nationality in asc order. | SELECT Nationality, COUNT(Nationality) FROM ship GROUP BY Nationality ORDER BY Nationality | nvbench |
CREATE TABLE table_name_64 (
date VARCHAR,
region VARCHAR,
catalog VARCHAR
) | On what date was the catalog cy-24623 for New Zealand? | SELECT date FROM table_name_64 WHERE region = "new zealand" AND catalog = "cy-24623" | sql_create_context |
CREATE TABLE table_name_30 (
total INTEGER,
year_s__won VARCHAR
) | Name the least total for 1978 years won | SELECT MIN(total) FROM table_name_30 WHERE year_s__won = "1978" | sql_create_context |
CREATE TABLE mzjybgb (
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,
... | 之前,患者彭璇玑的异常情况有什么? | SELECT * FROM person_info JOIN hz_info JOIN mzjzjlb JOIN zyjybgb 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 = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB AND zyjybgb.YLJGDM = jyjgzb... | css |
CREATE TABLE Detention (
detention_summary VARCHAR
) | Return all detention summaries. | SELECT detention_summary FROM Detention | sql_create_context |
CREATE TABLE table_65295 (
"Rank" real,
"Lane" real,
"Athlete" text,
"Nationality" text,
"Time" real,
"React" real
) | What is the average react for a rank more than 8? | SELECT AVG("React") FROM table_65295 WHERE "Rank" > '8' | 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 hz_info_mzjzjlb (
JZLSH number,
... | 列出患者姜浩歌就诊科室在医院1560846中名称包含牙病的所有门诊就诊记录是什么流水号? | SELECT mzjzjlb.JZLSH 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_mzjzjlb.YLJGDM AND ... | css |
CREATE TABLE table_28023 (
"Episode #" text,
"Original Air Date (UK)" text,
"Episode Title" text,
"Director" text,
"Writer" text,
"Cast" text
) | What is the title of the episode that aired on 13 august 1981? | SELECT "Episode Title" FROM table_28023 WHERE "Original Air Date (UK)" = '13 August 1981' | wikisql |
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE Tags (
Id number,
TagName text,
Cou... | Users with votes but no or few posts. Users with no questions | SELECT u.Id AS "user_link", COUNT(p.OwnerUserId) AS TotalPosts, u.UpVotes, u.DownVotes FROM Users AS u LEFT JOIN Posts AS p ON u.Id = p.OwnerUserId WHERE p.Id IS NULL AND u.UpVotes + u.DownVotes > '##MinVotes##' GROUP BY u.Id, u.UpVotes, u.DownVotes ORDER BY COUNT(p.OwnerUserId), u.UpVotes DESC | sede |
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
CreationDate time,
UserId number,
UserDisplayName text,
Comment text,
Text text,
ContentLicense... | Days between Question Asked and Answer Accepted. | SELECT p.Id AS "post_link", p.CreationDate AS QuestionAsked, p.AnswerCount AS NumberOfAnswers, v.CreationDate AS AnswerAccepted, DATEDIFF(day, p.CreationDate, CreationDate) AS DiffDate FROM Posts AS p INNER JOIN Posts AS a ON a.Id = p.AcceptedAnswerId INNER JOIN Votes AS v ON a.Id = v.PostId WHERE p.PostTypeId = 1 AND ... | sede |
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... | 项目3265在医疗机构7787217有多少检查记录? | SELECT COUNT(*) FROM qtb JOIN t_kc22 ON qtb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE qtb.MED_SER_ORG_NO = '7787217' AND t_kc22.SOC_SRT_DIRE_CD = '3265' UNION SELECT COUNT(*) FROM gyb JOIN t_kc22 ON gyb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gyb.MED_SER_ORG_NO = '7787217' AND t_kc22.SOC_SRT_DIRE_CD = '3265' UNION ... | css |
CREATE TABLE table_72867 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | Name the record for score of l 93 104 (ot) | SELECT "Record" FROM table_72867 WHERE "Score" = 'L 93–104 (OT)' | wikisql |
CREATE TABLE table_22282917_26 (
code_ VARCHAR,
_location VARCHAR,
launch_site_condition_owner VARCHAR
) | What is every code and location where the launch site condition and owner is obliterated? | SELECT code_ & _location FROM table_22282917_26 WHERE launch_site_condition_owner = "Obliterated" | sql_create_context |
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
... | Top 10 Tags Associated with Posts Created in 2017. | SELECT Tags, COUNT(DISTINCT Id) AS post_cnt FROM Posts WHERE YEAR(CreationDate) = '2017' GROUP BY Tags ORDER BY post_cnt DESC LIMIT 10 | sede |
CREATE TABLE procedures (
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
)
... | What is lab test abnormal status and lab test name of Roxana Weaver? | SELECT lab.flag, lab.label FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.name = "Roxanna Weaver" | mimicsql_data |
CREATE TABLE table_204_480 (
id number,
"title" text,
"alternate title(s)" text,
"year" number,
"manufacturer" text,
"genre(s)" text,
"max. players" number
) | how many arcade games were released before 1979 ? | SELECT COUNT(*) FROM table_204_480 WHERE "year" < 1979 | squall |
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDisplayName text... | My unaccepted answers with non-zero probability of acceptance. | SELECT Q.Id AS "post_link" FROM Posts AS Q INNER JOIN Posts AS A ON (Q.Id = A.ParentId) INNER JOIN Users AS U ON (Q.OwnerUserId = U.Id) WHERE Q.PostTypeId = 1 AND A.PostTypeId = 2 AND A.OwnerUserId = @UserId AND Q.AcceptedAnswerId IS NULL AND Q.ClosedDate IS NULL AND NOT EXISTS(SELECT A2.Id FROM Posts AS A2 WHERE A2.Po... | sede |
CREATE TABLE table_name_33 (
class VARCHAR,
quantity VARCHAR,
gwr_nos VARCHAR
) | Which class is smaller than 5 and the GWR is 1322 1323? | SELECT class FROM table_name_33 WHERE quantity < 5 AND gwr_nos = "1322–1323" | 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... | 从02年9月27日到17年9月18日这段时间,病患窦蕴美的所有检验结果指标记录的检查人为21945662的检验指标流水号是多少? | SELECT jyjgzbb.JYZBLSH 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... | css |
CREATE TABLE table_15193 (
"Name" text,
"Race" text,
"Current age" real,
"Age at offense" real,
"Years on death row" real,
"Location of offense" text
) | Who is the prisoner that is older than 45 and has served less than 22 years on death row? | SELECT "Name" FROM table_15193 WHERE "Current age" > '45' AND "Years on death row" < '22' | wikisql |
CREATE TABLE table_66155 (
"Township" text,
"County" text,
"Pop. (2010)" real,
"Land ( sqmi )" real,
"Water (sqmi)" real,
"Latitude" real,
"Longitude" real,
"GEO ID" real,
"ANSI code" real
) | What's the total of Water (sqmi) with a Land (sqmi) of 35.918 and has a Longitude that is smaller than -97.115459? | SELECT SUM("Water (sqmi)") FROM table_66155 WHERE "Land ( sqmi )" = '35.918' AND "Longitude" < '-97.115459' | wikisql |
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDisplayName text... | Find Deletable Questions I voted to close. | SELECT DISTINCT Q.Id AS "post_link", A.CreationDate FROM Posts AS Q INNER JOIN PostHistory AS PH ON Q.Id = PH.PostId INNER JOIN Posts AS A ON Q.Id = A.ParentId WHERE PH.CreationDate <= DATEADD(d, -2, GETDATE()) AND PH.PostHistoryTypeId = 10 AND PH.UserId = @UserId AND NOT Q.ClosedDate IS NULL AND A.Score > 0 | sede |
CREATE TABLE table_name_40 (
rank_points VARCHAR,
event VARCHAR,
score_points VARCHAR
) | What Rank points has an Event of wc beijing, and Score points of 11? | SELECT rank_points FROM table_name_40 WHERE event = "wc beijing" AND score_points = "11" | sql_create_context |
CREATE TABLE table_26010 (
"Pos" real,
"Constructor" text,
"Chassis" text,
"Starts" real,
"Finishes" real,
"Wins" real,
"Podiums" real,
"Stage wins" real,
"Power stage wins" real,
"Points" real
) | What is the finishes maximum number? | SELECT MAX("Finishes") FROM table_26010 | wikisql |
CREATE TABLE table_1601027_1 (
headphone_model VARCHAR,
driver_matched_db VARCHAR,
us_msrp VARCHAR
) | Which headphone models have a driver-matched DB of 0.1 and a US MSRP of $49? | SELECT headphone_model FROM table_1601027_1 WHERE driver_matched_db = "0.1" AND us_msrp = "$49" | sql_create_context |
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE inputevents_cv (
row_i... | what is the average daily number of people diagnosed with cv dis nec-deliver w p/p until 2102? | SELECT AVG(t1.c1) FROM (SELECT COUNT(DISTINCT diagnoses_icd.hadm_id) AS c1 FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'cv dis nec-deliver w p/p') AND STRFTIME('%y', diagnoses_icd.charttime) <= '2102' GROUP BY STRFTIME('%y... | mimic_iii |
CREATE TABLE mzjzjlb (
YLJGDM text,
JZLSH text,
KH text,
KLX number,
MJZH text,
HZXM text,
NLS number,
NLY number,
ZSEBZ number,
JZZTDM number,
JZZTMC text,
JZJSSJ time,
TXBZ number,
ZZBZ number,
WDBZ number,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
... | 13948798患者头部的各项指标检验结果是什么? | (SELECT * 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_info.RYBH = ... | css |
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 procedures (
... | what is days of hospital stay and procedure short title of subject id 813? | SELECT demographic.days_stay, procedures.short_title FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.subject_id = "813" | mimicsql_data |
CREATE TABLE table_name_84 (
lane VARCHAR,
react VARCHAR,
rank VARCHAR
) | What Lane has a 0.209 React entered with a Rank entry that is larger than 6? | SELECT lane FROM table_name_84 WHERE react > 0.209 AND rank > 6 | sql_create_context |
CREATE TABLE table_20396 (
"N\u00b0" text,
"Television service" text,
"Country" text,
"Language" text,
"Content" text,
"DAR" text,
"HDTV" text,
"PPV" text,
"Package/Option" text
) | What package offers cinema content and is n. 333? | SELECT "Package/Option" FROM table_20396 WHERE "Content" = 'cinema' AND "N\u00b0" = '333' | 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... | 在2001年1月7号到2013年4月27号期间医疗机构0295569就诊记录里面有儿童医保的就诊记录数量 | SELECT COUNT(*) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '0295569' AND t_kc21.IN_HOSP_DATE BETWEEN '2001-01-07' AND '2013-04-27' AND t_kc21.INSU_TYPE = '儿童' | css |
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additio... | Which upper level CS courses are offered next semester ? | SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN program_course ON program_course.course_id = course.course_id INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester WHERE program_course.catego... | advising |
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,
... | 病患云鸿运在2009-07-30之前做过的检验报告在哪些门诊,列出这些门诊就诊的流水编码 | SELECT mzjzjlb.JZLSH 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_mzjzjlb.YLJGDM AND ... | css |
CREATE TABLE table_203_767 (
id number,
"season" text,
"club" text,
"league" text,
"apps" number,
"goals" number
) | did ibricic score more or less goals in his 3 seasons with hajduk split when compared to his 4 seasons with nk zagreb ? | SELECT (SELECT SUM("goals") FROM table_203_767 WHERE "club" = 'hajduk split') > (SELECT SUM("goals") FROM table_203_767 WHERE "club" = 'nk zagreb') | squall |
CREATE TABLE table_name_15 (
callback_venue VARCHAR,
audition_city VARCHAR
) | What was the callback venue for the Phoenix, Arizona auditions? | SELECT callback_venue FROM table_name_15 WHERE audition_city = "phoenix, arizona" | sql_create_context |
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 Ref_Incident_Type (
... | A bar chart shows the distribution of date_address_from and the amount of date_address_from , and group by attribute other_details and bin date_address_from by time. | SELECT date_address_from, COUNT(date_address_from) FROM Student_Addresses GROUP BY other_details ORDER BY monthly_rental DESC | nvbench |
CREATE TABLE table_72640 (
"Date" text,
"Tournament" text,
"Player" text,
"Country" text,
"Rounds" text,
"Score" real,
"To par" text,
"Finish" text
) | What players finished 2nd? | SELECT "Player" FROM table_72640 WHERE "Finish" = '2nd' | wikisql |
CREATE TABLE table_3358 (
"Total" real,
"#" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Canadian air date" text,
"UK air date" text,
"Canadian Viewers (millions)" text
) | If the UK air date is February 18, 2013, who was the episode written by? | SELECT "Written by" FROM table_3358 WHERE "UK air date" = 'February 18, 2013' | wikisql |
CREATE TABLE table_49851 (
"Date" text,
"H/A/N" text,
"Opponent" text,
"Score" text,
"Record" text
) | Who did they play when the score was 95-118? | SELECT "Opponent" FROM table_49851 WHERE "Score" = '95-118' | wikisql |
CREATE TABLE table_42109 (
"Source" text,
"Date" text,
"Clinton" text,
"Obama" text,
"Undecided" text
) | What kind of Obama that has a Source of rasmussen reports? | SELECT "Obama" FROM table_42109 WHERE "Source" = 'rasmussen reports' | wikisql |
CREATE TABLE table_44462 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
) | What is the Player that has a To standard of 1, and a Score of 71-68-76=215? | SELECT "Player" FROM table_44462 WHERE "To par" = '–1' AND "Score" = '71-68-76=215' | wikisql |
CREATE TABLE table_78757 (
"Year (Ceremony)" text,
"Film title used in nomination" text,
"Original title" text,
"Director" text,
"Result" text
) | What is the ceremony year when Ganito Kami Noon, Paano Kayo Ngayon was the original title? | SELECT "Year (Ceremony)" FROM table_78757 WHERE "Original title" = 'ganito kami noon, paano kayo ngayon' | wikisql |
CREATE TABLE complaints (
complaint_id number,
product_id number,
customer_id number,
complaint_outcome_code text,
complaint_status_code text,
complaint_type_code text,
date_complaint_raised time,
date_complaint_closed time,
staff_id number
)
CREATE TABLE customers (
customer_id... | Return the city with the customer type code 'Good Credit Rating' that had the fewest customers. | SELECT town_city FROM customers WHERE customer_type_code = "Good Credit Rating" GROUP BY town_city ORDER BY COUNT(*) LIMIT 1 | spider |
CREATE TABLE table_7664 (
"Region" text,
"Date" text,
"Label" text,
"Format" text,
"Catalog" text
) | What is the Format when Alfa records is the label, and there is a Catalog of alca-9016? | SELECT "Format" FROM table_7664 WHERE "Label" = 'alfa records' AND "Catalog" = 'alca-9016' | wikisql |
CREATE TABLE table_42850 (
"Year" real,
"Chassis" text,
"Engine" text,
"Start" real,
"Finish" real,
"Entrant" text
) | What start has a ford cosworth dfx as the engine, a year later than 1981, and kraco enterprises as the entrant? | SELECT "Start" FROM table_42850 WHERE "Engine" = 'ford cosworth dfx' AND "Year" > '1981' AND "Entrant" = 'kraco enterprises' | wikisql |
CREATE TABLE table_54457 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | When was Windy Hill used as a venue? | SELECT "Date" FROM table_54457 WHERE "Venue" = 'windy hill' | wikisql |
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE cost (
costid num... | when did patient 029-16431 have a base excess test for the last time when they came to the hospital last time? | 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 = '029-16431' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitala... | eicu |
CREATE TABLE table_25756 (
"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 (millions)" text
) | What is the title of the episode directed by Rodney Clouden? | SELECT "Title" FROM table_25756 WHERE "Directed by" = 'Rodney Clouden' | wikisql |
CREATE TABLE table_name_6 (
rank INTEGER,
silver INTEGER
) | what is the rank when silver is less than 0? | SELECT SUM(rank) FROM table_name_6 WHERE silver < 0 | sql_create_context |
CREATE TABLE table_name_76 (
date INTEGER,
score VARCHAR
) | On what Date was the Score of 3 6, 6 4, 3 6, 6 1, 6 2 | SELECT SUM(date) FROM table_name_76 WHERE score = "3–6, 6–4, 3–6, 6–1, 6–2" | sql_create_context |
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... | what is the name of the disease that dawn cooper is primarily suffering from? also find his admission type. | SELECT demographic.admission_type, demographic.diagnosis FROM demographic WHERE demographic.name = "Dawn Cooper" | mimicsql_data |
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
UserId number,
ContentLicense text
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,... | Bronze Badges for React in London, UK. | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Users.Id AS "user_link", Reputation, Location, Name FROM Users, Badges WHERE Users.Id = Badges.UserId AND Badges.TagBased = 1 AND Users.Location LIKE '%United%' AND Badges.Name = 'knockout.js' AND Badges.Name = 'reactjs' ORDER BY Reputation DESC | sede |
CREATE TABLE table_12338595_1 (
average VARCHAR,
state VARCHAR
) | How much is the average score for New York state? | SELECT average FROM table_12338595_1 WHERE state = "New York" | sql_create_context |
CREATE TABLE table_name_53 (
react INTEGER,
mark INTEGER
) | What is the average React, when Mark is less than 7.93? | SELECT AVG(react) FROM table_name_53 WHERE mark < 7.93 | sql_create_context |
CREATE TABLE table_4209 (
"Player" text,
"Starts" real,
"Cuts made" real,
"Best finish" text,
"Money list rank" text,
"Earnings ($)" real
) | What was the best finish for 206 on the money list? | SELECT "Best finish" FROM table_4209 WHERE "Money list rank" = '206' | wikisql |
CREATE TABLE table_name_73 (
crowd INTEGER,
venue VARCHAR
) | Who was the team with the smallest crowd at the Princes Park venue? | SELECT MIN(crowd) FROM table_name_73 WHERE venue = "princes park" | sql_create_context |
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description varchar
)
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varc... | i'd like to know what flights UA has from DALLAS to SAN FRANCISCO | 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 = 'SAN FRANCISCO' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = ... | atis |
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,
... | 根据科室编码和入院诊断疾病编码的不同看看医院8056118全部诊疗记录中大病支付和全部医疗费用的比值最小有多少 | SELECT gwyjzb.MED_ORG_DEPT_CD, gwyjzb.IN_DIAG_DIS_CD, MIN(t_kc24.ILL_PAY) FROM gwyjzb JOIN t_kc24 ON gwyjzb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE gwyjzb.MED_SER_ORG_NO = '8056118' GROUP BY gwyjzb.MED_ORG_DEPT_CD, gwyjzb.IN_DIAG_DIS_CD UNION SELECT fgwyjzb.MED_ORG_DEPT_CD, fgwyjzb.IN_DIAG_DIS_CD, MIN(t_kc24.ILL_PAY... | css |
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 ... | 从2016年1月19到2018年2月22的这段时间里,看看医疗机构3982610处理的新生儿门诊的就诊记录 | SELECT COUNT(*) FROM mzjzjlb WHERE YLJGDM = '3982610' AND JZKSRQ BETWEEN '2016-01-19' AND '2018-02-22' AND ZSEBZ > 0 | css |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE medication (
medicatio... | had patient 021-114154 had any allergies until 56 months ago? | SELECT COUNT(*) > 0 FROM allergy WHERE allergy.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '021-114154')) AND DATETIME(allergy.allergytime) <= DATETIME(CURRENT_TIME(), '-56... | eicu |
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE prescriptions (
... | what is the minimum total cost of a hospital that includes laboratory testing for c-reactive protein since 2102? | SELECT MIN(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.hadm_id IN (SELECT labevents.hadm_id FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'c-reactive protein')) AND STRFTIME('%y', cost.chargetime) >= '2102' GROUP BY cost.hadm_id) AS t1 | mimic_iii |
CREATE TABLE table_69446 (
"Date" text,
"Course" text,
"Distance" text,
"Type" text,
"Winner" text
) | What type is the race with the vicenza to marostica course? | SELECT "Type" FROM table_69446 WHERE "Course" = 'vicenza to marostica' | wikisql |
CREATE TABLE table_16654785_2 (
average_climb___percentage_ INTEGER,
name VARCHAR
) | What is the average climb for Tenbosse? | SELECT MIN(average_climb___percentage_) FROM table_16654785_2 WHERE name = "Tenbosse" | sql_create_context |
CREATE TABLE table_name_94 (
tied INTEGER,
points VARCHAR,
games VARCHAR,
goals_for VARCHAR
) | Name the least tied with games more than 70 and goals for less than 310 with points of 98 | SELECT MIN(tied) FROM table_name_94 WHERE games > 70 AND goals_for < 310 AND points = 98 | sql_create_context |
CREATE TABLE table_10577579_3 (
left VARCHAR,
women’s_nickname VARCHAR
) | Name the left of the Lady Pilots. | SELECT left FROM table_10577579_3 WHERE women’s_nickname = "Lady Pilots" | 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... | 从2014年2月8日到2016年4月24日,4804151这个医疗机构在外地门诊的就诊记录具体是多少 | SELECT COUNT(*) FROM mzjzjlb WHERE mzjzjlb.YLJGDM = '4804151' AND mzjzjlb.JZKSRQ BETWEEN '2014-02-08' AND '2016-04-24' AND mzjzjlb.WDBZ > 0 | css |
CREATE TABLE table_name_22 (
season INTEGER,
position VARCHAR
) | What is the most recent year with a finish in 2nd position? | SELECT MAX(season) FROM table_name_22 WHERE position = "2nd" | sql_create_context |
CREATE TABLE table_21089 (
"Name" text,
"Latitude" text,
"Longitude" text,
"Diameter (km)" text,
"Year named" real,
"Name origin" text
) | Name the latitude of laima tessera | SELECT "Latitude" FROM table_21089 WHERE "Name" = 'Laima Tessera' | wikisql |
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
) | For those records from the products and each product's manufacturer, return a bar chart about the distribution of name and code , and group by attribute founder, and order by the Code in desc. | SELECT T1.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder, T1.Name ORDER BY T1.Code DESC | nvbench |
CREATE TABLE exhibition_record (
Exhibition_ID int,
Date text,
Attendance int
)
CREATE TABLE exhibition (
Exhibition_ID int,
Year int,
Theme text,
Artist_ID int,
Ticket_Price real
)
CREATE TABLE artist (
Artist_ID int,
Name text,
Country text,
Year_Join int,
Age int... | What is the number of countries in the artist table?, I want to order by the bars in asc. | SELECT Country, COUNT(Country) FROM artist GROUP BY Country ORDER BY Country | nvbench |
CREATE TABLE table_49394 (
"Class" text,
"Part 1" text,
"Part 2" text,
"Part 3" text,
"Part 4" text
) | What was part 4 when part 3 was *hleupun? | SELECT "Part 4" FROM table_49394 WHERE "Part 3" = '*hleupun' | wikisql |
CREATE TABLE table_57288 (
"Round" real,
"Player" text,
"Position" text,
"Nationality" text,
"College/Junior/Club Team (League)" text
) | Tell me the college for carl hagelin | SELECT "College/Junior/Club Team (League)" FROM table_57288 WHERE "Player" = 'carl hagelin' | wikisql |
CREATE TABLE table_12576536_1 (
population__maryborough_ VARCHAR,
population__woocoo_ VARCHAR
) | Name the population of maryborough when population of woocoo is 2700 | SELECT population__maryborough_ FROM table_12576536_1 WHERE population__woocoo_ = 2700 | sql_create_context |
CREATE TABLE table_name_12 (
top_5 INTEGER,
events INTEGER
) | With events less than 0, what is the fewest Top-5? | SELECT MIN(top_5) FROM table_name_12 WHERE events < 0 | sql_create_context |
CREATE TABLE table_58743 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Results" text
) | What is Incumbent, when Results is 'Re-Elected', when Party is 'Democratic', and when District is 'Minnesota 7'? | SELECT "Incumbent" FROM table_58743 WHERE "Results" = 're-elected' AND "Party" = 'democratic' AND "District" = 'minnesota 7' | wikisql |
CREATE TABLE table_name_33 (
week VARCHAR,
date VARCHAR
) | What week has December 19, 2004 as the date? | SELECT week FROM table_name_33 WHERE date = "december 19, 2004" | sql_create_context |
CREATE TABLE schedule (
Cinema_ID int,
Film_ID int,
Date text,
Show_times_per_day int,
Price float
)
CREATE TABLE cinema (
Cinema_ID int,
Name text,
Openning_year int,
Capacity int,
Location text
)
CREATE TABLE film (
Film_ID int,
Rank_in_series int,
Number_in_seaso... | Create a bar chart showing capacity across name | SELECT Name, Capacity FROM cinema | nvbench |
CREATE TABLE student (
stuid number,
lname text,
fname text,
age number,
sex text,
major number,
advisor number,
city_code text
)
CREATE TABLE voting_record (
stuid number,
registration_date text,
election_cycle text,
president_vote number,
vice_president_vote number... | Who served as an advisor for students who have treasurer votes in the spring election cycle? | SELECT DISTINCT T1.advisor FROM student AS T1 JOIN voting_record AS T2 ON T1.stuid = T2.treasurer_vote WHERE T2.election_cycle = "Spring" | spider |
CREATE TABLE table_45058 (
"Outcome" text,
"Date" text,
"Tournament" text,
"Surface" text,
"Partner" text,
"Opponents in the final" text,
"Score" text
) | What was hayley ericksen's score? | SELECT "Score" FROM table_45058 WHERE "Partner" = 'hayley ericksen' | wikisql |
CREATE TABLE table_name_77 (
venue VARCHAR,
competition VARCHAR
) | What is the venue of the 1990 Asian games? | SELECT venue FROM table_name_77 WHERE competition = "1990 asian games" | sql_create_context |
CREATE TABLE table_203_671 (
id number,
"name" text,
"rank" text,
"age" number,
"years until mandatory retirement" text,
"appointed by" text,
"year appointed" number
) | how long did roberto feliberti cintron serve before retirement ? | SELECT "years until mandatory retirement" FROM table_203_671 WHERE "name" = 'roberto feliberti cintron' | squall |
CREATE TABLE table_20630462_1 (
tier_iv_in VARCHAR,
tournament VARCHAR
) | What is the tier IV year for the tournament held in Tampa? | SELECT tier_iv_in FROM table_20630462_1 WHERE tournament = "Tampa" | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.