context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE aircraft ( aircraft_code varchar, aircraft_description varchar, manufacturer varchar, basic_type varchar, engines int, propulsion varchar...
please show me all airports in DENVER
SELECT DISTINCT airport.airport_code FROM airport, airport_service, city WHERE airport.airport_code = airport_service.airport_code AND city.city_code = airport_service.city_code AND city.city_name = 'DENVER'
atis
CREATE TABLE table_1341577_36 ( party VARCHAR, incumbent VARCHAR )
Which party does Del Latta belong to?
SELECT party FROM table_1341577_36 WHERE incumbent = "Del Latta"
sql_create_context
CREATE TABLE table_name_29 ( draw INTEGER, time VARCHAR )
What is the average draw number of an entrant with a time of 22:29?
SELECT AVG(draw) FROM table_name_29 WHERE time = "22:29"
sql_create_context
CREATE TABLE player ( pid number, pname text, ycard text, hs number ) CREATE TABLE tryout ( pid number, cname text, ppos text, decision text ) CREATE TABLE college ( cname text, state text, enr number )
Find the number of students who participate in the tryout for each college ordered by descending count.
SELECT COUNT(*), cname FROM tryout GROUP BY cname ORDER BY COUNT(*) DESC
spider
CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, ...
Cloud Trends (# Questions per Tag per Month).
SELECT DATEADD(mm, (YEAR(Posts.CreationDate) - 1900) * 12 + MONTH(Posts.CreationDate) - 1, 0) AS Month, Tags.TagName, COUNT(*) AS Questions FROM Tags LEFT JOIN PostTags ON PostTags.TagId = Tags.Id LEFT JOIN Posts ON Posts.Id = PostTags.PostId LEFT JOIN PostTypes ON PostTypes.Id = Posts.PostTypeId WHERE Tags.TagName IN ...
sede
CREATE TABLE exhibition_record ( exhibition_id number, date text, attendance number ) CREATE TABLE exhibition ( exhibition_id number, year number, theme text, artist_id number, ticket_price number ) CREATE TABLE artist ( artist_id number, name text, country text, year_j...
Show theme and year for all exhibitions in an descending order of ticket price.
SELECT theme, year FROM exhibition ORDER BY ticket_price DESC
spider
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location te...
what is the total number of patients who received a remov ext immobilization procedure since 2 years ago?
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT procedures_icd.hadm_id FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'remov ext immobilization') AND DATETIME(procedures_i...
mimic_iii
CREATE TABLE COURSE ( CRS_CODE varchar(10), DEPT_CODE varchar(10), CRS_DESCRIPTION varchar(35), CRS_CREDIT float(8) ) CREATE TABLE CLASS ( CLASS_CODE varchar(5), CRS_CODE varchar(10), CLASS_SECTION varchar(2), CLASS_TIME varchar(20), CLASS_ROOM varchar(8), PROF_NUM int ) CREATE...
How many departments are in each school. Visualize by pie chart.
SELECT SCHOOL_CODE, COUNT(DISTINCT DEPT_NAME) FROM DEPARTMENT
nvbench
CREATE TABLE station ( id number, name text, lat number, long number, dock_count number, city text, installation_date text ) CREATE TABLE status ( station_id number, bikes_available number, docks_available number, time text ) CREATE TABLE weather ( date text, max_te...
How many trips started from Mountain View city and ended at Palo Alto city?
SELECT COUNT(*) FROM station AS T1 JOIN trip AS T2 JOIN station AS T3 JOIN trip AS T4 ON T1.id = T2.start_station_id AND T2.id = T4.id AND T3.id = T4.end_station_id WHERE T1.city = "Mountain View" AND T3.city = "Palo Alto"
spider
CREATE TABLE table_46436 ( "Finish" text, "Race" text, "Distance" text, "Jockey" text, "Time" text, "Victory Margin (in lengths)" text, "Runner up" text, "Track" text, "Surface" text, "Date" text )
What was the time of the Kentucky Derby?
SELECT "Time" FROM table_46436 WHERE "Race" = 'kentucky derby'
wikisql
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, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic (...
what is admission location and admission time of subject id 85673?
SELECT demographic.admission_location, demographic.admittime FROM demographic WHERE demographic.subject_id = "85673"
mimicsql_data
CREATE TABLE table_72016 ( "Wicket" text, "Runs" text, "Partnerships" text, "Venue" text, "Date" text )
What venue did the parntership of shoaib malik / misbah-ul-haq occur?
SELECT "Venue" FROM table_72016 WHERE "Partnerships" = 'shoaib malik / misbah-ul-haq'
wikisql
CREATE TABLE table_57223 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
When an away team scored 10.8 (68), what was the crowd size?
SELECT "Crowd" FROM table_57223 WHERE "Away team score" = '10.8 (68)'
wikisql
CREATE TABLE table_68390 ( "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text )
What is the result when the competition is 1982 president's cup?
SELECT "Result" FROM table_68390 WHERE "Competition" = '1982 president''s cup'
wikisql
CREATE TABLE table_15185 ( "Year" real, "Population (Total)" real, "(Barcaldine)" real, "(Aramac)" real, "(Jericho)" real )
What year was the (Barcaldine) larger than 1,868 and the (Aramac) lower than 1,592?
SELECT AVG("Year") FROM table_15185 WHERE "(Barcaldine)" > '1,868' AND "(Aramac)" < '1,592'
wikisql
CREATE TABLE table_14106 ( "Season" text, "Division" text, "Tms." text, "Pos." text, "PFF NMCC" text, "UFL Cup" text, "AFC PC" text )
Which Season has a UFL Cup of quarter-finals?
SELECT "Season" FROM table_14106 WHERE "UFL Cup" = 'quarter-finals'
wikisql
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) C...
provide the number of patients whose admission type is elective and diagnoses long title is sebaceous cyst?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND diagnoses.long_title = "Sebaceous cyst"
mimicsql_data
CREATE TABLE table_66060 ( "Chassis code" text, "Model Years" text, "Model" text, "Engine" text, "No. built" real )
What's the model that has chassis code W116.036?
SELECT "Model" FROM table_66060 WHERE "Chassis code" = 'w116.036'
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 are primarily diagnosed for sdh and lab tested with ascites ?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.diagnosis = "SDH" AND lab.fluid = "Ascites"
mimicsql_data
CREATE TABLE table_12482 ( "Draft" real, "Round" real, "Pick" real, "Player" text, "Nationality" text )
What is the sum of Draft, when Round is greater than 9?
SELECT SUM("Draft") FROM table_12482 WHERE "Round" > '9'
wikisql
CREATE TABLE table_1144 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Record" text, "Game Site" text, "Attendance" real )
Name the number of record when attendance is 44023
SELECT COUNT("Record") FROM table_1144 WHERE "Attendance" = '44023'
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...
Select posts with two favorite tags.
SELECT COUNT(p.Id) AS QuestionCounts FROM Posts AS p INNER JOIN PostTags AS pt ON pt.PostId = p.Id INNER JOIN Tags AS t ON pt.TagId = t.Id WHERE p.PostTypeId = 1 AND YEAR(p.CreationDate) < 2017 AND t.TagName IN ('.net') GROUP BY PostTypeId
sede
CREATE TABLE table_name_75 ( score VARCHAR, date VARCHAR )
What is the score of the game on June 9?
SELECT score FROM table_name_75 WHERE date = "june 9"
sql_create_context
CREATE TABLE table_13903 ( "Name" text, "Height" text, "Weight" text, "Spike" text, "2008 club" text )
What is the Weight of the Player with Copra Nordmeccanica 2008 Club?
SELECT "Weight" FROM table_13903 WHERE "2008 club" = 'copra nordmeccanica'
wikisql
CREATE TABLE table_46809 ( "Event" text, "Date" text, "Rating" text, "Share" text, "Viewers" text )
What is Viewers, when Event is Johnson Vs. Moraga?
SELECT "Viewers" FROM table_46809 WHERE "Event" = 'johnson vs. moraga'
wikisql
CREATE TABLE table_69797 ( "Rank" real, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
What is the lowest rank for nations with more than 3 bronze medals and more than 36 total medals?
SELECT MIN("Rank") FROM table_69797 WHERE "Bronze" > '3' AND "Total" > '36'
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 microlab ( microl...
tell me the intake method for nicotine 21 mg/24hr td pt24?
SELECT DISTINCT medication.routeadmin FROM medication WHERE medication.drugname = 'nicotine 21 mg/24hr td pt24'
eicu
CREATE TABLE table_name_4 ( record VARCHAR, location_attendance VARCHAR )
What is Record, when Location Attendance is 'Izod Center 16,911'?
SELECT record FROM table_name_4 WHERE location_attendance = "izod center 16,911"
sql_create_context
CREATE TABLE table_203_592 ( id number, "institution" text, "location" text, "athletic nickname" text, "undergraduate enrollment" number, "graduate enrollment" number, "total enrollment" number, "2013 endowment\n(and us rank)" text, "academic staff" number, "motto" text )
how many ivy league schools are in new york ?
SELECT COUNT(DISTINCT "institution") FROM table_203_592 WHERE "location" = 'new york'
squall
CREATE TABLE table_28163 ( "Village" text, "Area km\u00b2" text, "Population (2000 census )" real, "Region" text, "Pop. Density" real )
What is the population density of mongmong-toto-maite?
SELECT MIN("Pop. Density") FROM table_28163 WHERE "Village" = 'Mongmong-Toto-Maite'
wikisql
CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, war...
since 512 days ago when did patient 5828 get .9% normal saline for the last time?
SELECT inputevents_cv.charttime FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 5828)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label ...
mimic_iii
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...
provide the number of patients on dialys route of drug administration who are diagnosed with cerebral aneurysm, nonruptured.
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.long_title = "Cerebral aneurysm, nonruptured" AND prescriptions.route = "DIALYS"
mimicsql_data
CREATE TABLE table_7697 ( "Material" text, "Formula" text, "Refractive index(es) 589.3nm" text, "Hardness ( Mohs' scale )" text, "Density (g/cm 3 )" text, "State of the art" text )
What hardness has a formula of y 3 al 5 o 12?
SELECT "Hardness ( Mohs' scale )" FROM table_7697 WHERE "Formula" = 'y 3 al 5 o 12'
wikisql
CREATE TABLE table_64377 ( "Rank" real, "Show" text, "Episode" text, "Number of Viewers" real, "Date" text )
Which Episode has a Rank of 1?
SELECT "Episode" FROM table_64377 WHERE "Rank" = '1'
wikisql
CREATE TABLE table_19941 ( "Series Ep." text, "Episode" real, "Netflix" text, "Segment A" text, "Segment B" text, "Segment C" text, "Segment D" text )
What is the Segment B when the Segment D is s Hammock?
SELECT "Segment B" FROM table_19941 WHERE "Segment D" = 's Hammock'
wikisql
CREATE TABLE table_204_843 ( id number, "volume" number, "year" text, "names" text, "articles" number, "pages" number, "images" number, "maps" number, "number of copies" number )
which volume had the most maps ?
SELECT "volume" FROM table_204_843 ORDER BY "maps" DESC LIMIT 1
squall
CREATE TABLE table_35917 ( "Year" real, "Location" text, "Gold" text, "Silver" text, "Bronze" text )
Who won the gold when Kim Hyang-Mi won the bronze?
SELECT "Gold" FROM table_35917 WHERE "Bronze" = 'kim hyang-mi'
wikisql
CREATE TABLE table_17201869_3 ( replaced_by VARCHAR, outgoing_manager VARCHAR )
Who replaced outgoing manager Jos ngel Ziganda?
SELECT replaced_by FROM table_17201869_3 WHERE outgoing_manager = "José Ángel Ziganda"
sql_create_context
CREATE TABLE table_name_71 ( builder VARCHAR, br_no VARCHAR )
Which Builder has BR No. 30782?
SELECT builder FROM table_name_71 WHERE br_no = 30782
sql_create_context
CREATE TABLE table_69238 ( "Team 1" text, "Agg." text, "Team 2" text, "1st leg" text, "2nd leg" text )
What is the first leg of team 1 for Hardware stars?
SELECT "1st leg" FROM table_69238 WHERE "Team 1" = 'hardware stars'
wikisql
CREATE TABLE table_67962 ( "Year" real, "Class" text, "Team" text, "Points" real, "Wins" real )
What is the least amount of wins earlier than 1964 with more than 7 points?
SELECT MIN("Wins") FROM table_67962 WHERE "Year" < '1964' AND "Points" > '7'
wikisql
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 PostsWithDeleted ( Id number, PostTyp...
Test: List of Users in a given location.
SELECT Id AS "user_link", Location, Reputation FROM Users WHERE LOWER(Location) LIKE LOWER('%##location##%') ORDER BY Location
sede
CREATE TABLE table_21795650_1 ( team VARCHAR, podiums VARCHAR )
What team had 4 podiums?
SELECT team FROM table_21795650_1 WHERE podiums = 4
sql_create_context
CREATE TABLE table_26476336_2 ( location VARCHAR, team_nickname VARCHAR )
Where is the nickname the Red Raiders?
SELECT location FROM table_26476336_2 WHERE team_nickname = "Red Raiders"
sql_create_context
CREATE TABLE table_name_25 ( team_2 VARCHAR, team_1 VARCHAR )
What is the second team that has first team of Africa sports?
SELECT team_2 FROM table_name_25 WHERE team_1 = "africa sports"
sql_create_context
CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Percent text, ACC_Home text, ACC_Road text, All_Games text, All_Games_Percent int, All_Home text, All_Road text, All_Neutral text ) CREATE TABLE university ( Scho...
Draw a scatter chart about the correlation between Team_ID and All_Games_Percent , and group by attribute All_Neutral.
SELECT Team_ID, All_Games_Percent FROM basketball_match GROUP BY All_Neutral
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, ...
how many patients whose diagnoses short title is bph w/o urinary obs/luts and lab test category is hematology?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.short_title = "BPH w/o urinary obs/LUTS" AND lab."CATEGORY" = "Hematology"
mimicsql_data
CREATE TABLE t_kc21 ( MED_CLINIC_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, COMP_ID text, PERSON_ID text, PERSON_NM text, IDENTITY_CARD text, SOC_SRT_CARD text, PERSON_SEX number, PERSON_AGE number, IN_HOSP_DATE time, OUT_HOSP_DATE time, DIFF_PLACE_FLG numb...
医疗就诊11161226775记录里面514337-o这种药品收费是哪一级的
SELECT CHA_ITEM_LEV FROM t_kc22 WHERE MED_CLINIC_ID = '11161226775' AND SOC_SRT_DIRE_CD = '514337-o'
css
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost numbe...
until 3 years ago, what are the five most frequent medications prescribed to the transaminase elevation female patients 20s after they have been diagnosed with transaminase elevation in the same hospital encounter?
SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'transaminase el...
eicu
CREATE TABLE genre ( genreid number, name text ) CREATE TABLE employee ( employeeid number, lastname text, firstname text, title text, reportsto number, birthdate time, hiredate time, address text, city text, state text, country text, postalcode text, phone t...
What are the titles of albums by the artist 'AC/DC'?
SELECT title FROM album AS T1 JOIN artist AS T2 ON T1.artistid = T2.artistid WHERE T2.name = "AC/DC"
spider
CREATE TABLE table_name_74 ( milepost VARCHAR, name_of_the_tunnel VARCHAR )
What is the Milepost of the Twin Tunnel #1 North?
SELECT COUNT(milepost) FROM table_name_74 WHERE name_of_the_tunnel = "twin tunnel #1 north"
sql_create_context
CREATE TABLE table_39987 ( "Television service" text, "Language" text, "Content" text, "HDTV" text, "Package/Option" text )
What package/option has documentaries as the content, yes as the HDTV, and a television service of history hd?
SELECT "Package/Option" FROM table_39987 WHERE "Content" = 'documentaries' AND "HDTV" = 'yes' AND "Television service" = 'history hd'
wikisql
CREATE TABLE table_45533 ( "Rank" real, "City" text, "Province" text, "Date of Official Foundation of Municipality" real, "2006" real, "1996" real, "1986" real, "1976" real, "1966" real, "1956" real )
What is the average rank of the province alborz, which had more than 14526 in 1956?
SELECT AVG("Rank") FROM table_45533 WHERE "Province" = 'alborz' AND "1956" > '14526'
wikisql
CREATE TABLE table_26505 ( "Rnd" real, "Circuit" text, "LMP Winning Team" text, "LMPC Winning Team" text, "GT Winning Team" text, "GTC Winning Team" text, "Results" text )
What was the winning team lmpc in rnd 3?
SELECT "LMPC Winning Team" FROM table_26505 WHERE "Rnd" = '3'
wikisql
CREATE TABLE table_name_20 ( city_of_license VARCHAR, class VARCHAR )
What city has the A Class licence?
SELECT city_of_license FROM table_name_20 WHERE class = "a"
sql_create_context
CREATE TABLE table_name_56 ( bronze INTEGER, nation VARCHAR, gold VARCHAR )
What is the lowest Bronze with a Nation of egypt (egy) and with a Gold that is smaller than 2?
SELECT MIN(bronze) FROM table_name_56 WHERE nation = "egypt (egy)" AND gold < 2
sql_create_context
CREATE TABLE table_27484208_1 ( world_rank_by_qs_ VARCHAR, _2013 VARCHAR, members VARCHAR )
What was the world rank by QS in 2013 for the University of Otago?
SELECT world_rank_by_qs_, _2013 FROM table_27484208_1 WHERE members = "University of Otago"
sql_create_context
CREATE TABLE table_33250 ( "City" text, "Country" text, "IATA" text, "ICAO" text, "Airport" text )
What is China's IATA?
SELECT "IATA" FROM table_33250 WHERE "Country" = 'china'
wikisql
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...
编号51226934019的医疗就诊中,列出所有去外地就诊产生的费用明细项目
SELECT MED_EXP_DET_ID FROM t_kc22 WHERE MED_CLINIC_ID = '51226934019' AND (REMOTE_SETTLE_FLG = '异地1' OR REMOTE_SETTLE_FLG = '异地2')
css
CREATE TABLE table_train_275 ( "id" int, "systolic_blood_pressure_sbp" int, "hemoglobin_a1c_hba1c" float, "hba1c" float, "body_mass_index_bmi" float, "triglyceride_tg" float, "age" float, "NOUSE" float )
age < 18 or > 80 years
SELECT * FROM table_train_275 WHERE age < 18 OR age > 80
criteria2sql
CREATE TABLE table_name_6 ( model VARCHAR, number_of_cpus VARCHAR, performance__mips_ VARCHAR )
Which Model has a Number of CPUs of 1 10, and a Performance (MIPS) of 49 447?
SELECT model FROM table_name_6 WHERE number_of_cpus = "1–10" AND performance__mips_ = "49–447"
sql_create_context
CREATE TABLE table_name_57 ( opponent VARCHAR, date VARCHAR )
Which opponent was on July 21, 2008?
SELECT opponent FROM table_name_57 WHERE date = "july 21, 2008"
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 diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
what is the number of patients whose year of birth is less than 2058 and procedure icd9 code is 3782?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dob_year < "2058" AND procedures.icd9_code = "3782"
mimicsql_data
CREATE TABLE table_48244 ( "Team" text, "Outgoing manager" text, "Manner of departure" text, "Date of vacancy" text, "Replaced by" text, "Date of appointment" text )
What was the date of appointment for the manager of lecce when the previous manager's contract expired?
SELECT "Date of appointment" FROM table_48244 WHERE "Manner of departure" = 'contract expired' AND "Team" = 'lecce'
wikisql
CREATE TABLE table_17360840_9 ( score VARCHAR, record VARCHAR )
What was the score when the record was 21-31-13?
SELECT score FROM table_17360840_9 WHERE record = "21-31-13"
sql_create_context
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, ...
曹姓检测人员在医疗就诊18545084468中负责的所有检测指标的名称及其结果定量与结果定量单位的记录,请全部列出来
SELECT jyjgzbb.JCZBMC, jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM zyjybgb JOIN jyjgzbb ON zyjybgb.YLJGDM = jyjgzbb.YLJGDM AND zyjybgb.BGDH = jyjgzbb.BGDH WHERE zyjybgb.JZLSH = '18545084468' AND jyjgzbb.JCRXM LIKE '曹%' UNION SELECT jyjgzbb.JCZBMC, jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM mzjybgb JOIN jyjgzbb ON mzjybgb.YLJG...
css
CREATE TABLE table_80165 ( "Player" text, "Tries" real, "Goals" real, "Field Goals" real, "Points" real )
How many goals did the player with less than 4 points have?
SELECT COUNT("Goals") FROM table_80165 WHERE "Points" < '4'
wikisql
CREATE TABLE Addresses ( address_id INTEGER, address_details VARCHAR(255) ) CREATE TABLE Suppliers ( supplier_id INTEGER, supplier_name VARCHAR(80), supplier_phone VARCHAR(80) ) CREATE TABLE Staff_Department_Assignments ( staff_id INTEGER, department_id INTEGER, date_assigned_from DATE...
What is the price of each product supplied by supplier id 3? Return a bar chart, list by the y-axis from high to low.
SELECT product_name, product_price FROM Product_Suppliers AS T1 JOIN Products AS T2 ON T1.product_id = T2.product_id WHERE T1.supplier_id = 3 ORDER BY product_price DESC
nvbench
CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Percent text, ACC_Home text, ACC_Road text, All_Games text, All_Games_Percent int, All_Home text, All_Road text, All_Neutral text ) CREATE TABLE university ( Scho...
What is the relationship between School_ID and ACC_Percent ?
SELECT School_ID, ACC_Percent FROM basketball_match
nvbench
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 who did not have any job in the past, a bar chart shows the distribution of job_id and the average of employee_id , and group by attribute job_id, rank y axis in descending order.
SELECT JOB_ID, AVG(EMPLOYEE_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) GROUP BY JOB_ID ORDER BY AVG(EMPLOYEE_ID) DESC
nvbench
CREATE TABLE table_55483 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What was the score against home team, Richmond?
SELECT "Away team score" FROM table_55483 WHERE "Home team" = 'richmond'
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 primary disease and diagnoses long title of subject name bryant johnson?
SELECT demographic.diagnosis, diagnoses.long_title FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.name = "Bryant Johnson"
mimicsql_data
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, ...
how much change does patient 26777's metamyelocytes change second measured on the first hospital visit compared to the first value measured on the first hospital visit?
SELECT (SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 26777 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label ...
mimic_iii
CREATE TABLE table_name_54 ( attendance VARCHAR, week VARCHAR, date VARCHAR )
What was the attendance for the game on October 30, 1994 for a week after week 2?
SELECT COUNT(attendance) FROM table_name_54 WHERE week > 2 AND date = "october 30, 1994"
sql_create_context
CREATE TABLE table_67294 ( "Name" text, "Country" text, "Status" text, "Moving to" text, "Transfer window" text, "Transfer fee" text )
What is the Country, when the Transfer fee is 'loan', and when the Name is Lynch?
SELECT "Country" FROM table_67294 WHERE "Transfer fee" = 'loan' AND "Name" = 'lynch'
wikisql
CREATE TABLE table_name_50 ( home_team VARCHAR, away_team VARCHAR )
What was the home team score for the Richmond away team?
SELECT home_team AS score FROM table_name_50 WHERE away_team = "richmond"
sql_create_context
CREATE TABLE table_name_86 ( player VARCHAR, score VARCHAR )
Which Player has a Score of 74-67-74-71=286?
SELECT player FROM table_name_86 WHERE score = 74 - 67 - 74 - 71 = 286
sql_create_context
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemics...
tell me patient 016-18150's maximum temperature on last month/03?
SELECT MAX(vitalperiodic.temperature) FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-18150')) AND NOT vitalperiodic.temperature IS ...
eicu
CREATE TABLE table_name_8 ( competition VARCHAR, year VARCHAR, notes VARCHAR )
What competition took place in a year later than 2009 with team notes?
SELECT competition FROM table_name_8 WHERE year > 2009 AND notes = "team"
sql_create_context
CREATE TABLE table_name_25 ( dob VARCHAR, first VARCHAR, throws VARCHAR, position VARCHAR )
Which DOB has Throws of r, and a Position of c, and a First of torey?
SELECT dob FROM table_name_25 WHERE throws = "r" AND position = "c" AND first = "torey"
sql_create_context
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
What is the number of patients admitted before 2197 who had a joint fluid lab test done?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2197" AND lab.fluid = "Joint Fluid"
mimicsql_data
CREATE TABLE table_75215 ( "Doubles" real, "Player" text, "Team" text, "Year" real, "Years Record Stood" text )
Player of napoleon lajoie, and a Team of cleveland bronchos, and a Doubles of 49 which years record stood?
SELECT "Years Record Stood" FROM table_75215 WHERE "Player" = 'napoleon lajoie' AND "Team" = 'cleveland bronchos' AND "Doubles" = '49'
wikisql
CREATE TABLE table_name_85 ( home_team VARCHAR, road_team VARCHAR, result VARCHAR )
Which Home team has a Road team of portland, and a Result of 104 110?
SELECT home_team FROM table_name_85 WHERE road_team = "portland" AND result = "104–110"
sql_create_context
CREATE TABLE table_name_35 ( season VARCHAR, races VARCHAR, points VARCHAR )
What season has races larger than 18 and 36 points?
SELECT season FROM table_name_35 WHERE races > 18 AND points = 36
sql_create_context
CREATE TABLE table_name_77 ( silver VARCHAR, nation VARCHAR, gold VARCHAR, rank VARCHAR )
What is silver when gold is 1 and the rank is less than 3 for japan?
SELECT silver FROM table_name_77 WHERE gold = 1 AND rank < 3 AND nation = "japan"
sql_create_context
CREATE TABLE station ( city VARCHAR )
List the name and the number of stations for all the cities that have at least 15 stations.
SELECT city, COUNT(*) FROM station GROUP BY city HAVING COUNT(*) >= 15
sql_create_context
CREATE TABLE flight_stop ( flight_id int, stop_number int, stop_days text, stop_airport text, arrival_time int, arrival_airline text, arrival_flight_number int, departure_time int, departure_airline text, departure_flight_number int, stop_time int ) CREATE TABLE date_day ( ...
flights from OAK to SFO on 1 21 1992
SELECT DISTINCT flight.flight_id FROM airport AS AIRPORT_0, airport AS AIRPORT_1, airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE (((AIRPORT_1.airport_code = 'SFO' AND date_day.day_number = 21 AND date_day.month_number = 1 AND date...
atis
CREATE TABLE table_name_78 ( team VARCHAR, qual_1 VARCHAR )
What team had a qual 1 of 1:02.755?
SELECT team FROM table_name_78 WHERE qual_1 = "1:02.755"
sql_create_context
CREATE TABLE table_2879165_1 ( country VARCHAR, ioc_code VARCHAR )
What is the name of the country when the ioc code is mas?
SELECT country FROM table_2879165_1 WHERE ioc_code = "MAS"
sql_create_context
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, d...
tell me the length of stay of patient 006-93519's first stay in the icu.
SELECT STRFTIME('%j', patient.unitdischargetime) - STRFTIME('%j', patient.unitadmittime) FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-93519') AND NOT patient.unitadmittime IS NULL ORDER BY patient.unitadmittime LIMIT 1
eicu
CREATE TABLE table_name_54 ( to_par VARCHAR, player VARCHAR )
What was the score to par after two rounds for Nick Price?
SELECT to_par FROM table_name_54 WHERE player = "nick price"
sql_create_context
CREATE TABLE event ( ID int, Name text, Stadium_ID int, Year text ) CREATE TABLE stadium ( ID int, name text, Capacity int, City text, Country text, Opening_year int ) CREATE TABLE record ( ID int, Result text, Swimmer_ID int, Event_ID int ) CREATE TABLE swimme...
Find meter_700 and meter_100 , and visualize them by a bar chart, I want to show meter_100 in descending order.
SELECT meter_700, meter_100 FROM swimmer ORDER BY meter_100 DESC
nvbench
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) ...
Find the number of patients admitted in emergency who had the procedure titled ins nondrug elut cor st.
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.short_title = "Ins nondrug elut cor st"
mimicsql_data
CREATE TABLE table_27561503_2 ( gt_20_winning_team VARCHAR, sports_20_winning_team VARCHAR, circuit VARCHAR )
Name the gt 2.0 winning team for sports 2.0 winning team for #16 trans ocean motors for castle rock
SELECT COUNT(gt_20_winning_team) FROM table_27561503_2 WHERE sports_20_winning_team = "#16 Trans Ocean Motors" AND circuit = "Castle Rock"
sql_create_context
CREATE TABLE table_12141496_1 ( apogee__km_ INTEGER, name VARCHAR )
What is the maximum apogee for samos f3-3?
SELECT MAX(apogee__km_) FROM table_12141496_1 WHERE name = "SAMOS F3-3"
sql_create_context
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 d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABL...
what was the drug that patient 28447 had been prescribed two times this month.
SELECT t1.drug FROM (SELECT prescriptions.drug, COUNT(prescriptions.startdate) AS c1 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 28447) AND DATETIME(prescriptions.startdate, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-0 ...
mimic_iii
CREATE TABLE table_name_16 ( first_leg VARCHAR, round VARCHAR )
What was the first leg score during the quarter-final game?
SELECT first_leg FROM table_name_16 WHERE round = "quarter-final"
sql_create_context
CREATE TABLE table_45220 ( "Tournament" text, "2002" text, "2004" text, "2005" text, "2006" text )
What shows for 2004 when 2005 is A, 2006 is A, tournament is US Open?
SELECT "2004" FROM table_45220 WHERE "2005" = 'a' AND "2006" = 'a' AND "Tournament" = 'us open'
wikisql
CREATE TABLE table_59224 ( "Opposing Teams" text, "Against" real, "Date" text, "Venue" text, "Status" text )
What is Opposing Teams, when Status is 'Test Match', and when Date is '25/11/2000'?
SELECT "Opposing Teams" FROM table_59224 WHERE "Status" = 'test match' AND "Date" = '25/11/2000'
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 are the total number of patients who stayed in the hospital for more than 2 days and their lab test name is calcium?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.days_stay > "2" AND lab.label = "Calcium, Total"
mimicsql_data