context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_203_758 ( id number, "no." number, "dub no." number, "english dubbed title / english subbed title\noriginal japanese title" text, "original air date" text, "english air date" text )
episodes have been dubbed ?
SELECT COUNT(DISTINCT "dub no.") FROM table_203_758
squall
CREATE TABLE table_name_92 ( college_junior_club_team__league_ VARCHAR, nationality VARCHAR )
Which College/Junior/Club Team (League) are from sweden?
SELECT college_junior_club_team__league_ FROM table_name_92 WHERE nationality = "sweden"
sql_create_context
CREATE TABLE table_75024 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" text, "Record" text )
Attendance of 30,335 had what record?
SELECT "Record" FROM table_75024 WHERE "Attendance" = '30,335'
wikisql
CREATE TABLE table_14983 ( "Ensemble" text, "Gold Medals" real, "Silver Medals" real, "Bronze Medals" real, "Total Medals" real )
What is the lowest amount of bronze medals won by Music City Mystique where they won more than 3 gold medals and less than 15 total medals?
SELECT MIN("Bronze Medals") FROM table_14983 WHERE "Gold Medals" > '3' AND "Ensemble" = 'music city mystique' AND "Total Medals" < '15'
wikisql
CREATE TABLE table_7168 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
What is High Points, when Team is @ Phoenix?
SELECT "High points" FROM table_7168 WHERE "Team" = '@ phoenix'
wikisql
CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) 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 ...
FIRST class from DETROIT to ST. PETERSBURG
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, fare_basis, flight, flight_fare WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'ST. PETERSBURG' AND fare_basis.class_type = 'FIRST' AND fa...
atis
CREATE TABLE table_name_48 ( result VARCHAR, date VARCHAR )
What was the result on October 4, 1993?
SELECT result FROM table_name_48 WHERE date = "october 4, 1993"
sql_create_context
CREATE TABLE area ( course_id int, area varchar ) CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE p...
Next Winter who is teaching MDE classes ?
SELECT DISTINCT instructor.name FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester INNER JOIN program_course ON program_course.course_id = course_offering.course_id INNER JOIN offering_instructor ON offering_instr...
advising
CREATE TABLE table_67634 ( "Name" text, "Years" text, "Gender" text, "Area" text, "Authority" text, "Decile" real, "Roll" real )
Which name has a Roll of 270?
SELECT "Name" FROM table_67634 WHERE "Roll" = '270'
wikisql
CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE d_icd_diagnoses ( row_id n...
what are the four most frequent medications that people were prescribed with within 2 months after being prescribed with divalproex sod. sprinkles the last year?
SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'divalproex sod. sprinkles' AND DATETIME(prescriptions.startdate, ...
mimic_iii
CREATE TABLE table_28223 ( "Region" text, "Land area (km 2 )" text, "Rainfall by depth (mm/year)" real, "Rainfall by volume (km 3 /year)" text, "Surface run off (km 3 /year)" text, "Infiltration (km 3 /year)" text, "Evapotranspiration (km 3 /year)" text )
In the region where the rainfall by volume (km 3 /year) was 13.2, what was the evapotranspiration (km 3 /year)?
SELECT "Evapotranspiration (km 3 /year)" FROM table_28223 WHERE "Rainfall by volume (km 3 /year)" = '13.2'
wikisql
CREATE TABLE table_18600760_15 ( longitude VARCHAR, latitude VARCHAR )
What is the longitude with a latitude of 47.985154?
SELECT longitude FROM table_18600760_15 WHERE latitude = "47.985154"
sql_create_context
CREATE TABLE table_50885 ( "Player" text, "Country" text, "Year(s) won" text, "Total" real, "To par" text, "Finish" text )
Which Year(s) won has a Total smaller than 285, and a Player of tom watson?
SELECT "Year(s) won" FROM table_50885 WHERE "Total" < '285' AND "Player" = 'tom watson'
wikisql
CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE transfers ( row_id number, subject_id number, ...
patient 8116's sao2 on the current intensive care unit visit was normal?
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 = 8116) AND icustays.outtime IS NULL) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_item...
mimic_iii
CREATE TABLE table_36774 ( "Rank" real, "Name" text, "Nationality" text, "1st (m)" real, "2nd (m)" real, "Points" real, "Overall FHT points" text, "Overall WC points (Rank)" text )
What is the rank that has a 1st less than 132.5 and a Fin nationality.
SELECT "Overall WC points (Rank)" FROM table_36774 WHERE "1st (m)" < '132.5' AND "Nationality" = 'fin'
wikisql
CREATE TABLE table_name_74 ( draws INTEGER, goals_conceded VARCHAR, games_played VARCHAR )
What is the most draws when less than 154 goals were conceded, and less than 36 games played?
SELECT MAX(draws) FROM table_name_74 WHERE goals_conceded < 154 AND games_played < 36
sql_create_context
CREATE TABLE table_52357 ( "Region" text, "Date" text, "Label" text, "Format" text, "Catalogue" text )
Which label had a Japan region and a date of November 3, 2004?
SELECT "Label" FROM table_52357 WHERE "Region" = 'japan' AND "Date" = 'november 3, 2004'
wikisql
CREATE TABLE table_23390604_1 ( mir_hossein_mousavi INTEGER, mohsen_rezaee VARCHAR )
Display the lowest score for candidate Mir-Hossein Mousavi when candidate Mohsen Rezaee scored 44809 votes
SELECT MIN(mir_hossein_mousavi) FROM table_23390604_1 WHERE mohsen_rezaee = 44809
sql_create_context
CREATE TABLE table_35316 ( "Player" text, "Attempts" real, "Net yards" real, "Yards per attempt" real, "Touchdowns" real )
What are the highest attempts that have net yards less than 631, and 2 for the touchdowns?
SELECT MAX("Attempts") FROM table_35316 WHERE "Net yards" < '631' AND "Touchdowns" = '2'
wikisql
CREATE TABLE resultsdata15 ( sample_pk number, commod text, commtype text, lab text, pestcode text, testclass text, concen number, lod number, conunit text, confmethod text, confmethod2 text, annotate text, quantitate text, mean text, extract text, determi...
What kind of food has been test the most?
SELECT MAX(commod) FROM resultsdata15
pesticide
CREATE TABLE table_50222 ( "Date" text, "Opponent#" text, "Rank #" text, "Site" text, "Result" text, "Attendance" text )
How many were in attendance when they played vs. 12 Stanford?
SELECT "Attendance" FROM table_50222 WHERE "Opponent#" = 'vs. 12 stanford'
wikisql
CREATE TABLE table_26200568_16 ( losses VARCHAR, club VARCHAR )
How many losses does Toronto Downtown Dingos have?
SELECT losses FROM table_26200568_16 WHERE club = "Toronto Downtown Dingos"
sql_create_context
CREATE TABLE table_68992 ( "Material" text, "Resistivity (10 \u22126 ohm-inches)" real, "Relative permeability" real, "Skin depth, inches" real, "Surface resistance, Relative to copper" real )
What is the lowest relative permeability with a skin depth larger than 0.112 inches?
SELECT MIN("Relative permeability") FROM table_68992 WHERE "Skin depth, inches" > '0.112'
wikisql
CREATE TABLE table_name_2 ( name VARCHAR, winning_driver VARCHAR )
Which Grand Prix did Nello Pagani win?
SELECT name FROM table_name_2 WHERE winning_driver = "nello pagani"
sql_create_context
CREATE TABLE personfriend ( name text, friend text, year number ) CREATE TABLE person ( name text, age number, city text, gender text, job text )
What is the name of the person who is the oldest?
SELECT name FROM person WHERE age = (SELECT MAX(age) FROM person)
spider
CREATE TABLE student ( stuid number, lname text, fname text, age number, sex text, major number, advisor number, city_code text ) CREATE TABLE faculty_participates_in ( facid number, actid number ) CREATE TABLE faculty ( facid number, lname text, fname text, ran...
Give me the the first and last name of the faculty who advises the most students.
SELECT T1.fname, T1.lname FROM faculty AS T1 JOIN student AS T2 ON T1.facid = T2.advisor GROUP BY T1.facid ORDER BY COUNT(*) DESC LIMIT 1
spider
CREATE TABLE table_name_38 ( bonus_points VARCHAR, club VARCHAR )
What number of bonus points did Stade Fran ais?
SELECT bonus_points FROM table_name_38 WHERE club = "stade français"
sql_create_context
CREATE TABLE field ( fieldid int ) CREATE TABLE paper ( paperid int, title varchar, venueid int, year int, numciting int, numcitedby int, journalid int ) CREATE TABLE dataset ( datasetid int, datasetname varchar ) CREATE TABLE paperkeyphrase ( paperid int, keyphraseid ...
does ras bodik publish a lot ?
SELECT COUNT(paper.paperid) FROM author, paper, writes WHERE author.authorname = 'ras bodik' AND writes.authorid = author.authorid AND writes.paperid = paper.paperid
scholar
CREATE TABLE table_19992 ( "Condition/Parameter" text, "Coordinate velocity v dx/dt in units of c" text, "Velocity angle \u03b7 in i-radians" text, "Proper velocity w dx/d\u03c4 in units of c" text, "Lorentz factor \u03b3 dt/d\u03c4 = E/mc 2" text )
What is the coordinate velocity v dx/dt in units of c total number if the velocity angle in i-radians is ln[2 + 5] 1.444?
SELECT COUNT("Coordinate velocity v dx/dt in units of c") FROM table_19992 WHERE "Velocity angle \u03b7 in i-radians" = 'ln[2 + √5] ≅ 1.444'
wikisql
CREATE TABLE table_name_90 ( line_name VARCHAR, nimt_junction VARCHAR )
What Line has Ohakune Junction as its NIMT?
SELECT line_name FROM table_name_90 WHERE nimt_junction = "ohakune junction"
sql_create_context
CREATE TABLE table_name_25 ( week VARCHAR, opponent VARCHAR )
What is the total number of weeks that the Giants played against the Dallas Cowboys?
SELECT COUNT(week) FROM table_name_25 WHERE opponent = "dallas cowboys"
sql_create_context
CREATE TABLE table_name_24 ( home_team VARCHAR, away_team VARCHAR )
What was the home team score for the game played against Collingwood?
SELECT home_team AS score FROM table_name_24 WHERE away_team = "collingwood"
sql_create_context
CREATE TABLE table_78487 ( "Driver" text, "Constructor" text, "Laps" text, "Time/Retired" text, "Grid" text )
How many laps does jean-christophe boullion have with a time/retired of +1 lap?
SELECT "Laps" FROM table_78487 WHERE "Time/Retired" = '+1 lap' AND "Driver" = 'jean-christophe boullion'
wikisql
CREATE TABLE table_name_63 ( game INTEGER, opponent VARCHAR, february VARCHAR )
How many games have the New York Islanders as an opponent before February 7?
SELECT SUM(game) FROM table_name_63 WHERE opponent = "new york islanders" AND february < 7
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 diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions...
how many patients whose diagnoses icd9 code is 57450?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.icd9_code = "57450"
mimicsql_data
CREATE TABLE table_27361255_1 ( primary_conference VARCHAR, location VARCHAR )
How many primary conferences were held in Allendale, Michigan?
SELECT COUNT(primary_conference) FROM table_27361255_1 WHERE location = "Allendale, Michigan"
sql_create_context
CREATE TABLE table_65461 ( "Pick" real, "Team" text, "Player" text, "Position" text, "College" text )
What pick number did the linebacker from the denver broncos get?
SELECT "Pick" FROM table_65461 WHERE "Position" = 'linebacker' AND "Team" = 'denver broncos'
wikisql
CREATE TABLE table_61348 ( "Home (1st leg)" text, "Home (2nd leg)" text, "1st Leg" text, "2nd leg" text, "Aggregate" text )
What was the score on the first leg when gimnasia de mendoza played at home for the second leg?
SELECT "1st Leg" FROM table_61348 WHERE "Home (2nd leg)" = 'gimnasia de mendoza'
wikisql
CREATE TABLE table_name_26 ( record VARCHAR, event VARCHAR )
What was strikeforce: barnett vs. cormier's record?
SELECT record FROM table_name_26 WHERE event = "strikeforce: barnett vs. cormier"
sql_create_context
CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description ...
Has the most questions, but never accepted anything.
SELECT OwnerUserId AS UserId, OwnerUserId AS "user_link", COUNT(*) AS AllQ FROM Posts WHERE PostTypeId = 1 AND OwnerUserId > 0 GROUP BY OwnerUserId HAVING COUNT(AcceptedAnswerId) = 0 ORDER BY AllQ DESC, UserId LIMIT 100
sede
CREATE TABLE table_1205598_1 ( nhl_team_s_ VARCHAR, media_market_ranking VARCHAR )
What is the NHL team in the media market ranking number 7?
SELECT nhl_team_s_ FROM table_1205598_1 WHERE media_market_ranking = 7
sql_create_context
CREATE TABLE table_1589 ( "Character" text, "Indianapolis Concerts" text, "Sarasota" text, "Broadway" text, "Brighton Cast" text )
Name the sarasota samantha sharpe
SELECT "Sarasota" FROM table_1589 WHERE "Indianapolis Concerts" = 'Samantha Sharpe'
wikisql
CREATE TABLE table_59193 ( "Code" real, "Municipality" text, "County" text, "Population" real, "Total area" text, "Density (per km 2 land)" real )
Which municipality has the code 2401?
SELECT "Municipality" FROM table_59193 WHERE "Code" = '2401'
wikisql
CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE course_tags_count ( course_id int, clear_grading int, pop_quiz int, group_projects int, inspirational int, long_lectures int, extra_credit int, few_tests int, good_feedback int, tough_tests int, ...
Name the courses that count as upper level electives .
SELECT DISTINCT course.department, course.name, course.number FROM course, program_course WHERE program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id
advising
CREATE TABLE people ( Name VARCHAR, People_ID VARCHAR, Height VARCHAR ) CREATE TABLE gymnast ( Gymnast_ID VARCHAR )
List the names of gymnasts in ascending order by their heights.
SELECT T2.Name FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID ORDER BY T2.Height
sql_create_context
CREATE TABLE Customer_Events ( Customer_Event_ID INTEGER, customer_id INTEGER, date_moved_in DATETIME, property_id INTEGER, resident_id INTEGER, thing_id INTEGER ) CREATE TABLE Properties ( property_id INTEGER, property_type_code CHAR(15), property_address VARCHAR(255), other_de...
Just list the resident id and details in a bar chart, rank in descending by the bars.
SELECT other_details, resident_id FROM Residents ORDER BY other_details DESC
nvbench
CREATE TABLE table_1566852_4 ( date VARCHAR, centerfold_model VARCHAR )
On what deate was the centerfold featured Luci Victoria?
SELECT date FROM table_1566852_4 WHERE centerfold_model = "Luci Victoria"
sql_create_context
CREATE TABLE table_name_43 ( grid INTEGER, time VARCHAR, laps VARCHAR )
What is the smallest grid when the time is +8.051 and there were less than 23 laps?
SELECT MIN(grid) FROM table_name_43 WHERE time = "+8.051" AND laps < 23
sql_create_context
CREATE TABLE table_42647 ( "Tournament" text, "2002" text, "2003" text, "2004" text, "2005" text, "2006" text, "2007" text, "2008" text, "2009" text, "2010" text, "2011" text, "2012" text )
What is the 2005 when the 2008 shows grand slam tournaments?
SELECT "2005" FROM table_42647 WHERE "2008" = 'grand slam tournaments'
wikisql
CREATE TABLE table_26131768_4 ( residence VARCHAR, representative VARCHAR )
How many times was Scott Oelslager a representative?
SELECT COUNT(residence) FROM table_26131768_4 WHERE representative = "Scott Oelslager"
sql_create_context
CREATE TABLE t_kc21 ( MED_CLINIC_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, COMP_ID text, PERSON_ID text, PERSON_NM text, IDENTITY_CARD text, SOC_SRT_CARD text, PERSON_SEX number, PERSON_AGE number, IN_HOSP_DATE time, OUT_HOSP_DATE time, DIFF_PLACE_FLG numb...
根据出院诊断的不同以及科室的不同计算出0101657这家医院全部医疗就诊的记录里患者就诊的平均岁数是多少,把里面平均岁数超过23岁的记录留下来
SELECT MED_ORG_DEPT_NM, OUT_DIAG_DIS_NM, AVG(PERSON_AGE) FROM t_kc21 WHERE MED_SER_ORG_NO = '0101657' GROUP BY MED_ORG_DEPT_NM, OUT_DIAG_DIS_NM HAVING AVG(PERSON_AGE) > 23
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_Neutral and Team_ID , and I want to list by the x axis from high to low please.
SELECT All_Neutral, Team_ID FROM basketball_match ORDER BY All_Neutral DESC
nvbench
CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, ...
tell me the monthly maximum heartrate of patient 011-12267.
SELECT MAX(vitalperiodic.heartrate) FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '011-12267')) AND NOT vitalperiodic.heartrate IS NULL...
eicu
CREATE TABLE table_name_68 ( loss VARCHAR, date VARCHAR )
Who did they lose to on May 20?
SELECT loss FROM table_name_68 WHERE date = "may 20"
sql_create_context
CREATE TABLE table_name_64 ( stations VARCHAR, city VARCHAR )
Which Stations are in vancouver, bc?
SELECT stations FROM table_name_64 WHERE city = "vancouver, bc"
sql_create_context
CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type t...
when is the birth date of patient 61527?
SELECT patients.dob FROM patients WHERE patients.subject_id = 61527
mimic_iii
CREATE TABLE Orders ( order_id INTEGER, customer_id INTEGER, date_order_placed DATETIME, order_details VARCHAR(255) ) CREATE TABLE Product_Categories ( production_type_code VARCHAR(15), product_type_description VARCHAR(80), vat_rating DECIMAL(19,4) ) CREATE TABLE Order_Items ( order_it...
Show the number of accounts for all accounts by the customer with first name 'Meaghan' opened in each day Bin the account open day by year interval in a bar chart, list in desc by the x axis.
SELECT date_account_opened, COUNT(date_account_opened) FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.customer_first_name = 'Meaghan' ORDER BY date_account_opened DESC
nvbench
CREATE TABLE professor ( emp_num number, dept_code text, prof_office text, prof_extension text, prof_high_degree text ) CREATE TABLE enroll ( class_code text, stu_num number, enroll_grade text ) CREATE TABLE course ( crs_code text, dept_code text, crs_description text, ...
How many professors are teaching class with code ACCT-211?
SELECT COUNT(DISTINCT prof_num) FROM class WHERE crs_code = "ACCT-211"
spider
CREATE TABLE table_43516 ( "Name" text, "Team" text, "Qual 1" text, "Qual 2" text, "Best" text )
Who is the driver for the Forsythe Racing team that has the best time of 1:00.099?
SELECT "Name" FROM table_43516 WHERE "Team" = 'forsythe racing' AND "Best" = '1:00.099'
wikisql
CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod...
what are the four most frequent drugs prescribed to male patients aged 50s within the same hospital visit after being diagnosed with urin tract infection nos in this year?
SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime, admissions.hadm_id FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_...
mimic_iii
CREATE TABLE table_53491 ( "Pick" real, "Round" text, "Player" text, "Position" text, "School" text )
What position did the person from Clemson school fill?
SELECT "Position" FROM table_53491 WHERE "School" = 'clemson'
wikisql
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_CLINIC_ID text, MED_DIRE_CD tex...
病人07564193之前做的检查有哪些
SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM qtb JOIN t_kc22 ON qtb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE qtb.PERSON_ID = '07564193' AND t_kc22.MED_INV_ITEM_TYPE = '检查费' UNION SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM gyb JOIN t_kc22 ON gyb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE ...
css
CREATE TABLE txmzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH number, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZ...
以前患者07290816有过什么异常情况吗?
SELECT * FROM hz_info JOIN txmzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX AND txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE hz_i...
css
CREATE TABLE table_name_71 ( artist VARCHAR, year VARCHAR )
What artist was released in 2005?
SELECT artist FROM table_name_71 WHERE year = 2005
sql_create_context
CREATE TABLE artist ( artist_id number, artist text, age number, famous_title text, famous_release_date text ) CREATE TABLE music_festival ( id number, music_festival text, date_of_ceremony text, category text, volume number, result text ) CREATE TABLE volume ( volume_i...
What are the ages of all music artists?
SELECT age FROM artist
spider
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 hz_info ( KH text, KLX number...
患者任同和的地高辛情况在05年7月20日到2016年2月21日内啥样?
SELECT * FROM person_info JOIN hz_info JOIN mzjzjlb JOIN zyjybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB AND zyjybgb.YLJGDM = jyjgzb...
css
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 products with a price between 60 and 120, return a scatter chart about the correlation between code and price , and group by attribute name.
SELECT Code, Price FROM Products WHERE Price BETWEEN 60 AND 120 GROUP BY Name
nvbench
CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE course ( course_id int, name varchar, department varchar, number varchar, credits varchar, advisory_requirement varchar, enforced_requirement varchar, ...
Show me CS-LSA degree requirements .
SELECT DISTINCT program_requirement.additional_req, program_requirement.category, program_requirement.min_credit, program.name FROM program, program_requirement WHERE program.name LIKE '%CS-LSA%' AND program.program_id = program_requirement.program_id
advising
CREATE TABLE table_name_2 ( prize VARCHAR, rank VARCHAR )
What is Prize, when Rank is '2nd'?
SELECT prize FROM table_name_2 WHERE rank = "2nd"
sql_create_context
CREATE TABLE table_37288 ( "Title" text, "Publisher" text, "Developer" text, "Release date" text, "ESRB" text )
When Did Microsoft Game Studios release Amped: Freestyle Snowboarding?
SELECT "Release date" FROM table_37288 WHERE "Publisher" = 'microsoft game studios' AND "Title" = 'amped: freestyle snowboarding'
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 bdmzjzjlb ( CYBQDM text, CYBQ...
在03年3月23日到15年11月12日之间病患55566777的洋地黄情况是怎么样的?
SELECT * 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.BGDH WHERE hz_info.RYBH = '...
css
CREATE TABLE table_69888 ( "Club" text, "Played" text, "Drawn" text, "Lost" text, "Try BP" text, "Losing BP" text )
Can you tell me the Club that has the Lost of 19?
SELECT "Club" FROM table_69888 WHERE "Lost" = '19'
wikisql
CREATE TABLE table_12087 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text, "Money ( $ )" real )
Can you tell me the Country that has the Score of 69-72-67-71=279?
SELECT "Country" FROM table_12087 WHERE "Score" = '69-72-67-71=279'
wikisql
CREATE TABLE table_24538140_2 ( match2 INTEGER, match4 VARCHAR, total VARCHAR )
What is the highest score for match 2 where the score for match 4 is 0 and the total score is 5?
SELECT MAX(match2) FROM table_24538140_2 WHERE match4 = 0 AND total = 5
sql_create_context
CREATE TABLE campuses ( campus VARCHAR, county VARCHAR, YEAR VARCHAR )
Which university is in Los Angeles county and opened after 1950?
SELECT campus FROM campuses WHERE county = "Los Angeles" AND YEAR > 1950
sql_create_context
CREATE TABLE ENROLL ( CLASS_CODE varchar(5), STU_NUM int, ENROLL_GRADE varchar(50) ) CREATE TABLE EMPLOYEE ( EMP_NUM int, EMP_LNAME varchar(15), EMP_FNAME varchar(12), EMP_INITIAL varchar(1), EMP_JOBCODE varchar(5), EMP_HIREDATE datetime, EMP_DOB datetime ) CREATE TABLE CLASS (...
Show the number of courses for each instructor in a bar chart, and list x-axis from low to high order.
SELECT EMP_FNAME, COUNT(EMP_FNAME) FROM CLASS AS T1 JOIN EMPLOYEE AS T2 ON T1.PROF_NUM = T2.EMP_NUM JOIN COURSE AS T3 ON T1.CRS_CODE = T3.CRS_CODE JOIN PROFESSOR AS T4 ON T2.EMP_NUM = T4.EMP_NUM GROUP BY EMP_FNAME ORDER BY EMP_FNAME
nvbench
CREATE TABLE table_53585 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Series" text )
What's the sum of the games that had paul (9) for high assists?
SELECT SUM("Game") FROM table_53585 WHERE "High assists" = 'paul (9)'
wikisql
CREATE TABLE head ( head_ID int, name text, born_state text, age real ) CREATE TABLE management ( department_ID int, head_ID int, temporary_acting text ) CREATE TABLE department ( Department_ID int, Name text, Creation text, Ranking int, Budget_in_Billions real, Num...
Show the name and number of employees for the departments managed by heads whose temporary acting value is 'Yes' with a bar chart, order from high to low by the names.
SELECT Name, SUM(Num_Employees) FROM department AS T1 JOIN management AS T2 ON T1.department_ID = T2.department_ID WHERE T2.temporary_acting = 'Yes' GROUP BY Name ORDER BY Name DESC
nvbench
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 ...
检测指标名称与检测指标结果定量单位和编号为22948782140的检验指标记录完全一样,且检测指标结果定量和这个检验指标记录都不一样的都是什么地方?
SELECT * FROM jyjgzbb WHERE jyjgzbb.JCZBMC = (SELECT jyjgzbb.JCZBMC FROM jyjgzbb WHERE jyjgzbb.JYZBLSH = '22948782140') AND jyjgzbb.JCZBJGDW = (SELECT jyjgzbb.JCZBJGDW FROM jyjgzbb WHERE jyjgzbb.JYZBLSH = '22948782140') AND jyjgzbb.JCZBJGDL <> (SELECT jyjgzbb.JCZBJGDL FROM jyjgzbb WHERE jyjgzbb.JYZBLSH = '22948782140')
css
CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number,...
what the first height of patient 28443 during this month.
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 = 28443)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'admit ht'...
mimic_iii
CREATE TABLE table_18794 ( "Season" real, "Premiers" text, "Runners Up" text, "Score" text, "Captain" text, "Coach" text, "Simpson Medal" text, "Venue" text, "Attendance" real, "Umpires" text )
Who were the umpires when Paul Medhurst (C) won the Simpson Medal?
SELECT "Umpires" FROM table_18794 WHERE "Simpson Medal" = 'Paul Medhurst (C)'
wikisql
CREATE TABLE table_name_60 ( points_against VARCHAR, drawn VARCHAR, points VARCHAR )
How many points were scored against the club that drew 3 and scored 50 points?
SELECT points_against FROM table_name_60 WHERE drawn = "3" AND points = "50"
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...
what is the number of patients under the age of 86 whose drug code is levobase2?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "86" AND prescriptions.formulary_drug_cd = "LEVOBASE2"
mimicsql_data
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...
Find out the type of admission and death status of the patient with patient id 18372.
SELECT demographic.admission_type, demographic.expire_flag FROM demographic WHERE demographic.subject_id = "18372"
mimicsql_data
CREATE TABLE table_72837 ( "Country" text, "Skip" text, "W" real, "L" real, "PF" real, "PA" real, "Ends Won" real, "Ends Lost" real, "Blank Ends" real, "Stolen Ends" real, "Shot %" real )
Andrea Sch pp is the skip of which country?
SELECT "Country" FROM table_72837 WHERE "Skip" = 'Andrea Schöpp'
wikisql
CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, ...
what are the five most frequent lab tests that were performed in the same hospital encounter after being diagnosed with aspergillosis since 1 year ago?
SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT t3.itemid FROM (SELECT t2.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime, admissions.hadm_id FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id W...
mimic_iii
CREATE TABLE table_name_92 ( space_crusade VARCHAR, genestealers VARCHAR )
Name the space crusade which has Genestealers of genr vere (gene robbers)
SELECT space_crusade FROM table_name_92 WHERE genestealers = "genrøvere (gene robbers)"
sql_create_context
CREATE TABLE table_46748 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text )
What is the To par of the T4 Place Player with a Score of 72-69-73=214?
SELECT "To par" FROM table_46748 WHERE "Place" = 't4' AND "Score" = '72-69-73=214'
wikisql
CREATE TABLE paperfield ( fieldid int, paperid int ) CREATE TABLE paperkeyphrase ( paperid int, keyphraseid int ) CREATE TABLE journal ( journalid int, journalname varchar ) CREATE TABLE author ( authorid int, authorname varchar ) CREATE TABLE field ( fieldid int ) CREATE TABLE ...
What is the paper with the most citation about AlexNet ?
SELECT DISTINCT cite.citedpaperid, COUNT(cite.citingpaperid) FROM cite, keyphrase, paper, paperkeyphrase WHERE keyphrase.keyphrasename = 'AlexNet' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = cite.citedpaperid AND paper.paperid = paperkeyphrase.paperid GROUP BY cite.citedpaperid ORDER BY C...
scholar
CREATE TABLE t_kc22 ( MED_EXP_DET_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, MED_EXP_BILL_ID text, SOC_SRT_DIRE_CD text, SOC_SRT_DIRE_NM text, DIRE_TYPE number, CHA_ITEM_LEV number, MED_INV_ITEM_TYPE text, MED_DIRE_CD text, MED_DIRE_NM text,...
邹高峻这个病人在哪几次医疗记录中被开出过不超过3531.29元的药品金额?医疗就诊编号是多少
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 > 3531.29)
css
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...
编号为4821131的这个医院的医疗记录中,出院诊断为T22.309的最低医疗费总额是多少?最高医疗费总额是多少
SELECT MIN(t_kc24.MED_AMOUT), MAX(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.t_kc21_MED_SER_ORG_NO = '4821131' AND t_kc24.t_kc21_OUT_DIAG_DIS_CD = 'T22.309')
css
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...
病患00922703的检验结果指标均正常的检验报告单号是什么
SELECT jybgb.BGDH FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN person_info_hz_info JOIN person_info 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 person_info_hz_info.KH = hz_info.KH AND pers...
css
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 procedures ( ...
How many patients aged below 58 had a blood gas test by lab?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "58" AND lab."CATEGORY" = "Blood Gas"
mimicsql_data
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...
give me the number of patients who had percutaneous aspiration of gallbladder and are still alive.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.expire_flag = "0" AND procedures.long_title = "Percutaneous aspiration of gallbladder"
mimicsql_data
CREATE TABLE table_204_324 ( id number, "team 1" text, "agg." text, "team 2" text, "1st leg" text, "2nd leg" text )
what was the total score for the 1st and 2nd legs of the somalia vs sudan game .
SELECT "agg." + "agg." FROM table_204_324 WHERE "team 1" = 'somalia' AND "team 2" = 'sudan'
squall
CREATE TABLE table_53135 ( "Driver" text, "Constructor" text, "Laps" text, "Time/Retired" text, "Grid" text )
Which grid is constructed by Maserati and driven by Oscar Alfredo G lvez?
SELECT "Grid" FROM table_53135 WHERE "Constructor" = 'maserati' AND "Driver" = 'oscar alfredo gálvez'
wikisql
CREATE TABLE video_games ( gameid number, gname text, gtype text ) CREATE TABLE student ( stuid number, lname text, fname text, age number, sex text, major number, advisor number, city_code text ) CREATE TABLE plays_games ( stuid number, gameid number, hours_pla...
Show total hours per week and number of games played for students under 20.
SELECT SUM(hoursperweek), SUM(gamesplayed) FROM sportsinfo AS T1 JOIN student AS T2 ON T1.stuid = T2.stuid WHERE T2.age < 20
spider
CREATE TABLE table_name_76 ( attendance VARCHAR, date VARCHAR )
What was the attendance on October 17?
SELECT attendance FROM table_name_76 WHERE date = "october 17"
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 demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
what is the preferred language and primary disease of the patient with patient id 3343?
SELECT demographic.language, demographic.diagnosis FROM demographic WHERE demographic.subject_id = "3343"
mimicsql_data
CREATE TABLE table_204_140 ( id number, "round" number, "#" number, "player" text, "position" text, "nationality" text, "college/junior/club team (league)" text )
who was the top pick of the islanders ' in the 2006 nhl entry draft ?
SELECT "player" FROM table_204_140 ORDER BY "#" LIMIT 1
squall