context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_21453 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | What was the high assists on April 7? | SELECT "High assists" FROM table_21453 WHERE "Date" = 'April 7' | wikisql |
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25),
COUNTRY_ID varchar(2)
)
CREATE T... | For those employees who did not have any job in the past, give me the comparison about the amount of hire_date over the hire_date bin hire_date by weekday, and show Y-axis in desc order. | SELECT HIRE_DATE, COUNT(HIRE_DATE) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY COUNT(HIRE_DATE) DESC | nvbench |
CREATE TABLE table_17111812_1 (
tenth VARCHAR,
ninth VARCHAR
) | When Kubb is in 9th, who is in 10th? | SELECT tenth FROM table_17111812_1 WHERE ninth = "Kubb" | sql_create_context |
CREATE TABLE table_47085 (
"Game" real,
"Date" text,
"Opponent" text,
"Score" text,
"Record" text
) | Can you tell me the Score that has the Opponent of at edmonton oilers? | SELECT "Score" FROM table_47085 WHERE "Opponent" = 'at edmonton oilers' | wikisql |
CREATE TABLE table_name_14 (
long VARCHAR,
ryds VARCHAR
) | What is the Long when the ryds is 18? | SELECT long FROM table_name_14 WHERE ryds = "18" | sql_create_context |
CREATE TABLE table_20688030_1 (
county VARCHAR,
obama_percentage VARCHAR
) | What is the total of countys where Obama is popular by 35.44%? | SELECT COUNT(county) FROM table_20688030_1 WHERE obama_percentage = "35.44%" | sql_create_context |
CREATE TABLE Participants_in_Events (
Event_ID INTEGER,
Participant_ID INTEGER
)
CREATE TABLE Participants (
Participant_ID INTEGER,
Participant_Type_Code CHAR(15),
Participant_Details VARCHAR(255)
)
CREATE TABLE Events (
Event_ID INTEGER,
Service_ID INTEGER,
Event_Details VARCHAR(255)... | Give me a pie chart to show the proportion of event details of events that have more than one participant. | SELECT Event_Details, COUNT(Event_Details) FROM Events AS T1 JOIN Participants_in_Events AS T2 ON T1.Event_ID = T2.Event_ID GROUP BY Event_Details | nvbench |
CREATE TABLE table_name_90 (
score VARCHAR,
high_points VARCHAR
) | Which Score has High points of douglas (15)? | SELECT score FROM table_name_90 WHERE high_points = "douglas (15)" | sql_create_context |
CREATE TABLE table_61811 (
"Tournament" text,
"2009" text,
"2010" text,
"2011" text,
"2012" text
) | What is 2011, when 2012 is 'A', and when Tournament is 'French Open'? | SELECT "2011" FROM table_61811 WHERE "2012" = 'a' AND "Tournament" = 'french open' | wikisql |
CREATE TABLE table_69839 (
"Year" real,
"Class" text,
"Team" text,
"Points" real,
"Rank" text,
"Wins" real
) | What is the earliest year in the 125cc class with more than 102 points and a rank of 2nd? | SELECT MIN("Year") FROM table_69839 WHERE "Class" = '125cc' AND "Points" > '102' AND "Rank" = '2nd' | wikisql |
CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationDate time,
ApprovalDate time,
RejectionDate time,
OwnerUserId number,
Comment text,
Text text,
Title text,
Tags text,
RevisionGUID other
)
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
... | Accept ratio for a site. | SELECT CAST(COUNT(AcceptedAnswerId) AS FLOAT) / COUNT(*) AS Accept_ratio FROM Posts WHERE PostTypeId = 1 | sede |
CREATE TABLE table_name_56 (
distance VARCHAR
) | What is the number of 2012 passengers in millions that have traveled a distance of 1075km? | SELECT COUNT(2012 AS _passengers__in_millions_) FROM table_name_56 WHERE distance = "1075km" | sql_create_context |
CREATE TABLE table_28445 (
"Season" real,
"Series" text,
"Team" text,
"Races" real,
"Wins" real,
"Poles" real,
"F/Laps" real,
"Podiums" real,
"Points" text,
"Position" text
) | What is the minimum number of f/laps? | SELECT MIN("F/Laps") FROM table_28445 | wikisql |
CREATE TABLE table_204_854 (
id number,
"#" number,
"wrestlers" text,
"reign" number,
"date" text,
"days\nheld" number,
"location" text,
"notes" text
) | how many matches were in 2007 ? | SELECT COUNT(*) FROM table_204_854 WHERE "date" = 2007 | squall |
CREATE TABLE table_name_78 (
country VARCHAR,
score VARCHAR
) | What country was the golfer with a score of 72-72-72=216 representing? | SELECT country FROM table_name_78 WHERE score = 72 - 72 - 72 = 216 | sql_create_context |
CREATE TABLE table_758 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
) | Who ran for office in the Alabama 1 district? | SELECT "Candidates" FROM table_758 WHERE "District" = 'Alabama 1' | wikisql |
CREATE TABLE subjects (
subject_id number,
subject_name text
)
CREATE TABLE course_authors_and_tutors (
author_id number,
author_tutor_atb text,
login_name text,
password text,
personal_name text,
middle_name text,
family_name text,
gender_mf text,
address_line_1 text
)
CRE... | List all the information about course authors and tutors in alphabetical order of the personal name. | SELECT * FROM course_authors_and_tutors ORDER BY personal_name | spider |
CREATE TABLE table_name_55 (
word VARCHAR,
pronunciation_b VARCHAR
) | Name the word with pronunciation b of *s ks | SELECT word FROM table_name_55 WHERE pronunciation_b = "*sɨks" | sql_create_context |
CREATE TABLE qtb (
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... | 在患者32284795的医疗记录中,他的药品消费金额在1441.3元以上的医疗就诊有哪几次?编号是什么 | SELECT qtb.MED_CLINIC_ID FROM qtb WHERE qtb.PERSON_ID = '32284795' AND NOT qtb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT <= 1441.3) UNION SELECT gyb.MED_CLINIC_ID FROM gyb WHERE gyb.PERSON_ID = '32284795' AND NOT gyb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_k... | css |
CREATE TABLE table_name_5 (
political_party VARCHAR,
monarchs_served VARCHAR,
birth_place VARCHAR
) | To which political party did the prime minister who served under George V and was born in Manchester belong? | SELECT political_party FROM table_name_5 WHERE monarchs_served = "george v" AND birth_place = "manchester" | sql_create_context |
CREATE TABLE table_name_27 (
name VARCHAR,
place_of_birth VARCHAR
) | Who was born in Porsgrunn? | SELECT name FROM table_name_27 WHERE place_of_birth = "porsgrunn" | sql_create_context |
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 procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
... | out of total number of patient discharged after long term hospital care, calculate the maximum age of divorcee patients. | SELECT MAX(demographic.age) FROM demographic WHERE demographic.marital_status = "DIVORCED" AND demographic.discharge_location = "LONG TERM CARE HOSPITAL" | mimicsql_data |
CREATE TABLE postseason (
year INTEGER,
round TEXT,
team_id_winner TEXT,
league_id_winner TEXT,
team_id_loser TEXT,
league_id_loser TEXT,
wins INTEGER,
losses INTEGER,
ties INTEGER
)
CREATE TABLE fielding (
player_id TEXT,
year INTEGER,
stint INTEGER,
team_id TEXT,
... | How many home games by each year (bin the year attr into weekdays interval)? Give me a line chart, list X-axis from low to high order. | SELECT year, COUNT(year) FROM home_game ORDER BY year | nvbench |
CREATE TABLE table_22883210_9 (
game INTEGER,
team VARCHAR
) | What is the highest game number where the team was Cleveland? | SELECT MAX(game) FROM table_22883210_9 WHERE team = "Cleveland" | sql_create_context |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREA... | since 207 days ago, list the daily maximum heartrate of patient 007-15837. | SELECT MAX(vitalperiodic.heartrate) FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '007-15837')) AND NOT vitalperiodic.heartrate IS NULL... | eicu |
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto 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 diagnoses_icd (
row_id number,
... | how many patient have died after they were diagnosed with cardiac arrest within 2 months? | SELECT COUNT(DISTINCT t2.subject_id) FROM (SELECT t1.subject_id, t1.charttime FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_di... | mimic_iii |
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,... | For those employees who did not have any job in the past, return a bar chart about the distribution of job_id and the sum of salary , and group by attribute job_id, and could you sort by the Y in ascending please? | SELECT JOB_ID, SUM(SALARY) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) GROUP BY JOB_ID ORDER BY SUM(SALARY) | nvbench |
CREATE TABLE qtb (
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... | 郎永逸患者在编号为7422800的这家医院中被开过什么单价最高的药?还需要这个药的编码,还有药品的单价 | SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM, t_kc22.UNIVALENT FROM t_kc22 WHERE t_kc22.MED_CLINIC_ID IN (SELECT qtb.MED_CLINIC_ID FROM qtb WHERE qtb.PERSON_NM = '郎永逸' AND qtb.MED_SER_ORG_NO = '7422800' UNION SELECT gyb.MED_CLINIC_ID FROM gyb WHERE gyb.PERSON_NM = '郎永逸' AND gyb.MED_SER_ORG_NO = '7422800' UNION... | css |
CREATE TABLE table_67857 (
"Year" real,
"Team" text,
"Co-Drivers" text,
"Class" text,
"Laps" real,
"Pos." text,
"Class Pos." text
) | What position did the 5th place team after 1992 with over 346 laps finish in? | SELECT "Pos." FROM table_67857 WHERE "Class Pos." = '5th' AND "Year" > '1992' AND "Laps" > '346' | wikisql |
CREATE TABLE course (
course_id int,
name varchar,
department varchar,
number varchar,
credits varchar,
advisory_requirement varchar,
enforced_requirement varchar,
description varchar,
num_semesters int,
num_enrolled int,
has_discussion varchar,
has_lab varchar,
has_p... | I want to see 13 -credit Business Forecasting and Equity Valuation courses . | SELECT DISTINCT department, name, number FROM course WHERE (description LIKE '%Business Forecasting and Equity Valuation%' OR name LIKE '%Business Forecasting and Equity Valuation%') AND credits = 13 | advising |
CREATE TABLE table_64101 (
"Rank" real,
"Team" text,
"Apps" real,
"Record" text,
"Win %" real
) | What is the lowest apps for rank 3 and 0% wins? | SELECT MIN("Apps") FROM table_64101 WHERE "Rank" = '3' AND "Win %" < '0' | wikisql |
CREATE TABLE table_31807 (
"Class" text,
"Type" text,
"No. built (Converted*)" text,
"Year built (Converted*)" text,
"No. range" text,
"Withdrawn" real
) | Tell me the year built for number built of 10 | SELECT "Year built (Converted*)" FROM table_31807 WHERE "No. built (Converted*)" = '10' | wikisql |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id... | give me the number of patients whose insurance is medicare and days of hospital stay is greater than 13? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.insurance = "Medicare" AND demographic.days_stay > "13" | mimicsql_data |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE cost (
costid number,
uniquepi... | during yesterday, did patient 035-24054 have any output (ml)-nephrostomy left output? | SELECT COUNT(*) > 0 FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '035-24054')) AND intakeoutput.cellpath LIKE '%output%' AND intakeoutpu... | eicu |
CREATE TABLE table_name_61 (
career VARCHAR,
super_g VARCHAR,
combined VARCHAR
) | What Career has a Super G of 5, and a Combined of 6? | SELECT career FROM table_name_61 WHERE super_g = "5" AND combined = "6" | sql_create_context |
CREATE TABLE table_10128185_2 (
northern_ireland VARCHAR,
total VARCHAR
) | How many votes did Northern Ireland cast if the total was 35? | SELECT northern_ireland FROM table_10128185_2 WHERE total = 35 | sql_create_context |
CREATE TABLE table_12828723_5 (
lost VARCHAR
) | What was the lost with tries for? | SELECT lost FROM table_12828723_5 WHERE "tries_for" = "tries_for" | sql_create_context |
CREATE TABLE table_name_86 (
score VARCHAR,
team_1 VARCHAR
) | What is the 2nd round with a score of 3 - 3, and a team 1 fc gueugnon (d2)? | SELECT 2 AS nd_round FROM table_name_86 WHERE score = "3 - 3" AND team_1 = "fc gueugnon (d2)" | sql_create_context |
CREATE TABLE table_43612 (
"Game" real,
"Date" text,
"Opponent" text,
"Score" text,
"Location" text,
"Record" text
) | What is the record for the opponent the Cleveland Cavaliers? | SELECT "Record" FROM table_43612 WHERE "Opponent" = 'cleveland cavaliers' | wikisql |
CREATE TABLE table_name_73 (
team_2 VARCHAR
) | what is the 1st round when team 2 is usl dunkerque (d2)? | SELECT 1 AS st_round FROM table_name_73 WHERE team_2 = "usl dunkerque (d2)" | sql_create_context |
CREATE TABLE table_14920 (
"Station" text,
"Frequency" real,
"Network Affiliation" text,
"Format" text,
"City of License" text,
"Status" text
) | What is the largest frequency owned by multicultural broadcasting with a Format of vietnamese? | SELECT MAX("Frequency") FROM table_14920 WHERE "Status" = 'owned by multicultural broadcasting' AND "Format" = 'vietnamese' | wikisql |
CREATE TABLE table_79493 (
"Year" real,
"Game" text,
"Genre" text,
"Platform(s)" text,
"Developer(s)" text
) | What year is the Grim Fandango with a windows platform? | SELECT "Year" FROM table_79493 WHERE "Platform(s)" = 'windows' AND "Game" = 'grim fandango' | 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,
... | what is the number of patients whose ethnicity is black/african american and procedure short title is pericardiocentesis? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.ethnicity = "BLACK/AFRICAN AMERICAN" AND procedures.short_title = "Pericardiocentesis" | mimicsql_data |
CREATE TABLE COURSE (
CRS_CODE varchar(10),
DEPT_CODE varchar(10),
CRS_DESCRIPTION varchar(35),
CRS_CREDIT float(8)
)
CREATE TABLE EMPLOYEE (
EMP_NUM int,
EMP_LNAME varchar(15),
EMP_FNAME varchar(12),
EMP_INITIAL varchar(1),
EMP_JOBCODE varchar(5),
EMP_HIREDATE datetime,
EMP... | how many sections does each course has?, list by the Y in desc. | SELECT CRS_CODE, COUNT(*) FROM CLASS GROUP BY CRS_CODE ORDER BY COUNT(*) DESC | nvbench |
CREATE TABLE people (
People_ID int,
Name text,
Height real,
Weight real,
Date_of_Birth text
)
CREATE TABLE entrepreneur (
Entrepreneur_ID int,
People_ID int,
Company text,
Money_Requested real,
Investor text
) | How many companies each investor has invested? Show me a bar chart. | SELECT Investor, COUNT(Investor) FROM entrepreneur GROUP BY Investor | nvbench |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE cost (
r... | how many patients have been discharged from hospital until 2 years ago. | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE NOT admissions.dischtime IS NULL AND DATETIME(admissions.dischtime) <= DATETIME(CURRENT_TIME(), '-2 year') | mimic_iii |
CREATE TABLE hz_info (
KH text,
KLX number,
YLJGDM text,
RYBH text
)
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,... | 在2012年5月4日之后,3398509这个医疗机构的住院就诊记录中有多少入院登记 | SELECT COUNT(*) FROM zyjzjlb WHERE YLJGDM = '3398509' AND RYDJSJ > '2012-05-04' | css |
CREATE TABLE station (
id int,
network_name text,
services text,
local_authority text
)
CREATE TABLE weekly_weather (
station_id int,
day_of_week text,
high_temperature int,
low_temperature int,
precipitation real,
wind_speed_mph int
)
CREATE TABLE train (
id int,
train... | Group by services attribute in station table and compute the total number of services with a bar chart, order by the services in ascending. | SELECT services, COUNT(services) FROM station GROUP BY services ORDER BY services | nvbench |
CREATE TABLE table_40938 (
"Pilot" text,
"Original Airdate" text,
"Musical Guest/Song performed" text,
"YouTube Hero" text,
"MySpace Band" text
) | What is the Musical Guest/Song with an original airdate of january 2008? | SELECT "Musical Guest/Song performed" FROM table_40938 WHERE "Original Airdate" = 'january 2008' | 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... | what is the number of patients born before 2137 who are still alive? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.expire_flag = "0" AND demographic.dob_year < "2137" | mimicsql_data |
CREATE TABLE table_76361 (
"Date" text,
"Name of ship" text,
"Flag" text,
"Tonnage" real,
"Fate" text
) | What is the average tonnage of the ship named proletarij? | SELECT AVG("Tonnage") FROM table_76361 WHERE "Name of ship" = 'proletarij' | wikisql |
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 posses private insurance and are born before 2023? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.insurance = "Private" AND demographic.dob_year < "2023" | mimicsql_data |
CREATE TABLE table_name_35 (
rank VARCHAR,
wins VARCHAR,
player VARCHAR
) | What rank is Miller Barber with more than 11 wins? | SELECT rank FROM table_name_35 WHERE wins > 11 AND player = "miller barber" | sql_create_context |
CREATE TABLE table_name_6 (
country VARCHAR,
score VARCHAR
) | What country did the player who scored 73-73-65=211 come from? | SELECT country FROM table_name_6 WHERE score = 73 - 73 - 65 = 211 | sql_create_context |
CREATE TABLE table_53113 (
"Name" text,
"Actual version" text,
"System" text,
"Platform" text,
"License" text
) | Which System's Name is Gemulator? | SELECT "System" FROM table_53113 WHERE "Name" = 'gemulator' | wikisql |
CREATE TABLE table_name_63 (
draw INTEGER,
place VARCHAR,
points VARCHAR,
artist VARCHAR
) | What is the Draw number of the song by Artist of 'Loudest Whisper' with 68 or less Points with a place of 9 or larger? | SELECT AVG(draw) FROM table_name_63 WHERE points < 68 AND artist = "loudest whisper" AND place > 9 | sql_create_context |
CREATE TABLE table_name_45 (
player VARCHAR,
position VARCHAR,
team_from VARCHAR
) | Who is the player from Hotchkiss School with a position of d? | SELECT player FROM table_name_45 WHERE position = "d" AND team_from = "hotchkiss school" | sql_create_context |
CREATE TABLE course_tags_count (
course_id int,
clear_grading int,
pop_quiz int,
group_projects int,
inspirational int,
long_lectures int,
extra_credit int,
few_tests int,
good_feedback int,
tough_tests int,
heavy_papers int,
cares_for_students int,
heavy_assignments ... | What classes qualify me to declare a major in LATINOAM ? | SELECT DISTINCT course.department, course.name, course.number FROM course, program_course WHERE course.department LIKE '%LATINOAM%' AND program_course.category LIKE 'PreMajor' AND program_course.course_id = course.course_id | advising |
CREATE TABLE procedures_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_id number,
charttime time,
itemid number,
amount number
)
CREATE TABL... | compared to second measured on the first icu visit, is heart rate of patient 13897 greater than first measured on the first icu visit? | SELECT (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 = 13897) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime LIMIT 1) AND chartevents.item... | mimic_iii |
CREATE TABLE table_name_6 (
Id VARCHAR
) | What is the average 2007 value for a 2006 of 2.8 and 2009 under 20? | SELECT AVG(2007) FROM table_name_6 WHERE 2009 < 20 AND 2006 = 2.8 | sql_create_context |
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
last_wardid number,
intime time,
outtime time
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_... | what's the cost for a glucose, pleural laboratory test? | SELECT DISTINCT cost.cost FROM cost WHERE cost.event_type = 'labevents' AND cost.event_id IN (SELECT labevents.row_id FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'glucose, pleural')) | mimic_iii |
CREATE TABLE table_72719 (
"City/town" text,
"Municipality" text,
"County" text,
"City/town status" real,
"Population" real
) | What are the cities/towns located in the municipality of Moss? | SELECT "City/town" FROM table_72719 WHERE "Municipality" = 'Moss' | wikisql |
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,
... | 编号7874064的医疗机构天数超过26天的的住院人数提供一下 | SELECT COUNT(hz_info.RYBH) FROM hz_info JOIN wdmzjzjlb ON hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX WHERE wdmzjzjlb.YLJGDM = '7874064' AND DATEDIFF(wdmzjzjlb.CYSJ, wdmzjzjlb.RYSJ) > 26 UNION SELECT COUNT(hz_info.RYBH) FROM hz_info JOIN bdmzjzjlb ON hz_info.YLJGDM = ... | css |
CREATE TABLE table_name_31 (
opponent VARCHAR,
record VARCHAR
) | Which opponent has a Record of 4-5? | SELECT opponent FROM table_name_31 WHERE record = "4-5" | sql_create_context |
CREATE TABLE table_75582 (
"Name" text,
"Street address" text,
"Years as tallest" text,
"Height ft / m" text,
"Floors" real
) | What is the height of the building named 555 17th street? | SELECT "Height ft / m" FROM table_75582 WHERE "Name" = '555 17th street' | wikisql |
CREATE TABLE table_name_80 (
date VARCHAR,
time VARCHAR
) | Which Date has a Time of 12:00? | SELECT date FROM table_name_80 WHERE time = "12:00" | sql_create_context |
CREATE TABLE table_name_7 (
player VARCHAR,
school VARCHAR
) | what player went to ul-monroe | SELECT player FROM table_name_7 WHERE school = "ul-monroe" | sql_create_context |
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 d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE chart... | is the heart rate of patient 25300 last measured on the first icu visit less than second to last measured on the first icu visit. | SELECT (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 = 25300) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime LIMIT 1) AND chartevents.item... | mimic_iii |
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text varchar
)
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
CREATE ... | Do all senior level classes require exams ? | SELECT COUNT(*) = 0 FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE course.has_exams = 'N' AND program_course.category LIKE '%ULCS%' | advising |
CREATE TABLE table_name_38 (
giro_di_lombardia VARCHAR,
paris_roubaix VARCHAR
) | Which Giro di Lombardia has a Paris Roubaix of servais knaven ( ned )? | SELECT giro_di_lombardia FROM table_name_38 WHERE paris_roubaix = "servais knaven ( ned )" | sql_create_context |
CREATE TABLE table_name_75 (
name_of_the_song VARCHAR,
kind_of_the_song VARCHAR,
singer VARCHAR
) | Which song has a ending theme, and is sung by miriam yeung? | SELECT name_of_the_song FROM table_name_75 WHERE kind_of_the_song = "ending theme" AND singer = "miriam yeung" | sql_create_context |
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE gsi (
c... | Which are the courses required for the major but not in the CLIMATE department ? | SELECT DISTINCT course.department, course.name, course.number FROM course, program, program_course WHERE course.department <> 'CLIMATE' AND program_course.course_id = course.course_id AND program.program_id = program_course.program_id | advising |
CREATE TABLE ENROLL (
CLASS_CODE varchar(5),
STU_NUM int,
ENROLL_GRADE varchar(50)
)
CREATE TABLE DEPARTMENT (
DEPT_CODE varchar(10),
DEPT_NAME varchar(30),
SCHOOL_CODE varchar(8),
EMP_NUM int,
DEPT_ADDRESS varchar(20),
DEPT_EXTENSION varchar(4)
)
CREATE TABLE PROFESSOR (
EMP_N... | Give me a histogram for what is the number of professors for different school?, could you order in asc by the x axis? | SELECT SCHOOL_CODE, COUNT(*) FROM DEPARTMENT AS T1 JOIN PROFESSOR AS T2 ON T1.DEPT_CODE = T2.DEPT_CODE GROUP BY T1.SCHOOL_CODE ORDER BY SCHOOL_CODE | nvbench |
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,
... | 我想知道病人79373971在2004年4月25日到2019年4月28日内开出的所有检验报告单的科室编码以及名称都是哪些? | SELECT jybgb.KSBM, jybgb.KSMC 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 = '79373971' AND jybgb.BGRQ BETWEEN '2004-04-25... | css |
CREATE TABLE table_name_47 (
kaz_hayashi VARCHAR,
block_a VARCHAR
) | Name the kaz hayashi with block A of Shuji Kondo | SELECT kaz_hayashi FROM table_name_47 WHERE block_a = "shuji kondo" | sql_create_context |
CREATE TABLE table_name_74 (
auckland VARCHAR,
gold_coast VARCHAR,
melbourne VARCHAR,
sydney VARCHAR,
perth VARCHAR
) | yes or no for the auckland with a yes for sydney, no for perth, yes for melbourne and yes for the gold coast? | SELECT auckland FROM table_name_74 WHERE sydney = "yes" AND perth = "no" AND melbourne = "yes" AND gold_coast = "yes" | sql_create_context |
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,
MZBMLX number,
MZJZLSH text,
MZZDBM text,
MZZDMC text,
MZZYZDZZBM... | 患者沈鸿风的检测指标721371的情况,在16年7月25日到17年10月2日期间怎么样? | SELECT * FROM person_info JOIN hz_info JOIN wdmzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX AND wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jy... | css |
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
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,... | could you please give me the cost of a round trip flight from DENVER to PITTSBURGH | SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, flight, flight_fare WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'DENVER' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_... | atis |
CREATE TABLE t_kc22 (
AMOUNT number,
CHA_ITEM_LEV number,
DATA_ID text,
DIRE_TYPE number,
DOSE_FORM text,
DOSE_UNIT text,
EACH_DOSAGE text,
EXP_OCC_DATE time,
FLX_MED_ORG_ID text,
FXBZ number,
HOSP_DOC_CD text,
HOSP_DOC_NM text,
MED_CLINIC_ID text,
MED_DIRE_CD tex... | 在04年4月23日到10年10月25日内名叫马兴生的患者自费的金额比2352.85元高的药品量有多少? | SELECT COUNT(*) FROM qtb JOIN t_kc22 ON qtb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE qtb.PERSON_NM = '马兴生' AND t_kc22.STA_DATE BETWEEN '2004-04-23' AND '2010-10-25' AND t_kc22.SELF_PAY_AMO > 2352.85 UNION SELECT COUNT(*) FROM gyb JOIN t_kc22 ON gyb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gyb.PERSON_NM = '马兴生' AND ... | css |
CREATE TABLE table_22355_20 (
athlete VARCHAR,
nation VARCHAR,
rank VARCHAR
) | Who is the athlete from the nation of Ethiopia (eth) who had a rank bigger than 7.0? | SELECT athlete FROM table_22355_20 WHERE nation = "Ethiopia (ETH)" AND rank > 7.0 | sql_create_context |
CREATE TABLE employees (
employee_id number,
first_name text,
last_name text,
email text,
phone_number text,
hire_date time,
job_id text,
salary number,
commission_pct number,
manager_id number,
department_id number
)
CREATE TABLE regions (
region_id number,
region_n... | What are total salaries and department id for each department that has more than 2 employees? | SELECT department_id, SUM(salary) FROM employees GROUP BY department_id HAVING COUNT(*) >= 2 | spider |
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, show me about the distribution of hire_date and the sum of manager_id bin hire_date by weekday in a bar chart, and list in desc by the total number of manager id please. | SELECT HIRE_DATE, SUM(MANAGER_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY SUM(MANAGER_ID) DESC | nvbench |
CREATE TABLE table_76857 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Series" text
) | What is High Points, when High Rebounds is 'Dwight Howard (16)'? | SELECT "High points" FROM table_76857 WHERE "High rebounds" = 'dwight howard (16)' | wikisql |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
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,
... | 从02年6月25日至21年1月22日期间,病患鲁嘉歆被开出的所有检验报告单的检验报告单号都有哪些? | SELECT jybgb.BGDH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE person_info.XM = '鲁嘉歆' AND jybg... | css |
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
CREATE TABLE student_record (
student_id int,
course_id int,
semester int,
grade varchar,
how varchar,
transfer_source varchar,
earn_credit varchar,
repeat_term varchar,
test... | For upper level electives , which courses count ? | SELECT DISTINCT course.department, course.name, course.number FROM course, program_course WHERE program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id | advising |
CREATE TABLE table_22883210_7 (
location_attendance VARCHAR,
game VARCHAR
) | Where was game 41 held, and how many people attended? | SELECT location_attendance FROM table_22883210_7 WHERE game = 41 | sql_create_context |
CREATE TABLE table_53832 (
"Year" text,
"Winner" text,
"Jockey" text,
"Trainer" text,
"Owner" text,
"Distance" text,
"Time" text,
"Purse" text
) | Who was the owner in 1996 of trainer Nick Zito? | SELECT "Owner" FROM table_53832 WHERE "Trainer" = 'nick zito' AND "Year" = '1996' | wikisql |
CREATE TABLE table_train_259 (
"id" int,
"systolic_blood_pressure_sbp" int,
"hiv_infection" bool,
"hemoglobin_a1c_hba1c" float,
"hearing_problem" bool,
"heart_disease" bool,
"high_blood_pressure" bool,
"diabetic" string,
"immune_deficiency_disorder" bool,
"visual_impairment" bool... | uncontrolled high blood pressure ( >= 140 / 90 mmhg ) | SELECT * FROM table_train_259 WHERE high_blood_pressure = 1 OR systolic_blood_pressure_sbp > 140 OR diastolic_blood_pressure_dbp > 90 | criteria2sql |
CREATE TABLE table_58247 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" text,
"Record" text
) | What's the Loss listed with a Score of 5-1? | SELECT "Loss" FROM table_58247 WHERE "Score" = '5-1' | 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 procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
... | what is the number of patients whose age is less than 77 and drug code is nabc50i? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "77" AND prescriptions.formulary_drug_cd = "NABC50I" | mimicsql_data |
CREATE TABLE table_68043 (
"School" text,
"Team" text,
"Division Record" text,
"Overall Record" text,
"Season Outcome" text
) | What is the Panthers' Division Record? | SELECT "Division Record" FROM table_68043 WHERE "Team" = 'panthers' | wikisql |
CREATE TABLE table_11877 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" real,
"Record" text
) | What was the loss for the game on July 1 with an attendance more than 35,621? | SELECT "Loss" FROM table_11877 WHERE "Attendance" > '35,621' AND "Date" = 'july 1' | wikisql |
CREATE TABLE Apartment_Bookings (
booking_start_date VARCHAR,
apt_id VARCHAR
)
CREATE TABLE Apartments (
apt_number VARCHAR,
apt_id VARCHAR
) | Show the apartment numbers, start dates, and end dates of all the apartment bookings. | SELECT T2.apt_number, T1.booking_start_date, T1.booking_start_date FROM Apartment_Bookings AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id | sql_create_context |
CREATE TABLE table_18979 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | Who had the high rebounds at the delta center? | SELECT "High rebounds" FROM table_18979 WHERE "Location Attendance" = 'Delta Center' | wikisql |
CREATE TABLE table_72423 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
) | Who ran in the election where Claude Fuller was the incumbent? | SELECT "Candidates" FROM table_72423 WHERE "Incumbent" = 'Claude Fuller' | wikisql |
CREATE TABLE wdmzjzjlb (
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... | 2007-01-04到2020-10-03期间,2301260这个医疗机构处理了多少次新生儿门诊 | SELECT COUNT(*) FROM wdmzjzjlb WHERE wdmzjzjlb.YLJGDM = '2301260' AND wdmzjzjlb.JZKSRQ BETWEEN '2007-01-04' AND '2020-10-03' AND wdmzjzjlb.ZSEBZ > 0 UNION SELECT COUNT(*) FROM bdmzjzjlb WHERE bdmzjzjlb.YLJGDM = '2301260' AND bdmzjzjlb.JZKSRQ BETWEEN '2007-01-04' AND '2020-10-03' AND bdmzjzjlb.ZSEBZ > 0 | css |
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
CREA... | Detect posts misusing backticks for programming languages. | SELECT Id AS "post_link" FROM Posts WHERE Posts.Id > '##StartID:int?1##' AND Posts.Id < '##EndID:int?1000000##' AND (Body LIKE '%<code>PHP</code>%' OR Body LIKE '%<code>javascript</code>%' OR Body LIKE '%<code>C#</code>%' OR Body LIKE '%<code>python</code>%' OR Body LIKE '%<code>java</code>%' OR Body LIKE '%<code>C</co... | sede |
CREATE TABLE t_kc24 (
ACCOUNT_DASH_DATE time,
ACCOUNT_DASH_FLG number,
CASH_PAY number,
CIVIL_SUBSIDY number,
CKC102 number,
CLINIC_ID text,
CLINIC_SLT_DATE time,
COMP_ID text,
COM_ACC_PAY number,
COM_PAY number,
DATA_ID text,
ENT_ACC_PAY number,
ENT_PAY number,
F... | 统筹基金支出在医疗就诊30482936497中占医疗费总额百分之几? | SELECT (SELECT t_kc24.OVE_PAY FROM t_kc24 JOIN t_kc21_t_kc24 JOIN t_kc21 ON t_kc21_t_kc24.MED_SAFE_PAY_ID = t_kc24.MED_SAFE_PAY_ID AND t_kc21_t_kc24.MED_CLINIC_ID = t_kc21.MED_CLINIC_ID WHERE t_kc21.MED_CLINIC_ID = '30482936497') / (SELECT t_kc24.MED_AMOUT FROM t_kc24 WHERE t_kc21_t_kc24.MED_CLINIC_ID = '30482936497') | css |
CREATE TABLE table_14981555_3 (
result VARCHAR,
venue VARCHAR
) | In Ascot (UK), what was the result? | SELECT result FROM table_14981555_3 WHERE venue = "Ascot (UK)" | sql_create_context |
CREATE TABLE table_name_80 (
constructor VARCHAR,
grid VARCHAR,
time_retired VARCHAR
) | Who built the 21 grid car that retired due to suspension? | SELECT constructor FROM table_name_80 WHERE grid > 21 AND time_retired = "suspension" | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.