context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_name_81 (
centerfold_model VARCHAR,
cover_model VARCHAR
) | Which Centerfold model has a Cover model of irina voronina? | SELECT centerfold_model FROM table_name_81 WHERE cover_model = "irina voronina" | sql_create_context |
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number... | Stat language trends over time by month. | SELECT tmp.yearmon AS YEARMON, tmp.TagName AS TAGNAME, COUNT(*) AS COUNT FROM (SELECT DATE(CAST(TIME_TO_STR(CreationDate, '%Y') AS TEXT) + '-' + CAST(TIME_TO_STR(CreationDate, '%m') AS TEXT) + '-01') AS yearmon, t.TagName AS tagname FROM Posts AS p JOIN PostTags AS pt ON pt.PostId = p.Id JOIN Tags AS t ON t.Id = pt.Tag... | sede |
CREATE TABLE table_28640 (
"Rank" real,
"Couple" text,
"Judges" real,
"Public" real,
"Total" real,
"Vote percentage" text,
"Result" text
) | How many times was the vote percentage 15.0%? | SELECT COUNT("Total") FROM table_28640 WHERE "Vote percentage" = '15.0%' | wikisql |
CREATE TABLE table_203_114 (
id number,
"week" number,
"date" text,
"tv time" text,
"opponent" text,
"result" text,
"game site" text,
"record" text,
"attendance" number,
"bye" text
) | which week -lrb- s -rrb- did not have more than 75,000 in attendance ? | SELECT "week" FROM table_203_114 WHERE "attendance" <= 75000 | squall |
CREATE TABLE t_kc21 (
CLINIC_ID text,
CLINIC_TYPE 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,
... | 参保人水建茗10元以内小金额结算次数有多少,时间是在13年3月5日到16年1月7日内 | SELECT COUNT(*) FROM t_kc21 JOIN t_kc24 JOIN t_kc21_t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc24.MED_CLINIC_ID AND t_kc21_t_kc24.MED_SAFE_PAY_ID = t_kc24.MED_SAFE_PAY_ID WHERE t_kc21.PERSON_NM = '水建茗' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2013-03-05' AND '2016-01-07' AND t_kc24.MED_AMOUT <= 10 | css |
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,
... | count the number of patients whose year of death is less than or equal to 2133 and item id is 51384? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dod_year <= "2133.0" AND lab.itemid = "51384" | mimicsql_data |
CREATE TABLE table_name_77 (
country VARCHAR,
player VARCHAR
) | What country was Jay Haas representing? | SELECT country FROM table_name_77 WHERE player = "jay haas" | sql_create_context |
CREATE TABLE table_13015 (
"County" text,
"Per capita income" text,
"Median household income" text,
"Median family income" text,
"Population" real,
"Number of households" real
) | Which County has a Number of households larger than 17,741, and a Median family income of $37,072? | SELECT "County" FROM table_13015 WHERE "Number of households" > '17,741' AND "Median family income" = '$37,072' | wikisql |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE treatment (
treatmentid number... | when is the last time that patient 006-113829 has been prescribed calcium carbonate antacid 500 mg po chew and potassium chloride er at the same time in 06/2103? | SELECT t1.drugstarttime FROM (SELECT patient.uniquepid, medication.drugstarttime FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE medication.drugname = 'calcium carbonate antacid 500 mg po chew' AND patient.uniquepid = '006-113829' AND STRFTIME('%y-%m', medication.drugstart... | eicu |
CREATE TABLE table_18120 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Results" text,
"Candidates" text
) | who are the candidates when the incumbent is lindsey graham? | SELECT "Candidates" FROM table_18120 WHERE "Incumbent" = 'Lindsey Graham' | wikisql |
CREATE TABLE table_19948664_1 (
countries_sampled INTEGER,
index__year_ VARCHAR
) | How many countries were sampled for the Prosperity Index (2008)? | SELECT MAX(countries_sampled) FROM table_19948664_1 WHERE index__year_ = "Prosperity Index (2008)" | sql_create_context |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
... | how many married patients have diagnoses icd9 code 59080? | 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.icd9_code = "59080" | mimicsql_data |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
... | what is the number of patients whose primary disease is coronary artery disease\coronary artery bypass graft /sda and year of birth is less than 2071? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "CORONARY ARTERY DISEASE\CORONARY ARTERY BYPASS GRAFT /SDA" AND demographic.dob_year < "2071" | mimicsql_data |
CREATE TABLE table_14132239_3 (
offensive VARCHAR,
overall VARCHAR
) | Who was the offensive award winner the week when Bob Watson was given the overall award? | SELECT offensive FROM table_14132239_3 WHERE overall = "Bob Watson" | sql_create_context |
CREATE TABLE table_56182 (
"NGC number" real,
"Object type" text,
"Constellation" text,
"Right ascension ( J2000 )" text,
"Declination ( J2000 )" text,
"Apparent magnitude" real
) | What is the least apparent magnitude for all constellations from hydra? | SELECT MIN("Apparent magnitude") FROM table_56182 WHERE "Constellation" = 'hydra' | 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 demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob te... | count the number of patients whose discharge location is short term hospital and age is less than 67? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = "SHORT TERM HOSPITAL" AND demographic.age < "67" | mimicsql_data |
CREATE TABLE table_7827 (
"Country" text,
"2010" real,
"2011" real,
"2012" real,
"2013" real
) | What is the sum of participants in 2013 for Russia when there were 5 in 2010 and less than 4 in 2012? | SELECT SUM("2013") FROM table_7827 WHERE "2010" = '5' AND "Country" = 'russia' AND "2012" < '4' | wikisql |
CREATE TABLE table_65789 (
"Rank" real,
"Summit" text,
"Country" text,
"Island" text,
"Col (m)" real
) | What's the lowest Col ranked less than 6 with an Island of Moloka i? | SELECT MIN("Col (m)") FROM table_65789 WHERE "Island" = 'island of molokaʻi' AND "Rank" < '6' | wikisql |
CREATE TABLE table_22916979_5 (
_places VARCHAR,
principal_city VARCHAR
) | Name the least 10,000+ places for louisville | SELECT MIN(10), 000 + _places FROM table_22916979_5 WHERE principal_city = "Louisville" | sql_create_context |
CREATE TABLE table_66031 (
"Pick" real,
"Player" text,
"Country of origin*" text,
"PBA team" text,
"College" text
) | What is the Country of origin of PIck 6? | SELECT "Country of origin*" FROM table_66031 WHERE "Pick" = '6' | wikisql |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number... | when was the last time patient 016-9636 today had per iv flush: antecubital l 20 gauge intake? | 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 = '016-9636')) AND intakeoutput.cellpath LIKE '%intake%'... | eicu |
CREATE TABLE table_dev_55 (
"id" int,
"gender" string,
"serum_potassium_abnormality" float,
"hemoglobin_a1c_hba1c" float,
"body_weight" float,
"renal_disease" bool,
"serum_creatinine" float,
"body_mass_index_bmi" float,
"NOUSE" float
) | body mass index ( bmi ) of 18.5 to 45 kg / m2; and a total body weight > 50 kg ( 110 lbs ) . | SELECT * FROM table_dev_55 WHERE body_mass_index_bmi >= 18.5 AND body_mass_index_bmi <= 45 AND body_weight > 50 | criteria2sql |
CREATE TABLE table_name_65 (
height__cm_ VARCHAR,
birthdate VARCHAR
) | What is the total height of the player with a birthdate on September 2, 1973? | SELECT COUNT(height__cm_) FROM table_name_65 WHERE birthdate = "september 2, 1973" | sql_create_context |
CREATE TABLE table_name_5 (
population VARCHAR,
former_local_authority VARCHAR,
name VARCHAR
) | What is the population of the Parish, Plumbland, that had a former local authority of Cockermouth Rural District? | SELECT COUNT(population) FROM table_name_5 WHERE former_local_authority = "cockermouth rural district" AND name = "plumbland" | sql_create_context |
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
AboutMe text,
Views number,
UpVotes number,
DownVotes number,
ProfileImageUrl text,
EmailHash text,
AccountId number
)
CRE... | Top Perl users from India. | WITH USER_BY_TAG AS (SELECT ROW_NUMBER() OVER (ORDER BY COUNT(*) DESC) AS Rank, u.Id AS "user_link", COUNT(*) AS UpVotes FROM Tags AS t INNER JOIN PostTags AS pt ON pt.TagId = t.Id INNER JOIN Posts AS p ON p.ParentId = pt.PostId INNER JOIN Votes AS v ON v.PostId = p.Id AND VoteTypeId = 2 INNER JOIN Users AS u ON u.Id =... | sede |
CREATE TABLE table_name_25 (
score VARCHAR,
opponents_in_the_final VARCHAR
) | What is the Score of an Opponent\ in the final of jordi arrese lex corretja? | SELECT score FROM table_name_25 WHERE opponents_in_the_final = "jordi arrese àlex corretja" | sql_create_context |
CREATE TABLE table_52 (
"Year" real,
"Aircraft kilometers" real,
"Departures" real,
"Flying hours" real,
"Passengers" real,
"Seat factor" text,
"Employees" real,
"Profit/loss" text
) | How many hours were flown in each of the years where more than 64379058.0 kilometers were flown? | SELECT "Flying hours" FROM table_52 WHERE "Aircraft kilometers" > '64379058.0' | wikisql |
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate tim... | Answer counts for questions where accepted answer is not top-voted. | WITH TopAnswerScore AS (SELECT q.Id AS question, MAX(a.Score) AS topscore FROM Posts AS q INNER JOIN Posts AS a ON a.ParentId = q.Id GROUP BY q.Id) SELECT COALESCE(p.AnswerCount, 0), COUNT(*) AS N FROM Posts AS p INNER JOIN TopAnswerScore ON question = p.Id WHERE EXISTS(SELECT a.Id FROM Posts AS a WHERE a.Id = p.Accept... | sede |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE p... | did patient 006-36108 suffer from any type of allergy in the last month? | SELECT COUNT(*) > 0 FROM allergy WHERE allergy.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-36108')) AND DATETIME(allergy.allergytime, 'start of month') = DATETIME(CURR... | eicu |
CREATE TABLE table_30296 (
"Vessel" text,
"Built" real,
"Max Speed" text,
"Length" text,
"Breadth" text,
"Flag" text,
"Propulsion" text
) | How many breadth entries are there when propulsion is jet? | SELECT COUNT("Breadth") FROM table_30296 WHERE "Propulsion" = 'Jet' | wikisql |
CREATE TABLE table_name_77 (
current_version VARCHAR,
license VARCHAR
) | what is the current version with license gpl v3? | SELECT current_version FROM table_name_77 WHERE license = "gpl v3" | sql_create_context |
CREATE TABLE table_74947 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Record" text,
"Game Site" text,
"TV Time" text,
"Attendance" text
) | What's the Opponent with a Week that's larger than 16? | SELECT "Opponent" FROM table_74947 WHERE "Week" > '16' | wikisql |
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit ... | what is the yearly minimum amount of platelet count of patient 88441? | SELECT MIN(labevents.valuenum) FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 88441) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'platelet count') GROUP BY STRFTIME('%y', labevents.charttime) | mimic_iii |
CREATE TABLE table_76649 (
"Rider" text,
"Manufacturer" text,
"Laps" text,
"Time/Retired" text,
"Grid" text
) | Which rider had a time/retired od +19.909? | SELECT "Rider" FROM table_76649 WHERE "Time/Retired" = '+19.909' | wikisql |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE medication (
medicationid n... | what are the methods of consumption of potassium chloride 20 meq/50 ml iv piggy back 50 ml bag? | SELECT DISTINCT medication.routeadmin FROM medication WHERE medication.drugname = 'potassium chloride 20 meq/50 ml iv piggy back 50 ml bag' | eicu |
CREATE TABLE table_name_98 (
school_club_team VARCHAR,
position VARCHAR,
years_for_grizzlies VARCHAR
) | What is the team that has a shooting guard that played for the Grizzlies in 2000-2001? | SELECT school_club_team FROM table_name_98 WHERE position = "shooting guard" AND years_for_grizzlies = "2000-2001" | sql_create_context |
CREATE TABLE table_38421 (
"Games" real,
"Drawn" real,
"Lost" real,
"Points difference" text,
"Points" real
) | How many Games have a Drawn larger than 0, and a Lost of 1? | SELECT COUNT("Games") FROM table_38421 WHERE "Drawn" > '0' AND "Lost" = '1' | wikisql |
CREATE TABLE table_train_276 (
"id" int,
"hbv" bool,
"systolic_blood_pressure_sbp" int,
"hiv_infection" bool,
"hcv" bool,
"diastolic_blood_pressure_dbp" int,
"body_mass_index_bmi" float,
"hypertension" bool,
"NOUSE" float
) | blood pressure ( measured after the participant is sitting / resting quietly for 5 minutes ) between 90 and 140 millimeter of mercury ( mmhg ) systolic | SELECT * FROM table_train_276 WHERE systolic_blood_pressure_sbp >= 90 AND systolic_blood_pressure_sbp <= 140 | criteria2sql |
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationDate time,
ApprovalDate time,
RejectionDate time,
OwnerUserId number,
Comment text,
Text text,
Tit... | Find all posts with only the 'theology' tag. | SELECT Id, Title, Tags FROM Posts AS "post_link" WHERE NOT Title IS NULL AND Tags = '<theology>' | sede |
CREATE TABLE college (
cname text,
state text,
enr number
)
CREATE TABLE tryout (
pid number,
cname text,
ppos text,
decision text
)
CREATE TABLE player (
pid number,
pname text,
ycard text,
hs number
) | What is the average, maximum, and minimum for the number of hours spent training? | SELECT AVG(hs), MAX(hs), MIN(hs) FROM player | spider |
CREATE TABLE table_20090682_4 (
driver VARCHAR,
vehicle VARCHAR
) | how many drivers driving toyota corolla | SELECT COUNT(driver) FROM table_20090682_4 WHERE vehicle = "Toyota Corolla" | sql_create_context |
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
AboutMe text,
Views number,
UpVotes number,
DownVotes number,
ProfileImageUrl text,
EmailHash text,
AccountId number
)
CRE... | Got most rep by negatively scored questions. | WITH Raw AS (SELECT Posts.Id AS PostId, MIN(Posts.OwnerUserId) AS UserId, SUM(34 - 12 * Votes.VoteTypeId) AS QRep FROM Posts, Votes WHERE Posts.Id = Votes.PostId AND Votes.VoteTypeId BETWEEN 2 AND 3 AND Posts.PostTypeId = 1 AND Posts.Score < 0 AND Posts.OwnerUserId > 0 GROUP BY Posts.Id) SELECT UserId AS "user_link", U... | sede |
CREATE TABLE table_23235767_1 (
score_in_the_final VARCHAR,
opponent_in_the_final VARCHAR,
championship VARCHAR
) | What is every score in the final for opponent in final John Mcenroe at US Open? | SELECT score_in_the_final FROM table_23235767_1 WHERE opponent_in_the_final = "John McEnroe" AND championship = "US Open" | sql_create_context |
CREATE TABLE table_name_25 (
to_par VARCHAR,
score VARCHAR
) | What is the To par of the Player with a Score of 71-74-72-72=289? | SELECT to_par FROM table_name_25 WHERE score = 71 - 74 - 72 - 72 = 289 | 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 prescriptions... | give me the number of patients whose language is cape and admission location is clinic referral/premature? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.language = "CAPE" AND demographic.admission_location = "CLINIC REFERRAL/PREMATURE" | mimicsql_data |
CREATE TABLE table_6859 (
"Couple" text,
"Style" text,
"Music" text,
"Choreographer(s)" text,
"Chosen by" text
) | What is Choreographer(s), when Chosen By is Mary Murphy, and when Couple is Katee Shean Stephen 'Twitch' Boss? | SELECT "Choreographer(s)" FROM table_6859 WHERE "Chosen by" = 'mary murphy' AND "Couple" = 'katee shean stephen "twitch" boss' | wikisql |
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,0)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25... | For all employees who have the letters D or S in their first name, what is the relationship between employee_id and salary ? | SELECT EMPLOYEE_ID, SALARY FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' | nvbench |
CREATE TABLE table_77796 (
"Player" text,
"Club" text,
"League" real,
"Play-offs" real,
"FA Cup" real,
"FA Trophy" real,
"Total" real
) | Which mean total had Tim Sills as a player? | SELECT AVG("Total") FROM table_77796 WHERE "Player" = 'tim sills' | wikisql |
CREATE TABLE table_29163303_1 (
surface VARCHAR,
championship VARCHAR
) | On what surface was the Australian Open (6) played on? | SELECT surface FROM table_29163303_1 WHERE championship = "Australian Open (6)" | sql_create_context |
CREATE TABLE table_35024 (
"Game" real,
"March" real,
"Opponent" text,
"Score" text,
"Record" text,
"Points" real
) | Record of 44 18 8 involves which score? | SELECT "Score" FROM table_35024 WHERE "Record" = '44–18–8' | wikisql |
CREATE TABLE table_22568 (
"Position" real,
"Team" text,
"Played" real,
"Wins" real,
"Draws P.K. Wins / P.K. Losses" text,
"Losses" real,
"Scored" real,
"Conceded" real,
"Points" real
) | How many wins? | SELECT MAX("Wins") FROM table_22568 | wikisql |
CREATE TABLE table_name_5 (
season INTEGER,
level INTEGER
) | Tell me the least season with level less than 1 | SELECT MIN(season) FROM table_name_5 WHERE level < 1 | sql_create_context |
CREATE TABLE gwyjzb (
CLINIC_ID text,
CLINIC_TYPE 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,
... | 列出所有医疗就诊记录的统筹基金支出与医疗费总额在医院0109582中的平均比值是多大,在不同科室名称下? | SELECT gwyjzb.MED_ORG_DEPT_NM, AVG(t_kc24.OVE_PAY) FROM gwyjzb JOIN t_kc24 ON gwyjzb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE gwyjzb.MED_SER_ORG_NO = '0109582' GROUP BY gwyjzb.MED_ORG_DEPT_NM UNION SELECT fgwyjzb.MED_ORG_DEPT_NM, AVG(t_kc24.OVE_PAY) FROM fgwyjzb JOIN t_kc24 ON fgwyjzb.MED_CLINIC_ID = t_kc24.MED_CLINI... | css |
CREATE TABLE table_48412 (
"Name" text,
"Gain" real,
"Loss" real,
"Long" real,
"Avg/g" real
) | Can you tell me the sum of Gain that has the Name of kass, rob, and the Avg/g smaller than 1.9? | SELECT SUM("Gain") FROM table_48412 WHERE "Name" = 'kass, rob' AND "Avg/g" < '1.9' | wikisql |
CREATE TABLE table_15621965_17 (
years_in_orlando VARCHAR,
player VARCHAR
) | List all years in Orlando where Jeryl Sasser was a player. | SELECT years_in_orlando FROM table_15621965_17 WHERE player = "Jeryl Sasser" | sql_create_context |
CREATE TABLE table_43614 (
"Name" text,
"Team" text,
"Qual 1" text,
"Qual 2" text,
"Best" text
) | What was the second qualification time with a first qualification time of 1:02.813? | SELECT "Qual 2" FROM table_43614 WHERE "Qual 1" = '1:02.813' | wikisql |
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE student (
student_id int,
lastname varchar,
firstname varchar,
program_id int,
... | What are the classes that Dr. Patrick Seitzer has taught ? | SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, instructor, offering_instructor WHERE course_offering.semester < (SELECT SEMESTERalias0.semester_id FROM semester AS SEMESTERalias0 WHERE SEMESTERalias0.semester = 'WN' AND SEMESTERalias0.year = 2016) AND course.course_id = cour... | advising |
CREATE TABLE table_28038 (
"Player" text,
"Position" text,
"Starter" text,
"Touchdowns" real,
"Extra points" real,
"Field goals" real,
"Points" real
) | Was Magoffin a starting player? | SELECT "Starter" FROM table_28038 WHERE "Player" = 'Magoffin' | wikisql |
CREATE TABLE table_57993 (
"Player" text,
"Car." real,
"Yards" real,
"Avg." real,
"TD's" real,
"Long" real
) | How many TDs for the player averaging over 7, and over 39 yards? | SELECT MIN("TD's") FROM table_57993 WHERE "Avg." > '7' AND "Yards" > '39' | wikisql |
CREATE TABLE table_21040 (
"Poll Source" text,
"Dates administered" text,
"Democrat: Vivian Davis Figures" text,
"Republican: Jeff Sessions" text,
"Lead Margin" real
) | On June 30, 2008 who what was the Republican: Jeff Sessions percentage? | SELECT "Republican: Jeff Sessions" FROM table_21040 WHERE "Dates administered" = 'June 30, 2008' | wikisql |
CREATE TABLE table_name_34 (
class VARCHAR,
year_made VARCHAR
) | Which class was made in 1880? | SELECT class FROM table_name_34 WHERE year_made = "1880" | sql_create_context |
CREATE TABLE table_59310 (
"Round" real,
"Player" text,
"Position" text,
"Nationality" text,
"College/junior/club team (league)" text
) | What college did Louis LeBlanc attend? | SELECT "College/junior/club team (league)" FROM table_59310 WHERE "Player" = 'louis leblanc' | wikisql |
CREATE TABLE table_37055 (
"Position" real,
"Driver" text,
"Wins" real,
"Poles" real,
"Top 5's" real,
"Points" real
) | How many wins are associated with a position of under 6, over 8 top 5s, and 1793 points? | SELECT SUM("Wins") FROM table_37055 WHERE "Position" < '6' AND "Top 5's" = '8' AND "Points" = '1793' | wikisql |
CREATE TABLE technician (
technician_id real,
Name text,
Team text,
Starting_Year real,
Age int
)
CREATE TABLE repair_assignment (
technician_id int,
repair_ID int,
Machine_ID int
)
CREATE TABLE machine (
Machine_ID int,
Making_Year int,
Class text,
Team text,
Machi... | What are the names of the technicians that are assigned to repair machines with more point values than 70, and count them by a bar chart, and sort in ascending by the x-axis. | SELECT Name, COUNT(Name) FROM repair_assignment AS T1 JOIN machine AS T2 ON T1.Machine_ID = T2.Machine_ID JOIN technician AS T3 ON T1.technician_id = T3.technician_id WHERE T2.value_points > 70 GROUP BY Name ORDER BY Name | nvbench |
CREATE TABLE table_10150 (
"Player" text,
"Span" text,
"Start" real,
"Tries" real,
"Conv" real,
"Pens" real,
"Drop" real
) | What is the largest start for a player with 14 conv, 10 tries and more than 22 pens? | SELECT MAX("Start") FROM table_10150 WHERE "Conv" = '14' AND "Tries" = '10' AND "Pens" > '22' | wikisql |
CREATE TABLE participants (
participant_id number,
participant_type_code text,
participant_details text
)
CREATE TABLE participants_in_events (
event_id number,
participant_id number
)
CREATE TABLE events (
event_id number,
service_id number,
event_details text
)
CREATE TABLE services... | What are the ids and details of events that have more than one participants? | SELECT T1.event_id, T1.event_details FROM events AS T1 JOIN participants_in_events AS T2 ON T1.event_id = T2.event_id GROUP BY T1.event_id HAVING COUNT(*) > 1 | spider |
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 procedures_icd (
row_id number,
subject_id number,
... | what was the first time that patient 5828 had an intake in a day before? | SELECT inputevents_cv.charttime FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 5828)) AND DATETIME(inputevents_cv.charttime, 'start of day') = DATETIME(CURRENT_TIME(), 'st... | mimic_iii |
CREATE TABLE table_7917 (
"Rank" real,
"Company" text,
"Headquarters" text,
"Industry" text,
"Sales (billion $)" real,
"Profits (billion $)" real,
"Assets (billion $)" real,
"Market Value (billion $)" real
) | What is the lowest profits (billion $) for the rank 6? | SELECT MIN("Profits (billion $)") FROM table_7917 WHERE "Rank" = '6' | wikisql |
CREATE TABLE table_1305 (
"Date" text,
"Cover model" text,
"Centerfold model" text,
"Interview subject" text,
"20 Questions" text,
"Pictorials" text
) | Who were the cover models in the edition that included Benicio Del Toro as the interview subject? | SELECT "Cover model" FROM table_1305 WHERE "Interview subject" = 'Benicio del Toro' | wikisql |
CREATE TABLE table_name_21 (
catalog VARCHAR,
date VARCHAR
) | What Catalog came out on August 20, 1965? | SELECT catalog FROM table_name_21 WHERE date = "august 20, 1965" | sql_create_context |
CREATE TABLE table_name_2 (
type VARCHAR,
title VARCHAR
) | What is the type of the king title? | SELECT type FROM table_name_2 WHERE title = "king" | sql_create_context |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime... | what is the number of patients who were discharged from the hospital until 2103? | SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE NOT patient.hospitaldischargetime IS NULL AND STRFTIME('%y', patient.hospitaldischargetime) <= '2103' | eicu |
CREATE TABLE table_58280 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What date has a Crowd larger than 12,000, and an Away team score of 9.16 (70)? | SELECT "Date" FROM table_58280 WHERE "Crowd" > '12,000' AND "Away team score" = '9.16 (70)' | wikisql |
CREATE TABLE media_types (
id INTEGER,
name VARCHAR(120)
)
CREATE TABLE tracks (
id INTEGER,
name VARCHAR(200),
album_id INTEGER,
media_type_id INTEGER,
genre_id INTEGER,
composer VARCHAR(220),
milliseconds INTEGER,
bytes INTEGER,
unit_price NUMERIC(10,2)
)
CREATE TABLE pla... | Show me a bar chart for how many invoices were billed from each state?, could you sort Y-axis in asc order? | SELECT billing_state, COUNT(*) FROM invoices WHERE billing_country = "USA" GROUP BY billing_state ORDER BY COUNT(*) | nvbench |
CREATE TABLE table_name_56 (
result VARCHAR,
opponent VARCHAR
) | What was the result when the opponent was Arsenal? | SELECT result FROM table_name_56 WHERE opponent = "arsenal" | sql_create_context |
CREATE TABLE table_2665085_1 (
length__ft_ VARCHAR,
park VARCHAR
) | How long is the rollar coaster on Kemah Boardwalk | SELECT length__ft_ FROM table_2665085_1 WHERE park = "Kemah Boardwalk" | sql_create_context |
CREATE TABLE table_name_19 (
round VARCHAR,
year INTEGER
) | What is the round for a year earlier than 1987? | SELECT round FROM table_name_19 WHERE year < 1987 | sql_create_context |
CREATE TABLE market (
Market_ID int,
District text,
Num_of_employees int,
Num_of_shops real,
Ranking int
)
CREATE TABLE phone_market (
Market_ID int,
Phone_ID text,
Num_of_stock int
)
CREATE TABLE phone (
Name text,
Phone_ID int,
Memory_in_G int,
Carrier text,
Price... | A bar chart about what are the memories and carriers of phones?, and display by the bars from high to low. | SELECT Carrier, SUM(Memory_in_G) FROM phone GROUP BY Carrier ORDER BY Carrier DESC | nvbench |
CREATE TABLE table_34923 (
"Team" text,
"Driver" text,
"Laps" real,
"Time" text,
"Grid" real
) | What is name of the drive with a Time of +13.315? | SELECT "Driver" FROM table_34923 WHERE "Time" = '+13.315' | wikisql |
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 is the name of the insurance in patient 57050 on this hospital encounter? | SELECT admissions.insurance FROM admissions WHERE admissions.subject_id = 57050 AND admissions.dischtime IS NULL | mimic_iii |
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
Crea... | Users with their own Bronze Tag Badges. | SELECT B.Name, B.UserId AS "user_link" FROM Badges AS B WHERE Class = 3 AND TagBased = 1 AND (SELECT COUNT(B2.Name) FROM Badges AS B2 WHERE B2.Name = B.Name AND B2.Class = 3 AND B2.TagBased = 1) = 1 GROUP BY B.Name, B.UserId ORDER BY B.Name | sede |
CREATE TABLE table_203_364 (
id number,
"year" number,
"driver" text,
"nation of citizenship" text,
"racing series" text,
"type of vehicle" text
) | how many total row entries are there ? | SELECT COUNT(*) FROM table_203_364 | squall |
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,
... | find the female patients who have procedure icd9 code 3727. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.gender = "F" AND procedures.icd9_code = "3727" | mimicsql_data |
CREATE TABLE event (
ID int,
Name text,
Stadium_ID int,
Year text
)
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... | Give me the comparison about ID over the meter_400 by a bar chart, could you sort x axis in ascending order? | SELECT meter_400, ID FROM swimmer ORDER BY meter_400 | nvbench |
CREATE TABLE ta (
campus_job_id int,
student_id int,
location 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,
instructor_id int
)
CR... | For the courses in computing infrastructure who are the teachers ? | SELECT DISTINCT instructor.name FROM instructor INNER JOIN offering_instructor ON offering_instructor.instructor_id = instructor.instructor_id INNER JOIN course_offering ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN area ON course_offering.course_id = area.course_id WHERE area.area LIKE '%... | advising |
CREATE TABLE table_name_81 (
object_type VARCHAR,
ngc_number VARCHAR,
right_ascension___j2000__ VARCHAR
) | What Object Type has a 21h01m37.7s Right Ascension (J2000) and 6995 or greater NGC? | SELECT object_type FROM table_name_81 WHERE ngc_number > 6995 AND right_ascension___j2000__ = "21h01m37.7s" | sql_create_context |
CREATE TABLE table_35808 (
"Year" real,
"Dates" text,
"Venue" text,
"Champion" text,
"Country" text,
"Score" real,
"To par" text,
"Margin of victory" text,
"Runner(s)-up" text,
"Purse ( $ )" real,
"Winner's share ($)" real
) | What year was the margin of victory 9 strokes and the purse under $2,750,000? | SELECT AVG("Year") FROM table_35808 WHERE "Margin of victory" = '9 strokes' AND "Purse ( $ )" < '2,750,000' | wikisql |
CREATE TABLE table_27755603_10 (
high_points VARCHAR,
team VARCHAR
) | What was the high points when the team was Washington? | SELECT high_points FROM table_27755603_10 WHERE team = "Washington" | sql_create_context |
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... | 在0750542医院就医的患者郑碧菡出院的时候其出院诊断结果的诊断医生姓戚的是什么时候? | SELECT qtb.OUT_DIAG_DIS_CD, qtb.OUT_DIAG_DIS_NM FROM qtb WHERE qtb.PERSON_NM = '郑碧菡' AND qtb.MED_SER_ORG_NO = '0750542' AND qtb.OUT_DIAG_DOC_NM LIKE '戚%' UNION SELECT gyb.OUT_DIAG_DIS_CD, gyb.OUT_DIAG_DIS_NM FROM gyb WHERE gyb.PERSON_NM = '郑碧菡' AND gyb.MED_SER_ORG_NO = '0750542' AND gyb.OUT_DIAG_DOC_NM LIKE '戚%' UNION ... | css |
CREATE TABLE table_name_88 (
week_of VARCHAR,
winner VARCHAR
) | What is the Week when the winner was mary joe fern ndez 6 4, 7 5? | SELECT week_of FROM table_name_88 WHERE winner = "mary joe fernández 6–4, 7–5" | sql_create_context |
CREATE TABLE fare_basis (
fare_basis_code text,
booking_class text,
class_type text,
premium text,
economy text,
discounted text,
night text,
season text,
basis_days text
)
CREATE TABLE aircraft (
aircraft_code varchar,
aircraft_description varchar,
manufacturer varchar,... | flights from MEMPHIS to LAS VEGAS on sunday | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'LAS VEGAS' AND date_day.day_number = 27 AND date_day.month_number = 8 AND... | atis |
CREATE TABLE table_34795 (
"Date" text,
"Result" text,
"Score" text,
"Brazil scorers" text,
"Competition" text
) | Which Brazil scorers have a Result of w, and a Competition of world cup qualifying, and a Date of february 28, 1954? | SELECT "Brazil scorers" FROM table_34795 WHERE "Result" = 'w' AND "Competition" = 'world cup qualifying' AND "Date" = 'february 28, 1954' | wikisql |
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 d_icd_procedures (
row_id number,
icd9_code text,
s... | count the number of patients for whom neostigmine was prescribed in the same month after having been diagnosed during the previous year with atherosclerosis nec. | SELECT COUNT(DISTINCT t1.subject_id) 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_diagnoses.short_title = 'atherosclerosis ne... | mimic_iii |
CREATE TABLE table_12305325_4 (
eliminated VARCHAR,
safe VARCHAR
) | What is the number eliminated when kelly and brendan are safe? | SELECT COUNT(eliminated) FROM table_12305325_4 WHERE safe = "Kelly and Brendan" | sql_create_context |
CREATE TABLE table_11864 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | Which team has an away team score of 9.11 (65)? | SELECT "Away team" FROM table_11864 WHERE "Away team score" = '9.11 (65)' | 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,
... | 列举出在2001年2月17日到2007年7月3日这段时间内患者24318631所有检验报告单的审核日期时间是什么呢? | SELECT jybgb.SHSJ FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN mzjzjlb_jybgb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND mzjzjlb_jybgb.YLJGDM = jybgb.YLJGDM AND mzjzjlb_jybgb.BGDH ... | css |
CREATE TABLE table_23285761_11 (
team VARCHAR,
game VARCHAR
) | Which team has 5 as a game? | SELECT team FROM table_23285761_11 WHERE game = 5 | sql_create_context |
CREATE TABLE table_name_55 (
sponsor_s_ VARCHAR,
date_introduced VARCHAR
) | Who sponsored the bill that was introduced on June 2, 2009? | SELECT sponsor_s_ FROM table_name_55 WHERE date_introduced = "june 2, 2009" | sql_create_context |
CREATE TABLE table_78138 (
"D 41 O" text,
"D 42 O" text,
"D 43 O" text,
"D 44 O" text,
"D 45 +" text,
"R 55 +" text,
"R 54 +" text,
"R 53 +" text,
"R 52 O" text,
"R 51 O" text
) | What is the value of D 43 O that has a corresponding R 53 + value of r 8? | SELECT "D 43 O" FROM table_78138 WHERE "R 53 +" = 'r 8' | wikisql |
CREATE TABLE table_name_89 (
place VARCHAR,
player VARCHAR
) | What is Greg Norman's place? | SELECT place FROM table_name_89 WHERE player = "greg norman" | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.