context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_56964 ( "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 venue where the away team scored 10.11 (71)?
SELECT "Venue" FROM table_56964 WHERE "Away team score" = '10.11 (71)'
wikisql
CREATE TABLE trip ( id number, duration number, start_date text, start_station_name text, start_station_id number, end_date text, end_station_name text, end_station_id number, bike_id number, subscription_type text, zip_code number ) CREATE TABLE station ( id number, ...
What is the number of days that had an average humity above 50 and an average visibility above 8?
SELECT COUNT(*) FROM weather WHERE mean_humidity > 50 AND mean_visibility_miles > 8
spider
CREATE TABLE company ( main_industry VARCHAR, market_value INTEGER )
List the main industry with highest total market value and its number of companies.
SELECT main_industry, COUNT(*) FROM company GROUP BY main_industry ORDER BY SUM(market_value) DESC LIMIT 1
sql_create_context
CREATE TABLE table_63569 ( "Song" text, "Performer" text, "Original artist" text, "Length" text, "Recorded" text )
Which song lasts 3:34?
SELECT "Song" FROM table_63569 WHERE "Length" = '3:34'
wikisql
CREATE TABLE table_name_70 ( team VARCHAR, year VARCHAR )
what is the team that played in 2006?
SELECT team FROM table_name_70 WHERE year = 2006
sql_create_context
CREATE TABLE table_9626 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text )
What was Craig Stadler's score?
SELECT "Score" FROM table_9626 WHERE "Player" = 'craig stadler'
wikisql
CREATE TABLE medicine ( id int, name text, Trade_Name text, FDA_approved text ) CREATE TABLE enzyme ( id int, name text, Location text, Product text, Chromosome text, OMIM int, Porphyria text ) CREATE TABLE medicine_enzyme_interaction ( enzyme_id int, medicine_id in...
What are the ids and names of the medicine that can interact with two or more enzymes Visualize by bar chart, show by the x-axis in asc.
SELECT name, id FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id = T1.id ORDER BY name
nvbench
CREATE TABLE genre ( g_name varchar2(20), rating varchar2(10), most_popular_in varchar2(50) ) CREATE TABLE song ( song_name varchar2(50), artist_name varchar2(50), country varchar2(20), f_id number(10), genre_is varchar2(20), rating number(10), languages varchar2(20), releas...
A bar chart about how many songs were released for each format?, could you list Y-axis in descending order?
SELECT formats, COUNT(*) FROM files GROUP BY formats ORDER BY COUNT(*) DESC
nvbench
CREATE TABLE table_65063 ( "Pick" real, "Player" text, "Country of origin*" text, "PBA team" text, "College" text )
What is the Pick 3 Player from East College?
SELECT "Player" FROM table_65063 WHERE "College" = 'east' AND "Pick" = '3'
wikisql
CREATE TABLE table_59449 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Partner" text, "Opponents in the final" text, "Score in the final" text )
What surface did Ruxandra Dragomir play on?
SELECT "Surface" FROM table_59449 WHERE "Partner" = 'ruxandra dragomir'
wikisql
CREATE TABLE table_13192 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" real, "Money ( $ )" text )
How much money does player horton smith have?
SELECT "Money ( $ )" FROM table_13192 WHERE "Player" = 'horton smith'
wikisql
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_CLINIC_ID text, MED_DIRE_CD tex...
编号62138330296的医疗就诊对应的门诊号或住院号是什么
SELECT gwyjzb.CLINIC_ID FROM gwyjzb WHERE gwyjzb.MED_CLINIC_ID = '62138330296' UNION SELECT fgwyjzb.CLINIC_ID FROM fgwyjzb WHERE fgwyjzb.MED_CLINIC_ID = '62138330296'
css
CREATE TABLE table_38355 ( "Rank" text, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
Total smaller than 10, and a Gold larger than 1 then what is the lowest silver?
SELECT MIN("Silver") FROM table_38355 WHERE "Total" < '10' AND "Gold" > '1'
wikisql
CREATE TABLE table_22379931_2 ( fastest_lap VARCHAR, pole_position VARCHAR )
Who has the fastest lap where Beno t Tr luyer got the pole position?
SELECT fastest_lap FROM table_22379931_2 WHERE pole_position = "Benoît Tréluyer"
sql_create_context
CREATE TABLE table_46864 ( "State" text, "Type" text, "Name" text, "Title" text, "Royal house" text, "From" text )
What type of state was Chu?
SELECT "Type" FROM table_46864 WHERE "State" = 'chu'
wikisql
CREATE TABLE table_6396 ( "Round" real, "Pick" real, "Player" text, "Position" text, "School" text )
What is the total number of rounds for the player of Rell Tipton?
SELECT COUNT("Round") FROM table_6396 WHERE "Player" = 'rell tipton'
wikisql
CREATE TABLE table_18594107_2 ( points INTEGER, scored VARCHAR )
How many points when the score is 14?
SELECT MIN(points) FROM table_18594107_2 WHERE scored = 14
sql_create_context
CREATE TABLE table_7865 ( "Seeded at" text, "Team" text, "League" text, "Notes" text, "Eliminated at" text )
WHAT TEAM WAS AN NCAA CHAMPION?
SELECT "Team" FROM table_7865 WHERE "Notes" = 'ncaa champion'
wikisql
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_CLINIC_ID text, MED_DIRE_CD tex...
在医院3289603出院的病人蒋红叶诊断的病名不包含2的医疗就诊记录编码具体是啥?
SELECT qtb.MED_CLINIC_ID FROM qtb WHERE qtb.PERSON_NM = '蒋红叶' AND qtb.MED_SER_ORG_NO = '3289603' AND NOT qtb.OUT_DIAG_DIS_NM LIKE '%2%' UNION SELECT gyb.MED_CLINIC_ID FROM gyb WHERE gyb.PERSON_NM = '蒋红叶' AND gyb.MED_SER_ORG_NO = '3289603' AND NOT gyb.OUT_DIAG_DIS_NM LIKE '%2%' UNION SELECT zyb.MED_CLINIC_ID FROM zyb WH...
css
CREATE TABLE Addresses ( address_id INTEGER, line_1_number_building VARCHAR(80), city VARCHAR(50), zip_postcode VARCHAR(20), state_province_county VARCHAR(50), country VARCHAR(50) ) CREATE TABLE Staff ( staff_id INTEGER, staff_address_id INTEGER, nickname VARCHAR(80), first_name...
For each payment method, how many payments were made Show bar chart, and rank in asc by the x-axis please.
SELECT payment_method_code, COUNT(*) FROM Customer_Payments GROUP BY payment_method_code ORDER BY payment_method_code
nvbench
CREATE TABLE table_204_880 ( id number, "year" number, "competition" text, "venue" text, "position" text, "event" text, "notes" text )
how many marathons were held in beijing ?
SELECT COUNT("competition") FROM table_204_880 WHERE "venue" = 'beijing'
squall
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE chartevents ( row_id number, subject_id number, h...
what's the time for the hospital admission of patient 52604 since 4 years ago?
SELECT admissions.admittime FROM admissions WHERE admissions.subject_id = 52604 AND DATETIME(admissions.admittime) >= DATETIME(CURRENT_TIME(), '-4 year')
mimic_iii
CREATE TABLE producer ( pid int, gender text, name text, nationality text, birth_city text, birth_year int ) CREATE TABLE actor ( aid int, gender text, name text, nationality text, birth_city text, birth_year int ) CREATE TABLE copyright ( id int, msid int, ...
How many movies did ' Shahab Hosseini ' act in
SELECT COUNT(DISTINCT (movie.title)) FROM actor, cast, movie WHERE actor.name = 'Shahab Hosseini' AND cast.aid = actor.aid AND movie.mid = cast.msid
imdb
CREATE TABLE table_43177 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text )
What country was the player, rod pampling, from who placed t10?
SELECT "Country" FROM table_43177 WHERE "Place" = 't10' AND "Player" = 'rod pampling'
wikisql
CREATE TABLE table_name_28 ( west VARCHAR, south VARCHAR )
What was west when ev f rstenfeldbruck was south?
SELECT west FROM table_name_28 WHERE south = "ev fürstenfeldbruck"
sql_create_context
CREATE TABLE table_5339 ( "Date" text, "Home captain" text, "Away captain" text, "Venue" text, "Result" text )
What venue has eng by 10 runs as the result?
SELECT "Venue" FROM table_5339 WHERE "Result" = 'eng by 10 runs'
wikisql
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospit...
what's the first diagnosis patient 002-34744 got in this hospital visit?
SELECT diagnosis.diagnosisname FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-34744' AND patient.hospitaldischargetime IS NULL)) ORDER BY d...
eicu
CREATE TABLE table_25042332_26 ( region VARCHAR, solar_panel VARCHAR )
What region has 0.3% solar panel?
SELECT region FROM table_25042332_26 WHERE solar_panel = "0.3%"
sql_create_context
CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) CREATE TABLE diagnosis ( diagn...
when was patient 010-32430's first discharge until 2100?
SELECT patient.hospitaldischargetime FROM patient WHERE patient.uniquepid = '010-32430' AND STRFTIME('%y', patient.hospitaldischargetime) <= '2100' ORDER BY patient.hospitaldischargetime LIMIT 1
eicu
CREATE TABLE table_2623498_5 ( prod_code VARCHAR, episode__number VARCHAR )
What is the number of production codes for episode #73?
SELECT COUNT(prod_code) FROM table_2623498_5 WHERE episode__number = "73"
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...
Show me about the distribution of ACC_Regular_Season and All_Games_Percent in a bar chart, and could you order x-axis in asc order?
SELECT ACC_Regular_Season, All_Games_Percent FROM basketball_match ORDER BY ACC_Regular_Season
nvbench
CREATE TABLE table_name_78 ( gold INTEGER, rank VARCHAR, bronze VARCHAR, silver VARCHAR )
How much Gold has a Bronze smaller than 2, and a Silver of 0, and a Rank larger than 3?
SELECT SUM(gold) FROM table_name_78 WHERE bronze < 2 AND silver = 0 AND rank > 3
sql_create_context
CREATE TABLE table_13869651_3 ( frequency VARCHAR, part_number_s_ VARCHAR )
How many different frequencies does the model with part number ado540biaa5do?
SELECT COUNT(frequency) FROM table_13869651_3 WHERE part_number_s_ = "ADO540BIAA5DO"
sql_create_context
CREATE TABLE table_name_21 ( natural_wood_keyboard VARCHAR, model VARCHAR )
Which Natural Wood Keyboard has a CLP380 ?
SELECT natural_wood_keyboard FROM table_name_21 WHERE model = "clp380"
sql_create_context
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, last_wardid number, ...
tell me patient 76005's sex.
SELECT patients.gender FROM patients WHERE patients.subject_id = 76005
mimic_iii
CREATE TABLE table_name_60 ( points INTEGER, played VARCHAR, drawn VARCHAR, lost VARCHAR )
what is the average points when drawn is 0, lost is 5 and played is more than 10?
SELECT AVG(points) FROM table_name_60 WHERE drawn = 0 AND lost = 5 AND played > 10
sql_create_context
CREATE TABLE apartment_bookings ( apt_booking_id number, apt_id number, guest_id number, booking_status_code text, booking_start_date time, booking_end_date time ) CREATE TABLE guests ( guest_id number, gender_code text, guest_first_name text, guest_last_name text, date_of_b...
Show the most common apartment type code.
SELECT apt_type_code FROM apartments GROUP BY apt_type_code ORDER BY COUNT(*) DESC LIMIT 1
spider
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, ...
Provide the number of black/cape verdean patients with procedure icd9 code 9969.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.ethnicity = "BLACK/CAPE VERDEAN" AND procedures.icd9_code = "9969"
mimicsql_data
CREATE TABLE table_name_46 ( opponent VARCHAR, record VARCHAR, week VARCHAR, game_site VARCHAR )
Which Opponent has a Week larger than 3, and a Game site of mile high stadium, and a Record of 3 3?
SELECT opponent FROM table_name_46 WHERE week > 3 AND game_site = "mile high stadium" AND record = "3–3"
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 ...
医院2158634里面就诊的病患60094518在出院的时候科室名称中没有与的住院就诊记录是哪几条?
SELECT * FROM hz_info JOIN zyjzjlb JOIN hz_info_zyjzjlb ON hz_info.YLJGDM = hz_info_zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX AND hz_info_zyjzjlb.JZLSH = zyjzjlb.JZLSH AND hz_info_zyjzjlb.YLJGDM = hz_info_zyjzjlb.YLJGDM AND hz_info_zyjzjlb.JZLSH = zyjzjlb.JZLSH AND hz_info_zyjzjlb.zyjzjlb...
css
CREATE TABLE pitching ( player_id TEXT, year INTEGER, stint INTEGER, team_id TEXT, league_id TEXT, w INTEGER, l INTEGER, g INTEGER, gs INTEGER, cg INTEGER, sho INTEGER, sv INTEGER, ipouts NUMERIC, h INTEGER, er INTEGER, hr INTEGER, bb INTEGER, so I...
count yearid for visualizing a line chart.
SELECT yearid, COUNT(yearid) FROM hall_of_fame
nvbench
CREATE TABLE table_73931 ( "Week #" text, "Theme" text, "Song choice" text, "Original artist" text, "Order #" text, "Result" text )
what are all the results of songs is ' golden train
SELECT "Result" FROM table_73931 WHERE "Song choice" = ' Golden Train '
wikisql
CREATE TABLE table_38033 ( "Date" text, "Label" text, "Region" text, "Format" text, "Catalog" real )
Which Format has a Catalog of 61298, and a Date of september 1984?
SELECT "Format" FROM table_38033 WHERE "Catalog" = '61298' AND "Date" = 'september 1984'
wikisql
CREATE TABLE student ( stu_num number, stu_lname text, stu_fname text, stu_init text, stu_dob time, stu_hrs number, stu_class text, stu_gpa number, stu_transfer number, dept_code text, stu_phone text, prof_num number ) CREATE TABLE class ( class_code text, crs_co...
What is the first and last name of the professor in biology department?
SELECT T3.emp_fname, T3.emp_lname FROM professor AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code JOIN employee AS T3 ON T1.emp_num = T3.emp_num WHERE dept_name = "Biology"
spider
CREATE TABLE table_28606 ( "Election number" real, "Election date" text, "District" text, "Province" text, "Took office" text, "Left office" text )
What are the election date for elections held in the province of Albacete?
SELECT "Election date" FROM table_28606 WHERE "Province" = 'Albacete'
wikisql
CREATE TABLE table_33470 ( "Year" real, "Network" text, "Play-by-play" text, "Color commentator(s)" text, "Sideline reporter(s)" text )
Who was the 2004 color commentator?
SELECT "Color commentator(s)" FROM table_33470 WHERE "Year" = '2004'
wikisql
CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate time, ApprovalDate time, RejectionDate time, OwnerUserId number, Comment text, Text text, Title text, Tags text, RevisionGUID other ) CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, ...
Query for Energy related words in body of posts.
SELECT * FROM Posts WHERE ('body' LIKE '%energy%' OR 'body' LIKE '%energy consum%')
sede
CREATE TABLE table_12950 ( "Player" text, "Country" text, "Year(s) won" text, "Total" real, "To par" text, "Finish" text )
For the total of 288 what was the to par?
SELECT "To par" FROM table_12950 WHERE "Total" = '288'
wikisql
CREATE TABLE table_name_11 ( turnout__percentage VARCHAR, ngilu VARCHAR )
What's listed for the Turnout % with a Ngilu of 3,429?
SELECT turnout__percentage FROM table_name_11 WHERE ngilu = "3,429"
sql_create_context
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE medication ( medicationid number, pat...
what was the name of the lab test that patient 010-17950 received for the last time?
SELECT lab.labname FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '010-17950')) ORDER BY lab.labresulttime DESC LIMIT 1
eicu
CREATE TABLE table_203_874 ( id number, "year" number, "competition" text, "venue" text, "position" text, "event" text, "notes" text )
which venue is listed the most ?
SELECT "venue" FROM table_203_874 GROUP BY "venue" ORDER BY COUNT(*) DESC LIMIT 1
squall
CREATE TABLE table_54265 ( "Railway" text, "Loco name" text, "Build date" real, "Wheels" text, "Disposal" text )
What was the build date of the railway(s) with 0-6-2 t wheels?
SELECT "Build date" FROM table_54265 WHERE "Wheels" = '0-6-2 t'
wikisql
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,...
How many patients admitted before the year 2151 had clinical chemistry tests by lab?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2151" AND lab."CATEGORY" = "Chemistry"
mimicsql_data
CREATE TABLE airport ( airport_code varchar, airport_name text, airport_location text, state_code varchar, country_name varchar, time_zone_code varchar, minimum_connect_time int ) CREATE TABLE restriction ( restriction_code text, advance_purchase int, stopovers text, saturda...
i want to fly from DENVER to SAN FRANCISCO with at least one stop
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND flight.stops > 0 AND flight.to_airport = AIRPORT_SERVICE_1.airport_cod...
atis
CREATE TABLE table_name_85 ( total VARCHAR, e_score VARCHAR, a_score VARCHAR )
What was the total score when the E score was larger than 9.6 and the A score was 6?
SELECT total FROM table_name_85 WHERE e_score > 9.6 AND a_score = 6
sql_create_context
CREATE TABLE table_3372 ( "Date (YYYY-MM-DD)" text, "Time (UTC)" text, "Latitude" text, "Longitude" text, "Depth" text, "Magnitude" text )
If the longitude is 158.091 e, what is the depth?
SELECT "Depth" FROM table_3372 WHERE "Longitude" = '158.091° E'
wikisql
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartr...
count the number of patients who are currently in the hospital.
SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.hospitaldischargetime IS NULL
eicu
CREATE TABLE table_8458 ( "Pick #" real, "CFL Team" text, "Player" text, "Position" text, "College" text )
Who is the player with a FB position?
SELECT "Player" FROM table_8458 WHERE "Position" = 'fb'
wikisql
CREATE TABLE table_60584 ( "Shooter" text, "Event" text, "Rank points" text, "Score points" text, "Total" text )
What is the score points in WC Kerrville, when rank was points of 8?
SELECT "Score points" FROM table_60584 WHERE "Event" = 'wc kerrville' AND "Rank points" = '8'
wikisql
CREATE TABLE table_53174 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Date" text )
What is the away team's score of the game where the away team is Geelong?
SELECT "Away team score" FROM table_53174 WHERE "Away team" = 'geelong'
wikisql
CREATE TABLE table_65073 ( "Model number" text, "sSpec number" text, "Frequency" text, "Turbo" text, "Cores" text, "L2 cache" text, "L3 cache" text, "I/O bus" text, "Mult." text, "Memory" text, "Voltage" text, "Socket" text, "Release date" text, "Part number(s)" t...
What Memory has a Turbo of 2/2/4/5 and the Release date of May 2010?
SELECT "Memory" FROM table_65073 WHERE "Turbo" = '2/2/4/5' AND "Release date" = 'may 2010'
wikisql
CREATE TABLE qtb ( 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...
4050783这个医院的患者78487358,列出其出院诊断医生是韦医生的那次出院诊断的结果
SELECT qtb.OUT_DIAG_DIS_CD, qtb.OUT_DIAG_DIS_NM FROM qtb WHERE qtb.PERSON_ID = '78487358' AND qtb.MED_SER_ORG_NO = '4050783' AND qtb.OUT_DIAG_DOC_NM LIKE '韦%' UNION SELECT gyb.OUT_DIAG_DIS_CD, gyb.OUT_DIAG_DIS_NM FROM gyb WHERE gyb.PERSON_ID = '78487358' AND gyb.MED_SER_ORG_NO = '4050783' AND gyb.OUT_DIAG_DOC_NM LIKE '...
css
CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, ...
Unanswered questions that have a zero-score. Questions that can be marked as answered by upvoting a self-answered question.
SELECT q.Id AS "post_link" FROM Posts AS q WHERE q.PostTypeId = 1 AND q.ClosedDate IS NULL AND q.AcceptedAnswerId IS NULL AND q.AnswerCount > 0 AND EXISTS(SELECT a.Id FROM Posts AS a WHERE a.Score = 0 AND a.ParentId = q.Id) AND NOT EXISTS(SELECT a.Id FROM Posts AS a WHERE a.Score > 0 AND a.ParentId = q.Id) ORDER BY q.I...
sede
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,...
可以根据不同的科室名称和入院诊断疾病名称,把患者的平均年龄在医院4149956的所有医疗就诊记录中列出来都是哪些?
SELECT MED_ORG_DEPT_NM, IN_DIAG_DIS_NM, AVG(PERSON_AGE) FROM t_kc21 WHERE MED_SER_ORG_NO = '4149956' GROUP BY MED_ORG_DEPT_NM, IN_DIAG_DIS_NM
css
CREATE TABLE table_name_34 ( ihsaa_class VARCHAR, location VARCHAR )
What are the IHSAA classes of the Indianapolis schools?
SELECT ihsaa_class FROM table_name_34 WHERE location = "indianapolis"
sql_create_context
CREATE TABLE table_10470082_7 ( _number INTEGER, writer VARCHAR )
What is the largest # for an episode that was written by Allison Lea Bingeman?
SELECT MAX(_number) FROM table_10470082_7 WHERE writer = "Allison Lea Bingeman"
sql_create_context
CREATE TABLE table_7842 ( "Species" text, "Species common name" text, "NCBI Accession Number (mRNA/Protein)" text, "Length (bp/aa)" text, "Protein Identity" text )
Which Species has a Length (bp/aa) of 1154bp/358aa?
SELECT "Species" FROM table_7842 WHERE "Length (bp/aa)" = '1154bp/358aa'
wikisql
CREATE TABLE table_30637 ( "Rank" real, "Country" text, "Miss Universe" text, "1st Runner-up" real, "2nd Runner-up" real, "3rd Runner-up" real, "4th Runner-up" real, "Semifinalists" real, "Total" real )
How many placements in total does russia have?
SELECT MAX("Total") FROM table_30637 WHERE "Country" = 'Russia'
wikisql
CREATE TABLE table_name_33 ( away_team VARCHAR, home_team VARCHAR )
What away team played when the home team was south melbourne?
SELECT away_team FROM table_name_33 WHERE home_team = "south melbourne"
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, give me the comparison about the sum of revenue over the headquarter , and group by attribute headquarter by a bar chart, and list by the X from high to low.
SELECT Headquarter, SUM(Revenue) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter ORDER BY Headquarter DESC
nvbench
CREATE TABLE table_80111 ( "Game" real, "Date" text, "Location" text, "Time" text, "Attendance" real )
For the game that was played on october 22 in west side grounds, what is the total attendance
SELECT COUNT("Attendance") FROM table_80111 WHERE "Location" = 'west side grounds' AND "Date" = 'october 22'
wikisql
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,...
参保人05261498在二00二年十月十一日到二00六年九月十八日内,在门诊产生了多少手术费
SELECT SUM(t_kc22.AMOUNT) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_ID = '05261498' AND t_kc21.CLINIC_TYPE = '门诊' AND t_kc22.STA_DATE BETWEEN '2002-10-11' AND '2006-09-18' AND t_kc22.MED_INV_ITEM_TYPE = '手术费'
css
CREATE TABLE table_11383 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What is the home score with Away team score of 3.7 (25)?
SELECT "Home team score" FROM table_11383 WHERE "Away team score" = '3.7 (25)'
wikisql
CREATE TABLE table_29153 ( "Common Name" text, "Genus & Species" text, "NCBI Accession Number" text, "Length (AA)" real, "% Identity to C7orf38" real, "% Similarity to C7orf38" real )
What is the % identity to C7orf38 of the animal whose common name is rat?
SELECT MIN("% Identity to C7orf38") FROM table_29153 WHERE "Common Name" = 'Rat'
wikisql
CREATE TABLE table_77948 ( "Team" text, "Points" real, "Played" real, "Drawn" real, "Lost" real, "Against" real, "Diff" real )
What is the average against score of all teams with less than 7 losses, more than 6 draws, and 25 points?
SELECT AVG("Against") FROM table_77948 WHERE "Lost" < '7' AND "Drawn" > '6' AND "Points" = '25'
wikisql
CREATE TABLE table_25428 ( "Outcome" text, "Year" real, "Championship" text, "Surface" text, "Opponent in the final" text, "Score in the final" text )
What was the outcome of the match with score 4 6, 3 6, 2 6?
SELECT "Outcome" FROM table_25428 WHERE "Score in the final" = '4–6, 3–6, 2–6'
wikisql
CREATE TABLE table_76738 ( "Game" real, "Date" text, "Team" text, "Score" text, "Record" text, "Streak" text )
What is the lowest Game, when Date is March 21?
SELECT MIN("Game") FROM table_76738 WHERE "Date" = 'march 21'
wikisql
CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TI...
For those employees who do not work in departments with managers that have ids between 100 and 200, visualize a line chart about the change of salary over hire_date , and I want to order by the X in ascending.
SELECT HIRE_DATE, SALARY FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY HIRE_DATE
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 aged below 58 years have hypoxia as their primary disease?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "HYPOXIA" AND demographic.age < "58"
mimicsql_data
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 )
which country won the 1994 europeans men 's handball championship 's preliminary round ?
SELECT "team" FROM table_200_4 ORDER BY "pts." DESC LIMIT 1
squall
CREATE TABLE table_27255755_1 ( no_in_series INTEGER, us_viewers__millions_ VARCHAR )
What is the highest series number with 9.17 million US viewers?
SELECT MAX(no_in_series) FROM table_27255755_1 WHERE us_viewers__millions_ = "9.17"
sql_create_context
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, ...
患者许涵映在2012年7月16日之后做过的检验报告在哪些住院门诊?列出这些住院就诊的流水编码
SELECT zyjzjlb.JZLSH FROM person_info JOIN hz_info JOIN zyjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE person_info.XM = '许涵映' AND NOT zyjzjlb.JZLSH IN (SELECT zyjybgb.JZLSH FROM zyjybgb WHERE zyjybgb.BGRQ <= '2012-07-16' UNI...
css
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 ( ...
what is the number of patients whose primary disease is s/p hanging and year of birth is less than 2123?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "S/P HANGING" AND demographic.dob_year < "2123"
mimicsql_data
CREATE TABLE table_42888 ( "Country" text, "Telenovela" text, "Translation" text, "Series Premiere" text, "Series Finale" text, "Weekly Schedule" text, "Timeslot" text )
What series finale has the translation / ?
SELECT "Series Finale" FROM table_42888 WHERE "Translation" = 'ოჰ ეს ცრემლები / პარალელური საიდუმლო'
wikisql
CREATE TABLE table_28181347_6 ( replaced_by VARCHAR, date_of_vacancy VARCHAR )
In football league one, what coach was hired as a replacement on 8 October 2007
SELECT replaced_by FROM table_28181347_6 WHERE date_of_vacancy = "8 October 2007"
sql_create_context
CREATE TABLE table_name_66 ( winning_driver VARCHAR, winning_manufacturer VARCHAR )
Who is the winning driver of the race with no race as the winning manufacturer?
SELECT winning_driver FROM table_name_66 WHERE winning_manufacturer = "no race"
sql_create_context
CREATE TABLE table_name_72 ( worst_score VARCHAR, best_score VARCHAR, average VARCHAR )
WHAT IS THE WORST SCORE WHEN THE BEST SCORE WAS 8.8 AND AVERAGE WAS LARGER THAN 6.2?
SELECT COUNT(worst_score) FROM table_name_72 WHERE best_score = 8.8 AND average > 6.2
sql_create_context
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 TABLE EMPLOYEE ( EMP_NUM int, EMP_LNAME varchar(15), EMP_FNAME varchar(12), EMP_INITIAL varchar(1), EMP_JOBCODE va...
How many professors for each first name? Show me a bar chart, and rank the number of emp fname in desc order please.
SELECT EMP_FNAME, COUNT(EMP_FNAME) FROM PROFESSOR AS T1 JOIN EMPLOYEE AS T2 ON T1.EMP_NUM = T2.EMP_NUM GROUP BY EMP_FNAME ORDER BY COUNT(EMP_FNAME) DESC
nvbench
CREATE TABLE table_dev_42 ( "id" int, "gender" string, "depression" bool, "familial_hypercholesterolemia" bool, "microalbuminuria" int, "renal_disease" bool, "diabetic" string, "estimated_glomerular_filtration_rate_egfr" int, "serum_creatinine" float, "fbg" int, "body_mass_in...
familial hypercholesterolemia, triglycerides ( tg ) > 400 mg / dl
SELECT * FROM table_dev_42 WHERE familial_hypercholesterolemia = 1 OR triglyceride_tg > 400
criteria2sql
CREATE TABLE table_23312 ( "Game" real, "Date" text, "Opponent" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location" text, "Record" text )
Who did the high rebounds in the game in which five players (3) did the high assists?
SELECT "High rebounds" FROM table_23312 WHERE "High assists" = 'Five Players (3)'
wikisql
CREATE TABLE table_13661 ( "Year" text, "Start" text, "Qual" text, "Rank" text, "Finish" text, "Laps" real )
Which Qual has Laps smaller than 195, and a Rank of 25?
SELECT "Qual" FROM table_13661 WHERE "Laps" < '195' AND "Rank" = '25'
wikisql
CREATE TABLE table_48246 ( "Team" text, "Outgoing manager" text, "Manner of departure" text, "Date of vacancy" text, "Replaced by" text, "Date of appointment" text )
What was the manner of departure for the outgoing manager, giuseppe iachini?
SELECT "Manner of departure" FROM table_48246 WHERE "Outgoing manager" = 'giuseppe iachini'
wikisql
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, ...
what is the number of times the resect thorac ves w repl was ordered since 2 years ago?
SELECT COUNT(*) FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'resect thorac ves w repl') AND DATETIME(procedures_icd.charttime) >= DATETIME(CURRENT_TIME(), '-2 year')
mimic_iii
CREATE TABLE table_67903 ( "Tournament" text, "2006" text, "2007" text, "2008" text, "2009" text, "2010" text, "2011" text, "2012" text )
What is the 2010 result of a tournament that is 1R in 2009, Q2 in 2011 and 1R in 2012?
SELECT "2010" FROM table_67903 WHERE "2011" = 'q2' AND "2012" = '1r' AND "2009" = '1r'
wikisql
CREATE TABLE table_203_676 ( id number, "pick #" number, "cfl team" text, "player" text, "position" text, "college" text )
which team that drafted players in round four had the longest name ?
SELECT "cfl team" FROM table_203_676 ORDER BY LENGTH("cfl team") DESC LIMIT 1
squall
CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE restriction ( restriction_code text, advance_purc...
what ground transport is available in MINNEAPOLIS
SELECT DISTINCT ground_service.transport_type FROM city, ground_service WHERE city.city_name = 'MINNEAPOLIS' AND ground_service.city_code = city.city_code
atis
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 average age of patients whose admission location is phys referral/normal deli and days of hospital stay is 29?
SELECT AVG(demographic.age) FROM demographic WHERE demographic.admission_location = "PHYS REFERRAL/NORMAL DELI" AND demographic.days_stay = "29"
mimicsql_data
CREATE TABLE Student_Tests_Taken ( registration_id INTEGER, date_test_taken DATETIME, test_result VARCHAR(255) ) CREATE TABLE Course_Authors_and_Tutors ( author_id INTEGER, author_tutor_ATB VARCHAR(3), login_name VARCHAR(40), password VARCHAR(40), personal_name VARCHAR(80), middle_n...
List the number of completion students in each day and bin date of completion by weekday with a bar chart, rank in ascending by the y axis.
SELECT date_of_completion, COUNT(date_of_completion) FROM Student_Course_Enrolment ORDER BY COUNT(date_of_completion)
nvbench
CREATE TABLE table_77062 ( "Team" text, "Location" text, "Venue" text, "Capacity" real, "Position in 2005" text )
Can you tell me the Capacity that has the Position in 2005 of 8?
SELECT "Capacity" FROM table_77062 WHERE "Position in 2005" = '8'
wikisql
CREATE TABLE table_48206 ( "Season" text, "Winner" text, "Score" text, "Runner-up" text, "Venue" text )
What season did the Rangers win?
SELECT "Season" FROM table_48206 WHERE "Winner" = 'rangers'
wikisql