context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_21867 ( "Fin. Pos" real, "Car No." real, "Driver" text, "Team" text, "Laps" real, "Time/Retired" text, "Grid" real, "Laps Led" real, "Points" text )
If the points is 20, what was the team name?
SELECT "Team" FROM table_21867 WHERE "Points" = '20'
wikisql
CREATE TABLE table_5960 ( "Club" text, "Location" text, "Stadium" text, "Capacity" real, "Current manager" text )
What is the capacity for the stadium of kadrioru stadium and a current manager of sergei ratnikov?
SELECT AVG("Capacity") FROM table_5960 WHERE "Stadium" = 'kadrioru stadium' AND "Current manager" = 'sergei ratnikov'
wikisql
CREATE TABLE table_10647639_1 ( week INTEGER )
How many weeks are there?
SELECT MAX(week) FROM table_10647639_1
sql_create_context
CREATE TABLE table_203_183 ( id number, "season" text, "tier" number, "division" number, "place" text )
how many times has the team finished 9th ?
SELECT COUNT(*) FROM table_203_183 WHERE "place" = 9
squall
CREATE TABLE table_68990 ( "Year" real, "Entrant" text, "Chassis" text, "Engine" text, "Points" real )
What is the entrant in 1999?
SELECT "Entrant" FROM table_68990 WHERE "Year" = '1999'
wikisql
CREATE TABLE table_74934 ( "Circuit" text, "Date" text, "Pole position" text, "Fastest Lap" text, "Winning driver" text, "Winning team" text, "Winning manufacturer" text )
Who is the winning driver of the Oschersleben circuit with Timo Scheider as the pole position?
SELECT "Winning driver" FROM table_74934 WHERE "Pole position" = 'timo scheider' AND "Circuit" = 'oschersleben'
wikisql
CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGu...
Possible editors for the 'rebol' tag. Lists every user who has ever answered a question on the 'rebol' tag, along with if they have sufficient rep to edit questions
SELECT MAX(Users.Reputation), Users.Id AS "user_link", 'can_edit' = CASE WHEN MAX(Users.Reputation) >= 2000 THEN 'yes' ELSE 'no' END FROM Posts, Users, PostTags, Tags WHERE Posts.OwnerUserId = Users.Id AND Posts.ParentId = PostTags.PostId AND PostTags.TagId = Tags.Id AND Tags.TagName = 'rebol' GROUP BY Users.Id ORDER B...
sede
CREATE TABLE table_2182562_2 ( team_s_ VARCHAR, avg_start VARCHAR )
How many different teams had an average start of 12.9?
SELECT COUNT(team_s_) FROM table_2182562_2 WHERE avg_start = "12.9"
sql_create_context
CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, LastAutoRename time, Score number, ApprovedByUserId number, ApprovalDate time ) CREATE TABLE PostTypes ( Id number, Name text ) C...
Search comments by any keyword.
SELECT c.Text, c.Id AS "comment_link", CreationDate FROM Comments AS c WHERE c.Text LIKE '%##keyword1##%' AND LENGTH(c.Text) <= 25 ORDER BY CreationDate DESC LIMIT 100
sede
CREATE TABLE table_name_20 ( circuit VARCHAR, winning_constructor VARCHAR, winning_driver VARCHAR )
What Circuit has a Winning constructor of bugatti, and a Winning driver of edward bret?
SELECT circuit FROM table_name_20 WHERE winning_constructor = "bugatti" AND winning_driver = "edward bret"
sql_create_context
CREATE TABLE table_203_237 ( id number, "n" number, "p" text, "nat." text, "name" text, "age" number, "moving from" text, "type" text, "transfer\nwindow" text, "ends" number, "transfer\nfee" text )
who had a larger transfer fee ? gavin rae or bajram fetai ?
SELECT "name" FROM table_203_237 WHERE "name" IN ('gavin rae', 'bajram fetai') ORDER BY "transfer\nfee" DESC LIMIT 1
squall
CREATE TABLE table_49647 ( "Game" real, "Date" text, "Opponent" text, "Score" text, "Location" text, "Record" text )
What is the celtics record after game 33 when they score of the game was 111-108?
SELECT "Record" FROM table_49647 WHERE "Game" > '33' AND "Score" = '111-108'
wikisql
CREATE TABLE table_58779 ( "Position" real, "Team" text, "Played" real, "Drawn" real, "Lost" real, "Goals For" real, "Goals Against" real, "Goal Difference" text, "Points 1" text )
What is the highest position for Nelson, with a played entry of more than 24?
SELECT MAX("Position") FROM table_58779 WHERE "Team" = 'nelson' AND "Played" > '24'
wikisql
CREATE TABLE table_name_80 ( games INTEGER, team VARCHAR, rank VARCHAR, rebounds VARCHAR )
Which game did Bruesa GBC play in with fewer than 275 rebounds that is ranked less than 4?
SELECT SUM(games) FROM table_name_80 WHERE rank < 4 AND rebounds < 275 AND team = "bruesa gbc"
sql_create_context
CREATE TABLE table_train_215 ( "id" int, "hemoglobin_a1c_hba1c" float, "hgba1c" float, "estimated_glomerular_filtration_rate_egfr" int, "kidney_disease" bool, "body_mass_index_bmi" float, "age" float, "NOUSE" float )
have a bmi of less than the 90 percentile for age.
SELECT * FROM table_train_215 WHERE body_mass_index_bmi < 90
criteria2sql
CREATE TABLE Attribute_Definitions ( attribute_data_type VARCHAR, attribute_name VARCHAR )
What is the attribute data type of the attribute with name 'Green'?
SELECT attribute_data_type FROM Attribute_Definitions WHERE attribute_name = "Green"
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 procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( ...
count the number of patients whose insurance is private and procedure icd9 code is 12?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Private" AND procedures.icd9_code = "12"
mimicsql_data
CREATE TABLE table_55662 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real )
Who constructed grid 14?
SELECT "Constructor" FROM table_55662 WHERE "Grid" = '14'
wikisql
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TAB...
until 2104 what are the four most commonly ordered medications for patients of age 60 or above?
SELECT t1.drugname FROM (SELECT medication.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age >= 60) AND STRFTIME('%y', medication.drugstarttime) <= '2104' GROUP BY medication.drugname) AS t1 W...
eicu
CREATE TABLE t_kc24 ( MED_SAFE_PAY_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, REF_SLT_FLG number, CLINIC_SLT_DATE time, COMP_ID text, PERSON_ID text, FLX_MED_ORG_ID text, INSU_TYPE text, MED_AMOUT number, PER_ACC_PAY number, OVE_PAY numb...
从一五年十二月二十六日到一七年一月二十一日,患者14788506的医保总共被刷了多少金额的医疗费
SELECT SUM(MED_AMOUT) FROM t_kc24 WHERE PERSON_ID = '14788506' AND CLINIC_SLT_DATE BETWEEN '2015-12-26' AND '2017-01-21'
css
CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime ti...
heart rate for patient 25233 second measured on the first icu visit is less than the value first measured on the first icu visit?
SELECT (SELECT chartevents.valuenum FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 25233) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime LIMIT 1) AND chartevents.item...
mimic_iii
CREATE TABLE table_17077 ( "Player" text, "Position" text, "School" text, "Hometown" text, "College" text )
How many positions does Greg Bryant play?
SELECT COUNT("Position") FROM table_17077 WHERE "Player" = 'Greg Bryant'
wikisql
CREATE TABLE table_58237 ( "Index (Year)" text, "Author / Editor / Source" text, "Year of publication" text, "Countries sampled" real, "World Ranking (1)" text, "Ranking L.A. (2)" text )
In 2008, what was the world ranking that ranked 5th in L.A.?
SELECT "World Ranking (1)" FROM table_58237 WHERE "Ranking L.A. (2)" = '5th' AND "Year of publication" = '2008'
wikisql
CREATE TABLE table_65065 ( "Pick" real, "Player" text, "Country of origin*" text, "PBA team" text, "College" text )
What is the College of the Player from PBA Team Alaska Milkmen with a Pick number of 3 or less?
SELECT "College" FROM table_65065 WHERE "Pick" < '3' AND "PBA team" = 'alaska milkmen'
wikisql
CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, outtime time ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, ...
what was the three most frequently ordered laboratory tests for patients who had already been diagnosed with ac alcoholic hepatitis during the same month, since 2103?
SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT t3.itemid FROM (SELECT t2.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.i...
mimic_iii
CREATE TABLE table_name_38 ( nationality VARCHAR, pick INTEGER )
What nationality has a pick greater than 129?
SELECT nationality FROM table_name_38 WHERE pick > 129
sql_create_context
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
What is the maximum age of patient who speaks English and is diagnosed for hypertension; rule out coronary artery disease/caridac cath?
SELECT MAX(demographic.age) FROM demographic WHERE demographic.language = "ENGL" AND demographic.diagnosis = "HYPERTENSION;RULE OUT CORONARY ARTERY DISEASE\CARDIAC CATH"
mimicsql_data
CREATE TABLE Dorm_amenity ( amenid INTEGER, amenity_name VARCHAR(25) ) CREATE TABLE Lives_in ( stuid INTEGER, dormid INTEGER, room_number INTEGER ) CREATE TABLE Dorm ( dormid INTEGER, dorm_name VARCHAR(20), student_capacity INTEGER, gender VARCHAR(1) ) CREATE TABLE Has_amenity ( ...
Find the average age for students with different sex in a bar chart.
SELECT Sex, AVG(Age) FROM Student GROUP BY Sex
nvbench
CREATE TABLE table_12165135_1 ( position VARCHAR, overall_pick__number VARCHAR )
What is the position for the pick number 17?
SELECT position FROM table_12165135_1 WHERE overall_pick__number = 17
sql_create_context
CREATE TABLE table_69710 ( "City" text, "Country" text, "IATA" text, "ICAO" text, "Airport" text )
what's the iata for the icao of eheh?
SELECT "IATA" FROM table_69710 WHERE "ICAO" = 'eheh'
wikisql
CREATE TABLE table_62782 ( "Year" real, "Chassis" text, "Engine" text, "Start" real, "Finish" real, "Team" text )
What is the start of the Team of Andretti Green Racing with a finish higher than 3 in a year before 2007?
SELECT AVG("Start") FROM table_62782 WHERE "Team" = 'andretti green racing' AND "Finish" > '3' AND "Year" < '2007'
wikisql
CREATE TABLE table_2252745_1 ( pop__km² VARCHAR, area__km²_ VARCHAR )
when the area (km ) is 22721, what is the pop./ km ?
SELECT pop__km² FROM table_2252745_1 WHERE area__km²_ = 22721
sql_create_context
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
count the number of patients whose death status is 1 and age is less than 77?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.expire_flag = "1" AND demographic.age < "77"
mimicsql_data
CREATE TABLE table_1126 ( "Position" real, "Team" text, "Played" real, "Wins" real, "Draws" real, "Losses" real, "Scored" real, "Conceded" real, "Points" real )
Name the most draws when wins is 3
SELECT MAX("Draws") FROM table_1126 WHERE "Wins" = '3'
wikisql
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TA...
how many hours has it been since first time patient 009-5001 had a procedure on this hospital visit?
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', treatment.treatmenttime)) FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '009-5001'...
eicu
CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, P...
Why is bounty start/close timing data removed from the data explorer?. http://meta.stackexchange.com/questions/281217/why-is-bounty-start-close-timing-data-removed-from-the-data-explorer
SELECT v.PostId, v.CreationDate, ph.CreationDate, ph.Text, ph.Comment, v.BountyAmount FROM Votes AS v INNER JOIN PostHistory AS ph ON ph.PostId = v.PostId WHERE (v.VoteTypeId = 8 AND ph.PostHistoryTypeId = 33)
sede
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, ...
看看住院就诊49376399892的入住病区的名称是什么?病区的代码是什么?床位号是什么
SELECT zyjzjlb.RZBQDM, zyjzjlb.RZBQMC, zyjzjlb.RYCWH FROM zyjzjlb WHERE zyjzjlb.JZLSH = '49376399892'
css
CREATE TABLE table_60018 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Game site" text, "Record" text, "Attendance" real )
Which Opponent has an Attendance greater than 14,431 during Week 3 at Bears Stadium Game site?
SELECT "Opponent" FROM table_60018 WHERE "Attendance" > '14,431' AND "Game site" = 'bears stadium' AND "Week" = '3'
wikisql
CREATE TABLE table_18268930_1 ( partner VARCHAR, location VARCHAR )
Who's the partner at Tamara, Hon?
SELECT partner FROM table_18268930_1 WHERE location = "Tamara, HON"
sql_create_context
CREATE TABLE table_22782 ( "Name" text, "Home or representative town or province" text, "Age" real, "Edition" text, "Total days in PBB House" real, "Duration" text, "Status" text )
When guiguinto, bulacan is the home or representative town or province how many names are there?
SELECT COUNT("Name") FROM table_22782 WHERE "Home or representative town or province" = 'Guiguinto, Bulacan'
wikisql
CREATE TABLE table_name_38 ( result VARCHAR, goals VARCHAR )
Which result has a Goal of deacon 3/5, bridge 2/2?
SELECT result FROM table_name_38 WHERE goals = "deacon 3/5, bridge 2/2"
sql_create_context
CREATE TABLE table_24649082_1 ( production_code VARCHAR, written_by VARCHAR )
What is the production code for the episode written by J. H. Wyman & Jeff Pinkner?
SELECT production_code FROM table_24649082_1 WHERE written_by = "J. H. Wyman & Jeff Pinkner"
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, ...
哪几个医院给患者16090485开了编号为056956的药
SELECT gwyjzb.MED_SER_ORG_NO FROM gwyjzb WHERE gwyjzb.PERSON_ID = '16090485' AND gwyjzb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.SOC_SRT_DIRE_CD = '056956') UNION SELECT fgwyjzb.MED_SER_ORG_NO FROM fgwyjzb WHERE fgwyjzb.PERSON_ID = '16090485' AND fgwyjzb.MED_CLINIC_ID IN (SELECT t_kc22.MED...
css
CREATE TABLE table_name_73 ( year VARCHAR, category VARCHAR )
What year saw an award in the category of Revelation?
SELECT year FROM table_name_73 WHERE category = "revelation"
sql_create_context
CREATE TABLE table_74755 ( "Region" text, "Date" text, "Label" text, "Format" text, "Catalog" text )
What label has a catalog of chem036cd?
SELECT "Label" FROM table_74755 WHERE "Catalog" = 'chem036cd'
wikisql
CREATE TABLE DEPARTMENT ( DEPT_CODE varchar(10), DEPT_NAME varchar(30), SCHOOL_CODE varchar(8), EMP_NUM int, DEPT_ADDRESS varchar(20), DEPT_EXTENSION varchar(4) ) CREATE TABLE EMPLOYEE ( EMP_NUM int, EMP_LNAME varchar(15), EMP_FNAME varchar(12), EMP_INITIAL varchar(1), EMP_J...
Find the number of students for each department Plot them as bar chart, I want to list by the names in asc.
SELECT DEPT_CODE, COUNT(*) FROM STUDENT GROUP BY DEPT_CODE ORDER BY DEPT_CODE
nvbench
CREATE TABLE table_56691 ( "Year" real, "Champion" text, "Score" text, "Runner-Up" text, "Location" text, "Semi-Finalist #1" text, "Semi-Finalist #2" text )
Which champion was from the location of Morrisville, NC, and whose SemiFinalist #2 of Clemson?
SELECT "Champion" FROM table_56691 WHERE "Location" = 'morrisville, nc' AND "Semi-Finalist #2" = 'clemson'
wikisql
CREATE TABLE table_69914 ( "Rank" real, "Lane" real, "Name" text, "Nationality" text, "Time" text )
Which france nationality has a lane larger than 3?
SELECT "Name" FROM table_69914 WHERE "Lane" > '3' AND "Nationality" = 'france'
wikisql
CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC text, RYBH text, XBDM number, XBMC text, XLDM text, XLMC text, XM text, ZYLBDM text, ZYMC text ) CREATE TABLE wdmzjzjlb ( CYBQDM text, CYBQ...
列出患者30900247入院科室名称在医院7528776中不包含青光眼的住院有什么就诊记录?
SELECT * 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 = '30900247' AND hz_info.YLJGDM = '7528776' AND NOT wdmzjzjlb.JZKSMC LIKE '%青光眼%' UNION SELECT * FROM hz_info JOIN bdmzjzjlb ON hz_info.YLJGDM = bdmzjzjlb.YLJGDM AND...
css
CREATE TABLE table_2266762_1 ( driver VARCHAR, team VARCHAR, race_time VARCHAR )
Who was the driver for the Richard Childress Racing team in the race with a time of 2:58:22?
SELECT driver FROM table_2266762_1 WHERE team = "Richard Childress Racing" AND race_time = "2:58:22"
sql_create_context
CREATE TABLE table_72927 ( "Body style" text, "Wheelbase" text, "Length" text, "Height" text, "Curb weight" text )
What are the lengths of the models that are mm (in) tall?
SELECT "Length" FROM table_72927 WHERE "Height" = 'mm (in)'
wikisql
CREATE TABLE table_name_32 ( _percentage_2001 VARCHAR, seats_2001 VARCHAR )
What is the sum of % for 2001 if 2001 seats equals 7?
SELECT COUNT(_percentage_2001) FROM table_name_32 WHERE seats_2001 = 7
sql_create_context
CREATE TABLE table_30121096_1 ( civil_parish VARCHAR, townland VARCHAR )
Which civil parish is for the townland clooncugger?
SELECT civil_parish FROM table_30121096_1 WHERE townland = "Clooncugger"
sql_create_context
CREATE TABLE hz_info_mzjzjlb ( JZLSH number, YLJGDM number, mzjzjlb_id number ) 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, ...
从2009年9月11日直到17年9月26日为止编号为52631015的作为检查人对患者15672063所有检验结果指标记载的检验指标流水号都是啥?
SELECT jyjgzbb.JYZBLSH FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN hz_info_mzjzjlb ON hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM A...
css
CREATE TABLE Department_Stores ( dept_store_id INTEGER, dept_store_chain_id INTEGER, store_name VARCHAR(80), store_address VARCHAR(255), store_phone VARCHAR(80), store_email VARCHAR(80) ) CREATE TABLE Customer_Orders ( order_id INTEGER, customer_id INTEGER, order_status_code VARCHAR...
For each product type, show the relationship between minimum product price and maximum product price in a scatter chart.
SELECT MAX(product_price), MIN(product_price), product_type_code FROM Products GROUP BY product_type_code
nvbench
CREATE TABLE table_53690 ( "Points" real, "Player" text, "Tries" real, "Goals" real, "Field Goals" real )
What is the average amount of goals that has a points smaller of 882, less than 5 field goals, and less than 85 tries all by Ty Williams.
SELECT AVG("Goals") FROM table_53690 WHERE "Points" < '882' AND "Field Goals" < '5' AND "Player" = 'ty williams' AND "Tries" < '85'
wikisql
CREATE TABLE fgwyjzb ( 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, ...
能告诉我病人金秀筠所有医疗记录中医疗费总额不低于8263.6元的入院诊断疾病编码和名称吗
SELECT gwyjzb.IN_DIAG_DIS_CD, gwyjzb.IN_DIAG_DIS_NM FROM gwyjzb WHERE gwyjzb.PERSON_NM = '金秀筠' AND gwyjzb.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT >= 8263.6) UNION SELECT fgwyjzb.IN_DIAG_DIS_CD, fgwyjzb.IN_DIAG_DIS_NM FROM fgwyjzb WHERE fgwyjzb.PERSON_NM = '金秀筠' AND fgwyjzb.MED_C...
css
CREATE TABLE table_61161 ( "Lince" text, "Leopard 2A4" text, "Leclerc" text, "M1A1 Abrams" text, "M60A3 Patton" text )
What is the M60A3 that has 40 rounds as Leclerc?
SELECT "M60A3 Patton" FROM table_61161 WHERE "Leclerc" = '40 rounds'
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...
Top User Of Hong Kong.
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_44 ( district VARCHAR, iucn VARCHAR, est VARCHAR )
Which district has an IUCN of iii and was established in 1998?
SELECT district FROM table_name_44 WHERE iucn = "iii" AND est = 1998
sql_create_context
CREATE TABLE table_2508633_11 ( nfl_team VARCHAR, player VARCHAR )
What NFL Teams have the player Aaron Williams?
SELECT nfl_team FROM table_2508633_11 WHERE player = "Aaron Williams"
sql_create_context
CREATE TABLE area ( course_id int, area varchar ) CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE course ( course_id int, name varchar, department varchar, number varchar, credits varchar, advisory_requirement varchar, enforced_requi...
Is 398 offered next semester and when ?
SELECT DISTINCT course_offering.end_time, course_offering.friday, course_offering.monday, course_offering.saturday, course_offering.start_time, course_offering.sunday, course_offering.thursday, course_offering.tuesday, course_offering.wednesday FROM course, course_offering, semester WHERE course.course_id = course_offe...
advising
CREATE TABLE table_38631 ( "Call sign" text, "Frequency MHz" text, "City of license" text, "ERP W" real, "Class" text, "FCC info" text )
What is surfside beach, SC frequency?
SELECT "Frequency MHz" FROM table_38631 WHERE "City of license" = 'surfside beach, sc'
wikisql
CREATE TABLE table_12148147_2 ( second_year VARCHAR, fourth_year VARCHAR )
What is the second year course in the program where physics is taken in the fourth year?
SELECT second_year FROM table_12148147_2 WHERE fourth_year = "Physics"
sql_create_context
CREATE TABLE table_1376890_2 ( chroma_format VARCHAR, name VARCHAR )
what's the chroma format with name being high profile
SELECT chroma_format FROM table_1376890_2 WHERE name = "High profile"
sql_create_context
CREATE TABLE program_course ( program_id int, course_id int, workload int, category varchar ) CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, country varchar, zip int ) CREATE TABLE course ( c...
Will taking the 615 and 554 allow me to leave for work at 5 each day ?
SELECT COUNT(*) = 0 FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester WHERE (course.number = 615 OR course.number = 554) AND course_offering.end_time > '17:00:00' AND semester.semester = 'WN' AND semester.year = ...
advising
CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE cost ( row_i...
what does a lab hemoglobin test cost?
SELECT DISTINCT cost.cost FROM cost WHERE cost.event_type = 'labevents' AND cost.event_id IN (SELECT labevents.row_id FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'hemoglobin'))
mimic_iii
CREATE TABLE table_10812293_3 ( location_attendance VARCHAR, date VARCHAR )
Where was the game on November 20?
SELECT location_attendance FROM table_10812293_3 WHERE date = "November 20"
sql_create_context
CREATE TABLE schedule ( Cinema_ID int, Film_ID int, Date text, Show_times_per_day int, Price float ) CREATE TABLE film ( Film_ID int, Rank_in_series int, Number_in_season int, Title text, Directed_by text, Original_air_date text, Production_code text ) CREATE TABLE cine...
For each film, return the number of cinemas showing that fim in a bar chart, and I want to order by the the number of title in asc.
SELECT Title, COUNT(Title) FROM schedule AS T1 JOIN film AS T2 ON T1.Film_ID = T2.Film_ID JOIN cinema AS T3 ON T1.Cinema_ID = T3.Cinema_ID GROUP BY Title ORDER BY COUNT(Title)
nvbench
CREATE TABLE table_name_81 ( played VARCHAR, points VARCHAR, drawn VARCHAR, team VARCHAR )
How many games played for the army team with over 51 points and under 5 games drawn?
SELECT COUNT(played) FROM table_name_81 WHERE drawn < 5 AND team = "army" AND points > 51
sql_create_context
CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDa...
How many users have 30k+?.
SELECT COUNT(*) AS users FROM Users WHERE Reputation >= 30000
sede
CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId numb...
count of comments for questions.
SELECT UserId FROM Comments WHERE NOT UserId IS NULL GROUP BY UserId ORDER BY COUNT(*) DESC
sede
CREATE TABLE table_67085 ( "Name" text, "Championship" real, "League Cup" real, "FA Cup" real, "Total" text )
How many FA cups were there without any league cups, but a total of 0 2?
SELECT MIN("FA Cup") FROM table_67085 WHERE "Total" = '0 2' AND "League Cup" < '0'
wikisql
CREATE TABLE table_11395 ( "State" text, "Interview" real, "Swimsuit" real, "Evening Gown" real, "Average" real )
Which smallest interview number had a swimsuit stat of less than 9.322, an evening gown score of more than 9.259, and an average number of 9.321?
SELECT MIN("Interview") FROM table_11395 WHERE "Swimsuit" < '9.322' AND "Evening Gown" > '9.259' AND "Average" = '9.321'
wikisql
CREATE TABLE table_53759 ( "Candidate" text, "Money Raised, 3Q" text, "Loans Received, 3Q" text, "Money Spent, 3Q" text, "Total Receipts" text, "Cash On Hand" text, "Total Debt" text, "After Debt" text )
How much cash was on hand after debt of $82,741?
SELECT "Cash On Hand" FROM table_53759 WHERE "After Debt" = '$82,741'
wikisql
CREATE TABLE table_200_4 ( id number, "team" text, "p" number, "w" number, "t" number, "l" number, "gf" number, "ga" number, "gd" number, "pts." number )
what team had the worst win/tie/loss record ?
SELECT "team" FROM table_200_4 ORDER BY "pts." LIMIT 1
squall
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 last weight for patient 021-250695 during the last hospital visit?
SELECT patient.admissionweight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '021-250695' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitaladmittime DESC LIMIT 1) AND NOT patient.admissionweight IS NULL ORDE...
eicu
CREATE TABLE branch ( branch_id number, name text, open_year text, address_road text, city text, membership_amount text ) CREATE TABLE membership_register_branch ( member_id number, branch_id text, register_year text ) CREATE TABLE member ( member_id number, card_number tex...
Show member names without any registered branch.
SELECT name FROM member WHERE NOT member_id IN (SELECT member_id FROM membership_register_branch)
spider
CREATE TABLE table_name_90 ( entrant VARCHAR, engine VARCHAR, driver VARCHAR )
Who is the entrant when the engine is talbot l6 and the driver is pierre levegh?
SELECT entrant FROM table_name_90 WHERE engine = "talbot l6" AND driver = "pierre levegh"
sql_create_context
CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, outtime time ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, ...
tell me the number of times that patient 95892 has received an mcv lab test during this month.
SELECT COUNT(*) FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'mcv') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 95892) AND DATETIME(labevents.charttime, 'start of month') = DATETIME(CURRENT_TIME(), 'star...
mimic_iii
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 patients did a wbc pleural lab test and had the results show abnormal status?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.flag = "abnormal" AND lab.label = "WBC, Pleural"
mimicsql_data
CREATE TABLE table_name_78 ( third VARCHAR, lead VARCHAR )
Which Third has a Lead of zanda bik e?
SELECT third FROM table_name_78 WHERE lead = "zanda bikše"
sql_create_context
CREATE TABLE person_info_hz_info ( RYBH text, KH number, KLX number, YLJGDM number ) CREATE TABLE hz_info ( KH text, KLX number, YLJGDM text ) CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZ...
列出患者钱艳芳的检验报告单日期在2015年9月20日之前的所对应的住院就诊的流水号
SELECT zyjzjlb.JZLSH FROM person_info JOIN hz_info JOIN zyjzjlb JOIN person_info_hz_info ON person_info.RYBH = person_info_hz_info.RYBH AND hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX AND person_info_hz_info.KH = hz_info.KH AND person_info_hz_info.KLX = hz_info.KLX AND pers...
css
CREATE TABLE table_20803241_1 ( cash_fare VARCHAR, type_of_fare VARCHAR )
When mega pass* (senior/disabled) is the type of fare what is the cash fare?
SELECT cash_fare FROM table_20803241_1 WHERE type_of_fare = "Mega Pass* (Senior/Disabled)"
sql_create_context
CREATE TABLE table_11747 ( "Entrant" text, "Constructor" text, "Chassis" text, "Engine" text, "Tyre" text, "Driver" text, "Rounds" text )
Who was the driver of the Ford EDB 3.0 v8 engine?
SELECT "Driver" FROM table_11747 WHERE "Engine" = 'ford edb 3.0 v8'
wikisql
CREATE TABLE table_11057 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What is the name of the team with the Away score of 12.13 (85)?
SELECT "Away team" FROM table_11057 WHERE "Away team score" = '12.13 (85)'
wikisql
CREATE TABLE table_name_62 ( laps INTEGER, class VARCHAR, qual_pos VARCHAR )
What are the most laps for the Qual position of 7 in the OC class?
SELECT MAX(laps) FROM table_name_62 WHERE class = "oc" AND qual_pos = 7
sql_create_context
CREATE TABLE table_name_34 ( catalog VARCHAR, region VARCHAR )
Which catalog value has a region of world?
SELECT catalog FROM table_name_34 WHERE region = "world"
sql_create_context
CREATE TABLE table_65831 ( "Internet Explorer" text, "Firefox , Other Mozilla" text, "Chrome" text, "Safari" text, "Opera" text )
What percentage of browsers were using Chrome during the period in which 0.30% were using Opera and 6.77% were using Safari?
SELECT "Chrome" FROM table_65831 WHERE "Opera" = '0.30%' AND "Safari" = '6.77%'
wikisql
CREATE TABLE table_21138 ( "Cat. #" text, "Artist" text, "Title" text, "Release date" text, "Format" text, "Other information" text )
When was 'Tell You When' released?
SELECT "Release date" FROM table_21138 WHERE "Title" = 'Tell You When'
wikisql
CREATE TABLE mzb ( CLINIC_ID text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, INSU_TYPE text, IN...
列出患者何丽姿的医疗记录中每一次药品消费金额不低于8447.75元的医疗就诊编号
SELECT qtb.MED_CLINIC_ID FROM qtb WHERE qtb.PERSON_NM = '何丽姿' AND NOT qtb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT < 8447.75) UNION SELECT gyb.MED_CLINIC_ID FROM gyb WHERE gyb.PERSON_NM = '何丽姿' AND NOT gyb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT...
css
CREATE TABLE station ( id int, network_name text, services text, local_authority text ) CREATE TABLE route ( train_id int, station_id int ) CREATE TABLE weekly_weather ( station_id int, day_of_week text, high_temperature int, low_temperature int, precipitation real, win...
Show a bar graph, the data is those times of trains that run through stations for the local authority Chiltern, and the Y axis is the total number of different times, display X from low to high order please.
SELECT time, COUNT(time) FROM station AS t1 JOIN route AS t2 ON t1.id = t2.station_id JOIN train AS t3 ON t2.train_id = t3.id WHERE t1.local_authority = "Chiltern" GROUP BY time ORDER BY time
nvbench
CREATE TABLE table_68036 ( "Date" text, "Tournament" text, "Surface" text, "Opponent in the Final" text, "Score" text )
What score has wynne prakusya as the opponent in the final?
SELECT "Score" FROM table_68036 WHERE "Opponent in the Final" = 'wynne prakusya'
wikisql
CREATE TABLE table_name_95 ( game VARCHAR, opponent VARCHAR )
What is the total game number with athlone town as the opponent?
SELECT COUNT(game) FROM table_name_95 WHERE opponent = "athlone town"
sql_create_context
CREATE TABLE storm ( Number_Deaths INTEGER )
How many storms had death records?
SELECT COUNT(*) FROM storm WHERE Number_Deaths > 0
sql_create_context
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...
Find posts where you offered more than one bounty.
SELECT PostId AS "post_link", COUNT(*) AS Bounties FROM Votes WHERE VoteTypeId = 8 AND UserId = '##UserId##' GROUP BY PostId ORDER BY Bounties DESC
sede
CREATE TABLE domain_journal ( did int, jid int ) CREATE TABLE publication ( abstract varchar, cid int, citation_num int, jid int, pid int, reference_num int, title varchar, year int ) CREATE TABLE domain ( did int, name varchar ) CREATE TABLE author ( aid int, ...
return me the number of the keywords of ' Making database systems usable ' .
SELECT COUNT(DISTINCT (keyword.keyword)) FROM keyword, publication, publication_keyword WHERE publication_keyword.kid = keyword.kid AND publication.pid = publication_keyword.pid AND publication.title = 'Making database systems usable'
academic
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...
how patient 028-45936 was first admitted to hospital during this year?
SELECT patient.hospitaladmitsource FROM patient WHERE patient.uniquepid = '028-45936' AND DATETIME(patient.hospitaladmittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') ORDER BY patient.hospitaladmittime LIMIT 1
eicu
CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC text, RYBH text, XBDM number, XBMC text, XLDM text, XLMC text, XM text, ZYLBDM text, ZYMC text ) CREATE TABLE jyjgzbb ( BGDH text, BGRQ tim...
列出患者韦伟彦所有检验结果指标记录的检测人为郎霞姝的检验指标流水号有多少在在2009-11-03到2010-06-13内?
SELECT jyjgzbb.JYZBLSH FROM person_info JOIN hz_info JOIN mzjzjlb 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 = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJZJLB WHERE person_i...
css
CREATE TABLE restriction ( restriction_code text, advance_purchase int, stopovers text, saturday_stay_required text, minimum_stay int, maximum_stay int, application text, no_discounts text ) CREATE TABLE flight ( aircraft_code_sequence text, airline_code varchar, airline_fli...
what is the code for BUSINESS class
SELECT DISTINCT fare.fare_basis_code FROM fare, fare_basis WHERE fare_basis.class_type = 'BUSINESS' AND fare.fare_basis_code = fare_basis.fare_basis_code
atis