context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE instructor ( ID varchar(5), name varchar(20), dept_name varchar(20), salary numeric(8,2) ) CREATE TABLE classroom ( building varchar(15), room_number varchar(7), capacity numeric(4,0) ) CREATE TABLE advisor ( s_ID varchar(5), i_ID varchar(5) ) CREATE TABLE time_slot (...
List the number of instructors for each course in year 2008 with a bar chart.
SELECT title, COUNT(title) FROM course AS T1 JOIN teaches AS T2 ON T1.course_id = T2.course_id JOIN instructor AS T3 ON T2.ID = T3.ID WHERE year = 2008 GROUP BY title
nvbench
CREATE TABLE table_14850099_18 ( cardinal_direction VARCHAR, planet VARCHAR )
What is the cardinal direction associated with Venus?
SELECT cardinal_direction FROM table_14850099_18 WHERE planet = "Venus"
sql_create_context
CREATE TABLE race ( race_id number, name text, class text, date text, track_id text ) CREATE TABLE track ( track_id number, name text, location text, seating number, year_opened number )
What are the names for tracks without a race in class 'GT'.
SELECT name FROM track EXCEPT SELECT T2.name FROM race AS T1 JOIN track AS T2 ON T1.track_id = T2.track_id WHERE T1.class = 'GT'
spider
CREATE TABLE table_16432543_1 ( location VARCHAR, nickname VARCHAR )
Location of the school with the nickname Mountaineers
SELECT location FROM table_16432543_1 WHERE nickname = "Mountaineers"
sql_create_context
CREATE TABLE region ( Region_id int, Region_code text, Region_name text ) CREATE TABLE storm ( Storm_ID int, Name text, Dates_active text, Max_speed int, Damage_millions_USD real, Number_Deaths int ) CREATE TABLE affected_region ( Region_id int, Storm_ID int, Number_cit...
Visualize a bar chart for what are the names and damage in millions for storms, ordered by their max speeds descending?
SELECT Name, Damage_millions_USD FROM storm ORDER BY Max_speed DESC
nvbench
CREATE TABLE enrollments ( campus VARCHAR, year VARCHAR ) CREATE TABLE campuses ( id VARCHAR )
What campus had more than 400 total enrollment but more than 200 full time enrollment in year 1956?
SELECT T1.campus FROM campuses AS t1 JOIN enrollments AS t2 ON t1.id = t2.campus WHERE t2.year = 1956 AND totalenrollment_ay > 400 AND FTE_AY > 200
sql_create_context
CREATE TABLE table_name_23 ( tournament VARCHAR, score VARCHAR, outcome VARCHAR, surface VARCHAR )
Which Tournament has an Outcome of winner, and a Surface of clay, and a Score of 6 4, 6 1?
SELECT tournament FROM table_name_23 WHERE outcome = "winner" AND surface = "clay" AND score = "6–4, 6–1"
sql_create_context
CREATE TABLE table_name_56 ( constructor VARCHAR, team VARCHAR )
Who is the Constructor for the Trac Racing Team?
SELECT constructor FROM table_name_56 WHERE team = "trac racing team"
sql_create_context
CREATE TABLE table_60906 ( "Shooter" text, "Event" text, "Rank points" text, "Score points" text, "Total" text )
That's the total for rank points of olympic gold medalist?
SELECT "Total" FROM table_60906 WHERE "Rank points" = 'olympic gold medalist'
wikisql
CREATE TABLE table_name_92 ( place VARCHAR, to_par VARCHAR )
What Place has a To par of 4?
SELECT place FROM table_name_92 WHERE to_par = "–4"
sql_create_context
CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, LastAutoRename time, Score number, ApprovedByUserId number, ApprovalDate time ) CREATE TABLE PostsWithDeleted ( Id number, PostTyp...
Questions in a tag that haven't had activity.
SELECT Posts.Id AS "post_link", Posts.LastActivityDate FROM ((Posts JOIN PostTypes ON Posts.PostTypeId = PostTypes.Id) JOIN (PostTags JOIN Tags ON PostTags.TagId = Tags.Id) ON Posts.Id = PostTags.PostId) WHERE Tags.TagName = @tagName AND DATEADD(m, @ageInMonths, Posts.LastActivityDate) < GETDATE() AND PostTypes.Name = ...
sede
CREATE TABLE member ( Member_ID int, Card_Number text, Name text, Hometown text, Level int ) CREATE TABLE branch ( Branch_ID int, Name text, Open_year text, Address_road text, City text, membership_amount text ) CREATE TABLE membership_register_branch ( Member_ID int, ...
Show all branch names with the number of members in each branch registered after 2015 Plot them as bar chart, and could you rank bars in desc order?
SELECT Name, COUNT(*) FROM membership_register_branch AS T1 JOIN branch AS T2 ON T1.Branch_ID = T2.Branch_ID WHERE T1.Register_Year > 2015 GROUP BY T2.Branch_ID ORDER BY Name DESC
nvbench
CREATE TABLE cinema ( Cinema_ID int, Name text, Openning_year int, Capacity int, Location text ) CREATE TABLE film ( Film_ID int, Rank_in_series int, Number_in_season int, Title text, Directed_by text, Original_air_date text, Production_code text ) CREATE TABLE schedule...
Plot openning year by how many openning year as a trend line, and show x-axis from low to high order.
SELECT Openning_year, COUNT(Openning_year) FROM cinema ORDER BY Openning_year
nvbench
CREATE TABLE table_name_89 ( away VARCHAR, date VARCHAR, attendance VARCHAR )
Which Away has a Date of 14 september 2008, and an Attendance larger than 1881?
SELECT away FROM table_name_89 WHERE date = "14 september 2008" AND attendance > 1881
sql_create_context
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...
患者92569406自二零零九年三月十六日开始,截止到二零一八年十一月二十五日,由哪几位医务人员为其检测指标591618的,查查这些医务人员的工号及姓名
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 table_name_21 ( chinese__simplified_ VARCHAR, album_number VARCHAR )
What is the simplified Chinese name for the 9th album?
SELECT chinese__simplified_ FROM table_name_21 WHERE album_number = "9th"
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 patient ( uniquep...
have patient 027-129174 undergone a ace inhibitor procedure this year at other hospitals?
SELECT COUNT(*) > 0 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.uniquepid = '027-129174' AND patient.hospitalid <> (SELECT DISTINCT patient.hospitalid FROM patient WHERE patient.uniquepid = '027-129174' AND patient.hospitaldischargetime IS NULL)) AND ...
eicu
CREATE TABLE table_name_61 ( snow__days_year_ INTEGER, storms__days_year_ VARCHAR )
What is the amount of snow where the days for storms are 31?
SELECT SUM(snow__days_year_) FROM table_name_61 WHERE storms__days_year_ = 31
sql_create_context
CREATE TABLE table_name_81 ( date VARCHAR, format VARCHAR )
Name the date that is a cd
SELECT date FROM table_name_81 WHERE format = "cd"
sql_create_context
CREATE TABLE table_name_12 ( year INTEGER, team VARCHAR, position VARCHAR )
What was the lowest year that a player from midfield won first team honors?
SELECT MIN(year) FROM table_name_12 WHERE team = "first team" AND position = "midfield"
sql_create_context
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
tell me the type of admission and number of days for which patient glen tanner stayed in hospital.
SELECT demographic.admission_type, demographic.days_stay FROM demographic WHERE demographic.name = "Glen Tanner"
mimicsql_data
CREATE TABLE table_42323 ( "CERCLIS ID" text, "Name" text, "County" text, "Proposed" text, "Listed" text, "Construction completed" text, "Partially deleted" text, "Deleted" text )
What is the partially deleted result for a deleted of m in Valley?
SELECT "Partially deleted" FROM table_42323 WHERE "Deleted" = '–' AND "County" = 'valley'
wikisql
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...
经过门诊就诊的病号97338418415用的卡的卡号以及卡类型是什么呢?
SELECT txmzjzjlb.KH, txmzjzjlb.KLX FROM txmzjzjlb WHERE txmzjzjlb.JZLSH = '97338418415' UNION SELECT ftxmzjzjlb.KH, ftxmzjzjlb.KLX FROM ftxmzjzjlb WHERE ftxmzjzjlb.JZLSH = '97338418415'
css
CREATE TABLE table_name_43 ( money___ INTEGER, score VARCHAR )
What is the sum of Money ($), when Score is 70-71-70-69=280?
SELECT SUM(money___) AS $__ FROM table_name_43 WHERE score = 70 - 71 - 70 - 69 = 280
sql_create_context
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
count the number of patients whose primary disease is mesenteric ischemia and year of death is less than or equal to 2164?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "MESENTERIC ISCHEMIA" AND demographic.dod_year <= "2164.0"
mimicsql_data
CREATE TABLE table_28439 ( "Sd" real, "Rk" real, "Player" text, "Points" real, "Points defending" real, "Points won" real, "New points" real, "Status" text )
What is the status when sd is 15?
SELECT "Status" FROM table_28439 WHERE "Sd" = '15'
wikisql
CREATE TABLE table_test_24 ( "id" int, "history_of_bleeding_diathesis" bool, "bleeding" int, "systolic_blood_pressure_sbp" int, "hemoglobin_a1c_hba1c" float, "blood_draw" bool, "renal_disease" bool, "allergy_to_aspirin" bool, "allergy_to_clopidogrel" bool, "cardiogenic_shock" boo...
serum total cholesterol levels on admission ranges >= 180 mg / dl and < 240 mg / dl
SELECT * FROM table_test_24 WHERE serum_total_cholesterol >= 180 AND serum_total_cholesterol <= 240
criteria2sql
CREATE TABLE table_53333 ( "Player" text, "Height" text, "School" text, "Hometown" text, "College" text, "NBA Draft" text )
What is Alex Poythress height?
SELECT "Height" FROM table_53333 WHERE "Player" = 'alex poythress'
wikisql
CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ) CREATE TABLE Lives_in ( stuid INTEGER, dormid INTEGER, room_number INTEGER ) CREATE TABLE Has_amenity ( dormid...
what is the average age for each dorm and what are the names of each dorm?, order from high to low by the x-axis.
SELECT dorm_name, AVG(T1.Age) FROM Student AS T1 JOIN Lives_in AS T2 ON T1.stuid = T2.stuid JOIN Dorm AS T3 ON T3.dormid = T2.dormid GROUP BY T3.dorm_name ORDER BY dorm_name DESC
nvbench
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 flight_s...
find me the earliest flight from BOSTON to ATLANTA on any day of the week
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 = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'ATLANT...
atis
CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) CREATE TABLE flight_fare ( flight_id int, fare_id int ) CREATE TABLE flight ( aircraft_code_sequence text, airline_code varchar, airline_fl...
i would like information on flights leaving ATLANTA in the afternoon arriving in DALLAS
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 = 'ATLANTA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DALLA...
atis
CREATE TABLE table_name_56 ( primary_conference VARCHAR, ihsaa_football_class VARCHAR, school VARCHAR )
What is the primary conference with a IHSAA Football Class of A, at South Decatur school?
SELECT primary_conference FROM table_name_56 WHERE ihsaa_football_class = "a" AND school = "south decatur"
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(...
For those employees who do not work in departments with managers that have ids between 100 and 200, a bar chart shows the distribution of phone_number and manager_id .
SELECT PHONE_NUMBER, MANAGER_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200)
nvbench
CREATE TABLE table_18346 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text )
What were the results when the incumbent was John Breaux?
SELECT "Result" FROM table_18346 WHERE "Incumbent" = 'John Breaux'
wikisql
CREATE TABLE table_60158 ( "Game" text, "Date" text, "Opponent" text, "Score" text, "Location Attendance" text, "Record" text )
What Location Attendance has a Game of 4?
SELECT "Location Attendance" FROM table_60158 WHERE "Game" = '4'
wikisql
CREATE TABLE table_name_93 ( points_classification VARCHAR, young_rider_classification VARCHAR, general_classification VARCHAR )
What is the point classification with chris anker s rensen as the young rider classification and Christian vande velde as the general classification?
SELECT points_classification FROM table_name_93 WHERE young_rider_classification = "chris anker sørensen" AND general_classification = "christian vande velde"
sql_create_context
CREATE TABLE table_name_83 ( weight__kg_ INTEGER, height__cm_ INTEGER )
What is the average weight of a player who is less than 175 centimeters tall?
SELECT AVG(weight__kg_) FROM table_name_83 WHERE height__cm_ < 175
sql_create_context
CREATE TABLE table_test_9 ( "id" int, "ejection_fraction_ef" int, "anemia" bool, "child_pugh_class" string, "systolic_blood_pressure_sbp" int, "leukopenia" int, "heart_disease" bool, "stroke" bool, "av_block" bool, "renal_disease" bool, "hepatic_disease" bool, "estimated_...
hepatic failure ( childs _ pugh grade b or c ) or renal failure ( estimated glomerular filtration rate < 25 ml / min )
SELECT * FROM table_test_9 WHERE hepatic_disease = 1 OR child_pugh_class = 'b' OR child_pugh_class = 'c' OR renal_disease = 1 OR estimated_glomerular_filtration_rate_egfr < 25
criteria2sql
CREATE TABLE table_204_480 ( id number, "title" text, "alternate title(s)" text, "year" number, "manufacturer" text, "genre(s)" text, "max. players" number )
what are the number of times taito is listed as the manufacturer ?
SELECT COUNT(*) FROM table_204_480 WHERE "manufacturer" = 'taito'
squall
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE medication ( medicationid n...
what are the four most frequently prescribed drugs that were prescribed to patients of the 30s in the same hospital visit after they had been diagnosed with hypertension until 1 year ago?
SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'hypertension' A...
eicu
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, ...
哪些是俞以轩患者的检验报告单对应的检验结果指标均正常以及列出检验报告单号是多少?
SELECT jybgb.BGDH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb 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 WHERE person_info.XM = '俞以轩' AND NOT ...
css
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) 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,...
叫鲁秀筠的患者的检验报告单的报告日期在零二年二月二十三日以前,这些报告单所对应的门诊就诊的流水号是什么
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 table_18862490_2 ( country VARCHAR, player VARCHAR )
What country does robert allenby represent?
SELECT country FROM table_18862490_2 WHERE player = "Robert Allenby"
sql_create_context
CREATE TABLE people ( People_ID int, Sex text, Name text, Date_of_Birth text, Height real, Weight real ) CREATE TABLE candidate ( Candidate_ID int, People_ID int, Poll_Source text, Date text, Support_rate real, Consider_rate real, Oppose_rate real, Unsure_rate re...
Return a scatter chart about the correlation between Height and Weight , and group by attribute Sex.
SELECT Height, Weight FROM people GROUP BY Sex
nvbench
CREATE TABLE table_34386 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" real, "Time" text, "Location" text )
What is the lowest round number for the fight that had a time of 1:09?
SELECT MIN("Round") FROM table_34386 WHERE "Time" = '1:09'
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 ) ...
give me the number of patients whose language is engl and age is less than 31?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.language = "ENGL" AND demographic.age < "31"
mimicsql_data
CREATE TABLE table_180802_3 ( sanskrit_word VARCHAR, color VARCHAR )
What is the sanskrit word for the color red?
SELECT sanskrit_word FROM table_180802_3 WHERE color = "red"
sql_create_context
CREATE TABLE flight ( flno number(4,0), origin varchar2(20), destination varchar2(20), distance number(6,0), departure_date date, arrival_date date, price number(7,2), aid number(9,0) ) CREATE TABLE certificate ( eid number(9,0), aid number(9,0) ) CREATE TABLE employee ( ei...
How many flights with price higher than 300 for each destination city? Return a bar chart, display by the x-axis in ascending.
SELECT destination, COUNT(destination) FROM flight WHERE price > 300 GROUP BY destination ORDER BY destination
nvbench
CREATE TABLE table_47872 ( "Season" text, "Coach" text, "Captain" text, "Alternate (1)" text, "Alternate (2)" text )
Which captain has Gintare Karpaviciute as an alternate?
SELECT "Captain" FROM table_47872 WHERE "Alternate (1)" = 'gintare karpaviciute'
wikisql
CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime tim...
what was patient 22973's change in platelet count last measured on the first hospital visit compared to the value first measured on the first hospital visit?
SELECT (SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 22973 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label ...
mimic_iii
CREATE TABLE table_name_43 ( casualties VARCHAR, nature_of_incident VARCHAR, date VARCHAR )
Name the casualities for nation of incident of hostile on 2006-06-26
SELECT casualties FROM table_name_43 WHERE nature_of_incident = "hostile" AND date = "2006-06-26"
sql_create_context
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...
在03年1月5日到10年11月6日期间,病患20286940的所有检验结果指标记录的检测人为58375381的检验指标流水号分别是多少?
SELECT jyjgzbb.JYZBLSH FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb 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 jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.B...
css
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...
检验报告单的编码为23522676937的检测项目代码是什么?检测项目名字叫什么?
SELECT zyjybgb.JYXMDM, zyjybgb.JYXMMC FROM zyjybgb WHERE zyjybgb.BGDH = '23522676937' UNION SELECT mzjybgb.JYXMDM, mzjybgb.JYXMMC FROM mzjybgb WHERE mzjybgb.BGDH = '23522676937'
css
CREATE TABLE table_name_22 ( home_team VARCHAR, away_team VARCHAR )
What Home team played Richmond?
SELECT home_team FROM table_name_22 WHERE away_team = "richmond"
sql_create_context
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE intakeoutput ( i...
what was patient 012-63427's first id of the ward until 1 year ago?
SELECT patient.wardid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '012-63427') AND DATETIME(patient.unitadmittime) <= DATETIME(CURRENT_TIME(), '-1 year') ORDER BY patient.unitadmittime LIMIT 1
eicu
CREATE TABLE Customers ( Customer_ID VARCHAR(100), Address_ID INTEGER, Customer_Name VARCHAR(255), Customer_Phone VARCHAR(255), Customer_Email_Address VARCHAR(255), Other_Details VARCHAR(255) ) CREATE TABLE Performers_in_Bookings ( Order_ID INTEGER, Performer_ID INTEGER ) CREATE TABLE ...
A bar chart for what are the number of the descriptions of the service types with product price above 100?, list by the Y-axis in ascending.
SELECT Service_Type_Description, COUNT(Service_Type_Description) FROM Ref_Service_Types AS T1 JOIN Services AS T2 ON T1.Service_Type_Code = T2.Service_Type_Code WHERE T2.Product_Price > 100 GROUP BY Service_Type_Description ORDER BY COUNT(Service_Type_Description)
nvbench
CREATE TABLE flight_fare ( flight_id int, fare_id int ) CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE TABLE code_description ( code varchar, description text ) CREATE...
is there ground transportation in OAKLAND
SELECT DISTINCT ground_service.transport_type FROM city, ground_service WHERE city.city_name = 'OAKLAND' AND ground_service.city_code = city.city_code
atis
CREATE TABLE table_25664518_3 ( itv1_weekly_ranking INTEGER, viewers__millions_ VARCHAR )
What is the minimum ITV1 ranking for the episode having viewership of 5.42 million?
SELECT MIN(itv1_weekly_ranking) FROM table_25664518_3 WHERE viewers__millions_ = "5.42"
sql_create_context
CREATE TABLE flight ( flno number, origin text, destination text, distance number, departure_date time, arrival_date time, price number, aid number ) CREATE TABLE employee ( eid number, name text, salary number ) CREATE TABLE aircraft ( aid number, name text, di...
What is the name of each aircraft and how many flights does each one complete?
SELECT T2.name, COUNT(*) FROM flight AS T1 JOIN aircraft AS T2 ON T1.aid = T2.aid GROUP BY T1.aid
spider
CREATE TABLE table_name_49 ( record VARCHAR, date VARCHAR )
Which Record is dated Dec 10?
SELECT record FROM table_name_49 WHERE date = "dec 10"
sql_create_context
CREATE TABLE table_name_42 ( year_named VARCHAR, longitude VARCHAR )
What is Year Named, when Longitude is 227.5E?
SELECT year_named FROM table_name_42 WHERE longitude = "227.5e"
sql_create_context
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, ...
how many times has patient 52898 been prescribed for ns in this month?
SELECT COUNT(*) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 52898) AND prescriptions.drug = 'ns' AND DATETIME(prescriptions.startdate, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-0 month')
mimic_iii
CREATE TABLE table_name_90 ( score INTEGER, country VARCHAR )
What is Sweden's lowest score?
SELECT MIN(score) FROM table_name_90 WHERE country = "sweden"
sql_create_context
CREATE TABLE table_26446 ( "Song title" text, "Artist" text, "Year" real, "Genre" text, "Single / Pack name" text, "Release date" text, "Family Friendly" text, "Additional Rock Band 3 Features" text )
Who is the artist for the song title of ' ...and justice for all '?
SELECT "Artist" FROM table_26446 WHERE "Song title" = ' ...And Justice for All '
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 diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
what is gender and language of subject name robert hyden?
SELECT demographic.gender, demographic.language FROM demographic WHERE demographic.name = "Robert Hyden"
mimicsql_data
CREATE TABLE table_33239 ( "Region" text, "Host" text, "Venue" text, "City" text, "State" text )
Which city is the University of Montana located in?
SELECT "City" FROM table_33239 WHERE "Host" = 'university of montana'
wikisql
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...
列出患者柳阳文所有检验结果指标记录的检测人为61543019的检验指标流水号有多少在在2007-05-14到2020-07-28内?
SELECT jyjgzbb.JYZBLSH 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 = ...
css
CREATE TABLE table_name_87 ( mountain_peak VARCHAR, region VARCHAR, location VARCHAR )
Which Mountain Peak has a Region of baja california, and a Location of 28.1301 n 115.2206 w?
SELECT mountain_peak FROM table_name_87 WHERE region = "baja california" AND location = "28.1301°n 115.2206°w"
sql_create_context
CREATE TABLE t_kc21_t_kc24 ( MED_CLINIC_ID text, MED_SAFE_PAY_ID number ) 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, ...
从2005年12月13日到2021年10月1日内参保人为号码87682313的人10元以下的小金额结算了多少次?
SELECT COUNT(*) FROM t_kc24 WHERE t_kc24.PERSON_ID = '87682313' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2005-12-13' AND '2021-10-01' AND t_kc24.MED_AMOUT <= 10
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),...
What are the names of the different bank branches, and what are their total loan amounts Show bar chart, list bars from low to high order please.
SELECT bname, SUM(amount) FROM bank AS T1 JOIN loan AS T2 ON T1.branch_ID = T2.branch_ID GROUP BY T1.bname ORDER BY bname
nvbench
CREATE TABLE table_62499 ( "Club" text, "Sport" text, "Founded" real, "League" text, "Venue" text )
Which venue was fouded before 2000 for basketball?
SELECT "Venue" FROM table_62499 WHERE "Founded" < '2000' AND "Sport" = 'basketball'
wikisql
CREATE TABLE table_11296 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text )
What was the date of the Cubs game that had an attendance over 20,737 and a loss of Dawley (2-3)?
SELECT "Date" FROM table_11296 WHERE "Attendance" > '20,737' AND "Loss" = 'dawley (2-3)'
wikisql
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 demographic ...
find the number of patients diagnosed with acute venous embolism and thrombosis of deep vessels of proximal lower extremity have expired.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.expire_flag = "1" AND diagnoses.long_title = "Acute venous embolism and thrombosis of deep vessels of proximal lower extremity"
mimicsql_data
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
calculate the minimum age of widowed patients admitted to trsf within this facility
SELECT MIN(demographic.age) FROM demographic WHERE demographic.marital_status = "WIDOWED" AND demographic.admission_location = "TRSF WITHIN THIS FACILITY"
mimicsql_data
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 prescriptions ( subject_id text, hadm_id...
how many self pay insurance patients are male?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "M" AND demographic.insurance = "Self Pay"
mimicsql_data
CREATE TABLE movie ( mid number, title text, year number, director text ) CREATE TABLE reviewer ( rid number, name text ) CREATE TABLE rating ( rid number, mid number, stars number, ratingdate time )
Find the movies with the highest average rating. Return the movie titles and average rating.
SELECT T2.title, AVG(T1.stars) FROM rating AS T1 JOIN movie AS T2 ON T1.mid = T2.mid GROUP BY T1.mid ORDER BY AVG(T1.stars) DESC LIMIT 1
spider
CREATE TABLE table_71303 ( "Year" text, "Start" text, "Qual" text, "Rank" text, "Finish" text, "Laps" real )
How many laps had a qualification of 136.168?
SELECT COUNT("Laps") FROM table_71303 WHERE "Qual" = '136.168'
wikisql
CREATE TABLE table_10979230_4 ( romaji_title VARCHAR, japanese_title VARCHAR )
How many songs have mi-chemin as their Japanese name and romanji name?
SELECT COUNT(romaji_title) FROM table_10979230_4 WHERE japanese_title = "Mi-Chemin"
sql_create_context
CREATE TABLE table_name_49 ( masculine_an_stems VARCHAR, feminine_ō_stems VARCHAR, masculine_u_stems VARCHAR )
What is the masculine an form for the word with a feminine ending of siangar and a masculine u ending of sunar?
SELECT masculine_an_stems FROM table_name_49 WHERE feminine_ō_stems = "siangar" AND masculine_u_stems = "sunar"
sql_create_context
CREATE TABLE table_38972 ( "Preseason" text, "Week 1 Aug 26" text, "Week 2 Sept 2" text, "Week 3 Sept 8" text, "Week 4 Sept 15" text, "Week 5 Sept 22" text, "Week 6 Sept 29" text, "Week 7 Oct 6" text, "Week 8 Oct 13" text, "Week 9 Oct 20" text, "Week 10 Oct 27" text, "Wee...
What is Week 14 Nov 24, that has Week 11 Nov 3 of USC (6-2)?
SELECT "Week 14 Nov 24" FROM table_38972 WHERE "Week 11 Nov 3" = 'usc (6-2)'
wikisql
CREATE TABLE table_61585 ( "Minister" text, "Party" text, "Governments" text, "Term start" text, "Term end" text )
Who was the minister of the labor party and had 26 goverments?
SELECT "Minister" FROM table_61585 WHERE "Party" = 'labor party' AND "Governments" = '26'
wikisql
CREATE TABLE table_67685 ( "Club" text, "Played" text, "Drawn" text, "Lost" text, "Points for" text, "Points against" text, "Tries for" text, "Tries against" text, "Try bonus" text, "Losing bonus" text, "Points" text )
What is the value for Drawn, when the value for Losing bonus is 6?
SELECT "Drawn" FROM table_67685 WHERE "Losing bonus" = '6'
wikisql
CREATE TABLE table_22904780_1 ( title VARCHAR, us_viewers__million_ VARCHAR )
List the number of shows that had 12.04 million viewers in the united states
SELECT COUNT(title) FROM table_22904780_1 WHERE us_viewers__million_ = "12.04"
sql_create_context
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...
门诊诊断的患者患有疾病J44.682的籍贯代码是多少以及名称叫什么和相应人数是多少?
SELECT person_info.JGDM, person_info.JGMC, COUNT(person_info.RYBH) 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_inf...
css
CREATE TABLE voting_record ( stuid number, registration_date text, election_cycle text, president_vote number, vice_president_vote number, secretary_vote number, treasurer_vote number, class_president_vote number, class_senator_vote number ) CREATE TABLE student ( stuid number, ...
Find the major that is studied by the most female students.
SELECT major FROM student WHERE sex = "F" GROUP BY major ORDER BY COUNT(*) DESC LIMIT 1
spider
CREATE TABLE t_kc21 ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, ...
这位患者谢晴雪出院诊断疾病名称包括性在病院1203816的医疗就诊记录编码是什么?
SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_NM = '谢晴雪' AND t_kc21.MED_SER_ORG_NO = '1203816' AND t_kc21.OUT_DIAG_DIS_NM LIKE '%性%'
css
CREATE TABLE table_58728 ( "Club" text, "City" text, "Stadium" text, "Capacity" real, "2007\u201308 season" text )
What is the capacity when the 2007 08 season was 1st Serie D/I?
SELECT "Capacity" FROM table_58728 WHERE "2007\u201308 season" = '1st serie d/i'
wikisql
CREATE TABLE table_name_50 ( opponent VARCHAR, date VARCHAR )
What is the Opponent of the Game on October 20?
SELECT opponent FROM table_name_50 WHERE date = "october 20"
sql_create_context
CREATE TABLE table_20506 ( "Region of USSR" text, "Number of families" real, "Number of people" real, "Average family size" text, "% of total deportees" text )
What is the total number of regions where the average family size is 2.8?
SELECT COUNT("% of total deportees") FROM table_20506 WHERE "Average family size" = '2.8'
wikisql
CREATE TABLE artwork ( Artwork_ID int, Type text, Name text ) CREATE TABLE nomination ( Artwork_ID int, Festival_ID int, Result text ) CREATE TABLE festival_detail ( Festival_ID int, Festival_Name text, Chair_Name text, Location text, Year int, Num_of_Audience int )
Show the ids and names of festivals that have at least two nominations for artworks by a bar chart, rank in descending by the y axis.
SELECT T3.Festival_Name, T1.Festival_ID FROM nomination AS T1 JOIN artwork AS T2 ON T1.Artwork_ID = T2.Artwork_ID JOIN festival_detail AS T3 ON T1.Festival_ID = T3.Festival_ID ORDER BY T1.Festival_ID DESC
nvbench
CREATE TABLE table_18894744_5 ( opponent VARCHAR, record VARCHAR )
Name the opponent for record 10-4
SELECT opponent FROM table_18894744_5 WHERE record = "10-4"
sql_create_context
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...
列出患者秦浩然医疗记录中的入院诊断疾病编码和名称,主要针对医疗费总额不少于216.54元的
SELECT qtb.IN_DIAG_DIS_CD, qtb.IN_DIAG_DIS_NM FROM qtb WHERE qtb.PERSON_NM = '秦浩然' AND qtb.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT >= 216.54) UNION SELECT gyb.IN_DIAG_DIS_CD, gyb.IN_DIAG_DIS_NM FROM gyb WHERE gyb.PERSON_NM = '秦浩然' AND gyb.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLIN...
css
CREATE TABLE table_name_60 ( inchicore_class VARCHAR, gswr_class VARCHAR, type VARCHAR )
What Inchicore Class has a GSWR Class smaller than 268, and a Type of 0-4-2t?
SELECT inchicore_class FROM table_name_60 WHERE gswr_class < 268 AND type = "0-4-2t"
sql_create_context
CREATE TABLE restriction ( restriction_code text, advance_purchase int, stopovers text, saturday_stay_required text, minimum_stay int, maximum_stay int, application text, no_discounts text ) CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE ...
what is AA 's last flight from BOSTON to WASHINGTON on 7 21
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 = 'WASHINGTON' AND date_day.day_number = 21 AND date_day.month_number = 7 ...
atis
CREATE TABLE stadium ( ID int, name text, Capacity int, City text, Country text, Opening_year int ) CREATE TABLE record ( ID int, Result text, Swimmer_ID int, Event_ID int ) CREATE TABLE event ( ID int, Name text, Stadium_ID int, Year text ) CREATE TABLE swimme...
Find meter_500 and meter_100 , and visualize them by a bar chart, could you list by the X in asc?
SELECT meter_500, meter_100 FROM swimmer ORDER BY meter_500
nvbench
CREATE TABLE table_name_89 ( lane INTEGER, rank VARCHAR )
What is the lane total when rank is 2?
SELECT SUM(lane) FROM table_name_89 WHERE rank = 2
sql_create_context
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...
how many patients who have stayed in the hospital for more than 43 days have 4432 as their procedure icd9 code?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.days_stay > "43" AND procedures.icd9_code = "4432"
mimicsql_data
CREATE TABLE semester ( semester_id int, semester varchar, year int ) 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...
Are any of the RCIDIV 318 classes before noon ?
SELECT COUNT(*) > 0 FROM course, course_offering, semester WHERE course_offering.start_time < '12:00:00' AND course_offering.start_time >= '08:00:00' AND course.course_id = course_offering.course_id AND course.department = 'RCIDIV' AND course.number = 318 AND semester.semester = 'WN' AND semester.semester_id = course_o...
advising
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, ...
了解一下住院就诊76532524824的患者在哪个病区出院?名称和代码分别是什么?出院的床位号是哪个呢
SELECT zyjzjlb.CYBQDM, zyjzjlb.CYBQMC, zyjzjlb.CYCWH FROM zyjzjlb WHERE zyjzjlb.JZLSH = '76532524824'
css
CREATE TABLE table_name_59 ( standing VARCHAR, date VARCHAR, total_points VARCHAR, finished VARCHAR )
I want the standing for january 29 and finished of 3rd and total points less than 248
SELECT standing FROM table_name_59 WHERE total_points < 248 AND finished = "3rd" AND date = "january 29"
sql_create_context