context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_name_16 ( score VARCHAR, record VARCHAR )
WHich Score has a Record of 31 28 3?
SELECT score FROM table_name_16 WHERE record = "31–28–3"
sql_create_context
CREATE TABLE date_day ( month_number int, day_number int, year int, day_name 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, ...
what UA flights go through DENVER
SELECT DISTINCT flight.flight_id FROM airport_service, city, flight, flight_stop WHERE city.city_code = airport_service.city_code AND city.city_name = 'DENVER' AND flight_stop.stop_airport = airport_service.airport_code AND flight.airline_code = 'UA' AND flight.flight_id = flight_stop.flight_id
atis
CREATE TABLE table_name_6 ( entrant VARCHAR, engine VARCHAR, points VARCHAR )
what is the entrant for the ferrari v8 with points less than 4?
SELECT entrant FROM table_name_6 WHERE engine = "ferrari v8" AND points < 4
sql_create_context
CREATE TABLE table_41026 ( "Date" text, "Time" text, "Score" text, "Set 1" text, "Set 2" text, "Set 3" text, "Total" text, "Report" text )
What is the report in the tournament that started at 12:30?
SELECT "Report" FROM table_41026 WHERE "Time" = '12:30'
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 procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
how many patients whose diagnoses long title is opioid type dependence, unspecified and drug route is ivpca?
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.long_title = "Opioid type dependence, unspecified" AND prescriptions.route = "IVPCA"
mimicsql_data
CREATE TABLE table_name_36 ( november VARCHAR, year VARCHAR )
Who is in November in the year 1979?
SELECT november FROM table_name_36 WHERE year = 1979
sql_create_context
CREATE TABLE table_204_426 ( id number, "year" text, "division" number, "league" text, "regular season" text, "playoffs" text, "open cup" text )
how many years did they not qualify for the playoffs ?
SELECT COUNT("year") FROM table_204_426 WHERE "playoffs" = 'did not qualify'
squall
CREATE TABLE Behavior_Incident ( incident_id INTEGER, incident_type_code VARCHAR(10), student_id INTEGER, date_incident_start DATETIME, date_incident_end DATETIME, incident_summary VARCHAR(255), recommendations VARCHAR(255), other_details VARCHAR(255) ) CREATE TABLE Ref_Address_Types ( ...
A bar chart shows the distribution of date_address_to and the amount of date_address_to , and group by attribute other_details and bin date_address_to by time.
SELECT date_address_to, COUNT(date_address_to) FROM Student_Addresses GROUP BY other_details ORDER BY monthly_rental DESC
nvbench
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
calculate the number of patients treated with loperamide who have unspecified death status.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.expire_flag = "0" AND prescriptions.drug = "Loperamide"
mimicsql_data
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( ...
provide the number of government health insurance patients who had right and left heart catheterization.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Government" AND procedures.short_title = "Rt/left heart card cath"
mimicsql_data
CREATE TABLE Financial_Transactions ( transaction_id INTEGER, previous_transaction_id INTEGER, account_id INTEGER, card_id INTEGER, transaction_type VARCHAR(15), transaction_date DATETIME, transaction_amount DOUBLE, transaction_comment VARCHAR(255), other_transaction_details VARCHAR(...
Display a bar chart for what are the different card types, and how many cards are there of each?, could you display Y from high to low order?
SELECT card_type_code, COUNT(*) FROM Customers_Cards GROUP BY card_type_code ORDER BY COUNT(*) DESC
nvbench
CREATE TABLE table_62537 ( "Year" text, "Arizona" text, "California" text, "Colorado" text, "Nevada" text, "New Mexico" text, "Oklahoma" text, "Texas" text, "Utah" text )
What's the value for utah when colorado and new mexico are bush?
SELECT "Utah" FROM table_62537 WHERE "Colorado" = 'bush' AND "New Mexico" = 'bush'
wikisql
CREATE TABLE train_station ( Train_ID int, Station_ID int ) CREATE TABLE station ( Station_ID int, Name text, Annual_entry_exit real, Annual_interchanges real, Total_Passengers real, Location text, Main_Services text, Number_of_Platforms int ) CREATE TABLE train ( Train_ID ...
A bar chart shows how many locations, list Y-axis in asc order.
SELECT Location, COUNT(Location) FROM station GROUP BY Location ORDER BY COUNT(Location)
nvbench
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 ...
provide the number of patients whose admission type is urgent and lab test name is magnesium?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "URGENT" AND lab.label = "Magnesium"
mimicsql_data
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE wdmzjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH number, KH text, KLX num...
列出患者孔古兰出院科室名称包含病的住院就诊在医院3510402中有什么记录?
SELECT * FROM person_info JOIN hz_info JOIN wdmzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX WHERE person_info.XM = '孔古兰' AND hz_info.YLJGDM = '3510402' AND wdmzjzjlb.CYKSMC LIKE '%病%' UNION SELECT * FROM person_info JOIN hz...
css
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,...
总计患者年龄20岁及以下的医疗记录的平均医务费总数有多少?
SELECT AVG(MED_AMOUT) FROM t_kc24 WHERE MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc21 WHERE PERSON_AGE <= 20)
css
CREATE TABLE table_13037 ( "Block" real, "Title" text, "Directed by" text, "Written by" text, "Code" text )
Which Written by has a Code of 1.2 1.3?
SELECT "Written by" FROM table_13037 WHERE "Code" = '1.2 1.3'
wikisql
CREATE TABLE table_11839306_2 ( track VARCHAR )
How long is track number 8?
SELECT track AS time FROM table_11839306_2 WHERE track = 8
sql_create_context
CREATE TABLE table_name_38 ( club VARCHAR, losses VARCHAR, goals_for VARCHAR, draws VARCHAR )
What club has more than 35 goals, more than 7 draws, and 20 losses?
SELECT club FROM table_name_38 WHERE goals_for > 35 AND draws > 7 AND losses = 20
sql_create_context
CREATE TABLE table_34140 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Record" text, "Game Site" text, "Attendance" real )
What's the record of the team who played the Cleveland Browns?
SELECT "Record" FROM table_34140 WHERE "Opponent" = 'cleveland browns'
wikisql
CREATE TABLE Courses ( author_id VARCHAR ) CREATE TABLE Course_Authors_and_Tutors ( address_line_1 VARCHAR, author_id VARCHAR )
Find the addresses and author IDs of the course authors that teach at least two courses.
SELECT T1.address_line_1, T2.author_id FROM Course_Authors_and_Tutors AS T1 JOIN Courses AS T2 ON T1.author_id = T2.author_id GROUP BY T2.author_id HAVING COUNT(*) >= 2
sql_create_context
CREATE TABLE people ( people_id number, name text, height number, weight number, date_of_birth text ) CREATE TABLE entrepreneur ( entrepreneur_id number, people_id number, company text, money_requested number, investor text )
What are the dates of birth of entrepreneurs with investor 'Simon Woodroffe' or 'Peter Jones'?
SELECT T2.date_of_birth FROM entrepreneur AS T1 JOIN people AS T2 ON T1.people_id = T2.people_id WHERE T1.investor = "Simon Woodroffe" OR T1.investor = "Peter Jones"
spider
CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE TABLE fare_basis ( fare_basis_code text, booking_class text, class_type text, premium text, economy text, discounted text, night text, season text, basis_days text ) CREATE TABLE date_day ...
show me OAKLAND to DALLAS flights
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 = 'OAKLAND' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DALLAS...
atis
CREATE TABLE table_name_4 ( date VARCHAR, venue VARCHAR )
On what date was a match played at Lake Oval?
SELECT date FROM table_name_4 WHERE venue = "lake oval"
sql_create_context
CREATE TABLE table_2897457_5 ( nationality VARCHAR, player VARCHAR )
What nationality is keith carney?
SELECT nationality FROM table_2897457_5 WHERE player = "Keith Carney"
sql_create_context
CREATE TABLE body_builder ( Body_Builder_ID int, People_ID int, Snatch real, Clean_Jerk real, Total real ) CREATE TABLE people ( People_ID int, Name text, Height real, Weight real, Birth_Date text, Birth_Place text )
A scatter chart shows the correlation between People_ID and Total .
SELECT People_ID, Total FROM body_builder
nvbench
CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE compartment_class ( ...
is there a flight from PITTSBURGH to BALTIMORE that arrives between 1800 and 1900
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE ((flight.arrival_time <= 1900 AND flight.arrival_time >= 1800) AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BALTIMORE' AND flight.t...
atis
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 ( ...
calculat the number of patients with icd9 code 4928 who had abnormal lab test results.
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.icd9_code = "4928" AND lab.flag = "abnormal"
mimicsql_data
CREATE TABLE table_16384648_2 ( institution VARCHAR, team_nickname VARCHAR )
How many schools have the team nickname bobcats?
SELECT COUNT(institution) FROM table_16384648_2 WHERE team_nickname = "Bobcats"
sql_create_context
CREATE TABLE table_56547 ( "Position" real, "Club" text, "Played" real, "Points" text, "Wins" real, "Draws" real, "Losses" real, "Goals for" real, "Goals against" real, "Goal Difference" real )
How many positions have Points of 30-8 and more than 25 goals?
SELECT COUNT("Position") FROM table_56547 WHERE "Points" = '30-8' AND "Goals for" > '25'
wikisql
CREATE TABLE table_name_81 ( party VARCHAR, votes INTEGER )
Which party has less than 11,484 votes?
SELECT party FROM table_name_81 WHERE votes < 11 OFFSET 484
sql_create_context
CREATE TABLE table_89 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "U.S. viewers (millions)" text )
What is the original air date for episode 15 of season 6?
SELECT "Original air date" FROM table_89 WHERE "No. in season" = '15'
wikisql
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, ...
during the previous year, was there any microbiological test record for patient 031-16123's blood, venipuncture?
SELECT COUNT(*) FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-16123')) AND microlab.culturesite = 'blood, venipuncture' AND DATETIME(microla...
eicu
CREATE TABLE writes ( paperid int, authorid int ) CREATE TABLE journal ( journalid int, journalname varchar ) CREATE TABLE paperdataset ( paperid int, datasetid int ) CREATE TABLE venue ( venueid int, venuename varchar ) CREATE TABLE author ( authorid int, authorname varchar ...
the papers of li dong at acl or emnlp last year
SELECT DISTINCT paper.paperid FROM author, paper, venue, writes WHERE author.authorname = 'li dong' AND paper.year = 2015 AND venue.venueid = paper.venueid AND venue.venuename IN ('acl', 'emnlp') AND writes.authorid = author.authorid AND writes.paperid = paper.paperid
scholar
CREATE TABLE table_70845 ( "Year" real, "Competition" text, "Town" text, "Opponent" text, "Final score" text )
who is the opponent when played in trieste before 2007?
SELECT "Opponent" FROM table_70845 WHERE "Year" < '2007' AND "Town" = 'trieste'
wikisql
CREATE TABLE table_name_35 ( silver INTEGER, bronze VARCHAR, gold VARCHAR, rank VARCHAR )
What is the average silver for golds over 2, ranks of 1, and bronzes over 0?
SELECT AVG(silver) FROM table_name_35 WHERE gold > 2 AND rank = "1" AND bronze > 0
sql_create_context
CREATE TABLE paperfield ( fieldid int, paperid int ) CREATE TABLE author ( authorid int, authorname varchar ) CREATE TABLE paperkeyphrase ( paperid int, keyphraseid int ) CREATE TABLE paperdataset ( paperid int, datasetid int ) CREATE TABLE field ( fieldid int ) CREATE TABLE key...
where does li dong publish ?
SELECT DISTINCT paper.journalid, venue.venueid FROM author, paper, venue, writes WHERE author.authorname = 'li dong' AND venue.venueid = paper.venueid AND writes.authorid = author.authorid AND writes.paperid = paper.paperid
scholar
CREATE TABLE table_15904 ( "Name" text, "Direction" text, "Mantra" text, "Weapon" text, "Consort" text, "Graha (Planet)" text, "Guardian M\u0101t\u1e5bk\u0101" text )
What are the directions for the guardian whose graha (planet) is b haspati (Jupiter)?
SELECT "Direction" FROM table_15904 WHERE "Graha (Planet)" = 'Bṛhaspati (Jupiter)'
wikisql
CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TAB...
Upvotes by users with low reputation.
SELECT SUM(UpVotes) AS "all_upvotes" FROM Users ORDER BY 'all_upvotes' DESC
sede
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, h...
so what's the maximum chloride value of patient 016-17204 since 06/2104?
SELECT MAX(lab.labresult) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-17204')) AND lab.labname = 'chloride' AND STRFTIME('%y-%m', lab.labresulttime)...
eicu
CREATE TABLE flight_fare ( flight_id int, fare_id int ) 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, round_trip_required varchar ) CREA...
i would like a nonstop flight from MEMPHIS to LAS VEGAS on 3 2
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'LAS VEGAS' AND date_day.day_number = 2 AND date_day.month_number = 3 AND...
atis
CREATE TABLE table_2267345_2 ( general_classification VARCHAR, young_rider_classification VARCHAR, winner VARCHAR )
Who was the general classification leader when the young rider classification leader was Salvatore Commesso and the winner was Erik Dekker?
SELECT general_classification FROM table_2267345_2 WHERE young_rider_classification = "Salvatore Commesso" AND winner = "Erik Dekker"
sql_create_context
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE microbiologyevents ( ...
the first intake that patient 2004 had on 07/18/last year what is the name of it?
SELECT d_items.label FROM d_items WHERE d_items.itemid IN (SELECT inputevents_cv.itemid FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 2004)) AND DATETIME(inputevents_cv.c...
mimic_iii
CREATE TABLE table_24345 ( "Team #1" text, "Agg. score" text, "Team #2" text, "1st leg" text, "2nd leg" text )
give the 1st leg score against ilisiakos
SELECT "1st leg" FROM table_24345 WHERE "Team #2" = 'Ilisiakos'
wikisql
CREATE TABLE table_name_41 ( name VARCHAR, city VARCHAR )
Who has the city Santiago?
SELECT name FROM table_name_41 WHERE city = "santiago"
sql_create_context
CREATE TABLE table_203_620 ( id number, "tie no" number, "home team" text, "score" text, "away team" text, "attendance" number )
how many teams played consecutive games due to getting a tie ?
SELECT COUNT(*) FROM table_203_620 WHERE "score" = "score"
squall
CREATE TABLE Customers ( customer_id INTEGER, payment_method VARCHAR(15), customer_name VARCHAR(80), customer_phone VARCHAR(80), customer_email VARCHAR(80), customer_address VARCHAR(255), customer_login VARCHAR(80), customer_password VARCHAR(10) ) CREATE TABLE Mailshot_Customers ( m...
Show all distinct product categories along with the number of mailshots in each category in a bar chart, and show from high to low by the total number please.
SELECT product_category, COUNT(*) FROM Mailshot_Campaigns GROUP BY product_category ORDER BY COUNT(*) DESC
nvbench
CREATE TABLE table_203_42 ( id number, "model" text, "class" text, "length" text, "fuel" text, "starting price" text )
what is the name of the top priced winnebago model ?
SELECT "model" FROM table_203_42 ORDER BY "starting price" DESC LIMIT 1
squall
CREATE TABLE table_name_30 ( result VARCHAR, goal VARCHAR )
What is the Result for Goal 3?
SELECT result FROM table_name_30 WHERE goal = 3
sql_create_context
CREATE TABLE hz_info_mzjzjlb ( JZLSH number, YLJGDM number, mzjzjlb_id number ) 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, ...
医院1771451在2003年9月14日到2010年1月28日期间,有多少科室在门诊就诊中开出20张以下的检验报告单
SELECT COUNT(*) FROM (SELECT jybgb.KSBM FROM mzjzjlb JOIN jybgb JOIN hz_info_mzjzjlb ON hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_inf...
css
CREATE TABLE table_name_30 ( paper_type VARCHAR, denomination VARCHAR, date_of_issue VARCHAR )
Which Paper Type has a Denomination of $0.50 and Date of Issue 4 February 2005?
SELECT paper_type FROM table_name_30 WHERE denomination = "$0.50" AND date_of_issue = "4 february 2005"
sql_create_context
CREATE TABLE table_48735 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
Which Date has a Location Attendance of madison square garden 19,763, and a High rebounds of david lee (12)?
SELECT "Date" FROM table_48735 WHERE "Location Attendance" = 'madison square garden 19,763' AND "High rebounds" = 'david lee (12)'
wikisql
CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDa...
Top user in all tags by score and answer count.
SELECT t.TagName, a.OwnerUserId AS "user_link", SUM(a.Score) / 10 AS Score, COUNT(a.Score) AS "count", ((SUM(a.Score) / 10) + COUNT(a.Score)) / 2 AS Total FROM Posts AS a, Posts AS q INNER JOIN PostTags AS qt ON q.Id = qt.PostId INNER JOIN Tags AS t ON t.Id = qt.TagId WHERE a.ParentId = q.Id AND a.PostTypeId = 2 AND a....
sede
CREATE TABLE table_204_379 ( id number, "year" text, "title" text, "hangul" text, "network" text, "further info" text )
between what years was tears of the antarctic shown ?
SELECT "year" FROM table_204_379 WHERE "title" = 'tears of the antarctic'
squall
CREATE TABLE table_20348 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written By" text, "Originalairdate" text, "TV Broadcast" text )
The 'Head of State' episode was authored by which person?
SELECT "Written By" FROM table_20348 WHERE "Title" = 'Head of State'
wikisql
CREATE TABLE table_name_53 ( combined VARCHAR, victories VARCHAR )
Can you tell me the Combined that has the Victories of 14?
SELECT combined FROM table_name_53 WHERE victories = 14
sql_create_context
CREATE TABLE table_name_36 ( tries_for VARCHAR, points_for VARCHAR )
WHAT IS THE TRIES WITH POINTS 190?
SELECT tries_for FROM table_name_36 WHERE points_for = "190"
sql_create_context
CREATE TABLE table_name_84 ( label VARCHAR, release_date VARCHAR )
What Label released an album in August 1996?
SELECT label FROM table_name_84 WHERE release_date = "august 1996"
sql_create_context
CREATE TABLE table_37160 ( "Rank" text, "Scorer" text, "Club" text, "Goals" real, "Matches" text )
Which Rank has Goals larger than 10, and a Scorer of choi sang-kuk?
SELECT "Rank" FROM table_37160 WHERE "Goals" > '10' AND "Scorer" = 'choi sang-kuk'
wikisql
CREATE TABLE enroll ( stu_num VARCHAR ) CREATE TABLE student ( stu_num VARCHAR )
What is the first name of students who got grade C in any class?
SELECT DISTINCT stu_fname FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num = T2.stu_num WHERE enroll_grade = 'C'
sql_create_context
CREATE TABLE table_name_53 ( field_goals INTEGER, points INTEGER )
What is the lowest number of field goals when the points were less than 5?
SELECT MIN(field_goals) FROM table_name_53 WHERE points < 5
sql_create_context
CREATE TABLE table_203_17 ( id number, "name" text, "date of death" text, "ceremony" text, "year" text, "academy award" text, "film" text, "winner" text )
who was awarded an oscar for best sound for two films in the same year - king kong and rocky ?
SELECT "name" FROM table_203_17 WHERE "film" = 'king kong'
squall
CREATE TABLE table_name_94 ( date VARCHAR, home_team VARCHAR )
When was Fitzroy the home team?
SELECT date FROM table_name_94 WHERE home_team = "fitzroy"
sql_create_context
CREATE TABLE table_name_40 ( centennial VARCHAR, del_pueblo VARCHAR )
Which Centennial has a del Pueblo of 1986?
SELECT centennial FROM table_name_40 WHERE del_pueblo = "1986"
sql_create_context
CREATE TABLE table_7310 ( "Ballarat FL" text, "Wins" real, "Byes" real, "Losses" real, "Draws" real, "Against" real )
How many total losses does the team have with an against of 2195 and the draws were greater than 0?
SELECT COUNT("Losses") FROM table_7310 WHERE "Against" = '2195' AND "Draws" > '0'
wikisql
CREATE TABLE table_name_23 ( draws INTEGER, losses VARCHAR, club VARCHAR )
What are the draws of Cobden when there are more than 3 losses?
SELECT AVG(draws) FROM table_name_23 WHERE losses > 3 AND club = "cobden"
sql_create_context
CREATE TABLE table_name_7 ( rank INTEGER, rmax_rpeak___pflops__ VARCHAR )
What is the rank of Rmax Rpeak ( Pflops ) of 17.173 20.133?
SELECT AVG(rank) FROM table_name_7 WHERE rmax_rpeak___pflops__ = "17.173 20.133"
sql_create_context
CREATE TABLE table_203_437 ( id number, "year" number, "laureate" text, "relation" text, "category" text, "rationale" text )
name of the first nobel laureates from penn. .
SELECT "laureate" FROM table_203_437 ORDER BY "year" LIMIT 1
squall
CREATE TABLE table_name_28 ( races INTEGER, points VARCHAR )
What is the number of races that took place with points of 257?
SELECT SUM(races) FROM table_name_28 WHERE points = 257
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 ) ...
provide the number of patients whose gender is f and procedure icd9 code is 5783?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.gender = "F" AND procedures.icd9_code = "5783"
mimicsql_data
CREATE TABLE Rooms ( RoomId TEXT, roomName TEXT, beds INTEGER, bedType TEXT, maxOccupancy INTEGER, basePrice INTEGER, decor TEXT ) CREATE TABLE Reservations ( Code INTEGER, Room TEXT, CheckIn TEXT, CheckOut TEXT, Rate REAL, LastName TEXT, FirstName TEXT, Adul...
how many rooms have king beds? Report the number for each decor type, and rank by the y axis in ascending.
SELECT decor, COUNT(*) FROM Rooms WHERE bedType = "King" GROUP BY decor ORDER BY COUNT(*)
nvbench
CREATE TABLE table_name_93 ( pole_position VARCHAR, round VARCHAR )
What is the pole position of the grand prix with 1 round?
SELECT pole_position FROM table_name_93 WHERE round = 1
sql_create_context
CREATE TABLE jybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH text, BGJGDM text, BGJGMC text, BGRGH text, BGRQ time, BGRXM text, BGSJ time, CJRQ time, JSBBRQSJ time, JSBBSJ time, JYBBH text, JYJGMC text, JYJSGH text, JYJSQM text, JY...
编号7874064的医疗机构天数超过26天的的住院人数提供一下
SELECT COUNT(person_info.RYBH) 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.YLJGD...
css
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,...
卡马西平片的社保三大目录统一编码在医疗就诊87668608517中为多少?
SELECT SOC_SRT_DIRE_CD FROM t_kc22 WHERE MED_CLINIC_ID = '87668608517' AND SOC_SRT_DIRE_NM = '卡马西平片'
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...
在10年11月11日到13年1月13日期间,参保人任博涛购买单一药品的最大购买次数有几次
SELECT COUNT(*) FROM gwyjzb JOIN t_kc22 ON gwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gwyjzb.PERSON_NM = '任博涛' AND t_kc22.STA_DATE BETWEEN '2010-11-11' AND '2013-01-13' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY COUNT(*) DESC LIMIT 1 UNION SELECT COUNT(*) FROM fgwyjzb JOIN t_kc22 ON fgwyjzb.MED_CLINIC_ID = t_kc22....
css
CREATE TABLE table_204_450 ( id number, "year" number, "competition" text, "venue" text, "position" text, "event" text, "notes" text )
lorraine moller 's top time overall was
SELECT MIN("notes") FROM table_204_450
squall
CREATE TABLE table_2461 ( "#" real, "Japanese title" text, "R\u014dmaji" text, "Japanese translation" text, "Vocalist" text, "Episodes used" text )
When momoiro clover z is the vocalist what is the japanese translation?
SELECT "Japanese translation" FROM table_2461 WHERE "Vocalist" = 'Momoiro Clover Z'
wikisql
CREATE TABLE table_12319 ( "Date" text, "Opponents" text, "H / A" text, "Result F \u2013 A" text, "Attendance" real, "League position" text )
What Result F A has a League position of 2nd, and Opponents of liverpool?
SELECT "Result F \u2013 A" FROM table_12319 WHERE "League position" = '2nd' AND "Opponents" = 'liverpool'
wikisql
CREATE TABLE table_11669 ( "Rider" text, "Manufacturer" text, "Laps" real, "Time/Retired" text, "Grid" real )
What was the time/retired for the driver with fewer than 23 laps and grid larger than 23?
SELECT "Time/Retired" FROM table_11669 WHERE "Laps" < '23' AND "Grid" > '23'
wikisql
CREATE TABLE table_name_66 ( venue VARCHAR, country VARCHAR, champion VARCHAR )
Which Venue has a Country of england, and a Champion of alison nicholas?
SELECT venue FROM table_name_66 WHERE country = "england" AND champion = "alison nicholas"
sql_create_context
CREATE TABLE table_45182 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real )
what is the lowest week when the date is september 16, 1979 and the attendance less than 54,212?
SELECT MIN("Week") FROM table_45182 WHERE "Date" = 'september 16, 1979' AND "Attendance" < '54,212'
wikisql
CREATE TABLE table_225100_4 ( reason_for_change VARCHAR, district VARCHAR )
What is the reason for change when maryland 6th is the district?
SELECT reason_for_change FROM table_225100_4 WHERE district = "Maryland 6th"
sql_create_context
CREATE TABLE table_43686 ( "Nationality" text, "Position" text, "Gillingham career" text, "Apps." real, "Goals" real )
Where was the player born when the appearances were greater than 40 and made 17 goals?
SELECT "Nationality" FROM table_43686 WHERE "Apps." > '40' AND "Goals" = '17'
wikisql
CREATE TABLE table_55163 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
On which date did the away team score 10.11 (71)?
SELECT "Date" FROM table_55163 WHERE "Away team score" = '10.11 (71)'
wikisql
CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text ) CREATE TABLE pat...
what was the three most commonly taken laboratory tests during a year before for patients of the age 50s?
SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT t1.itemid FROM (SELECT labevents.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age BETWEEN 50 AND 59) AND DATETIME(labevents.chartti...
mimic_iii
CREATE TABLE table_11323532_2 ( channel VARCHAR, country_region VARCHAR )
What was the number of channels in New Zealand?
SELECT COUNT(channel) FROM table_11323532_2 WHERE country_region = "New Zealand"
sql_create_context
CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int ) CREATE TABLE airline ( airline_code varchar, airline_name ...
what is the cheapest flight from DENVER to OAKLAND
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_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'DENVER' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1....
atis
CREATE TABLE program_course ( program_id int, course_id int, workload int, category varchar ) CREATE TABLE course ( course_id int, name varchar, department varchar, number varchar, credits varchar, advisory_requirement varchar, enforced_requirement varchar, description v...
Most recently , who taught NAVARCH 583 ?
SELECT DISTINCT instructor.name FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN offering_instructor ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN instructor ON offering_instructor.instructor_id = instructor.instructor_id WHERE course_offeri...
advising
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE patient ( ...
how many times on the current hospital encounter has patient 004-79017 received enteral perative?
SELECT COUNT(*) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '004-79017' AND patient.hospitaldischargetime IS NULL)) AND intakeoutput.ce...
eicu
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) ...
what is admission location and discharge location of subject id 84129?
SELECT demographic.admission_location, demographic.discharge_location FROM demographic WHERE demographic.subject_id = "84129"
mimicsql_data
CREATE TABLE table_45184 ( "Date" text, "Opponent" text, "Venue" text, "Result" text, "Attendance" text, "Competition" text, "Man of the Match" text )
Which venue had a lost 5-4 result?
SELECT "Venue" FROM table_45184 WHERE "Result" = 'lost 5-4'
wikisql
CREATE TABLE table_67476 ( "Party" text, "Party List votes" real, "Vote percentage" text, "Total Seats" real, "Seat percentage" text )
What is the highest total number of seats with a Seat percentage of 46.5% and less than 394,118 party list votes?
SELECT MAX("Total Seats") FROM table_67476 WHERE "Seat percentage" = '46.5%' AND "Party List votes" < '394,118'
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 fzzmzjzjlb ( HXPLC number, HZ...
门诊就诊59680222876中病人的舒张压、身高、体重、体温、收缩压、心率、呼吸频率、脉率数据是多少?
SELECT zzmzjzjlb.SG, zzmzjzjlb.TZ, zzmzjzjlb.TW, zzmzjzjlb.SSY, zzmzjzjlb.SZY, zzmzjzjlb.XL, zzmzjzjlb.HXPLC, zzmzjzjlb.ML FROM zzmzjzjlb WHERE zzmzjzjlb.JZLSH = '59680222876' UNION SELECT fzzmzjzjlb.SG, fzzmzjzjlb.TZ, fzzmzjzjlb.TW, fzzmzjzjlb.SSY, fzzmzjzjlb.SZY, fzzmzjzjlb.XL, fzzmzjzjlb.HXPLC, fzzmzjzjlb.ML FROM fz...
css
CREATE TABLE table_63212 ( "Model number" text, "sSpec number" text, "Cores" text, "Frequency" text, "Turbo" text, "L2 cache" text, "L3 cache" text, "GPU model" text, "GPU frequency" text, "Socket" text, "I/O bus" text, "Release date" text, "Part number(s)" text, ...
What was the frequency of the Core i7-3610QE?
SELECT "Frequency" FROM table_63212 WHERE "Model number" = 'core i7-3610qe'
wikisql
CREATE TABLE table_17323042_11 ( record VARCHAR, high_points VARCHAR )
What was the W-L record when HIgh Points was andre miller (30)?
SELECT record FROM table_17323042_11 WHERE high_points = "Andre Miller (30)"
sql_create_context
CREATE TABLE table_name_37 ( Id VARCHAR )
What 2008 has 2013 for the year 2013?
SELECT 2008 FROM table_name_37 WHERE "2013" = "2013"
sql_create_context
CREATE TABLE diagnoses ( 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, ...
give the number of female patients whose primary disease is squamous cell carcinoma oral tongue/sda.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "F" AND demographic.diagnosis = "SQUAMOUS CELL CARCINOMA ORAL TONGUE/SDA"
mimicsql_data
CREATE TABLE table_72598 ( "Tournament" text, "Country" text, "Location" text, "Current Venue" text, "Began" real, "Court surface" text )
Which current venues location is Mason, Ohio?
SELECT "Current Venue" FROM table_72598 WHERE "Location" = 'Mason, Ohio'
wikisql
CREATE TABLE geographic ( city_name varchar, county varchar, region varchar ) CREATE TABLE restaurant ( id int, name varchar, food_type varchar, city_name varchar, rating "decimal ) CREATE TABLE location ( restaurant_id int, house_number int, street_name varchar, city_n...
where is a good arabic restaurant in mountain view ?
SELECT location.house_number, restaurant.name FROM location, restaurant WHERE location.city_name = 'mountain view' AND restaurant.food_type = 'arabic' AND restaurant.id = location.restaurant_id AND restaurant.rating > 2.5
restaurants
CREATE TABLE table_6338 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text )
result is lost re-election republican gain, what is the district?
SELECT "District" FROM table_6338 WHERE "Result" = 'lost re-election republican gain'
wikisql