context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( ...
what is gender and discharge time of subject id 2560?
SELECT demographic.gender, demographic.dischtime FROM demographic WHERE demographic.subject_id = "2560"
mimicsql_data
CREATE TABLE table_49967 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" text, "Location" text )
With a method of tko (kick) what is the record of the match?
SELECT "Record" FROM table_49967 WHERE "Method" = 'tko (kick)'
wikisql
CREATE TABLE table_55385 ( "Year" real, "Date" text, "Driver" text, "Team" text, "Distance/Duration" text )
How many years does Team wal-mart / tide participate?
SELECT COUNT("Year") FROM table_55385 WHERE "Team" = 'wal-mart / tide'
wikisql
CREATE TABLE table_name_38 ( home_team VARCHAR, away_team VARCHAR )
What did the team score when playing south melbourne at home?
SELECT home_team AS score FROM table_name_38 WHERE away_team = "south melbourne"
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 the number of times patient 013-20464 has had a chest tube #1 output in 07/this year.
SELECT COUNT(*) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '013-20464')) AND intakeoutput.cellpath LIKE '%output%' AND intakeoutput.ce...
eicu
CREATE TABLE table_10606 ( "Entrant" text, "Constructor" text, "Chassis" text, "Engine" text, "Tyre" text, "Driver" text, "Rounds" text )
Which engine was on a car with G tires, a chassis model of 003 002 004 005 006, driven by Jackie Stewart?
SELECT "Engine" FROM table_10606 WHERE "Tyre" = 'g' AND "Chassis" = '003 002 004 005 006' AND "Driver" = 'jackie stewart'
wikisql
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE patient ( uniquepid text, ...
when was the last time patient 002-41152 had been prescribed furosemide 10 mg/ml ij soln and potassium chloride 20 meq po pack at the same time last month?
SELECT t1.drugstarttime FROM (SELECT patient.uniquepid, medication.drugstarttime FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE medication.drugname = 'furosemide 10 mg/ml ij soln' AND patient.uniquepid = '002-41152' AND DATETIME(medication.drugstarttime, 'start of month')...
eicu
CREATE TABLE table_204_836 ( id number, "#" number, "date" text, "opponent" text, "score" text, "result" text, "competition" text )
which date and opponent is next after june 12,1989
SELECT "date", "opponent" FROM table_204_836 WHERE "#" = (SELECT MAX("#") FROM table_204_836 WHERE "date" = 'june 12, 1989') + 1
squall
CREATE TABLE table_30702 ( "Constellation" text, "IAU abbreviation" text, "Other abbreviation" text, "Genitive" text, "Family" text, "Origin" text, "Meaning" text, "Brightest star" text )
What is the other abbreviation of the constellation that has hydrae / ha dri / as genitive?
SELECT "Other abbreviation" FROM table_30702 WHERE "Genitive" = 'Hydrae /ˈhaɪdriː/'
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...
how many patients admitted after year 2146 had ruq pain?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "RUQ PAIN" AND demographic.admityear < "2146"
mimicsql_data
CREATE TABLE table_14847 ( "Name" text, "Code" text, "Capacity" text, "Power" text, "Acceleration 0\u2013100km/h" text, "Top speed" text, "Combined consumption" text )
What is the acceleration 1-100km/h when the name is 1.5 dci?
SELECT "Acceleration 0\u2013100km/h" FROM table_14847 WHERE "Name" = '1.5 dci'
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 allergy ( allergy...
count the number of times patient 004-4326 had a administration of saline solution procedure until 2 years ago.
SELECT COUNT(*) FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '004-4326')) AND treatment.treatmentname = 'administration of saline solution' AN...
eicu
CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body t...
CDA Cloud-Gazing: Azure Python Questions.
SELECT Id AS "comment_link", Score, Text FROM Comments WHERE UPPER(Text) LIKE UPPER('Azure') ORDER BY Score DESC
sede
CREATE TABLE mzjybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH number, 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, ...
检验报告单21129933460是哪个申请人申请开出的,工号是多少,把姓名也查一下
SELECT zyjybgb.SQRGH, zyjybgb.SQRXM FROM zyjybgb WHERE zyjybgb.BGDH = '21129933460' UNION SELECT mzjybgb.SQRGH, mzjybgb.SQRXM FROM mzjybgb WHERE mzjybgb.BGDH = '21129933460'
css
CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE student_record ( student_id int, course_id int, semester int, grade varchar, how varchar, transfer_source varchar, earn_credit varchar, repeat_term varchar, test_id varchar...
What 's the hardest class ?
SELECT DISTINCT course.name, course.number, program_course.workload FROM course, program_course WHERE course.department = 'EECS' AND program_course.course_id = course.course_id AND program_course.workload = (SELECT MAX(PROGRAM_COURSEalias1.workload) FROM course AS COURSEalias1, program_course AS PROGRAM_COURSEalias1 WH...
advising
CREATE TABLE table_3869 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
Who had the high assist total on january 27?
SELECT "High assists" FROM table_3869 WHERE "Date" = 'January 27'
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 PostHistory ( Id number, PostHistoryT...
Top users from Haarlem, The Netherlands.
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%haarlem%' OR UPPER(Location) LIKE '%HAARLEM%' OR Location LIKE '%Haarlem%' AND Reputation >= 1000 ORDER BY Reputation DESC
sede
CREATE TABLE table_28735 ( "Institution" text, "Location" text, "Team Nickname" text, "Years" text, "New Conference" text, "New Classification" text )
What school has the new conference as SELC?
SELECT "Institution" FROM table_28735 WHERE "New Conference" = 'SELC'
wikisql
CREATE TABLE table_24394 ( "State (class)" text, "Vacator" text, "Reason for change" text, "Successor" text, "Date of successors formal installation" text )
What change caused a change of staff in March 9, 1865?
SELECT "Reason for change" FROM table_24394 WHERE "Date of successors formal installation" = 'March 9, 1865'
wikisql
CREATE TABLE table_name_27 ( result VARCHAR, venue VARCHAR )
What was the result of the game played in Venue H?
SELECT result FROM table_name_27 WHERE venue = "h"
sql_create_context
CREATE TABLE table_name_80 ( wins VARCHAR, losses VARCHAR )
How many wins did they have when they had 5 losses?
SELECT wins FROM table_name_80 WHERE losses = 5
sql_create_context
CREATE TABLE table_27065 ( "Name of the war" text, "Ottoman sultan" text, "Persian shah" text, "Treaty at the end of the war" text, "Victor" text )
What is the name of the war where the Ottoman sultan was Selim I?
SELECT "Name of the war" FROM table_27065 WHERE "Ottoman sultan" = 'Selim I'
wikisql
CREATE TABLE table_name_77 ( rank_points VARCHAR, event VARCHAR, shooter VARCHAR )
What is Rank Points, when Event is 'WC Milan', and when Shooter is 'Lalita Yauhleuskaya ( AUS )'?
SELECT rank_points FROM table_name_77 WHERE event = "wc milan" AND shooter = "lalita yauhleuskaya ( aus )"
sql_create_context
CREATE TABLE table_name_86 ( year INTEGER, chassis VARCHAR )
What is the year with a kurtis kraft 500a chassis?
SELECT SUM(year) FROM table_name_86 WHERE chassis = "kurtis kraft 500a"
sql_create_context
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...
count the number of patients whose diagnoses icd9 code is 51881 and drug type is additive?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.icd9_code = "51881" AND prescriptions.drug_type = "ADDITIVE"
mimicsql_data
CREATE TABLE table_52405 ( "City" text, "Country" text, "Region" text, "IATA" text, "ICAO" text, "Airport" text )
I want the ICAO for city of xi'an
SELECT "ICAO" FROM table_52405 WHERE "City" = 'xi''an'
wikisql
CREATE TABLE table_16941 ( "Date" text, "Tournament" text, "Location" text, "Purse( $ )" real, "Winner" text, "Score" text, "1st Prize( $ )" real )
How many scores were at the Northville Long Island Classic?
SELECT COUNT("Score") FROM table_16941 WHERE "Tournament" = 'Northville Long Island Classic'
wikisql
CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location text, insurance text, language text, marital_status text, ethnicity text, age number ) CREATE ...
what is the maximum value of arterial bp mean of patient 655 on the last intensive care unit visit?
SELECT MAX(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 = 655) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime DESC LIMIT 1) AND chartevents.item...
mimic_iii
CREATE TABLE table_37157 ( "Season" real, "Series" text, "Team Name" text, "Races" text, "Wins" text, "Poles" text, "F/Laps" text, "Podiums" text, "Points" text, "Final Placing" text )
Which Series has a Team Name of sunred engineering?
SELECT "Series" FROM table_37157 WHERE "Team Name" = 'sunred engineering'
wikisql
CREATE TABLE table_35321 ( "Season" real, "Overall" real, "Slalom" text, "Giant Slalom" real, "Super G" text, "Downhill" text, "Combined" text )
How many seasons had a Super G of 2 and overall of 3?
SELECT COUNT("Season") FROM table_35321 WHERE "Super G" = '2' AND "Overall" = '3'
wikisql
CREATE TABLE table_train_214 ( "id" int, "gender" string, "lead_ecg" bool, "systolic_blood_pressure_sbp" int, "qt_interval" bool, "urine_dipstick_protein" int, "stroke" bool, "transient_ischemic_attack" bool, "qtc" int, "long_qt_syndrome" bool, "cardiovascular_disease" bool, ...
urine dipstick protein > 2+ ( 100 mg / dl ) or urine protein 2+ and a urine protein / creatinine ratio > 1 ( > 1000 mg / g )
SELECT * FROM table_train_214 WHERE urine_dipstick_protein > 100 AND (urine_protein > 1 OR creatinine_ratio > 1000)
criteria2sql
CREATE TABLE t_kc22 ( MED_EXP_DET_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, MED_EXP_BILL_ID text, SOC_SRT_DIRE_CD text, SOC_SRT_DIRE_NM text, DIRE_TYPE number, CHA_ITEM_LEV number, MED_INV_ITEM_TYPE text, MED_DIRE_CD text, MED_DIRE_NM text,...
在医院2065470病患50675305出院诊断疾病名称不包含失眠症的医疗就诊记录编号是多少号?
SELECT MED_CLINIC_ID FROM t_kc21 WHERE PERSON_ID = '50675305' AND MED_SER_ORG_NO = '2065470' AND NOT OUT_DIAG_DIS_NM LIKE '%失眠症%'
css
CREATE TABLE table_name_35 ( date VARCHAR, opponent_in_final VARCHAR )
What is the Date of the Tournament against Anastasiya Yakimova?
SELECT date FROM table_name_35 WHERE opponent_in_final = "anastasiya yakimova"
sql_create_context
CREATE TABLE table_18932 ( "Year (Ceremony)" text, "Film title used in nomination" text, "Original title" text, "Director" text, "Result" text )
How many films titled Gie have been nominated?
SELECT COUNT("Original title") FROM table_18932 WHERE "Film title used in nomination" = 'Gie'
wikisql
CREATE TABLE table_75336 ( "Game" text, "Date" text, "Home Team" text, "Result" text, "Road Team" text )
What was the result of the game played on April 16 with Philadelphia as home team?
SELECT "Result" FROM table_75336 WHERE "Home Team" = 'philadelphia' AND "Date" = 'april 16'
wikisql
CREATE TABLE table_22622 ( "Country" text, "TV Network(s)" text, "Series Premiere" text, "Weekly Schedule" text, "Status" text )
What is every country with a TV network of AXN India?
SELECT "Country" FROM table_22622 WHERE "TV Network(s)" = 'AXN India'
wikisql
CREATE TABLE table_7280 ( "Call sign" text, "Frequency MHz" real, "City of license" text, "ERP W" real, "Height m ( ft )" text, "Class" text, "FCC info" text )
On what frequency does W233AG broadcast?
SELECT COUNT("Frequency MHz") FROM table_7280 WHERE "Call sign" = 'w233ag'
wikisql
CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE instructor ( instructor_id int, name varchar, uniqname varchar ) CREATE TABLE program_requirement ( program_id int, category varchar, ...
Whose course is it that happens to be the easiest PreMajor course ?
SELECT DISTINCT instructor.name, program_course.workload FROM instructor INNER JOIN offering_instructor ON offering_instructor.instructor_id = instructor.instructor_id INNER JOIN course_offering ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN program_course ON program_course.course_id = cour...
advising
CREATE TABLE table_71047 ( "Category" text, "Film" text, "Director(s)" text, "Country" text, "Nominating Festival" text )
Name the director of alt i alt
SELECT "Director(s)" FROM table_71047 WHERE "Film" = 'alt i alt'
wikisql
CREATE TABLE table_59738 ( "Year" text, "Winner" text, "Runner-up" text, "Venue" text, "Location" text )
What is the location where ed c. kingsley was the runner-up in 1939?
SELECT "Location" FROM table_59738 WHERE "Runner-up" = 'ed c. kingsley' AND "Year" = '1939'
wikisql
CREATE TABLE table_name_69 ( grid INTEGER, laps VARCHAR, driver VARCHAR )
What is the average grid when the laps are smaller than 14 and Reine Wisell is the driver?
SELECT AVG(grid) FROM table_name_69 WHERE laps < 14 AND driver = "reine wisell"
sql_create_context
CREATE TABLE mzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH text, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZZMC ...
能举出在2002年7月9日到2012年2月15日这段时间患者21625825被开出的所有检验报告单的检验报告单号具体都有啥吗?
SELECT jybgb.BGDH FROM hz_info JOIN mzjzjlb JOIN jybgb 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 WHERE hz_info.RYBH = '21625825' AND jybgb.BGRQ BETWEEN '2002-07-09' AND '2012-02-15' UNION...
css
CREATE TABLE Documents_with_Expenses ( Document_ID INTEGER, Budget_Type_Code CHAR(15), Document_Details VARCHAR(255) ) CREATE TABLE Ref_Document_Types ( Document_Type_Code CHAR(15), Document_Type_Name VARCHAR(255), Document_Type_Description VARCHAR(255) ) CREATE TABLE Ref_Budget_Codes ( Bu...
Show the total number from each document type code, and I want to sort y-axis from low to high order.
SELECT Document_Type_Code, COUNT(*) FROM Documents GROUP BY Document_Type_Code ORDER BY COUNT(*)
nvbench
CREATE TABLE actor ( Actor_ID int, Name text, Musical_ID int, Character text, Duration text, age int ) CREATE TABLE musical ( Musical_ID int, Name text, Year int, Award text, Category text, Nominee text, Result text )
how many actors have appeared in each musical?, sort bar in desc order.
SELECT T2.Name, COUNT(*) FROM actor AS T1 JOIN musical AS T2 ON T1.Musical_ID = T2.Musical_ID GROUP BY T1.Musical_ID ORDER BY T2.Name DESC
nvbench
CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) CREATE TABLE flight_fare ( flight_id int, fare_id int ) CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minu...
AA flight 4400 from CINCINNATI to HOUSTON
SELECT DISTINCT FLIGHT_0.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight AS FLIGHT_0, flight AS FLIGHT_1, flight_leg WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'HOUSTON' AND FLIGHT_0.flight_id = flight_l...
atis
CREATE TABLE Participants ( Participant_ID INTEGER, Participant_Type_Code CHAR(15), Participant_Details VARCHAR(255) ) CREATE TABLE Services ( Service_ID INTEGER, Service_Type_Code CHAR(15) ) CREATE TABLE Events ( Event_ID INTEGER, Service_ID INTEGER, Event_Details VARCHAR(255) ) CREA...
Group and count details for the events using a bar chart, and show by the the number of event details in ascending please.
SELECT Event_Details, COUNT(Event_Details) FROM Events GROUP BY Event_Details ORDER BY COUNT(Event_Details)
nvbench
CREATE TABLE table_name_84 ( l3_cache VARCHAR, part_number_s_ VARCHAR )
What's the L3 cache that has a low power part number?
SELECT l3_cache FROM table_name_84 WHERE part_number_s_ = "low power"
sql_create_context
CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text,...
Who's my biggest 'favourite' fan?.
SELECT p.OwnerUserId, p.OwnerDisplayName, p.Id FROM Posts AS p WHERE p.OwnerUserId = '##UserID##' AND p.PostTypeId = 1
sede
CREATE TABLE table_name_51 ( second VARCHAR, equipment VARCHAR, position VARCHAR, points VARCHAR )
What is Second, when Position is greater than 33, when Points is greater than 12, and when Equipment is Zabel-VMC?
SELECT second FROM table_name_51 WHERE position > 33 AND points > 12 AND equipment = "zabel-vmc"
sql_create_context
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...
编号为45531183的患者的检验报告单的报告日期在一六年二月四日之后?这些报告单所对应的门诊就诊的流水号是什么
SELECT mzjzjlb.JZLSH FROM hz_info JOIN mzjzjlb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE hz_info.RYBH = '45531183' AND NOT mzjzjlb.JZLSH IN (SELECT zyjybgb.JZLSH FROM zyjybgb WHERE zyjybgb.BGRQ <= '2016-02-04' UNION SELECT mzjybgb.JZLSH FROM mzjybgb WHERE mzjybgb...
css
CREATE TABLE table_name_26 ( wins INTEGER, top_5 VARCHAR )
Which Wins has a Top-5 of 6?
SELECT AVG(wins) FROM table_name_26 WHERE top_5 = 6
sql_create_context
CREATE TABLE table_name_26 ( round INTEGER, player VARCHAR, pick VARCHAR )
What was the earliest round with Neil Colzie and a pick smaller than 24?
SELECT MIN(round) FROM table_name_26 WHERE player = "neil colzie" AND pick < 24
sql_create_context
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 patient ( uniquepid text, ...
how many days have passed since patient 002-34744 received a -lymphs laboratory test for the last time on their current hospital encounter?
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', lab.labresulttime)) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-34744' AND patient.hospi...
eicu
CREATE TABLE table_18942 ( "Asset Acquired" text, "Acquired From" text, "Date Announced" text, "Date Completed" text, "Reported Cost" text )
On what date was it announced that an asset was acquired for US$9 Million?
SELECT "Date Announced" FROM table_18942 WHERE "Reported Cost" = 'US$9 million'
wikisql
CREATE TABLE table_28846 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text )
How many times did the incumbent was first elected and then lost re-election anti-masonic gain?
SELECT COUNT("First elected") FROM table_28846 WHERE "Result" = 'Lost re-election Anti-Masonic gain'
wikisql
CREATE TABLE table_25352318_1 ( position VARCHAR, season VARCHAR, team VARCHAR )
When racing engineering is the team and 2012 is the team what is the position?
SELECT position FROM table_25352318_1 WHERE season = 2012 AND team = "Racing Engineering"
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...
provide the number of patients whose primary disease is celo-vessicle fistula and age is less than 45?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "CELO-VESSICLE FISTULA" AND demographic.age < "45"
mimicsql_data
CREATE TABLE table_50359 ( "Team" text, "Head Coach" text, "Team Captain" text, "Kitmaker" text, "Shirt sponsor" text )
For the team whose shirt sponsor is Krombacher, who is the team captain?
SELECT "Team Captain" FROM table_50359 WHERE "Shirt sponsor" = 'krombacher'
wikisql
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid num...
what was patient 016-9636's last intake today.
SELECT intakeoutput.celllabel FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-9636')) AND intakeoutput.cellpath LIKE '%intake%' AND DA...
eicu
CREATE TABLE people ( People_ID int, District text, Name text, Party text, Age int ) CREATE TABLE debate ( Debate_ID int, Date text, Venue text, Num_of_Audience int ) CREATE TABLE debate_people ( Debate_ID int, Affirmative int, Negative int, If_Affirmative_Win bool ...
Bar graph to show the total number from different party, and rank Y-axis from high to low order.
SELECT Party, COUNT(*) FROM people GROUP BY Party ORDER BY COUNT(*) DESC
nvbench
CREATE TABLE table_name_69 ( season VARCHAR )
What 20-29 was in season 2008?
SELECT 20 AS _29 FROM table_name_69 WHERE season = "2008"
sql_create_context
CREATE TABLE table_name_85 ( round INTEGER, overall VARCHAR, pick__number VARCHAR )
Which Round is the highest one that has an Overall of 32, and a Pick # smaller than 4?
SELECT MAX(round) FROM table_name_85 WHERE overall = 32 AND pick__number < 4
sql_create_context
CREATE TABLE table_1942683_1 ( house_mascot VARCHAR, house_colour VARCHAR )
How many house mascots are associated with yellow house colours?
SELECT COUNT(house_mascot) FROM table_1942683_1 WHERE house_colour = "Yellow"
sql_create_context
CREATE TABLE table_name_2 ( crowd VARCHAR, away_team VARCHAR )
What was the crowd size for the game at Footscray?
SELECT COUNT(crowd) FROM table_name_2 WHERE away_team = "footscray"
sql_create_context
CREATE TABLE table_40175 ( "Candidate" text, "Votes" real, "Percentage" text, "Counties" real, "Delegates" real )
What is the number of votes when Ron Paul is the candidate with less than 0 counties?
SELECT COUNT("Votes") FROM table_40175 WHERE "Candidate" = 'ron paul' AND "Counties" < '0'
wikisql
CREATE TABLE table_203_406 ( id number, "entrant" text, "constructor" text, "chassis" text, "engine" text, "tyre" text, "driver" text, "rounds" text )
what is the total amount of times porsche is a constructor ?
SELECT COUNT(DISTINCT "entrant") FROM table_203_406 WHERE "constructor" = 'porsche'
squall
CREATE TABLE table_20726262_2 ( title VARCHAR, directedby VARCHAR )
What title episode did Paris Barclay direct?
SELECT title FROM table_20726262_2 WHERE directedby = "Paris Barclay"
sql_create_context
CREATE TABLE Students ( student_id INTEGER, address_id INTEGER, first_name VARCHAR(80), middle_name VARCHAR(40), last_name VARCHAR(40), cell_mobile_number VARCHAR(40), email_address VARCHAR(40), date_first_rental DATETIME, date_left_university DATETIME, other_student_details VARC...
Show me about the distribution of date_address_to and the sum of monthly_rental bin date_address_to by time in a bar chart.
SELECT date_address_to, SUM(monthly_rental) FROM Student_Addresses ORDER BY monthly_rental DESC
nvbench
CREATE TABLE table_23734 ( "Season" text, "Games" real, "Tries" real, "Conversions" real, "Penalties" real, "Drop Goals" real, "Total Points" real )
How many seasons featured 29 conversions?
SELECT COUNT("Penalties") FROM table_23734 WHERE "Conversions" = '29'
wikisql
CREATE TABLE table_25896 ( "Series #" real, "Season #" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" text )
How many episodes were directed by Sarah Pia Anderson?
SELECT COUNT("Title") FROM table_25896 WHERE "Directed by" = 'Sarah Pia Anderson'
wikisql
CREATE TABLE Ref_Calendar ( Calendar_Date DATETIME, Day_Number INTEGER ) CREATE TABLE Documents_to_be_Destroyed ( Document_ID INTEGER, Destruction_Authorised_by_Employee_ID INTEGER, Destroyed_by_Employee_ID INTEGER, Planned_Destruction_Date DATETIME, Actual_Destruction_Date DATETIME, Ot...
Plot how many date in location from over date in location from in a line chart, and list by the X from low to high.
SELECT Date_in_Location_From, COUNT(Date_in_Location_From) FROM Document_Locations GROUP BY Date_in_Location_From ORDER BY Date_in_Location_From
nvbench
CREATE TABLE table_13762472_3 ( high_points VARCHAR, game VARCHAR )
How many players scored the most points on game 4?
SELECT COUNT(high_points) FROM table_13762472_3 WHERE game = 4
sql_create_context
CREATE TABLE table_76759 ( "Player" text, "Pos." text, "Nationality" text, "Team" text, "Previous team" text, "Years of NBA experience [a ]" real, "Career with the franchise [b ]" text )
How many years of NBA experience does the player who plays position g for the Portland Trail Blazers?
SELECT "Years of NBA experience [a ]" FROM table_76759 WHERE "Pos." = 'g' AND "Team" = 'portland trail blazers'
wikisql
CREATE TABLE table_3806 ( "Team #1" text, "Points" text, "Team #2" text, "1st leg" text, "2nd leg" text )
What was the 2nd leg score if the team 1 is Deportivo Pasto?
SELECT "2nd leg" FROM table_3806 WHERE "Team #1" = 'Deportivo Pasto'
wikisql
CREATE TABLE table_name_63 ( elevator VARCHAR, elector VARCHAR )
When Giovanni Gaetano Orsini was the elector who was the elevator?
SELECT elevator FROM table_name_63 WHERE elector = "giovanni gaetano orsini"
sql_create_context
CREATE TABLE table_name_53 ( bronze INTEGER, gold VARCHAR, nation VARCHAR, silver VARCHAR, total VARCHAR )
Which Bronze has a Silver larger than 1, a Total larger than 3, a Nation of turkey, and a Gold smaller than 2?
SELECT SUM(bronze) FROM table_name_53 WHERE silver > 1 AND total > 3 AND nation = "turkey" AND gold < 2
sql_create_context
CREATE TABLE table_31590 ( "Member" text, "Electorate" text, "Province" text, "MP's term" text, "Election date" text )
What is the Election date for Member william richmond category:articles with hcards?
SELECT "Election date" FROM table_31590 WHERE "Member" = 'william richmond category:articles with hcards'
wikisql
CREATE TABLE paperfield ( fieldid int, paperid int ) CREATE TABLE keyphrase ( keyphraseid int, keyphrasename varchar ) CREATE TABLE journal ( journalid int, journalname varchar ) CREATE TABLE cite ( citingpaperid int, citedpaperid int ) CREATE TABLE paper ( paperid int, title...
find me paper on using Neural for Relation Extraction
SELECT DISTINCT paperkeyphrase.paperid FROM keyphrase, paperkeyphrase WHERE keyphrase.keyphrasename IN ('Neural', 'Relation Extraction') GROUP BY paperkeyphrase.paperid HAVING COUNT(DISTINCT keyphrase.keyphraseid) = 1
scholar
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 job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), ...
For those employees who was hired before 2002-06-21, a line chart shows the change of commission_pct over hire_date, and I want to display in desc by the x-axis.
SELECT HIRE_DATE, COMMISSION_PCT FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY HIRE_DATE DESC
nvbench
CREATE TABLE table_33085 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What is the total crowd size when the away team scores 14.6 (90)?
SELECT SUM("Crowd") FROM table_33085 WHERE "Away team score" = '14.6 (90)'
wikisql
CREATE TABLE table_name_62 ( loss VARCHAR, date VARCHAR )
What was the score of the game for April 16?
SELECT loss FROM table_name_62 WHERE date = "april 16"
sql_create_context
CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL )
For those records from the products and each product's manufacturer, what is the relationship between code and code , and group by attribute founder?
SELECT T1.Code, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder
nvbench
CREATE TABLE genres ( id number, name text ) CREATE TABLE media_types ( id number, name text ) CREATE TABLE customers ( id number, first_name text, last_name text, company text, address text, city text, state text, country text, postal_code text, phone text, ...
What are the names of all tracks that are on playlists titled Movies?
SELECT T1.name FROM tracks AS T1 JOIN playlist_tracks AS T2 ON T1.id = T2.track_id JOIN playlists AS T3 ON T3.id = T2.playlist_id WHERE T3.name = "Movies"
spider
CREATE TABLE party ( region_id VARCHAR, party_id VARCHAR ) CREATE TABLE party_events ( party_id VARCHAR, Event_Name VARCHAR ) CREATE TABLE region ( region_id VARCHAR, region_name VARCHAR )
How many Annual Meeting events happened in the United Kingdom region?
SELECT COUNT(*) FROM region AS t1 JOIN party AS t2 ON t1.region_id = t2.region_id JOIN party_events AS t3 ON t2.party_id = t3.party_id WHERE t1.region_name = "United Kingdom" AND t3.Event_Name = "Annaual Meeting"
sql_create_context
CREATE TABLE table_14327 ( "Rank" real, "Year" real, "Name" text, "Moving from" text, "Moving to" text )
When was the earliest year that kakha kaladze moved to milan with a rank above 9?
SELECT MIN("Year") FROM table_14327 WHERE "Moving to" = 'milan' AND "Name" = 'kakha kaladze' AND "Rank" < '9'
wikisql
CREATE TABLE table_59515 ( "Opposing Teams" text, "Against" real, "Date" text, "Venue" text, "Status" text )
What is the average against of Murrayfield, Edinburgh?
SELECT AVG("Against") FROM table_59515 WHERE "Venue" = 'murrayfield, edinburgh'
wikisql
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 state ( state_code text, state_name text, country_name text ) CREATE T...
from WASHINGTON to PHILADELPHIA departing in the afternoon
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, state WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'WASHINGTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_nam...
atis
CREATE TABLE table_12221 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Record" text )
What is Date, when Record is '1-1'?
SELECT "Date" FROM table_12221 WHERE "Record" = '1-1'
wikisql
CREATE TABLE table_name_17 ( gamecenter VARCHAR, attendance VARCHAR )
Name the gamecenter that has attendance of 65,212
SELECT gamecenter FROM table_name_17 WHERE attendance = "65,212"
sql_create_context
CREATE TABLE people ( People_ID int, Age int, Name text, Nationality text, Graduation_College text ) CREATE TABLE employment ( Company_ID int, People_ID int, Year_working int ) CREATE TABLE company ( Company_ID real, Name text, Headquarters text, Industry text, Sale...
Bar chart x axis headquarters y axis the total number, and sort y-axis in asc order.
SELECT Headquarters, COUNT(*) FROM company GROUP BY Headquarters ORDER BY COUNT(*)
nvbench
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...
把团伙成员喻星海最常开的几种药品排序查看一下
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.PERSON_NM = '喻星海' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY COUNT(*) DESC
css
CREATE TABLE table_204_180 ( id number, "date" text, "opponent#" text, "rank#" text, "site" text, "result" text, "attendance" number )
how many games did they play total ?
SELECT COUNT(*) FROM table_204_180
squall
CREATE TABLE table_name_9 ( score VARCHAR, venue VARCHAR )
What was the score at North Shore Events Centre?
SELECT score FROM table_name_9 WHERE venue = "north shore events centre"
sql_create_context
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 icd9 code of subject name ida cook?
SELECT demographic.diagnosis, diagnoses.icd9_code FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.name = "Ida Cook"
mimicsql_data
CREATE TABLE Movie ( mID int, title text, year int, director text ) CREATE TABLE Rating ( rID int, mID int, stars int, ratingDate date ) CREATE TABLE Reviewer ( rID int, name text )
Show the title and score of the movie with a pie chart.
SELECT title, stars FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID
nvbench
CREATE TABLE table_15608800_2 ( number_at_march VARCHAR, class VARCHAR )
Name the number at march when class is j66
SELECT number_at_march FROM table_15608800_2 WHERE class = "J66"
sql_create_context
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, ...
褚芳洁患者在医疗就诊92050718697中,有那个项目的自费金额是最高的
SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc22 JOIN t_kc21_t_kc22 JOIN t_kc21 ON t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID AND t_kc21_t_kc22.MED_CLINIC_ID = t_kc21.MED_CLINIC_ID WHERE t_kc21.MED_CLINIC_ID = '92050718697' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY SUM(t_kc22.SELF_PAY_AMO) DES...
css
CREATE TABLE program_course ( program_id int, course_id int, workload int, category varchar ) CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int,...
Name for me all PreMajor classes .
SELECT DISTINCT course.department, course.name, course.number FROM course, program, program_course WHERE program_course.category LIKE '%PreMajor%' AND program_course.course_id = course.course_id AND program.name LIKE '%CS-LSA%' AND program.program_id = program_course.program_id
advising
CREATE TABLE table_52391 ( "Season" text, "Competition" text, "Round" text, "Club" text, "Score" text )
In which season was there a competition in the Champions League?
SELECT "Season" FROM table_52391 WHERE "Competition" = 'champions league'
wikisql
CREATE TABLE rating ( rid number, mid number, stars number, ratingdate time ) CREATE TABLE movie ( mid number, title text, year number, director text ) CREATE TABLE reviewer ( rid number, name text )
What is the id of the reviewer whose name has substring Mike ?
SELECT rid FROM reviewer WHERE name LIKE "%Mike%"
spider