context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC text, RYBH text, XBDM number, XBMC text, XLDM text, XLMC text, XM text, ZYLBDM text, ZYMC text ) CREATE TABLE bdmzjzjlb ( HXPLC number, HZX...
在2002年9月18日到2018年10月31日期间有几个医生就诊过病患23946092?
SELECT COUNT(wdmzjzjlb.ZZYSGH) FROM hz_info JOIN wdmzjzjlb ON hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX WHERE hz_info.RYBH = '23946092' AND wdmzjzjlb.JZKSRQ BETWEEN '2002-09-18' AND '2018-10-31' UNION SELECT COUNT(bdmzjzjlb.ZZYSGH) FROM hz_info JOIN bdmzjzjlb ON hz_...
css
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) C...
among patients diagnosed with critical illness myopthy, how many of them received drug via id route?
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 = "Critical illness myopthy" AND prescriptions.route = "ID"
mimicsql_data
CREATE TABLE mzjzjlb ( YLJGDM text, JZLSH text, KH text, KLX number, MJZH text, HZXM text, NLS number, NLY number, ZSEBZ number, JZZTDM number, JZZTMC text, JZJSSJ time, TXBZ number, ZZBZ number, WDBZ number, JZKSBM text, JZKSMC text, JZKSRQ time, ...
检验报告单97022779675是哪个审核人审核的,工号是多少,把姓名也查一下
SELECT SHRGH, SHRXM FROM jybgb WHERE BGDH = '97022779675'
css
CREATE TABLE table_name_49 ( qual_2 VARCHAR, qual_1 VARCHAR )
What is the qual 2 when the qual 1 is 1:16.841?
SELECT qual_2 FROM table_name_49 WHERE qual_1 = "1:16.841"
sql_create_context
CREATE TABLE table_58877 ( "Round" real, "Pick" real, "Player" text, "Nationality" text, "School/Club Team" text )
In what round did someone from North Carolina State get picked larger than 91?
SELECT COUNT("Round") FROM table_58877 WHERE "School/Club Team" = 'north carolina state' AND "Pick" > '91'
wikisql
CREATE TABLE table_26402 ( "Series #" real, "Season #" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Prod. code" real )
How many people directed 'through the looking glass'?
SELECT COUNT("Directed by") FROM table_26402 WHERE "Title" = 'Through The Looking Glass'
wikisql
CREATE TABLE table_1342426_18 ( incumbent VARCHAR, candidates VARCHAR )
Who was the incumbent in the election of henry garland dupr (d) unopposed?
SELECT incumbent FROM table_1342426_18 WHERE candidates = "Henry Garland Dupré (D) Unopposed"
sql_create_context
CREATE TABLE table_16409745_1 ( dpi VARCHAR, dimensions__mm_ VARCHAR )
What is the dpi of a scanner with the mm dimensions 280 x 95 x 40?
SELECT dpi FROM table_16409745_1 WHERE dimensions__mm_ = "280 x 95 x 40"
sql_create_context
CREATE TABLE table_name_97 ( java_ee_compatibility VARCHAR, edition VARCHAR )
What is the Java EE compatibility of the 5.2.4 edition?
SELECT java_ee_compatibility FROM table_name_97 WHERE edition = "5.2.4"
sql_create_context
CREATE TABLE tourist_attractions ( tourist_attraction_id number, attraction_type_code text, location_id number, how_to_get_there text, name text, description text, opening_hours text, other_details text ) CREATE TABLE tourist_attraction_features ( tourist_attraction_id number, f...
What are the names of the tourist attractions that can be accessed by bus?
SELECT name FROM tourist_attractions WHERE how_to_get_there = "bus"
spider
CREATE TABLE table_27961684_1 ( institution VARCHAR, team_name VARCHAR )
How many institutes have the team name Spartans?
SELECT COUNT(institution) FROM table_27961684_1 WHERE team_name = "Spartans"
sql_create_context
CREATE TABLE table_15347 ( "Sydney" text, "Melbourne" text, "Perth" text, "Adelaide" text, "Gold Coast" text, "Auckland" text )
Which Sydney has a Perth of no, an Adelaide of yes, and a Gold Coast of no?
SELECT "Sydney" FROM table_15347 WHERE "Perth" = 'no' AND "Adelaide" = 'yes' AND "Gold Coast" = 'no'
wikisql
CREATE TABLE table_14302582_1 ( result VARCHAR, record VARCHAR )
What was the result when the team was 4-1?
SELECT result FROM table_14302582_1 WHERE record = "4-1"
sql_create_context
CREATE TABLE airport_aircraft ( id number, airport_id number, aircraft_id number ) CREATE TABLE pilot ( pilot_id number, name text, age number ) CREATE TABLE match ( round number, location text, country text, date text, fastest_qualifying text, winning_pilot text, w...
What are the names of all the aircrafts associated with London Gatwick airport?
SELECT T1.aircraft FROM aircraft AS T1 JOIN airport_aircraft AS T2 ON T1.aircraft_id = T2.aircraft_id JOIN airport AS T3 ON T2.airport_id = T3.airport_id WHERE T3.airport_name = "London Gatwick"
spider
CREATE TABLE table_24486462_1 ( disposable_usd_growth INTEGER, country VARCHAR )
What is Australia's Disposable USD growth?
SELECT MAX(disposable_usd_growth) FROM table_24486462_1 WHERE country = "Australia"
sql_create_context
CREATE TABLE table_77776 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
When the away team scored 7.11 (53) what venue did they play at?
SELECT "Venue" FROM table_77776 WHERE "Away team score" = '7.11 (53)'
wikisql
CREATE TABLE table_7694 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real )
What is the highest attendance for the game after week 1 against the New York Jets?
SELECT MAX("Attendance") FROM table_7694 WHERE "Week" > '1' AND "Opponent" = 'new york jets'
wikisql
CREATE TABLE table_17123 ( "Team" text, "Outgoing manager" text, "Manner of departure" text, "Date of vacancy" text, "Replaced by" text, "Date of appointment" text )
How many have been replaced where the appointment date is 10 December 2007 and the manner of departure is quit?
SELECT COUNT("Replaced by") FROM table_17123 WHERE "Date of appointment" = '10 December 2007' AND "Manner of departure" = 'Quit'
wikisql
CREATE TABLE table_name_16 ( young_rider_classification VARCHAR, general_classification VARCHAR, stage VARCHAR )
Name the young rider classification for giuseppe saronni at stage 6
SELECT young_rider_classification FROM table_name_16 WHERE general_classification = "giuseppe saronni" AND stage = "6"
sql_create_context
CREATE TABLE table_17060277_6 ( date VARCHAR, high_assists VARCHAR )
Which date did Chris Duhon (13) receive high assists?
SELECT date FROM table_17060277_6 WHERE high_assists = "Chris Duhon (13)"
sql_create_context
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE mzjzjlb_jybgb ( YLJGDM_MZJZJLB text, BGDH number, YLJGDM number ) CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC te...
2007-01-04到2020-10-03期间,2301260这个医疗机构处理了多少次新生儿门诊
SELECT COUNT(*) FROM mzjzjlb WHERE mzjzjlb.YLJGDM = '2301260' AND mzjzjlb.JZKSRQ BETWEEN '2007-01-04' AND '2020-10-03' AND mzjzjlb.ZSEBZ > 0
css
CREATE TABLE PersonFriend ( name varchar(20), friend varchar(20), year INTEGER ) CREATE TABLE Person ( name varchar(20), age INTEGER, city TEXT, gender TEXT, job TEXT )
What is minimum age for different job title, sort in descending by the X.
SELECT job, MIN(age) FROM Person GROUP BY job ORDER BY job DESC
nvbench
CREATE TABLE table_22473 ( "Township" text, "County" text, "Pop. (2010)" real, "Land ( sqmi )" text, "Water (sqmi)" text, "Latitude" text, "Longitude" text, "GEO ID" real, "ANSI code" real )
How many places associated with latitude 48.247662?
SELECT COUNT("ANSI code") FROM table_22473 WHERE "Latitude" = '48.247662'
wikisql
CREATE TABLE table_66935 ( "Stage" text, "Time (EEST)" text, "Name" text, "Length" text, "Winner" text, "Time" text, "Avg. spd." text, "Rally leader" text )
What is the Name, when the Time is 8:10.1?
SELECT "Name" FROM table_66935 WHERE "Time" = '8:10.1'
wikisql
CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text ) CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, ...
on this month/21, was patient 10855's arterial bp [diastolic] ever less than 61.0?
SELECT COUNT(*) > 0 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 = 10855)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial bp [dias...
mimic_iii
CREATE TABLE table_11624 ( "Year" real, "Athlete" text, "Country/State" text, "Time" text, "Location" text )
At what location was the time 1:54:21?
SELECT "Location" FROM table_11624 WHERE "Time" = '1:54:21'
wikisql
CREATE TABLE table_14425454_1 ( ground VARCHAR, crowd VARCHAR )
What stadiums had an attendance of 8,256?
SELECT ground FROM table_14425454_1 WHERE crowd = "8,256"
sql_create_context
CREATE TABLE table_15187735_15 ( segment_d VARCHAR, episode VARCHAR )
What was segment D for episode 183?
SELECT segment_d FROM table_15187735_15 WHERE episode = 183
sql_create_context
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text )...
what is the five most frequently taken laboratory tests since 2104?
SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT t1.itemid FROM (SELECT labevents.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM labevents WHERE STRFTIME('%y', labevents.charttime) >= '2104' GROUP BY labevents.itemid) AS t1 WHERE t1.c1 <= 5)
mimic_iii
CREATE TABLE table_42983 ( "Year" text, "GP/GS" text, "Goals" text, "Assists" text, "Total Points" text )
How many assists were there when the total points was 2?
SELECT "Assists" FROM table_42983 WHERE "Total Points" = '2'
wikisql
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE d_labitems ( row_id numbe...
tell me the cost of a lab test for epithelial cells?
SELECT DISTINCT cost.cost FROM cost WHERE cost.event_type = 'labevents' AND cost.event_id IN (SELECT labevents.row_id FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'epithelial cells'))
mimic_iii
CREATE TABLE table_79120 ( "Club" text, "City" text, "Stadium" text, "2007\u201308 result" text, "Capacity" real )
What stadium has 9th in 2.hnl as the 2007-08 result?
SELECT "Stadium" FROM table_79120 WHERE "2007\u201308 result" = '9th in 2.hnl'
wikisql
CREATE TABLE STUDENT ( STU_NUM int, STU_LNAME varchar(15), STU_FNAME varchar(15), STU_INIT varchar(1), STU_DOB datetime, STU_HRS int, STU_CLASS varchar(2), STU_GPA float(8), STU_TRANSFER numeric, DEPT_CODE varchar(18), STU_PHONE varchar(4), PROF_NUM int ) CREATE TABLE DE...
What is the relationship between lowest and average student GPA for every department? Give me a scatter chart grouping by department code.
SELECT AVG(STU_GPA), MIN(STU_GPA) FROM STUDENT GROUP BY DEPT_CODE
nvbench
CREATE TABLE stadium ( id number, name text, capacity number, city text, country text, opening_year number ) CREATE TABLE event ( id number, name text, stadium_id number, year text ) CREATE TABLE record ( id number, result text, swimmer_id number, event_id numbe...
Find the names of the swimmers who have both 'win' and 'loss' results in the record.
SELECT t1.name FROM swimmer AS t1 JOIN record AS t2 ON t1.id = t2.swimmer_id WHERE result = 'Win' INTERSECT SELECT t1.name FROM swimmer AS t1 JOIN record AS t2 ON t1.id = t2.swimmer_id WHERE result = 'Loss'
spider
CREATE TABLE table_69029 ( "Riding" text, "Candidate's Name" text, "Gender" text, "Residence" text, "Occupation" text, "Votes" real, "Rank" text )
Which Occupation has a Rank of 5th, a Gender of M, with a Residence of orono?
SELECT "Occupation" FROM table_69029 WHERE "Rank" = '5th' AND "Gender" = 'm' AND "Residence" = 'orono'
wikisql
CREATE TABLE table_name_79 ( type VARCHAR, quantity VARCHAR )
Which type has 140 made?
SELECT type FROM table_name_79 WHERE quantity = "140"
sql_create_context
CREATE TABLE table_28232 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" text, "U.S. viewers (million)" text )
how many million u.s. viewers watched the episode directed by dan lerner?
SELECT "U.S. viewers (million)" FROM table_28232 WHERE "Directed by" = 'Dan Lerner'
wikisql
CREATE TABLE table_41270 ( "Rider" text, "Bike" text, "Laps" real, "Time" text, "Grid" real )
Who was the rider with a grid of 36?
SELECT "Rider" FROM table_41270 WHERE "Grid" = '36'
wikisql
CREATE TABLE discount_coupons ( coupon_id number, date_issued time, coupon_amount number ) CREATE TABLE view_product_availability ( product_id number, booking_id number, status_date time, available_yn text ) CREATE TABLE payments ( payment_id number, booking_id number, customer...
What is the id of the product that is booked for 3 times?
SELECT product_id FROM products_booked GROUP BY product_id HAVING COUNT(*) = 3
spider
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 time_interval ( period text, begin_time int, end_time int ) CREATE TABLE days ( d...
please show me CO flights from SAN FRANCISCO to PITTSBURGH on friday
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, date_day, days, flight WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PITTSBURGH' AND date_day.day_number = 25 AND date_day.month_number = 6 A...
atis
CREATE TABLE table_28211988_1 ( womens_singles VARCHAR, season VARCHAR )
How many people are women's singles in the season of 2000/01?
SELECT COUNT(womens_singles) FROM table_28211988_1 WHERE season = "2000/01"
sql_create_context
CREATE TABLE member ( member_id number, member_name text, party_id text, in_office text ) CREATE TABLE party_events ( event_id number, event_name text, party_id number, member_in_charge_id number ) CREATE TABLE party ( party_id number, minister text, took_office text, l...
What is the name of member in charge of greatest number of events?
SELECT T1.member_name FROM member AS T1 JOIN party_events AS T2 ON T1.member_id = T2.member_in_charge_id GROUP BY T2.member_in_charge_id ORDER BY COUNT(*) DESC LIMIT 1
spider
CREATE TABLE table_name_6 ( place INTEGER, artist VARCHAR, points VARCHAR )
What is the highest place of a song by Henri D s that has fewer than 8 points?
SELECT MAX(place) FROM table_name_6 WHERE artist = "henri dès" AND points < 8
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...
provide the number of patients whose age is less than 74 and drug code is neut?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "74" AND prescriptions.formulary_drug_cd = "NEUT"
mimicsql_data
CREATE TABLE table_19426 ( "State/UT Code" real, "India/State/UT" text, "Literate Persons (%)" text, "Males (%)" text, "Females (%)" text )
What is the percentage of all the literate people where females are 73.17?
SELECT "Literate Persons (%)" FROM table_19426 WHERE "Females (%)" = '73.17'
wikisql
CREATE TABLE table_66651 ( "Player" text, "Country" text, "Year(s) won" text, "Total" real, "To par" text, "Finish" text )
Which county did the player with a total of 294 represent?
SELECT "Country" FROM table_66651 WHERE "Total" = '294'
wikisql
CREATE TABLE table_73569 ( "Rank by average" real, "Place" real, "Couple" text, "Number Of Dances" real, "Total Points Earned" real, "Average" text )
What was the name of the couple if the number of dances is 6?
SELECT "Couple" FROM table_73569 WHERE "Number Of Dances" = '6'
wikisql
CREATE TABLE table_52234 ( "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text )
Which competition took place at Stade Fernand Fournier, Arles?
SELECT "Competition" FROM table_52234 WHERE "Venue" = 'stade fernand fournier, arles'
wikisql
CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE SuggestedEdits ( Id number, PostId n...
Get Vote Data for Posts.
SELECT v.UserId, vt.Name, COUNT(*) FROM Posts AS p INNER JOIN Votes AS v ON v.PostId = p.Id INNER JOIN VoteTypes AS vt ON v.VoteTypeId = vt.Id WHERE p.OwnerUserId = 154486 GROUP BY vt.Name, v.UserId
sede
CREATE TABLE program_course ( program_id int, course_id int, workload int, category varchar ) CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE TABLE course_offering ( offering_id int, course_id int, semester int, ...
During the next 6 semesters which classes will be offered ?
SELECT DISTINCT course.name, course.number, semester.semester, semester.year FROM course, course_offering, semester WHERE ((semester.semester = 'FA' AND semester.year = 2016) OR (semester.semester = 'FA' AND semester.year = 2017) OR (semester.semester = 'FA' AND semester.year = 2018) OR (semester.semester = 'WN' AND se...
advising
CREATE TABLE table_13110459_2 ( rating VARCHAR, viewers__m_ VARCHAR )
what are all the rating with viewers (m) being 2.61
SELECT rating FROM table_13110459_2 WHERE viewers__m_ = "2.61"
sql_create_context
CREATE TABLE body_builder ( Body_Builder_ID int, People_ID int, Snatch real, Clean_Jerk real, Total real ) CREATE TABLE people ( People_ID int, Name text, Height real, Weight real, Birth_Date text, Birth_Place text )
Draw a scatter chart about the correlation between Snatch and Total .
SELECT Snatch, Total FROM body_builder
nvbench
CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY ...
Show me a bar chart for what are the department names and how many employees work in each of them?, rank y axis from high to low order please.
SELECT DEPARTMENT_NAME, COUNT(*) FROM employees AS T1 JOIN departments AS T2 ON T1.DEPARTMENT_ID = T2.DEPARTMENT_ID GROUP BY DEPARTMENT_NAME ORDER BY COUNT(*) DESC
nvbench
CREATE TABLE table_13015539_1 ( points VARCHAR, lost VARCHAR )
What is the total points for the tean with 8 losses?
SELECT COUNT(points) FROM table_13015539_1 WHERE lost = 8
sql_create_context
CREATE TABLE table_203_237 ( id number, "n" number, "p" text, "nat." text, "name" text, "age" number, "moving from" text, "type" text, "transfer\nwindow" text, "ends" number, "transfer\nfee" text )
how many players had a free transfer fee ?
SELECT COUNT("name") FROM table_203_237 WHERE "n" = 'free'
squall
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 female patients belong to black/african american ethnic background?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "F" AND demographic.ethnicity = "BLACK/AFRICAN AMERICAN"
mimicsql_data
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...
58152656这个病人在2017年4月13日往后有哪些门诊就诊的检验报告单?查一下这些门诊就诊的流水号
SELECT mzjzjlb.JZLSH FROM hz_info JOIN mzjzjlb JOIN hz_info_mzjzjlb ON hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzj...
css
CREATE TABLE table_10566855_1 ( attendance INTEGER, score VARCHAR )
what is the minimum attendance with score 8.16 (64) 8.12 (60)
SELECT MIN(attendance) FROM table_10566855_1 WHERE score = "8.16 (64) – 8.12 (60)"
sql_create_context
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 dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, ...
US 269 leaving BOSTON at 1628 what is the arrival time in BALTIMORE
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 (((flight.departure_time = 1628 AND flight.flight_number = 269) AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BALTIMORE' AND flight....
atis
CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC text, RYBH text, XBDM number, XBMC text, XLDM text, XLMC text, XM text, ZYLBDM text, ZYMC text ) CREATE TABLE jyjgzbb ( BGDH text, BGRQ tim...
在患者55890390的诊疗记录里,从18年5月1日到20年11月25日这期间,为其检测指标836276的医务人员有哪几位,报一下工号及姓名
SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb 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 AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb....
css
CREATE TABLE bank ( branch_ID int, bname varchar(20), no_of_customers int, city varchar(10), state varchar(20) ) CREATE TABLE loan ( loan_ID varchar(3), loan_type varchar(15), cust_ID varchar(3), branch_ID varchar(3), amount int ) CREATE TABLE customer ( cust_ID varchar(3),...
Can you compare the account balances of customers with the letter 'a' in their names using a bar graph, and show from low to high by the y axis.
SELECT cust_name, acc_bal FROM customer WHERE cust_name LIKE '%a%' ORDER BY acc_bal
nvbench
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
how many patients with primary pulmonary hypertension had a blood gas test by lab?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.long_title = "Primary pulmonary hypertension" AND lab."CATEGORY" = "Blood Gas"
mimicsql_data
CREATE TABLE table_22417 ( "Frequency" text, "Call sign" text, "Branding" text, "Format" text, "Owner" text, "Language/Rebroadcast" text )
When fm 97.3 is the frequency how many formats are there?
SELECT COUNT("Format") FROM table_22417 WHERE "Frequency" = 'FM 97.3'
wikisql
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE intakeoutput ( i...
in total what was the total amount of enteral tube intake: nasogastric nostril, l that patient 005-18714 had received on 01/26/2104?
SELECT SUM(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '005-18714')) AND intakeoutput.celllabel = 'enter...
eicu
CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC text, RYBH text, XBDM number, XBMC text, XLDM text, XLMC text, XM text, ZYLBDM text, ZYMC text ) CREATE TABLE jyjgzbb ( BGDH text, BGRQ tim...
在2002年7月29日到2003年2月5日这段时间内患者60923283被开出的所有检验报告单的科室编码是什么?科室名称是啥啊?
SELECT jybgb.KSBM, jybgb.KSMC FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN hz_info_mzjzjlb ON hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH...
css
CREATE TABLE table_63850 ( "Airline" text, "IATA" text, "ICAO" text, "Callsign" text, "Commenced operations" real )
Which Commenced operations have an Airline of valuair?
SELECT "Commenced operations" FROM table_63850 WHERE "Airline" = 'valuair'
wikisql
CREATE TABLE tip ( tip_id int, business_id varchar, text longtext, user_id varchar, likes int, year int, month varchar ) CREATE TABLE user ( uid int, user_id varchar, name varchar ) CREATE TABLE business ( bid int, business_id varchar, name varchar, full_address...
list all the reviews by Niloofar
SELECT review.text FROM review, user WHERE user.name = 'Niloofar' AND user.user_id = review.user_id
yelp
CREATE TABLE gyb ( 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...
查询医院4405816的病人80809375的某次出院诊断结果,一位姓施的医生未其诊断的
SELECT qtb.OUT_DIAG_DIS_CD, qtb.OUT_DIAG_DIS_NM FROM qtb WHERE qtb.PERSON_ID = '80809375' AND qtb.MED_SER_ORG_NO = '4405816' 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 = '80809375' AND gyb.MED_SER_ORG_NO = '4405816' AND gyb.OUT_DIAG_DOC_NM LIKE '...
css
CREATE TABLE requirement ( requirement_id int, requirement varchar, college 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, additio...
Which courses will be taught by Dr. Selena Smith next semester ?
SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, instructor, offering_instructor, semester WHERE course.course_id = course_offering.course_id AND instructor.name LIKE '%Selena Smith%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.offe...
advising
CREATE TABLE dorm ( dorm_name VARCHAR, student_capacity VARCHAR )
Find the name of the dorm with the largest capacity.
SELECT dorm_name FROM dorm ORDER BY student_capacity DESC LIMIT 1
sql_create_context
CREATE TABLE table_name_95 ( theme VARCHAR, issue_price VARCHAR )
What is the Theme of the coin with an Issue Price of $89.95?
SELECT theme FROM table_name_95 WHERE issue_price = "$89.95"
sql_create_context
CREATE TABLE table_name_55 ( decile VARCHAR, authority VARCHAR, name VARCHAR )
What is the decile for Westminster Christian School with a state integrated authority?
SELECT decile FROM table_name_55 WHERE authority = "state integrated" AND name = "westminster christian school"
sql_create_context
CREATE TABLE table_72670 ( "Position" real, "Team" text, "Points" real, "Played" real, "Won" real, "Drawn" real, "Lost" real, "For" real, "Against" real, "Difference" text )
Name the points for paulistano
SELECT "Points" FROM table_72670 WHERE "Team" = 'Paulistano'
wikisql
CREATE TABLE Ref_Document_Types ( Document_Type_Code CHAR(15), Document_Type_Name VARCHAR(255), Document_Type_Description VARCHAR(255) ) CREATE TABLE Ref_Locations ( Location_Code CHAR(15), Location_Name VARCHAR(255), Location_Description VARCHAR(255) ) CREATE TABLE Documents_to_be_Destroyed (...
Show all role codes and the number of employees in each role by a bar chart, and sort by the the total number from high to low.
SELECT Role_Code, COUNT(*) FROM Employees GROUP BY Role_Code ORDER BY COUNT(*) DESC
nvbench
CREATE TABLE table_name_39 ( total INTEGER, league_cup INTEGER )
What is the sum of the League Cup smaller than 0?
SELECT SUM(total) FROM table_name_39 WHERE league_cup < 0
sql_create_context
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, ...
provide the number of patients whose ethnicity is black/haitian and age is less than 85?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "BLACK/HAITIAN" AND demographic.age < "85"
mimicsql_data
CREATE TABLE table_name_79 ( matches INTEGER, name VARCHAR, seasons VARCHAR )
What is the average number of matches of leonardo in seasons after 1?
SELECT AVG(matches) FROM table_name_79 WHERE name = "leonardo" AND seasons > 1
sql_create_context
CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), HIRE_DATE date, JOB_ID varchar(10), SALARY decimal(8,2), COMMISSION_PCT decimal(2,2), MANAGER_ID decimal(6,0), DEPARTMENT_ID decimal(...
Bin the hire date into Month interval, and then compute the average salary of employees in each month for a bar chart, note that just select those employees without the letter M in their first name, and sort the average of salary in asc order please.
SELECT HIRE_DATE, AVG(SALARY) FROM employees WHERE NOT FIRST_NAME LIKE '%M%' ORDER BY AVG(SALARY)
nvbench
CREATE TABLE volume ( volume_id number, volume_issue text, issue_date text, weeks_on_top number, song text, artist_id number ) CREATE TABLE music_festival ( id number, music_festival text, date_of_ceremony text, category text, volume number, result text ) CREATE TABLE a...
Return the dates of ceremony corresponding to music festivals that had the category 'Best Song' and result 'Awarded'.
SELECT date_of_ceremony FROM music_festival WHERE category = "Best Song" AND result = "Awarded"
spider
CREATE TABLE table_56778 ( "County" text, "Name" text, "Length (miles)" real, "West or south terminus" text, "East or north terminus" text )
what is the length (miles) when the east or north terminus is ne 2 in lincoln?
SELECT COUNT("Length (miles)") FROM table_56778 WHERE "East or north terminus" = 'ne 2 in lincoln'
wikisql
CREATE TABLE table_23346303_3 ( opponent VARCHAR, location VARCHAR )
what is the number of opponents where the location is syracuse, ny?
SELECT COUNT(opponent) FROM table_23346303_3 WHERE location = "Syracuse, NY"
sql_create_context
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE microlab ( microlabid number, ...
when was the first time the respiration for patient 015-58787 was less than 29.0 today?
SELECT vitalperiodic.observationtime FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '015-58787')) AND vitalperiodic.respiration < 29.0 A...
eicu
CREATE TABLE table_name_93 ( top_5 INTEGER, top_10 VARCHAR, wins VARCHAR )
What is the best top-5 when top-10 is 1 and there are more than 0 wins?
SELECT MAX(top_5) FROM table_name_93 WHERE top_10 = 1 AND wins > 0
sql_create_context
CREATE TABLE All_Documents ( Document_ID INTEGER, Date_Stored DATETIME, Document_Type_Code CHAR(15), Document_Name CHAR(255), Document_Description CHAR(255), Other_Details VARCHAR(255) ) CREATE TABLE Ref_Locations ( Location_Code CHAR(15), Location_Name VARCHAR(255), Location_Descri...
Show all role codes and the number of employees in each role with a pie chart.
SELECT Role_Code, COUNT(*) FROM Employees GROUP BY Role_Code
nvbench
CREATE TABLE table_76742 ( "Location" text, "Country" text, "Type" text, "Wheels" real, "Configuration" text )
What average wheels has accounting as the type, with IBM Collection as the location?
SELECT AVG("Wheels") FROM table_76742 WHERE "Type" = 'accounting' AND "Location" = 'ibm collection'
wikisql
CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), ...
For those employees who do not work in departments with managers that have ids between 100 and 200, visualize a bar chart about the distribution of last_name and employee_id , show in asc by the y-axis please.
SELECT LAST_NAME, EMPLOYEE_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY EMPLOYEE_ID
nvbench
CREATE TABLE course_offering ( offering_id int, course_id int, semester int, section_number int, start_time time, end_time time, monday varchar, tuesday varchar, wednesday varchar, thursday varchar, friday varchar, saturday varchar, sunday varchar, has_final_proje...
Which classes should I take to use toward my Core ?
SELECT DISTINCT course.department, course.name, course.number FROM course, program_course WHERE program_course.category LIKE '%Core%' AND program_course.course_id = course.course_id
advising
CREATE TABLE table_name_32 ( school VARCHAR, player VARCHAR )
Which school did player Rodney Purvis belong to?
SELECT school FROM table_name_32 WHERE player = "rodney purvis"
sql_create_context
CREATE TABLE people ( People_ID int, Name text, Height real, Weight real, Date_of_Birth text ) CREATE TABLE entrepreneur ( Entrepreneur_ID int, People_ID int, Company text, Money_Requested real, Investor text )
Return the dates of birth for entrepreneurs who have either the investor Simon Woodroffe or Peter Jones, and count them by a line chart
SELECT Date_of_Birth, COUNT(Date_of_Birth) FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID WHERE T1.Investor = "Simon Woodroffe" OR T1.Investor = "Peter Jones"
nvbench
CREATE TABLE table_47326 ( "Year" text, "Rebs" real, "Asts" real, "Stls" real, "Blks" real )
What is the sum of Blks, when Stls is 1, and when Rebs is greater than 8.6?
SELECT SUM("Blks") FROM table_47326 WHERE "Stls" = '1' AND "Rebs" > '8.6'
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 ...
在11年7月15日到2014年12月18日之间病患17045983经过了哪些仪器的检查,在检验结果指标记录中仪器的编号是什么?
SELECT jyjgzbb.YQBH, jyjgzbb.YQMC FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb 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 AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BG...
css
CREATE TABLE table_23235767_4 ( year VARCHAR, opponent_in_the_final VARCHAR, surface VARCHAR, championship VARCHAR )
Name the year for clay for boston and guillermo vilas
SELECT year FROM table_23235767_4 WHERE surface = "Clay" AND championship = "Boston" AND opponent_in_the_final = "Guillermo Vilas"
sql_create_context
CREATE TABLE table_name_19 ( week INTEGER, date VARCHAR )
What is the lowest week that has November 30, 2003 as the date?
SELECT MIN(week) FROM table_name_19 WHERE date = "november 30, 2003"
sql_create_context
CREATE TABLE table_34378 ( "Place" real, "Nation" text, "6 Ropes" real, "4 Hoops, 2 Clubs" real, "Total" real )
What is the total of the nation with 19.025 4 hoops, 2 clubs?
SELECT "Total" FROM table_34378 WHERE "4 Hoops, 2 Clubs" = '19.025'
wikisql
CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW text, JCZBJGDX text, JCZBMC text, JLDW text, JYRQ time, JYZBLSH text, ...
在编号为9381500的医院中,孙丹红患者在科室名有产字的科室的就诊记录的流水号有哪些
SELECT mzjzjlb.JZLSH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN hz_info_mzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.YLJGDM = hz_info_mzjzjlb.YLJGDM AND ...
css
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) 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 t...
give the number of patients who were admitted to the hospital before the year 2144 with 5720 as the diagnosis icd9 code.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2144" AND diagnoses.icd9_code = "5720"
mimicsql_data
CREATE TABLE table_name_52 ( points VARCHAR, year VARCHAR, chassis VARCHAR )
How many points does the year after 1986 with a AGS JH23B chassis have?
SELECT points FROM table_name_52 WHERE year > 1986 AND chassis = "ags jh23b"
sql_create_context
CREATE TABLE table_45895 ( "Name" text, "Listed" text, "Location" text, "County" text, "Type" text )
What type of Bridge is in Stanley?
SELECT "Type" FROM table_45895 WHERE "Location" = 'stanley'
wikisql
CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE d_labitems ( row_i...
how many times has patient 55360 been at the intensive care unit on this hospital encounter?
SELECT COUNT(DISTINCT icustays.icustay_id) FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 55360 AND admissions.dischtime IS NULL)
mimic_iii
CREATE TABLE table_1108394_43 ( party VARCHAR, brooklyn VARCHAR )
what's the party with brooklyn value of 51.0%
SELECT party FROM table_1108394_43 WHERE brooklyn = "51.0_percentage"
sql_create_context