context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
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 text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZDZZMC ... | 在17年10月30日到18年12月8日期间,列出金宏茂患者所有检验结果指标记录中用的什么检测方法? | SELECT jyjgzbb.JCFF FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN jybgb_jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND... | css |
CREATE TABLE table_name_34 (
known_for VARCHAR,
entered VARCHAR,
celebrity VARCHAR
) | What was Freddie Starr, who entered on Day 1, known for? | SELECT known_for FROM table_name_34 WHERE entered = "day 1" AND celebrity = "freddie starr" | sql_create_context |
CREATE TABLE Movie (
mID int,
title text,
year int,
director text
)
CREATE TABLE Reviewer (
rID int,
name text
)
CREATE TABLE Rating (
rID int,
mID int,
stars int,
ratingDate date
) | For directors who had more than one movie, bin the year into Year interval and them compute the total number of movies in each year bucket, and group by title The result can be drawn as a trend line, show X-axis in descending order. | SELECT year, COUNT(year) FROM Movie AS T1 JOIN Movie AS T2 ON T1.director = T2.director WHERE T1.title <> T2.title GROUP BY title ORDER BY year DESC | nvbench |
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 food_service (
meal_code text,
meal_number int,
compartment text,
meal_description... | can i have a RENTAL CAR in HOUSTON | SELECT DISTINCT ground_service.transport_type FROM city, ground_service WHERE city.city_name = 'HOUSTON' AND ground_service.city_code = city.city_code AND ground_service.transport_type = 'RENTAL CAR' | atis |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid numb... | in 2105, how many patients underwent therapeutic antibacterials - penicillins during the same hospital encounter after the previous mri - spine? | SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, treatment.treatmenttime, patient.patienthealthsystemstayid FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'mri - spine' AND STRFTIME('%y', treatment.treatmenttime) = '2105') AS t1 ... | eicu |
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
... | count the number of patients that were prescribed cefazolin in the same hospital encounter after having received a stress ulcer prophylaxis - pantoprazole procedure. | SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, treatment.treatmenttime, patient.patienthealthsystemstayid FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'stress ulcer prophylaxis - pantoprazole') AS t1 JOIN (SELECT patient.uniq... | eicu |
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
... | how many hours have it been since patient 017-88691 was admitted into the hospital? | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', patient.hospitaladmittime)) FROM patient WHERE patient.uniquepid = '017-88691' AND patient.hospitaldischargetime IS NULL | eicu |
CREATE TABLE Transactions_Lots (
lot_id VARCHAR,
transaction_id VARCHAR
)
CREATE TABLE TRANSACTIONS (
transaction_id VARCHAR
) | Show the average amount of transactions for different lots. | SELECT T2.lot_id, AVG(amount_of_transaction) FROM TRANSACTIONS AS T1 JOIN Transactions_Lots AS T2 ON T1.transaction_id = T2.transaction_id GROUP BY T2.lot_id | sql_create_context |
CREATE TABLE table_22557 (
"Date" real,
"Single" text,
"Backed with" text,
"Record label" text,
"Format" text,
"Other details" text
) | What format for the release that had 2000 copies? | SELECT "Format" FROM table_22557 WHERE "Other details" = '2000 copies' | wikisql |
CREATE TABLE table_name_77 (
country VARCHAR,
player VARCHAR
) | What is Country, when Player is 'Billy Maxwell'? | SELECT country FROM table_name_77 WHERE player = "billy maxwell" | sql_create_context |
CREATE TABLE table_name_61 (
city_of_license VARCHAR,
frequency VARCHAR
) | What city is 103.3 FM licensed in? | SELECT city_of_license FROM table_name_61 WHERE frequency = "103.3 fm" | sql_create_context |
CREATE TABLE table_30911 (
"Round" real,
"Date" text,
"Opponent" text,
"Home/Away" text,
"Score (Collingwoods score is in bold)" text,
"Result (includes margin)" text,
"Venue" text,
"Position on Ladder" text
) | Which venue did collingsworth play essendon in when they had the 3rd position on the ladder? | SELECT "Venue" FROM table_30911 WHERE "Opponent" = 'Essendon' AND "Position on Ladder" = '3rd' | wikisql |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
CREATE TABLE jybgb_jyjgzbb (
JYZBLSH number,
YLJGDM text,
jyjgzbb_id number
)
CREATE TABLE jyjgzbb (
BGDH text,
BGRQ time,
CKZFWDX text,
CKZFWSX number,
CKZFWXX number,
JCFF text,
JCRGH text,
... | 自2017.9.16日起,至2018.5.10日止,把患者郑和璧这段时间被开出的所有检验报告单中的标本采集部位给一一列出来 | SELECT jybgb.BBCJBW FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE person_info.XM = '郑和璧' AND jy... | css |
CREATE TABLE table_7714 (
"Year" text,
"Regular Season" text,
"Playoffs" text,
"Canadian Championship" text,
"CONCACAF Champions League" text
) | Which regular season had the playoffs of 0 mls cups? | SELECT "Regular Season" FROM table_7714 WHERE "Playoffs" = '0 mls cups' | wikisql |
CREATE TABLE table_name_2 (
attendance VARCHAR,
week VARCHAR
) | What was the attendance during the week 1 match? | SELECT attendance FROM table_name_2 WHERE week = 1 | sql_create_context |
CREATE TABLE table_name_87 (
team VARCHAR,
best VARCHAR
) | Which team has a 1:10.998 best? | SELECT team FROM table_name_87 WHERE best = "1:10.998" | sql_create_context |
CREATE TABLE election (
Election_ID int,
Representative_ID int,
Date text,
Votes real,
Vote_Percent real,
Seats real,
Place real
)
CREATE TABLE representative (
Representative_ID int,
Name text,
State text,
Party text,
Lifespan text
) | Show vote_percent from each date, list by the Vote_Percent in asc please. | SELECT Date, Vote_Percent FROM election ORDER BY Vote_Percent | nvbench |
CREATE TABLE table_name_31 (
apparent_magnitude INTEGER,
constellation VARCHAR
) | What is the least apparent magnitude for all constellations from hydra? | SELECT MIN(apparent_magnitude) FROM table_name_31 WHERE constellation = "hydra" | sql_create_context |
CREATE TABLE flight (
flno number(4,0),
origin varchar2(20),
destination varchar2(20),
distance number(6,0),
departure_date date,
arrival_date date,
price number(7,2),
aid number(9,0)
)
CREATE TABLE certificate (
eid number(9,0),
aid number(9,0)
)
CREATE TABLE aircraft (
ai... | Show all origins and the number of flights from each origin by a bar chart, display by the y axis in descending. | SELECT origin, COUNT(*) FROM flight GROUP BY origin ORDER BY COUNT(*) DESC | nvbench |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | provide the number of patients whose diagnoses short title is seroma complicting proc and drug route is neb? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Seroma complicting proc" AND prescriptions.route = "NEB" | mimicsql_data |
CREATE TABLE table_9773 (
"Episode #" text,
"Original airdate (UK)" text,
"Episode title" text,
"Doctor Who episode" text,
"Webcast link" text
) | Which Episode title has a Episode # of s2? | SELECT "Episode title" FROM table_9773 WHERE "Episode #" = 's2' | wikisql |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
... | how many patients were admitted before the year 2165 with the diagnosis icd9 code v1083? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2165" AND diagnoses.icd9_code = "V1083" | mimicsql_data |
CREATE TABLE table_77789 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | In the match where north melbourne was the away team, how much did the home team score? | SELECT "Home team score" FROM table_77789 WHERE "Away team" = 'north melbourne' | wikisql |
CREATE TABLE table_5980 (
"Year" text,
"Total matches" real,
"Total W-L-H" text,
"Singles W-L-H" text,
"Points won" real,
"Points %" text
) | Which Total matches is the lowest one that has a Total W-L-H of 1-2-0? | SELECT MIN("Total matches") FROM table_5980 WHERE "Total W-L-H" = '1-2-0' | wikisql |
CREATE TABLE table_name_14 (
japan VARCHAR,
title VARCHAR
) | Tell me japan for jigsaw land: japan graffiti | SELECT japan FROM table_name_14 WHERE title = "jigsaw land: japan graffiti" | sql_create_context |
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, draw a bar chart about the distribution of name and the sum of code , and group by attribute name, could you list by the y axis in desc? | SELECT T2.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T1.Code DESC | nvbench |
CREATE TABLE table_56163 (
"Date" text,
"Competition" text,
"Venue" text,
"Result" text,
"Score" text,
"Goals" text
) | What are the goals for 8/4/04? | SELECT "Goals" FROM table_56163 WHERE "Date" = '8/4/04' | wikisql |
CREATE TABLE media_types (
id number,
name text
)
CREATE TABLE invoices (
id number,
customer_id number,
invoice_date time,
billing_address text,
billing_city text,
billing_state text,
billing_country text,
billing_postal_code text,
total number
)
CREATE TABLE invoice_lines... | What are the states with the most invoices? | SELECT billing_state, COUNT(*) FROM invoices WHERE billing_country = "USA" GROUP BY billing_state ORDER BY COUNT(*) DESC LIMIT 1 | spider |
CREATE TABLE table_2933761_1 (
gender VARCHAR,
name VARCHAR
) | What gender is Quentin? | SELECT gender FROM table_2933761_1 WHERE name = "Quentin" | sql_create_context |
CREATE TABLE table_62343 (
"Name" text,
"Pos." text,
"Height" text,
"Weight" text,
"Date of Birth" text,
"Club" text
) | What is Height, when Name is 'Manuela Zanchi'? | SELECT "Height" FROM table_62343 WHERE "Name" = 'manuela zanchi' | wikisql |
CREATE TABLE table_train_187 (
"id" int,
"pregnancy_or_lactation" bool,
"renal_disease" bool,
"diabetic" string,
"liver_disease" bool,
"NOUSE" float
) | pregnant or planning to become pregnant within 6 months | SELECT * FROM table_train_187 WHERE pregnancy_or_lactation = 1 | criteria2sql |
CREATE TABLE table_204_355 (
id number,
"#" text,
"player" text,
"country" text,
"score" text,
"to par" number,
"money ($)" number
) | which player is in the last position ? | SELECT "player" FROM table_204_355 ORDER BY id DESC LIMIT 1 | squall |
CREATE TABLE table_47000 (
"Club" text,
"Played" text,
"Drawn" text,
"Lost" text,
"Points for" text,
"Points against" text,
"Tries for" text,
"Tries against" text,
"Try bonus" text,
"Losing bonus" text,
"Points" text
) | What is Lost, when Losing Bonus is '3', and when Club is 'Bettws RFC'? | SELECT "Lost" FROM table_47000 WHERE "Losing bonus" = '3' AND "Club" = 'bettws rfc' | wikisql |
CREATE TABLE table_203_5 (
id number,
"season" text,
"competition" text,
"round" text,
"opponent" text,
"home" text,
"away" text,
"aggregate" text
) | what is the last competition listed on the table ? | SELECT "competition" FROM table_203_5 ORDER BY id DESC LIMIT 1 | squall |
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
item... | how many times does patient 20165 receive a nutren pulmonary intake until 1729 days ago? | SELECT COUNT(*) 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 = 20165)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'nutren pulmo... | mimic_iii |
CREATE TABLE table_204_121 (
id number,
"year" text,
"game" text,
"developer" text,
"setting" text,
"platform" text,
"notes" text
) | what was the name of the only business simulation video game developed by frog city ? | SELECT "game" FROM table_204_121 WHERE "developer" = 'frog city' | squall |
CREATE TABLE table_49405 (
"Nat." text,
"Name" text,
"Since" text,
"Goals" real,
"Ends" text,
"Transfer fee" text
) | What is the transfer fee for the MLI player with fewer than 63 goals in a year more recent than 2006? | SELECT "Transfer fee" FROM table_49405 WHERE "Since" = '2006' AND "Goals" < '63' AND "Nat." = 'mli' | wikisql |
CREATE TABLE equipment_sequence (
aircraft_code_sequence varchar,
aircraft_code varchar
)
CREATE TABLE fare (
fare_id int,
from_airport varchar,
to_airport varchar,
fare_basis_code text,
fare_airline text,
restriction_code text,
one_direction_cost int,
round_trip_cost int,
r... | what airlines fly from BOSTON to ATLANTA | 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 = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_na... | atis |
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... | 医生87598615一共诊治过多少门诊病人,在05-03-01到11-02-19期间 | SELECT COUNT(hz_info.RYBH) FROM hz_info JOIN txmzjzjlb ON hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX WHERE txmzjzjlb.ZZYSGH = '87598615' AND txmzjzjlb.JZKSRQ BETWEEN '2005-03-01' AND '2011-02-19' UNION SELECT COUNT(hz_info.RYBH) FROM hz_info JOIN ftxmzjzjlb ON hz_inf... | css |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom te... | during this year, how many patients were prescribed sodium citrate/citric acid? | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT prescriptions.hadm_id FROM prescriptions WHERE prescriptions.drug = 'sodium citrate/citric acid' AND DATETIME(prescriptions.startdate, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year')) | mimic_iii |
CREATE TABLE table_name_73 (
player VARCHAR,
team VARCHAR
) | What player plays for the Dakota Wizards? | SELECT player FROM table_name_73 WHERE team = "dakota wizards" | sql_create_context |
CREATE TABLE table_76876 (
"Date" text,
"Round" text,
"Opponents" text,
"H / A" text,
"Result F \u2013 A" text,
"Scorers" text,
"Attendance" real
) | What is the opponent name when the H/A is h with more than 28,411 in attendance and Sharpe 28' is the scorer? | SELECT "Opponents" FROM table_76876 WHERE "H / A" = 'h' AND "Attendance" > '28,411' AND "Scorers" = 'sharpe 28' | wikisql |
CREATE TABLE table_name_84 (
played VARCHAR,
points VARCHAR,
drawn VARCHAR
) | What is the total number of played values for teams with more than 14 points and more than 1 draw? | SELECT COUNT(played) FROM table_name_84 WHERE points > 14 AND drawn > 1 | sql_create_context |
CREATE TABLE table_name_76 (
region VARCHAR,
area__km_2__ VARCHAR
) | Tell me the number of regions with an area of 58.81 | SELECT COUNT(region) FROM table_name_76 WHERE area__km_2__ = 58.81 | sql_create_context |
CREATE TABLE faculty (
facid number,
lname text,
fname text,
rank text,
sex text,
phone number,
room text,
building text
)
CREATE TABLE gradeconversion (
lettergrade text,
gradepoint number
)
CREATE TABLE enrolled_in (
stuid number,
cid text,
grade text
)
CREATE TA... | What are the course names, ordered by credits? | SELECT cname FROM course ORDER BY credits | spider |
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 (
... | heartrate for patient 029-6419 measured at 2102-12-02 05:46:06 is less than the value measured at 2102-12-02 05:41:06? | 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 = '029-6419')) AND NOT vitalperiodic.heartrate IS NU... | eicu |
CREATE TABLE management (
department_ID int,
head_ID int,
temporary_acting text
)
CREATE TABLE head (
head_ID int,
name text,
born_state text,
age real
)
CREATE TABLE department (
Department_ID int,
Name text,
Creation text,
Ranking int,
Budget_in_Billions real,
Num... | Plot the average of budget in billions over creation in a line chart, and order by the x-axis from low to high. | SELECT Creation, AVG(Budget_in_Billions) FROM department GROUP BY Creation ORDER BY Creation | nvbench |
CREATE TABLE table_train_198 (
"id" int,
"hemoglobin_a1c_hba1c" float,
"fasting_plasma_glucose" int,
"diabetes" bool,
"body_mass_index_bmi" float,
"type_1_patients" bool,
"NOUSE" float
) | a random plasma glucose of 200 mg / dl or more with typical symptom of diabetes | SELECT * FROM table_train_198 WHERE fasting_plasma_glucose >= 200 OR diabetes = 1 | criteria2sql |
CREATE TABLE table_name_55 (
br_nos VARCHAR
) | Which 1947 Nos has a BR Nos of 48730-9? | SELECT 1947 AS _nos FROM table_name_55 WHERE br_nos = "48730-9" | sql_create_context |
CREATE TABLE table_name_70 (
rank VARCHAR,
time VARCHAR
) | What is the rank when the time is 6:50.48? | SELECT rank FROM table_name_70 WHERE time = "6:50.48" | sql_create_context |
CREATE TABLE table_name_69 (
attendance INTEGER,
opponent VARCHAR,
date VARCHAR
) | What attendance has astros as the opponent, and april 29 as the date? | SELECT SUM(attendance) FROM table_name_69 WHERE opponent = "astros" AND date = "april 29" | sql_create_context |
CREATE TABLE table_38429 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" real,
"Record" text
) | What date is associated with the Loss of Farrell (6-13)? | SELECT "Date" FROM table_38429 WHERE "Loss" = 'farrell (6-13)' | wikisql |
CREATE TABLE table_76654 (
"Rider" text,
"Manufacturer" text,
"Laps" text,
"Time/Retired" text,
"Grid" text
) | What was the amount of laps for the vehicle manufactured by honda with a grid of 9? | SELECT "Laps" FROM table_76654 WHERE "Manufacturer" = 'honda' AND "Grid" = '9' | wikisql |
CREATE TABLE table_name_62 (
tournaments_played INTEGER,
year VARCHAR
) | what is the least tournaments played when the year is 1998? | SELECT MIN(tournaments_played) FROM table_name_62 WHERE year = 1998 | sql_create_context |
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description varchar
)
CREATE TABLE fare (
fare_id int,
from_airport varchar,
to_airport varchar,
fare_basis_code text,
fare_airline text,
restriction_code text,
one_direction_cost int,
ro... | show me the cities served by CP | SELECT DISTINCT city.city_code FROM airport_service, city, flight WHERE city.city_code = airport_service.city_code AND flight.airline_code = 'CP' AND flight.from_airport = airport_service.airport_code | atis |
CREATE TABLE table_22860 (
"#" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" real,
"U.S. viewers (in millions)" text
) | Who directed 'Fever'? | SELECT "Directed by" FROM table_22860 WHERE "Title" = 'Fever' | wikisql |
CREATE TABLE location (
restaurant_id int,
house_number int,
street_name varchar,
city_name varchar
)
CREATE TABLE restaurant (
id int,
name varchar,
food_type varchar,
city_name varchar,
rating "decimal
)
CREATE TABLE geographic (
city_name varchar,
county varchar,
reg... | give me the best restaurant in bay area for american food ? | SELECT location.house_number, restaurant.name FROM geographic, location, restaurant WHERE geographic.region = 'bay area' AND restaurant.city_name = geographic.city_name AND restaurant.food_type = 'american' AND restaurant.id = location.restaurant_id AND restaurant.rating = (SELECT MAX(RESTAURANTalias1.rating) FROM geog... | restaurants |
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE p... | What number of upper level classes have labs ? | SELECT COUNT(DISTINCT course.course_id) FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE course.has_lab = 'Y' AND program_course.category LIKE '%ULCS%' | advising |
CREATE TABLE table_name_38 (
date_of_registration VARCHAR,
province VARCHAR,
party VARCHAR
) | When was the Partido radical party in Madrid registered? | SELECT date_of_registration FROM table_name_38 WHERE province = "madrid" AND party = "partido radical" | sql_create_context |
CREATE TABLE table_name_46 (
howard_baker VARCHAR,
ronald_reagan VARCHAR
) | Name the howard baker for ronald reagan of 72% | SELECT howard_baker FROM table_name_46 WHERE ronald_reagan = "72%" | sql_create_context |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE v... | how much is dextrose 50 % in water (d50w) injection 15 ml costing? | SELECT DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'medication' AND cost.eventid IN (SELECT medication.medicationid FROM medication WHERE medication.drugname = 'dextrose 50 % in water (d50w) injection 15 ml') | eicu |
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE cost (
row_id... | what was the drug that patient 5905 had been prescribed two times until 10/2101. | SELECT t1.drug FROM (SELECT prescriptions.drug, COUNT(prescriptions.startdate) AS c1 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 5905) AND STRFTIME('%y-%m', prescriptions.startdate) <= '2101-10' GROUP BY prescriptions.drug) AS t1 WHERE t1.c1... | mimic_iii |
CREATE TABLE table_33409 (
"Vessel Name" text,
"Type" text,
"Built" real,
"Class" text,
"Flag" text
) | What is the name of the Malta vessel built after 2010 that is a GL class Panamax vessel? | SELECT "Vessel Name" FROM table_33409 WHERE "Flag" = 'malta' AND "Type" = 'panamax' AND "Class" = 'gl' AND "Built" > '2010' | wikisql |
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE student (
student_id int,
lastname varchar,
firstname varchar,
program_id int,
declare_major varchar,
total_credit int,
total_gpa float,
entered_as varchar,
admit_term int,... | Next semester , is HHCR 700 available on days that are not Monday ? | SELECT DISTINCT course_offering.section_number FROM course, course_offering, semester WHERE course_offering.monday = 'N' AND course.course_id = course_offering.course_id AND course.department = 'HHCR' AND course.number = 700 AND semester.semester = 'FA' AND semester.semester_id = course_offering.semester AND semester.y... | advising |
CREATE TABLE table_11545282_5 (
position VARCHAR,
player VARCHAR
) | What is the position for player Blue Edwards? | SELECT position FROM table_11545282_5 WHERE player = "Blue Edwards" | sql_create_context |
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... | let me know the drug code and route of administration of metronidazole. | SELECT prescriptions.formulary_drug_cd, prescriptions.route FROM prescriptions WHERE prescriptions.drug = "Metronidazole" | mimicsql_data |
CREATE TABLE manufacturers (
name VARCHAR,
Headquarter VARCHAR,
revenue INTEGER
) | Find the name and revenue of the company that earns the highest revenue in each city. | SELECT name, MAX(revenue), Headquarter FROM manufacturers GROUP BY Headquarter | sql_create_context |
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 with item id 50862 were admitted before 2162? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2162" AND lab.itemid = "50862" | mimicsql_data |
CREATE TABLE table_50487 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Date" text
) | What team was the home team when Manchester City was the away team? | SELECT "Home team" FROM table_50487 WHERE "Away team" = 'manchester city' | wikisql |
CREATE TABLE table_36009 (
"Year" real,
"Competition" text,
"Venue" text,
"Position" text,
"Notes" text
) | After 1983, what was the Position in Seoul, South Korea? | SELECT "Position" FROM table_36009 WHERE "Year" > '1983' AND "Venue" = 'seoul, south korea' | wikisql |
CREATE TABLE table_37921 (
"Date" text,
"Score" text,
"Set 1" text,
"Set 2" text,
"Set 3" text,
"Total" text
) | Which Total has a Set 1 of 25 22? | SELECT "Total" FROM table_37921 WHERE "Set 1" = '25–22' | wikisql |
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 regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE job_history (
EMPLOYEE... | For those employees who did not have any job in the past, visualize a bar chart about the distribution of hire_date and the average of department_id bin hire_date by time, display by the Y from high to low. | SELECT HIRE_DATE, AVG(DEPARTMENT_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY AVG(DEPARTMENT_ID) DESC | nvbench |
CREATE TABLE publication (
abstract varchar,
cid int,
citation_num int,
jid int,
pid int,
reference_num int,
title varchar,
year int
)
CREATE TABLE domain_journal (
did int,
jid int
)
CREATE TABLE domain_publication (
did int,
pid int
)
CREATE TABLE domain (
did in... | return me the number of papers in ' University of Michigan ' in Databases area . | SELECT COUNT(DISTINCT (publication.title)) FROM author, domain, domain_author, domain_publication, organization, publication WHERE domain_author.aid = author.aid AND domain.did = domain_author.did AND domain.did = domain_publication.did AND domain.name = 'Databases' AND organization.name = 'University of Michigan' AND ... | academic |
CREATE TABLE table_48762 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Attendance" real,
"Record" text,
"Points" real
) | Can you tell me the Record that has the Points larger than 23, and the Attendance larger than 4,017, and the Date of january 18? | SELECT "Record" FROM table_48762 WHERE "Points" > '23' AND "Attendance" > '4,017' AND "Date" = 'january 18' | wikisql |
CREATE TABLE table_67459 (
"Rank" text,
"Building Name" text,
"Street address" text,
"Height feet (meters)" text,
"Floors" real,
"Completed" real
) | When did the rank 9 building got completed? | SELECT "Completed" FROM table_67459 WHERE "Rank" = '9' | wikisql |
CREATE TABLE table_261951_1 (
pop_density__per_km²_ VARCHAR,
municipality VARCHAR
) | What is the population density for the city of lubang? | SELECT COUNT(pop_density__per_km²_) FROM table_261951_1 WHERE municipality = "Lubang" | sql_create_context |
CREATE TABLE weather (
date VARCHAR,
zip_code VARCHAR,
max_temperature_f VARCHAR
) | When and in what zip code did max temperature reach 80? | SELECT date, zip_code FROM weather WHERE max_temperature_f >= 80 | sql_create_context |
CREATE TABLE table_80277 (
"Year" real,
"Competition" text,
"Wins" real,
"Draws" real,
"Loses" real
) | What highest Year has Wins 15 and Losses less than 5? | SELECT MAX("Year") FROM table_80277 WHERE "Wins" = '15' AND "Loses" < '5' | wikisql |
CREATE TABLE table_name_94 (
date VARCHAR,
opponent VARCHAR
) | WHEN has a Opponent of miami dolphins? | SELECT date FROM table_name_94 WHERE opponent = "miami dolphins" | sql_create_context |
CREATE TABLE table_44067 (
"Nat." text,
"Name" text,
"Since" real,
"Goals" real,
"Ends" text,
"Transfer fee" text
) | Which Goals have Ends of 30 june 2010, and Since larger than 2007? | SELECT "Goals" FROM table_44067 WHERE "Ends" = '30 june 2010' AND "Since" > '2007' | wikisql |
CREATE TABLE table_name_13 (
year VARCHAR,
original_title VARCHAR
) | Which Year has the Orginal title of La C r monie? | SELECT year FROM table_name_13 WHERE original_title = "la cérémonie" | sql_create_context |
CREATE TABLE circuits (
circuitid number,
circuitref text,
name text,
location text,
country text,
lat number,
lng number,
alt number,
url text
)
CREATE TABLE status (
statusid number,
status text
)
CREATE TABLE qualifying (
qualifyid number,
raceid number,
driv... | What are the names of all the Japanese constructors that have earned more than 5 points? | SELECT T1.name FROM constructors AS T1 JOIN constructorstandings AS T2 ON T1.constructorid = T2.constructorid WHERE T1.nationality = "Japanese" AND T2.points > 5 | spider |
CREATE TABLE table_48318 (
"Player" text,
"Nationality" text,
"Position" text,
"Years for Grizzlies" text,
"School/Club Team" text
) | What is the nationality of the Team Purdue? | SELECT "Nationality" FROM table_48318 WHERE "School/Club Team" = 'purdue' | wikisql |
CREATE TABLE table_76980 (
"Poll source" text,
"Dates administered" text,
"Jim DeMint (R)" text,
"Alvin Greene (D)" text,
"Tom Clements (G)" text,
"Other" text,
"Undecided" text
) | Which poll source determined undecided of 5% and Jim DeMint (R) of 58%? | SELECT "Poll source" FROM table_76980 WHERE "Undecided" = '5%' AND "Jim DeMint (R)" = '58%' | wikisql |
CREATE TABLE table_36073 (
"Date" text,
"Tournament" text,
"Location" text,
"Winner" text,
"Score" text,
"1st prize ( $ )" text
) | What date did Lanny Wadkins (6) win? | SELECT "Date" FROM table_36073 WHERE "Winner" = 'lanny wadkins (6)' | wikisql |
CREATE TABLE table_50387 (
"Tournament" text,
"2003" text,
"2004" text,
"2005" text,
"2006" text,
"2007" text,
"2008" text,
"2009" text,
"2010" text,
"2011" text,
"2012" text
) | With a 2008 result of 153 what is the result for 2007? | SELECT "2007" FROM table_50387 WHERE "2008" = '153' | wikisql |
CREATE TABLE table_name_67 (
frequency VARCHAR,
format VARCHAR
) | WHich Frequency has a Format of country / news / sports? | SELECT frequency FROM table_name_67 WHERE format = "country / news / sports" | sql_create_context |
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 (
... | count the number of patients whose marital status is married and procedure short title is inject ca chemother nec? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.marital_status = "MARRIED" AND procedures.short_title = "Inject ca chemother NEC" | mimicsql_data |
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
discharge_location text,
insurance text,
language text,
marital_status text,
ethnicity text,
age number
)
CREATE ... | what was patient 6170's insurance plan during this hospital visit. | SELECT admissions.insurance FROM admissions WHERE admissions.subject_id = 6170 AND admissions.dischtime IS NULL | mimic_iii |
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,
... | how many patients who have been prescribed base drug type had other cell lab test in the lab? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE prescriptions.drug_type = "BASE" AND lab.label = "Other Cell" | mimicsql_data |
CREATE TABLE table_203_484 (
id number,
"member" text,
"party" text,
"electorate" text,
"state" text,
"first elected" text
) | who was the only member of the country party to be elected in 1919 ? | SELECT "member" FROM table_203_484 WHERE "first elected" = 1919 AND "party" = 'country' | squall |
CREATE TABLE table_name_79 (
bronze INTEGER,
total INTEGER
) | How many bronze medals for the nation with less than 1 total? | SELECT MAX(bronze) FROM table_name_79 WHERE total < 1 | sql_create_context |
CREATE TABLE table_17716 (
"Name of System" text,
"Location" text,
"Traction Type" text,
"Date (From)" text,
"Date (To)" text,
"Notes" text
) | what is the location for the date (to) 8 october 1922? | SELECT "Location" FROM table_17716 WHERE "Date (To)" = '8 October 1922' | wikisql |
CREATE TABLE table_name_10 (
social_democratic_party INTEGER,
green INTEGER
) | Which Social Democratic Party has a Green smaller than 0? | SELECT AVG(social_democratic_party) FROM table_name_10 WHERE green < 0 | sql_create_context |
CREATE TABLE table_name_24 (
week_1 VARCHAR,
week_3 VARCHAR,
week_8 VARCHAR,
week_9 VARCHAR
) | What kind of Week 1 has a Week 8 of not eligible, and a Week 9 of no nominations, and a Week 3 of cyril? Question 3 | SELECT week_1 FROM table_name_24 WHERE week_8 = "not eligible" AND week_9 = "no nominations" AND week_3 = "cyril" | sql_create_context |
CREATE TABLE table_76175 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Date" text
) | What was the date when the away team was the leeds united? | SELECT "Date" FROM table_76175 WHERE "Away team" = 'leeds united' | wikisql |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
CREATE TABLE zzmzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH number,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
K... | 在11年3月24日到16年7月23日这段时间,患者陶展鹏一共有多少检验报告单,把这些检验报告单的审核日期列出来 | SELECT jybgb.SHSJ FROM person_info JOIN hz_info JOIN zzmzjzjlb JOIN jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX AND zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE person_info.XM = '陶... | css |
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... | 9683754医疗机构在2004年6月18到2005年4月20的这段时间共计多少医疗费 | SELECT SUM(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.t_kc21_MED_SER_ORG_NO = '9683754' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2004-06-18' AND '2005-04-20' | css |
CREATE TABLE table_name_5 (
frequency VARCHAR,
power__kw_ VARCHAR
) | Which frequency has 40kw power? | SELECT frequency FROM table_name_5 WHERE power__kw_ = "40kw" | sql_create_context |
CREATE TABLE table_name_61 (
losses INTEGER,
mlb_season VARCHAR
) | How many losses did the 1943 MLB have? | SELECT AVG(losses) FROM table_name_61 WHERE mlb_season = "1943" | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.