context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
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,
... | 患者13034482在2003年4月25日到2009年2月2日内曾在医院一共就诊多少次? | SELECT (SELECT COUNT(*) FROM hz_info JOIN mzjzjlb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE hz_info.RYBH = '13034482' AND mzjzjlb.JZKSRQ BETWEEN '2003-04-25' AND '2009-02-02') + (SELECT COUNT(*) FROM hz_info JOIN zyjzjlb ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_... | css |
CREATE TABLE table_33414 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | Who was the home team when the away team scored 5.9 (39)? | SELECT "Home team score" FROM table_33414 WHERE "Away team score" = '5.9 (39)' | wikisql |
CREATE TABLE table_62689 (
"Date" text,
"Tournament" text,
"Surface" text,
"Partner" text,
"Opponents" text,
"Score" text
) | Who was the Partner in the Algiers 2, Algeria Tournament? | SELECT "Partner" FROM table_62689 WHERE "Tournament" = 'algiers 2, algeria' | wikisql |
CREATE TABLE table_49747 (
"Date" text,
"Ship" text,
"Nationality" text,
"Tonnage" real,
"Fate" text
) | What is the Nationality of the Aracataca Ship? | SELECT "Nationality" FROM table_49747 WHERE "Ship" = 'aracataca' | wikisql |
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... | 投保人华嘉淑在2005年12月6日到2015年9月7日期间每一种药物最多都购买次了多少次? | SELECT COUNT(*) FROM gwyjzb JOIN t_kc22 ON gwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gwyjzb.PERSON_NM = '华嘉淑' AND t_kc22.STA_DATE BETWEEN '2005-12-06' AND '2015-09-07' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY COUNT(*) DESC LIMIT 1 UNION SELECT COUNT(*) FROM fgwyjzb JOIN t_kc22 ON fgwyjzb.MED_CLINIC_ID = t_kc22.... | css |
CREATE TABLE table_80454 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" real,
"Record" text
) | Which opponent has an attendance greater than 29,904 and 11-8 as the record? | SELECT "Opponent" FROM table_80454 WHERE "Attendance" > '29,904' AND "Record" = '11-8' | wikisql |
CREATE TABLE table_20342 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | WHO DID THE RAPTORS PLAY ON JANUARY 9? | SELECT "Team" FROM table_20342 WHERE "Date" = 'January 9' | wikisql |
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm... | how many days have elapsed since the first time patient 10855 had an intake of .9% normal saline on the current icu visit? | SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', inputevents_cv.charttime)) FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 10855) AND icustays.outtime IS NULL) ... | mimic_iii |
CREATE TABLE table_203_295 (
id number,
"position" number,
"driver / passenger" text,
"equipment" text,
"points" number,
"wins" number,
"second" number,
"third" number
) | the number of points daniel willemsen scored with his passenger | SELECT "points" FROM table_203_295 WHERE "driver / passenger" = 'daniel willemsen' | squall |
CREATE TABLE member (
Member_ID int,
Name text,
Country text,
College_ID int
)
CREATE TABLE round (
Round_ID int,
Member_ID int,
Decoration_Theme text,
Rank_in_Round int
)
CREATE TABLE college (
College_ID int,
Name text,
Leader_Name text,
College_Location text
) | Plot the total number by grouped by country as a bar graph, and order by the y axis from low to high please. | SELECT Country, COUNT(*) FROM member GROUP BY Country ORDER BY COUNT(*) | nvbench |
CREATE TABLE table_10694 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
) | I want the lowest Laps for time/retired of engine and driver of charles de tornaco | SELECT MIN("Laps") FROM table_10694 WHERE "Time/Retired" = 'engine' AND "Driver" = 'charles de tornaco' | wikisql |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | how many patients of black/cape verdean ethnicity are born before 2184? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "BLACK/CAPE VERDEAN" AND demographic.dob_year < "2184" | mimicsql_data |
CREATE TABLE table_32732 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What is the score for Hawthorn as an away team? | SELECT "Away team score" FROM table_32732 WHERE "Away team" = 'hawthorn' | wikisql |
CREATE TABLE table_21025437_5 (
viewers__millions_ VARCHAR,
episode_no VARCHAR
) | How many million viewers watched episode number 20? | SELECT viewers__millions_ FROM table_21025437_5 WHERE episode_no = 20 | sql_create_context |
CREATE TABLE table_73337 (
"Chapter" text,
"Installation Date" text,
"Institution" text,
"Location" text,
"Inactive" text
) | What was the installation date in El Paso, Texas? | SELECT "Installation Date" FROM table_73337 WHERE "Location" = 'El Paso, Texas' | wikisql |
CREATE TABLE table_29747178_2 (
title VARCHAR,
series__number VARCHAR
) | What is the title when the series # is 7? | SELECT title FROM table_29747178_2 WHERE series__number = 7 | sql_create_context |
CREATE TABLE table_10935205_1 (
canadian_airdate VARCHAR,
us_airdate VARCHAR
) | The U.S. airdate of 8 august 2008 also had canadian airdates of what? | SELECT canadian_airdate FROM table_10935205_1 WHERE us_airdate = "8 August 2008" | sql_create_context |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE diagnosis (
diagnosisid number... | in 2103, what were the five most frequent medications prescribed to patients in the same hospital encounter after the diagnosis of pain? | SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'pain' AND STRFT... | eicu |
CREATE TABLE table_40074 (
"Ring name" text,
"Current rank" text,
"Debut" text,
"Stable" text,
"Birthplace" text
) | What is Current Rank, when Ring Name is Tamaasuka Daisuke? | SELECT "Current rank" FROM table_40074 WHERE "Ring name" = 'tamaasuka daisuke' | wikisql |
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 demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob te... | give me the number of patients with procedure icd9 code 966 who were admitted in hospital before 2138. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admityear < "2138" AND procedures.icd9_code = "966" | mimicsql_data |
CREATE TABLE table_67806 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" text,
"Record" text
) | Can you tell me the Attendance that has the Date of april 12? | SELECT "Attendance" FROM table_67806 WHERE "Date" = 'april 12' | wikisql |
CREATE TABLE table_30482 (
"Parent unit" text,
"Geschwader Base" text,
"Unit (Gruppe/Staffel)" text,
"Aircraft Type" text,
"Commanding Officer" text
) | Name the aircraft type for jagdgeschwader 6 | SELECT "Aircraft Type" FROM table_30482 WHERE "Parent unit" = 'Jagdgeschwader 6' | wikisql |
CREATE TABLE table_name_16 (
inclination VARCHAR,
semimajor_axis___au__ VARCHAR
) | What inclination has a semimajor axis of 20 au? | SELECT inclination FROM table_name_16 WHERE semimajor_axis___au__ = "20 au" | sql_create_context |
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE o... | since 5 years ago patient 16571 was diagnosed with a special symptom nec/nos? | SELECT COUNT(*) > 0 FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'special symptom nec/nos') AND diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 16571) AND DATETIME(diagnoses... | mimic_iii |
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... | look for the route of drug administration and primary disease of patient marilyn norvell. | SELECT demographic.diagnosis, prescriptions.route FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.name = "Marilyn Norvell" | mimicsql_data |
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 diagnoses is crn ath atlg vn bps grft and lab test category is hematology. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.short_title = "Crn ath atlg vn bps grft" AND lab."CATEGORY" = "Hematology" | mimicsql_data |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE vitalperiodic (
... | how much does the heartrate change of patient 031-19622 last measured on the last icu visit compared to the second to last value measured on the last icu visit? | SELECT (SELECT vitalperiodic.heartrate FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-19622') AND NOT patient.unitdischargetime IS ... | eicu |
CREATE TABLE table_51665 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
) | What is the number of laps for Grid 14? | SELECT COUNT("Laps") FROM table_51665 WHERE "Grid" = '14' | wikisql |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
C... | what is the number of male patients who have ng route of drug administration? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.gender = "M" AND prescriptions.route = "NG" | 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... | Stacked bar chart of school_id for with each ACC_Home in each acc road, rank by the Y-axis in asc. | SELECT ACC_Road, School_ID FROM basketball_match GROUP BY ACC_Home, ACC_Road ORDER BY School_ID | nvbench |
CREATE TABLE table_name_44 (
split_off___continuation_of VARCHAR,
church_name VARCHAR
) | What was the Independent Church's Split off/ Continuation? | SELECT split_off___continuation_of FROM table_name_44 WHERE church_name = "independent church" | sql_create_context |
CREATE TABLE table_56976 (
"Rank" real,
"Name" text,
"Nation" text,
"SP+FS" real,
"Points" real,
"Placings" real
) | What is the average points value for a rank less than 12 for David Santee? | SELECT AVG("Points") FROM table_56976 WHERE "Rank" < '12' AND "Name" = 'david santee' | wikisql |
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 outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
... | how much is the change in bicarbonate in patient 83182 last measured on the current hospital visit compared to the first value measured on the current hospital visit? | SELECT (SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 83182 AND admissions.dischtime IS NULL) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'bicarbonate') ORDER BY labevents.chartt... | mimic_iii |
CREATE TABLE table_30969 (
"Episode" real,
"Broadcast date" text,
"Guest(s)" text,
"Singer(s)" text,
"Ratings" text
) | which episode did sarah millican and grayson perry appear in | SELECT MIN("Episode") FROM table_30969 WHERE "Guest(s)" = 'Sarah Millican and Grayson Perry' | wikisql |
CREATE TABLE table_1712 (
"Episode #" real,
"US air date" text,
"Rating" text,
"Share" text,
"Rating/Share (18\u201349)" text,
"Viewers (millions)" text
) | How many rating/share values does the episode aired on Saturday, May 9, 2009? | SELECT COUNT("Rating/Share (18\u201349)") FROM table_1712 WHERE "US air date" = 'Saturday, May 9, 2009' | wikisql |
CREATE TABLE table_name_58 (
city VARCHAR,
state VARCHAR,
venue VARCHAR
) | Which city in Texas hosts the Frank Erwin center? | SELECT city FROM table_name_58 WHERE state = "texas" AND venue = "frank erwin center" | sql_create_context |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
... | what is age and insurance of subject id 42067? | SELECT demographic.age, demographic.insurance FROM demographic WHERE demographic.subject_id = "42067" | mimicsql_data |
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 office hospital admission patients had open and other sigmoidectomy? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_location = "PHYS REFERRAL/NORMAL DELI" AND procedures.short_title = "Open sigmoidectomy NEC" | mimicsql_data |
CREATE TABLE table_57691 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What is the scoreof the away team Collingwood? | SELECT "Away team score" FROM table_57691 WHERE "Away team" = 'collingwood' | wikisql |
CREATE TABLE table_name_68 (
total VARCHAR,
nation VARCHAR,
rank VARCHAR,
gold VARCHAR,
silver VARCHAR
) | What is the total number of Total, when Gold is less than 1, when Silver is greater than 0, when Rank is 14, and when Nation is Afghanistan? | SELECT COUNT(total) FROM table_name_68 WHERE gold < 1 AND silver > 0 AND rank = "14" AND nation = "afghanistan" | sql_create_context |
CREATE TABLE table_name_66 (
events INTEGER,
top_10 VARCHAR,
cuts_made VARCHAR,
top_5 VARCHAR
) | How many total events have cuts made over 12, more than 2 top-5s, and more than 11 top-10s? | SELECT SUM(events) FROM table_name_66 WHERE cuts_made > 12 AND top_5 > 2 AND top_10 > 11 | sql_create_context |
CREATE TABLE table_72112 (
"Rd" real,
"Name" text,
"Pole Position" text,
"Fastest Lap" text,
"Winning driver" text,
"Winning team" text,
"Report" text
) | What was the fastest lap time in the Escort Radar Warning 200? | SELECT "Fastest Lap" FROM table_72112 WHERE "Name" = 'Escort Radar Warning 200' | wikisql |
CREATE TABLE table_23141 (
"County" text,
"Starky #" real,
"Starky %" text,
"Hancock #" real,
"Hancock %" text,
"McCain #" real,
"McCain %" text,
"Total" real
) | how many times was hancock % considered when starky % was 20.96% | SELECT COUNT("Hancock %") FROM table_23141 WHERE "Starky %" = '20.96%' | wikisql |
CREATE TABLE table_name_39 (
points VARCHAR,
goals_scored INTEGER
) | What were the total number of points when the amount of goals scored was less than 20? | SELECT COUNT(points) FROM table_name_39 WHERE goals_scored < 20 | sql_create_context |
CREATE TABLE table_15829930_5 (
wins INTEGER,
success_rate VARCHAR
) | Name the least wins of 56.25% | SELECT MIN(wins) FROM table_15829930_5 WHERE success_rate = "56.25%" | sql_create_context |
CREATE TABLE table_15187735_3 (
segment_c VARCHAR,
segment_b VARCHAR
) | Name the segment c for pottery | SELECT segment_c FROM table_15187735_3 WHERE segment_b = "Pottery" | sql_create_context |
CREATE TABLE table_59594 (
"Rank" text,
"County" text,
"State" text,
"Land area (km\u00b2)" text,
"Land area (mi\u00b2)" text,
"April 1, 2010 census" text,
"April 1, 2010 density (/km\u00b2)" text,
"April 1, 2010 density (/mi\u00b2)" text,
"July 1, 2010 official estimate" text,
"... | What is the rank where the July 1, 2010 density equals 437? | SELECT "Rank" FROM table_59594 WHERE "July 1, 2010 density (/km\u00b2)" = '437' | wikisql |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE cost (
costid number,
... | when did patient 029-27704 receive the last procedure during the first hospital visit? | SELECT treatment.treatmenttime FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '029-27704' AND NOT patient.hospitaldischargetime IS NULL ORDER BY... | eicu |
CREATE TABLE medicine_enzyme_interaction (
enzyme_id number,
medicine_id number,
interaction_type text
)
CREATE TABLE enzyme (
id number,
name text,
location text,
product text,
chromosome text,
omim number,
porphyria text
)
CREATE TABLE medicine (
id number,
name text,... | How many distinct FDA approval statuses are there for the medicines? | SELECT COUNT(DISTINCT fda_approved) FROM medicine | spider |
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Votes (
Id number,
PostId number,... | All posts with a given tag, formatted for copying out post links. | SELECT q.Id AS "Id", 'http://chemistry.stackexchange.com/q/' + CAST(q.Id AS TEXT(15)) AS "Link" FROM Posts AS q WHERE q.PostTypeId = 1 AND q.Tags LIKE '%<' + @Tag + '>%' ORDER BY q.Id | sede |
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE TABLE PostHistory (
Id num... | Number of users which made their last comment in a given month. | WITH last_cte AS (SELECT UserId, MAX(Id) AS MaxId FROM Comments GROUP BY UserId), dates_cte AS (SELECT c.UserId AS odn, c.Id AS cid, c.CreationDate AS CDate FROM Comments AS c INNER JOIN last_cte ON c.Id = maxid) SELECT LAST_DATE_OF_MONTH(CDate), COUNT(odn) FROM dates_cte GROUP BY LAST_DATE_OF_MONTH(CDate) ORDER BY LAS... | sede |
CREATE TABLE table_27734577_2 (
team VARCHAR,
date VARCHAR
) | Which team was the opponent on october 21? | SELECT team FROM table_27734577_2 WHERE date = "October 21" | sql_create_context |
CREATE TABLE Students (
student_id INTEGER,
date_of_registration DATETIME,
date_of_latest_logon DATETIME,
login_name VARCHAR(40),
password VARCHAR(10),
personal_name VARCHAR(40),
middle_name VARCHAR(40),
family_name VARCHAR(40)
)
CREATE TABLE Course_Authors_and_Tutors (
author_id IN... | Find password and gender_mf , and visualize them by a bar chart. | SELECT password, gender_mf FROM Course_Authors_and_Tutors ORDER BY personal_name | nvbench |
CREATE TABLE table_name_50 (
sio_2 INTEGER,
na_2_o VARCHAR,
k_2_o VARCHAR,
fe_2_o_3 VARCHAR
) | What is the highest SiO 2, when K 2 O is greater than 0.16, when Fe 2 O 3 is greater than 0.16, and when Na 2 O is less than 7.53? | SELECT MAX(sio_2) FROM table_name_50 WHERE k_2_o > 0.16 AND fe_2_o_3 > 0.16 AND na_2_o < 7.53 | sql_create_context |
CREATE TABLE table_73387 (
"Year" real,
"Champion" text,
"Country" text,
"Venue" text,
"Location of venue" text,
"Winners Score" text,
"Winners share ( $ )" real
) | Where is the Bellerive Country Club venue located? | SELECT "Location of venue" FROM table_73387 WHERE "Venue" = 'Bellerive Country Club' | wikisql |
CREATE TABLE table_name_96 (
opponent VARCHAR,
week VARCHAR
) | Who is the opponent for week 5? | SELECT opponent FROM table_name_96 WHERE week = 5 | sql_create_context |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
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,
KH te... | 韦宏峻患者在门诊诊断为多动性障碍的检测指标037121的结果还有他的定量及单位都是多少? | SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW 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_MZ... | css |
CREATE TABLE table_6902 (
"Year" text,
"Playoff round" text,
"Venue" text,
"Winner" text,
"Result" text,
"Loser" text
) | What is the Loser when the winner was los angeles lakers (10)? | SELECT "Loser" FROM table_6902 WHERE "Winner" = 'los angeles lakers (10)' | wikisql |
CREATE TABLE table_28161 (
"Village" text,
"Area km\u00b2" text,
"Population (2000 census )" real,
"Region" text,
"Pop. Density" real
) | How many places named asan-maina? | SELECT COUNT("Region") FROM table_28161 WHERE "Village" = 'Asan-Maina' | wikisql |
CREATE TABLE Roles (
Role_Code CHAR(15),
Role_Name VARCHAR(255),
Role_Description VARCHAR(255)
)
CREATE TABLE Document_Locations (
Document_ID INTEGER,
Location_Code CHAR(15),
Date_in_Location_From DATETIME,
Date_in_Locaton_To DATETIME
)
CREATE TABLE Employees (
Employee_ID INTEGER,
... | Show the number of documents in different starting date and bin starting date by year interval with a line chart. | SELECT Date_in_Location_From, COUNT(Date_in_Location_From) FROM Document_Locations | nvbench |
CREATE TABLE table_62593 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Date" text
) | What is the Home team in the Game with a Score of 1 0? | SELECT "Home team" FROM table_62593 WHERE "Score" = '1–0' | wikisql |
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,
... | how many patients of asian ethnicity are administered additive drug types? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "ASIAN" AND prescriptions.drug_type = "ADDITIVE" | mimicsql_data |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime... | what is the minimum amylase value until 10 months ago for patient 005-86645? | SELECT MIN(lab.labresult) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '005-86645')) AND lab.labname = 'amylase' AND DATETIME(lab.labresulttime) <= DATETI... | eicu |
CREATE TABLE table_203_721 (
id number,
"school" text,
"location" text,
"control" text,
"type" text,
"enrollment" number,
"founded" number
) | what 's the number of schools represented in the table ? | SELECT COUNT("school") FROM table_203_721 | squall |
CREATE TABLE table_71937 (
"Rank" real,
"Lane" real,
"Name" text,
"Nationality" text,
"Time" real
) | What is the Name of the person from the Netherlands in a Lane lower than 5, with a Rank better than 5, and a time of less than 55.62? | SELECT "Name" FROM table_71937 WHERE "Rank" < '5' AND "Time" < '55.62' AND "Lane" < '5' AND "Nationality" = 'netherlands' | wikisql |
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... | 在01年9月15日到2009年7月27日期间,医生70900015的门诊量一共是多少人? | SELECT COUNT(*) FROM zzmzjzjlb WHERE zzmzjzjlb.ZZYSGH = '70900015' AND zzmzjzjlb.JZKSRQ BETWEEN '2001-09-15' AND '2009-07-27' UNION SELECT COUNT(*) FROM fzzmzjzjlb WHERE fzzmzjzjlb.ZZYSGH = '70900015' AND fzzmzjzjlb.JZKSRQ BETWEEN '2001-09-15' AND '2009-07-27' | css |
CREATE TABLE table_name_45 (
runner_s__up VARCHAR,
winning_score VARCHAR
) | Who is the runner-up where the winning score is 8 (71-69-67-73=280)? | SELECT runner_s__up FROM table_name_45 WHERE winning_score = –8(71 - 69 - 67 - 73 = 280) | sql_create_context |
CREATE TABLE status (
station_id INTEGER,
bikes_available INTEGER,
docks_available INTEGER,
time TEXT
)
CREATE TABLE station (
id INTEGER,
name TEXT,
lat NUMERIC,
long NUMERIC,
dock_count INTEGER,
city TEXT,
installation_date TEXT
)
CREATE TABLE trip (
id INTEGER,
d... | Please give me a pie chart to show the proportion of end stations for the trips with the three smallest ids? | SELECT end_station_name, COUNT(end_station_name) FROM trip GROUP BY end_station_name ORDER BY id LIMIT 3 | nvbench |
CREATE TABLE table_40547 (
"Round" text,
"Opposition" text,
"First leg" text,
"Second leg" text,
"Aggregate score" text
) | What round had the opponent Lyon? | SELECT "Round" FROM table_40547 WHERE "Opposition" = 'lyon' | wikisql |
CREATE TABLE table_name_81 (
name_designation VARCHAR,
payload VARCHAR
) | What is the name/designation for the 1200kg payload? | SELECT name_designation FROM table_name_81 WHERE payload = "1200kg" | sql_create_context |
CREATE TABLE stock (
shop_id number,
device_id number,
quantity number
)
CREATE TABLE shop (
shop_id number,
shop_name text,
location text,
open_date text,
open_year number
)
CREATE TABLE device (
device_id number,
device text,
carrier text,
package_version text,
ap... | Give the average quantity of stocks. | SELECT AVG(quantity) FROM stock | spider |
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
... | Answer score as a function of length. Plots average answer score, +/- 1 standard deviation, as a function of binned answer length. | SELECT Score, LENGTH(Body) FROM Posts WHERE PostTypeId = 2 AND LENGTH(Body) <= 20000 | sede |
CREATE TABLE Students_in_Detention (
student_id INTEGER,
detention_id INTEGER,
incident_id INTEGER
)
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 V... | Visualize a line chart about the change of the sum of monthly_rental over date_address_to , and group by attribute other_details. | SELECT date_address_to, SUM(monthly_rental) FROM Student_Addresses GROUP BY other_details, date_address_to ORDER BY monthly_rental DESC | nvbench |
CREATE TABLE table_24791 (
"Pilot" text,
"Organization" text,
"Total Flights" real,
"USAF space flights" real,
"FAI space flights" real,
"Max Mach" text,
"Max speed (mph)" real,
"Max altitude (miles)" text
) | Who was the pilot of max altitude of 55.9 miles? | SELECT "Pilot" FROM table_24791 WHERE "Max altitude (miles)" = '55.9' | wikisql |
CREATE TABLE Patient (
SSN INTEGER,
Name VARCHAR(30),
Address VARCHAR(30),
Phone VARCHAR(30),
InsuranceID INTEGER,
PCP INTEGER
)
CREATE TABLE Prescribes (
Physician INTEGER,
Patient INTEGER,
Medication INTEGER,
Date DATETIME,
Appointment INTEGER,
Dose VARCHAR(30)
)
CREA... | Find the number of the physicians who are trained in a procedure that costs more than 5000. | SELECT T1.Name, COUNT(T1.Name) FROM Physician AS T1 JOIN Trained_In AS T2 ON T1.EmployeeID = T2.Physician JOIN Procedures AS T3 ON T3.Code = T2.Treatment WHERE T3.Cost > 5000 GROUP BY T1.Name | nvbench |
CREATE TABLE table_7944 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text,
"Money ( $ )" text
) | What is Money ( $ ), when Score is '75-71-72-70=288'? | SELECT "Money ( $ )" FROM table_7944 WHERE "Score" = '75-71-72-70=288' | wikisql |
CREATE TABLE table_38343 (
"Round" real,
"Pick #" real,
"Overall" real,
"Name" text,
"Position" text,
"College" text
) | Which Round is the highest one that has an Overall of 32, and a Pick # smaller than 4? | SELECT MAX("Round") FROM table_38343 WHERE "Overall" = '32' AND "Pick #" < '4' | wikisql |
CREATE TABLE table_27537870_3 (
location_attendance VARCHAR,
record VARCHAR
) | What is the location and what was the attendance on those days when the score was 3-5-1? | SELECT location_attendance FROM table_27537870_3 WHERE record = "3-5-1" | sql_create_context |
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... | What is the relationship between Team_ID and ACC_Percent , and group by attribute All_Road? | SELECT Team_ID, ACC_Percent FROM basketball_match GROUP BY All_Road | nvbench |
CREATE TABLE table_58356 (
"Position" text,
"Game 1" text,
"Game 2" text,
"Game 3" text,
"Game 4" text
) | For which Game 4 did Michael O'Connor play during Game 1? | SELECT "Game 4" FROM table_58356 WHERE "Game 1" = 'michael o''connor' | 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 treatment (
treat... | how many hours have passed since first time that patient 027-32001 stayed in ward 962 during the current hospital encounter? | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', patient.unitadmittime)) FROM patient WHERE patient.uniquepid = '027-32001' AND patient.wardid = 962 AND patient.hospitaldischargetime IS NULL ORDER BY patient.unitadmittime LIMIT 1 | eicu |
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 demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob te... | how many patients whose procedure long title is colonoscopy? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE procedures.long_title = "Colonoscopy" | mimicsql_data |
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25),
COUNTRY_ID varchar(2)
)
CREATE TABLE departments (
DEPARTME... | For those employees who did not have any job in the past, give me the comparison about the average of salary over the hire_date bin hire_date by weekday by a bar chart, and show in desc by the Y. | SELECT HIRE_DATE, AVG(SALARY) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY AVG(SALARY) DESC | nvbench |
CREATE TABLE table_name_41 (
color_commentator_s_ VARCHAR,
channel VARCHAR,
year VARCHAR
) | Which Color commentator has a Channel of fsn new england, and a Year of 2004-05? | SELECT color_commentator_s_ FROM table_name_41 WHERE channel = "fsn new england" AND year = "2004-05" | sql_create_context |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
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,... | 检验报告单的编码为60691424102所对应的就诊流水号是多少? | SELECT zyjybgb.JZLSH FROM zyjybgb WHERE zyjybgb.BGDH = '60691424102' UNION SELECT mzjybgb.JZLSH FROM mzjybgb WHERE mzjybgb.BGDH = '60691424102' | css |
CREATE TABLE table_12592074_1 (
launched VARCHAR,
commissioned_or_completed_ VARCHAR,
_ VARCHAR
) | When was the ship launched when the commissioned or completed(*) is 6 june 1864? | SELECT launched FROM table_12592074_1 WHERE commissioned_or_completed_ * _ = "6 June 1864" | sql_create_context |
CREATE TABLE table_64128 (
"Rank" real,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | What is the silver when the Total is 1, and Gold is 1? | SELECT AVG("Silver") FROM table_64128 WHERE "Total" = '1' AND "Gold" = '1' | wikisql |
CREATE TABLE table_name_59 (
administrative_panel VARCHAR,
nominated_by_the_taoiseach VARCHAR,
labour_panel VARCHAR,
total VARCHAR
) | Tell me the total number of administrative panel with labour panel more than 2, nominated by taoiseach more than 6 and total of 28 | SELECT COUNT(administrative_panel) FROM table_name_59 WHERE labour_panel > 2 AND total = 28 AND nominated_by_the_taoiseach > 6 | sql_create_context |
CREATE TABLE table_47327 (
"Game" real,
"October" real,
"Opponent" text,
"Score" text,
"Record" text
) | Which opponent played in game 3 before October 18? | SELECT "Opponent" FROM table_47327 WHERE "October" < '18' AND "Game" = '3' | wikisql |
CREATE TABLE table_17862135_3 (
number_of_dances VARCHAR,
couple VARCHAR
) | How many dances did Warren & Kym have? | SELECT number_of_dances FROM table_17862135_3 WHERE couple = "Warren & Kym" | sql_create_context |
CREATE TABLE table_name_37 (
method VARCHAR,
record VARCHAR
) | How did the match end when his record was 15-11? | SELECT method FROM table_name_37 WHERE record = "15-11" | sql_create_context |
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
CreationDate time,
UserId number,
UserDisplayName text,
Comment text,
... | Last posts with negative score. | SELECT 'id' AS "post_link", 'score', 'creationdate', 'closeddate', 'body' FROM Posts WHERE Score < -10 ORDER BY CreationDate DESC LIMIT 50 | sede |
CREATE TABLE table_69299 (
"Name" text,
"Years" text,
"Gender" text,
"Area" text,
"Authority" text,
"Decile" real,
"Roll" real
) | What is the area of Mangamahu primary school? | SELECT "Area" FROM table_69299 WHERE "Name" = 'mangamahu primary school' | wikisql |
CREATE TABLE table_2891 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"U.S. viewers (million)" text,
"Original air date" text,
"Production code" real
) | What is the series number of the episode that aired March 25, 2010? | SELECT MIN("No. in series") FROM table_2891 WHERE "Original air date" = 'March 25, 2010' | wikisql |
CREATE TABLE table_27631756_2 (
chairman VARCHAR,
captain VARCHAR
) | Who is the chairman when teh captain is fawzi bashir? | SELECT chairman FROM table_27631756_2 WHERE captain = "Fawzi Bashir" | sql_create_context |
CREATE TABLE table_40855 (
"Season" text,
"Round" text,
"Country" text,
"Opponent" text,
"Result" text
) | What season had a game in the first round with a result of 4 1, 0 1? | SELECT "Season" FROM table_40855 WHERE "Round" = 'first round' AND "Result" = '4–1, 0–1' | wikisql |
CREATE TABLE table_42044 (
"Actual Title" text,
"Writer" text,
"Artist" text,
"Issue" real,
"Date" text
) | What writer has mort drucker as the artist, an issue greater than 470, and law & order: svu as an actual title? | SELECT "Writer" FROM table_42044 WHERE "Artist" = 'mort drucker' AND "Issue" > '470' AND "Actual Title" = 'law & order: svu' | wikisql |
CREATE TABLE table_name_29 (
to_par VARCHAR,
player VARCHAR
) | What is Charlie Wi's To par? | SELECT to_par FROM table_name_29 WHERE player = "charlie wi" | sql_create_context |
CREATE TABLE table_71103 (
"Date" text,
"Time" text,
"Score" text,
"Set 1" text,
"Set 2" text,
"Set 3" text,
"Total" text,
"Report" text
) | Which Set 3 has a Set 1 of 25 20? | SELECT "Set 3" FROM table_71103 WHERE "Set 1" = '25–20' | wikisql |
CREATE TABLE station_company (
Station_ID int,
Company_ID int,
Rank_of_the_Year int
)
CREATE TABLE gas_station (
Station_ID int,
Open_Year int,
Location text,
Manager_Name text,
Vice_Manager_Name text,
Representative_Name text
)
CREATE TABLE company (
Company_ID int,
Rank i... | Show all main industry and total market value in each industry by a bar chart, show in asc by the x-axis. | SELECT Main_Industry, SUM(Market_Value) FROM company GROUP BY Main_Industry ORDER BY Main_Industry | nvbench |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.