context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_56499 ( "Wind farm" text, "Capacity (MW)" real, "Country" text, "State/Province" text, "Notes" text )
Which state is Tehachapi Pass Wind Farm located in?
SELECT "State/Province" FROM table_56499 WHERE "Wind farm" = 'tehachapi pass wind farm'
wikisql
CREATE TABLE table_name_67 ( attendance VARCHAR, result VARCHAR, year VARCHAR, venue VARCHAR )
What's the total attendance at anaheim stadium after 1983 when the result is 14-28?
SELECT COUNT(attendance) FROM table_name_67 WHERE year > 1983 AND venue = "anaheim stadium" AND result = "14-28"
sql_create_context
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
give the number of patients whose admission type is emergency and ethnicity is american indian/alaska native.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "EMERGENCY" AND demographic.ethnicity = "AMERICAN INDIAN/ALASKA NATIVE"
mimicsql_data
CREATE TABLE table_name_25 ( home_team VARCHAR )
What was the essendon score when they were at home?
SELECT home_team AS score FROM table_name_25 WHERE home_team = "essendon"
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 the number of patients whose admission location is trsf within this facility and days of hospital stay is greater than 34?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "TRSF WITHIN THIS FACILITY" AND demographic.days_stay > "34"
mimicsql_data
CREATE TABLE hz_info ( KH text, KLX number, YLJGDM text ) 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...
哪位患者在住院就诊中开出了编号为66920522667的检验报告单?
SELECT person_info.XM FROM person_info JOIN hz_info JOIN zyjzjlb JOIN jybgb JOIN person_info_hz_info ON person_info.RYBH = person_info_hz_info.RYBH AND hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX AND zyjzjlb.YLJGDM = jybgb.YLJGDM_ZYJZJLB AND zyjzjlb.JZLSH = jybgb.JZLSH_ZYJZ...
css
CREATE TABLE table_3051 ( "Seed" real, "Rank" real, "Player" text, "Points" real, "Points defending" real, "Points won" real, "New points" real, "Status" text )
What is the highest points won when the player is aravane reza ?
SELECT MAX("Points won") FROM table_3051 WHERE "Player" = 'Aravane Rezaï'
wikisql
CREATE TABLE table_72389 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text )
What is the earliest first elected for district georgia 1?
SELECT MIN("First elected") FROM table_72389 WHERE "District" = 'Georgia 1'
wikisql
CREATE TABLE table_60986 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" text )
What was the result of the game that had 77,702 people in attendance?
SELECT "Result" FROM table_60986 WHERE "Attendance" = '77,702'
wikisql
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 prescriptions...
count the number of patients less than 58 years on neb route of drug administration.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "58" AND prescriptions.route = "NEB"
mimicsql_data
CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) CREATE TABLE fare ( fare_id int, from_airport varchar, to_airport varchar, fare_basis_code text, fare_airline text, restriction_code text, one_direction_cost int, round_trip_cost int, r...
i'd like to fly round trip from BOSTON to PITTSBURGH
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, flight, flight_fare WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PITTSBURGH' AND NOT fare.round_trip_cost IS NULL AND flight_fare.fare_...
atis
CREATE TABLE table_name_42 ( final INTEGER, all_around VARCHAR, total VARCHAR )
What is the average final with an all around greater than 19.35 and a total over 40?
SELECT AVG(final) FROM table_name_42 WHERE all_around > 19.35 AND total > 40
sql_create_context
CREATE TABLE table_26725 ( "Country or region" text, "Highest point" text, "Maximum elevation" text, "Lowest point" text, "Minimum elevation" text, "Elevation span" text )
What are the highest point in latvia
SELECT "Highest point" FROM table_26725 WHERE "Country or region" = 'Latvia'
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 insurance of subject name kelly gallardo?
SELECT demographic.insurance FROM demographic WHERE demographic.name = "Kelly Gallardo"
mimicsql_data
CREATE TABLE table_name_85 ( competition VARCHAR, date VARCHAR )
What competition took place on 10 August 2011?
SELECT competition FROM table_name_85 WHERE date = "10 august 2011"
sql_create_context
CREATE TABLE table_46831 ( "Game" real, "Date" text, "Opponent" text, "Result" text, "Rockets score" real, "Opponents" real, "Record" text, "Streak" text )
Which Date has a Rockets score of 94, and a Game of 66?
SELECT "Date" FROM table_46831 WHERE "Rockets score" = '94' AND "Game" = '66'
wikisql
CREATE TABLE table_14977252_2 ( draw INTEGER, artist VARCHAR )
Name the least draw for elena dermidjean
SELECT MIN(draw) FROM table_14977252_2 WHERE artist = "Elena Dermidjean"
sql_create_context
CREATE TABLE table_18646111_13 ( round_1 VARCHAR, event VARCHAR )
Name the round 1 for team event
SELECT round_1 FROM table_18646111_13 WHERE event = "Team"
sql_create_context
CREATE TABLE restaurant ( id int, name varchar, food_type varchar, city_name varchar, rating "decimal ) CREATE TABLE geographic ( city_name varchar, county varchar, region varchar ) CREATE TABLE location ( restaurant_id int, house_number int, street_name varchar, city_n...
where is a good arabic on buchanan in san francisco ?
SELECT location.house_number, restaurant.name FROM location, restaurant WHERE location.city_name = 'san francisco' AND location.street_name = 'buchanan' AND restaurant.food_type = 'arabic' AND restaurant.id = location.restaurant_id AND restaurant.rating > 2.5
restaurants
CREATE TABLE table_name_85 ( points INTEGER, year INTEGER )
What were the total Pints after 1957?
SELECT SUM(points) FROM table_name_85 WHERE year > 1957
sql_create_context
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 ...
哪些工号及姓名的医务人员在患者沈云梦就诊过程中为他检测地高辛的,时间是从0二年二月六日到0四年五月十二日
SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM 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 jy...
css
CREATE TABLE table_58268 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Series" text )
What is the series score of the game with Vancouver as the visiting team on April 16?
SELECT "Series" FROM table_58268 WHERE "Visitor" = 'vancouver' AND "Date" = 'april 16'
wikisql
CREATE TABLE table_73274 ( "English Name" text, "Simplified" text, "Traditional" text, "Pinyin" text, "Area" real, "Population" real, "Density" real )
What is the Pinyin for the simplified ?
SELECT "Pinyin" FROM table_73274 WHERE "Simplified" = '虞城县'
wikisql
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 whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, return a scatter chart about the correlation between employee_id and salary .
SELECT EMPLOYEE_ID, SALARY FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40
nvbench
CREATE TABLE table_31526 ( "Economy" text, "1980" real, "Gap from Thailand as of 1980 (times)" text, "1985" real, "1990" real, "1995" real, "2000" real, "2005" real, "2010" real, "2012" real, "Gap from Thailand as of 2012 (times)" text, "GDP as of 2012 after purchasing po...
How many GDPs as of 2012 after PPP values are associated with a 2012 value of 23113?
SELECT COUNT("GDP as of 2012 after purchasing power parity (PPP) calculations (USD billions)") FROM table_31526 WHERE "2012" = '23113'
wikisql
CREATE TABLE table_70502 ( "Year" real, "Entrant" text, "Chassis" text, "Engine" text, "Points" real )
Can you tell me the Chassis that has the Year of 1977?
SELECT "Chassis" FROM table_70502 WHERE "Year" = '1977'
wikisql
CREATE TABLE table_1342379_41 ( result VARCHAR, candidates VARCHAR )
How many times was the election joseph w. byrns, sr. (d) unopposed?
SELECT COUNT(result) FROM table_1342379_41 WHERE candidates = "Joseph W. Byrns, Sr. (D) Unopposed"
sql_create_context
CREATE TABLE table_51291 ( "Entrant" text, "Constructor" text, "Chassis" text, "Engine \u2020" text, "Tyre" text, "Driver" text, "Rounds" text )
What is the constructor of driver Alexander Wurz?
SELECT "Constructor" FROM table_51291 WHERE "Driver" = 'alexander wurz'
wikisql
CREATE TABLE table_62167 ( "Party" text, "Name in English" text, "City" text, "Province" text, "Date of registration" text )
On what date was the Canarian Workers Socialist Union registered?
SELECT "Date of registration" FROM table_62167 WHERE "Name in English" = 'canarian workers socialist union'
wikisql
CREATE TABLE table_name_46 ( country VARCHAR, ief_2011 VARCHAR )
What country has an IEF 2011 of 45.3?
SELECT country FROM table_name_46 WHERE ief_2011 = "45.3"
sql_create_context
CREATE TABLE zyjybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH number, 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, ...
患者褚雯华在04年11月9日到19年1月17日,是找的哪些工号及姓名的医务人员检测甲状腺素的
SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM 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 ...
css
CREATE TABLE table_3339 ( "Settlement" text, "Cyrillic Name Other Names" text, "Type" text, "Population (2011)" real, "Largest ethnic group (2002)" text, "Dominant religion (2002)" text )
Name the total number of population 2011 for perlez
SELECT COUNT("Population (2011)") FROM table_3339 WHERE "Settlement" = 'Perlez'
wikisql
CREATE TABLE table_name_69 ( year__ceremony_ VARCHAR, original_title VARCHAR )
What year was Zona Sur nominated?
SELECT year__ceremony_ FROM table_name_69 WHERE original_title = "zona sur"
sql_create_context
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
how many patients whose admission type is emergency and diagnoses long title is major depressive affective disorder, recurrent episode, severe, specified as with psychotic behavior?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND diagnoses.long_title = "Major depressive affective disorder, recurrent episode, severe, specified as with psychotic behavior"
mimicsql_data
CREATE TABLE code_description ( code varchar, description text ) 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 time_inte...
show me round trip fares between SAN FRANCISCO and WASHINGTON
SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, flight, flight_fare WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'SAN FRANCISCO' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_...
atis
CREATE TABLE table_437 ( "Series #" real, "Season #" real, "Episode title" text, "Writer(s)" text, "Director" text, "U.S. viewers (millions)" text, "Original air date" text )
What is the name of the episode written by Sheila Lawrence & Henry Alonso Myers?
SELECT "Episode title" FROM table_437 WHERE "Writer(s)" = 'Sheila Lawrence & Henry Alonso Myers'
wikisql
CREATE TABLE table_name_53 ( assists INTEGER, rank VARCHAR )
What is the least number of assists among players ranked 2?
SELECT MIN(assists) FROM table_name_53 WHERE rank = 2
sql_create_context
CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, UpVotes number, DownVotes number, ProfileImageUrl text, EmailHash text, AccountId number ) CRE...
Top users from Barcelona, Spain.
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE (LOWER(Location) LIKE '%barcelona%' OR LOWER(Location) LIKE '%bcn%') ORDER BY Reputation DESC
sede
CREATE TABLE table_80381 ( "Year" text, "Men's singles" text, "Women's singles" text, "Men's doubles" text, "Women's doubles" text, "Mixed doubles" text )
Who won the Women's singles, in the year that Raymond M. White won the Men's singles and that W. Hamilton Ian Maconachie won the Men's doubles?
SELECT "Women's singles" FROM table_80381 WHERE "Men's singles" = 'raymond m. white' AND "Men's doubles" = 'w. hamilton ian maconachie'
wikisql
CREATE TABLE table_5386 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Record" text )
What was the record on december 8 when the boston bruins visited?
SELECT "Record" FROM table_5386 WHERE "Visitor" = 'boston bruins' AND "Date" = 'december 8'
wikisql
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetake...
how many patients were diagnosed with s/p hip surgery and did not come to the hospital within the same month in the last year?
SELECT (SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 's/p hip surgery' AND DATETIME(diagnosis.diagnosistime, 'start of year') = DATETIME(CURRENT_TIME(), '...
eicu
CREATE TABLE table_39660 ( "Number" real, "Result" text, "Date" text, "Score" text, "Opponent" text, "Record" text )
What's the number of the game played on January 2, 1936?
SELECT MIN("Number") FROM table_39660 WHERE "Date" = 'january 2, 1936'
wikisql
CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location text, insurance text, language text, marital_status text, ethnicity text, age number ) CREATE ...
has patient 7107 had a potassium test during this month?
SELECT COUNT(*) > 0 FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'potassium') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 7107) AND DATETIME(labevents.charttime, 'start of month') = DATETIME(CURRENT_TIME...
mimic_iii
CREATE TABLE table_48380 ( "Date" text, "Home" text, "Score" text, "Away" text, "Attendance" real )
Home for away of hispano?
SELECT "Home" FROM table_48380 WHERE "Away" = 'hispano'
wikisql
CREATE TABLE table_35213 ( "Year" real, "Group" text, "Award" text, "Film" text, "Result" text )
Which Film has a Result of nominated, and a Year of 2001?
SELECT "Film" FROM table_35213 WHERE "Result" = 'nominated' AND "Year" = '2001'
wikisql
CREATE TABLE table_name_43 ( date VARCHAR, attendance INTEGER )
What is Date, when Attendance is less than 521?
SELECT date FROM table_name_43 WHERE attendance < 521
sql_create_context
CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, outtime time ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) ...
what are the five most commonly prescribed medications since 2100?
SELECT t1.drug FROM (SELECT prescriptions.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM prescriptions WHERE STRFTIME('%y', prescriptions.startdate) >= '2100' GROUP BY prescriptions.drug) AS t1 WHERE t1.c1 <= 5
mimic_iii
CREATE TABLE table_name_58 ( venue VARCHAR, competition VARCHAR, score VARCHAR )
What is the Venue of the Friendly Competition with a Score of 1 4?
SELECT venue FROM table_name_58 WHERE competition = "friendly" AND score = "1–4"
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 procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
specify the marital status of patient id 18480
SELECT demographic.marital_status FROM demographic WHERE demographic.subject_id = "18480"
mimicsql_data
CREATE TABLE table_name_38 ( heat INTEGER, name VARCHAR )
What is the average Heat for anjelika solovieva?
SELECT AVG(heat) FROM table_name_38 WHERE name = "anjelika solovieva"
sql_create_context
CREATE TABLE table_51136 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text )
What is Country, when Score is 71-71-69=211?
SELECT "Country" FROM table_51136 WHERE "Score" = '71-71-69=211'
wikisql
CREATE TABLE table_14 ( "#" text, "Shipyard" text, "Laid down" text, "Launched" text, "Commissioned" text, "Fleet" text, "Status" text )
When were the ships launched that were laid down on september 1, 1964?
SELECT "Launched" FROM table_14 WHERE "Laid down" = 'September 1, 1964'
wikisql
CREATE TABLE table_name_28 ( geo_id VARCHAR, ansi_code VARCHAR, water__sqmi_ VARCHAR, township VARCHAR )
What is the number of GEO IDs for areas in Riggin township with water area over 0.587 sq mi and ANSI codes over 1759257?
SELECT COUNT(geo_id) FROM table_name_28 WHERE water__sqmi_ > 0.587 AND township = "riggin" AND ansi_code > 1759257
sql_create_context
CREATE TABLE organizations ( organization_name VARCHAR, date_formed VARCHAR )
List all the name of organizations in order of the date formed.
SELECT organization_name FROM organizations ORDER BY date_formed
sql_create_context
CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE flight_stop ( flight_id int, stop_number int, stop_days text, stop_airport text, arrival_time int, arrival_airline text, arrival_flight_number int, departure_time int, departure_airlin...
what kind of aircraft is used on the FIRST class AA flight from PHILADELPHIA to SAN FRANCISCO stopping in DALLAS
SELECT DISTINCT aircraft.aircraft_code FROM aircraft, airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, equipment_sequence, fare, fare_basis, flight, flight_fare, flight_stop WHERE (((CITY_2.city_code = AIRPO...
atis
CREATE TABLE table_name_17 ( north_american_release_date VARCHAR, japanese_release_date VARCHAR )
What is North American Release Date, when Japanese Release Date is '2011-06-23'?
SELECT north_american_release_date FROM table_name_17 WHERE japanese_release_date = "2011-06-23"
sql_create_context
CREATE TABLE table_40025 ( "Goal" real, "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text )
What is the result when there's less than 2 goals?
SELECT "Result" FROM table_40025 WHERE "Goal" < '2'
wikisql
CREATE TABLE musical ( musical_id number, name text, year number, award text, category text, nominee text, result text ) CREATE TABLE actor ( actor_id number, name text, musical_id number, character text, duration text, age number )
List the name of musicals that do not have actors.
SELECT name FROM musical WHERE NOT musical_id IN (SELECT musical_id FROM actor)
spider
CREATE TABLE table_46302 ( "Game" real, "Date" text, "Opponent" text, "Score" text, "Location" text, "Record" text )
What date did the Boston Celtics play at Richfield Coliseum?
SELECT "Date" FROM table_46302 WHERE "Location" = 'richfield coliseum'
wikisql
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime...
get the id of the patients who had been diagnosed with acute respiratory failure - due to inability to clear secretions in this year.
SELECT patient.uniquepid FROM patient WHERE patient.patientunitstayid IN (SELECT diagnosis.patientunitstayid FROM diagnosis WHERE diagnosis.diagnosisname = 'acute respiratory failure - due to inability to clear secretions' AND DATETIME(diagnosis.diagnosistime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year'...
eicu
CREATE TABLE table_17632217_2 ( fourth_placed VARCHAR, total_wins VARCHAR, third_place VARCHAR, winners VARCHAR )
Who was placed fourth when third was Beijing Guoan and the winner was Dalian Wanda and wins total was 4?
SELECT fourth_placed FROM table_17632217_2 WHERE third_place = "Beijing Guoan" AND winners = "Dalian Wanda" AND total_wins = 4
sql_create_context
CREATE TABLE table_69202 ( "2003/ 04" text, "2004/ 05" text, "2007/ 08" text, "2009/ 10" text, "2010/ 11" text, "2011/ 12" text, "2012/ 13" text )
What was held in 2003/04 when Former Ranking Tournaments was in 2007/08?
SELECT "2003/ 04" FROM table_69202 WHERE "2007/ 08" = 'former ranking tournaments'
wikisql
CREATE TABLE table_name_27 ( registrations VARCHAR, type VARCHAR, station_number VARCHAR )
What is the registration of the station with a retained type and a station number of c03?
SELECT registrations FROM table_name_27 WHERE type = "retained" AND station_number = "c03"
sql_create_context
CREATE TABLE table_204_661 ( id number, "team" text, "location" text, "home ground" text, "first year in\nqld cup" number, "last year in\nqld cup" number, "qld cup\npremierships" text )
which team has had the most queensland cup premierships ?
SELECT "team" FROM table_204_661 ORDER BY "qld cup\npremierships" DESC LIMIT 1
squall
CREATE TABLE table_2887 ( "Rank" real, "Rider" text, "Mon 24 Aug" text, "Tues 25 Aug" text, "Wed 26 Aug" text, "Thurs 27 Aug" text, "Fri 28 Aug" text )
What is every value for Monday August 24 if Friday August 28 is 23' 22.25 96.864mph?
SELECT "Mon 24 Aug" FROM table_2887 WHERE "Fri 28 Aug" = '23'' 22.25 96.864mph'
wikisql
CREATE TABLE table_13771 ( "School" text, "Location" text, "Mascot" text, "County" text, "Year joined" real, "Previous Conference" text, "Year Left" real, "Conference joined" text )
What's the mascot in Huntington after the year 2000?
SELECT "Mascot" FROM table_13771 WHERE "Year Left" > '2000' AND "Location" = 'huntington'
wikisql
CREATE TABLE table_name_85 ( Id VARCHAR )
2006 of 10 4 is in which 2000?
SELECT 2000 FROM table_name_85 WHERE 2006 = "10–4"
sql_create_context
CREATE TABLE table_26559 ( "Model number" text, "Frequency" text, "L1 Cache" text, "FSB" text, "Mult." text, "Voltage" text, "TDP" text, "Socket" text, "Release date" text, "Part number(s)" text, "sSpec number" text )
What's the part number of the model with TDP of 2.9 (max.4.1~5.4) w?
SELECT "Part number(s)" FROM table_26559 WHERE "TDP" = '2.9 (Max.4.1~5.4) W'
wikisql
CREATE TABLE jyjgzbb ( JYZBLSH text, YLJGDM text, BGDH text, BGRQ time, JYRQ time, JCRGH text, JCRXM text, SHRGH text, SHRXM text, JCXMMC text, JCZBDM text, JCFF text, JCZBMC text, JCZBJGDX text, JCZBJGDL number, JCZBJGDW text, SBBM text, YQBH text...
卫星纬这位患者的204895指标在零一年四月三十日至零六年一月三十一日期间的情况
(SELECT * FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGD...
css
CREATE TABLE 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 procedures ( ...
what is primary disease and diagnoses icd9 code of subject name bruce harris?
SELECT demographic.diagnosis, diagnoses.icd9_code FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.name = "Bruce Harris"
mimicsql_data
CREATE TABLE table_25014 ( "English name" text, "Georgian name" text, "Transliteration" text, "Date" text, "Author" text, "Period covered" text )
Who is the auther when the english name was histories and eulogies of the sovereigns?
SELECT "Author" FROM table_25014 WHERE "English name" = 'Histories and Eulogies of the Sovereigns'
wikisql
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 number of patients with abnormal lab test status who were diagnosed with perforation of intestine?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.long_title = "Perforation of intestine" AND lab.flag = "abnormal"
mimicsql_data
CREATE TABLE gwyjzb ( 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, ...
列一下医院5728238所有就诊记录里,在不同科室就诊的患者和有不同的入院诊断编号患者的平均年纪
SELECT gwyjzb.MED_ORG_DEPT_NM, gwyjzb.IN_DIAG_DIS_CD, AVG(gwyjzb.PERSON_AGE) FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '5728238' GROUP BY gwyjzb.MED_ORG_DEPT_NM, gwyjzb.IN_DIAG_DIS_CD UNION SELECT fgwyjzb.MED_ORG_DEPT_NM, fgwyjzb.IN_DIAG_DIS_CD, AVG(fgwyjzb.PERSON_AGE) FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '57282...
css
CREATE TABLE table_name_66 ( period VARCHAR, other_mozilla VARCHAR )
What period has 0.25% as the other mozilla?
SELECT period FROM table_name_66 WHERE other_mozilla = "0.25%"
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_DIRE_CD text, MED_DIRE_NM text,...
把患者许浩歌在编号为8126391的医院中入院诊断疾病名称不包含肺的医疗就诊记录编号列出来
SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_NM = '许浩歌' AND t_kc21.MED_SER_ORG_NO = '8126391' AND NOT t_kc21.IN_DIAG_DIS_NM LIKE '%肺%'
css
CREATE TABLE table_55299 ( "NGC number" real, "Object type" text, "Constellation" text, "Right ascension ( J2000 )" text, "Declination ( J2000 )" text, "Apparent magnitude" real )
I want the sum of NGC number for spiral galaxy and right acension of 08h14m40.4s
SELECT SUM("NGC number") FROM table_55299 WHERE "Object type" = 'spiral galaxy' AND "Right ascension ( J2000 )" = '08h14m40.4s'
wikisql
CREATE TABLE table_26352332_4 ( cylinder_layout VARCHAR, years_produced VARCHAR, engine_family VARCHAR )
The engine family MaxxForce 5 in the years produced 2007-current, have what cylinder layout?
SELECT cylinder_layout FROM table_26352332_4 WHERE years_produced = "2007-current" AND engine_family = "MaxxForce 5"
sql_create_context
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) C...
count the number of patients whose discharge location is snf and primary disease is posterior communicating aneurysm/sda?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = "SNF" AND demographic.diagnosis = "POSTERIOR COMMUNICATING ANEURYSM/SDA"
mimicsql_data
CREATE TABLE table_21287 ( "June 10-11" text, "March 27-29" text, "January 15-16" text, "November 3" text, "August 21-22" text )
Name march 27-29 where january 15-16 is january 15, 1991
SELECT "March 27-29" FROM table_21287 WHERE "January 15-16" = 'January 15, 1991'
wikisql
CREATE TABLE table_51501 ( "Pick" real, "Round" text, "Player" text, "Position" text, "School" text )
Who is the guard for Wisconsin?
SELECT "Player" FROM table_51501 WHERE "Position" = 'guard' AND "School" = 'wisconsin'
wikisql
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 whose marital status is single and diagnoses long title is bacterial pneumonia, unspecified?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.marital_status = "SINGLE" AND diagnoses.long_title = "Bacterial pneumonia, unspecified"
mimicsql_data
CREATE TABLE zyb ( CLINIC_ID text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, INSU_TYPE text, IN...
范馨逸那个病人在治病期间使用的医疗费总额高于6053.87元的医疗记录有多些,其什么名字和编号的病在出院时诊断了出来?
SELECT qtb.OUT_DIAG_DIS_CD, qtb.OUT_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 > 6053.87) UNION SELECT gyb.OUT_DIAG_DIS_CD, gyb.OUT_DIAG_DIS_NM FROM gyb WHERE gyb.PERSON_NM = '范馨逸' AND gyb.MED_CLINIC_ID IN (SELECT t_kc24.MED_...
css
CREATE TABLE table_60297 ( "Year" real, "Team" text, "Co-Drivers" text, "Class" text, "Laps" real, "Pos." text )
What position did the driver from Audi Sport North America finish in the race after 2008?
SELECT "Pos." FROM table_60297 WHERE "Team" = 'audi sport north america' AND "Year" > '2008'
wikisql
CREATE TABLE table_229917_2 ( tail_number VARCHAR, brief_description VARCHAR )
What's the tail number of the airplane involved in the accident described as crashed?
SELECT tail_number FROM table_229917_2 WHERE brief_description = "Crashed"
sql_create_context
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, ...
测验报告单编号为70434114659对应的是哪个住院的病人?
SELECT person_info.XM FROM person_info JOIN hz_info JOIN zyjzjlb JOIN zyjybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX AND zyjzjlb.YLJGDM = zyjybgb.YLJGDM_ZYJZJLB AND zyjzjlb.JZLSH = zyjybgb.JZLSH_ZYJZJLB WHERE zyjybgb.BGDH = '70434...
css
CREATE TABLE table_13516 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" real, "Time" text, "Location" text )
What was the time for the match that resulted in a loss in less than 3 rounds?
SELECT "Time" FROM table_13516 WHERE "Res." = 'loss' AND "Round" < '3'
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...
Total Posts by Database Server Per Month - Oracle.
SELECT CONCAT(YEAR(P.CreationDate), '-', MONTH(P.CreationDate)) AS YearMonth, 'Oracle' AS TagName, COUNT(*) AS PostCount FROM Posts AS P INNER JOIN PostTags AS PT ON (P.Id = PT.PostId) INNER JOIN Tags AS T ON (PT.TagId = T.Id) WHERE T.TagName LIKE 'oracle%' GROUP BY YEAR(P.CreationDate), MONTH(P.CreationDate) ORDER BY ...
sede
CREATE TABLE table_21183 ( "Show" text, "Last Aired" real, "Previous Network" text, "Retitled as/Same" text, "New/Returning/Same Network" text, "Returning" text )
Which show as previously on The Family Channel?
SELECT "Show" FROM table_21183 WHERE "Previous Network" = 'The Family Channel'
wikisql
CREATE TABLE Guests ( guest_id INTEGER, gender_code CHAR(1), guest_first_name VARCHAR(80), guest_last_name VARCHAR(80), date_of_birth DATETIME ) CREATE TABLE View_Unit_Status ( apt_id INTEGER, apt_booking_id INTEGER, status_date DATETIME, available_yn BIT ) CREATE TABLE Apartment_B...
What are the facility codes of the apartments with more than four bedrooms, and count them by a bar chart, I want to list by the y-axis from high to low.
SELECT facility_code, COUNT(facility_code) FROM Apartment_Facilities AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T2.bedroom_count > 4 GROUP BY facility_code ORDER BY COUNT(facility_code) DESC
nvbench
CREATE TABLE table_11351 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real )
What is the average number of laps for grid 8?
SELECT AVG("Laps") FROM table_11351 WHERE "Grid" = '8'
wikisql
CREATE TABLE table_name_19 ( wins VARCHAR, pct VARCHAR )
How many wins when the pct, is .848?
SELECT wins FROM table_name_19 WHERE pct = ".848"
sql_create_context
CREATE TABLE table_13051 ( "Team 1" text, "Agg." text, "Team 2" text, "1st leg" text, "2nd leg" text )
What 2nd leg has pelister as team 1?
SELECT "2nd leg" FROM table_13051 WHERE "Team 1" = 'pelister'
wikisql
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE diagnosis ( diagnosisid number, ...
what was the top four of the most frequent procedures until 2 years ago?
SELECT t1.treatmentname FROM (SELECT treatment.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM treatment WHERE DATETIME(treatment.treatmenttime) <= DATETIME(CURRENT_TIME(), '-2 year') GROUP BY treatment.treatmentname) AS t1 WHERE t1.c1 <= 4
eicu
CREATE TABLE table_17427 ( "Year" real, "Mens singles" text, "Womens singles" text, "Mens doubles" text, "Womens doubles" text, "Mixed doubles" text )
Who won the womens singles when Marc Zwiebler won the men's singles?
SELECT "Womens singles" FROM table_17427 WHERE "Mens singles" = 'Marc Zwiebler'
wikisql
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE d_...
when did patient 9294 first have a arterial bp [systolic] measured on the first intensive care unit visit?
SELECT chartevents.charttime 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 = 9294) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime LIMIT 1) AND chartevents.itemid IN (S...
mimic_iii
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, ...
what exactly does carbuncle, site nec mean?
SELECT d_icd_diagnoses.long_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'carbuncle, site nec' UNION SELECT d_icd_procedures.long_title FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'carbuncle, site nec'
mimic_iii
CREATE TABLE table_name_27 ( bulls VARCHAR, venue VARCHAR )
What was the total number for the Bulls when they were at Old Trafford?
SELECT COUNT(bulls) FROM table_name_27 WHERE venue = "old trafford"
sql_create_context
CREATE TABLE table_5938 ( "Medium" text, "Title" text, "Date" text, "Theatre, Studio, or Network" text, "Role" text )
What production was created by Monogram?
SELECT "Title" FROM table_5938 WHERE "Theatre, Studio, or Network" = 'monogram'
wikisql
CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, Crea...
Posts with images hosted on ImageShack.
SELECT Posts.Id, Posts.Id AS "post_link", PostTypes.Name AS "type", Posts.Score, Posts.CreationDate, Posts.Tags FROM Posts JOIN PostTypes ON PostTypes.Id = Posts.PostTypeId WHERE Body LIKE '%<img%.imageshack.us/img%' LIMIT 1000
sede
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,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 varchar(12), CITY ...
For all employees who have the letters D or S in their first name, a line chart shows the change of employee_id over hire_date
SELECT HIRE_DATE, EMPLOYEE_ID FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%'
nvbench