context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_57645 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | In the match where Melbourne was the away team, how much did they score? | SELECT "Away team score" FROM table_57645 WHERE "Away team" = 'melbourne' | wikisql |
CREATE TABLE table_name_42 (
building VARCHAR,
storeys VARCHAR
) | Which building has 26 storeys? | SELECT building FROM table_name_42 WHERE storeys = 26 | sql_create_context |
CREATE TABLE table_61895 (
"Week 1" text,
"Week 2" text,
"Week 3" text,
"Week 4" text,
"Week 5" text
) | Who is the cyber girl in week 3 when Ashley Lowe was the cyber girl in week 2? | SELECT "Week 3" FROM table_61895 WHERE "Week 2" = 'ashley lowe' | wikisql |
CREATE TABLE table_26745820_1 (
no VARCHAR,
distance VARCHAR
) | what is the no when the distance is 4168km? | SELECT no FROM table_26745820_1 WHERE distance = "4168km" | sql_create_context |
CREATE TABLE table_63869 (
"Date" text,
"Venue" text,
"Score" text,
"Comp" text,
"Report" text
) | What's the comp in Olympic Stadium Tokyo, Japan? | SELECT "Comp" FROM table_63869 WHERE "Venue" = 'olympic stadium tokyo, japan' | wikisql |
CREATE TABLE table_34258 (
"Abbr." text,
"Name" text,
"Picture Coding Types" text,
"Chroma Format" text,
"Aspect Ratios" text,
"Scalable modes" text,
"Intra DC Precision" text
) | What Chroma Format that has both Picture Coding Types of i, p, b, and the Name of main profile? | SELECT "Chroma Format" FROM table_34258 WHERE "Picture Coding Types" = 'i, p, b' AND "Name" = 'main profile' | wikisql |
CREATE TABLE table_name_96 (
capacity INTEGER,
city VARCHAR,
rank VARCHAR
) | Which Capacity is the lowest one that has a City of brisbane, and a Rank smaller than 1? | SELECT MIN(capacity) FROM table_name_96 WHERE city = "brisbane" AND rank < 1 | sql_create_context |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE vitalperiodic (
vitalperio... | what would be patient 003-54468's daily maximum weight since 2102? | SELECT MAX(patient.admissionweight) FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '003-54468') AND NOT patient.admissionweight IS NULL AND STRFTIME('%y', patient.unitadmittime) >= '2102' GROUP BY STRFTIME('%y-%m-%d', patient.unit... | eicu |
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,
... | KINESLGY 600 has been offer for how long ? | SELECT DISTINCT semester.year FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'KINESLGY' AND course.number = 600 AND semester.semester_id = course_offering.semester ORDER BY semester.year LIMIT 1 | advising |
CREATE TABLE table_35998 (
"Code" text,
"Vehicle" text,
"Year" text,
"Displacement" text,
"Bore" text,
"Stroke" text,
"C.R." text,
"Max. Power" text
) | What code has a C.R of 16.7:1? | SELECT "Code" FROM table_35998 WHERE "C.R." = '16.7:1' | wikisql |
CREATE TABLE table_1342370_41 (
candidates VARCHAR,
district VARCHAR
) | Who were the candidates in the election in the Tennessee 9 district? | SELECT candidates FROM table_1342370_41 WHERE district = "Tennessee 9" | sql_create_context |
CREATE TABLE table_20403 (
"Country" text,
"Total Freshwater Withdrawal (km 3 /yr)" text,
"Per Capita Withdrawal (m 3 /p/yr)" real,
"Domestic Use (m 3 /p/yr)(in %)" text,
"Industrial Use (m 3 /p/yr)(in %)" text,
"Agricultural Use (m 3 /p/yr)(in %)" text
) | What are the countries in which the agricultural use (m 3 /p/yr)(in %) is 2040(93%)? | SELECT "Country" FROM table_20403 WHERE "Agricultural Use (m 3 /p/yr)(in %)" = '2040(93%)' | wikisql |
CREATE TABLE table_26368 (
"Week #" text,
"Theme" text,
"Song Choice" text,
"Original Artist" text,
"Order #" real,
"Result" text
) | In what week was the original singer Whitney Houston. | SELECT "Week #" FROM table_26368 WHERE "Original Artist" = 'Whitney Houston' | wikisql |
CREATE TABLE table_65519 (
"Shirt No" real,
"Nationality" text,
"Player" text,
"Birth Date" text,
"Height" real,
"Position" text
) | What player that has a Nationality of Turkey, a Height smaller than 183, a shirt no smaller than 19, and a birth date of June 27, 1993 (age20)? | SELECT "Player" FROM table_65519 WHERE "Nationality" = 'turkey' AND "Height" < '183' AND "Shirt No" < '19' AND "Birth Date" = 'june 27, 1993 (age20)' | wikisql |
CREATE TABLE table_269920_16 (
l3_cache__mb_ VARCHAR,
speed__ghz_ VARCHAR
) | What is the L3 cache for the processor having a speed of 2.93 GHz? | SELECT l3_cache__mb_ FROM table_269920_16 WHERE speed__ghz_ = "2.93" | sql_create_context |
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationD... | Find Best Developers in location with Specific Badge. | SELECT DISTINCT u.Id AS "user_link", u.Reputation FROM Users AS u INNER JOIN Badges AS b ON b.UserId = u.Id WHERE LOWER(Location) LIKE LOWER('%##CityName##%') AND LOWER(b.Name) LIKE LOWER('%##BadgeName##%') ORDER BY Reputation DESC | sede |
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,
... | count the number of patients whose item id is 51256? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.itemid = "51256" | mimicsql_data |
CREATE TABLE table_76353 (
"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 the points against is 231? | SELECT "Lost" FROM table_76353 WHERE "Points against" = '231' | wikisql |
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_... | tell me the number of patients who had been prescribed 0.9% sodium chloride until 4 years ago. | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT prescriptions.hadm_id FROM prescriptions WHERE prescriptions.drug = '0.9% sodium chloride' AND DATETIME(prescriptions.startdate) <= DATETIME(CURRENT_TIME(), '-4 year')) | mimic_iii |
CREATE TABLE table_29120 (
"Country" text,
"Skip" text,
"W" real,
"L" real,
"PF" real,
"PA" real,
"Ends Won" real,
"Ends Lost" real,
"Blank Ends" real,
"Stolen Ends" real,
"Shot Pct." real
) | When chen lu'an is the skip what is the lowest amount l's? | SELECT MIN("L") FROM table_29120 WHERE "Skip" = 'Chen Lu''an' | wikisql |
CREATE TABLE table_51327 (
"CERCLIS ID" text,
"Name" text,
"Municipality" text,
"Proposed" text,
"Listed" text,
"Construction completed" text,
"Partially deleted" text,
"Deleted" text
) | What is the site for Florida? | SELECT "Listed" FROM table_51327 WHERE "Municipality" = 'florida' | wikisql |
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
) | For those records from the products and each product's manufacturer, show me about the distribution of name and the amount of name , and group by attribute name in a bar chart, 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_23670057_5 (
player VARCHAR,
height__m_ VARCHAR
) | which players have a height of 2.07m? | SELECT player FROM table_23670057_5 WHERE height__m_ = "2.07" | sql_create_context |
CREATE TABLE table_1246208_5 (
overall_record VARCHAR,
club VARCHAR
) | what is the overall record when the club is dallas burn? | SELECT overall_record FROM table_1246208_5 WHERE club = "Dallas Burn" | sql_create_context |
CREATE TABLE table_30394 (
"Institution" text,
"Location" text,
"Founded" real,
"Affiliation" text,
"Enrollment" real,
"Team Nickname" text,
"Primary conference" text
) | When indianapolis, indiana is the location what is the institution? | SELECT "Institution" FROM table_30394 WHERE "Location" = 'Indianapolis, Indiana' | wikisql |
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
... | so, what was the first temperature c (calc) of patient 4085 on 09/18/this year? | SELECT chartevents.valuenum 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 = 4085)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'temperatur... | mimic_iii |
CREATE TABLE table_32343 (
"Round" real,
"Overall" real,
"Player" text,
"Position" text,
"College" text
) | Which position did David Nugent play with an overall small than 187? | SELECT "Position" FROM table_32343 WHERE "Overall" > '187' AND "Player" = 'david nugent' | wikisql |
CREATE TABLE table_1342331_5 (
incumbent VARCHAR,
candidates VARCHAR
) | who is the the incumbent with candidates being ben cravens (d) unopposed | SELECT incumbent FROM table_1342331_5 WHERE candidates = "Ben Cravens (D) Unopposed" | sql_create_context |
CREATE TABLE table_name_21 (
team VARCHAR,
draws VARCHAR
) | Which team had 15 draws? | SELECT team FROM table_name_21 WHERE draws = "15" | sql_create_context |
CREATE TABLE table_203_79 (
id number,
"year" number,
"film" text,
"publisher" text,
"director" text,
"distributor" text,
"worldwide gross" text,
"notes" text
) | which 2012 superhero film did not gross at least 100,000,000 ? | SELECT "film" FROM table_203_79 WHERE "year" = 2012 AND "worldwide gross" < 100000000 | squall |
CREATE TABLE table_42682 (
"Frequency" text,
"Call sign" text,
"Format" text,
"Owner" text,
"Notes" text
) | What is the Format of the French Frequency with a Call sign of CKRL-FM? | SELECT "Format" FROM table_42682 WHERE "Notes" = 'french' AND "Call sign" = 'ckrl-fm' | wikisql |
CREATE TABLE author (
authorid int,
authorname varchar
)
CREATE TABLE writes (
paperid int,
authorid int
)
CREATE TABLE cite (
citingpaperid int,
citedpaperid int
)
CREATE TABLE journal (
journalid int,
journalname varchar
)
CREATE TABLE keyphrase (
keyphraseid int,
keyphrase... | What articles have been published since 2006 about the effects of juicing for cancer patients ? | SELECT DISTINCT paperid, title FROM paper WHERE title LIKE 'the effects of juicing for cancer patients' AND year > 2006 | scholar |
CREATE TABLE products (
product_name VARCHAR,
product_id VARCHAR,
product_price INTEGER
) | Return the names and ids of all products whose price is between 600 and 700. | SELECT product_name, product_id FROM products WHERE product_price BETWEEN 600 AND 700 | sql_create_context |
CREATE TABLE table_35445 (
"School" text,
"Mascot" text,
"Location" text,
"Enrollment" real,
"IHSAA Class" text,
"IHSAA Football Class" text,
"County" text
) | Where is Lafayette T. Jefferson School in 79 Tippecanoe county? | SELECT "Location" FROM table_35445 WHERE "County" = '79 tippecanoe' AND "School" = 'lafayette t. jefferson' | wikisql |
CREATE TABLE table_name_74 (
rank INTEGER,
events VARCHAR,
wins VARCHAR
) | What is the average rank for players with under 26 events and less than 2 wins? | SELECT AVG(rank) FROM table_name_74 WHERE events < 26 AND wins < 2 | sql_create_context |
CREATE TABLE table_name_16 (
last_performance VARCHAR,
status VARCHAR,
name VARCHAR
) | What was the Last Performance when the status is current cast, and a Name of noah parets? | SELECT last_performance FROM table_name_16 WHERE status = "current cast" AND name = "noah parets" | sql_create_context |
CREATE TABLE table_20381 (
"N\u00b0" real,
"Television service" text,
"Country" text,
"Language" text,
"Content" text,
"DAR" text,
"HDTV" text,
"Package/Option" text
) | Name the total number of hdtv for eurotic tv | SELECT COUNT("HDTV") FROM table_20381 WHERE "Television service" = 'Eurotic TV' | wikisql |
CREATE TABLE table_3115 (
"University" text,
"Location" text,
"Year Founded" real,
"QS World University Rankings 2012" real,
"Times Higher Education World University Rankings 2012-2013" text
) | What university was founded in 1898? | SELECT "University" FROM table_3115 WHERE "Year Founded" = '1898' | wikisql |
CREATE TABLE table_18626 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
) | In how many districts was the incumbent Estes Kefauver? | SELECT COUNT("District") FROM table_18626 WHERE "Incumbent" = 'Estes Kefauver' | wikisql |
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALA... | For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, visualize a bar chart about the distribution of hire_date and the sum of employee_id bin hire_date by time. | SELECT HIRE_DATE, SUM(EMPLOYEE_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 | nvbench |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | provide the number of patients whose admission location is transfer from hosp/extram and procedure long title is continuous intra-arterial blood gas monitoring? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_location = "TRANSFER FROM HOSP/EXTRAM" AND procedures.long_title = "Continuous intra-arterial blood gas monitoring" | mimicsql_data |
CREATE TABLE table_25901 (
"Series #" real,
"Season #" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" text
) | Name the directed by season # 2 | SELECT "Directed by" FROM table_25901 WHERE "Season #" = '2' | wikisql |
CREATE TABLE table_21094951_1 (
date VARCHAR,
record VARCHAR
) | Name the date for 6-2 record | SELECT date FROM table_21094951_1 WHERE record = "6-2" | sql_create_context |
CREATE TABLE table_59043 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Game site" text,
"Record" text,
"Attendance" text
) | What date is week 3? | SELECT "Date" FROM table_59043 WHERE "Week" = '3' | wikisql |
CREATE TABLE table_name_40 (
date VARCHAR,
tournament VARCHAR,
runner_s__up VARCHAR
) | Which date was the Memorial Tournament held on, when Payne Stewart was runner-up? | SELECT date FROM table_name_40 WHERE tournament = "memorial tournament" AND runner_s__up = "payne stewart" | sql_create_context |
CREATE TABLE table_23680576_2 (
party VARCHAR,
dec_2008 VARCHAR
) | Name the party/s when the polling percentage was 6.3% in Dec 2008. | SELECT party FROM table_23680576_2 WHERE dec_2008 = "6.3%" | sql_create_context |
CREATE TABLE flight (
aircraft_code_sequence text,
airline_code varchar,
airline_flight text,
arrival_time int,
connections int,
departure_time int,
dual_carrier text,
flight_days text,
flight_id int,
flight_number int,
from_airport varchar,
meal_code text,
stops int,... | show me the earliest flight from CLEVELAND to MEMPHIS | 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 = 'CLEVELAND' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'MEM... | atis |
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 of white-russian ethnicity were suggested the drug route ou? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "WHITE - RUSSIAN" AND prescriptions.route = "OU" | mimicsql_data |
CREATE TABLE table_name_39 (
round VARCHAR,
opponent VARCHAR
) | What round was the game against Cedric Marks? | SELECT round FROM table_name_39 WHERE opponent = "cedric marks" | sql_create_context |
CREATE TABLE table_35053 (
"gzip" text,
"bzip2" text,
"LHA/LZH" text,
"StuffIt" text,
"StuffIt X" text,
"ISO/CD Image" text
) | What is the ISO/CD image value associated with StuffitX of no, gzip of yes, and LHA/LZH of yes? | SELECT "ISO/CD Image" FROM table_35053 WHERE "StuffIt X" = 'no' AND "gzip" = 'yes' AND "LHA/LZH" = 'yes' | wikisql |
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE... | For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, give me the trend about salary over hire_date , and could you rank x axis from high to low order? | SELECT HIRE_DATE, SALARY FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY HIRE_DATE DESC | nvbench |
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE cost (
costid num... | what was the first time of patient 006-122712's intake on the last icu visit? | SELECT intakeoutput.intakeoutputtime FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-122712') AND NOT patient.unitdischargetime IS NUL... | eicu |
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 prescriptions... | give me the number of patients whose ethnicity is black/african american and lab test name is urobilinogen? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.ethnicity = "BLACK/AFRICAN AMERICAN" AND lab.label = "Urobilinogen" | mimicsql_data |
CREATE TABLE table_5501 (
"Name" text,
"Hanzi" text,
"Origin" text,
"Launch" real,
"Owner" text
) | Who is the owner of the object launched after 1997 and a Hanzi of ? | SELECT "Owner" FROM table_5501 WHERE "Launch" > '1997' AND "Hanzi" = '厦门卫视' | wikisql |
CREATE TABLE table_name_68 (
location VARCHAR,
position_in_2012_13 VARCHAR
) | When the position in 2012-13 is 13th, third division what is the location? | SELECT location FROM table_name_68 WHERE position_in_2012_13 = "13th, third division" | sql_create_context |
CREATE TABLE table_27682 (
"22/06/2008" text,
"Indonesia Super Series 2008" text,
"S.Series" text,
"7800.00" text,
"Runner-Up" text
) | Which s.series occurred on 06/05/2007? | SELECT "S.Series" FROM table_27682 WHERE "22/06/2008" = '06/05/2007' | wikisql |
CREATE TABLE table_1001 (
"Player" text,
"Position" text,
"Starter" text,
"Touchdowns" real,
"Extra points" real,
"Field goals" real,
"Points" real
) | How many touchdowns did Redden score? | SELECT MIN("Touchdowns") FROM table_1001 WHERE "Player" = 'Redden' | wikisql |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,... | what is average age of patients whose marital status is single and ethnicity is black/haitian? | SELECT AVG(demographic.age) FROM demographic WHERE demographic.marital_status = "SINGLE" AND demographic.ethnicity = "BLACK/HAITIAN" | mimicsql_data |
CREATE TABLE table_name_12 (
date VARCHAR,
score VARCHAR
) | On what day was the score of 1 6 6 1 3 6 achieved? | SELECT date FROM table_name_12 WHERE score = "1–6 6–1 3–6" | sql_create_context |
CREATE TABLE person_info (
RYBH text,
XBDM number,
XBMC text,
XM text,
CSRQ time,
CSD text,
MZDM text,
MZMC text,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
XLDM text,
XLMC text,
ZYLBDM text,
ZYMC text
)
CREATE TABLE jyjgzbb (
JYZBLSH text,
YLJGD... | 90418965888的住院中医诊断编号以及名称在住院看病中都是什么呢? | SELECT ZYZYZDZZBM, ZYZYZDZZMC FROM zyjzjlb WHERE JZLSH = '90418965888' | css |
CREATE TABLE table_12186237_1 (
date VARCHAR,
grand_prix VARCHAR
) | What is the date of the German Grand Prix? | SELECT date FROM table_12186237_1 WHERE grand_prix = "German grand_prix" | sql_create_context |
CREATE TABLE Course_Authors_and_Tutors (
author_id INTEGER,
author_tutor_ATB VARCHAR(3),
login_name VARCHAR(40),
password VARCHAR(40),
personal_name VARCHAR(80),
middle_name VARCHAR(80),
family_name VARCHAR(80),
gender_mf VARCHAR(1),
address_line_1 VARCHAR(80)
)
CREATE TABLE Subject... | Draw a bar chart about the distribution of password and author_tutor_ATB . | SELECT password, author_tutor_ATB FROM Course_Authors_and_Tutors ORDER BY personal_name | nvbench |
CREATE TABLE table_76685 (
"Full name" text,
"Alias" text,
"Age\u00b9" real,
"From" text,
"Occupation\u00b2" text,
"Specialty" text,
"Position/ Eliminated" text
) | What is Position/ Eliminated, when Age is less than 22, and when Full Name is 'Muhammad Fairul Azreen Bin Mohd Zahid'? | SELECT "Position/ Eliminated" FROM table_76685 WHERE "Age\u00b9" < '22' AND "Full name" = 'muhammad fairul azreen bin mohd zahid' | 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,
... | how many patients whose admission type is urgent and days of hospital stay is greater than 2? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "URGENT" AND demographic.days_stay > "2" | mimicsql_data |
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,
... | 在医院0729314中,患者50833760在名中包括妇产科的就诊科室的所有门诊就诊记录的流水号是什么 | SELECT mzjzjlb.JZLSH FROM hz_info JOIN mzjzjlb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE hz_info.RYBH = '50833760' AND hz_info.YLJGDM = '0729314' AND mzjzjlb.JZKSMC LIKE '%妇产科%' | css |
CREATE TABLE table_19822 (
"States" text,
"Fall 05" real,
"Fall 06" real,
"Fall 07" real,
"Fall 08" real,
"Fall 09" real
) | How man students were from Maryland in Fall 05? | SELECT "Fall 05" FROM table_19822 WHERE "States" = 'Maryland' | wikisql |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
C... | When was Kelly Gallardo discharged? | SELECT demographic.dischtime FROM demographic WHERE demographic.name = "Kelly Gallardo" | mimicsql_data |
CREATE TABLE table_62825 (
"Rank" real,
"Lane" real,
"Athlete" text,
"Nationality" text,
"Time" real,
"React" real
) | Which lane did the swimmer who had a Reaction time of 0.185 and a time of 20.9 swim in? | SELECT SUM("Lane") FROM table_62825 WHERE "React" = '0.185' AND "Time" < '20.9' | wikisql |
CREATE TABLE table_name_17 (
game INTEGER,
october VARCHAR,
opponent VARCHAR,
record VARCHAR
) | What average game has @ florida panthers as the opponent, 0-1-2 as the record, with an october greater than 8? | SELECT AVG(game) FROM table_name_17 WHERE opponent = "@ florida panthers" AND record = "0-1-2" AND october > 8 | sql_create_context |
CREATE TABLE table_36636 (
"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
) | How many points does the team with 3 losses have? | SELECT "Points" FROM table_36636 WHERE "Lost" = '3' | wikisql |
CREATE TABLE player (
player_id number,
name text,
position text,
club_id number,
apps number,
tries number,
goals text,
points number
)
CREATE TABLE competition_result (
competition_id number,
club_id_1 number,
club_id_2 number,
score text
)
CREATE TABLE competition (
... | What is the most common competition type? | SELECT competition_type FROM competition GROUP BY competition_type ORDER BY COUNT(*) DESC LIMIT 1 | spider |
CREATE TABLE table_63692 (
"School" text,
"City" text,
"Team Name" text,
"County" text,
"Year Joined" text,
"Year Left" text
) | What year did the Hornets leave the conference? | SELECT "Year Left" FROM table_63692 WHERE "Team Name" = 'hornets' | wikisql |
CREATE TABLE table_70154 (
"Surface" text,
"Event" text,
"Time ( h : m : s )" text,
"Date" text,
"Place" text
) | What is the Time ( h : m : s ) on 13 october 2010 | SELECT "Time ( h : m : s )" FROM table_70154 WHERE "Date" = '13 october 2010' | wikisql |
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... | 在01-12-24到12-01-09期间内,把患者奚欣嘉所有检验结果指标记录中的检测方法给列出来 | SELECT jyjgzbb.JCFF 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 = jyj... | css |
CREATE TABLE table_204_337 (
id number,
"festival" text,
"year" number,
"award" text,
"nominee" text,
"result" text
) | what is the name of the festival that has won the most ? | SELECT "festival" FROM table_204_337 WHERE "result" = 'won' GROUP BY "festival" ORDER BY COUNT(*) DESC LIMIT 1 | squall |
CREATE TABLE table_name_48 (
year_joined VARCHAR,
mascot VARCHAR,
year_left VARCHAR
) | What year did the Ingots, who left after 2007, join? | SELECT COUNT(year_joined) FROM table_name_48 WHERE mascot = "ingots" AND year_left > 2007 | sql_create_context |
CREATE TABLE table_42508 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Date" text
) | Who was the away team for tie number 9? | SELECT "Away team" FROM table_42508 WHERE "Tie no" = '9' | wikisql |
CREATE TABLE table_41420 (
"Player" text,
"Club" text,
"League" real,
"Play-offs" real,
"FA Cup" real,
"FA Trophy" real,
"Total" real
) | What are the average play-offs that have an FA Cup greater than 3? | SELECT AVG("Play-offs") FROM table_41420 WHERE "FA Cup" > '3' | wikisql |
CREATE TABLE Parts (
part_id INTEGER,
part_name VARCHAR(255),
chargeable_yn VARCHAR(1),
chargeable_amount VARCHAR(20),
other_part_details VARCHAR(255)
)
CREATE TABLE Third_Party_Companies (
company_id INTEGER,
company_type VARCHAR(5),
company_name VARCHAR(255),
company_address VARCH... | How many staffs have contacted with each engineer? Give me a bar chart grouping by each engineer's first name, rank from high to low by the x axis please. | SELECT first_name, COUNT(first_name) FROM Staff AS T1 JOIN Engineer_Visits AS T2 ON T1.staff_id = T2.contact_staff_id JOIN Maintenance_Engineers AS T3 ON T2.engineer_id = T3.engineer_id GROUP BY first_name ORDER BY first_name DESC | nvbench |
CREATE TABLE table_name_84 (
grid INTEGER,
time VARCHAR
) | With a Time of +1:37.055, which has the lowest Grid? | SELECT MIN(grid) FROM table_name_84 WHERE time = "+1:37.055" | sql_create_context |
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... | Return a bar chart about the distribution of ACC_Road and School_ID , and group by attribute ACC_Home, order in descending by the X please. | SELECT ACC_Road, School_ID FROM basketball_match GROUP BY ACC_Home, ACC_Road ORDER BY ACC_Road DESC | nvbench |
CREATE TABLE table_16751596_12 (
democrat VARCHAR,
dates_administered VARCHAR
) | On July 31, 2008, what are the Democrat: Vivian Davis Figures percentages? | SELECT democrat AS :_vivian_davis_figures FROM table_16751596_12 WHERE dates_administered = "July 31, 2008" | sql_create_context |
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
)
CREATE TABLE labevents (
ro... | when was the first time patient 27451 was admitted via a hospital clinic referral/premature? | SELECT admissions.admittime FROM admissions WHERE admissions.subject_id = 27451 AND admissions.admission_location = 'clinic referral/premature' ORDER BY admissions.admittime LIMIT 1 | mimic_iii |
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
... | For those employees who do not work in departments with managers that have ids between 100 and 200, show me about the distribution of hire_date and the sum of employee_id bin hire_date by weekday in a bar chart. | SELECT HIRE_DATE, SUM(EMPLOYEE_ID) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) | nvbench |
CREATE TABLE table_22416 (
"Frequency" text,
"Call sign" text,
"Branding" text,
"Format" text,
"Owner" text,
"Language/Rebroadcast" text
) | When vista radio is the owner how many call signs are there? | SELECT COUNT("Call sign") FROM table_22416 WHERE "Owner" = 'Vista Radio' | wikisql |
CREATE TABLE table_name_12 (
score VARCHAR,
date VARCHAR
) | What's the score on April 9? | SELECT score FROM table_name_12 WHERE date = "april 9" | sql_create_context |
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
outtime time
)
CREATE TABLE cost (
row_id nu... | when was patient 25869 prescribed for the first time since 16 months ago a medication via ng route? | SELECT prescriptions.startdate FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 25869) AND prescriptions.route = 'ng' AND DATETIME(prescriptions.startdate) >= DATETIME(CURRENT_TIME(), '-16 month') ORDER BY prescriptions.startdate LIMIT 1 | mimic_iii |
CREATE TABLE procedures (
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,
... | how many patients whose diagnoses icd9 code is 4295 and lab test fluid is other body fluid? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.icd9_code = "4295" AND lab.fluid = "Other Body Fluid" | mimicsql_data |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
CREATE TABLE zyjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
HZXM text,
JZKSDM text,
JZKSMC text,
JZLSH text,
KH text,
KLX number,... | 哪些编号的检验报告单是患者78649221818在名称中不包含变态反应的科室里开出的? | SELECT zyjybgb.BGDH FROM zyjybgb WHERE zyjybgb.JZLSH = '78649221818' AND NOT zyjybgb.KSMC LIKE '%变态反应%' UNION SELECT mzjybgb.BGDH FROM mzjybgb WHERE mzjybgb.JZLSH = '78649221818' AND NOT mzjybgb.KSMC LIKE '%变态反应%' | css |
CREATE TABLE Dorm (
dormid INTEGER,
dorm_name VARCHAR(20),
student_capacity INTEGER,
gender VARCHAR(1)
)
CREATE TABLE Dorm_amenity (
amenid INTEGER,
amenity_name VARCHAR(25)
)
CREATE TABLE Lives_in (
stuid INTEGER,
dormid INTEGER,
room_number INTEGER
)
CREATE TABLE Student (
S... | Compute the total mean age across sex as a pie chart. | SELECT Sex, AVG(Age) FROM Student GROUP BY Sex | nvbench |
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number... | what were the four most frequently prescribed medications that patients were prescribed with within the same hospital visit after being prescribed heparin? | SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, prescriptions.startdate, admissions.hadm_id FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'heparin') AS t1 JOIN (SELECT admissions.subje... | mimic_iii |
CREATE TABLE table_204_975 (
id number,
"year" number,
"competition" text,
"location" text,
"event" text,
"final-rank" text,
"final-score" number,
"qualifying rank" number,
"qualifying score" number
) | how man consecutive events took place in beijing ? | SELECT COUNT("event") FROM table_204_975 WHERE "location" = 'beijing' | squall |
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,
itemid number,
value number
)
CREATE TABLE labevents (
row_id number,
sub... | has patient 23436 ever had any lab test on their current hospital visit? | SELECT COUNT(*) > 0 FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 23436 AND admissions.dischtime IS NULL) | mimic_iii |
CREATE TABLE table_name_78 (
opponent_number VARCHAR,
result VARCHAR
) | What is the opponent number of the match with a w27-16 result? | SELECT opponent_number FROM table_name_78 WHERE result = "w27-16" | sql_create_context |
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,
... | count the number of patients whose primary disease is abdominal pain and age is less than 77? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "ABDOMINAL PAIN" AND demographic.age < "77" | mimicsql_data |
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, show me about the distribution of founder and the sum of revenue , and group by attribute founder in a bar chart, and display y-axis in asc order please. | SELECT Founder, SUM(Revenue) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder ORDER BY SUM(Revenue) | nvbench |
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... | what is the number of patients whose year of birth is less than 2043 and drug route is dialys? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dob_year < "2043" AND prescriptions.route = "DIALYS" | mimicsql_data |
CREATE TABLE company (
Company_ID int,
Rank int,
Company text,
Headquarters text,
Main_Industry text,
Sales_billion real,
Profits_billion real,
Assets_billion real,
Market_Value real
)
CREATE TABLE station_company (
Station_ID int,
Company_ID int,
Rank_of_the_Year int
)
... | List all headquarters and the number of companies in each headquarter, and order bar in ascending order. | SELECT Headquarters, COUNT(*) FROM company GROUP BY Headquarters ORDER BY Headquarters | nvbench |
CREATE TABLE state (
state_code text,
state_name text,
country_name text
)
CREATE TABLE ground_service (
city_code text,
airport_code text,
transport_type text,
ground_fare int
)
CREATE TABLE days (
days_code varchar,
day_name varchar
)
CREATE TABLE restriction (
restriction_c... | is there a CO flight leaving from LAS VEGAS to NEW YORK nonstop | 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 = 'LAS VEGAS' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'NE... | atis |
CREATE TABLE table_name_7 (
constructor VARCHAR,
laps VARCHAR,
grid VARCHAR
) | Which Constructor has Laps larger than 9, and a Grid smaller than 2? | SELECT constructor FROM table_name_7 WHERE laps > 9 AND grid < 2 | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.