context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_17394 (
"English Name" text,
"Simplified" text,
"Traditional" text,
"Pinyin" text,
"Hakka" text,
"Area" real,
"Population" real,
"Density" real
) | When pinyin is x nlu q , what is the simplified value? | SELECT COUNT("Simplified") FROM table_17394 WHERE "Pinyin" = 'Xīnluó Qū' | wikisql |
CREATE TABLE table_name_16 (
result VARCHAR,
time VARCHAR
) | What was the final score for the game played at 7:00 pm? | SELECT result FROM table_name_16 WHERE time = "7:00 pm" | 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... | 花费的医疗费总额不少于1973.76元的次数在患者72169223的医疗记录有多少,其有什么编号的病是入院诊断出来的,叫啥名? | SELECT IN_DIAG_DIS_CD, IN_DIAG_DIS_NM FROM t_kc21 WHERE PERSON_ID = '72169223' AND MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc24 WHERE MED_AMOUT >= 1973.76) | css |
CREATE TABLE table_3913 (
"#" real,
"Date" text,
"Opponent" text,
"Site/Stadium" text,
"Score" text,
"Win" text,
"Loss" text,
"Save" text,
"Attendance" real,
"Overall Record" text,
"Pac-10 Record" text
) | What was the overall record of the game lost by A. Pracher (4-1)? | SELECT "Overall Record" FROM table_3913 WHERE "Loss" = 'A. Pracher (4-1)' | wikisql |
CREATE TABLE table_32651 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | How many times is st kilda the away team? | SELECT COUNT("Crowd") FROM table_32651 WHERE "Away team" = 'st kilda' | wikisql |
CREATE TABLE table_204_596 (
id number,
"year" number,
"winners" text,
"score" text,
"runners up" text,
"notes" text
) | which team scored the most goals in 1946 ? | SELECT "winners" FROM table_204_596 WHERE "year" = 1946 | squall |
CREATE TABLE table_71057 (
"Year" real,
"Population (Total)" real,
"(Caboolture)" real,
"(Pine Rivers)" real,
"(Redcliffe)" real
) | What is the Pine Rivers total population after 1947 with a Redcliffe population smaller than 68,877, a total population greater than 50,785, and a Caboolture population greater than 12,207? | SELECT COUNT("(Pine Rivers)") FROM table_71057 WHERE "Year" > '1947' AND "(Redcliffe)" < '68,877' AND "Population (Total)" > '50,785' AND "(Caboolture)" > '12,207' | wikisql |
CREATE TABLE table_35678 (
"Name" text,
"Street address" text,
"Years as tallest" text,
"Height ft ( m )" text,
"Floors" real
) | Which Floors is the highest one that has a Name of one indiana square? | SELECT MAX("Floors") FROM table_35678 WHERE "Name" = 'one indiana square' | wikisql |
CREATE TABLE table_4141 (
"By-election" real,
"Electorate" text,
"Date" text,
"Incumbent" text,
"Reason" text,
"Winner" text
) | When arthur collins is the winner what is the reason? | SELECT "Reason" FROM table_4141 WHERE "Winner" = 'Arthur Collins' | wikisql |
CREATE TABLE paperdataset (
paperid int,
datasetid int
)
CREATE TABLE paper (
paperid int,
title varchar,
venueid int,
year int,
numciting int,
numcitedby int,
journalid int
)
CREATE TABLE writes (
paperid int,
authorid int
)
CREATE TABLE journal (
journalid int,
j... | In what years did pedro domingos publish a paper ? | SELECT DISTINCT paper.year FROM author, paper, writes WHERE author.authorname = 'pedro domingos' AND writes.authorid = author.authorid AND writes.paperid = paper.paperid GROUP BY paper.year | scholar |
CREATE TABLE table_name_5 (
home_team VARCHAR,
away_team VARCHAR
) | Which team played against North Melbourne as the home team? | SELECT home_team FROM table_name_5 WHERE away_team = "north melbourne" | sql_create_context |
CREATE TABLE person_info (
CSD text,
CSRQ time,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
MZDM text,
MZMC text,
RYBH text,
XBDM number,
XBMC text,
XLDM text,
XLMC text,
XM text,
ZYLBDM text,
ZYMC text
)
CREATE TABLE mzjzjlb (
HXPLC number,
HZXM ... | 在门诊确诊为脑外伤所致精神障碍的病人方歌韵其直接胆红素二代的检查的结果中具体的定量及其单位都是什么? | SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN person_info_hz_info ON person_info.RYBH = person_info_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... | css |
CREATE TABLE table_79827 (
"Nat." text,
"Name" text,
"Since" text,
"Goals" real,
"Transfer fee" text
) | What is the average goals Sawyer has? | SELECT AVG("Goals") FROM table_79827 WHERE "Name" = 'sawyer' | wikisql |
CREATE TABLE table_48715 (
"Institution" text,
"Location" text,
"Nickname" text,
"Founded" real,
"Enrollment" real,
"Joined" real
) | Which Joined has a Nickname of knights, and an Enrollment larger than 2,960? | SELECT SUM("Joined") FROM table_48715 WHERE "Nickname" = 'knights' AND "Enrollment" > '2,960' | wikisql |
CREATE TABLE table_name_58 (
catalog VARCHAR,
label VARCHAR
) | What is the Catalog of the RCA release? | SELECT catalog FROM table_name_58 WHERE label = "rca" | sql_create_context |
CREATE TABLE injury_accident (
game_id int,
id int,
Player text,
Injury text,
Number_of_matches text,
Source text
)
CREATE TABLE stadium (
id int,
name text,
Home_Games int,
Average_Attendance real,
Total_Attendance real,
Capacity_Percentage real
)
CREATE TABLE game (
... | List the number of games in each season and group by home team in a group line chart, order by the X-axis from high to low. | SELECT Season, COUNT(Season) FROM game GROUP BY Home_team, Season ORDER BY Season DESC | nvbench |
CREATE TABLE table_name_69 (
network VARCHAR,
aspect VARCHAR,
channel VARCHAR
) | Which network has more than 31.4 channels with a 4:3 aspect? | SELECT network FROM table_name_69 WHERE aspect = "4:3" AND channel > 31.4 | sql_create_context |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (... | what is admission type of subject name gus marques? | SELECT demographic.admission_type FROM demographic WHERE demographic.name = "Gus Marques" | mimicsql_data |
CREATE TABLE Ref_Document_Types (
Document_Type_Code CHAR(15),
Document_Type_Name VARCHAR(255),
Document_Type_Description VARCHAR(255)
)
CREATE TABLE Roles (
Role_Code CHAR(15),
Role_Name VARCHAR(255),
Role_Description VARCHAR(255)
)
CREATE TABLE All_Documents (
Document_ID INTEGER,
Da... | Show me the proportion on what is the code of each location and the number of documents in that location? | SELECT Location_Code, COUNT(*) FROM Document_Locations GROUP BY Location_Code | nvbench |
CREATE TABLE table_name_31 (
length_of_game VARCHAR,
home_team VARCHAR
) | How long did the game go that was played with the Houston Oilers at home? | SELECT length_of_game FROM table_name_31 WHERE home_team = "houston oilers" | sql_create_context |
CREATE TABLE table_name_95 (
score VARCHAR,
time VARCHAR
) | WHAT SCORE HAS A TIME OF 18:27? | SELECT score FROM table_name_95 WHERE time = "18:27" | sql_create_context |
CREATE TABLE table_34337 (
"Pick #" real,
"Round" text,
"Player" text,
"Position" text,
"College" text
) | If the college is Trinity, what position is listed? | SELECT "Position" FROM table_34337 WHERE "College" = 'trinity' | wikisql |
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... | how much has changed in patient 016-35266's mcv levels measured at 2103-12-15 06:47:00 compared to the value measured at 2103-12-13 10:19:00? | SELECT (SELECT lab.labresult FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-35266')) AND lab.labname = 'mcv' AND lab.labresulttime = '2103-12-15 06:47:... | eicu |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate n... | did patient 022-140336 be prescribed dextrose 50%, morphine inj, or acetaminophen 650mg rect supp in 12/2105? | SELECT COUNT(*) > 0 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '022-140336')) AND medication.drugname IN ('dextrose 50%', 'morphine inj', ... | eicu |
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE fare_basis (
fare_basis_code text,
booking_class text,
class_type text,
premium text,
economy text,
discounted text,
ni... | show all flights on LH out of BOSTON | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND flight.from_airport = AIRP... | atis |
CREATE TABLE table_25171 (
"Position" text,
"Name" text,
"Jersey Number" real,
"Age" real,
"Height" text,
"Weight" real,
"College" text,
"Result" text
) | What is the result for Wisconsin? | SELECT "Result" FROM table_25171 WHERE "College" = 'Wisconsin' | wikisql |
CREATE TABLE Reservations (
Code INTEGER,
Room TEXT,
CheckIn TEXT,
CheckOut TEXT,
Rate REAL,
LastName TEXT,
FirstName TEXT,
Adults INTEGER,
Kids INTEGER
)
CREATE TABLE Rooms (
RoomId TEXT,
roomName TEXT,
beds INTEGER,
bedType TEXT,
maxOccupancy INTEGER,
baseP... | Show me the average of baseprice by bedtype in a histogram, and order in asc by the Y-axis. | SELECT bedType, AVG(basePrice) FROM Rooms GROUP BY bedType ORDER BY AVG(basePrice) | nvbench |
CREATE TABLE Flight (
Id VARCHAR
) | How many flights do we have? | SELECT COUNT(*) FROM Flight | sql_create_context |
CREATE TABLE Products (
product_id INTEGER,
parent_product_id INTEGER,
production_type_code VARCHAR(15),
unit_price DECIMAL(19,4),
product_name VARCHAR(80),
product_color VARCHAR(20),
product_size VARCHAR(20)
)
CREATE TABLE Product_Categories (
production_type_code VARCHAR(15),
prod... | Return a scatter on how many order items correspond to each order id? | SELECT order_id, COUNT(*) FROM Order_Items GROUP BY order_id | nvbench |
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
HIRE_DATE date,
JOB_ID varchar(10),
... | For all employees who have the letters D or S in their first name, a line chart shows the trend of commission_pct over hire_date , and could you rank from low to high by the x-axis? | SELECT HIRE_DATE, COMMISSION_PCT FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY HIRE_DATE | nvbench |
CREATE TABLE table_19698421_1 (
number_of_candidates VARCHAR,
year VARCHAR
) | How many candidates were there in the year of 1987? | SELECT number_of_candidates FROM table_19698421_1 WHERE year = "1987" | sql_create_context |
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
discharge_location text,
insurance text,
language text,
marital_status text,
ethnicity text,
age number
)
CREATE ... | what's the percentile of 285.0 in a platelet count lab test at the same age as patient 458 in their last hospital encounter? | SELECT DISTINCT t1.c1 FROM (SELECT labevents.valuenum, PERCENT_RANK() OVER (ORDER BY labevents.valuenum) AS c1 FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'platelet count') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admission... | mimic_iii |
CREATE TABLE table_203_41 (
id number,
"name" text,
"variant name(s)" text,
"source" text,
"source coordinates" text,
"length" text,
"mouth" text,
"mouth coordinates" text
) | which is the only creek to be 1 mile in length ? | SELECT "name" FROM table_203_41 WHERE "length" = 1 | squall |
CREATE TABLE table_54376 (
"Year" real,
"Category" text,
"Nominee(s)" text,
"Episode" text,
"Result" text
) | Name the episode for jenny bicks and cindy chupack nominees in 2004 | SELECT "Episode" FROM table_54376 WHERE "Year" = '2004' AND "Nominee(s)" = 'jenny bicks and cindy chupack' | wikisql |
CREATE TABLE table_59520 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Results" text
) | Who is the Incumbent of the Democratic Party at an election after 1992 in the New York 1 District who was Re-elected? | SELECT "Incumbent" FROM table_59520 WHERE "Party" = 'democratic' AND "Results" = 're-elected' AND "First elected" > '1992' AND "District" = 'new york 1' | wikisql |
CREATE TABLE table_name_19 (
tonnage VARCHAR,
date VARCHAR
) | With 14 under the date, what is the tonnage of the ship? | SELECT tonnage FROM table_name_19 WHERE date = "14" | sql_create_context |
CREATE TABLE courses (
course_id text,
course_name text,
course_description text,
other_details text
)
CREATE TABLE student_course_attendance (
student_id number,
course_id number,
date_of_attendance time
)
CREATE TABLE addresses (
address_id number,
line_1 text,
line_2 text,
... | How many registed students do each course have? List course name and the number of their registered students? | SELECT T3.course_name, COUNT(*) FROM students AS T1 JOIN student_course_registrations AS T2 ON T1.student_id = T2.student_id JOIN courses AS T3 ON T2.course_id = T3.course_id GROUP BY T2.course_id | spider |
CREATE TABLE table_962 (
"IN No." real,
"County Name" text,
"Establishment Date (SW Indiana) (History) (Statehood)" text,
"County Seat" text,
"Time Zone" text,
"Population (2010) (Rank)" text,
"Area sq mi (km 2 ) (Rank)" text,
"Twps" real,
"ZIP code Prefix(es)" text,
"% of Bounda... | When Vincennes is the county seat what is the area sq mi (km 2 ) (rank) ? | SELECT "Area sq mi (km 2 ) (Rank)" FROM table_962 WHERE "County Seat" = 'Vincennes' | wikisql |
CREATE TABLE table_59269 (
"Team 1" text,
"Agg." text,
"Team 2" text,
"1st leg" text,
"2nd leg" text
) | What is the 1st leg that has a Rc Cannes Team 1? | SELECT "1st leg" FROM table_59269 WHERE "Team 1" = 'rc cannes' | 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
) | how many products are there for each manufacturer?, could you list bar from low to high order? | SELECT T2.Name, COUNT(*) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T2.Name | nvbench |
CREATE TABLE table_36019 (
"Rank" real,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | What is the highest number of silvers for ranks over 7? | SELECT MAX("Silver") FROM table_36019 WHERE "Rank" > '7' | wikisql |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE prescription... | find the number of patients who follow the religion jehovah's witness. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.religion = "JEHOVAH'S WITNESS" | mimicsql_data |
CREATE TABLE table_78895 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text,
"Money ( \u00a3 )" real
) | What is the Place of Davis Love III with a To Par of +1? | SELECT "Place" FROM table_78895 WHERE "To par" = '+1' AND "Player" = 'davis love iii' | wikisql |
CREATE TABLE table_54359 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" real,
"Record" text
) | Who is the loser when the attendance is larger than 31,409 and the date is July 9? | SELECT "Loss" FROM table_54359 WHERE "Attendance" > '31,409' AND "Date" = 'july 9' | wikisql |
CREATE TABLE table_20345624_2 (
title VARCHAR,
original_airdate VARCHAR
) | Name the title that aired on 5 august 1967 | SELECT COUNT(title) FROM table_20345624_2 WHERE original_airdate = "5 August 1967" | sql_create_context |
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_i... | calculate the four year survival probability of patients to whom clopidogrel bisulfate was prescribed after they were diagnosed with kidney laceration-open. | SELECT SUM(CASE WHEN patients.dod IS NULL THEN 1 WHEN STRFTIME('%j', patients.dod) - STRFTIME('%j', t4.charttime) > 4 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t2.subject_id, t2.charttime FROM (SELECT t1.subject_id, t1.charttime FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd... | mimic_iii |
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 average of code , and group by attribute name in a bar chart, and I want to show by the y-axis in descending please. | 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 mzjybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH number,
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,
... | 对于被门诊诊断为疾病号码E70.881的人来说甲胎蛋白的参考值范畴下限和上限为多少? | SELECT jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM mzjzjlb JOIN zyjybgb JOIN jyjgzbb ON mzjzjlb.YLJGDM = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB AND zyjybgb.YLJGDM = jyjgzbb.YLJGDM AND zyjybgb.BGDH = jyjgzbb.BGDH WHERE mzjzjlb.JZZDBM = 'E70.881' AND jyjgzbb.JCZBMC = '甲胎蛋白' UNION SELECT jyjgzbb.CKZFWX... | css |
CREATE TABLE table_24431348_18 (
status VARCHAR,
player VARCHAR
) | What is the status of player Philipp Kohlschreiber? | SELECT status FROM table_24431348_18 WHERE player = "Philipp Kohlschreiber" | sql_create_context |
CREATE TABLE table_19681738_1 (
county VARCHAR,
starky__percentage VARCHAR
) | How many times was country considered when starky % was 20.96% | SELECT COUNT(county) FROM table_19681738_1 WHERE starky__percentage = "20.96%" | sql_create_context |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
... | tell me the difference between the total of patient 008-24610's input and the output on the first icu visit. | SELECT (SELECT SUM(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '008-24610') AND NOT patient.unitdischarg... | eicu |
CREATE TABLE d_icd_procedures (
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_i... | how many days have elapsed since patient 22648 first received a creatinine lab test on their current hospital encounter? | SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', labevents.charttime)) FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'creatinine') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 22648 AND admissio... | mimic_iii |
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE treatment (
treat... | in 09/2105, when was patient 003-34282 prescribed a medication via subq route for the first time? | SELECT medication.drugstarttime FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '003-34282')) AND medication.routeadmin = 'subq' AND STRFTIME('... | eicu |
CREATE TABLE table_name_28 (
seasons VARCHAR,
entries VARCHAR,
poles VARCHAR
) | Which Seasons have Entries larger than 52, and Poles of 33? | SELECT seasons FROM table_name_28 WHERE entries > 52 AND poles = 33 | sql_create_context |
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
HIRE_DATE date,
JOB_ID varchar(10),
SALARY decimal(8,2),
COMMISSION_PCT decimal(2,2),
MANAGER_ID decimal(6,0),
DEPARTMENT_ID decimal(... | For those employees who was hired before 2002-06-21, for manager_id, hire_date, visualize the trend. | SELECT HIRE_DATE, MANAGER_ID FROM employees WHERE HIRE_DATE < '2002-06-21' | nvbench |
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
last_wardid number... | how many patients are in hospital ward 12 in 2102? | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT transfers.hadm_id FROM transfers WHERE transfers.wardid = 12 AND STRFTIME('%y', transfers.intime) = '2102') | mimic_iii |
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
) | For those records from the products and each product's manufacturer, visualize the relationship between price and revenue . | SELECT Price, Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code | nvbench |
CREATE TABLE table_name_87 (
laps VARCHAR,
grid VARCHAR,
points VARCHAR,
team VARCHAR
) | Waht laps have points smaller than 1, and a team of dale coyne racing, and the grid larger than 13? | SELECT laps FROM table_name_87 WHERE points < 1 AND team = "dale coyne racing" AND grid > 13 | sql_create_context |
CREATE TABLE table_51725 (
"Player" text,
"Nationality" text,
"Position" text,
"Years for Jazz" text,
"School/Club Team" text
) | What Position did Aaron Williams play? | SELECT "Position" FROM table_51725 WHERE "Player" = 'aaron williams' | wikisql |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | how many patients are with diagnosis icd9 code 78551? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.icd9_code = "78551" | mimicsql_data |
CREATE TABLE table_75079 (
"Callsign" text,
"Area served" text,
"Frequency" text,
"Band" text,
"Fate" text,
"Freq currently" text,
"Purpose" text
) | What is the purpose for Frequency of 102.3? | SELECT "Purpose" FROM table_75079 WHERE "Frequency" = '102.3' | 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,... | count the number of married patients who have acute myocardial infarction of inferolateral wall, initial episode of care diagnoses. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.marital_status = "MARRIED" AND diagnoses.short_title = "AMI inferolateral, init" | mimicsql_data |
CREATE TABLE table_66829 (
"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 matches were drawn by a team with 447 points? | SELECT "Drawn" FROM table_66829 WHERE "Points for" = '447' | wikisql |
CREATE TABLE table_name_47 (
evening_gown INTEGER,
preliminaries VARCHAR,
swimsuit VARCHAR,
state VARCHAR
) | What is the average evening gown score of the contestant from New York with a swimsuit score less than 8.703 and preliminaries larger than 8.292? | SELECT AVG(evening_gown) FROM table_name_47 WHERE swimsuit < 8.703 AND state = "new york" AND preliminaries > 8.292 | sql_create_context |
CREATE TABLE table_65494 (
"Name" text,
"Position" text,
"League Apps" text,
"League Goals" real,
"FA Cup Apps" text,
"FA Cup Goals" real,
"League Cup Apps" real,
"League Cup Goals" real,
"Total Apps" text,
"Total Goals" real
) | what is the average league cup goals when the league cup apps is 4, league goals is less than 4, fa cup apps is 1 and total apps is 35? | SELECT AVG("League Cup Goals") FROM table_65494 WHERE "League Cup Apps" = '4' AND "League Goals" < '4' AND "FA Cup Apps" = '1' AND "Total Apps" = '35' | wikisql |
CREATE TABLE table_22301 (
"Player" text,
"FCSL Team" text,
"Years Played" text,
"Year Drafted" real,
"Round" text,
"MLB Team" text
) | When winter pines is the fcsl team how many mlb teams are there? | SELECT COUNT("MLB Team") FROM table_22301 WHERE "FCSL Team" = 'Winter Pines' | wikisql |
CREATE TABLE Movie (
mID int,
title text,
year int,
director text
)
CREATE TABLE Rating (
rID int,
mID int,
stars int,
ratingDate date
)
CREATE TABLE Reviewer (
rID int,
name text
) | Please give me a bar chart to compare the stars by directors. | SELECT director, stars FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID | nvbench |
CREATE TABLE table_name_83 (
duration VARCHAR,
actor VARCHAR
) | How long did Joyce Jacobs portray her character on her show? | SELECT duration FROM table_name_83 WHERE actor = "joyce jacobs" | sql_create_context |
CREATE TABLE table_name_63 (
draws INTEGER,
wins VARCHAR,
club VARCHAR
) | Club warrnambool has less than 9 wins and what average of draws? | SELECT AVG(draws) FROM table_name_63 WHERE wins < 9 AND club = "warrnambool" | sql_create_context |
CREATE TABLE table_name_49 (
Id VARCHAR
) | How many 1990 growth numbers had less than 10,522 in 1970? | SELECT COUNT(1990) FROM table_name_49 WHERE 1970 < 10 OFFSET 522 | sql_create_context |
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE patients (
row_id number,
subject_... | what were the top five most frequently performed lab tests among patients aged 40s since 3 years ago? | SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT t1.itemid FROM (SELECT labevents.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age BETWEEN 40 AND 49) AND DATETIME(labevents.chartti... | mimic_iii |
CREATE TABLE table_34718 (
"Game" real,
"Date" text,
"Opponent" text,
"Score" text,
"Series" text
) | Name the opponent for game 5 | SELECT "Opponent" FROM table_34718 WHERE "Game" = '5' | wikisql |
CREATE TABLE table_name_40 (
opponent_in_the_final VARCHAR,
date VARCHAR
) | What is Opponent in The Final, when Date is '1976'? | SELECT opponent_in_the_final FROM table_name_40 WHERE date = 1976 | sql_create_context |
CREATE TABLE table_4271 (
"Route Number" real,
"Origin" text,
"Intermediate stops" text,
"Destination" text,
"Provider" text
) | How many route numbers occur for the origin of Birmingham and destination of Bristol? | SELECT COUNT("Route Number") FROM table_4271 WHERE "Origin" = 'Birmingham' AND "Destination" = 'Bristol' | wikisql |
CREATE TABLE person_info (
CSD text,
CSRQ time,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
MZDM text,
MZMC text,
RYBH text,
XBDM number,
XBMC text,
XLDM text,
XLMC text,
XM text,
ZYLBDM text,
ZYMC text
)
CREATE TABLE jyjgzbb (
BGDH text,
BGRQ tim... | 列出在2001年9月1日到2013年5月9日内患者72522384被开出的所有检验报告单的检验报告单号分别是哪些? | SELECT jybgb.BGDH FROM hz_info JOIN zzmzjzjlb JOIN jybgb 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 WHERE hz_info.RYBH = '72522384' AND jybgb.BGRQ BETWEEN '2001-09-01' AND '2013-... | css |
CREATE TABLE table_name_32 (
game INTEGER,
record VARCHAR,
hornets_score VARCHAR
) | What is the highest game with a 1-0 record, and the Hornets scored more than 100? | SELECT MAX(game) FROM table_name_32 WHERE record = "1-0" AND hornets_score > 100 | 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... | 患者98927870为检测指标229548从06年10月2日到2011年7月16日之内的医务人员工号与姓名都是什么? | SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM 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.BGD... | css |
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
CreationDate time,
UserId number,
UserDisplayName text,
Comment text,
Text text,
ContentLicense text
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswer... | Most popular bad questions about Python. All non-CW questions with at least 1000 views ordered by votes ascending so that the least popular of the questions is on top | SELECT question.Title, question.Score, question.AnswerCount AS "Answer Count", question.ViewCount, t.TagName FROM Posts AS question JOIN PostTypes AS ty ON ty.Id = question.PostTypeId JOIN PostTags AS questiont ON question.Id = questiont.PostId JOIN Tags AS t ON t.Id = questiont.TagId WHERE question.CommunityOwnedDate ... | sede |
CREATE TABLE table_15977768_1 (
del_pueblo VARCHAR,
centennial VARCHAR
) | Name the del pueblo for red/black | SELECT del_pueblo FROM table_15977768_1 WHERE centennial = "Red/black" | sql_create_context |
CREATE TABLE table_29763 (
"Stadium" text,
"City" text,
"Capacity" real,
"Matches played" real,
"Overall attendance" real,
"Average attendance per match" real,
"Average attendance as % of Capacity" text,
"Overall goals scored" real,
"Average goals scored per match" text,
"Elevati... | what is the minimum overall attendance where the goals scored were 19? | SELECT MIN("Overall attendance") FROM table_29763 WHERE "Overall goals scored" = '19' | wikisql |
CREATE TABLE table_name_34 (
status VARCHAR,
against VARCHAR
) | What status has 18 as the against? | SELECT status FROM table_name_34 WHERE against = 18 | sql_create_context |
CREATE TABLE table_name_66 (
league VARCHAR,
goals VARCHAR
) | Which league has 12 goals? | SELECT league FROM table_name_66 WHERE goals = 12 | sql_create_context |
CREATE TABLE status (
id VARCHAR,
station_id VARCHAR,
lat INTEGER,
bikes_available INTEGER
)
CREATE TABLE station (
id VARCHAR,
station_id VARCHAR,
lat INTEGER,
bikes_available INTEGER
) | What are the ids of stations that have latitude above 37.4 and never had bike availability below 7? | SELECT id FROM station WHERE lat > 37.4 EXCEPT SELECT station_id FROM status GROUP BY station_id HAVING MIN(bikes_available) < 7 | sql_create_context |
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,
... | when patient 027-178044 first got surgery in 2105. | SELECT treatment.treatmenttime FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-178044')) AND STRFTIME('%y', treatment.treatmenttime) = '2105... | eicu |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id t... | how many male patients had the diagnosis long title polycythemia vera? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.gender = "M" AND diagnoses.long_title = "Polycythemia vera" | mimicsql_data |
CREATE TABLE t_kc22 (
AMOUNT number,
CHA_ITEM_LEV number,
DATA_ID text,
DIRE_TYPE number,
DOSE_FORM text,
DOSE_UNIT text,
EACH_DOSAGE text,
EXP_OCC_DATE time,
FLX_MED_ORG_ID text,
FXBZ number,
HOSP_DOC_CD text,
HOSP_DOC_NM text,
MED_DIRE_CD text,
MED_DIRE_NM text,... | 医疗机构5083520从一一年六月六日开始,截止到二零年四月二十一日,出现疾病诊断结果出院与入院不相同的结果有多少次 | SELECT COUNT(*) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '5083520' AND t_kc21.IN_HOSP_DATE BETWEEN '2011-06-06' AND '2020-04-21' AND t_kc21.IN_DIAG_DIS_CD <> t_kc21.OUT_DIAG_DIS_CD | css |
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
) | For those records from the products and each product's manufacturer, a bar chart shows the distribution of headquarter and the sum of code , and group by attribute headquarter, and display names in ascending order please. | SELECT T2.Headquarter, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Headquarter ORDER BY T2.Headquarter | nvbench |
CREATE TABLE table_2974 (
"French Title" text,
"Date of Publication" real,
"English Translation" text,
"Writer" text,
"Artist" text
) | How many English translations were made for the story originally titled 'La Ribambelle Enqu te'? | SELECT COUNT("English Translation") FROM table_2974 WHERE "French Title" = 'La Ribambelle enquête' | wikisql |
CREATE TABLE table_name_75 (
result VARCHAR,
date VARCHAR
) | What was the result of the game on April 28? | SELECT result FROM table_name_75 WHERE date = "april 28" | sql_create_context |
CREATE TABLE table_train_242 (
"id" int,
"macroalbuminuria" bool,
"hyperlipidemia" bool,
"fasting_serum_triglycerides" int,
"fasting_ldl_cholesterol" int,
"panel_reactive_antibodies" int,
"serum_creatinine" float,
"albumin" float,
"body_mass_index_bmi" float,
"fasting_serum_chole... | bmi above 26 ; | SELECT * FROM table_train_242 WHERE body_mass_index_bmi > 26 | criteria2sql |
CREATE TABLE table_31692 (
"Region" text,
"Host" text,
"Venue" text,
"City" text,
"State" text
) | What city is the Northeast Louisiana University located in? | SELECT "City" FROM table_31692 WHERE "Host" = 'northeast louisiana university' | wikisql |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TAB... | how many times patient 004-65311 has been prescribed for 500 ml flex cont excel : sodium chloride 0.9 % iv soln until 2104? | 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 = '004-65311')) AND medication.drugname = '500 ml flex cont excel : sodium chlori... | eicu |
CREATE TABLE table_22413 (
"Country" text,
"Tourist arrivals (2011) (Millions)" text,
"Tourism receipts (2011) (Millions of US$)" real,
"Tourism receipts (2011) (US$ per arrival)" real,
"Tourism receipts (2011) (US$ per capita)" real,
"Tourism receipts (2003) (as % of GDP)" text,
"Tourism re... | Name the total number of tourism receipts 2011 where tourism receipts 2003 13.5 | SELECT COUNT("Tourism receipts (2011) (US$ per capita)") FROM table_22413 WHERE "Tourism receipts (2003) (as % of GDP)" = '13.5' | wikisql |
CREATE TABLE Customers (
customer_id VARCHAR
)
CREATE TABLE Accounts (
customer_id VARCHAR
) | Show customer ids who don't have an account. | SELECT customer_id FROM Customers EXCEPT SELECT customer_id FROM Accounts | sql_create_context |
CREATE TABLE swimmer (
ID int,
name text,
Nationality text,
meter_100 real,
meter_200 text,
meter_300 text,
meter_400 text,
meter_500 text,
meter_600 text,
meter_700 text,
Time text
)
CREATE TABLE event (
ID int,
Name text,
Stadium_ID int,
Year text
)
CREATE... | Return a bar chart about the distribution of meter_400 and meter_100 , display in descending by the meter_100. | SELECT meter_400, meter_100 FROM swimmer ORDER BY meter_100 DESC | nvbench |
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
) | Compare the total number of captains with different classes using a bar graph. | SELECT Class, COUNT(Class) FROM captain GROUP BY Class | nvbench |
CREATE TABLE table_1875157_1 (
winnings VARCHAR,
starts VARCHAR
) | Did this driver have any winnings the season he had 32 starts | SELECT COUNT(winnings) FROM table_1875157_1 WHERE starts = 32 | sql_create_context |
CREATE TABLE table_name_56 (
rebounds INTEGER,
team VARCHAR,
games VARCHAR
) | What is the sum of Rebounds, when Team is Aris Thessaloniki, and when Games is greater than 14? | SELECT SUM(rebounds) FROM table_name_56 WHERE team = "aris thessaloniki" AND games > 14 | sql_create_context |
CREATE TABLE table_47427 (
"Date" text,
"Tournament" text,
"Winning score" text,
"Margin of victory" text,
"Runner(s)-up" text
) | What is the winning score for the B.C. Open 1 tournament? | SELECT "Winning score" FROM table_47427 WHERE "Tournament" = 'b.c. open 1' | wikisql |
CREATE TABLE table_49929 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" real
) | What was the result of the September 8, 1985 game? | SELECT "Result" FROM table_49929 WHERE "Date" = 'september 8, 1985' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.