context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_name_89 ( high_points VARCHAR, opponent VARCHAR )
WHAT IS THE HIGHEST POINTS FOR LOS ANGELES?
SELECT high_points FROM table_name_89 WHERE opponent = "los angeles"
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 diagnoses short title and diagnoses long title of subject id 23733?
SELECT diagnoses.short_title, diagnoses.long_title FROM diagnoses WHERE diagnoses.subject_id = "23733"
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...
医疗就诊85755686668中列出姓韦的医师开具的所有药品都是什么?
SELECT SOC_SRT_DIRE_CD, SOC_SRT_DIRE_NM FROM t_kc22 WHERE MED_CLINIC_ID = '85755686668' AND HOSP_DOC_NM LIKE '韦%'
css
CREATE TABLE table_202_15 ( id number, "year" number, "title" text, "role" text, "notes" text )
what films did mandy patinkin star in in 1998 ?
SELECT "title" FROM table_202_15 WHERE "year" = 1998
squall
CREATE TABLE paper ( paperid int, title varchar, venueid int, year int, numciting int, numcitedby int, journalid int ) CREATE TABLE venue ( venueid int, venuename varchar ) CREATE TABLE journal ( journalid int, journalname varchar ) CREATE TABLE writes ( paperid int, ...
How many papers are related to deep learning ?
SELECT DISTINCT COUNT(DISTINCT paper.paperid) FROM keyphrase, paper, paperkeyphrase WHERE keyphrase.keyphrasename = 'deep learning' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid
scholar
CREATE TABLE table_name_62 ( points INTEGER, draw VARCHAR, rank VARCHAR )
What is the lowest points with 6 draws and lower than rank 10?
SELECT MIN(points) FROM table_name_62 WHERE draw = 6 AND rank > 10
sql_create_context
CREATE TABLE PlaylistTrack ( PlaylistId integer, TrackId integer ) CREATE TABLE InvoiceLine ( InvoiceLineId integer, InvoiceId integer, TrackId integer, UnitPrice decimal(10,2), Quantity integer ) CREATE TABLE Employee ( EmployeeId integer, LastName varchar(20), FirstName varch...
Plot the number of phone by grouped by phone as a bar graph, could you list bar in descending order?
SELECT Phone, COUNT(Phone) FROM Employee GROUP BY Phone ORDER BY Phone DESC
nvbench
CREATE TABLE table_name_40 ( winner__male_ VARCHAR, winner__female_ VARCHAR, year VARCHAR )
Who is the male winner the year after 1998 with Marleen Renders as the female winner?
SELECT winner__male_ FROM table_name_40 WHERE winner__female_ = "marleen renders" AND year > 1998
sql_create_context
CREATE TABLE table_name_71 ( runner_s__up VARCHAR, winning_score VARCHAR )
Which Runner(s)-up has a Winning score of 9 (71-68-72-68=279)?
SELECT runner_s__up FROM table_name_71 WHERE winning_score = –9(71 - 68 - 72 - 68 = 279)
sql_create_context
CREATE TABLE table_name_78 ( population INTEGER, area_km_2 VARCHAR )
What is the population of the parish that has an area of 304.06?
SELECT SUM(population) FROM table_name_78 WHERE area_km_2 = 304.06
sql_create_context
CREATE TABLE table_27774 ( "Rank by average" real, "Competition finish" real, "Couple" text, "Total" real, "Number of dances" real, "Average" text )
What couple averaged 21.0?
SELECT "Couple" FROM table_27774 WHERE "Average" = '21.0'
wikisql
CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE flight ( aircraft_code_sequence text, airline_code varchar, airline_flight text, arrival_time int, connections int, departure_time int, dual_carrier text, flight_days text, flight_id int, fligh...
please list the THURSDAY morning flights from ST. LOUIS to ST. PAUL
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, days, flight WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'ST. PAUL' AND days.day_name = 'THURSDAY' AND flight.flight_days = days.days_code A...
atis
CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConce...
Number of votes on max-upvoted answer versus Number of Questions in that category.
SELECT max_upvotes, COUNT(*) AS num_of_questions FROM (SELECT question_id, answer_id, MAX(upvotes) AS max_upvotes FROM (SELECT Posts.Id AS answer_id, Posts.ParentId AS question_id, COUNT(*) AS upvotes FROM Posts INNER JOIN Votes ON Posts.Id = Votes.PostId WHERE Posts.PostTypeId = 2 AND Votes.VoteTypeId = 2 GROUP BY Pos...
sede
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 )
Give me a bar chart for sum price of each name, and display from low to high by the y-axis please.
SELECT Name, SUM(Price) FROM Products GROUP BY Name ORDER BY SUM(Price)
nvbench
CREATE TABLE table_1496 ( "Game" real, "Date" text, "Opponent" text, "Result" text, "Giants points" real, "Opponents" real, "Record" text, "Attendance" real )
Name the number of giants points for opponents being 31
SELECT COUNT("Giants points") FROM table_1496 WHERE "Opponents" = '31'
wikisql
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 ...
患者吕建茗所有检验报告单中的标本采集部位在2008年7月2日到2019年5月18日期间内都是那几个部位?
SELECT zyjybgb.BBCJBW FROM person_info JOIN hz_info JOIN mzjzjlb JOIN zyjybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB WHERE person_info.XM = '吕建茗...
css
CREATE TABLE table_5857 ( "District" real, "Incumbent" text, "Party" text, "Elected" real, "Status" text )
What was the year elected in District 15?
SELECT "Elected" FROM table_5857 WHERE "District" = '15'
wikisql
CREATE TABLE table_64684 ( "Time" text, "Home team" text, "Score" text, "Away team" text, "Venue" text )
Who was the home team in the match that had an away team of Convoy Sun Hei Team B?
SELECT "Home team" FROM table_64684 WHERE "Away team" = 'convoy sun hei team b'
wikisql
CREATE TABLE jybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH text, BGJGDM text, BGJGMC text, BGRGH text, BGRQ time, BGRXM text, BGSJ time, CJRQ time, JSBBRQSJ time, JSBBSJ time, JYBBH text, JYJGMC text, JYJSGH text, JYJSQM text, JY...
之前钱景福患者有过哪些住院诊断知道么?
SELECT zyjzjlb.ZYZDBM, zyjzjlb.ZYZDMC 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 = '钱景福'
css
CREATE TABLE table_22824199_1 ( player VARCHAR, rebounds VARCHAR )
Who are all the players with 156 rebounds?
SELECT player FROM table_22824199_1 WHERE rebounds = 156
sql_create_context
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE v...
how many hours was it since patient 006-14121's last sepsis - severe diagnosis during this hospital visit.
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', diagnosis.diagnosistime)) FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-14121...
eicu
CREATE TABLE table_name_98 ( player VARCHAR, hometown_school VARCHAR, pick VARCHAR, position VARCHAR )
Which player was picked before 13, in a P position, and is from Georgia Tech?
SELECT player FROM table_name_98 WHERE pick < 13 AND position = "p" AND hometown_school = "georgia tech"
sql_create_context
CREATE TABLE table_73548 ( "Average Ranking" real, "Competitive Finish" real, "Couple" text, "Number Of Dances" real, "Total Score" real, "Average" text )
Which couple has 295 as a total score?
SELECT "Couple" FROM table_73548 WHERE "Total Score" = '295'
wikisql
CREATE TABLE Organisations ( organisation_id INTEGER, organisation_type VARCHAR(10), organisation_details VARCHAR(255) ) CREATE TABLE Research_Outcomes ( outcome_code VARCHAR(10), outcome_description VARCHAR(255) ) CREATE TABLE Grants ( grant_id INTEGER, organisation_id INTEGER, grant_...
A bar chart for listing the number of the description of the outcomes for all projects, and could you display from high to low by the x axis?
SELECT outcome_description, COUNT(outcome_description) FROM Research_Outcomes AS T1 JOIN Project_Outcomes AS T2 ON T1.outcome_code = T2.outcome_code GROUP BY outcome_description ORDER BY outcome_description DESC
nvbench
CREATE TABLE fare ( fare_id int, from_airport varchar, to_airport varchar, fare_basis_code text, fare_airline text, restriction_code text, one_direction_cost int, round_trip_cost int, round_trip_required varchar ) CREATE TABLE time_zone ( time_zone_code text, time_zone_name ...
what are the least expensive flights from DENVER to ATLANTA
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, flight, flight_fare WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'DENVER' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1....
atis
CREATE TABLE table_name_18 ( station VARCHAR, frequency VARCHAR )
Which station has a frequency of 873khz?
SELECT station FROM table_name_18 WHERE frequency = "873khz"
sql_create_context
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...
列出患者55178621医疗记录中的入院诊断疾病编码和名称,主要针对医疗费总额高于9322.98元的
SELECT IN_DIAG_DIS_CD, IN_DIAG_DIS_NM FROM t_kc21 WHERE PERSON_ID = '55178621' AND MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc24 WHERE MED_AMOUT > 9322.98)
css
CREATE TABLE table_64268 ( "Period" text, "Internet Explorer" text, "Chrome" text, "Firefox" text, "Safari" text, "Opera" text, "Other Mozilla" text )
What is the other mozilla that has 9.41% for the safari?
SELECT "Other Mozilla" FROM table_64268 WHERE "Safari" = '9.41%'
wikisql
CREATE TABLE table_name_83 ( away_team VARCHAR )
What is the scoreof the away team Collingwood?
SELECT away_team AS score FROM table_name_83 WHERE away_team = "collingwood"
sql_create_context
CREATE TABLE table_20249 ( "Year" real, "Division" real, "League" text, "Regular Season" text, "Playoffs" text, "Open Cup" text )
Name the open cup for 2010
SELECT "Open Cup" FROM table_20249 WHERE "Year" = '2010'
wikisql
CREATE TABLE table_70229 ( "Year" real, "Date" text, "Winner" text, "Result" text, "Loser" text, "Location" text )
Who is the Winner, when the Loser is the Baltimore Colts, when the Location is Schaefer Stadium, and when the Result is 42-3?
SELECT "Winner" FROM table_70229 WHERE "Loser" = 'baltimore colts' AND "Location" = 'schaefer stadium' AND "Result" = '42-3'
wikisql
CREATE TABLE table_2562572_33 ( type VARCHAR, cyrillic_name_other_names VARCHAR )
What type of settlement is (hungarian: orom)?
SELECT type FROM table_2562572_33 WHERE cyrillic_name_other_names = "Ором (Hungarian: Orom)"
sql_create_context
CREATE TABLE table_17208 ( "Round" real, "Overall" text, "Player" text, "Position" text, "Nationality" text, "Club team" text )
What position is associated with an overall value of 126?
SELECT "Position" FROM table_17208 WHERE "Overall" = '126'
wikisql
CREATE TABLE table_52625 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
Who was the away team when the crowd was larger than 41,451?
SELECT "Away team" FROM table_52625 WHERE "Crowd" > '41,451'
wikisql
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, ...
tell me the long title of diagnoses for diagnoses icd9 code v5883.
SELECT diagnoses.long_title FROM diagnoses WHERE diagnoses.icd9_code = "V5883"
mimicsql_data
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...
had patient 006-36108 during a month before been allergic to any substance?
SELECT COUNT(*) > 0 FROM allergy WHERE allergy.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-36108')) AND DATETIME(allergy.allergytime, 'start of month') = DATETIME(CURR...
eicu
CREATE TABLE table_12962773_10 ( year_born INTEGER )
What is the earliest any of these players were born?
SELECT MIN(year_born) FROM table_12962773_10
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 allergy ( allergy...
count the number of times patient 016-2639 had been prescribed 1000 ml flex cont: dextrose-nacl 5-0.45 % iv soln the last year.
SELECT COUNT(*) FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-2639')) AND medication.drugname = '1000 ml flex cont: dextrose-nacl 5-0.45...
eicu
CREATE TABLE table_73529 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
What was the record at the game where Deron Williams (6) did the high assists?
SELECT "Record" FROM table_73529 WHERE "High assists" = 'Deron Williams (6)'
wikisql
CREATE TABLE table_17928 ( "Position" real, "Club" text, "Played" real, "Won" real, "Drawn" real, "Lost" real, "Pts For" real, "Pts Agst" real, "Bonus Points" real, "Points" real )
What is the total points for the tean with 8 losses?
SELECT COUNT("Points") FROM table_17928 WHERE "Lost" = '8'
wikisql
CREATE TABLE table_name_97 ( club VARCHAR, player VARCHAR )
What club wast he player hristo stoitchkov from?
SELECT club FROM table_name_97 WHERE player = "hristo stoitchkov"
sql_create_context
CREATE TABLE Accounts ( account_id INTEGER, customer_id INTEGER, account_name VARCHAR(50), other_account_details VARCHAR(255) ) CREATE TABLE Customers_Cards ( card_id INTEGER, customer_id INTEGER, card_type_code VARCHAR(15), card_number VARCHAR(80), date_valid_from DATETIME, dat...
Visualize a scatter chart on how many accounts are there for each customer id?
SELECT customer_id, COUNT(*) FROM Accounts GROUP BY customer_id
nvbench
CREATE TABLE table_name_37 ( opponent VARCHAR, week VARCHAR, date VARCHAR )
Who was the opponent in the game played after Week 4 on October 15, 2000?
SELECT opponent FROM table_name_37 WHERE week > 4 AND date = "october 15, 2000"
sql_create_context
CREATE TABLE table_16799784_12 ( name VARCHAR )
What is every name origin with the name Ovda Fluctus?
SELECT name AS origin FROM table_16799784_12 WHERE name = "Ovda Fluctus"
sql_create_context
CREATE TABLE jyjgzbb ( JYZBLSH text, YLJGDM text, BGDH text, BGRQ time, JYRQ time, JCRGH text, JCRXM text, SHRGH text, SHRXM text, JCXMMC text, JCZBDM text, JCFF text, JCZBMC text, JCZBJGDX text, JCZBJGDL number, JCZBJGDW text, SBBM text, YQBH text...
患者俞嘉平大腿的各项指标检验结果的详细情况怎么样
(SELECT * FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGD...
css
CREATE TABLE table_27690 ( "Country" text, "Contestant" text, "Age" real, "Height (cm)" real, "Height (ft)" text, "Hometown" text )
What is the height associated with Paraguay?
SELECT "Height (ft)" FROM table_27690 WHERE "Country" = 'Paraguay'
wikisql
CREATE TABLE table_21268 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
February 12 is the date for all location attendance.
SELECT "Location Attendance" FROM table_21268 WHERE "Date" = 'February 12'
wikisql
CREATE TABLE table_name_15 ( winning_team VARCHAR, date VARCHAR, winning_manufacturer VARCHAR, winning_driver VARCHAR )
What is the winning team of the race on 31 August with Audi as the winning manufacturer and Timo Scheider as the winning driver?
SELECT winning_team FROM table_name_15 WHERE winning_manufacturer = "audi" AND winning_driver = "timo scheider" AND date = "31 august"
sql_create_context
CREATE TABLE table_name_5 ( denomination VARCHAR, location VARCHAR )
What denomination is mt lawley?
SELECT denomination FROM table_name_5 WHERE location = "mt lawley"
sql_create_context
CREATE TABLE table_name_84 ( tries INTEGER, player VARCHAR, points VARCHAR )
What is the smallest number of tries when Matt Diskin is the player and there are more than 16 points?
SELECT MIN(tries) FROM table_name_84 WHERE player = "matt diskin" AND points > 16
sql_create_context
CREATE TABLE table_204_864 ( id number, "pos" number, "class" text, "no" number, "team" text, "drivers" text, "chassis" text, "engine" text )
the gelo racing team and the ecurie du nord team both used what kind of chassis ?
SELECT "chassis" FROM table_204_864 WHERE "team" = 'gelo racing team'
squall
CREATE TABLE company ( company VARCHAR, rank VARCHAR, Sales_billion VARCHAR )
List the company name and rank for all companies in the decreasing order of their sales.
SELECT company, rank FROM company ORDER BY Sales_billion DESC
sql_create_context
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id t...
provide the number of patients whose diagnosis short title is acute kidney failure nos and drug route is nu.
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.short_title = "Acute kidney failure NOS" AND prescriptions.route = "NU"
mimicsql_data
CREATE TABLE table_name_92 ( competition VARCHAR, venue VARCHAR, year VARCHAR )
Which Competition has a Venue of manchester in 2009?
SELECT competition FROM table_name_92 WHERE venue = "manchester" AND year = 2009
sql_create_context
CREATE TABLE table_15970 ( "Formula" text, "Notation" text, "T c (K)" real, "No. of Cu-O planes in unit cell" real, "Crystal structure" text )
What is the notion when the crystal structure is tetragonal and the formula is bi 2 sr 2 cacu 2 o 8
SELECT "Notation" FROM table_15970 WHERE "Crystal structure" = 'Tetragonal' AND "Formula" = 'Bi 2 Sr 2 CaCu 2 O 8'
wikisql
CREATE TABLE table_6780 ( "Member" text, "Party" text, "Electorate" text, "State" text, "First elected" text )
Which party has wa as the state, and hon victor garland as the memeber?
SELECT "Party" FROM table_6780 WHERE "State" = 'wa' AND "Member" = 'hon victor garland'
wikisql
CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE fare_basis ( fare_basis_code text, booking_class text, class_type text, premium text, economy text, discounted text, night text, season text, basis_days text ) CREATE TABLE month ( ...
list DAILY flights from DENVER to BOSTON
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_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'DENVER' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BOSTON...
atis
CREATE TABLE table_name_96 ( viewers__m_ VARCHAR, share VARCHAR )
What is the average rating of viewers 18 to 49 where the total viewer count is 3.93 million and share less than 4?
SELECT AVG(18 AS _49) FROM table_name_96 WHERE viewers__m_ = 3.93 AND share < 4
sql_create_context
CREATE TABLE table_name_84 ( points INTEGER, entrant VARCHAR, year VARCHAR )
Before the year 1988, what is the lowest number of points that entrant Coloni SpA scored?
SELECT MIN(points) FROM table_name_84 WHERE entrant = "coloni spa" AND year < 1988
sql_create_context
CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, COM_PAY number, DATA_ID text, ENT_ACC_PAY number, ENT_PAY number, F...
在哪几次医疗记录中给病患秦娟丽开出的药品均超过8902.92元?列出所有医疗就诊序列号都是什么?
SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_NM = '秦娟丽' AND NOT t_kc22.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT <= 8902.92)
css
CREATE TABLE mzjzjlb_jybgb ( YLJGDM_MZJZJLB text, BGDH number, YLJGDM number ) CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC te...
在01年10月19日到16年8月22日这段时间,患者13818309一共有多少检验报告单,把这些检验报告单的审核日期列出来
SELECT jybgb.SHSJ FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN mzjzjlb_jybgb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND mzjzjlb_jybgb.YLJGDM = jybgb.YLJGDM AND mzjzjlb_jybgb.BGDH ...
css
CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) CREATE TABLE restriction ( restriction_code text, advance_purchase int, stopovers text, saturday_stay_required text, minimum_stay int, m...
what is the latest US flight leaving PHILADELPHIA and returning to BOSTON
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_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'PHILADELPHIA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = ...
atis
CREATE TABLE table_name_45 ( weight VARCHAR, name VARCHAR )
What is the Weight for the Name Billy Miller Category:Articles with hcards?
SELECT weight FROM table_name_45 WHERE name = "billy miller category:articles with hcards"
sql_create_context
CREATE TABLE table_10971 ( "Race" text, "Circuit" text, "Date" text, "Pole position" text, "Fastest lap" text, "Winning driver" text, "Constructor" text, "Tyre" text, "Report" text )
Tell me the winning driver for jim clark as pole position and fastest lap
SELECT "Winning driver" FROM table_10971 WHERE "Pole position" = 'jim clark' AND "Fastest lap" = 'jim clark'
wikisql
CREATE TABLE table_203_805 ( id number, "year" number, "player" text, "position" text, "high school" text, "college" text )
how many wins came out of ohio state ?
SELECT COUNT(*) FROM table_203_805 WHERE "college" = 'ohio state'
squall
CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE Badges ( Id number, UserId number, Name text, ...
Technology Trends (# Questions per Tag per Month).
SELECT DATEADD(mm, (YEAR(Posts.CreationDate) - 1900) * 12 + MONTH(Posts.CreationDate) - 1, 0) AS Month, COUNT(*) AS Q 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 ('primefaces') AND Pos...
sede
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 ...
华明哲这个病人被门诊诊断为脑梗死后遗症,他做的检测指标097260的结果定量和单位是啥
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN mzjzjlb JOIN zyjybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZ...
css
CREATE TABLE campuses ( id number, campus text, location text, county text, year number ) CREATE TABLE faculty ( campus number, year number, faculty number ) CREATE TABLE discipline_enrollments ( campus number, discipline number, year number, undergraduate number, g...
What campuses are located in Los Angeles county and opened after 1950?
SELECT campus FROM campuses WHERE county = "Los Angeles" AND year > 1950
spider
CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), ...
Return a scatter on what is the average salary of employees who have a commission percentage that is not null?
SELECT DEPARTMENT_ID, AVG(SALARY) FROM employees WHERE COMMISSION_PCT <> "null" GROUP BY DEPARTMENT_ID
nvbench
CREATE TABLE table_25016555_5 ( blocks VARCHAR, assists VARCHAR )
When 21 is the number of assists how many sets of blocks are there?
SELECT COUNT(blocks) FROM table_25016555_5 WHERE assists = 21
sql_create_context
CREATE TABLE table_66996 ( "Stage (Winner)" text, "General Classification Yellow Jersey" text, "Mountains Classification Green Jersey" text, "Points Classification Navy Blue Jersey" text, "Intermediate Sprints Classification Red Jersey" text, "Team Classification" text )
Which Points Classification Navy Blue Jersey that has a Jersey of Graeme Brown
SELECT "Points Classification Navy Blue Jersey" FROM table_66996 WHERE "General Classification Yellow Jersey" = 'graeme brown'
wikisql
CREATE TABLE table_name_63 ( region VARCHAR, districts VARCHAR, capital VARCHAR )
What is the region for Chep n with 3 districts?
SELECT region FROM table_name_63 WHERE districts = 3 AND capital = "chepén"
sql_create_context
CREATE TABLE table_1818471_1 ( scott VARCHAR, date VARCHAR )
What is every entry for Scott when the date is (15.12)?
SELECT scott FROM table_1818471_1 WHERE date = "(15.12)"
sql_create_context
CREATE TABLE table_47780 ( "Date" text, "Home" text, "Score" text, "Away" text, "Attendance" real )
What was date was the attendance larger than 875 against Platense?
SELECT "Date" FROM table_47780 WHERE "Attendance" > '875' AND "Home" = 'platense'
wikisql
CREATE TABLE table_22849 ( "Rank" real, "London Borough" text, "Indian Population" real, "Pakistani Population" real, "Bangladeshi Population" real, "Chinese Population" real, "Other Asian Population" real, "Total Asian Population" real )
How many Asians live in the borough with 8109 Chinese population?
SELECT MIN("Total Asian Population") FROM table_22849 WHERE "Chinese Population" = '8109'
wikisql
CREATE TABLE table_48416 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Ground" text, "Crowd" real, "Date" text )
What kind of Crowd has a Home team of port adelaide, and a Away team score of 11.10 (76)?
SELECT "Crowd" FROM table_48416 WHERE "Home team" = 'port adelaide' AND "Away team score" = '11.10 (76)'
wikisql
CREATE TABLE Addresses ( address_id INTEGER, line_1 VARCHAR(120), line_2 VARCHAR(120), line_3 VARCHAR(120), city VARCHAR(80), zip_postcode VARCHAR(20), state_province_county VARCHAR(50), country VARCHAR(50), other_address_details VARCHAR(255) ) CREATE TABLE Teachers ( teacher_id...
Draw a line chart about the change of the sum of monthly_rental over date_address_to , and group by attribute other_details.
SELECT date_address_to, SUM(monthly_rental) FROM Student_Addresses GROUP BY other_details, date_address_to ORDER BY monthly_rental DESC
nvbench
CREATE TABLE table_name_33 ( written_by VARCHAR, production_code VARCHAR )
tell me the writer of production code ad1d09.
SELECT written_by FROM table_name_33 WHERE production_code = "ad1d09"
sql_create_context
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 were the top five most frequent procedures that patients received within 2 months after having been diagnosed with mitral insuf/aort stenos until 2 years ago?
SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissi...
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...
give me the number of patients in urgent care who were given lactic acid 12% lotion.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_type = "URGENT" AND prescriptions.drug = "Lactic Acid 12% Lotion"
mimicsql_data
CREATE TABLE Accounts ( Account_ID INTEGER, Statement_ID INTEGER, Account_Details VARCHAR(255) ) CREATE TABLE Statements ( Statement_ID INTEGER, Statement_Details VARCHAR(255) ) CREATE TABLE Documents_with_Expenses ( Document_ID INTEGER, Budget_Type_Code CHAR(15), Document_Details VARC...
Scatter. what are the ids and details of all accounts?
SELECT Account_ID, Account_Details FROM Accounts
nvbench
CREATE TABLE table_63759 ( "Title" text, "Series" text, "Director" text, "Production Num." text, "Release date" text )
What is the release date of The Blow Out?
SELECT "Release date" FROM table_63759 WHERE "Title" = 'the blow out'
wikisql
CREATE TABLE table_66451 ( "Name" text, "Egyptian Premier League" real, "Egypt Cup" real, "CAF Champions League" real, "Total" real )
What is the aveage Egypt Cup value for players with 0 CAF Champions League goals, 6 Egyptian Premier League goals, and totals under 6?
SELECT AVG("Egypt Cup") FROM table_66451 WHERE "CAF Champions League" = '0' AND "Egyptian Premier League" = '6' AND "Total" < '6'
wikisql
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...
医院4420698中根据出院诊断疾病名称,列出不同疾病的平均患者多大年龄?
SELECT OUT_DIAG_DIS_NM, AVG(PERSON_AGE) FROM t_kc21 WHERE MED_SER_ORG_NO = '4420698' GROUP BY OUT_DIAG_DIS_NM
css
CREATE TABLE school_performance ( school_id number, school_year text, class_a text, class_aa text ) CREATE TABLE player ( player_id number, player text, team text, age number, position text, school_id number ) CREATE TABLE school ( school_id number, school text, loc...
List the locations of schools in ascending order of enrollment.
SELECT location FROM school ORDER BY enrollment
spider
CREATE TABLE procedures ( 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 prescription...
how many patients with procedure icd9 code 4523 were discharged to inpatient hospital?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.discharge_location = "DISC-TRAN CANCER/CHLDRN H" AND procedures.icd9_code = "4523"
mimicsql_data
CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense...
Top type of post history with count.
SELECT PostHistoryTypes.Name, COUNT(PostHistory.Id) FROM PostHistory JOIN PostHistoryTypes ON PostHistory.PostHistoryTypeId = PostHistoryTypes.Id GROUP BY PostHistoryTypes.Name
sede
CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int ) CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description varchar ) CREATE TABLE restriction ( restriction_c...
i want to leave OAKLAND and arrive in BOSTON at 1700 o'clock 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 WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BOSTON' AND flight.arrival_time = 1700 AND flight.to_airport = AIRPORT_SERVICE_1.airport_...
atis
CREATE TABLE table_59883 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text, "Money ( $ )" real )
Which player placed in t5 and had a score of 72-71-73-78=294?
SELECT "Player" FROM table_59883 WHERE "Place" = 't5' AND "Score" = '72-71-73-78=294'
wikisql
CREATE TABLE Ship ( Ship_ID int, Name text, Type text, Built_Year real, Class text, Flag text ) CREATE TABLE captain ( Captain_ID int, Name text, Ship_ID int, age text, Class text, Rank text )
Count the number of captains that have each rank with a pie chart.
SELECT Rank, COUNT(*) FROM captain GROUP BY Rank
nvbench
CREATE TABLE table_name_15 ( outgoing_manager VARCHAR, team VARCHAR )
Tell me the outgoing manager for livingston
SELECT outgoing_manager FROM table_name_15 WHERE team = "livingston"
sql_create_context
CREATE TABLE table_68439 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Record" text )
Whose Visitor has a Record of 10 11 5?
SELECT "Visitor" FROM table_68439 WHERE "Record" = '10–11–5'
wikisql
CREATE TABLE table_66645 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Attendance" text )
What was the score for the game with a tie no of 1?
SELECT "Score" FROM table_66645 WHERE "Tie no" = '1'
wikisql
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 ) ...
how many patients whose insurance is medicaid and age is less than 68?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.insurance = "Medicaid" AND demographic.age < "68"
mimicsql_data
CREATE TABLE trip ( name VARCHAR, end_station_name VARCHAR, city VARCHAR ) CREATE TABLE station ( name VARCHAR, end_station_name VARCHAR, city VARCHAR )
What are the names of stations that are located in Palo Alto city but have never been the ending point of trips more than 100 times?
SELECT name FROM station WHERE city = "Palo Alto" EXCEPT SELECT end_station_name FROM trip GROUP BY end_station_name HAVING COUNT(*) > 100
sql_create_context
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE chartevents ...
when was the first time yesterday that patient 10855 has had a promote w/fiber intake?
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 = 10855)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label...
mimic_iii
CREATE TABLE Faculty ( FacID INTEGER, Lname VARCHAR(15), Fname VARCHAR(15), Rank VARCHAR(15), Sex VARCHAR(1), Phone INTEGER, Room VARCHAR(5), Building VARCHAR(13) ) CREATE TABLE Activity ( actid INTEGER, activity_name varchar(25) ) CREATE TABLE Participates_in ( stuid INTEG...
How many faculty members does each building have? List the result with the name of the building. Visualize by bar chart.
SELECT Building, COUNT(*) FROM Faculty GROUP BY Building
nvbench
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE d_labitems ( row_id number, itemid numbe...
tell me the name of the intake that patient 14154 had for the last time on 12/26/this year?
SELECT d_items.label FROM d_items WHERE d_items.itemid IN (SELECT inputevents_cv.itemid 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 = 14154)) AND DATETIME(inputevents_cv....
mimic_iii
CREATE TABLE table_name_95 ( date VARCHAR, venue VARCHAR, result VARCHAR )
What is Date, when Venue is Melbourne Cricket Ground, and when Result is Eng By Inns&225 Runs?
SELECT date FROM table_name_95 WHERE venue = "melbourne cricket ground" AND result = "eng by inns&225 runs"
sql_create_context
CREATE TABLE table_14984126_1 ( result VARCHAR, record VARCHAR )
what's the result with record being 0 1
SELECT result FROM table_14984126_1 WHERE record = "0–1"
sql_create_context