context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
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 procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, ...
calculate how many times patient 14611 had had a dressing of wound nec until 2102.
SELECT COUNT(*) FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'dressing of wound nec') AND procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 14611) AND STRFTIME('%y', pro...
mimic_iii
CREATE TABLE table_15277629_1 ( original_title VARCHAR, director VARCHAR )
Name the original title of the Suzana Amaral film
SELECT original_title FROM table_15277629_1 WHERE director = "Suzana Amaral"
sql_create_context
CREATE TABLE table_13463 ( "Japanese Title" text, "Romaji Title" text, "TV Station" text, "Episodes" text, "Average Ratings" text )
What are the Ratings of Japanese Title episode 11 on Fuji TV station?
SELECT "Average Ratings" FROM table_13463 WHERE "Episodes" = '11' AND "TV Station" = 'fuji tv' AND "Japanese Title" = 'プロポーズ大作戦'
wikisql
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE diagnoses_icd ( ...
what was the name of the intake that patient 7524 had a first until 02/04/2104?
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 = 7524)) AND STRFTIME('%y-%m-%d', inpu...
mimic_iii
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 age is less than 79 and drug route is id?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "79" AND prescriptions.route = "ID"
mimicsql_data
CREATE TABLE table_2286 ( "Type" text, "Beam height (mm)" real, "Flange width (mm)" real, "Web thickness (mm)" text, "Flange thickness (mm)" text, "Weight (kg/m)" text, "Cross-section area (cm 2 )" text, "Moment of inertia in torsion (J) (cm 4 )" text )
How many weights are there when the flange with is 304?
SELECT COUNT("Weight (kg/m)") FROM table_2286 WHERE "Flange width (mm)" = '304'
wikisql
CREATE TABLE files ( f_id number(10), artist_name varchar2(50), file_size varchar2(20), duration varchar2(20), formats varchar2(20) ) CREATE TABLE artist ( artist_name varchar2(50), country varchar2(20), gender varchar2(20), preferred_genre varchar2(50) ) CREATE TABLE genre ( g...
Let the shortest duration as bar chart's X-axis and the most poorly rated song for each genre as the Y.
SELECT MIN(T1.duration), MIN(T2.rating) FROM files AS T1 JOIN song AS T2 ON T1.f_id = T2.f_id GROUP BY MIN(T1.duration)
nvbench
CREATE TABLE table_name_89 ( date VARCHAR, away_team VARCHAR )
When did the game with North Melbourne as the away team take place?
SELECT date FROM table_name_89 WHERE away_team = "north melbourne"
sql_create_context
CREATE TABLE table_54196 ( "Season" text, "Competition" text, "Round" text, "Opponent" text, "Result" text, "Venue" text )
Which round has a Venue of nicosia, and a Opponent of levski sofia zapad?
SELECT "Round" FROM table_54196 WHERE "Venue" = 'nicosia' AND "Opponent" = 'levski sofia zapad'
wikisql
CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE...
Questions that have been closed as being Opinion Based. Questions that have been closed for being Opinion Based.
SELECT DISTINCT Q.Id AS "post_link", CASE WHEN Q.ClosedDate IS NULL THEN 'open' ELSE 'closed' END AS "state", Q.Score AS "score", Q.AnswerCount AS "answers", Q.CreationDate AS "asked" FROM Posts AS Q INNER JOIN PostHistory AS PH ON (Q.Id = PH.PostId) WHERE Q.PostTypeId = 1 AND PH.PostHistoryTypeId = 10 AND PH.Comment =...
sede
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...
列出在医院0345841中患者吕香馨不包含室的就诊科室名称所有门诊就诊记录的流水号是什么?
SELECT mzjzjlb.JZLSH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN hz_info_mzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.YLJGDM = hz_info_mzjzjlb.YLJGDM AND ...
css
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25), COUNTRY_ID varchar(2) ) CREATE T...
Create a bar chart showing the number of city across city, order in asc by the bars.
SELECT CITY, COUNT(CITY) FROM locations GROUP BY CITY ORDER BY CITY
nvbench
CREATE TABLE table_name_21 ( frequency VARCHAR, call_letters VARCHAR )
What is the frequency of WMAD?
SELECT frequency FROM table_name_21 WHERE call_letters = "wmad"
sql_create_context
CREATE TABLE table_11622924_1 ( winner VARCHAR, tournament VARCHAR )
Who won the Suntree Seniors Classic?
SELECT winner FROM table_11622924_1 WHERE tournament = "Suntree Seniors Classic"
sql_create_context
CREATE TABLE table_name_55 ( chassis VARCHAR, points VARCHAR, engine VARCHAR, entrant VARCHAR )
What is the chassis of Officine Alfieri Maserati with a Maserati Straight-6 engine and fewer than 6 points?
SELECT chassis FROM table_name_55 WHERE engine = "maserati straight-6" AND entrant = "officine alfieri maserati" AND points < 6
sql_create_context
CREATE TABLE table_name_67 ( enrolment INTEGER, founded INTEGER )
What is the low enrolment for schools founded after 1995?
SELECT MIN(enrolment) FROM table_name_67 WHERE founded > 1995
sql_create_context
CREATE TABLE table_53855 ( "Rank" real, "Club 1" text, "Seasons" real, "Spells" real, "Played 2" real, "Drawn" real, "Lost" real, "Goals" text, "Points 3" text )
What is the rank number with 562-506 goals before season 13?
SELECT COUNT("Rank") FROM table_53855 WHERE "Goals" = '562-506' AND "Seasons" < '13'
wikisql
CREATE TABLE table_4793 ( "Date" text, "Opponent" text, "Home / Away" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location/Attendance" text, "Record" text )
Was the game home or away when the record is 6-12?
SELECT "Home / Away" FROM table_4793 WHERE "Record" = '6-12'
wikisql
CREATE TABLE table_23213 ( "Institution" text, "Location" text, "Nickname" text, "Founded" real, "Type" text, "Enrollment" real, "Joined" real )
On how many locations is the Saint Joseph's College of Maine located?
SELECT COUNT("Location") FROM table_23213 WHERE "Institution" = 'Saint Joseph''s College of Maine'
wikisql
CREATE TABLE table_203_540 ( id number, "symbol" text, "gsi" text, "meaning" text, "unicode" text, "description" text )
how many symbols are not shown ?
SELECT COUNT(*) FROM table_203_540 WHERE "symbol" IS NULL
squall
CREATE TABLE table_26267607_2 ( date VARCHAR, circuit VARCHAR, winning_team VARCHAR, pole_position VARCHAR )
On what date is the winning team Abt Sportsline and pole position Mattias Ekstr m in the Circuit Ricardo Tormo , Valencia?
SELECT date FROM table_26267607_2 WHERE winning_team = "Abt Sportsline" AND pole_position = "Mattias Ekström" AND circuit = "circuit Ricardo Tormo , Valencia"
sql_create_context
CREATE TABLE table_204_584 ( id number, "pos" text, "no" number, "driver" text, "constructor" text, "laps" number, "time/retired" text, "grid" number, "points" number )
how many points did clay regazzoni receive ?
SELECT "points" FROM table_204_584 WHERE "driver" = 'clay regazzoni'
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 ( ...
give the number of patients who were admitted before the year 2154 with the procedure icd9 code 331.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admityear < "2154" AND procedures.icd9_code = "331"
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...
What is the number of government health insurance patients who had an other radiotherapeutic procedure?
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 = "Radiotherapeut proc NEC"
mimicsql_data
CREATE TABLE table_name_55 ( competition VARCHAR, venue VARCHAR, position VARCHAR, year VARCHAR )
Which competition did T rlea come in 4th place, in 2003 at Budapest, Hungary?
SELECT competition FROM table_name_55 WHERE position = "4th" AND year > 2003 AND venue = "budapest, hungary"
sql_create_context
CREATE TABLE t_kc21_t_kc22 ( MED_CLINIC_ID text, MED_EXP_DET_ID number ) CREATE TABLE t_kc21 ( 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 ...
列出编码为8988209的医院按不同的科室编码和出院诊断疾病名称所有医疗就诊记录中患者的平均年龄是哪些吗?
SELECT t_kc21.MED_ORG_DEPT_CD, t_kc21.OUT_DIAG_DIS_NM, AVG(t_kc21.PERSON_AGE) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '8988209' GROUP BY t_kc21.MED_ORG_DEPT_CD, t_kc21.OUT_DIAG_DIS_NM
css
CREATE TABLE table_69524 ( "Club" text, "Played" text, "Drawn" text, "Lost" text, "Points for" text, "Points against" text, "Tries for" text, "Tries against" text, "Try bonus" text )
How many tries for did the team with a try bonus of 5 score?
SELECT "Tries for" FROM table_69524 WHERE "Try bonus" = '5'
wikisql
CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other,...
How many helpful answers have I posted?. How many of my answers were either accepted or have score > 0?
SELECT a.Id, SUM(CASE WHEN a.PostTypeId = 2 THEN 1 END) AS Accepted, SUM(CASE WHEN a.PostTypeId = 3 THEN 1 END) AS "score>0", SUM(CASE WHEN a.PostTypeId = 4 THEN 1 END) AS "acceptedorscore>0" FROM Posts AS q INNER JOIN Posts AS a ON q.AcceptedAnswerId = a.Id WHERE a.OwnerUserId = @UserId GROUP BY a.Id, a.PostTypeId
sede
CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE Tags ( Id number, TagName text, Cou...
Try to answer these questions, to increase your tag score.
WITH TagScores AS (SELECT PostTags.TagId, SUM(5 - 2 * Votes.VoteTypeId) AS Score FROM Posts, Votes, PostTags WHERE Posts.ParentId = PostTags.PostId AND Votes.PostId = Posts.Id AND Votes.VoteTypeId BETWEEN 2 AND 3 AND Posts.OwnerUserId = @UserId AND Posts.CommunityOwnedDate IS NULL GROUP BY PostTags.TagId) SELECT * FROM...
sede
CREATE TABLE table_40333 ( "Sport" text, "Record" text, "Nation \u2013 athlete(s)" text, "Date" text, "Time (seconds)" real )
What Date has a time of (seconds) 42.172?
SELECT "Date" FROM table_40333 WHERE "Time (seconds)" = '42.172'
wikisql
CREATE TABLE table_29743928_4 ( years VARCHAR, name VARCHAR )
When chase harrison category:articles with hcards is the name what is the year?
SELECT years FROM table_29743928_4 WHERE name = "Chase Harrison Category:Articles with hCards"
sql_create_context
CREATE TABLE table_name_62 ( country VARCHAR, money__$_ VARCHAR )
What country is the player who earned $9,000 from?
SELECT country FROM table_name_62 WHERE money__$_ = "9,000"
sql_create_context
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number,...
tell me the total of patient 7524's inputs on 02/08/last year?
SELECT SUM(inputevents_cv.amount) 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 = 7524)) AND DATETIME(inputevents_cv.charttime, 'start of year') = DATETIME(CURRENT_TIME(), ...
mimic_iii
CREATE TABLE member ( Member_ID int, Member_Name text, Party_ID text, In_office text ) CREATE TABLE party_events ( Event_ID int, Event_Name text, Party_ID int, Member_in_charge_ID int ) CREATE TABLE region ( Region_ID int, Region_name text, Date text, Label text, Fo...
Show all party names and the number of members in each party. Show the proportion.
SELECT Party_name, COUNT(*) FROM member AS T1 JOIN party AS T2 ON T1.Party_ID = T2.Party_ID GROUP BY T1.Party_ID
nvbench
CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE T...
String search in a tag. Search for questions and answers containing a specific string with a given tag.
SELECT Id AS "post_link", OwnerUserId AS "user_link", CreationDate AS "date" FROM Posts AS p WHERE (p.PostTypeId = 1 AND (p.Body LIKE '%##Pattern##%' OR p.Title LIKE '%##Pattern##%') AND (p.Tags LIKE '%<##Tag##>%' OR p.Tags LIKE '% ##Tag## %')) OR (p.PostTypeId = 2 AND (SELECT COUNT(*) FROM Posts AS q WHERE q.Id = p.Pa...
sede
CREATE TABLE table_20663 ( "Code" real, "County" text, "Former Province" text, "Area (km 2 )" text, "Population Census 2009" real, "Capital" text )
What is the capital of Bungoma county?
SELECT "Capital" FROM table_20663 WHERE "County" = 'Bungoma'
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_Document_Types ( Document_Type_Code CHAR(15), Document_...
A bar chart about what is the project id and detail for the project with at least two documents?
SELECT T1.Project_Details, T1.Project_ID FROM Projects AS T1 JOIN Documents AS T2 ON T1.Project_ID = T2.Project_ID
nvbench
CREATE TABLE table_60967 ( "Title" text, "Developer" text, "Category" text, "Release date" text, "Version" text )
What Release date has a Category of utilities, a Developer of microsoft, and a Title of chord finder?
SELECT "Release date" FROM table_60967 WHERE "Category" = 'utilities' AND "Developer" = 'microsoft' AND "Title" = 'chord finder'
wikisql
CREATE TABLE table_48535 ( "Date" text, "Home team" text, "Score" text, "Away team" text, "Venue" text, "Crowd" real, "Box Score" text, "Report" text )
When the home team is Cairns Taipans, at which venue do they play?
SELECT "Venue" FROM table_48535 WHERE "Home team" = 'cairns taipans'
wikisql
CREATE TABLE table_53631 ( "Identity" text, "Builder" text, "Built" real, "Wheel Arrangement" text, "Notes" text )
What is the identity of the brighton works built train?
SELECT "Identity" FROM table_53631 WHERE "Builder" = 'brighton works'
wikisql
CREATE TABLE table_44467 ( "Competition" text, "1970\u201371" text, "1971\u201372" text, "1972\u201373" text, "1973\u201374" text, "1974\u201375" text, "1975\u201376" text, "1976\u201377" text, "1977\u201378" text, "1978\u201379" text, "1979\u201380" text, "1980\u201381" ...
What is the 1989 90 answer when the 2004 05 shows grp?
SELECT "1989\u201390" FROM table_44467 WHERE "2004\u201305" = 'grp'
wikisql
CREATE TABLE table_1342218_17 ( first_elected VARCHAR, incumbent VARCHAR )
How many times was incumbent Noble Jones Gregory first elected?
SELECT COUNT(first_elected) FROM table_1342218_17 WHERE incumbent = "Noble Jones Gregory"
sql_create_context
CREATE TABLE table_18597 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text )
Name all the candidates that ran for the seat where Harold D. Cooley is the incumbent?
SELECT "Candidates" FROM table_18597 WHERE "Incumbent" = 'Harold D. Cooley'
wikisql
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...
编号01352770在2014年10月3日到2016年4月14日期间所在检验所有结果指标记录中的仪器编号以及名称都是啥?
SELECT jyjgzbb.YQBH, jyjgzbb.YQMC 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.BG...
css
CREATE TABLE table_38640 ( "City" text, "Country" text, "IATA" text, "ICAO" text, "Airport" text )
Name the city for IATA of llw
SELECT "City" FROM table_38640 WHERE "IATA" = 'llw'
wikisql
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id t...
count the number of patients whose diagnoses long title is long-term (current) use of steroids and lab test abnormal status is delta?
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 = "Long-term (current) use of steroids" AND lab.flag = "delta"
mimicsql_data
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...
what the name was of the drug that patient 027-5581 was allergic to in 10/last year?
SELECT allergy.drugname FROM allergy WHERE allergy.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-5581')) AND DATETIME(allergy.allergytime, 'start of year') = DATETIME(CU...
eicu
CREATE TABLE table_name_62 ( gold VARCHAR, rank VARCHAR, bronze VARCHAR, silver VARCHAR )
How many golds does the nation having a rank of 8, fewer than 5 bronzes and more than 1 silver have?
SELECT COUNT(gold) FROM table_name_62 WHERE bronze < 5 AND silver > 1 AND rank > 8
sql_create_context
CREATE TABLE table_name_45 ( opponent VARCHAR, result VARCHAR, date VARCHAR )
Which Opponent has a Result of win, and a Date of march 17?
SELECT opponent FROM table_name_45 WHERE result = "win" AND date = "march 17"
sql_create_context
CREATE TABLE table_2139023_2 ( outcome VARCHAR, surface VARCHAR, year VARCHAR )
What was the result of the match on grass in 1955?
SELECT outcome FROM table_2139023_2 WHERE surface = "Grass" AND year = 1955
sql_create_context
CREATE TABLE airline ( airline_code varchar, airline_name text, note 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 flight_s...
i would like to know the types of ground transportation from the airport to LAS VEGAS
SELECT DISTINCT ground_service.transport_type FROM city, ground_service WHERE city.city_name = 'LAS VEGAS' AND ground_service.city_code = city.city_code
atis
CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER )
For those records from the products and each product's manufacturer, give me the comparison about the average of code over the name , and group by attribute name, show X in asc order.
SELECT T2.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T2.Name
nvbench
CREATE TABLE table_64882 ( "Township" text, "County" text, "Pop. (2010)" real, "Land ( sqmi )" real, "Water (sqmi)" real, "Latitude" real, "Longitude" real, "GEO ID" real, "ANSI code" real )
What is the average GEO ID with a latitude less than 46.57958, a latitude of -102.109898 and more than 35.99 square miles of land?
SELECT AVG("GEO ID") FROM table_64882 WHERE "Latitude" < '46.57958' AND "Longitude" = '-102.109898' AND "Land ( sqmi )" > '35.99'
wikisql
CREATE TABLE table_52325 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Decision" text, "Attendance" real, "Record" text )
What was the average attendance of a team with a 38 31 8 record?
SELECT AVG("Attendance") FROM table_52325 WHERE "Record" = '38–31–8'
wikisql
CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, hig...
what is the fare on AA flight 928 from DALLAS FORT WORTH to BOSTON
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 (((flight.airline_code = 'AA') AND flight.flight_number = 928) AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BOSTON' ...
atis
CREATE TABLE table_name_98 ( date VARCHAR, tie_no VARCHAR )
What is the date when tie number is 6?
SELECT date FROM table_name_98 WHERE tie_no = "6"
sql_create_context
CREATE TABLE table_1597866_3 ( host VARCHAR, first_premiere VARCHAR )
Name the host when first premiere is august 3, 2007
SELECT host FROM table_1597866_3 WHERE first_premiere = "August 3, 2007"
sql_create_context
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id t...
what is the admission location and icu stay of the patient id 74032?
SELECT demographic.admission_location, prescriptions.icustay_id FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.subject_id = "74032"
mimicsql_data
CREATE TABLE table_name_41 ( score VARCHAR, away_team VARCHAR )
What is the score for the away team of Grimsby Town?
SELECT score FROM table_name_41 WHERE away_team = "grimsby town"
sql_create_context
CREATE TABLE stadium ( ID int, name text, Capacity int, City text, Country text, Opening_year int ) CREATE TABLE record ( ID int, Result text, Swimmer_ID int, Event_ID int ) CREATE TABLE event ( ID int, Name text, Stadium_ID int, Year text ) CREATE TABLE swimme...
Show me about the distribution of meter_600 and ID in a bar chart.
SELECT meter_600, ID FROM swimmer
nvbench
CREATE TABLE table_name_21 ( lost INTEGER, goals_conceded VARCHAR, team VARCHAR, place VARCHAR, points VARCHAR )
What is the average of lost for place less than 10, less than 23 points, and goals conceded less than 26 for the Chorrillo team?
SELECT AVG(lost) FROM table_name_21 WHERE place < 10 AND points < 23 AND team = "chorrillo" AND goals_conceded < 26
sql_create_context
CREATE TABLE table_dev_55 ( "id" int, "gender" string, "serum_potassium_abnormality" float, "hemoglobin_a1c_hba1c" float, "body_weight" float, "renal_disease" bool, "serum_creatinine" float, "body_mass_index_bmi" float, "NOUSE" float )
hemoglobin < 12 g / dl ( male ) , < 10 g / dl ( female ) at screening
SELECT * FROM table_dev_55 WHERE (hemoglobin_a1c_hba1c < 12 AND gender = 'male') OR (hemoglobin_a1c_hba1c < 10 AND gender = 'female')
criteria2sql
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
provide the number of patients whose marital status is married and diagnoses long title is subarachnoid hemorrhage following injury without mention of open intracranial wound, with loss of consciousness of unspecified duration?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.marital_status = "MARRIED" AND diagnoses.long_title = "Subarachnoid hemorrhage following injury without mention of open intracranial wound, with loss of consciousness of unspe...
mimicsql_data
CREATE TABLE table_203_598 ( id number, "date" text, "time" text, "opponent" text, "site" text, "tv" text, "result" text, "attendance" number )
how many were in attendance for the september 5th game ?
SELECT "attendance" FROM table_203_598 WHERE "date" = 'september 5'
squall
CREATE TABLE table_31708 ( "Call sign" text, "Frequency MHz" real, "City of license" text, "ERP W" text, "Class" text, "FCC info" text )
Name the city of license for call sign of k215es
SELECT "City of license" FROM table_31708 WHERE "Call sign" = 'k215es'
wikisql
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 ...
查查这位钱康复的患者身高和体重指标
SELECT mzjzjlb.SG, mzjzjlb.TZ FROM person_info JOIN hz_info JOIN mzjzjlb JOIN person_info_hz_info ON person_info.RYBH = person_info_hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND person_info_hz_info.KH = hz_info.KH AND person_info_hz_info.KLX = hz_info.KLX...
css
CREATE TABLE table_name_82 ( career_w_l VARCHAR )
What is theW-L of the tournament listed as A for 1976?
SELECT career_w_l FROM table_name_82 WHERE 1976 = "a"
sql_create_context
CREATE TABLE table_203_510 ( id number, "township" text, "fips" number, "population\ncenter" text, "population" number, "population\ndensity\n(/mi2)" number, "population\ndensity\n(/km2)" number, "land area\n(mi2)" number, "land area\n(km2)" number, "water area\n(mi2)" number, ...
how many townships are there in pope county ?
SELECT COUNT("township") FROM table_203_510
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 procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
give me the number of patients whose days of hospital stay is greater than 34 and drug name is loperamide?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.days_stay > "34" AND prescriptions.drug = "Loperamide"
mimicsql_data
CREATE TABLE table_name_2 ( city VARCHAR, stadium VARCHAR )
What city is Gwang-Yang stadium in?
SELECT city FROM table_name_2 WHERE stadium = "gwang-yang stadium"
sql_create_context
CREATE TABLE table_name_42 ( to_par VARCHAR, country VARCHAR, money___$__ VARCHAR )
How much To par has a Country of united states, and a Money ($) of 90?
SELECT COUNT(to_par) FROM table_name_42 WHERE country = "united states" AND money___$__ = 90
sql_create_context
CREATE TABLE table_31021 ( "Distance" text, "Adelaide" text, "Brisbane" text, "Canberra" text, "Melbourne" text, "Perth" text, "Sydney" text )
How many listings under Melbourne has a distance at 15km?
SELECT COUNT("Melbourne") FROM table_31021 WHERE "Distance" = '15km'
wikisql
CREATE TABLE table_52474 ( "Productions" text, "Rose" text, "Louise" text, "Dainty June" text, "Herbie" text, "Director" text )
Which production had Rex Robbins as Herbie?
SELECT "Productions" FROM table_52474 WHERE "Herbie" = 'rex robbins'
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...
report the number of american indian/alaska native ethnic background patients who have diagnoses icd9 code 51881.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.ethnicity = "AMERICAN INDIAN/ALASKA NATIVE" AND diagnoses.icd9_code = "51881"
mimicsql_data
CREATE TABLE table_11340432_1 ( willow_canyon VARCHAR, shadow_ridge VARCHAR )
What is the willow canyon of Stallion?
SELECT willow_canyon FROM table_11340432_1 WHERE shadow_ridge = "Stallion"
sql_create_context
CREATE TABLE table_21736 ( "Class" text, "Part 1" text, "Part 2" text, "Part 3" text, "Part 4" text, "Verb meaning" text )
Name the verb meaning for half drosch
SELECT "Verb meaning" FROM table_21736 WHERE "Part 2" = 'half drosch'
wikisql
CREATE TABLE table_61407 ( "Year (Ceremony)" text, "Film title used in nomination" text, "Original title" text, "Director" text, "Result" text )
What is the Director of Gulf Stream Under the Iceberg?
SELECT "Director" FROM table_61407 WHERE "Film title used in nomination" = 'gulf stream under the iceberg'
wikisql
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, ...
list the top three most frequently prescribed drugs that were prescribed to patients during the same hospital encounter after they were diagnosed with hemorrhage complic proc in this year.
SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime, admissions.hadm_id FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_...
mimic_iii
CREATE TABLE table_60441 ( "Year" real, "Dates" text, "Champion" text, "Country" text, "Score" text, "Tournament Location" text, "Purse" text, "Winner's Share" text )
What is the winner's share of champion hideto tanihara?
SELECT "Winner's Share" FROM table_60441 WHERE "Champion" = 'hideto tanihara'
wikisql
CREATE TABLE table_1973816_2 ( founded VARCHAR, institution VARCHAR )
When was Daniel Webster College founded?
SELECT founded FROM table_1973816_2 WHERE institution = "Daniel Webster College"
sql_create_context
CREATE TABLE browser ( id number, name text, market_share number ) CREATE TABLE accelerator_compatible_browser ( accelerator_id number, browser_id number, compatible_since_year number ) CREATE TABLE web_client_accelerator ( id number, name text, operating_system text, client te...
What is the id and name of the browser that is compatible with the most web accelerators?
SELECT T1.id, T1.name FROM browser AS T1 JOIN accelerator_compatible_browser AS T2 ON T1.id = T2.browser_id GROUP BY T1.id ORDER BY COUNT(*) DESC LIMIT 1
spider
CREATE TABLE table_train_187 ( "id" int, "pregnancy_or_lactation" bool, "renal_disease" bool, "diabetic" string, "liver_disease" bool, "NOUSE" float )
the diagnosis of type ii diabetes of the subjects should be 1 year or more prior to the inception of this study
SELECT * FROM table_train_187 WHERE diabetic = 'ii'
criteria2sql
CREATE TABLE county_public_safety ( county_id number, name text, population number, police_officers number, residents_per_officer number, case_burden number, crime_rate number, police_force text, location text ) CREATE TABLE city ( city_id number, county_id number, name ...
What are the case burdens of counties, ordered descending by population?
SELECT case_burden FROM county_public_safety ORDER BY population DESC
spider
CREATE TABLE table_204_561 ( id number, "fence" number, "name" text, "jockey" text, "age" number, "handicap (st-lb)" text, "starting price" text, "fate" text )
which horse is older , greek scholar or irish day ?
SELECT "name" FROM table_204_561 WHERE "name" IN ('greek scholar', 'irish day') ORDER BY "age" DESC LIMIT 1
squall
CREATE TABLE table_66039 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" real, "Time" text, "Location" text )
What event had a record of 8 5 1?
SELECT "Event" FROM table_66039 WHERE "Record" = '8–5–1'
wikisql
CREATE TABLE table_name_38 ( venue VARCHAR, home_team VARCHAR )
Where did Melbourne play as the home team?
SELECT venue FROM table_name_38 WHERE home_team = "melbourne"
sql_create_context
CREATE TABLE table_name_66 ( party VARCHAR, district VARCHAR )
In Colorado 6 district what is the party?
SELECT party FROM table_name_66 WHERE district = "colorado 6"
sql_create_context
CREATE TABLE table_name_95 ( away_team VARCHAR, home_team VARCHAR )
Who was the away team when Brighton & Hove Albion was home?
SELECT away_team FROM table_name_95 WHERE home_team = "brighton & hove albion"
sql_create_context
CREATE TABLE table_766 ( "District" text, "Incumbent" text, "Party" text, "First elected" text, "Result" text, "Candidates" text )
Name the result for new york 1
SELECT "Result" FROM table_766 WHERE "District" = 'New York 1'
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...
计算出年龄在25岁及以上的患者治病期间花费的平均医疗费总额是多少?
SELECT AVG(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_AGE >= 25)
css
CREATE TABLE table_58429 ( "Season" real, "Level" text, "Division" text, "Administration" text, "Position" text )
What level for seasons after 2003, a Division of kakkonen (second division), and a Position of 12th?
SELECT "Level" FROM table_58429 WHERE "Season" > '2003' AND "Division" = 'kakkonen (second division)' AND "Position" = '12th'
wikisql
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) 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...
卫奇胜这个患者以前在哪个地方就诊过?
SELECT mzjzjlb.YLJGDM FROM person_info JOIN hz_info JOIN mzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE person_info.XM = '卫奇胜' UNION SELECT hz_info_zyjzjlb.YLJGDM FROM person_info JOIN hz_info JOIN zyjzjlb JOIN hz_info_zyjzj...
css
CREATE TABLE table_74698 ( "Player" text, "Tries" text, "Conv" text, "Pens" text, "Drop" text, "Venue" text, "Date" text )
How many conversions did Severo Koroduadua Waqanibau have when he has 0 pens?
SELECT "Conv" FROM table_74698 WHERE "Pens" = '0' AND "Player" = 'severo koroduadua waqanibau'
wikisql
CREATE TABLE t_kc24 ( MED_SAFE_PAY_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, REF_SLT_FLG number, CLINIC_SLT_DATE time, COMP_ID text, PERSON_ID text, FLX_MED_ORG_ID text, INSU_TYPE text, MED_AMOUT number, PER_ACC_PAY number, OVE_PAY numb...
负责医疗就诊41231928309的医疗机构科室的编码及医疗机构科室的名称都是什么?
SELECT MED_ORG_DEPT_CD, MED_ORG_DEPT_NM FROM t_kc21 WHERE MED_CLINIC_ID = '41231928309'
css
CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description ...
Percentage of bounties with accepted answer depending on the day (time) when bounty started.
WITH tmp AS (SELECT p.Id, p.AcceptedAnswerId AS Acc, Period = CASE @Frequency WHEN 1 THEN TIME_TO_STR(bs.CreationDate, '%h') WHEN 2 THEN TIME_TO_STR(bs.CreationDate, '%W') WHEN 3 THEN ROUND((CAST(TIME_TO_STR(bs.CreationDate, '%W') AS FLOAT) + CAST(TIME_TO_STR(bs.CreationDate, '%h') AS FLOAT) / 24), 2) END FROM Posts AS...
sede
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE inputevents_cv ( row_id nu...
tell me the name of the drug that patient 49295 was last prescribed through the ivt route?
SELECT prescriptions.drug FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 49295) AND prescriptions.route = 'ivt' ORDER BY prescriptions.startdate DESC LIMIT 1
mimic_iii
CREATE TABLE table_name_87 ( Id VARCHAR )
I want to know the 2013 when 2001 was wta premier 5 tournaments
SELECT 2013 FROM table_name_87 WHERE 2001 = "wta premier 5 tournaments"
sql_create_context
CREATE TABLE table_name_98 ( hometown VARCHAR, player VARCHAR )
Where is Terry Mills from?
SELECT hometown FROM table_name_98 WHERE player = "terry mills"
sql_create_context
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE cost ( c...
when was the first time that patient 006-133605 has the minimum systemicmean value on 12/26/this year.
SELECT vitalperiodic.observationtime FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-133605')) AND NOT vitalperiodic.systemicmean IS...
eicu
CREATE TABLE table_name_41 ( attendance VARCHAR, date VARCHAR )
What was the attendance of the game on October 17, 2004?
SELECT attendance FROM table_name_41 WHERE date = "october 17, 2004"
sql_create_context