context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE ftxmzjzjlb ( 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, MZZYZD...
在张秀媛的患者的检查过程中有哪些检验报告单对应的检验结果指标是都不正常的?具体的检验报告单号是啥?
SELECT jybgb.BGDH FROM person_info JOIN hz_info JOIN txmzjzjlb JOIN jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX AND txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE person_info.XM = '张...
css
CREATE TABLE Scientists ( SSN int, Name Char(30) ) CREATE TABLE AssignedTo ( Scientist int, Project char(4) ) CREATE TABLE Projects ( Code Char(4), Name Char(50), Hours int )
What is the name of the project that has a scientist assigned to it whose name contains 'Smith', and count them by a bar chart, I want to order in asc by the total number.
SELECT T2.Name, COUNT(T2.Name) FROM AssignedTo AS T1 JOIN Projects AS T2 ON T1.Project = T2.Code JOIN Scientists AS T3 ON T1.Scientist = T3.SSN WHERE T3.Name LIKE '%Smith%' GROUP BY T2.Name ORDER BY COUNT(T2.Name)
nvbench
CREATE TABLE table_47804 ( "Player" text, "Country" text, "Year(s) won" text, "Total" real, "To par" real, "Finish" text )
What is Player, when Year(s) Won is 1978 , 1985?
SELECT "Player" FROM table_47804 WHERE "Year(s) won" = '1978 , 1985'
wikisql
CREATE TABLE table_28243691_1 ( enrollment INTEGER, founded VARCHAR )
List the highest number of students in attendance for the institution that started in 1923.
SELECT MAX(enrollment) FROM table_28243691_1 WHERE founded = 1923
sql_create_context
CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE job_history ( EMPLO...
For those employees who do not work in departments with managers that have ids between 100 and 200, visualize a bar chart about the distribution of email and employee_id , list from low to high by the y axis.
SELECT EMAIL, EMPLOYEE_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY EMPLOYEE_ID
nvbench
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...
门诊给编号为63047610这个患者诊断为躁狂型分裂情感性障碍,看看超敏甲状腺球蛋白的结果定量还有单位
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb 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 jybgb.YLJGDM = jyjgzbb...
css
CREATE TABLE student ( stuid number, lname text, fname text, age number, sex text, major number, advisor number, city_code text ) CREATE TABLE faculty_participates_in ( facid number, actid number ) CREATE TABLE participates_in ( stuid number, actid number ) CREATE TABL...
Show the ids of all the faculty members who participate in an activity and advise a student.
SELECT facid FROM faculty_participates_in INTERSECT SELECT advisor FROM student
spider
CREATE TABLE table_22831 ( "DMA" real, "Market" text, "Station" text, "Frequency" text, "Branding" text, "Format" text )
Which branding has the format of southern country?
SELECT "Branding" FROM table_22831 WHERE "Format" = 'Southern Country'
wikisql
CREATE TABLE table_name_93 ( event VARCHAR, name VARCHAR )
Name the Event of sudesh peiris?
SELECT event FROM table_name_93 WHERE name = "sudesh peiris"
sql_create_context
CREATE TABLE table_42486 ( "Rank" real, "Province" text, "Population" real, "Area" real, "Density" real )
What is the Density that has a Population larger than 290,458, and an Area of 91.6?
SELECT SUM("Density") FROM table_42486 WHERE "Population" > '290,458' AND "Area" = '91.6'
wikisql
CREATE TABLE table_61672 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text )
What To par has a Place of t2, and a Country of united states?
SELECT "To par" FROM table_61672 WHERE "Place" = 't2' AND "Country" = 'united states'
wikisql
CREATE TABLE table_33913 ( "Year" real, "Championship" text, "Winning score" text, "Margin" text, "Runner(s)-up" text )
What Championship had a Winning score of 6 & 5?
SELECT "Championship" FROM table_33913 WHERE "Winning score" = '6 & 5'
wikisql
CREATE TABLE fzzmzjzjlb ( 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, MZZYZD...
在03年3月23日到15年11月12日之间病患55566777的洋地黄情况是怎么样的?
SELECT * FROM hz_info JOIN zzmzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX AND zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE hz_i...
css
CREATE TABLE Participates_in ( stuid INTEGER, actid INTEGER ) CREATE TABLE Faculty_Participates_in ( FacID INTEGER, actid INTEGER ) CREATE TABLE Faculty ( FacID INTEGER, Lname VARCHAR(15), Fname VARCHAR(15), Rank VARCHAR(15), Sex VARCHAR(1), Phone INTEGER, Room VARCHAR(5), ...
How many faculty members do we have for each gender? Draw a bar chart, and I want to order by the names in asc please.
SELECT Sex, COUNT(*) FROM Faculty GROUP BY Sex ORDER BY Sex
nvbench
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 born before 2053 who are taking drug via ivpca route.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dob_year < "2053" AND prescriptions.route = "IVPCA"
mimicsql_data
CREATE TABLE table_63584 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Record" text, "Attendance" real )
What was the home team for the game with attendance larger than 59,064 and a record of 7-4-0?
SELECT "Home" FROM table_63584 WHERE "Attendance" > '59,064' AND "Record" = '7-4-0'
wikisql
CREATE TABLE jybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH text, BGJGDM text, BGJGMC text, BGRGH text, BGRQ time, BGRXM text, BGSJ time, CJRQ time, JSBBRQSJ time, JSBBSJ time, JYBBH text, JYJGMC text, JYJSGH text, JYJSQM text, JY...
哪些门诊就诊记录对应患者37451168的检验报告单的报告日期均在2000年10月7日之前?门诊就诊流水号是多少?
SELECT wdmzjzjlb.JZLSH FROM hz_info JOIN wdmzjzjlb ON hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX WHERE hz_info.RYBH = '37451168' AND NOT wdmzjzjlb.JZLSH IN (SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ >= '2000-10-07') UNION SELECT bdmzjzjlb.JZLSH FROM hz_info JOIN...
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...
Posts with Tags for the last 60 days.
SELECT * FROM Posts INNER JOIN PostTags ON Posts.Id = PostTags.PostId INNER JOIN Tags ON PostTags.TagId = Tags.Id WHERE DATEDIFF(day, Posts.CreationDate, GETDATE()) < 60
sede
CREATE TABLE table_14736 ( "Unit" text, "Reactor type" text, "Net capacity" text, "Gross capacity" text, "Construction started" text, "Electricity grid" text, "Commercial operation" text, "Shutdown" text )
What reactor type that has a commercial operation of , and a tianwan-7 unit?
SELECT "Reactor type" FROM table_14736 WHERE "Commercial operation" = '—' AND "Unit" = 'tianwan-7'
wikisql
CREATE TABLE table_2679061_7 ( college_junior_club_team VARCHAR, pick__number VARCHAR )
How many teams got pick number 130?
SELECT COUNT(college_junior_club_team) FROM table_2679061_7 WHERE pick__number = 130
sql_create_context
CREATE TABLE table_name_62 ( population VARCHAR, official_name VARCHAR )
What is saint-andr 's population?
SELECT population FROM table_name_62 WHERE official_name = "saint-andré"
sql_create_context
CREATE TABLE table_204_103 ( id number, "medal" text, "name" text, "sport" text, "event" text )
in what sport did india win the most silver medals ?
SELECT "sport" FROM table_204_103 GROUP BY "sport" ORDER BY COUNT("medal") DESC LIMIT 1
squall
CREATE TABLE table_name_83 ( accreditation_status VARCHAR, product_name VARCHAR )
What is the Accreditation Status, when the Product Name is LG RCS-e Client?
SELECT accreditation_status FROM table_name_83 WHERE product_name = "lg rcs-e client"
sql_create_context
CREATE TABLE table_11785 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What is the highest crowd when fitzroy is the home team?
SELECT MAX("Crowd") FROM table_11785 WHERE "Home team" = 'fitzroy'
wikisql
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...
在编号为1303547的医院,查出非科室乳腺负责的在2003-02-21到2005-09-08内所有医疗就诊记录
SELECT * FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '1303547' AND gwyjzb.IN_HOSP_DATE BETWEEN '2003-02-21' AND '2005-09-08' UNION SELECT * FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '1303547' AND fgwyjzb.IN_HOSP_DATE BETWEEN '2003-02-21' AND '2005-09-08' EXCEPT SELECT * FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '130354...
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...
Is there a lab for CHE 330 if Prof. Jessi Streib teaches it ?
SELECT COUNT(*) = 0 FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN offering_instructor ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN instructor ON offering_instructor.instructor_id = instructor.instructor_id WHERE course.department = 'CHE'...
advising
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 lab ( subject_id text, hadm_id text, ...
what is the number of dead patients who were diagnosed with unspecified pseudomonas infection?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.expire_flag = "1" AND diagnoses.short_title = "Pseudomonas infect NOS"
mimicsql_data
CREATE TABLE table_100 ( "Pick #" real, "CFL Team" text, "Player" text, "Position" text, "College" text )
What college did Calvin McCarty play at?
SELECT "College" FROM table_100 WHERE "Player" = 'Calvin McCarty'
wikisql
CREATE TABLE table_2655016_4 ( nick_prod__number INTEGER )
What is the lowest Nick production number?
SELECT MIN(nick_prod__number) FROM table_2655016_4
sql_create_context
CREATE TABLE table_18155 ( "District" text, "Incumbent" text, "Party" text, "First elected" text, "Results" text, "Candidates" text )
How many elections have resulted in retired democratic hold?
SELECT COUNT("Party") FROM table_18155 WHERE "Results" = 'Retired Democratic hold'
wikisql
CREATE TABLE Customers ( customer_id INTEGER, payment_method VARCHAR(15), customer_name VARCHAR(80), date_became_customer DATETIME, other_customer_details VARCHAR(255) ) CREATE TABLE Customer_Addresses ( customer_id INTEGER, address_id INTEGER, date_address_from DATETIME, address_ty...
What are the number of the dates when customers with ids between 10 and 20 became customers?, and order by the the number of date became customer in descending please.
SELECT date_became_customer, COUNT(date_became_customer) FROM Customers WHERE customer_id BETWEEN 10 AND 20 ORDER BY COUNT(date_became_customer) DESC
nvbench
CREATE TABLE ship ( ship_id number, name text, type text, built_year number, class text, flag text ) CREATE TABLE captain ( captain_id number, name text, ship_id number, age text, class text, rank text )
Which rank is the most common among captains?
SELECT rank FROM captain GROUP BY rank ORDER BY COUNT(*) DESC LIMIT 1
spider
CREATE TABLE table_42451 ( "Year" real, "Team" text, "Chassis" text, "Engine" text, "Rank" text, "Points" real )
Which engine has a chassis of dallara, is ranked 6th, and has 384 points?
SELECT "Engine" FROM table_42451 WHERE "Chassis" = 'dallara' AND "Rank" = '6th' AND "Points" = '384'
wikisql
CREATE TABLE table_44340 ( "Team" text, "Tries for" text, "Tries against" text, "Try diff" text, "Points for" text, "Points against" text, "Points diff" text )
What is the Points for number of the team with a 10 Tries against number?
SELECT "Points for" FROM table_44340 WHERE "Tries against" = '10'
wikisql
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 intakeoutput ( in...
how many times patient 005-18714 last year visits the icu?
SELECT COUNT(DISTINCT patient.patientunitstayid) FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '005-18714') AND DATETIME(patient.unitadmittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')
eicu
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime...
what was the name of the lab test that patient 003-39001 received for first time in 02/last year?
SELECT lab.labname FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '003-39001')) AND DATETIME(lab.labresulttime, 'start of year') = DATETIME(CURRENT_TIME(), ...
eicu
CREATE TABLE table_204_749 ( id number, "courthouse" text, "city" text, "street address" text, "jurisdiction" text, "dates of use" text, "named for" number )
where is the location -lrb- city -rrb- of the last u.s. post office and court house on the chart ?
SELECT "city" FROM table_204_749 ORDER BY id DESC LIMIT 1
squall
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, a...
how many patients stayed on the 888 ward a year before?
SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.wardid = 888 AND DATETIME(patient.unitadmittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')
eicu
CREATE TABLE table_80303 ( "Year" text, "Winner" text, "Country" text, "Score" text, "Margin" text, "Runner(s)-up" text )
Who was the runner-up when the year was 2008?
SELECT "Runner(s)-up" FROM table_80303 WHERE "Year" = '2008'
wikisql
CREATE TABLE table_name_77 ( date_of_appointment VARCHAR, outgoing_manager VARCHAR )
When was outgoing manager Zolt n Varga appointed?
SELECT date_of_appointment FROM table_name_77 WHERE outgoing_manager = "zoltán varga"
sql_create_context
CREATE TABLE table_15852257_1 ( races INTEGER )
What is the highest value for race?
SELECT MAX(races) FROM table_15852257_1
sql_create_context
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE diagnoses_icd ( row_id n...
calculate the number of visits to patient 72647's hospital since 2102.
SELECT COUNT(DISTINCT admissions.hadm_id) FROM admissions WHERE admissions.subject_id = 72647 AND STRFTIME('%y', admissions.admittime) >= '2102'
mimic_iii
CREATE TABLE table_name_91 ( tries_against INTEGER, points_against VARCHAR, tries_for VARCHAR )
What Tries against that have a Points against of 95 and Tries for larger than 20?
SELECT SUM(tries_against) FROM table_name_91 WHERE points_against = 95 AND tries_for > 20
sql_create_context
CREATE TABLE drivers ( forename VARCHAR, surname VARCHAR, driverid VARCHAR ) CREATE TABLE laptimes ( driverid VARCHAR, milliseconds INTEGER )
List the forename and surname of all distinct drivers who once had laptime less than 93000 milliseconds?
SELECT DISTINCT T1.forename, T1.surname FROM drivers AS T1 JOIN laptimes AS T2 ON T1.driverid = T2.driverid WHERE T2.milliseconds < 93000
sql_create_context
CREATE TABLE table_36379 ( "Game" real, "March" real, "Opponent" text, "Score" text, "Record" text, "Points" real )
Which Game has a March smaller than 12, and a Score of 10 1?
SELECT MIN("Game") FROM table_36379 WHERE "March" < '12' AND "Score" = '10–1'
wikisql
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE d_labitems ( row_id number, itemid numbe...
what is the name of the medication that patient 10425 was prescribed during the same hospital visit after being diagnosed with peritonitis (acute) gen since 75 months ago?
SELECT t2.drug FROM (SELECT admissions.subject_id, diagnoses_icd.charttime, admissions.hadm_id FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE admissions.subject_id = 10425 AND diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.s...
mimic_iii
CREATE TABLE table_15621965_1 ( nationality VARCHAR, no VARCHAR )
Name the nationality of number 9
SELECT nationality FROM table_15621965_1 WHERE no = 9
sql_create_context
CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Per...
Return a bar chart about the distribution of All_Home and School_ID , and group by attribute ACC_Home.
SELECT All_Home, School_ID FROM basketball_match GROUP BY ACC_Home, All_Home
nvbench
CREATE TABLE table_30065 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
How many games did they play on january 11?
SELECT COUNT("Location Attendance") FROM table_30065 WHERE "Date" = 'January 11'
wikisql
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost numb...
when did patient 18841 get admitted to the hospital for the first time the last year via emergency room admitting?
SELECT admissions.admittime FROM admissions WHERE admissions.subject_id = 18841 AND admissions.admission_location = 'emergency room admit' AND DATETIME(admissions.admittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') ORDER BY admissions.admittime LIMIT 1
mimic_iii
CREATE TABLE table_name_95 ( lost INTEGER, goals_scored VARCHAR, played VARCHAR )
What is the average value for Lost, when the value for Goals Scored is greater than 20, and when the value for Played is less than 18?
SELECT AVG(lost) FROM table_name_95 WHERE goals_scored > 20 AND played < 18
sql_create_context
CREATE TABLE table_203_102 ( id number, "event" text, "performance" text, "athlete" text, "nation" text, "place" text, "date" text )
is the best time for the 100 m more or less than the time for the 110 m hurdles ?
SELECT (SELECT "performance" FROM table_203_102 WHERE "event" = '100 m') > (SELECT "performance" FROM table_203_102 WHERE "event" = '110 m hurdles')
squall
CREATE TABLE table_4335 ( "Region" text, "Date" text, "Format" text, "Label" text, "Edition(s)" text )
Tell me the format for worldwide region july 22, 2008
SELECT "Format" FROM table_4335 WHERE "Region" = 'worldwide' AND "Date" = 'july 22, 2008'
wikisql
CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDisplayName text...
AAD Question count by month.
SELECT * FROM Posts AS p JOIN PostTags AS pt ON p.Id = pt.PostId JOIN Tags AS t ON pt.TagId = t.Id WHERE t.TagName IN ('azure-active-directory', 'azure-ad-b2c', 'azure-ad-graph-api', 'adal', 'microsoft-account') AND p.PostTypeId = 1
sede
CREATE TABLE election ( election_id number, representative_id number, date text, votes number, vote_percent number, seats number, place number ) CREATE TABLE representative ( representative_id number, name text, state text, party text, lifespan text )
What are the minimum and maximum vote percents of elections?
SELECT MIN(vote_percent), MAX(vote_percent) FROM election
spider
CREATE TABLE table_name_59 ( upper_index_kcal__nm_3 VARCHAR, fuel_gas VARCHAR, lower_index_mj__nm_3 VARCHAR )
What is the Upper index Kcal/ Nm 3 of iso-butane, and a Lower index MJ/ Nm 3 smaller than 84.71?
SELECT COUNT(upper_index_kcal__nm_3) FROM table_name_59 WHERE fuel_gas = "iso-butane" AND lower_index_mj__nm_3 < 84.71
sql_create_context
CREATE TABLE mzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH text, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZZMC ...
在医院4252595中列出86686346患者入院科室名称包含针灸的住院就诊记录数目是多少?
SELECT * FROM hz_info JOIN zyjzjlb ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE hz_info.RYBH = '86686346' AND hz_info.YLJGDM = '4252595' AND zyjzjlb.JZKSMC LIKE '%针灸%'
css
CREATE TABLE musical ( Musical_ID int, Name text, Year int, Award text, Category text, Nominee text, Result text ) CREATE TABLE actor ( Actor_ID int, Name text, Musical_ID int, Character text, Duration text, age int )
Show the musical nominee with award 'Bob Fosse' or 'Cleavant Derricks', and count them by a bar chart, and could you list from high to low by the total number?
SELECT Nominee, COUNT(Nominee) FROM musical WHERE Award = "Tony Award" OR Award = "Cleavant Derricks" GROUP BY Nominee ORDER BY COUNT(Nominee) DESC
nvbench
CREATE TABLE table_name_54 ( language VARCHAR, director VARCHAR )
Which Language Director of nagisa oshima use in his film?
SELECT language FROM table_name_54 WHERE director = "nagisa oshima"
sql_create_context
CREATE TABLE table_22043925_1 ( denomination VARCHAR, school VARCHAR )
What is every denomination for the school Seymour college?
SELECT denomination FROM table_22043925_1 WHERE school = "Seymour College"
sql_create_context
CREATE TABLE table_78557 ( "Position" real, "Club" text, "Played" real, "Points" real, "Wins" real, "Draws" real, "Losses" real, "Goals for" real, "Goals against" real, "Goal Difference" real )
Which Wins have a Goal Difference larger than 0, and Goals against larger than 40, and a Position smaller than 6, and a Club of sd indauchu?
SELECT MIN("Wins") FROM table_78557 WHERE "Goal Difference" > '0' AND "Goals against" > '40' AND "Position" < '6' AND "Club" = 'sd indauchu'
wikisql
CREATE TABLE table_204_634 ( id number, "tour" number, "official title" text, "venue" text, "city" text, "date\nstart" text, "date\nfinish" text, "prize money\nusd" number, "report" text )
does the malaysia open super series pay more or less than french super series ?
SELECT (SELECT "prize money\nusd" FROM table_204_634 WHERE "official title" = 'malaysia open super series') > (SELECT "prize money\nusd" FROM table_204_634 WHERE "official title" = 'french super series')
squall
CREATE TABLE market ( Market_ID int, District text, Num_of_employees int, Num_of_shops real, Ranking int ) CREATE TABLE phone ( Name text, Phone_ID int, Memory_in_G int, Carrier text, Price real ) CREATE TABLE phone_market ( Market_ID int, Phone_ID text, Num_of_stoc...
What are the memories and carriers of phones.
SELECT Carrier, SUM(Memory_in_G) FROM phone GROUP BY Carrier
nvbench
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE l...
what was the new prescription for patient 017-88691 today compared to the prescription yesterday?
SELECT medication.drugname FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.uniquepid = '017-88691') AND DATETIME(medication.drugstarttime, 'start of day') = DATETIME(CURRENT_TIME(), 'start of day', '-0 day') EXCEPT SELECT medication.drugname FROM medica...
eicu
CREATE TABLE table_203_363 ( id number, "city\n2010 census" text, "chinese" text, "built-up area" number, "urban area" number, "level" text, "administrative area" number, "province-level division" text, "remarks" text )
which city has more in their built up area than any other ?
SELECT "city\n2010 census" FROM table_203_363 ORDER BY "built-up area" DESC LIMIT 1
squall
CREATE TABLE table_44485 ( "Team" text, "Tries for" text, "Tries against" text, "Try diff" text, "Points for" text, "Points against" text, "Points diff" text )
What is Tries Against, when Points Against is 213?
SELECT "Tries against" FROM table_44485 WHERE "Points against" = '213'
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 PostNoticeTypes ( Id number, ClassId number, Na...
Posts Containing Statistics in Title.
SELECT Title, Score, Id FROM Posts WHERE PostTypeId = 1 AND Title LIKE '%stat%' ORDER BY Score DESC
sede
CREATE TABLE table_name_84 ( opponent VARCHAR, time VARCHAR )
Which Opponent has a Time of 4:51?
SELECT opponent FROM table_name_84 WHERE time = "4:51"
sql_create_context
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 patient ( uniquep...
what was the total number of outputs patient 016-18150 had since 299 days ago?
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 = '016-18150')) AND intakeoutput.cellpath LIKE '%ou...
eicu
CREATE TABLE table_name_11 ( type VARCHAR, moving_from VARCHAR )
What is the type of the player moving from belgrano?
SELECT type FROM table_name_11 WHERE moving_from = "belgrano"
sql_create_context
CREATE TABLE table_name_31 ( bluetooth VARCHAR, model VARCHAR )
Does the s35 model have bluetooth?
SELECT bluetooth FROM table_name_31 WHERE model = "s35"
sql_create_context
CREATE TABLE table_29141354_4 ( first_broadcast VARCHAR, jamie_and_johns_guest VARCHAR )
When id the episode broadcast with Mark Webber as Jamie and John's guest?
SELECT first_broadcast FROM table_29141354_4 WHERE jamie_and_johns_guest = "Mark Webber"
sql_create_context
CREATE TABLE table_16371 ( "No. in series" real, "No. in season" real, "Title" text, "Director" text, "Writer(s)" text, "Original air date" text, "Production code" text )
Who's the writer for the episode with a production code 2395114?
SELECT "Writer(s)" FROM table_16371 WHERE "Production code" = '2395114'
wikisql
CREATE TABLE table_name_25 ( attendance VARCHAR, week VARCHAR, date VARCHAR )
What was the attendance for the game held on September 18, 1994, with a week less than 5?
SELECT attendance FROM table_name_25 WHERE week < 5 AND date = "september 18, 1994"
sql_create_context
CREATE TABLE table_name_21 ( other VARCHAR, christianity VARCHAR )
What is the other value associated with a Christianity value of 10.24%?
SELECT other FROM table_name_21 WHERE christianity = "10.24%"
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...
把医院8257985全部诊疗记录中个人需要自费的部分与总的医疗花费的比值最小值依科室的不同和出院诊断编码的差别列出来,把结果按从小到大来显示
SELECT t_kc21.MED_ORG_DEPT_NM, t_kc21.OUT_DIAG_DIS_CD, MIN(t_kc24.PER_EXP) 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.MED_SER_ORG_NO = '8257985' GROUP BY t_kc21.MED_ORG_DEPT_NM, t_kc21.OUT_DIAG_...
css
CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE PostHistoryTypes ( Id numb...
Most viewed questions with a tag converted to a synonym since then.
SELECT Posts.Id AS "post_link", Posts.ViewCount, TagSynonyms.SourceTagName AS "Its tag...", TagSynonyms.TargetTagName AS "...is a synonym of" FROM TagSynonyms, Tags, PostTags, Posts WHERE Tags.TagName = TagSynonyms.SourceTagName AND PostTags.TagId = Tags.Id AND Posts.Id = PostTags.PostId ORDER BY Posts.ViewCount DESC, ...
sede
CREATE TABLE candidate ( Candidate_ID int, People_ID int, Poll_Source text, Date text, Support_rate real, Consider_rate real, Oppose_rate real, Unsure_rate real ) CREATE TABLE people ( People_ID int, Sex text, Name text, Date_of_Birth text, Height real, Weight re...
What is the relationship between Height and Weight ?
SELECT Height, Weight FROM people
nvbench
CREATE TABLE table_61106 ( "Year" real, "Award" text, "Category" text, "Nominated Work" text, "Result" text )
What is the result for the Outer Critics Circle award earlier than 2004?
SELECT "Result" FROM table_61106 WHERE "Award" = 'outer critics circle award' AND "Year" < '2004'
wikisql
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
what is the number of patients whose diagnoses icd9 code is v667 and drug route is tp?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.icd9_code = "V667" AND prescriptions.route = "TP"
mimicsql_data
CREATE TABLE table_35934 ( "Round" real, "Pick" real, "Player" text, "Position" text, "School/Club Team" text )
What is the highest round of Ed Smith, who had a pick higher than 261 and played halfback?
SELECT MAX("Round") FROM table_35934 WHERE "Pick" < '261' AND "Position" = 'halfback' AND "Player" = 'ed smith'
wikisql
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 ...
In every semester , can you take ENDODONT 651 ?
SELECT COUNT(*) > 0 FROM semester WHERE NOT semester IN (SELECT DISTINCT SEMESTERalias1.semester FROM course AS COURSEalias0, course_offering AS COURSE_OFFERINGalias0, semester AS SEMESTERalias1 WHERE COURSEalias0.course_id = COURSE_OFFERINGalias0.course_id AND COURSEalias0.department = 'ENDODONT' AND COURSEalias0.numb...
advising
CREATE TABLE table_name_29 ( listed VARCHAR, location VARCHAR )
On what date was the bridge located in McClain listed?
SELECT listed FROM table_name_29 WHERE location = "mcclain"
sql_create_context
CREATE TABLE table_19229 ( "Country/Territory" text, "Former pageant" text, "Last competed" real, "New pageant" text, "Franchise since" real )
How many new pageants does Aruba have?
SELECT COUNT("New pageant") FROM table_19229 WHERE "Country/Territory" = 'Aruba'
wikisql
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...
列出给尤修远这个病人开拉莫三嗪片的几家医院
SELECT t_kc22.t_kc21_MED_SER_ORG_NO FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_NM = '尤修远' AND t_kc22.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.SOC_SRT_DIRE_NM = '拉莫三嗪片')
css
CREATE TABLE table_name_30 ( overall VARCHAR, name VARCHAR )
How much Overall has a Name of bob anderson?
SELECT COUNT(overall) FROM table_name_30 WHERE name = "bob anderson"
sql_create_context
CREATE TABLE table_name_2 ( time VARCHAR, nfl_recap VARCHAR, result VARCHAR )
What was the time of the game that had an NFL recap and a result of W 22 16?
SELECT time FROM table_name_2 WHERE nfl_recap = "recap" AND result = "w 22–16"
sql_create_context
CREATE TABLE table_name_95 ( played INTEGER, position VARCHAR, drawn VARCHAR, team VARCHAR )
Which Played has a Drawn of 5, and a Team of palmeiras, and a Position smaller than 6?
SELECT MAX(played) FROM table_name_95 WHERE drawn = 5 AND team = "palmeiras" AND position < 6
sql_create_context
CREATE TABLE table_23474 ( "#" real, "Title" text, "Maneater" text, "Television Premiere" text, "DVD release" text, "Writer" text, "Director" text, "Producer" text )
How many numbers have Charles Salmon as the producer and January 27, 2007 was the television premiere?
SELECT MIN("#") FROM table_23474 WHERE "Producer" = 'Charles Salmon' AND "Television Premiere" = 'January 27, 2007'
wikisql
CREATE TABLE table_27257896_2 ( working_force_of_hk VARCHAR, nepalese VARCHAR )
If the nepalese is 37.1%, what is the working force of HK?
SELECT working_force_of_hk FROM table_27257896_2 WHERE nepalese = "37.1%"
sql_create_context
CREATE TABLE table_name_82 ( elected VARCHAR )
Who is the 1st member elected in 1620/21?
SELECT 1 AS st_member FROM table_name_82 WHERE elected = "1620/21"
sql_create_context
CREATE TABLE table_name_70 ( year INTEGER, category VARCHAR )
What is the latest year for the distinguished performance?
SELECT MAX(year) FROM table_name_70 WHERE category = "distinguished performance"
sql_create_context
CREATE TABLE jybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH text, BGJGDM text, BGJGMC text, BGRGH text, BGRQ time, BGRXM text, BGSJ time, CJRQ time, JSBBRQSJ time, JSBBSJ time, JYBBH text, JYJGMC text, JYJSGH text, JYJSQM text, JY...
08年2月6日到18年10月8日期间,87902700这名患者全段甲状旁腺激素这个指标的所有记录
SELECT * FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb 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 jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb....
css
CREATE TABLE table_79696 ( "Tournament" text, "Wins" real, "Top-10" real, "Top-25" real, "Events" real, "Cuts made" real )
What is the sum of top-10s for events with more than 0 wins?
SELECT SUM("Top-10") FROM table_79696 WHERE "Wins" > '0'
wikisql
CREATE TABLE table_2223177_3 ( season INTEGER )
Name the least season
SELECT MIN(season) FROM table_2223177_3
sql_create_context
CREATE TABLE gsi ( course_offering_id int, student_id int ) 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, ...
During the Spring season , has the PHYSED 305 ever been offered ?
SELECT COUNT(*) > 0 FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'PHYSED' AND course.number = 305 AND semester.semester = 'Spring' AND semester.semester_id = course_offering.semester
advising
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 emergency hospital admission patients have calculus of bile duct without mention of cholecystitis or obstruction diagnoses?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND diagnoses.long_title = "Calculus of bile duct without mention of cholecystitis, without mention of obstruction"
mimicsql_data
CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) 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 varcha...
For all employees who have the letters D or S in their first name, a scatter chart shows the correlation between employee_id and department_id .
SELECT EMPLOYEE_ID, DEPARTMENT_ID FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%'
nvbench
CREATE TABLE table_40519 ( "Year" text, "Team" text, "GP/GS" text, "Goals" text, "Assists" text, "Total Points" text )
What assists has the Team SMU and the total points of 85?
SELECT "Assists" FROM table_40519 WHERE "Team" = 'smu' AND "Total Points" = '85'
wikisql
CREATE TABLE table_18733480_1 ( players_left_after_round_1 VARCHAR, team_1 VARCHAR )
How many times was team 1 the wykeham wonderers?
SELECT COUNT(players_left_after_round_1) FROM table_18733480_1 WHERE team_1 = "Wykeham Wonderers"
sql_create_context