context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE area ( course_id int, area varchar ) CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE course_tags_count ( course_id int, clear_grading int, pop_quiz int, group_projects int, inspirational...
Speaking of upper-level MUSED classes , which are available this Winter ?
SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, program_course, semester WHERE course.course_id = course_offering.course_id AND course.department = 'MUSED' AND program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id AND semester.semester = 'Winte...
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, ...
查询13423195病患的检验报告单中结果指标均正常的检验报告单号,需要检验报告的单号
SELECT jybgb.BGDH 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 Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, ...
Number of questions, answers, and net scores.
SELECT * FROM (SELECT COUNT(*) AS Questions, SUM(Posts.Score) AS Score FROM (Posts JOIN PostTypes ON Posts.PostTypeId = PostTypes.Id) WHERE Posts.OwnerUserId = @userId AND PostTypes.Name = 'Question') AS QT, (SELECT COUNT(*) AS Answers, SUM(Posts.Score) AS Score FROM (Posts JOIN PostTypes ON Posts.PostTypeId = PostType...
sede
CREATE TABLE table_58618 ( "Polling Firm" text, "Polling Dates" text, "Bob Chiarelli" text, "Alex Munter" text, "Larry O'Brien" text, "Terry Kilrea (dropped out)" text )
What are the polling dates when Larry O'Brien has 37%?
SELECT "Polling Dates" FROM table_58618 WHERE "Larry O'Brien" = '37%'
wikisql
CREATE TABLE table_name_78 ( date VARCHAR, venue VARCHAR )
Name the date for venue of lord's
SELECT date FROM table_name_78 WHERE venue = "lord's"
sql_create_context
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE diagnosis ( diagnosisid...
tell me the duration of patient 002-57636's last hospital stay.
SELECT STRFTIME('%j', patient.hospitaldischargetime) - STRFTIME('%j', patient.hospitaladmittime) FROM patient WHERE patient.uniquepid = '002-57636' AND NOT patient.hospitaladmittime IS NULL ORDER BY patient.hospitaladmittime DESC LIMIT 1
eicu
CREATE TABLE table_name_14 ( team VARCHAR, date_of_appointment VARCHAR )
Which Team has a Date of appointment on sep. 20, 2008?
SELECT team FROM table_name_14 WHERE date_of_appointment = "sep. 20, 2008"
sql_create_context
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, ...
what is drug type of drug name lidocaine jelly 2% (urojet)?
SELECT prescriptions.drug_type FROM prescriptions WHERE prescriptions.drug = "Lidocaine Jelly 2% (Urojet)"
mimicsql_data
CREATE TABLE table_22596 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" text )
what is the title no in season 2?
SELECT "Title" FROM table_22596 WHERE "No. in season" = '2'
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, ...
在二零一五年三月二十日到二零二一年四月二十四日的这几年里,查一下医疗机构8772585转诊门诊的就诊记录数量
SELECT COUNT(*) FROM fzzmzjzjlb WHERE fzzmzjzjlb.YLJGDM = '8772585' AND fzzmzjzjlb.JZKSRQ BETWEEN '2015-03-20' AND '2021-04-24'
css
CREATE TABLE table_32553 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What is the sum of all the crowds at matches where the away team's score was 7.6 (48)?
SELECT SUM("Crowd") FROM table_32553 WHERE "Away team score" = '7.6 (48)'
wikisql
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, ...
how many patients whose diagnoses short title is fx surg nck humerus-clos and drug route is iv?
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 = "Fx surg nck humerus-clos" AND prescriptions.route = "IV"
mimicsql_data
CREATE TABLE table_17576 ( "County" text, "Live births 2006" real, "GFR 2006" text, "TFR 2006" text, "Whites as % of Pop." text )
How many TFR were there in 2006 when the GFR was 53.8?
SELECT "TFR 2006" FROM table_17576 WHERE "GFR 2006" = '53.8'
wikisql
CREATE TABLE table_41093 ( "Ship" text, "13.5-inch/1400lb" real, "13.5-inch/1250lb" real, "12-inch" real, "Total" real )
What is the lowest 13.5-inch/1400lb with a 13.5-inch/1250lb less than 2, a 12-inch of 0, and a Total larger than 8?
SELECT MIN("13.5-inch/1400lb") FROM table_41093 WHERE "13.5-inch/1250lb" < '2' AND "12-inch" = '0' AND "Total" > '8'
wikisql
CREATE TABLE table_name_89 ( total_goals INTEGER, position VARCHAR, fa_cup_goals VARCHAR )
What is the lowest total goals when position is df, and FA Cup Goals is smaller than 0?
SELECT MIN(total_goals) FROM table_name_89 WHERE position = "df" AND fa_cup_goals < 0
sql_create_context
CREATE TABLE table_name_48 ( position VARCHAR, year VARCHAR, name VARCHAR )
What Position did the sophomore Darnell Jackson play?
SELECT position FROM table_name_48 WHERE year = "sophomore" AND name = "darnell jackson"
sql_create_context
CREATE TABLE table_name_8 ( took_office INTEGER, district VARCHAR )
Which Took Office has a District of 29?
SELECT AVG(took_office) FROM table_name_8 WHERE district = 29
sql_create_context
CREATE TABLE table_3401 ( "Skip (Club)" text, "W" real, "L" real, "PF" real, "PA" real, "Ends Won" real, "Ends Lost" real, "Blank Ends" real, "Stolen Ends" real )
What is the largest amount of ends won when stolen ends were 3?
SELECT MAX("Ends Won") FROM table_3401 WHERE "Stolen Ends" = '3'
wikisql
CREATE TABLE table_18158 ( "District" text, "Incumbent" text, "Party" text, "First elected" text, "Results" text, "Candidates" text )
How many incumbents were first elected in 1984?
SELECT COUNT("Incumbent") FROM table_18158 WHERE "First elected" = '1984'
wikisql
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemics...
how many hours does it have passed since patient 005-4471 was admitted to the icu?
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', patient.unitadmittime)) FROM patient WHERE patient.uniquepid = '005-4471' AND patient.unitdischargetime IS NULL
eicu
CREATE TABLE table_222771_1 ( numeric_code VARCHAR, alpha_3_code VARCHAR )
What is the number reference for LIE?
SELECT numeric_code FROM table_222771_1 WHERE alpha_3_code = "LIE"
sql_create_context
CREATE TABLE table_5977 ( "Year" text, "Total matches" real, "Total W-L-H" text, "Singles W-L-H" text, "Points won" real, "Points %" text )
How many Total matches happened in 2003?
SELECT "Total matches" FROM table_5977 WHERE "Year" = '2003'
wikisql
CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDisplayName text...
Most closed and deleted where the action is by one user. Post history of deleted and closed
SELECT Text, COUNT(Id) FROM PostHistory WHERE PostHistoryTypeId IN (10, 12) AND CreationDate > '2011-12-31' AND NOT Text LIKE '%},{%' GROUP BY Text HAVING COUNT(Id) > 99 ORDER BY COUNT(Id) DESC
sede
CREATE TABLE table_name_39 ( name VARCHAR, teams VARCHAR )
Which name is on the of fc s te olympique de marseille?
SELECT name FROM table_name_39 WHERE teams = "fc sète olympique de marseille"
sql_create_context
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE labevents ...
what was the last value of arterial bp [diastolic] patient 11064 had on the last icu visit.
SELECT chartevents.valuenum FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 11064) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime DESC LIMIT 1) AND chartevents.itemid ...
mimic_iii
CREATE TABLE rental ( rental_id number, rental_date time, inventory_id number, customer_id number, return_date time, staff_id number, last_update time ) CREATE TABLE staff ( staff_id number, first_name text, last_name text, address_id number, picture others, email te...
What are the title and id of the film which has a rental rate of 0.99 and an inventory of below 3?
SELECT title, film_id FROM film WHERE rental_rate = 0.99 INTERSECT SELECT T1.title, T1.film_id FROM film AS T1 JOIN inventory AS T2 ON T1.film_id = T2.film_id GROUP BY T1.film_id HAVING COUNT(*) < 3
spider
CREATE TABLE table_name_16 ( home_team VARCHAR, venue VARCHAR )
Which team plays their home matches at the mcg Venue?
SELECT home_team FROM table_name_16 WHERE venue = "mcg"
sql_create_context
CREATE TABLE table_28243691_2 ( team_nickname VARCHAR, enrollment VARCHAR )
What's the nickname of the team with enrollment of 40747?
SELECT team_nickname FROM table_28243691_2 WHERE enrollment = 40747
sql_create_context
CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL )
For those records from the products and each product's manufacturer, return a bar chart about the distribution of name and manufacturer , and group by attribute founder, and list in ascending by the Y-axis.
SELECT T1.Name, T1.Manufacturer FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder, T1.Name ORDER BY T1.Manufacturer
nvbench
CREATE TABLE table_name_70 ( score VARCHAR, type VARCHAR, date VARCHAR )
Tell me the score for international friendly 17 august 2013
SELECT score FROM table_name_70 WHERE type = "international friendly" AND date = "17 august 2013"
sql_create_context
CREATE TABLE table_24786 ( "Year (Ceremony)" text, "English title" text, "Portuguese title" text, "Director" text, "Result" text )
What is the Portuguese name of the film who's English title is, Belle Toujours?
SELECT "Portuguese title" FROM table_24786 WHERE "English title" = 'Belle Toujours'
wikisql
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...
医院3003256所有医疗记录的个人账户支出与医疗费总额是多大平均比值,在2011-07-03到2013-04-26内?
SELECT AVG(t_kc24.PER_ACC_PAY) FROM gwyjzb JOIN t_kc24 ON gwyjzb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE gwyjzb.MED_SER_ORG_NO = '3003256' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2011-07-03' AND '2013-04-26' UNION SELECT AVG(t_kc24.PER_ACC_PAY) FROM fgwyjzb JOIN t_kc24 ON fgwyjzb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHE...
css
CREATE TABLE table_64033 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" text )
What is the date of week 11?
SELECT "Date" FROM table_64033 WHERE "Week" = '11'
wikisql
CREATE TABLE t_kc24 ( MED_SAFE_PAY_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, REF_SLT_FLG number, CLINIC_SLT_DATE time, COMP_ID text, PERSON_ID text, FLX_MED_ORG_ID text, INSU_TYPE text, MED_AMOUT number, PER_ACC_PAY number, OVE_PAY numb...
病患凤香馨使用的药品均低于3461.35元一共有多少记载在次医疗记录上?编号当时都是多少?
SELECT MED_CLINIC_ID FROM t_kc21 WHERE PERSON_NM = '凤香馨' AND NOT MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc22 WHERE AMOUNT >= 3461.35)
css
CREATE TABLE table_47684 ( "Rider" text, "Manufacturer" text, "Laps" text, "Time/Retired" text, "Grid" text )
WHAT IS THE RIDER WITH A 21 GRID?
SELECT "Rider" FROM table_47684 WHERE "Grid" = '21'
wikisql
CREATE TABLE table_12117 ( "Mininera DFL" text, "Wins" real, "Byes" real, "Losses" real, "Draws" real, "Against" real )
WHAT ARE THE BYES WITH A DRAWS OF 1, SMW ROVERS, AND WINS LARGER THAN 6?
SELECT AVG("Byes") FROM table_12117 WHERE "Draws" = '1' AND "Mininera DFL" = 'smw rovers' AND "Wins" > '6'
wikisql
CREATE TABLE table_name_58 ( score VARCHAR, opponent VARCHAR )
What Score has an Opponent of nina bratchikova?
SELECT score FROM table_name_58 WHERE opponent = "nina bratchikova"
sql_create_context
CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, country varchar, zip int ) CREATE TABLE comment_instructor ( instructor_id int, ...
Name the MDE courses for the EECS major ?
SELECT DISTINCT course.department, course.name, course.number FROM course, program_course WHERE course.department LIKE '%EECS%' AND program_course.category LIKE '%MDE%' AND program_course.course_id = course.course_id
advising
CREATE TABLE table_name_25 ( total INTEGER, player VARCHAR, challenge_cup VARCHAR )
What is the highest total of Player Damon Gray, with a Challenge Cup less than 0?
SELECT MAX(total) FROM table_name_25 WHERE player = "damon gray" AND challenge_cup < 0
sql_create_context
CREATE TABLE diagnoses ( 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 (...
provide the number of patients whose days of hospital stay is greater than 29 and drug name is lorazepam?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.days_stay > "29" AND prescriptions.drug = "Lorazepam"
mimicsql_data
CREATE TABLE table_204_313 ( id number, "date" text, "operation" text, "location" text, "type" text, "information" text )
how many months did operation maritime monitor last ?
SELECT "date" - "date" FROM table_204_313 WHERE "operation" = 'operation maritime monitor'
squall
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...
检验报告单76845212176与检验报告单63705425605中是否有检测指标名称相同?列出这些检测指标名称是什么?
SELECT jyjgzbb.JCZBMC FROM jyjgzbb WHERE jyjgzbb.BGDH = '76845212176' INTERSECT SELECT jyjgzbb.JCZBMC FROM jyjgzbb WHERE jyjgzbb.BGDH = '63705425605'
css
CREATE TABLE table_27756014_6 ( high_points VARCHAR, team VARCHAR )
Who scored the most points when the Bucks played against Houston?
SELECT high_points FROM table_27756014_6 WHERE team = "Houston"
sql_create_context
CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE airport ( airport_code varchar, airport_name text,...
what evening flights do you have available from BALTIMORE to PHILADELPHIA
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 = 'BALTIMORE' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PHI...
atis
CREATE TABLE table_1505809_2 ( locale VARCHAR, l VARCHAR )
Where is the Locale when L is 2.
SELECT locale FROM table_1505809_2 WHERE l = 2
sql_create_context
CREATE TABLE diagnoses ( 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 out the number of patients with copd exacerbation as their primary disease who died in or before 2158.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "COPD EXACERBATION" AND demographic.dod_year <= "2158.0"
mimicsql_data
CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) CREATE TABLE days ( days_code varchar, day_name varchar ) CREATE TABLE state ( state_code text, state...
can you please tell me the type of aircraft used flying from ATLANTA to DENVER on EA flight 825 leaving at 555
SELECT DISTINCT aircraft.aircraft_code FROM aircraft, airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, equipment_sequence, flight WHERE (((flight.departure_time = 555 AND flight.flight_number = 825) AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1....
atis
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...
列出在医院6643812中患者32609286入院科室名称不包含其它的有哪些住院就诊记录?
SELECT * 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 = '32609286' AND hz_info.YLJGDM = '6643812' AND NOT wdmzjzjlb.JZKSMC LIKE '%其它%' UNION SELECT * FROM hz_info JOIN bdmzjzjlb ON hz_info.YLJGDM = bdmzjzjlb.YLJGDM AND ...
css
CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Per...
Visualize a bar chart about the distribution of All_Games and All_Games_Percent , rank Y-axis in desc order.
SELECT All_Games, All_Games_Percent FROM basketball_match ORDER BY All_Games_Percent DESC
nvbench
CREATE TABLE table_52321 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
Which Away team has a Venue of arden street oval?
SELECT "Away team" FROM table_52321 WHERE "Venue" = 'arden street oval'
wikisql
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE lab ( labid number, pa...
what was the daily minimum intake of p.o. that patient 028-23341 had received until 12/05/2103?
SELECT MIN(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 = '028-23341')) AND intakeoutput.celllabel = 'p.o.'...
eicu
CREATE TABLE table_name_90 ( date_final VARCHAR, year VARCHAR )
What date final has 1989 as the year?
SELECT date_final FROM table_name_90 WHERE year = "1989"
sql_create_context
CREATE TABLE table_32926 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real )
What team did the Brows play against on October 20, 1963 to a crowd larger than 55,096?
SELECT "Opponent" FROM table_32926 WHERE "Attendance" > '55,096' AND "Date" = 'october 20, 1963'
wikisql
CREATE TABLE table_37856 ( "Rank" real, "Name" text, "Point" real, "Played" real, "Draw" real, "Lose" real, "Goal in" real, "Goal loss" real, "Goal diff" real )
What was the average rank of a player with more than 52 points, fewer than 10 draws, a goal loss under 44, and a loss under 15?
SELECT AVG("Rank") FROM table_37856 WHERE "Point" > '52' AND "Draw" < '10' AND "Goal loss" < '44' AND "Lose" < '15'
wikisql
CREATE TABLE table_23248420_1 ( county VARCHAR, region_province VARCHAR, rank VARCHAR )
When 20 is the rank and north west is the region/province what is the county?
SELECT county FROM table_23248420_1 WHERE region_province = "North West" AND rank = 20
sql_create_context
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 ...
what is drug type and drug code of drug name lopinavir-ritonavir?
SELECT prescriptions.drug_type, prescriptions.formulary_drug_cd FROM prescriptions WHERE prescriptions.drug = "Lopinavir-Ritonavir"
mimicsql_data
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...
find the number of patients with st elevated myocardial infarction/cardiac catheterization primary disease who have procedure icd9 code 2219.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.diagnosis = "ST ELEVATED MYOCARDIAL INFARCTION\CARDIAC CATH" AND procedures.icd9_code = "2219"
mimicsql_data
CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId number, Parent...
Highest upvote of question, answer.
SELECT P.Id AS "post_link", R.MaxScore, R.PostType FROM Posts AS P INNER JOIN (SELECT MAX(PO.Score) AS MaxScore, PT.Name AS PostType FROM Posts AS PO INNER JOIN PostTypes AS PT ON PT.Id = PO.PostTypeId AND PT.Id IN (1, 2) WHERE PO.DeletionDate IS NULL GROUP BY PT.Name) AS R ON R.MaxScore = P.Score
sede
CREATE TABLE table_203_491 ( id number, "year" number, "title" text, "us hot 100" number, "us modern rock" number, "us mainstream rock" number, "album" text )
how many singles were released after 2010 ?
SELECT COUNT("title") FROM table_203_491 WHERE "year" > 2010
squall
CREATE TABLE table_204_209 ( id number, "released" text, "title" text, "label" text, "number" text, "notes" text )
how many releases are there in all months of june ?
SELECT COUNT(*) FROM table_204_209 WHERE "released" = 6
squall
CREATE TABLE table_16912000_13 ( player VARCHAR, kr_avg VARCHAR )
Who's average is 24.8?
SELECT player FROM table_16912000_13 WHERE kr_avg = "24.8"
sql_create_context
CREATE TABLE grapes ( ID INTEGER, Grape TEXT, Color TEXT ) CREATE TABLE wine ( No INTEGER, Grape TEXT, Winery TEXT, Appelation TEXT, State TEXT, Name TEXT, Year INTEGER, Price INTEGER, Score INTEGER, Cases INTEGER, Drink TEXT ) CREATE TABLE appellations ( No...
Show me the trend aboutthe maximum score of wines for each year.
SELECT Year, MAX(Score) FROM wine GROUP BY Year
nvbench
CREATE TABLE table_78993 ( "Time" text, "Show Name" text, "Local/Networked" text, "Ad Freq" text, "News Freq" text )
What Time has Ad Freq of 15 minutes, and a Show Name of country today?
SELECT "Time" FROM table_78993 WHERE "Ad Freq" = '15 minutes' AND "Show Name" = 'country today'
wikisql
CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int ) CREATE TABLE days ( days_code varchar, day_name varchar...
what flights are there from DALLAS to PITTSBURGH on monday morning
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 (((flight.departure_time BETWEEN 0 AND 1200) AND date_day.day_number = 21 AND date_day.month_number = 2 AND date_day.year = 1991 AND days.day_nam...
atis
CREATE TABLE table_name_8 ( goals INTEGER, name VARCHAR )
Name the most goals for josep samitier
SELECT MAX(goals) FROM table_name_8 WHERE name = "josep samitier"
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...
陈玲玲这个病人在07年4月17到14年6月22日买过多少次西药
SELECT COUNT(*) FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_NM = '陈玲玲' AND t_kc22.STA_DATE BETWEEN '2007-04-17' AND '2014-06-22' AND t_kc22.MED_INV_ITEM_TYPE = '西药费'
css
CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) 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, insuranc...
what was the drug that until 28 months ago patient 26218 had been prescribed two times?
SELECT t1.drug FROM (SELECT prescriptions.drug, COUNT(prescriptions.startdate) AS c1 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 26218) AND DATETIME(prescriptions.startdate) <= DATETIME(CURRENT_TIME(), '-28 month') GROUP BY prescriptions.dru...
mimic_iii
CREATE TABLE table_18408 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text )
what's party with district being tennessee 3
SELECT "Party" FROM table_18408 WHERE "District" = 'Tennessee 3'
wikisql
CREATE TABLE person_info ( RYBH text, XBDM number, XBMC text, XM text, CSRQ time, CSD text, MZDM text, MZMC text, GJDM text, GJMC text, JGDM text, JGMC text, XLDM text, XLMC text, ZYLBDM text, ZYMC text ) CREATE TABLE zyjzjlb ( YLJGDM text, JZLSH ...
门诊就诊01359019093检验报告单开出了几份
SELECT COUNT(*) FROM jybgb WHERE JZLSH = '01359019093'
css
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 all employees who have the letters D or S in their first name, give me the trend about manager_id over hire_date , display HIRE_DATE from low to high order.
SELECT HIRE_DATE, MANAGER_ID FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY HIRE_DATE
nvbench
CREATE TABLE table_14571 ( "Year" real, "Venue" text, "Winner" text, "Country" text, "Score" text )
What is the Score, when the Year is after 2007, and when the Country is England?
SELECT "Score" FROM table_14571 WHERE "Year" > '2007' AND "Country" = 'england'
wikisql
CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varc...
For those employees who do not work in departments with managers that have ids between 100 and 200, draw a bar chart about the distribution of job_id and manager_id , list by the Y-axis from low to high please.
SELECT JOB_ID, MANAGER_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY MANAGER_ID
nvbench
CREATE TABLE table_21756039_1 ( maac VARCHAR, ncaa_seed VARCHAR, overall VARCHAR )
How many maac are there that have 14th as the ncaa and the overall is 20-10?
SELECT COUNT(maac) FROM table_21756039_1 WHERE ncaa_seed = "14th" AND overall = "20-10"
sql_create_context
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 swimmer ( ID int, name text, Nationality text, meter_100 real, meter_20...
What is the relationship between ID and meter_100 ?
SELECT ID, meter_100 FROM swimmer
nvbench
CREATE TABLE table_34659 ( "Year" real, "Class" text, "Team" text, "Points" real, "Wins" real )
Class of 125cc, and a Year smaller than 1966 had what lowest wins?
SELECT MIN("Wins") FROM table_34659 WHERE "Class" = '125cc' AND "Year" < '1966'
wikisql
CREATE TABLE table_204_654 ( id number, "year" number, "song" text, "u.s." number, "u.s.\nr&b" number, "u.s.\nac" number, "uk" number, "album" text )
what song hit the highest spot on the uk chart ?
SELECT "song" FROM table_204_654 ORDER BY "uk" LIMIT 1
squall
CREATE TABLE table_name_5 ( total_freshwater_withdrawal__km_3__yr_ INTEGER, industrial_use__m_3__p_yr__in__percentage_ VARCHAR, per_capita_withdrawal__m_3__p_yr_ VARCHAR )
What is the average Total Freshwater Withdrawal (km 3 /yr), when Industrial Use (m 3 /p/yr)(in %) is 337(63%), and when Per Capita Withdrawal (m 3 /p/yr) is greater than 535?
SELECT AVG(total_freshwater_withdrawal__km_3__yr_) FROM table_name_5 WHERE industrial_use__m_3__p_yr__in__percentage_ = "337(63%)" AND per_capita_withdrawal__m_3__p_yr_ > 535
sql_create_context
CREATE TABLE table_32371 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What venue has the away side scoring 15.23 (113)?
SELECT "Venue" FROM table_32371 WHERE "Away team score" = '15.23 (113)'
wikisql
CREATE TABLE table_74946 ( "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's the losing bonus of Crumlin RFC?
SELECT "Losing bonus" FROM table_74946 WHERE "Club" = 'crumlin rfc'
wikisql
CREATE TABLE course ( course_id text, title text, dept_name text, credits number ) CREATE TABLE section ( course_id text, sec_id text, semester text, year number, building text, room_number text, time_slot_id text ) CREATE TABLE department ( dept_name text, building...
Give id of the instructor who advises students in the History department.
SELECT i_id FROM advisor AS T1 JOIN student AS T2 ON T1.s_id = T2.id WHERE T2.dept_name = 'History'
spider
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 ...
病人韩飞烟在医疗机构8914725的门诊就诊过多少次?在2010-09-30到2019-07-07的这几年里
SELECT COUNT(*) FROM person_info JOIN hz_info JOIN mzjzjlb 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 WHERE person_info.XM = '韩飞烟' AND mzjzjlb.JZKSRQ BETWEEN '2010-09-30' AND '2019-07-07' AND mzjzjlb.YLJGDM = '8914725'
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...
列出患者吴兰若的检验报告单日期在2008年7月26日之后所对应的门诊就诊的流水号
SELECT mzjzjlb.JZLSH FROM person_info JOIN hz_info JOIN mzjzjlb 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 WHERE person_info.XM = '吴兰若' AND NOT mzjzjlb.JZLSH IN (SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ <= '2008-07-26')
css
CREATE TABLE table_name_1 ( game VARCHAR, date VARCHAR )
Date of wed. nov. 13 had how many number of games?
SELECT COUNT(game) FROM table_name_1 WHERE date = "wed. nov. 13"
sql_create_context
CREATE TABLE hz_info ( KH text, KLX number, YLJGDM text, RYBH text ) CREATE TABLE zyjzjlb ( YLJGDM text, JZLSH text, MZJZLSH text, KH text, KLX number, HZXM text, WDBZ number, RYDJSJ time, RYTJDM number, RYTJMC text, JZKSDM text, JZKSMC text, RZBQDM t...
从零七年到八月十一日之后,查查医疗机构7743304的住院就诊记录中入院登记有多少
SELECT COUNT(*) FROM zyjzjlb WHERE YLJGDM = '7743304' AND RYDJSJ > '2007-08-11'
css
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 female patients had a thyroxine (t4) lab test done?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.gender = "F" AND lab.label = "Thyroxine (T4)"
mimicsql_data
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...
在2016年3月3日到2017年3月19日这段时间里,统计医院7038262的科室0541涉及的医疗费一共是多少钱?
SELECT SUM(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '7038262' AND t_kc21.MED_ORG_DEPT_CD = '0541') AND t_kc24.CLINIC_SLT_DATE BETWEEN '2016-03-03' AND '2017-03-19'
css
CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Percent text, ACC_Home text, ACC_Road text, All_Games text, All_Games_Percent int, All_Home text, All_Road text, All_Neutral text ) CREATE TABLE university ( Scho...
Give me the comparison about All_Games_Percent over the All_Neutral by a bar chart, and rank total number in ascending order.
SELECT All_Neutral, All_Games_Percent FROM basketball_match ORDER BY All_Games_Percent
nvbench
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
what is the maximum age of male patients who stayed in hospital for 5 days?
SELECT MAX(demographic.age) FROM demographic WHERE demographic.gender = "M" AND demographic.days_stay = "5"
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 patients primarily have bowel obstruction and were admitted before the year 2203?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "BOWEL OBSTRUCTION" AND demographic.admityear < "2203"
mimicsql_data
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE vitalperiodic ( ...
list the top three most frequently prescribed drugs that patients were prescribed with in the same hospital encounter after they were prescribed with 10 ml vial : insulin glargine 100 unit/ml sc soln.
SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, medication.drugstarttime, patient.patienthealthsystemstayid FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE medication.drugname = '10 ml vial : ins...
eicu
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
how many patients had gentamicin lab test?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.label = "Gentamicin"
mimicsql_data
CREATE TABLE table_43025 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" text )
How many people attended the game in week 13?
SELECT "Attendance" FROM table_43025 WHERE "Week" = '13'
wikisql
CREATE TABLE aircraft ( aircraft_code varchar, aircraft_description varchar, manufacturer varchar, basic_type varchar, engines int, propulsion varchar, wide_body varchar, wing_span int, length int, weight int, capacity int, pay_load int, cruising_speed int, range_...
what flight from DENVER to PITTSBURGH arrives earliest in the morning
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 = 'PITTSBURGH' AND flight.arrival_time = (SELECT MIN(FLIGHTalias1.arrival_time) FROM airport...
atis
CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, Deletio...
My Highest Rated Comments with CreationDate.
SELECT PostId AS "post_link", Score, Text, CreationDate FROM Comments WHERE UserId = '##UserId##' ORDER BY Score DESC LIMIT 250
sede
CREATE TABLE table_2562572_39 ( cyrillic_name_other_names VARCHAR, population__2011_ VARCHAR )
What town has the population of 777?
SELECT cyrillic_name_other_names FROM table_2562572_39 WHERE population__2011_ = "777"
sql_create_context
CREATE TABLE table_68383 ( "Rank" real, "Lane" real, "Name" text, "Nationality" text, "Time" text )
What is the rank of the swimmer named Petria Thomas?
SELECT "Rank" FROM table_68383 WHERE "Name" = 'petria thomas'
wikisql
CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE student ( student_id int, lastname varchar, firstname varchar, program_id int, declare_major varchar, total_credit int, total...
If you compared EECS 453 and EECS 592 , which would you consider to be least difficult ?
SELECT DISTINCT course.number FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE (course.number = 453 OR course.number = 592) AND program_course.workload = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM program_course AS PROGRAM_COURSEalias1 INNER JOIN course AS COURSEalias1 ON ...
advising
CREATE TABLE hz_info ( KH text, KLX number, YLJGDM text ) 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 num...
医院2158634里面就诊的病患60094518在出院的时候科室名称中没有与的住院就诊记录是哪几条?
SELECT * FROM hz_info JOIN zyjzjlb JOIN person_info_hz_info JOIN person_info ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX AND person_info_hz_info.KH = hz_info.KH AND person_info_hz_info.KLX = hz_info.KLX AND person_info_hz_info.YLJGDM = hz_info.YLJGDM AND person_info_hz_i...
css
CREATE TABLE table_204_644 ( id number, "week" number, "date" text, "opponent" text, "result" text, "record" text, "game site" text, "bye" text )
who was the opponent previous to the south georgia wildcats ?
SELECT "opponent" FROM table_204_644 WHERE "date" < (SELECT "date" FROM table_204_644 WHERE "opponent" = 'south georgia wildcats') ORDER BY "date" DESC LIMIT 1
squall
CREATE TABLE table_18946749_1 ( country VARCHAR, col__m_ VARCHAR )
When 44 is the col in meters what is the country?
SELECT country FROM table_18946749_1 WHERE col__m_ = 44
sql_create_context