instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wa... | SELECT COUNT(*) > 0 FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-40255')) AND diagnosis.diagnosisname = 'hepatic dysfunction - moderate' ... | eicu |
CREATE TABLE table_63604 (
"Medal count" real,
"Date" text,
"Athlete" text,
"Nation" text,
"Sport" text,
"Record medal event" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What record medal event has athletics as the sport, with robert garrett ... | SELECT "Record medal event" FROM table_63604 WHERE "Sport" = 'athletics' AND "Athlete" = 'robert garrett' AND "Medal count" < '3' | wikisql |
CREATE TABLE table_name_43 (
player VARCHAR,
height VARCHAR,
current_club VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is 1.92 m tall and a current club member of Montepaschi Siena
| SELECT player FROM table_name_43 WHERE height = 1.92 AND current_club = "montepaschi siena" | sql_create_context |
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
)
... | SELECT MAX(demographic.age) FROM demographic WHERE demographic.gender = "F" AND demographic.discharge_location = "DISC-TRAN CANCER/CHLDRN H" | mimicsql_data |
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text varchar
)
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
... | SELECT DISTINCT name FROM course WHERE department = 'CJS' AND number = 592 | advising |
CREATE TABLE table_35444 (
"School" text,
"Mascot" text,
"Location" text,
"Enrollment" real,
"IHSAA Class" text,
"IHSAA Football Class" text,
"County" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the mascot for the school with a st... | SELECT "Mascot" FROM table_35444 WHERE "Enrollment" > '2,191' AND "School" = 'noblesville' | wikisql |
CREATE TABLE table_12095 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the place of the player with a 70-66-67=203 score?
| SELECT "Place" FROM table_12095 WHERE "Score" = '70-66-67=203' | wikisql |
CREATE TABLE table_39733 (
"Code" text,
"Years" text,
"Displacement (bore x stroke)/Type" text,
"Power@rpm" text,
"torque@rpm" text,
"Compression (:1)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- torque@rpm of n m (lb ft)@4050 has what code?
| SELECT "Code" FROM table_39733 WHERE "torque@rpm" = 'n·m (lb·ft)@4050' | wikisql |
CREATE TABLE table_name_18 (
home_team VARCHAR,
away_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the home team that played Derby County as the away team?
| SELECT home_team FROM table_name_18 WHERE away_team = "derby county" | sql_create_context |
CREATE TABLE table_77805 (
"Race Name" text,
"Circuit" text,
"Date" text,
"Winning driver" text,
"Constructor" text,
"Report" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What circuit did Innes Ireland win at for the I lombank trophy?
| SELECT "Circuit" FROM table_77805 WHERE "Winning driver" = 'innes ireland' AND "Race Name" = 'i lombank trophy' | wikisql |
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE instructor (
instructor_id int,
name varchar,
uniqname varchar
)
CREATE TABLE course_prerequisite (
pre_cour... | SELECT DISTINCT instructor.name FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN offering_instructor ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN instructor ON offering_instructor.instructor_id = instructor.instructor_id INNER JOIN semester... | advising |
CREATE TABLE table_56162 (
"Date" text,
"Competition" text,
"Venue" text,
"Result" text,
"Score" text,
"Goals" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which date has a Goal of deacon 4/4, withers 1 dg?
| SELECT "Date" FROM table_56162 WHERE "Goals" = 'deacon 4/4, withers 1 dg' | wikisql |
CREATE TABLE table_60121 (
"Player" text,
"Country" text,
"Year(s) won" text,
"Total" real,
"To par" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What year was the 146 total?
| SELECT "Year(s) won" FROM table_60121 WHERE "Total" = '146' | wikisql |
CREATE TABLE table_38142 (
"Rank" real,
"Player" text,
"Country" text,
"Earnings ( $ )" real,
"Events" real,
"Wins" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Events of 22, and a Rank smaller than 4 involved which of the lowest earnings ($)?... | SELECT MIN("Earnings ( $ )") FROM table_38142 WHERE "Events" = '22' AND "Rank" < '4' | wikisql |
CREATE TABLE table_42086 (
"Year" real,
"Men's singles" text,
"Women's singles" text,
"Men's doubles" text,
"Women's doubles" text,
"Mixed doubles" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who were the winners of the Women's Doubles in the... | SELECT "Women's doubles" FROM table_42086 WHERE "Year" > '2009' | wikisql |
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
)
-- Using valid SQLite, answer the following questions for the... | SELECT T2.Name, T2.Revenue 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_54319 (
"Name" text,
"Service" text,
"Rank" text,
"Place of action" text,
"Unit" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the place of action for the marine corps and corporal rank
| SELECT "Place of action" FROM table_54319 WHERE "Service" = 'marine corps' AND "Rank" = 'corporal' | wikisql |
CREATE TABLE table_name_21 (
result VARCHAR,
week VARCHAR,
opponent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the result in a week lower than 10 with an opponent of Chicago Bears?
| SELECT result FROM table_name_21 WHERE week < 10 AND opponent = "chicago bears" | sql_create_context |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugsto... | SELECT COUNT(*) FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-181433')) AND medication.drugname = 'dextrose 50% inj' AND DATETIME(medica... | eicu |
CREATE TABLE table_name_84 (
number_range VARCHAR,
builder VARCHAR,
introduced VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the number range for the Gloucester RCW builder introduced in 1937?
| SELECT number_range FROM table_name_84 WHERE builder = "gloucester rcw" AND introduced = "1937" | 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... | SELECT demographic.admittime FROM demographic WHERE demographic.name = "Dona Cole" | mimicsql_data |
CREATE TABLE table_28271 (
"No." real,
"#" real,
"Title" text,
"Director" text,
"Writer(s)" text,
"Original air date" text,
"Prod. code" real,
"U.S. viewers (million)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who wrote the movie po... | SELECT "Writer(s)" FROM table_28271 WHERE "#" = '8' | wikisql |
CREATE TABLE table_13570 (
"Model number" text,
"sSpec number" text,
"Cores" text,
"Frequency" text,
"Turbo" text,
"L2 cache" text,
"L3 cache" text,
"GPU model" text,
"GPU frequency" text,
"Socket" text,
"I/O bus" text,
"Release date" text,
"Part number(s)" text,
... | SELECT "GPU model" FROM table_13570 WHERE "sSpec number" = 'sr16z(c0)' | wikisql |
CREATE TABLE table_1772 (
"Parish (Prestegjeld)" text,
"Sub-Parish (Sogn)" text,
"Church Name" text,
"Year Built" real,
"Location of the Church" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total number of churches built in 1916?
| SELECT COUNT("Location of the Church") FROM table_1772 WHERE "Year Built" = '1916' | wikisql |
CREATE TABLE table_name_9 (
overall VARCHAR,
combined VARCHAR,
downhill VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many overalls has 1 combined and 24 downhills?
| SELECT overall FROM table_name_9 WHERE combined = "1" AND downhill = "24" | sql_create_context |
CREATE TABLE table_name_57 (
engine VARCHAR,
points VARCHAR,
year VARCHAR,
entrant VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the engine for the bmw motorsport entrant with 123 points before 2004?
| SELECT engine FROM table_name_57 WHERE year < 2004 AND entrant = "bmw motorsport" AND points = 123 | sql_create_context |
CREATE TABLE table_64386 (
"Rank" real,
"Heat" real,
"Athlete" text,
"Country" text,
"Time" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who is the athlete when the time is less than 11.13 and the country is belgium?
| SELECT "Athlete" FROM table_64386 WHERE "Time" < '11.13' AND "Country" = 'belgium' | wikisql |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
... | SELECT DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'medication' AND cost.eventid IN (SELECT medication.medicationid FROM medication WHERE medication.drugname = 'meropenem') | eicu |
CREATE TABLE table_21881 (
"Season" text,
"Date" text,
"Driver" text,
"Team" text,
"Chassis" text,
"Engine" text,
"Laps" text,
"Miles (km)" text,
"Race Time" text,
"Average Speed (mph)" text,
"Report" text
)
-- Using valid SQLite, answer the following questions for the tabl... | SELECT COUNT("Driver") FROM table_21881 WHERE "Season" = '2005' | wikisql |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Government" AND procedures.short_title = "Heart countershock NEC" | mimicsql_data |
CREATE TABLE table_30191 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What dat did episode 195 i... | SELECT "Original air date" FROM table_30191 WHERE "No. in series" = '195' | wikisql |
CREATE TABLE table_204_946 (
id number,
"pos" number,
"no" number,
"driver" text,
"team" text,
"laps" number,
"time/retired" text,
"grid" number,
"points" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many finished above frnch... | SELECT COUNT(*) FROM table_204_946 WHERE "pos" < (SELECT "pos" FROM table_204_946 WHERE "driver" = 'dario franchitti') | squall |
CREATE TABLE table_19255192_1 (
fiscal_year INTEGER,
total_vehicles VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest fiscal year if total vehicles is 490?
| SELECT MIN(fiscal_year) FROM table_19255192_1 WHERE total_vehicles = 490 | sql_create_context |
CREATE TABLE table_40609 (
"Name" text,
"Novelty" text,
"Status" text,
"Authors" text,
"Location" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Authors, when Novelty is Gen Nov, when Location is South Africa, and when Name is Criocephalosau... | SELECT "Authors" FROM table_40609 WHERE "Novelty" = 'gen nov' AND "Location" = 'south africa' AND "Name" = 'criocephalosaurus' | wikisql |
CREATE TABLE table_27704187_7 (
location_attendance VARCHAR,
team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Where was the game against Detroit played?
| SELECT location_attendance FROM table_27704187_7 WHERE team = "Detroit" | sql_create_context |
CREATE TABLE txmzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH number,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZDZ... | SELECT txmzjzjlb.JZKSRQ FROM txmzjzjlb WHERE txmzjzjlb.JZLSH = '45399366381' UNION SELECT ftxmzjzjlb.JZKSRQ FROM ftxmzjzjlb WHERE ftxmzjzjlb.JZLSH = '45399366381' | css |
CREATE TABLE table_204_353 (
id number,
"no." number,
"date/time" text,
"aircraft" text,
"foe" text,
"result" text,
"location" text,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the date after number 4 ?
| SELECT "date/time" FROM table_204_353 WHERE id > (SELECT id FROM table_204_353 WHERE "no." = 4) ORDER BY id LIMIT 1 | squall |
CREATE TABLE cite (
citingpaperid int,
citedpaperid int
)
CREATE TABLE venue (
venueid int,
venuename varchar
)
CREATE TABLE dataset (
datasetid int,
datasetname varchar
)
CREATE TABLE journal (
journalid int,
journalname varchar
)
CREATE TABLE paperfield (
fieldid int,
paper... | SELECT DISTINCT paper.year FROM keyphrase, paper, paperkeyphrase WHERE keyphrase.keyphrasename = 'LSTM' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid GROUP BY paper.year ORDER BY paper.year | scholar |
CREATE TABLE mzb (
CLINIC_ID text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
INSU_TYPE text,
IN... | SELECT qtb.IN_DIAG_DIS_CD, AVG(qtb.PERSON_AGE) FROM qtb WHERE qtb.MED_SER_ORG_NO = '3491233' GROUP BY qtb.IN_DIAG_DIS_CD UNION SELECT gyb.IN_DIAG_DIS_CD, AVG(gyb.PERSON_AGE) FROM gyb WHERE gyb.MED_SER_ORG_NO = '3491233' GROUP BY gyb.IN_DIAG_DIS_CD UNION SELECT zyb.IN_DIAG_DIS_CD, AVG(zyb.PERSON_AGE) FROM zyb WHERE zyb.... | css |
CREATE TABLE order_items (
order_item_id number,
product_id number,
order_id number,
order_item_status text,
order_item_details text
)
CREATE TABLE shipment_items (
shipment_id number,
order_item_id number
)
CREATE TABLE products (
product_id number,
product_name text,
product_... | SELECT order_item_id FROM order_items WHERE product_id = 11 | spider |
CREATE TABLE table_name_4 (
opponent VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the opponent on November 11, 2001?
| SELECT opponent FROM table_name_4 WHERE date = "november 11, 2001" | sql_create_context |
CREATE TABLE table_13998897_1 (
height_m___ft__ VARCHAR,
frequency_mhz VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many height m ( ft ) with frequency mhz being 100.1
| SELECT COUNT(height_m___ft__) FROM table_13998897_1 WHERE frequency_mhz = "100.1" | sql_create_context |
CREATE TABLE t_kc21 (
MED_CLINIC_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
COMP_ID text,
PERSON_ID text,
PERSON_NM text,
IDENTITY_CARD text,
SOC_SRT_CARD text,
PERSON_SEX number,
PERSON_AGE number,
IN_HOSP_DATE time,
OUT_HOSP_DATE time,
DIFF_PLACE_FLG numb... | SELECT OUT_DIAG_DIS_CD, OUT_DIAG_DIS_NM FROM t_kc21 WHERE PERSON_ID = '48858661' AND MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc24 WHERE MED_AMOUT > 759.51) | css |
CREATE TABLE table_2508633_8 (
position VARCHAR,
nfl_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- If the NFL team is the Minnesota Vikings, what is the position?
| SELECT position FROM table_2508633_8 WHERE nfl_team = "Minnesota Vikings" | sql_create_context |
CREATE TABLE table_20492 (
"Game" real,
"Date" text,
"Opponent" text,
"Result" text,
"Bills points" real,
"Opponents" real,
"Bills first downs" real,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When is the latest game the bil... | SELECT MIN("Game") FROM table_20492 WHERE "Bills first downs" = '21' | wikisql |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescription... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "54" AND prescriptions.drug = "Succinylcholine" | mimicsql_data |
CREATE TABLE table_53925 (
"Year" real,
"Network" text,
"Lap-by-lap" text,
"Pit reporters" text,
"Host" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What network has lap-by-laps by Bill Flemming, and Pit reporter Chris Economaki?
| SELECT "Network" FROM table_53925 WHERE "Lap-by-lap" = 'bill flemming' AND "Pit reporters" = 'chris economaki' | wikisql |
CREATE TABLE submission (
College VARCHAR,
Scores INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Show the colleges that have both authors with submission score larger than 90 and authors with submission score smaller than 80.
| SELECT College FROM submission WHERE Scores > 90 INTERSECT SELECT College FROM submission WHERE Scores < 80 | sql_create_context |
CREATE TABLE aircraft (
aid number,
name text,
distance number
)
CREATE TABLE employee (
eid number,
name text,
salary number
)
CREATE TABLE flight (
flno number,
origin text,
destination text,
distance number,
departure_date time,
arrival_date time,
price number,
... | SELECT T2.name FROM flight AS T1 JOIN aircraft AS T2 ON T1.aid = T2.aid GROUP BY T1.aid HAVING COUNT(*) >= 2 | spider |
CREATE TABLE table_61631 (
"Fin. Pos" real,
"Car No." real,
"Driver" text,
"Team" text,
"Laps" real,
"Time/Retired" text,
"Grid" real,
"Laps Led" real,
"Points" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest Laps ... | SELECT MAX("Laps Led") FROM table_61631 WHERE "Grid" < '4' AND "Fin. Pos" = '15' | wikisql |
CREATE TABLE table_name_8 (
japanese_name VARCHAR,
korean_name_² VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Japanese name has a Korean name of ( ) gyeongchip?
| SELECT japanese_name FROM table_name_8 WHERE korean_name_² = "경칩 (驚蟄) gyeongchip" | sql_create_context |
CREATE TABLE table_204_215 (
id number,
"airline" text,
"destination(s)" text,
"aircraft scheduled" text,
"service date(s)" text,
"comments" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- does allegiant air fly to dallas or las vegas ?
| SELECT "destination(s)" FROM table_204_215 WHERE "airline" = 'allegiant air' | squall |
CREATE TABLE table_40669 (
"Name" text,
"Location" text,
"Type" text,
"Completed" text,
"List entry number" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the completed date of the church with list entry number 1068071?
| SELECT "Completed" FROM table_40669 WHERE "Type" = 'church' AND "List entry number" = '1068071' | wikisql |
CREATE TABLE table_51034 (
"Date" text,
"Series" text,
"Circuit" text,
"City / State" text,
"Winner" text,
"Team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the circuit on 19 Apr with Craig Lowndes as the winner?
| SELECT "Circuit" FROM table_51034 WHERE "Winner" = 'craig lowndes' AND "Date" = '19 apr' | wikisql |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "EMERGENCY" AND demographic.admission_location = "EMERGENCY ROOM ADMIT" | mimicsql_data |
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 ... | SELECT mzjzjlb.JZLSH FROM person_info JOIN hz_info JOIN mzjzjlb 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 WHERE person_info.XM = '王向卉' AND NOT mzjzjlb.JZLSH IN (SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ <= '2021-05-03') | css |
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
war... | SELECT admissions.admittime FROM admissions WHERE admissions.subject_id = 15135 AND DATETIME(admissions.admittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') | mimic_iii |
CREATE TABLE table_204_774 (
id number,
"#" number,
"date" text,
"venue" text,
"opponent" text,
"score" text,
"result" text,
"competition" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who was his first opponent in the 2006 fifa world c... | SELECT "opponent" FROM table_204_774 WHERE "competition" = '2006 fifa world cup qualification' ORDER BY "date" LIMIT 1 | squall |
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... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.days_stay > "5" AND procedures.short_title = "Contr cerebr arteriogram" | mimicsql_data |
CREATE TABLE table_name_31 (
report VARCHAR,
home_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the report when the home team is new zealand breakers?
| SELECT report FROM table_name_31 WHERE home_team = "new zealand breakers" | sql_create_context |
CREATE TABLE aircraft (
aircraft_code varchar,
aircraft_description varchar,
manufacturer varchar,
basic_type varchar,
engines int,
propulsion varchar,
wide_body varchar,
wing_span int,
length int,
weight int,
capacity int,
pay_load int,
cruising_speed int,
range_... | SELECT DISTINCT aircraft.aircraft_code FROM aircraft, airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, equipment_sequence, flight WHERE aircraft.capacity = (SELECT MIN(AIRCRAFTalias1.capacity) FROM aircraft AS AIRCRAFTalias1, airport_service AS AIRPORT_SERVICEa... | atis |
CREATE TABLE table_name_55 (
club VARCHAR,
nationality VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What club did united states player ty harden play for?
| SELECT club FROM table_name_55 WHERE nationality = "united states" AND player = "ty harden" | sql_create_context |
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,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZDZ... | SELECT * FROM hz_info JOIN zzmzjzjlb JOIN jybgb JOIN jyjgzbb ON 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 AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE hz_i... | css |
CREATE TABLE table_204_607 (
id number,
"season" number,
"date" text,
"location" text,
"discipline" text,
"place" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what was the finishing place of the last race in december 2010 ?
| SELECT "place" FROM table_204_607 WHERE "date" = 12 AND "date" = 2010 | squall |
CREATE TABLE table_name_66 (
club_province VARCHAR,
caps VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What club/province has 41 caps?
| SELECT club_province FROM table_name_66 WHERE caps = 41 | sql_create_context |
CREATE TABLE table_41175 (
"Team" text,
"Match" real,
"Points" real,
"Draw" real,
"Lost" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which average lost that has a match less than 14?
| SELECT AVG("Lost") FROM table_41175 WHERE "Match" < '14' | wikisql |
CREATE TABLE table_56771 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which venue did the home team score 22.23 (155) ... | SELECT "Venue" FROM table_56771 WHERE "Home team score" = '22.23 (155)' | wikisql |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellv... | SELECT t3.treatmentname FROM (SELECT t2.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'bone fracture(s) - clavicle' AND STRFTIM... | eicu |
CREATE TABLE table_name_75 (
runners_up VARCHAR,
venue VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Runners-up have a Venue in Broadwood Stadium?
| SELECT runners_up FROM table_name_75 WHERE venue = "broadwood stadium" | sql_create_context |
CREATE TABLE table_23286223_8 (
high_points VARCHAR,
record VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many players did the most high points in the game with 39-22 record?
| SELECT COUNT(high_points) FROM table_23286223_8 WHERE record = "39-22" | 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
)
-- Using valid SQLite, answer the following questions for the... | SELECT T2.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name | nvbench |
CREATE TABLE table_3680 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"U.S. viewers (million)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the title of... | SELECT "Title" FROM table_3680 WHERE "Directed by" = 'Romeo Tirone' | 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... | SELECT All_Neutral, School_ID FROM basketball_match ORDER BY All_Neutral | nvbench |
CREATE TABLE table_41699 (
"Tournament" text,
"Wins" real,
"Top-5" real,
"Top-10" real,
"Top-25" real,
"Events" real,
"Cuts made" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Top-10 has a Cuts made of 10, and a Top-5 larger than 1?
| SELECT MIN("Top-10") FROM table_41699 WHERE "Cuts made" = '10' AND "Top-5" > '1' | wikisql |
CREATE TABLE transactions (
transaction_id number,
investor_id number,
transaction_type_code text,
date_of_transaction time,
amount_of_transaction number,
share_count text,
other_details text
)
CREATE TABLE sales (
sales_transaction_id number,
sales_details text
)
CREATE TABLE lots... | SELECT transaction_type_code FROM transactions GROUP BY transaction_type_code ORDER BY COUNT(*) LIMIT 1 | spider |
CREATE TABLE hz_info (
KH text,
KLX number,
YLJGDM text,
RYBH text
)
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,
... | (SELECT * FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGD... | css |
CREATE TABLE table_203_125 (
id number,
"club" text,
"winners" number,
"runner-ups" number,
"winning years" text,
"runner-up years" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many years was sk sturm graz winner ?
| SELECT "winners" FROM table_203_125 WHERE "club" = 'sk sturm graz' | squall |
CREATE TABLE table_38688 (
"Type" text,
"Actual Exponent" text,
"Exp (biased)" text,
"Exponent field" text,
"Significand (fraction field)" text,
"Value" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the Significant of a value 1.0?
| SELECT "Significand (fraction field)" FROM table_38688 WHERE "Value" = '1.0' | wikisql |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost numbe... | SELECT (SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'septic arthritis' AND STRFTIME('%y', diagnosis.diagnosistime) <= '2102') AS t1) - (SELECT COUNT(DIST... | eicu |
CREATE TABLE table_203_306 (
id number,
"no." number,
"title" text,
"directed by" text,
"written by" text,
"original air date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many other episodes were written by john zinman other than reunion ... | SELECT COUNT("title") FROM table_203_306 WHERE "written by" = 'john zinman' AND "title" <> '"reunion"' | squall |
CREATE TABLE table_59000 (
"Title" text,
"Developer" text,
"Genre" text,
"Release date" text,
"Version" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Version, when Genre is 'Action', and when Title is 'Hairball'?
| SELECT "Version" FROM table_59000 WHERE "Genre" = 'action' AND "Title" = 'hairball' | wikisql |
CREATE TABLE mzjzjlb (
YLJGDM text,
JZLSH text,
KH text,
KLX number,
MJZH text,
HZXM text,
NLS number,
NLY number,
ZSEBZ number,
JZZTDM number,
JZZTMC text,
JZJSSJ time,
TXBZ number,
ZZBZ number,
WDBZ number,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
... | SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW 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 = jy... | css |
CREATE TABLE Maintenance_Contracts (
maintenance_contract_id INTEGER,
maintenance_contract_company_id INTEGER,
contract_start_date DATETIME,
contract_end_date DATETIME,
other_contract_details VARCHAR(255)
)
CREATE TABLE Assets (
asset_id INTEGER,
maintenance_contract_id INTEGER,
supplie... | SELECT fault_short_name, COUNT(fault_short_name) FROM Part_Faults AS T1 JOIN Skills_Required_To_Fix AS T2 ON T1.part_fault_id = T2.part_fault_id JOIN Skills AS T3 ON T2.skill_id = T3.skill_id GROUP BY skill_description, fault_short_name | nvbench |
CREATE TABLE people (
people_id number,
name text,
age number,
height number,
hometown text
)
CREATE TABLE gymnast (
gymnast_id number,
floor_exercise_points number,
pommel_horse_points number,
rings_points number,
vault_points number,
parallel_bars_points number,
horizo... | SELECT COUNT(DISTINCT hometown) FROM people | spider |
CREATE TABLE table_23918 (
"Year" text,
"Head Coach" text,
"Regular Season Record (W-L)" text,
"NEC Record" text,
"Standing" text,
"NEC Tournament Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the year for t-10th
| SELECT "Year" FROM table_23918 WHERE "Standing" = 'T-10th' | wikisql |
CREATE TABLE captain (
Captain_ID int,
Name text,
Ship_ID int,
age text,
Class text,
Rank text
)
CREATE TABLE Ship (
Ship_ID int,
Name text,
Type text,
Built_Year real,
Class text,
Flag text
)
-- Using valid SQLite, answer the following questions for the tables provide... | SELECT Flag, COUNT(*) FROM Ship GROUP BY Flag ORDER BY Flag | nvbench |
CREATE TABLE table_name_17 (
date VARCHAR,
opponent VARCHAR,
result VARCHAR,
attendance VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- On what date was the opponent Ayr United, the result 1 0, and the attendance more than 668?
| SELECT date FROM table_name_17 WHERE result = "1–0" AND attendance > 668 AND opponent = "ayr united" | sql_create_context |
CREATE TABLE table_name_1 (
draws INTEGER,
al_ahly_wins INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average number of draws for Al Ahly wins over 59?
| SELECT AVG(draws) FROM table_name_1 WHERE al_ahly_wins > 59 | sql_create_context |
CREATE TABLE table_60256 (
"Opposing Teams" text,
"Against" real,
"Date" text,
"Venue" text,
"Status" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the venue of the match with more than 8 against and ireland as the opposing team?
| SELECT "Venue" FROM table_60256 WHERE "Against" > '8' AND "Opposing Teams" = 'ireland' | wikisql |
CREATE TABLE table_27003186_3 (
no_party_preference VARCHAR,
city VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the no party preference when the city is murrieta?
| SELECT no_party_preference FROM table_27003186_3 WHERE city = "Murrieta" | sql_create_context |
CREATE TABLE table_72989 (
"Year" real,
"Date (Opening)" text,
"Date (Closing)" text,
"Opening Film" text,
"Number of Screening" text,
"Award-Winning Film" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which award-winning film has a screening n... | SELECT "Award-Winning Film" FROM table_72989 WHERE "Number of Screening" = '50 films 50 televised' | wikisql |
CREATE TABLE assignedto (
scientist number,
project text
)
CREATE TABLE projects (
code text,
name text,
hours number
)
CREATE TABLE scientists (
ssn number,
name text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- List all the scientists' name... | SELECT T1.name, T3.name, T3.hours FROM scientists AS T1 JOIN assignedto AS T2 ON T1.ssn = T2.scientist JOIN projects AS T3 ON T2.project = T3.code ORDER BY T3.name, T1.name | spider |
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,
... | SELECT zzmzjzjlb.KH, zzmzjzjlb.KLX FROM zzmzjzjlb WHERE zzmzjzjlb.JZLSH = '00282220286' UNION SELECT fzzmzjzjlb.KH, fzzmzjzjlb.KLX FROM fzzmzjzjlb WHERE fzzmzjzjlb.JZLSH = '00282220286' | css |
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description varchar
)
CREATE TABLE restriction (
restriction_c... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE (((flight.arrival_time <= 1930 AND flight.arrival_time >= 1830) AND date_day.day_number = 23 AND date_day.month_number = 4 AND date_day.year = 19... | atis |
CREATE TABLE table_37069 (
"Season" real,
"Team" text,
"Games" real,
"Wins" real,
"Losses" real,
"Ties" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Season has Ties smaller than 1, and a Team of vancouver grizzlies, and Wins smaller than... | SELECT SUM("Season") FROM table_37069 WHERE "Ties" < '1' AND "Team" = 'vancouver grizzlies' AND "Wins" < '1' | wikisql |
CREATE TABLE table_61604 (
"Location" text,
"Partner" text,
"Construction Start" text,
"Inauguration Date" text,
"Population Served" real,
"Design flow (LPM)" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Partner has a Construction Start o... | SELECT "Partner" FROM table_61604 WHERE "Construction Start" = '2008 january' | wikisql |
CREATE TABLE table_name_5 (
race VARCHAR,
margin VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which race has a Margin of 8?
| SELECT race FROM table_name_5 WHERE margin = "8" | sql_create_context |
CREATE TABLE wine (
No INTEGER,
Grape TEXT,
Winery TEXT,
Appelation TEXT,
State TEXT,
Name TEXT,
Year INTEGER,
Price INTEGER,
Score INTEGER,
Cases INTEGER,
Drink TEXT
)
CREATE TABLE appellations (
No INTEGER,
Appelation TEXT,
County TEXT,
State TEXT,
Area... | SELECT Year, MAX(Score) FROM wine GROUP BY Year | nvbench |
CREATE TABLE table_41593 (
"Animal" text,
"Cell type" text,
"Resting potential (mV)" text,
"AP increase (mV)" text,
"AP duration (ms)" text,
"Conduction speed (m/s)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What AP increase has an AP durat... | SELECT "AP increase (mV)" FROM table_41593 WHERE "AP duration (ms)" = '0.75' | wikisql |
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescription text,
CreationDate time,
CreationModeratorId number,
ApprovalDa... | SELECT Users.DisplayName, COUNT(Posts.Id) AS number_of_posts, SUM(CommentCount) * 1.0 / COUNT(Posts.Id) AS number_of_comments_per_post FROM Users INNER JOIN Posts ON Posts.OwnerUserId = Users.Id GROUP BY DisplayName ORDER BY 2 DESC | sede |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.