context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_50208 ( "Opposing Team" text, "Against" real, "Date" text, "Venue" text, "Round" text )
What was the date when the against was 3?
SELECT "Date" FROM table_50208 WHERE "Against" = '3'
wikisql
CREATE TABLE table_name_77 ( silver INTEGER, gold VARCHAR, bronze VARCHAR, sport VARCHAR )
What is the lowest Silver in the Total Sport has less than 1 Gold and more than 1 Bronze?
SELECT MIN(silver) FROM table_name_77 WHERE bronze > 1 AND sport = "total" AND gold < 1
sql_create_context
CREATE TABLE table_53435 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Leading scorer" text, "Attendance" real, "Record" text )
Who was the leading scorer on 23 February 2008?
SELECT "Leading scorer" FROM table_53435 WHERE "Date" = '23 february 2008'
wikisql
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE diagnosis ( diagnosisid number...
tell me the name of the drug that patient 010-32430 was prescribed with in the same day after being diagnosed until 60 months ago with acute coronary syndrome?
SELECT t2.drugname FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '010-32430') AND diagnosis.diagnos...
eicu
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time...
is the heartrate of patient 035-11300 normal in the first hospital encounter?
SELECT COUNT(*) > 0 FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '035-11300' AND NOT patient.hospitaldischargetime IS NULL ORDER BY pa...
eicu
CREATE TABLE table_49336 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text, "Money ( $ )" real )
what is the to par when the place is t10 and the score is 72-74-71-69=286?
SELECT "To par" FROM table_49336 WHERE "Place" = 't10' AND "Score" = '72-74-71-69=286'
wikisql
CREATE TABLE table_13758945_3 ( losing_bonus VARCHAR, won VARCHAR, points_against VARCHAR )
how many losing bonus with won being 10 and points against being 283
SELECT COUNT(losing_bonus) FROM table_13758945_3 WHERE won = "10" AND points_against = "283"
sql_create_context
CREATE TABLE table_80047 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Time" text, "Att." text, "Record" text )
Who lost on August 27?
SELECT "Loss" FROM table_80047 WHERE "Date" = 'august 27'
wikisql
CREATE TABLE table_21427 ( "Season" real, "Series" text, "Team" text, "Races" real, "Wins" real, "Poles" real, "FLaps" real, "Podiums" real, "Points" real, "Position" text )
What was the position for the Josef Kaufmann Racing team?
SELECT "Position" FROM table_21427 WHERE "Team" = 'Josef Kaufmann Racing'
wikisql
CREATE TABLE table_62744 ( "Name" text, "Feature" text, "Latitude" text, "Longitude" text, "Distance" text, "Bearing" text )
what is the distance for mj kollen?
SELECT "Distance" FROM table_62744 WHERE "Name" = 'mjåkollen'
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 demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
how many female patients had an emergency admission type?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "F" AND demographic.admission_type = "EMERGENCY"
mimicsql_data
CREATE TABLE table_name_7 ( multi_1 VARCHAR, model_number VARCHAR, frequency VARCHAR, release_date VARCHAR )
Which Multi 1 has a Frequency of 2300mhz, and a Release date of q3 2008 and a Model number of turion x2 ultra zm-84?
SELECT multi_1 FROM table_name_7 WHERE frequency = "2300mhz" AND release_date = "q3 2008" AND model_number = "turion x2 ultra zm-84"
sql_create_context
CREATE TABLE table_20830 ( "Children/Women over 15" real, "Oblast\\Age of women" text, "15 to 17" real, "18 to 19" real, "20 to 24" real, "25 to 29" real, "30 to 34" real, "35 to 39" real, "40 to 44" real, "45 to 49" real, "50 to 54" real, "55 to 59" real, "60 to 64" ...
If 70+ is 2554, what is the 25 to 29 amount?
SELECT "25 to 29" FROM table_20830 WHERE "70+" = '2554'
wikisql
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 vitalperiodi...
calculate patient 010-19726's stay length of the last stay in the icu.
SELECT STRFTIME('%j', patient.unitdischargetime) - STRFTIME('%j', patient.unitadmittime) FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '010-19726') AND NOT patient.unitadmittime IS NULL ORDER BY patient.unitadmittime DESC LIMIT 1
eicu
CREATE TABLE table_20403667_2 ( village INTEGER, house_affected VARCHAR )
What is the largest village that had 103279 houses affected?
SELECT MAX(village) FROM table_20403667_2 WHERE house_affected = 103279
sql_create_context
CREATE TABLE table_name_2 ( duration VARCHAR, character VARCHAR )
How many years did the soap opera run in which the character Clemens Richter was included?
SELECT duration FROM table_name_2 WHERE character = "clemens richter"
sql_create_context
CREATE TABLE table_2781227_9 ( position VARCHAR, college_junior_club_team VARCHAR )
What position does krylja sovetov (russia) play?
SELECT position FROM table_2781227_9 WHERE college_junior_club_team = "Krylja Sovetov (Russia)"
sql_create_context
CREATE TABLE table_name_70 ( runner_up VARCHAR, prize VARCHAR )
What is 3rd Place, when Runner-Up is 'Simon Ehne', and when Prize is $100,000?
SELECT 3 AS rd_place FROM table_name_70 WHERE runner_up = "simon ehne" AND prize = "$100,000"
sql_create_context
CREATE TABLE table_17078 ( "Player" text, "Position" text, "School" text, "Hometown" text, "College" text )
Which college has the player Rushel Shell?
SELECT "College" FROM table_17078 WHERE "Player" = 'Rushel Shell'
wikisql
CREATE TABLE table_name_72 ( status VARCHAR, moving_to VARCHAR )
What is the status of the player who is moving to Nantes?
SELECT status FROM table_name_72 WHERE moving_to = "nantes"
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 cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, ...
calculate the number of patients who have been prescribed belatacept study drug (*ind*) since 2105.
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT prescriptions.hadm_id FROM prescriptions WHERE prescriptions.drug = 'belatacept study drug (*ind*)' AND STRFTIME('%y', prescriptions.startdate) >= '2105')
mimic_iii
CREATE TABLE table_29063 ( "Date" text, "Time" text, "Visiting team" text, "Home team" text, "Site" text, "Broadcast" text, "Result" text, "Attendance" real )
Name the broadcast for davis-wade stadium starkville ms
SELECT "Broadcast" FROM table_29063 WHERE "Site" = 'Davis-Wade Stadium • Starkville MS'
wikisql
CREATE TABLE user_profiles ( Id VARCHAR )
How many users are there?
SELECT COUNT(*) FROM user_profiles
sql_create_context
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 ...
what were the drugs which were added to patient 90663 today compared to the ones yesterday?
SELECT prescriptions.drug FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 90663) AND DATETIME(prescriptions.startdate, 'start of day') = DATETIME(CURRENT_TIME(), 'start of day', '-0 day') EXCEPT SELECT prescriptions.drug FROM prescriptions WHERE...
mimic_iii
CREATE TABLE lapTimes ( raceId INTEGER, driverId INTEGER, lap INTEGER, position INTEGER, time TEXT, milliseconds INTEGER ) CREATE TABLE races ( raceId INTEGER, year INTEGER, round INTEGER, circuitId INTEGER, name TEXT, date TEXT, time TEXT, url TEXT ) CREATE TAB...
What are the numbers of races for each constructor id. Show the correlation.
SELECT COUNT(*), constructorId FROM constructorStandings GROUP BY constructorId
nvbench
CREATE TABLE table_28061 ( "Player" text, "Touchdowns" real, "Extra points" real, "Field goals" real, "Points" real )
How many points did Donald Green score?
SELECT COUNT("Points") FROM table_28061 WHERE "Player" = 'Donald Green'
wikisql
CREATE TABLE table_25604014_5 ( written_by VARCHAR, no_in_series VARCHAR )
Who wrote episode number 81 in the series?
SELECT written_by FROM table_25604014_5 WHERE no_in_series = 81
sql_create_context
CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) CREATE TABLE code_description ( code varchar, description text ) C...
show me all DAILY flights from MILWAUKEE to ORLANDO
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 = 'MILWAUKEE' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'ORL...
atis
CREATE TABLE table_27091128_2 ( date_of_appointment VARCHAR, replaced_by VARCHAR )
What was date of appointment for Erg n Penbe?
SELECT date_of_appointment FROM table_27091128_2 WHERE replaced_by = "Ergün Penbe"
sql_create_context
CREATE TABLE table_5854 ( "Designation" text, "Car numbers" text, "Manufacturer" text, "Model No." text, "First used" text, "Quantity" real )
Which model number does bombardier manufacture?
SELECT "Model No." FROM table_5854 WHERE "Manufacturer" = 'bombardier'
wikisql
CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW text, JCZBJGDX text, JCZBMC text, JLDW text, JYRQ time, JYZBLSH text, ...
05037621患者的颈部的各项指标检验结果的数据是什么样子的?
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_name_25 ( nationality VARCHAR, player VARCHAR )
What is tom cassidy's nationality?
SELECT nationality FROM table_name_25 WHERE player = "tom cassidy"
sql_create_context
CREATE TABLE table_2166 ( "Map number" real, "English name" text, "Finnish name" text, "Swedish name" text, "Residence city" text, "Dates of existence" text, "Notes" text )
How many residence cities have an English name of Province of Viborg and Nyslott?
SELECT COUNT("Residence city") FROM table_2166 WHERE "English name" = 'Province of Viborg and Nyslott'
wikisql
CREATE TABLE d_labitems ( row_id number, itemid number, label 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 diagnoses_icd ( ...
how much heparin sodium was prescribed on the last hospital visit for the last time to patient 14621?
SELECT prescriptions.dose_val_rx FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 14621 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1) AND prescriptions.drug = 'heparin sodium' ORDER BY prescriptions.startdate DE...
mimic_iii
CREATE TABLE table_name_86 ( year_s__won VARCHAR, to_par VARCHAR, total VARCHAR )
WHAT YEAR HAS A TO PAR SMALLER THAN 16, TOTAL 151?
SELECT year_s__won FROM table_name_86 WHERE to_par < 16 AND total = 151
sql_create_context
CREATE TABLE table_1354805_3 ( total VARCHAR, number_of_dances VARCHAR, competition_finish VARCHAR )
What is the Number of dances is 11 and competition finish is larger than 2.0 total
SELECT total FROM table_1354805_3 WHERE number_of_dances = 11 AND competition_finish > 2.0
sql_create_context
CREATE TABLE table_name_12 ( round INTEGER, time VARCHAR )
What is the lowest round number for the fight that had a time of 1:09?
SELECT MIN(round) FROM table_name_12 WHERE time = "1:09"
sql_create_context
CREATE TABLE table_name_35 ( ebit__us_ VARCHAR, revenue__us_$million_ VARCHAR, net_profit__us_$m_ VARCHAR )
COunt the EBIT (US $m) which has a Revenue (US $million) larger than 434.8 and a Net profit (US $m) larger than 96.4?
SELECT COUNT(ebit__us_) AS $m_ FROM table_name_35 WHERE revenue__us_$million_ > 434.8 AND net_profit__us_$m_ > 96.4
sql_create_context
CREATE TABLE table_79155 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text, "Money ( \u00a3 )" real )
What is Lee Westwood's score?
SELECT "Score" FROM table_79155 WHERE "Player" = 'lee westwood'
wikisql
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...
what is the number of patients on ih route of drug administration who have regional enteritis of unspecified site diagnoses?
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 = "Regional enteritis of unspecified site" AND prescriptions.route = "IH"
mimicsql_data
CREATE TABLE table_26231 ( "No" real, "Player" text, "Height (m)" text, "Height (f)" text, "Position" text, "Year born" real, "Current Club" text )
For all players playing at the center, list the height in feet.
SELECT "Height (f)" FROM table_26231 WHERE "Position" = 'Center'
wikisql
CREATE TABLE table_37345 ( "Date" text, "Opponent" text, "Result" text, "Score" text, "Record" text, "Streak" text )
What is the game that has the phoenix suns as the opponent played against?
SELECT "Result" FROM table_37345 WHERE "Opponent" = 'phoenix suns'
wikisql
CREATE TABLE table_21877 ( "Season" real, "Date" text, "Winning Driver" text, "Car #" real, "Sponsor" text, "Make" text, "Team" text, "Avg Speed" text, "Margin of Victory" text )
Who was the winning driver for Hendrick Motorsports in a Chevrolet Impala SS?
SELECT "Winning Driver" FROM table_21877 WHERE "Team" = 'Hendrick Motorsports' AND "Make" = 'Chevrolet Impala SS'
wikisql
CREATE TABLE SportsInfo ( StuID INTEGER, SportName VARCHAR(32), HoursPerWeek INTEGER, GamesPlayed INTEGER, OnScholarship VARCHAR(1) ) CREATE TABLE Video_Games ( GameID INTEGER, GName VARCHAR(40), GType VARCHAR(40) ) CREATE TABLE Plays_Games ( StuID INTEGER, GameID INTEGER, ...
A scatter chart about what are ids and total number of hours played for each game?
SELECT GameID, SUM(Hours_Played) FROM Plays_Games GROUP BY GameID
nvbench
CREATE TABLE table_58259 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What did the home team score when Carlton played as the Away team?
SELECT "Home team score" FROM table_58259 WHERE "Away team" = 'carlton'
wikisql
CREATE TABLE table_name_64 ( venue VARCHAR, date VARCHAR )
I want the venue for 23 july 1992
SELECT venue FROM table_name_64 WHERE date = "23 july 1992"
sql_create_context
CREATE TABLE table_3614 ( "District" text, "Incumbent" text, "Party" text, "First elected" text, "Result" text, "Candidates" text )
Name the district for hugh glasgow
SELECT "District" FROM table_3614 WHERE "Incumbent" = 'Hugh Glasgow'
wikisql
CREATE TABLE table_204_843 ( id number, "volume" number, "year" text, "names" text, "articles" number, "pages" number, "images" number, "maps" number, "number of copies" number )
for how many years was the encyclopedia printed ?
SELECT COUNT("year") FROM table_204_843
squall
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...
how many patients whose ethnicity is asian and procedure short title is open reduc-int fix femur?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.ethnicity = "ASIAN" AND procedures.short_title = "Open reduc-int fix femur"
mimicsql_data
CREATE TABLE table_26108103_2 ( opponent VARCHAR, rushing_yards VARCHAR )
Who was the opponent when there was 117 rushing yards?
SELECT opponent FROM table_26108103_2 WHERE rushing_yards = 117
sql_create_context
CREATE TABLE table_54220 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real )
What are the highest number of laps for grid 8?
SELECT MAX("Laps") FROM table_54220 WHERE "Grid" = '8'
wikisql
CREATE TABLE table_40722 ( "Player" text, "Nationality" text, "Position" text, "Years in Orlando" text, "School/Club Team" text )
What school/club team did Amal McCaskill play for?
SELECT "School/Club Team" FROM table_40722 WHERE "Player" = 'amal mccaskill'
wikisql
CREATE TABLE diagnoses_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 admissions ( row_id number, subject_id number, hadm_id number, admittime tim...
did patient 63676 undergo a opn reduct malar/zygo fx procedure during this year?
SELECT COUNT(*) > 0 FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'opn reduct malar/zygo fx') AND procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 63676) AND DATETIME(pr...
mimic_iii
CREATE TABLE table_40256 ( "Rider" text, "Manufacturer" text, "Laps" real, "Time/Retired" text, "Grid" real )
What was the average number of laps completed by KTM riders, with times of +56.440 and grid values under 11?
SELECT AVG("Laps") FROM table_40256 WHERE "Manufacturer" = 'ktm' AND "Time/Retired" = '+56.440' AND "Grid" < '11'
wikisql
CREATE TABLE Parts ( part_id INTEGER, part_name VARCHAR(255), chargeable_yn VARCHAR(1), chargeable_amount VARCHAR(20), other_part_details VARCHAR(255) ) CREATE TABLE Engineer_Skills ( engineer_id INTEGER, skill_id INTEGER ) CREATE TABLE Staff ( staff_id INTEGER, staff_name VARCHAR(...
A stacked bar about the number of faults for different fault description and fault status of all the faults recoreded in the logs.
SELECT fault_status, COUNT(fault_status) FROM Fault_Log AS T1 JOIN Fault_Log_Parts AS T2 ON T1.fault_log_entry_id = T2.fault_log_entry_id GROUP BY fault_description, fault_status
nvbench
CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, Creati...
Limiting Posts by Date - Questions Only (Tutorial).
SELECT Title, Id, PostTypeId FROM Posts WHERE CreationDate BETWEEN '2014-07-01' AND '2014-07-31' AND PostTypeId = 1
sede
CREATE TABLE music_festival ( ID int, Music_Festival text, Date_of_ceremony text, Category text, Volume int, Result text ) CREATE TABLE artist ( Artist_ID int, Artist text, Age int, Famous_Title text, Famous_Release_date text ) CREATE TABLE volume ( Volume_ID int, V...
A bar chart for returning the number of the categories of music festivals that have the result 'Awarded', and I want to rank y-axis in desc order please.
SELECT Category, COUNT(Category) FROM music_festival WHERE Result = "Awarded" GROUP BY Category ORDER BY COUNT(Category) DESC
nvbench
CREATE TABLE table_1682026_6 ( profits__billion_$_ VARCHAR, market_value__billion_$_ VARCHAR )
what is the amount of profits in billions for companies with a market value of 204.9 billion?
SELECT profits__billion_$_ FROM table_1682026_6 WHERE market_value__billion_$_ = "204.9"
sql_create_context
CREATE TABLE table_21443 ( "1st throw" real, "2nd throw" real, "3rd throw" real, "Equation" text, "Result" real )
If the equation is 6 9 + 6 9 + 6, what is the 2nd throw?
SELECT MAX("2nd throw") FROM table_21443 WHERE "Equation" = '6 × 9² + 6 × 9 + 6'
wikisql
CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH text, KH text, KLX number, MZBMLX number, MZJZLSH text, MZZDBM text, MZZDMC text, MZZYZDZZBM...
在医疗就诊80645619078中给72701230这个病人做检验的科室是哪些?科室编码是什么
SELECT jybgb.JYKSBM, jybgb.JYKSMC FROM jybgb WHERE jybgb.JZLSH = '80645619078'
css
CREATE TABLE table_9035 ( "Official Name" text, "Status" text, "Area km 2" real, "Population" real, "Census Ranking" text )
What status has 10 as the population?
SELECT "Status" FROM table_9035 WHERE "Population" = '10'
wikisql
CREATE TABLE table_48750 ( "Rank" real, "Team" text, "Played" real, "Wins" real, "Ties" real, "Losses" real, "Points" real )
What is the highest Wins, when Rank is greater than 2, and when Played is less than 5?
SELECT MAX("Wins") FROM table_48750 WHERE "Rank" > '2' AND "Played" < '5'
wikisql
CREATE TABLE genre ( g_name text, rating text, most_popular_in text ) CREATE TABLE artist ( artist_name text, country text, gender text, preferred_genre text ) CREATE TABLE song ( song_name text, artist_name text, country text, f_id number, genre_is text, rating num...
What are the top 3 artists with the largest number of songs in the language Bangla?
SELECT T1.artist_name FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T2.languages = "bangla" GROUP BY T2.artist_name ORDER BY COUNT(*) DESC LIMIT 3
spider
CREATE TABLE event ( Event_ID int, Date text, Venue text, Name text, Event_Attendance int ) CREATE TABLE journalist ( journalist_ID int, Name text, Nationality text, Age text, Years_working int ) CREATE TABLE news_report ( journalist_ID int, Event_ID int, Work_Type ...
Draw a bar chart of nationality versus the average of age
SELECT Nationality, AVG(Age) FROM journalist GROUP BY Nationality
nvbench
CREATE TABLE table_name_62 ( weight__kg_ INTEGER, birthdate VARCHAR, jersey__number VARCHAR, position VARCHAR )
What is the lightest Weight (kg), when the Jersey # is greater than 22, when the Position is F, and when the Birthdate is March 19, 1980?
SELECT MIN(weight__kg_) FROM table_name_62 WHERE jersey__number > 22 AND position = "f" AND birthdate = "march 19, 1980"
sql_create_context
CREATE TABLE table_name_6 ( date VARCHAR, record VARCHAR )
On what date was there a record of 76-72?
SELECT date FROM table_name_6 WHERE record = "76-72"
sql_create_context
CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE ReviewTaskResultTypes ( Id number, Name te...
Comments on questions containing the substring 'close'.
SELECT c.Id AS "comment_link", c.CreationDate, c.Score FROM Comments AS c INNER JOIN Posts AS q ON q.Id = c.PostId WHERE (LOWER(Text) LIKE '%close%' AND q.PostTypeId = 1) ORDER BY c.CreationDate DESC
sede
CREATE TABLE table_66314 ( "Pick" real, "Player" text, "Team" text, "Position" text, "School" text )
What school did P Jay Gehrke of the Kansas City Royals attend?
SELECT "School" FROM table_66314 WHERE "Position" = 'p' AND "Team" = 'kansas city royals' AND "Player" = 'jay gehrke'
wikisql
CREATE TABLE Tryout ( pID numeric(5,0), cName varchar(20), pPos varchar(8), decision varchar(3) ) CREATE TABLE College ( cName varchar(20), state varchar(2), enr numeric(5,0) ) CREATE TABLE Player ( pID numeric(5,0), pName varchar(20), yCard varchar(3), HS numeric(5,0) )
Compare the smallest enrollment of schools in each state using a bar chart, order by the Y-axis in descending please.
SELECT cName, MIN(enr) FROM College GROUP BY state ORDER BY MIN(enr) DESC
nvbench
CREATE TABLE table_name_10 ( decision VARCHAR, record VARCHAR )
For the game ending with a record of 31-43-2, what was the decision?
SELECT decision FROM table_name_10 WHERE record = "31-43-2"
sql_create_context
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE cost ( costid number, ...
how many patients were prescribed with rocuronium bromide within 2 months after having undergone pulmonary medicine consultation.
SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'pulmonary medicine consultation') AS t1 JOIN (SELECT patient.uniquepid, medication.drugstarttime FROM medica...
eicu
CREATE TABLE table_name_31 ( type VARCHAR, name VARCHAR )
What is the Type for l. publilius philo vulscus?
SELECT type FROM table_name_31 WHERE name = "l. publilius philo vulscus"
sql_create_context
CREATE TABLE table_name_30 ( assists INTEGER, name VARCHAR )
What's the largest amount of assists juan ignacio s nchez ever had?
SELECT MAX(assists) FROM table_name_30 WHERE name = "juan ignacio sánchez"
sql_create_context
CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDispl...
Find unanswered questions for specific tag. This query returns a list of all questions that have zero answers. The questions returned are not closed.
SELECT t.TagName, p.Id AS "post_link", p.Score, p.ViewCount 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 p.PostTypeId = 1 AND p.ClosedDate IS NULL AND p.AnswerCount = 0 AND t.TagName LIKE '##TagName:string##'
sede
CREATE TABLE table_name_31 ( date VARCHAR, race VARCHAR )
What Date is Northern Spur Breeders' Cup Stakes Race?
SELECT date FROM table_name_31 WHERE race = "northern spur breeders' cup stakes"
sql_create_context
CREATE TABLE table_204_598 ( id number, "name" text, "state of residence" text, "took office" text, "left office" text, "president served under" text )
who was the last senior advisor to be named in 2013 ?
SELECT "name" FROM table_204_598 WHERE "took office" = 2013 ORDER BY "took office" DESC LIMIT 1
squall
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 ( ...
what is the number of patients whose admission year is less than 2179 and diagnoses icd9 code is 99591?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2179" AND diagnoses.icd9_code = "99591"
mimicsql_data
CREATE TABLE table_26654 ( "District" text, "Vacator" text, "Reason for Vacancy" text, "Successor" text, "Date of successors taking office" text )
When frederick remann (r) is the vacator what is the reason for vacancy?
SELECT "Reason for Vacancy" FROM table_26654 WHERE "Vacator" = 'Frederick Remann (R)'
wikisql
CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, COM_PAY number, DATA_ID text, ENT_ACC_PAY number, ENT_PAY number, F...
在编码为2985604的医院中给患者施颖秀开出的单价最高的药品编码和名称及其单价都有什么吗?
SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM, t_kc22.UNIVALENT FROM t_kc22 WHERE t_kc22.MED_CLINIC_ID IN (SELECT gwyjzb.MED_CLINIC_ID FROM gwyjzb WHERE gwyjzb.PERSON_NM = '施颖秀' AND gwyjzb.MED_SER_ORG_NO = '2985604' UNION SELECT fgwyjzb.MED_CLINIC_ID FROM fgwyjzb WHERE fgwyjzb.PERSON_NM = '施颖秀' AND fgwyjzb.MED_...
css
CREATE TABLE ftxmzjzjlb ( 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, MZZYZD...
97259664233那个门诊就诊中患者的身高、体重、体温、收缩压、舒张压、心率、呼吸频率和脉率分别是怎样的
SELECT txmzjzjlb.SG, txmzjzjlb.TZ, txmzjzjlb.TW, txmzjzjlb.SSY, txmzjzjlb.SZY, txmzjzjlb.XL, txmzjzjlb.HXPLC, txmzjzjlb.ML FROM txmzjzjlb WHERE txmzjzjlb.JZLSH = '97259664233' UNION SELECT ftxmzjzjlb.SG, ftxmzjzjlb.TZ, ftxmzjzjlb.TW, ftxmzjzjlb.SSY, ftxmzjzjlb.SZY, ftxmzjzjlb.XL, ftxmzjzjlb.HXPLC, ftxmzjzjlb.ML FROM ft...
css
CREATE TABLE table_name_87 ( order_of_succession VARCHAR, department VARCHAR )
What was the order of succession for the department of education?
SELECT order_of_succession FROM table_name_87 WHERE department = "education"
sql_create_context
CREATE TABLE table_name_35 ( length VARCHAR, shoulder VARCHAR )
What is the length of the gun that has a shoulder measurement of 12.18 (.480)?
SELECT length FROM table_name_35 WHERE shoulder = "12.18 (.480)"
sql_create_context
CREATE TABLE table_test_26 ( "id" int, "bleeding" int, "left_ventricular_ejection_fraction_lvef" int, "left_main_coronary_artery_disease" bool, "uncontrolled_diabetes" bool, "hiv_infection" bool, "hemoglobin_a1c_hba1c" float, "hepatitis_b_infection" bool, "renal_disease" bool, "u...
left main coronary artery disease with 50 % stenosis
SELECT * FROM table_test_26 WHERE left_main_coronary_artery_disease = 1 AND stenosis = 50
criteria2sql
CREATE TABLE table_name_59 ( elevation_msnm VARCHAR, population_censo_2007_hab_ VARCHAR )
What is the elevation msnm for a population censo 2007(hab) of 77.392*?
SELECT elevation_msnm FROM table_name_59 WHERE population_censo_2007_hab_ = "77.392*"
sql_create_context
CREATE TABLE table_36712 ( "Editor" text, "Site" text, "Style, clone of" text, "Cost ( US$ )" text, "Open source" text, "Activity" text )
Which site has a Cost free and a Editor of jsvi?
SELECT "Site" FROM table_36712 WHERE "Cost ( US$ )" = 'free' AND "Editor" = 'jsvi'
wikisql
CREATE TABLE table_47524 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" text )
On what date was the opponent the Green Bay Packers?
SELECT "Date" FROM table_47524 WHERE "Opponent" = 'green bay packers'
wikisql
CREATE TABLE table_1213511_2 ( nhl_team VARCHAR, player VARCHAR )
How many NHL teams does Terry French play for?
SELECT COUNT(nhl_team) FROM table_1213511_2 WHERE player = "Terry French"
sql_create_context
CREATE TABLE table_4407 ( "Rank" real, "Scorer" text, "Club" text, "Goals" real, "Assists" real, "Points" real )
What is the average amount of assists with a rank higher than 6 and goals 10 and the scorer is Robert Ukrop
SELECT AVG("Assists") FROM table_4407 WHERE "Rank" > '6' AND "Goals" = '10' AND "Scorer" = 'robert ukrop'
wikisql
CREATE TABLE Documents ( Document_ID INTEGER, Document_Type_Code CHAR(15), Project_ID INTEGER, Document_Date DATETIME, Document_Name VARCHAR(255), Document_Description VARCHAR(255), Other_Details VARCHAR(255) ) CREATE TABLE Ref_Budget_Codes ( Budget_Type_Code CHAR(15), Budget_Type_D...
how many documents are with document type code BK for each product id?
SELECT COUNT(*), Project_ID FROM Documents WHERE Document_Type_Code = "BK" GROUP BY Project_ID
nvbench
CREATE TABLE table_11249 ( "Player" text, "Rec." real, "Yards" text, "Avg." text, "TD's" real, "Long" text )
Which Rec has Jerel Myers as the Player?
SELECT "Rec." FROM table_11249 WHERE "Player" = 'jerel myers'
wikisql
CREATE TABLE table_12953 ( "Player" text, "Country" text, "Year(s) won" text, "Total" real, "To par" text, "Finish" text )
What is the to par when the total is larger than 288?
SELECT "To par" FROM table_12953 WHERE "Total" > '288'
wikisql
CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId n...
Votes on post by users.
SELECT PostId AS "post_link", t.Name, UserId AS "user_link", CreationDate FROM Votes LEFT JOIN VoteTypes AS t ON Votes.VoteTypeId = t.Id WHERE PostId = @PostId
sede
CREATE TABLE table_name_58 ( result VARCHAR, order__number VARCHAR, week__number VARCHAR )
What is the Result when the order is # 4, and the week # is top 12?
SELECT result FROM table_name_58 WHERE order__number = "4" AND week__number = "top 12"
sql_create_context
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, heavy_papers int, cares_for_students int, heavy_assignments ...
During the Spring and Summer term , what is the number of 100 -level classes offered ?
SELECT COUNT(DISTINCT course.course_id, semester.semester) FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'department0' AND course.number BETWEEN 100 AND 100 + 100 AND semester.semester IN ('SP', 'SS', 'SU') AND semester.semester_id = course_offering.se...
advising
CREATE TABLE table_59328 ( "Years" text, "Type" text, "Original code" text, "Current code" text, "Location" text )
What is the location for the club trophy?
SELECT "Location" FROM table_59328 WHERE "Type" = 'club trophy'
wikisql
CREATE TABLE Dorm ( dormid INTEGER, dorm_name VARCHAR(20), student_capacity INTEGER, gender VARCHAR(1) ) CREATE TABLE Has_amenity ( dormid INTEGER, amenid INTEGER ) CREATE TABLE Dorm_amenity ( amenid INTEGER, amenity_name VARCHAR(25) ) CREATE TABLE Lives_in ( stuid INTEGER, do...
Display a bar chart for how many students are from each city, and which cities have more than one cities?, and sort X-axis from high to low order.
SELECT city_code, COUNT(*) FROM Student GROUP BY city_code ORDER BY city_code DESC
nvbench
CREATE TABLE table_54995 ( "Position" real, "Album Title" text, "Artist" text, "Highest Position" real, "Sales" real )
What is the average high position for the album unwritten?
SELECT AVG("Highest Position") FROM table_54995 WHERE "Album Title" = 'unwritten'
wikisql
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, ...
what is the number of patients whose diagnoses short title is rec depr psych-psychotic and drug type is base?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Rec depr psych-psychotic" AND prescriptions.drug_type = "BASE"
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 whose primary disease is liver transplant and procedure short title is skin & subq dx proc nec.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.diagnosis = "LIVER TRANSPLANT" AND procedures.short_title = "Skin & subq dx proc NEC"
mimicsql_data
CREATE TABLE table_name_22 ( cover_model VARCHAR, centerfold_model VARCHAR )
Which Cover model has a Centerfold model of scarlett keegan?
SELECT cover_model FROM table_name_22 WHERE centerfold_model = "scarlett keegan"
sql_create_context