context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_56190 ( "Round" text, "Pick" text, "Player" text, "Position" text, "Nationality" text, "Team" text, "College" text )
Name the college that has 7 rounds and boston celtics team
SELECT "College" FROM table_56190 WHERE "Team" = 'boston celtics' AND "Round" = '7'
wikisql
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 TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), ...
For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, visualize a bar chart about the distribution of hire_date and the sum of department_id bin hire_date by weekday, I want to sort from high to low by the sum department id.
SELECT HIRE_DATE, SUM(DEPARTMENT_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY SUM(DEPARTMENT_ID) DESC
nvbench
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...
对于医疗费总额不少于9872.67元的患者朱同和的医疗记录,列出出院诊断疾病编码是什么?名称是什么?
SELECT t_kc21.OUT_DIAG_DIS_CD, t_kc21.OUT_DIAG_DIS_NM FROM t_kc21 WHERE t_kc21.PERSON_NM = '朱同和' AND t_kc21.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT >= 9872.67)
css
CREATE TABLE table_29217 ( "Pick #" real, "CFL Team" text, "Player" text, "Position" text, "College" text )
What college did Bob Larose attend?
SELECT "College" FROM table_29217 WHERE "Player" = 'Bob LaRose'
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...
之前患者韩依然在哪儿看过病?
SELECT zzmzjzjlb.YLJGDM FROM person_info JOIN hz_info JOIN zzmzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX WHERE person_info.XM = '韩依然' UNION SELECT fzzmzjzjlb.YLJGDM FROM person_info JOIN hz_info JOIN fzzmzjzjlb ON person_...
css
CREATE TABLE table_7960 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Date" text )
Which Home Team has a Tie no of 13?
SELECT "Home team" FROM table_7960 WHERE "Tie no" = '13'
wikisql
CREATE TABLE table_37321 ( "District" real, "Incumbent" text, "2008 Status" text, "Democratic" text, "Republican" text )
Which District has a Republican of dan mansell?
SELECT AVG("District") FROM table_37321 WHERE "Republican" = 'dan mansell'
wikisql
CREATE TABLE table_name_71 ( finish VARCHAR, rank VARCHAR )
What's the Finish rank of 31?
SELECT finish FROM table_name_71 WHERE rank = "31"
sql_create_context
CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE flight ( aircraft_code_sequence text, ...
show me airlines between BOSTON and SAN FRANCISCO
SELECT DISTINCT airline.airline_code FROM airline, airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_na...
atis
CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE T...
find candidates for Necromancer badge. finds questions more than 60 days old having in the specified tag
SELECT Id AS "post_link", Score, ViewCount AS Views, AnswerCount AS Answers, Body, CreationDate FROM Posts WHERE AcceptedAnswerId IS NULL AND PostTypeId = 1 AND CreationDate < CURRENT_TIMESTAMP() - 60 AND ClosedDate IS NULL AND Tags LIKE '%<' + LOWER(@tag) + '>%' AND AnswerCount = 0 LIMIT 1000
sede
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
how many patients who had intravenous infusion of clofarabine were discharged to short term hospital?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.discharge_location = "SHORT TERM HOSPITAL" AND procedures.long_title = "Intravenous infusion of clofarabine"
mimicsql_data
CREATE TABLE table_47237 ( "1998" text, "2000" text, "2004" text, "2007" text, "2011" text )
What is the 2004 value if the 1998 value is 35?
SELECT "2004" FROM table_47237 WHERE "1998" = '35'
wikisql
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...
查一下彭雅蕊这位参保人产生的住院费用是整数金额的次数
SELECT COUNT(*) FROM t_kc21 WHERE t_kc21.PERSON_NM = '彭雅蕊' AND t_kc21.CLINIC_TYPE = '住院' AND MOD(t_kc21.MED_AMOUT, 1) = 0
css
CREATE TABLE table_73940 ( "Year" real, "Championship" text, "Surface" text, "Partner" text, "Opponents in final" text, "Score in final" text )
What was the surface when he played with John Alexander?
SELECT "Surface" FROM table_73940 WHERE "Partner" = 'John Alexander'
wikisql
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
how many patients whose admission type is emergency and procedure icd9 code is 66?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND procedures.icd9_code = "66"
mimicsql_data
CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(...
For those employees who was hired before 2002-06-21, give me the comparison about the average of salary over the hire_date bin hire_date by time, and show y axis in asc order.
SELECT HIRE_DATE, AVG(SALARY) FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY AVG(SALARY)
nvbench
CREATE TABLE table_204_26 ( id number, "name" text, "position" text, "birth date/age at start of campaign" text, "games in campaign" text, "club" text )
what is the number of players that played for fc st. gallen ?
SELECT COUNT("name") FROM table_204_26 WHERE "club" = 'fc st. gallen'
squall
CREATE TABLE table_73138 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text )
Name the party for yvette clarke (d) 90.6% hugh carr (r) 9.4%
SELECT "Party" FROM table_73138 WHERE "Candidates" = 'Yvette Clarke (D) 90.6% Hugh Carr (R) 9.4%'
wikisql
CREATE TABLE participates_in ( stuid number, actid number ) CREATE TABLE faculty ( facid number, lname text, fname text, rank text, sex text, phone number, room text, building text ) CREATE TABLE faculty_participates_in ( facid number, actid number ) CREATE TABLE activ...
How many students are advised by each rank of faculty? List the rank and the number of students.
SELECT T1.rank, COUNT(*) FROM faculty AS T1 JOIN student AS T2 ON T1.facid = T2.advisor GROUP BY T1.rank
spider
CREATE TABLE roller_coaster ( Park VARCHAR, Speed VARCHAR )
Show the park of the roller coaster with the highest speed.
SELECT Park FROM roller_coaster ORDER BY Speed DESC LIMIT 1
sql_create_context
CREATE TABLE table_train_125 ( "id" int, "carotid_stenosis" int, "pulmonary_disease" bool, "neurodegenerative_disease" bool, "active_infection" bool, "skin_cancer" bool, "heart_disease" bool, "clinical_dementia_rating_scale" float, "renal_disease" bool, "cerebrovascular_disease" ...
the subject has evidence of clinically significant gastrointestinal, cardiovascular, hepatic, renal, hematological, neoplastic, endocrine, neurological, immunodeficiency, pulmonary, or other disorder or disease.
SELECT * FROM table_train_125 WHERE gastrointestinal_disease = 1 OR cardiovascular_disease = 1 OR hepatic_disease = 1 OR renal_disease = 1 OR hematologic_disease = 1 OR neoplastic = 1 OR endocrine_disease = 1 OR neurological_disease = 1 OR immune_deficiency_disorder = 1 OR pulmonary_disease = 1
criteria2sql
CREATE TABLE table_17085947_32 ( trans_2 VARCHAR, bike__40km_ VARCHAR )
What is the trans 2 duration if the biking stage is covered within 58:20?
SELECT trans_2 FROM table_17085947_32 WHERE bike__40km_ = "58:20"
sql_create_context
CREATE TABLE table_204_813 ( id number, "year" number, "competition" text, "venue" text, "position" text, "event" text, "notes" text )
at which competition did the competitor throw the javelin the farthest ?
SELECT "competition" FROM table_204_813 ORDER BY "notes" DESC LIMIT 1
squall
CREATE TABLE Participates_in ( stuid INTEGER, actid INTEGER ) CREATE TABLE Faculty_Participates_in ( FacID INTEGER, actid INTEGER ) CREATE TABLE Activity ( actid INTEGER, activity_name varchar(25) ) CREATE TABLE Faculty ( FacID INTEGER, Lname VARCHAR(15), Fname VARCHAR(15), Ra...
Return a pie on how many faculty members does each building have? List the result with the name of the building.
SELECT Building, COUNT(*) FROM Faculty GROUP BY Building
nvbench
CREATE TABLE table_46518 ( "Model Number" text, "sSpec Number" text, "Frequency" text, "L2 Cache" text, "Mult" text, "Voltage" text, "Socket" text, "Release Date" text, "Part Number(s)" text )
What date was part number rk80533pz933256 released?
SELECT "Release Date" FROM table_46518 WHERE "Part Number(s)" = 'rk80533pz933256'
wikisql
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE vitalperiodic ( ...
how many patients are diagnosed with coagulopathy within 2 months after receiving angiogram - with cerebral angioplasty, since 6 years ago?
SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'angiogram - with cerebral angioplasty' AND DATETIME(treatment.treatmenttime) >= DATETIME(CURRENT_TIME(), '-6...
eicu
CREATE TABLE STUDENT ( STU_NUM int, STU_LNAME varchar(15), STU_FNAME varchar(15), STU_INIT varchar(1), STU_DOB datetime, STU_HRS int, STU_CLASS varchar(2), STU_GPA float(8), STU_TRANSFER numeric, DEPT_CODE varchar(18), STU_PHONE varchar(4), PROF_NUM int ) CREATE TABLE CL...
Show the number of courses each instructor taught in a bar chart, and order in asc by the how many emp fname please.
SELECT EMP_FNAME, COUNT(EMP_FNAME) FROM CLASS AS T1 JOIN EMPLOYEE AS T2 ON T1.PROF_NUM = T2.EMP_NUM GROUP BY EMP_FNAME ORDER BY COUNT(EMP_FNAME)
nvbench
CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC text, RYBH text, XBDM number, XBMC text, XLDM text, XLMC text, XM text, ZYLBDM text, ZYMC text ) CREATE TABLE jybgb ( BBCJBW text, BBDM tex...
被门诊诊断的病人云思远患有躁狂抑郁性精神病当前为躁狂相的的检测指标350790的结果定量以及单位都是多少?
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN jybgb_jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = j...
css
CREATE TABLE table_7893 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Opponent" text, "Score" text )
On what date did Jesse Levine play on a hard surface?
SELECT "Date" FROM table_7893 WHERE "Surface" = 'hard' AND "Opponent" = 'jesse levine'
wikisql
CREATE TABLE member ( member_id number, name text, membership_card text, age number, time_of_purchase number, level_of_membership number, address text ) CREATE TABLE shop ( shop_id number, address text, num_of_staff text, score number, open_year text ) CREATE TABLE happ...
How many members have the black membership card?
SELECT COUNT(*) FROM member WHERE membership_card = 'Black'
spider
CREATE TABLE table_33432 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Game site" text, "Attendance" text )
What opponent had an attendance of 12,508 during weeks 1 through 8?
SELECT "Opponent" FROM table_33432 WHERE "Week" < '8' AND "Attendance" = '12,508'
wikisql
CREATE TABLE table_19508635_1 ( result VARCHAR, original_artist VARCHAR )
Name the result for dolly parton
SELECT result FROM table_19508635_1 WHERE original_artist = "Dolly Parton"
sql_create_context
CREATE TABLE table_name_92 ( country VARCHAR, to_par VARCHAR, score VARCHAR )
Which country has a to par less than 19 and a score of 75-79-77-73=304?
SELECT country FROM table_name_92 WHERE to_par < 19 AND score = 75 - 79 - 77 - 73 = 304
sql_create_context
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE procedures_icd ( ...
what was the time patient 32153 entered the hospital for the last time this year?
SELECT admissions.admittime FROM admissions WHERE admissions.subject_id = 32153 AND DATETIME(admissions.admittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') ORDER BY admissions.admittime DESC LIMIT 1
mimic_iii
CREATE TABLE table_12178 ( "Country" text, "Date" text, "Label" text, "Format" text, "Catalogue #" text )
What is the country when the date shows October 24, 2008?
SELECT "Country" FROM table_12178 WHERE "Date" = 'october 24, 2008'
wikisql
CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE transfers ( row_id number, subject_id number, ...
what are patient 14502's changes in arterial bp mean last measured on the last intensive care unit visit compared to the second to last value measured on the last intensive care unit 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 = 14502) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime DESC LIMIT 1) AND chartevents...
mimic_iii
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...
从02年9月27日到17年9月18日这段时间,病患窦蕴美的所有检验结果指标记录的检查人为21945662的检验指标流水号是多少?
SELECT jyjgzbb.JYZBLSH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = ...
css
CREATE TABLE table_37795 ( "Medal" text, "Name" text, "Games" text, "Sport" text, "Event" text )
Name the games for rub n limardo
SELECT "Games" FROM table_37795 WHERE "Name" = 'rubén limardo'
wikisql
CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) CREATE TABLE state ( state_code text, state_name text, countr...
round trip flights from SALT LAKE CITY to CINCINNATI nonstop flights if possible
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, fare, flight, flight_fare WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'CINCINNATI' AND NOT fare.round_trip_cost IS NULL AND flight_fare.fare...
atis
CREATE TABLE table_name_69 ( distance VARCHAR, date VARCHAR )
What is the distance for the 5 September race?
SELECT distance FROM table_name_69 WHERE date = "5 september"
sql_create_context
CREATE TABLE table_54177 ( "Date" text, "Result" text, "Opponent" text, "Location" text, "Method" text )
What is the date of the match in Vilnius, Lithuania?
SELECT "Date" FROM table_54177 WHERE "Location" = 'vilnius, lithuania'
wikisql
CREATE TABLE table_15003 ( "Rank" real, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
Name the sum of gold when Bronze is less than 0
SELECT SUM("Gold") FROM table_15003 WHERE "Bronze" < '0'
wikisql
CREATE TABLE table_name_46 ( head_linesman VARCHAR, date VARCHAR )
Who is the head linesman of the game on 1 February 2009?
SELECT head_linesman FROM table_name_46 WHERE date = "1 february 2009"
sql_create_context
CREATE TABLE table ( league_cup INTEGER )
What is the lowest league cup?
SELECT MIN(league_cup) FROM table
sql_create_context
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...
Link-only answers in unclosed questions.
SELECT Questions.Score, Answers.Id AS "post_link", Answers.Score, Answers.Body FROM Posts AS Answers INNER JOIN Posts AS Questions ON Answers.ParentId = Questions.Id WHERE Answers.PostTypeId = 2 AND LENGTH(Answers.Body) < 100 AND Answers.Body LIKE '%http://%' AND Answers.Score < 0 AND Questions.ClosedDate IS NULL ORDER...
sede
CREATE TABLE table_2886617_4 ( nationality VARCHAR, player VARCHAR )
How many countries had players named Marc Savard get picked?
SELECT COUNT(nationality) FROM table_2886617_4 WHERE player = "Marc Savard"
sql_create_context
CREATE TABLE table_41104 ( "Year" real, "Winning team" text, "Losing team" text, "Score" text, "Site" text )
Which Score that has a Winning team of wei chuan dragons?
SELECT "Score" FROM table_41104 WHERE "Winning team" = 'wei chuan dragons'
wikisql
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, ...
在患者朱飞宇的医疗记录中,医疗费总额不低于1829.32元的入院诊断疾病名是什么?编码呢
SELECT t_kc21.OUT_DIAG_DIS_CD, t_kc21.OUT_DIAG_DIS_NM FROM t_kc21 WHERE t_kc21.PERSON_NM = '朱飞宇' AND t_kc21.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT >= 1829.32)
css
CREATE TABLE person_info ( RYBH text, XBDM number, XBMC text, XM text, CSRQ time, CSD text, MZDM text, MZMC text, GJDM text, GJMC text, JGDM text, JGMC text, XLDM text, XLMC text, ZYLBDM text, ZYMC text ) CREATE TABLE hz_info ( KH text, KLX number...
请提供检验报告单21931181267的检验申请机构和检验机构这两家机构的名称
SELECT JYSQJGMC, JYJGMC FROM jybgb WHERE BGDH = '21931181267'
css
CREATE TABLE table_21251 ( "Pos" text, "No" real, "Driver" text, "Constructor" text, "Q1 order" real, "Q1 time" text, "Q1 pos" real, "Q1+Q2 time" text )
What is the Q1 time for the driver with Q1 order of 6?
SELECT "Q1 time" FROM table_21251 WHERE "Q1 order" = '6'
wikisql
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...
Show me the number of all home by all home in a histogram, and show by the how many all home in descending.
SELECT All_Home, COUNT(All_Home) FROM basketball_match GROUP BY All_Home ORDER BY COUNT(All_Home) DESC
nvbench
CREATE TABLE table_203_118 ( id number, "game" number, "date" text, "opponent" text, "location" text, "score" text, "ot" text, "attendance" number, "record" text )
how many wins did the team have before march 4,2005 ?
SELECT COUNT(*) FROM table_203_118 WHERE id < (SELECT id FROM table_203_118 WHERE "date" = 'march 4, 2005') AND "score" = 'w'
squall
CREATE TABLE exhibition_record ( Exhibition_ID int, Date text, Attendance int ) CREATE TABLE artist ( Artist_ID int, Name text, Country text, Year_Join int, Age int ) CREATE TABLE exhibition ( Exhibition_ID int, Year int, Theme text, Artist_ID int, Ticket_Price real...
Bar chart x axis name y axis age, and rank Y in asc order.
SELECT Name, Age FROM artist ORDER BY Age
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, ...
患者郑欣嘉的检验报告单中有多少检验结果指标均异常?查询检验报告的单号
SELECT jybgb.BGDH FROM person_info JOIN hz_info JOIN zzmzjzjlb JOIN jybgb ON person_info.RYBH = hz_info.RYBH AND 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 person_info.XM = '郑...
css
CREATE TABLE publication ( abstract varchar, cid int, citation_num int, jid int, pid int, reference_num int, title varchar, year int ) CREATE TABLE domain_author ( aid int, did int ) CREATE TABLE writes ( aid int, pid int ) CREATE TABLE publication_keyword ( kid in...
return me the authors who have papers in the VLDB conference .
SELECT author.name FROM author, conference, publication, writes WHERE conference.name = 'VLDB' AND publication.cid = conference.cid AND writes.aid = author.aid AND writes.pid = publication.pid
academic
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE vitalperiodic ( ...
what are the three most commonly performed procedures for patients who were previously diagnosed with upper gi bleeding - gastritis in the same month, since 2105?
SELECT t3.treatmentname FROM (SELECT t2.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'upper gi bleeding - gastritis' AND STRFT...
eicu
CREATE TABLE table_19380 ( "Week" real, "Date" text, "Opponent" text, "Location" text, "Time ( ET )" text, "TV" text, "Result" text, "Record" text )
Name the record for l 24 22
SELECT "Record" FROM table_19380 WHERE "Result" = 'L 24–22'
wikisql
CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, ...
Yahoo-Answers: Question & Answer Statistics.
SELECT Posts.Id, Posts.Title, Posts.Tags, Posts.AcceptedAnswerId, Posts.Score, Posts.ViewCount, Posts.AnswerCount, Posts.CommentCount FROM Posts INNER JOIN PostTags AS pt ON Posts.Id = Pt.PostId INNER JOIN Tags AS t ON pt.TagId = t.Id WHERE t.TagName = 'yahoo-answers' ORDER BY Posts.Score DESC
sede
CREATE TABLE table_47907 ( "Reservation" text, "Location" text, "1969" real, "1979" real, "1989" real, "2000" real )
What shows for 2000 at the Fort Peck Indian Reservation, Montana, when the 1979 is less than 26.8?
SELECT AVG("2000") FROM table_47907 WHERE "Location" = 'montana' AND "Reservation" = 'fort peck indian reservation' AND "1979" < '26.8'
wikisql
CREATE TABLE table_63400 ( "Position" real, "Gymnast" text, "A Score" real, "B Score" real, "Total" real )
What is the A score for the person with a total less than 15.95, position less than 7, and B score more than 8.225?
SELECT MAX("A Score") FROM table_63400 WHERE "Total" < '15.95' AND "Position" < '7' AND "B Score" > '8.225'
wikisql
CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE days ( days_code varchar, day_name varchar ) CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE food_service ( meal_code text, meal_number int, compa...
list all TW flights from INDIANAPOLIS to HOUSTON that arrive in HOUSTON between 1030 and 1130
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE (((flight.arrival_time <= 1130 AND flight.arrival_time >= 1030) AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'HOUSTON' AND flight.to...
atis
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, ...
how many female patients had the procedure long title percutaneous transluminal coronary angioplasty (ptca)?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.gender = "F" AND procedures.long_title = "Percutaneous transluminal coronary angioplasty [PTCA]"
mimicsql_data
CREATE TABLE table_name_58 ( date VARCHAR, away_team VARCHAR )
What is the date of the game where South Melbourne was the away team?
SELECT date FROM table_name_58 WHERE away_team = "south melbourne"
sql_create_context
CREATE TABLE table_name_89 ( player VARCHAR, nationality VARCHAR, round VARCHAR, draft VARCHAR, pick VARCHAR )
Which Player has a Draft of 1994, a Pick larger than 8, a Round of 10, and a Nationality of canada?
SELECT player FROM table_name_89 WHERE draft = 1994 AND pick > 8 AND round = "10" AND nationality = "canada"
sql_create_context
CREATE TABLE table_61984 ( "Official Name" text, "Status" text, "Area km 2" real, "Population" real, "Census Ranking" text )
What is the area of drummond village?
SELECT MAX("Area km 2") FROM table_61984 WHERE "Status" = 'village' AND "Official Name" = 'drummond'
wikisql
CREATE TABLE table_203_230 ( id number, "place" text, "player" text, "country" text, "score" text, "to par" number )
how many times does tiger woods appear in the list ?
SELECT COUNT(*) FROM table_203_230 WHERE "player" = 'tiger woods'
squall
CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE course_tags_count ( course_id int, clear_grading int, pop_...
Is it possible for me to take 311 on Mondays and Wednesdays ?
SELECT COUNT(*) > 0 FROM course, course_offering, semester WHERE course_offering.friday = 'N' AND course_offering.monday = 'Y' AND course_offering.thursday = 'N' AND course_offering.tuesday = 'N' AND course_offering.wednesday = 'Y' AND course.course_id = course_offering.course_id AND course.department = 'EECS' AND cour...
advising
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, ...
医疗机构7265817金额前24名的项目有哪些
SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '7265817' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY SUM(t_kc22.AMOUNT) DESC LIMIT 24
css
CREATE TABLE table_name_20 ( losses INTEGER, wins INTEGER )
What's the greatest losses for those with more than 13 wins?
SELECT MAX(losses) FROM table_name_20 WHERE wins > 13
sql_create_context
CREATE TABLE table_name_34 ( studio VARCHAR, rank VARCHAR, gross VARCHAR )
Which studio grossed $83,531,958 and ranked lower than 13?
SELECT studio FROM table_name_34 WHERE rank > 13 AND gross = "$83,531,958"
sql_create_context
CREATE TABLE table_54363 ( "Candidate" text, "Contributions" real, "Loans Received" real, "All Receipts" real, "Operating Expenditures" real, "All Disbursements" real )
What is the most Receipts for Barack Obama with Disbursements smaller than 85,176,289?
SELECT MAX("All Receipts") FROM table_54363 WHERE "Candidate" = 'barack obama' AND "All Disbursements" < '85,176,289'
wikisql
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 editors in a given period.
SELECT ph.UserId AS "user_link", COUNT(DISTINCT RevisionGUID) AS Count FROM PostHistory AS ph INNER JOIN Posts AS p ON p.Id = ph.PostId WHERE ph.PostHistoryTypeId IN (4, 5, 6) AND (ph.CreationDate >= '##Date1?2018-01-01##') AND (ph.CreationDate <= '##Date2?2018-12-31##') AND ph.UserId != p.OwnerUserId GROUP BY ph.UserI...
sede
CREATE TABLE table_50503 ( "Year" real, "Team" text, "Co-Drivers" text, "Class" text, "Laps" real, "Pos." text, "Class Pos." text )
What is the total number of laps that Beno t Tr yluyer completed when his position was 7th and the year was before 2008?
SELECT COUNT("Laps") FROM table_50503 WHERE "Class Pos." = '7th' AND "Year" < '2008'
wikisql
CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDa...
Users with more than 1000 upvotes.
SELECT * FROM Users WHERE UpVotes > 1000
sede
CREATE TABLE table_46347 ( "Year" real, "Round" text, "Opponent" text, "Result" text, "BSU Head Coach" text )
What is the sum of the years with bus conner as the BSU head coach?
SELECT SUM("Year") FROM table_46347 WHERE "BSU Head Coach" = 'bus conner'
wikisql
CREATE TABLE table_name_12 ( opponents VARCHAR, venue VARCHAR )
When the game was played at Domnarvsvallen who were the opponents?
SELECT opponents FROM table_name_12 WHERE venue = "domnarvsvallen"
sql_create_context
CREATE TABLE hz_info ( KH text, KLX number, YLJGDM text, RYBH text ) CREATE TABLE jybgb ( YLJGDM text, YLJGDM_MZJZJLB text, YLJGDM_ZYJZJLB text, BGDH text, BGRQ time, JYLX number, JZLSH text, JZLSH_MZJZJLB text, JZLSH_ZYJZJLB text, JZLX number, KSBM text, ...
19146116这个病人检验的上肢各项指标怎么样
(SELECT * FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE hz_info.RYBH = ...
css
CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,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...
For all employees who have the letters D or S in their first name, draw a bar chart about the distribution of hire_date and the average of department_id bin hire_date by time, and could you display y-axis from high to low order?
SELECT HIRE_DATE, AVG(DEPARTMENT_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY AVG(DEPARTMENT_ID) DESC
nvbench
CREATE TABLE table_name_18 ( round INTEGER, opponent VARCHAR )
What is the average round against opponent Klas Akesson?
SELECT AVG(round) FROM table_name_18 WHERE opponent = "klas akesson"
sql_create_context
CREATE TABLE table_4860 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What was the home teams score at Victoria Park when attendance was more than 12,000?
SELECT "Home team score" FROM table_4860 WHERE "Crowd" > '12,000' AND "Venue" = 'victoria park'
wikisql
CREATE TABLE table_204_137 ( id number, "race" number, "race name" text, "pole position" text, "fastest lap" text, "winning driver" text, "winning team" text, "yokohama winner" text, "jay-ten winner" text, "report" text )
how many pole positions were won by robert huff ?
SELECT COUNT(*) FROM table_204_137 WHERE "pole position" = 'robert huff'
squall
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose...
tell me the price of n-acetylcysteine study drug.
SELECT DISTINCT cost.cost FROM cost WHERE cost.event_type = 'prescriptions' AND cost.event_id IN (SELECT prescriptions.row_id FROM prescriptions WHERE prescriptions.drug = 'n-acetylcysteine study drug')
mimic_iii
CREATE TABLE table_59096 ( "Player" text, "Country" text, "Year(s) won" text, "Total" real, "To par" text, "Finish" text )
What golfer has 281 as their total?
SELECT "Player" FROM table_59096 WHERE "Total" = '281'
wikisql
CREATE TABLE table_name_24 ( name VARCHAR, novelty VARCHAR, location VARCHAR, status VARCHAR, authors VARCHAR )
What is Name, when Status is Valid, when Authors is Maisch, when Location is Tanzania, and when Novelty is Gen Et Sp Nov?
SELECT name FROM table_name_24 WHERE status = "valid" AND authors = "maisch" AND location = "tanzania" AND novelty = "gen et sp nov"
sql_create_context
CREATE TABLE table_17369 ( "Year" real, "Division" text, "League" text, "Reg. Season" text, "Playoffs" text, "Open Cup" text )
How many teams placed 4th in the regular season?
SELECT COUNT("Division") FROM table_17369 WHERE "Reg. Season" = '4th'
wikisql
CREATE TABLE table_52498 ( "Block A" text, "BLACK BUSHI" text, "BUSHI" text, "Kaz Hayashi" text, "Kenny Omega" text, "Minoru" text )
Name the Kaz Hayashi which has BUSHI of yang (9:43)
SELECT "Kaz Hayashi" FROM table_52498 WHERE "BUSHI" = 'yang (9:43)'
wikisql
CREATE TABLE Stores ( Store_ID VARCHAR(100), Address_ID INTEGER, Marketing_Region_Code CHAR(15), Store_Name VARCHAR(255), Store_Phone VARCHAR(255), Store_Email_Address VARCHAR(255), Other_Details VARCHAR(255) ) CREATE TABLE Addresses ( Address_ID VARCHAR(100), Line_1 VARCHAR(255), ...
What are the names of the workshop groups that have bookings with status code 'stop', and count them by a bar chart, could you show total number from low to high order?
SELECT Store_Name, COUNT(Store_Name) FROM Bookings AS T1 JOIN Drama_Workshop_Groups AS T2 ON T1.Workshop_Group_ID = T2.Workshop_Group_ID WHERE T1.Status_Code = "stop" GROUP BY Store_Name ORDER BY COUNT(Store_Name)
nvbench
CREATE TABLE table_name_12 ( long INTEGER, yards VARCHAR, player VARCHAR )
Name the sum of Long for yards less than 197 and players of matt nagy
SELECT SUM(long) FROM table_name_12 WHERE yards < 197 AND player = "matt nagy"
sql_create_context
CREATE TABLE table_name_2 ( country VARCHAR, place VARCHAR, player VARCHAR )
What country has t6 as the place, with seve ballesteros as the player?
SELECT country FROM table_name_2 WHERE place = "t6" AND player = "seve ballesteros"
sql_create_context
CREATE TABLE table_name_47 ( games INTEGER, team VARCHAR, rebounds VARCHAR )
What is the number of Games for the Maccabi Tel Aviv Team with less than 208 Rebounds?
SELECT AVG(games) FROM table_name_47 WHERE team = "maccabi tel aviv" AND rebounds < 208
sql_create_context
CREATE TABLE table_12261806_2 ( young_rider_classification VARCHAR, winner VARCHAR )
Name the young rider classification with laudelino cubino
SELECT young_rider_classification FROM table_12261806_2 WHERE winner = "Laudelino Cubino"
sql_create_context
CREATE TABLE table_59264 ( "Position" real, "Club" text, "Played" real, "Points" real, "Wins" real, "Draws" real, "Losses" real, "Goals for" real, "Goals against" real, "Goal Difference" real )
What is the average number of goals for entries with more than 12 losses, more than 10 wins, more than 3 draws, and fewer than 29 points?
SELECT AVG("Goals for") FROM table_59264 WHERE "Losses" > '12' AND "Wins" > '10' AND "Points" < '29' AND "Draws" > '3'
wikisql
CREATE TABLE table_74199 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
What is the date for the game with team orlando?
SELECT "Date" FROM table_74199 WHERE "Team" = 'Orlando'
wikisql
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number,...
what is the total amount of deliver 2.0 that patient 1561 had received on 12/31/this year?
SELECT SUM(inputevents_cv.amount) 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 = 1561)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.labe...
mimic_iii
CREATE TABLE table_71424 ( "Year" real, "Entrant" text, "Chassis" text, "Engine" text, "Points" real )
What was the sum of the years, when the entrant was Scuderia Ferrari, and when the Chassis was Ferrari 312/66?
SELECT SUM("Year") FROM table_71424 WHERE "Entrant" = 'scuderia ferrari' AND "Chassis" = 'ferrari 312/66'
wikisql
CREATE TABLE table_name_7 ( film VARCHAR, nominating_festival VARCHAR )
The Prix UIP Vilo Do Conde festival nominated which film?
SELECT film FROM table_name_7 WHERE nominating_festival = "prix uip vilo do conde"
sql_create_context
CREATE TABLE table_42489 ( "English" text, "German" text, "Dutch" text, "Icelandic" text, "Latin" text, "Greek" text, "Russian" text )
What is the Russian word for the Greek word greek?
SELECT "Russian" FROM table_42489 WHERE "Greek" = 'greek'
wikisql
CREATE TABLE table_name_96 ( home VARCHAR, score VARCHAR )
Who was the home team at the game that had a score of 2 2?
SELECT home FROM table_name_96 WHERE score = "2 – 2"
sql_create_context
CREATE TABLE table_22481967_1 ( builder VARCHAR, date VARCHAR )
List the builder from 1930.
SELECT builder FROM table_22481967_1 WHERE date = "1930"
sql_create_context
CREATE TABLE table_41295 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text )
What is the Place, when the Score is 68-70-71=209?
SELECT "Place" FROM table_41295 WHERE "Score" = '68-70-71=209'
wikisql