context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
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 ... | 号码是45430196189的检验报告单的报告时间是啥时候啊? | SELECT BGRQ FROM jybgb WHERE BGDH = '45430196189' | css |
CREATE TABLE orders (
order_id number,
customer_id number,
order_status text,
date_order_placed time,
order_details text
)
CREATE TABLE shipments (
shipment_id number,
order_id number,
invoice_number number,
shipment_tracking_number text,
shipment_date time,
other_shipment_d... | Find the name of the customers who have at most two orders. | SELECT T2.customer_name FROM orders AS T1 JOIN customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T2.customer_id HAVING COUNT(*) <= 2 | spider |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
... | until 2102 how many patients were prescribed cefazolin (ancef) in dextrose ivpb 2 g during the same month after being diagnosed with cholecystitis - acute? | SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'cholecystitis - acute' AND STRFTIME('%y', diagnosis.diagnosistime) <= '2102') AS t1 JOIN (SELECT patient.uni... | eicu |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures (
... | what is the number of patients whose admission type is urgent and with lab test item id 50980? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "URGENT" AND lab.itemid = "50980" | mimicsql_data |
CREATE TABLE table_name_21 (
site_stadium VARCHAR,
date VARCHAR
) | On March 23, what is the site/stadium? | SELECT site_stadium FROM table_name_21 WHERE date = "march 23" | sql_create_context |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
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,
... | tell me the number of medicaid insurance patients who had procedure icd9 code 4432. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Medicaid" AND procedures.icd9_code = "4432" | mimicsql_data |
CREATE TABLE table_64311 (
"Club" text,
"Wins" real,
"Losses" real,
"Draws" real,
"Against" real
) | When against is 797 and wins is more than 10, what is the sum of draws? | SELECT COUNT("Draws") FROM table_64311 WHERE "Against" = '797' AND "Wins" > '10' | wikisql |
CREATE TABLE table_name_21 (
no_result VARCHAR,
wins INTEGER
) | How many total No Results are recorded for less than 6 wins? | SELECT COUNT(no_result) FROM table_name_21 WHERE wins < 6 | sql_create_context |
CREATE TABLE documents_mailed (
document_id number,
mailed_to_address_id number,
mailing_date time
)
CREATE TABLE ref_document_types (
document_type_code text,
document_type_description text
)
CREATE TABLE ref_document_status (
document_status_code text,
document_status_description text
)
... | What is the description of document status code 'working'? | SELECT document_status_description FROM ref_document_status WHERE document_status_code = "working" | spider |
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
)
... | find the maximum age of patients whose admission location is emergency room and primary disease is copd exacerbation. | SELECT MAX(demographic.age) FROM demographic WHERE demographic.admission_location = "EMERGENCY ROOM ADMIT" AND demographic.diagnosis = "COPD EXACERBATION" | mimicsql_data |
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... | 在患者55890390的诊疗记录里,从18年5月1日到20年11月25日这期间,为其检测指标836276的医务人员有哪几位,报一下工号及姓名 | SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM hz_info JOIN wdmzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX AND wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGD... | css |
CREATE TABLE table_38834 (
"Distance" text,
"Time" text,
"Date" text,
"Location" text,
"Notes" text
) | What's the date when the location is Berlin? | SELECT "Date" FROM table_38834 WHERE "Location" = 'berlin' | wikisql |
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,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
... | Find the route of administration for medication with a GELCLAIR drug code. | SELECT prescriptions.route FROM prescriptions WHERE prescriptions.formulary_drug_cd = "GELCLAIR" | mimicsql_data |
CREATE TABLE table_7725 (
"Nat." text,
"Name" text,
"Moving from" text,
"Type" text,
"Transfer window" text,
"Ends" real,
"Transfer fee" text
) | What was the transfer fee for the player ending in 2011 and moving from Thrasyvoulos? | SELECT "Transfer fee" FROM table_7725 WHERE "Ends" = '2011' AND "Moving from" = 'thrasyvoulos' | wikisql |
CREATE TABLE table_66377 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" real
) | What is the attendance in a week earlier than 4, and result is w 31-20? | SELECT AVG("Attendance") FROM table_66377 WHERE "Week" < '4' AND "Result" = 'w 31-20' | wikisql |
CREATE TABLE table_name_49 (
genre VARCHAR,
developer VARCHAR
) | In what genre did Microvision develop a game? | SELECT genre FROM table_name_49 WHERE developer = "microvision" | sql_create_context |
CREATE TABLE table_50446 (
"Name" text,
"Country" text,
"Type" text,
"Moving from" text,
"Transfer window" text,
"Transfer fee" text
) | What is the name of the player with a transfer window in summer, an undisclosed transfer fee, and is moving from brussels? | SELECT "Name" FROM table_50446 WHERE "Transfer window" = 'summer' AND "Transfer fee" = 'undisclosed' AND "Moving from" = 'brussels' | wikisql |
CREATE TABLE table_31778 (
"Year" real,
"Date" text,
"Event" text,
"Days" text,
"Stages" text,
"Acts" text
) | I want to know the events for 106 bands | SELECT "Event" FROM table_31778 WHERE "Acts" = '106 bands' | wikisql |
CREATE TABLE table_name_97 (
name VARCHAR,
qual_2 VARCHAR
) | What name has a qual 2 of 1:43.374? | SELECT name FROM table_name_97 WHERE qual_2 = "1:43.374" | sql_create_context |
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
dual_airline varchar,
service_name text
)
CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
CREATE TABLE flight (
aircraft_code_sequence text,
airline_code varchar,
airline_fl... | i'd like the earliest flight from DALLAS to BOSTON | 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 = 'DALLAS' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BOSTON... | atis |
CREATE TABLE table_name_92 (
place INTEGER,
year VARCHAR,
clean_and_jerk VARCHAR
) | What was the highest place result in 2010 with a Clean and Jerk weight of 224kg? | SELECT MAX(place) FROM table_name_92 WHERE year = 2010 AND clean_and_jerk = "224kg" | sql_create_context |
CREATE TABLE table_28027307_1 (
us_viewers__millions_ VARCHAR,
production_code VARCHAR
) | How many millions of U.S. viewers watched the episode with the production code of 6AKY07? | SELECT us_viewers__millions_ FROM table_28027307_1 WHERE production_code = "6AKY07" | sql_create_context |
CREATE TABLE table_name_57 (
origin VARCHAR,
in_service VARCHAR
) | For the vessel with a listed In service of 1, what is the origin given? | SELECT origin FROM table_name_57 WHERE in_service = 1 | sql_create_context |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
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 t... | give the number of patients whose insurance is government and lab test name is hematocrit, other fluid. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.insurance = "Government" AND lab.label = "Hematocrit, Other Fluid" | mimicsql_data |
CREATE TABLE t_kc22 (
AMOUNT number,
CHA_ITEM_LEV number,
DATA_ID text,
DIRE_TYPE number,
DOSE_FORM text,
DOSE_UNIT text,
EACH_DOSAGE text,
EXP_OCC_DATE time,
FLX_MED_ORG_ID text,
FXBZ number,
HOSP_DOC_CD text,
HOSP_DOC_NM text,
MED_CLINIC_ID text,
MED_DIRE_CD tex... | 最常开的药品排序有那些是团伙成员奚心思的排序? | SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM qtb JOIN t_kc22 ON qtb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE qtb.PERSON_NM = '奚心思' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY COUNT(*) DESC UNION SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM gyb JOIN t_kc22 ON gyb.MED_CLINIC_ID = t_kc22.MED_CLI... | css |
CREATE TABLE table_16748 (
"Rnd" real,
"Race" text,
"Date" text,
"Location" text,
"Pole Position" text,
"Fastest Lap" text,
"Race Winner" text,
"Constructor" text,
"Report" text
) | what is the report where the location is kyalami? | SELECT "Report" FROM table_16748 WHERE "Location" = 'Kyalami' | wikisql |
CREATE TABLE table_15161 (
"Year" text,
"League" text,
"Position" text,
"Leading Scorer" text,
"Goals" real
) | Goals that has a Position of 14th of 24, and a League of football conference has what sum? | SELECT SUM("Goals") FROM table_15161 WHERE "Position" = '14th of 24' AND "League" = 'football conference' | wikisql |
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... | Visualize a scatter chart about the correlation between Team_ID and School_ID , and group by attribute Team_Name. | SELECT Team_ID, School_ID FROM basketball_match GROUP BY Team_Name | nvbench |
CREATE TABLE table_name_23 (
location VARCHAR,
name VARCHAR
) | What is the Location when the name is telmatosaurus? | SELECT location FROM table_name_23 WHERE name = "telmatosaurus" | sql_create_context |
CREATE TABLE table_25049 (
"Rank Subcontinent" real,
"Rank Asia" real,
"Rank World" real,
"Country" text,
"2011 GDP (PPP) billions of USD" text
) | Name the least rank subcontinent for bangladesh | SELECT MIN("Rank Subcontinent") FROM table_25049 WHERE "Country" = 'Bangladesh' | wikisql |
CREATE TABLE table_name_89 (
home_team VARCHAR,
away_team VARCHAR
) | Who is the home team when Preston North End is the away team? | SELECT home_team FROM table_name_89 WHERE away_team = "preston north end" | sql_create_context |
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
) | For those records from the products and each product's manufacturer, visualize a bar chart about the distribution of name and the amount of name , and group by attribute name, and rank from high to low by the bars please. | SELECT T2.Name, COUNT(T2.Name) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T2.Name DESC | nvbench |
CREATE TABLE table_65612 (
"Wimmera FL" text,
"Wins" real,
"Byes" real,
"Losses" real,
"Draws" real,
"Against" real
) | How many Byes have Wins smaller than 11, and a Wimmera FL of minyip murtoa, and Losses smaller than 6? | SELECT COUNT("Byes") FROM table_65612 WHERE "Wins" < '11' AND "Wimmera FL" = 'minyip murtoa' AND "Losses" < '6' | wikisql |
CREATE TABLE table_2518850_4 (
year_of_previous_participation VARCHAR,
prefecture VARCHAR
) | What was the year of previous participation for the school in the Kagoshima prefecture? | SELECT year_of_previous_participation FROM table_2518850_4 WHERE prefecture = "Kagoshima" | sql_create_context |
CREATE TABLE table_16617025_1 (
written_by VARCHAR,
season__number VARCHAR
) | Who wrote Season 8? | SELECT written_by FROM table_16617025_1 WHERE season__number = 8 | sql_create_context |
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
last_wardid number,
intime time,
outtime ti... | show me the patient ids who are diagnosed with b-complex defic nec in 2101. | SELECT admissions.subject_id FROM admissions WHERE admissions.hadm_id IN (SELECT diagnoses_icd.hadm_id FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'b-complex defic nec') AND STRFTIME('%y', diagnoses_icd.charttime) = '2101'... | mimic_iii |
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 jyjgzbb (
BGDH text,
BGRQ tim... | 从二0一六年十二月八日到二0二0年十二月二十九日,患者79918177的所有检验结果指标记录中的检测方法共有多少种,给全部列出来 | 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 t_kc24 (
MED_SAFE_PAY_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
REF_SLT_FLG number,
CLINIC_SLT_DATE time,
COMP_ID text,
PERSON_ID text,
FLX_MED_ORG_ID text,
INSU_TYPE text,
MED_AMOUT number,
PER_ACC_PAY number,
OVE_PAY numb... | 总价格高于1924.14元的医疗费在柏和玉的医疗记录有多少,可以列出其在入院诊断出来的疾病编码和名称吗? | SELECT IN_DIAG_DIS_CD, IN_DIAG_DIS_NM FROM t_kc21 WHERE PERSON_NM = '柏和玉' AND MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc24 WHERE MED_AMOUT > 1924.14) | css |
CREATE TABLE table_55148 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | Which team has an away score of 18.14 (122)? | SELECT "Home team" FROM table_55148 WHERE "Away team score" = '18.14 (122)' | wikisql |
CREATE TABLE table_204_188 (
id number,
"rank" number,
"player" text,
"points" number,
"points defending" number,
"points won" number,
"new points" number,
"withdrew due to" text
) | who was the highest ranking player to withdraw from the 2010 french open tournament ? | SELECT "player" FROM table_204_188 ORDER BY "rank" LIMIT 1 | squall |
CREATE TABLE table_27298240_26 (
aorist VARCHAR,
present VARCHAR
) | What aorist has bude in present tense? | SELECT aorist FROM table_27298240_26 WHERE present = "bude" | sql_create_context |
CREATE TABLE table_name_90 (
date_aired VARCHAR,
network VARCHAR
) | Which date was the show aired on the RTL Televizija network? | SELECT date_aired FROM table_name_90 WHERE network = "rtl televizija" | sql_create_context |
CREATE TABLE table_61581 (
"Player" text,
"Country" text,
"Year(s) won" text,
"Total" real,
"To par" text,
"Finish" text
) | Which country won in 1988? | SELECT "Country" FROM table_61581 WHERE "Year(s) won" = '1988' | wikisql |
CREATE TABLE table_27871460_2 (
network VARCHAR,
state_or_territory VARCHAR
) | Which network was located in Illinois? | SELECT network FROM table_27871460_2 WHERE state_or_territory = "Illinois" | sql_create_context |
CREATE TABLE medicine_enzyme_interaction (
medicine_id VARCHAR
)
CREATE TABLE medicine (
id VARCHAR,
Name VARCHAR,
FDA_approved VARCHAR
) | What are the ids, names and FDA approval status of medicines in descending order of the number of enzymes that it can interact with. | SELECT T1.id, T1.Name, T1.FDA_approved FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id = T1.id GROUP BY T1.id ORDER BY COUNT(*) DESC | sql_create_context |
CREATE TABLE table_18681 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
) | What is the last year that someone is first elected? | SELECT MAX("First elected") FROM table_18681 | wikisql |
CREATE TABLE table_24648 (
"Year" real,
"Starts" real,
"Wins" real,
"Top 5" real,
"Top 10" real,
"Poles" real,
"Avg. Start" text,
"Avg. Finish" text,
"Winnings" text,
"Position" text,
"Team(s)" text
) | How many wins when the average start is 29.0? | SELECT COUNT("Wins") FROM table_24648 WHERE "Avg. Start" = '29.0' | wikisql |
CREATE TABLE t_kc21 (
CLINIC_ID text,
CLINIC_TYPE text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
... | 总计患者年纪低于20岁的医疗记录的平均就医费总金额是多少? | SELECT AVG(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc21_t_kc24.MED_CLINIC_ID IN (SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_AGE < 20) | css |
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, visualize the relationship between code and code . | SELECT T1.Code, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code | nvbench |
CREATE TABLE table_23703 (
"Season" real,
"Series" text,
"Team" text,
"Races" real,
"Wins" real,
"Poles" real,
"F/Laps" real,
"Podiums" real,
"Points" text,
"Position" text
) | Name the least podiums for 0 wins and 2005 season for 321 points | SELECT MIN("Podiums") FROM table_23703 WHERE "Wins" = '0' AND "Season" = '2005' AND "Points" = '321' | wikisql |
CREATE TABLE table_31198 (
"Skip (Club)" text,
"W" real,
"L" real,
"PF" real,
"PA" real,
"Ends Won" real,
"Ends Lost" real,
"Blank Ends" real,
"Stolen Ends" real
) | What is the lowest overall amount of w's? | SELECT MIN("W") FROM table_31198 | wikisql |
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE Tags (
Id number,
TagName text,
Count num... | Questions which you answered, by title keyword. | SELECT a.Id AS "post_link", a.Body FROM Posts AS a INNER JOIN Posts AS b ON a.ParentId = b.Id WHERE a.OwnerUserId = '##UserId##' AND LOWER(b.Title) LIKE '%##Keyword##%' ORDER BY a.Id DESC | sede |
CREATE TABLE table_34231 (
"Player" text,
"Rec." real,
"Yards" real,
"Avg." real,
"Long" real
) | What is Darrius Heyward-Bey's average with more than 20 yards and less than 80 long? | SELECT COUNT("Avg.") FROM table_34231 WHERE "Yards" > '20' AND "Player" = 'darrius heyward-bey' AND "Long" < '80' | wikisql |
CREATE TABLE table_name_64 (
score VARCHAR,
to_par VARCHAR,
country VARCHAR
) | What was the score for the player from the United states that was +1 to par? | SELECT score FROM table_name_64 WHERE to_par = "+1" AND country = "united states" | sql_create_context |
CREATE TABLE table_204_200 (
id number,
"iso/iec standard" text,
"title" text,
"status" text,
"description" text,
"wg" number
) | what is the difference in the year published between iso/iec 15288 and iso/ice 20000-1 ? | SELECT ABS((SELECT "status" FROM table_204_200 WHERE "iso/iec standard" = 'iso/iec 15288') - (SELECT "status" FROM table_204_200 WHERE "iso/iec standard" = 'iso/iec 20000-1')) | squall |
CREATE TABLE table_name_96 (
winner VARCHAR,
general_classification VARCHAR,
stage VARCHAR
) | Name the winner for nick nuyens for general classification and stage of 2 | SELECT winner FROM table_name_96 WHERE general_classification = "nick nuyens" AND stage = "2" | sql_create_context |
CREATE TABLE table_name_69 (
bronze INTEGER,
gold VARCHAR,
total VARCHAR,
silver VARCHAR
) | Which Bronze has a Total smaller than 2, and a Silver larger than 0, and a Gold smaller than 0? | SELECT SUM(bronze) FROM table_name_69 WHERE total < 2 AND silver > 0 AND gold < 0 | sql_create_context |
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt int
)
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_code varchar
)
CREATE TABLE flight (
aircraft_code_sequence text,
airline_code v... | list airlines that fly from SEATTLE to SALT LAKE CITY | SELECT DISTINCT airline.airline_code FROM airline, 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 = 'SEATTLE' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_n... | atis |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | how many patients whose diagnoses short title is dmii oth uncntrld? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.short_title = "DMII oth uncntrld" | mimicsql_data |
CREATE TABLE table_60429 (
"Date" text,
"Venue" text,
"Score" text,
"Competition" text,
"Report" text
) | What is the Venue of the Friendly Competition with a Score of 1 4? | SELECT "Venue" FROM table_60429 WHERE "Competition" = 'friendly' AND "Score" = '1–4' | wikisql |
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... | Show me about the distribution of Team_Name and Team_ID in a bar chart, sort X-axis from low to high order. | SELECT Team_Name, Team_ID FROM basketball_match ORDER BY Team_Name | nvbench |
CREATE TABLE table_12199 (
"Preferences" text,
"1. vs 2." real,
"1. vs 3." real,
"2. vs 3." real,
"Total" real
) | What is 1 vs 2 when total is more than 28 and 2 vs 3 is 8? | SELECT "1. vs 2." FROM table_12199 WHERE "Total" > '28' AND "2. vs 3." = '8' | wikisql |
CREATE TABLE table_name_99 (
best VARCHAR,
name VARCHAR
) | Justin Wilson has what has his best time? | SELECT best FROM table_name_99 WHERE name = "justin wilson" | sql_create_context |
CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationDate time,
ApprovalDate time,
RejectionDate time,
OwnerUserId number,
Comment text,
Text text,
Title text,
Tags text,
RevisionGUID other
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnon... | Questions per month in specific tags. How many questions per month does each tag in group has | SELECT COUNT(Id) FROM Posts WHERE Tags LIKE '%<php>%' AND CreationDate > '2012-06-01' AND CreationDate < '2012-06-03' | sede |
CREATE TABLE table_name_40 (
total INTEGER,
gold VARCHAR,
silver VARCHAR
) | Who scored the lowest with 8 gold medals and less than 4 silver medals? | SELECT MIN(total) FROM table_name_40 WHERE gold = 8 AND silver < 4 | sql_create_context |
CREATE TABLE table_name_41 (
score VARCHAR,
visitor VARCHAR,
date VARCHAR
) | What's the score on December 1 when Philadelphia visited? | SELECT score FROM table_name_41 WHERE visitor = "philadelphia" AND date = "december 1" | sql_create_context |
CREATE TABLE table_name_14 (
attendance VARCHAR,
date VARCHAR
) | How many were in Attendance on December 11, 1954? | SELECT COUNT(attendance) FROM table_name_14 WHERE date = "december 11, 1954" | sql_create_context |
CREATE TABLE t_kc22 (
MED_EXP_DET_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
MED_EXP_BILL_ID text,
SOC_SRT_DIRE_CD text,
SOC_SRT_DIRE_NM text,
DIRE_TYPE number,
CHA_ITEM_LEV number,
MED_INV_ITEM_TYPE text,
MED_DIRE_CD text,
MED_DIRE_NM text,... | 潘天蓝患者在医院0395177做过的出院诊断结果中,把出院诊断医生姓柳的诊断记录列出来 | SELECT OUT_DIAG_DIS_CD, OUT_DIAG_DIS_NM FROM t_kc21 WHERE PERSON_NM = '潘天蓝' AND MED_SER_ORG_NO = '0395177' AND OUT_DIAG_DOC_NM LIKE '柳%' | css |
CREATE TABLE table_name_46 (
broadcast_date VARCHAR,
viewers__in_millions_ VARCHAR
) | What is the broadcast date with 7.0 million viewers? | SELECT broadcast_date FROM table_name_46 WHERE viewers__in_millions_ = "7.0" | sql_create_context |
CREATE TABLE table_18118221_1 (
annual_interchanges__millions__2011_12 VARCHAR,
annual_entry_exit__millions__2011_12 VARCHAR
) | How many annual interchanges in the millions occurred in 2011-12 when the number of annual entry/exits was 36.609 million? | SELECT annual_interchanges__millions__2011_12 FROM table_18118221_1 WHERE annual_entry_exit__millions__2011_12 = "36.609" | sql_create_context |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
... | has patient 004-7984 actually visited the hospital until 2102? | SELECT COUNT(*) > 0 FROM patient WHERE patient.uniquepid = '004-7984' AND STRFTIME('%y', patient.hospitaladmittime) <= '2102' | eicu |
CREATE TABLE table_204_445 (
id number,
"year" number,
"competition" text,
"venue" text,
"position" text,
"notes" text
) | at which world indoor championships did peter widen achieve a higher position : 1989 or 1991 ? | SELECT "year" FROM table_204_445 WHERE "year" IN (1989, 1991) ORDER BY "position" LIMIT 1 | squall |
CREATE TABLE staff (
staff_id number,
gender text,
first_name text,
last_name text,
email_address text,
phone_number text
)
CREATE TABLE products (
product_id number,
parent_product_id number,
product_category_code text,
date_product_first_available time,
date_product_discon... | What are the last names of staff with email addressed containing the substring 'wrau'? | SELECT last_name FROM staff WHERE email_address LIKE "%wrau%" | spider |
CREATE TABLE table_55950 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What was the away score when they played at Brunswick Street Oval? | SELECT "Away team score" FROM table_55950 WHERE "Venue" = 'brunswick street oval' | wikisql |
CREATE TABLE table_11545282_6 (
years_for_jazz VARCHAR,
player VARCHAR
) | During which years did Jim Farmer play for Jazz? | SELECT years_for_jazz FROM table_11545282_6 WHERE player = "Jim Farmer" | sql_create_context |
CREATE TABLE zyjzjlb_jybgb (
YLJGDM_ZYJZJLB text,
BGDH number,
YLJGDM number
)
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 n... | 入院登记日期时间在2012-01-28之后的数量是多少?在1211179这个医疗机构的住院就诊记录中查一下 | SELECT COUNT(*) FROM zyjzjlb WHERE zyjzjlb.YLJGDM = '1211179' AND zyjzjlb.RYDJSJ > '2012-01-28' | css |
CREATE TABLE storm (
storm_id number,
name text,
dates_active text,
max_speed number,
damage_millions_usd number,
number_deaths number
)
CREATE TABLE region (
region_id number,
region_code text,
region_name text
)
CREATE TABLE affected_region (
region_id number,
storm_id nu... | What is the average and maximum damage in millions for storms that had a max speed over 1000? | SELECT AVG(damage_millions_usd), MAX(damage_millions_usd) FROM storm WHERE max_speed > 1000 | spider |
CREATE TABLE table_39859 (
"Date" text,
"Tournament" text,
"Location" text,
"Purse( $ )" real,
"Winner" text,
"Score" text,
"1st Prize( $ )" text
) | What was the Purse ($) total for Iowa? | SELECT COUNT("Purse( $ )") FROM table_39859 WHERE "Location" = 'iowa' | wikisql |
CREATE TABLE table_name_38 (
date_of_appointment VARCHAR,
team VARCHAR,
replaced_by VARCHAR
) | What was the date of appointment for Christos Kassianos who belonged to AEK? | SELECT date_of_appointment FROM table_name_38 WHERE team = "aek" AND replaced_by = "christos kassianos" | sql_create_context |
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_code varchar
)
CREATE TABLE ground_service (
city_code text,
airport_code text,
transport_type text,
ground_fare int
)
CREATE TABLE dual_carrier (
main_airline varchar,... | show flights and fare information from PITTSBURGH connecting through DENVER to OAKLAND | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, fare, flight, flight_fare, flight_stop WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'OAK... | atis |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartr... | since 2104, has any urine, voided specimen microbiology test been carried out on patient 025-19271? | SELECT COUNT(*) FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '025-19271')) AND microlab.culturesite = 'urine, voided specimen' AND STRFTIME('%y'... | eicu |
CREATE TABLE perpetrator (
Perpetrator_ID int,
People_ID int,
Date text,
Year real,
Location text,
Country text,
Killed int,
Injured int
)
CREATE TABLE people (
People_ID int,
Name text,
Height real,
Weight real,
"Home Town" text
) | Return a bar chart on what are the countries of perpetrators? Show each country and the corresponding number of perpetrators there, and list in descending by the y axis please. | SELECT Country, COUNT(*) FROM perpetrator GROUP BY Country ORDER BY COUNT(*) DESC | nvbench |
CREATE TABLE table_name_24 (
home VARCHAR,
score VARCHAR
) | Who was the home team at the Nuggets game that had a score of 116 105? | SELECT home FROM table_name_24 WHERE score = "116–105" | sql_create_context |
CREATE TABLE table_12691 (
"Matches" real,
"Wins" real,
"Draw" real,
"Losses" real,
"Against" real
) | What is the highest Losses, when Wins is '1', and when Matches is less than 2? | SELECT MAX("Losses") FROM table_12691 WHERE "Wins" = '1' AND "Matches" < '2' | wikisql |
CREATE TABLE table_79049 (
"Team" text,
"1982" text,
"1983" text,
"1984" real,
"Total points" real,
"Seasons" real,
"Points average" real
) | What is the total for 1984 for the team with 100 points total and more than 3 seasons? | SELECT SUM("1984") FROM table_79049 WHERE "Total points" = '100' AND "Seasons" > '3' | wikisql |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemics... | since 10/2105, was there any microbiology test result for the other of patient 031-3355? | SELECT COUNT(*) 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 microlab.culturesite = 'other' AND STRFTIME('%y-%m', microlab.cult... | eicu |
CREATE TABLE table_11440 (
"NGC number" real,
"Object type" text,
"Constellation" text,
"Right ascension ( J2000 )" text,
"Declination ( J2000 )" text
) | What Constellation has a 20h56m40s Right Ascension (J2000)? | SELECT "Constellation" FROM table_11440 WHERE "Right ascension ( J2000 )" = '20h56m40s' | wikisql |
CREATE TABLE table_75246 (
"Game" real,
"March" real,
"Opponent" text,
"Score" text,
"Record" text,
"Points" real
) | Which Opponent has a Record of 38 20 12 2? | SELECT "Opponent" FROM table_75246 WHERE "Record" = '38–20–12–2' | wikisql |
CREATE TABLE table_name_10 (
english_translation VARCHAR,
artist VARCHAR
) | what is the english translation when the artist is ann christine? | SELECT english_translation FROM table_name_10 WHERE artist = "ann christine" | sql_create_context |
CREATE TABLE table_12715053_1 (
molecular_target VARCHAR,
compound_name VARCHAR
) | What is the molecular target listed under the compounded name of hemiasterlin (e7974) | SELECT molecular_target FROM table_12715053_1 WHERE compound_name = "Hemiasterlin (E7974)" | sql_create_context |
CREATE TABLE table_name_96 (
productions VARCHAR,
herbie VARCHAR
) | Which production had Rex Robbins as Herbie? | SELECT productions FROM table_name_96 WHERE herbie = "rex robbins" | sql_create_context |
CREATE TABLE table_17675 (
"Character" text,
"Portrayed by" text,
"Main cast seasons" text,
"Recurring cast seasons" text,
"# of episodes" real
) | Kevin lucas appears in which seasons? | SELECT "Recurring cast seasons" FROM table_17675 WHERE "Character" = 'Kevin Lucas' | wikisql |
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
v... | since 1 year ago, what was the minimum monthly number of patients diagnosed with pressure ulcer,stage nos? | SELECT MIN(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 = 'pressure ulcer,stage nos') AND DATETIME(diagnoses_icd.charttime) >= DATETIME(CURRENT_TIME(), '-1 year'... | mimic_iii |
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... | provide me the number of patients with a diagnoses icd9 code 2809 who are younger than 31 years of age. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.age < "31" AND diagnoses.icd9_code = "2809" | mimicsql_data |
CREATE TABLE table_name_99 (
total VARCHAR,
fa_trophy VARCHAR,
player VARCHAR
) | How many Total that has a FA Trophy of 0 and a Player of charlie butler? | SELECT COUNT(total) FROM table_name_99 WHERE fa_trophy = 0 AND player = "charlie butler" | sql_create_context |
CREATE TABLE table_48035 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Ground" text,
"Crowd" real,
"Date" text
) | How much is the crowd attending at colonial stadium where Hawthorn plays? | SELECT "Crowd" FROM table_48035 WHERE "Ground" = 'colonial stadium' AND "Home team" = 'hawthorn' | wikisql |
CREATE TABLE table_name_78 (
away_team VARCHAR,
venue VARCHAR
) | What was the away score at VFL Park? | SELECT away_team AS score FROM table_name_78 WHERE venue = "vfl park" | sql_create_context |
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 ... | when was last time patient 3273 was measured with a greater arterial bp mean than 76.0 on 10/11/last year? | SELECT chartevents.charttime FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 3273)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial ... | mimic_iii |
CREATE TABLE table_36235 (
"Frequency" real,
"Callsign" text,
"Brand" text,
"City of License" text,
"Website" text,
"Webcast" text
) | The KTRH.com website includes which type of webcast? | SELECT "Webcast" FROM table_36235 WHERE "Website" = 'ktrh.com' | wikisql |
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE course_offering (
offering_id int,
course_id int,
... | Is 662 offered in Spring 2019 in the afternoon ? | SELECT COUNT(*) > 0 FROM course, course_offering, semester WHERE course_offering.start_time >= '12:00:00' AND course.course_id = course_offering.course_id AND course.department = 'EECS' AND course.number = 662 AND semester.semester = 'Spring' AND semester.semester_id = course_offering.semester AND semester.year = 2019 | advising |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.