context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_name_92 ( result VARCHAR, goal__number INTEGER )
Name the result for goal # more than 4
SELECT result FROM table_name_92 WHERE goal__number > 4
sql_create_context
CREATE TABLE table_name_12 ( size_of_rest_bit_field VARCHAR, leading_bits VARCHAR, start_address VARCHAR )
What is the size of the rest bit field when the leading bits are more than 110 and the start address is 224.0.0.0?
SELECT size_of_rest_bit_field FROM table_name_12 WHERE leading_bits > 110 AND start_address = "224.0.0.0"
sql_create_context
CREATE TABLE table_name_59 ( week VARCHAR, attendance VARCHAR )
In What Week was the Attendance 75,866?
SELECT week FROM table_name_59 WHERE attendance = "75,866"
sql_create_context
CREATE TABLE table_name_36 ( crowd INTEGER, home_team VARCHAR )
What is the average crowd size when the home team is North Melbourne?
SELECT AVG(crowd) FROM table_name_36 WHERE home_team = "north melbourne"
sql_create_context
CREATE TABLE aircraft ( aid number, name text, distance number ) CREATE TABLE flight ( flno number, origin text, destination text, distance number, departure_date time, arrival_date time, price number, aid number ) CREATE TABLE employee ( eid number, name text, ...
How many aircrafts do we have?
SELECT COUNT(*) FROM aircraft
spider
CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) CREATE TABLE medication ( medi...
has patient 006-171217 had any allergies in the last year?
SELECT COUNT(*) > 0 FROM allergy WHERE allergy.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-171217')) AND DATETIME(allergy.allergytime, 'start of year') = DATETIME(CURR...
eicu
CREATE TABLE table_name_26 ( to_par VARCHAR, score VARCHAR )
What was the TO par for the player who scored 70-68-74-70=282?
SELECT to_par FROM table_name_26 WHERE score = 70 - 68 - 74 - 70 = 282
sql_create_context
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...
let me know the lab test item id of patient stephanie suchan.
SELECT lab.itemid FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.name = "Stephanie Suchan"
mimicsql_data
CREATE TABLE table_name_51 ( attendance INTEGER, game_site VARCHAR, date VARCHAR )
What is the largest attendance at Memorial Stadium on December 12, 1965?
SELECT MAX(attendance) FROM table_name_51 WHERE game_site = "memorial stadium" AND date = "december 12, 1965"
sql_create_context
CREATE TABLE table_name_46 ( released_date VARCHAR, chinese_title VARCHAR )
What is the release date for the Chinese title ?
SELECT released_date FROM table_name_46 WHERE chinese_title = "摸摸瓦力欧制造"
sql_create_context
CREATE TABLE PersonFriend ( name varchar(20), friend varchar(20), year INTEGER ) CREATE TABLE Person ( name varchar(20), age INTEGER, city TEXT, gender TEXT, job TEXT )
Give a me a bar graph to show the friends's name, and ages of all people who are older than the average age of a person, show by the X-axis in desc please.
SELECT T1.name, T1.age FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T1.age > (SELECT AVG(age) FROM Person) ORDER BY T1.name DESC
nvbench
CREATE TABLE Has_amenity ( dormid INTEGER, amenid INTEGER ) CREATE TABLE Dorm_amenity ( amenid INTEGER, amenity_name VARCHAR(25) ) CREATE TABLE Lives_in ( stuid INTEGER, dormid INTEGER, room_number INTEGER ) CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHA...
Find the number of students who is older than 20 in each dorm. Plot them as bar chart.
SELECT dorm_name, COUNT(*) FROM Student AS T1 JOIN Lives_in AS T2 ON T1.stuid = T2.stuid JOIN Dorm AS T3 ON T3.dormid = T2.dormid WHERE T1.Age > 20 GROUP BY T3.dorm_name
nvbench
CREATE TABLE table_58326 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
Who was the away team when Footscray scored 11.14 (80)?
SELECT "Away team" FROM table_58326 WHERE "Home team score" = '11.14 (80)'
wikisql
CREATE TABLE AssignedTo ( Scientist int, Project char(4) ) CREATE TABLE Projects ( Code Char(4), Name Char(50), Hours int ) CREATE TABLE Scientists ( SSN int, Name Char(30) )
Find the number of scientists involved for each project name.
SELECT Name, COUNT(*) FROM Projects AS T1 JOIN AssignedTo AS T2 ON T1.Code = T2.Project GROUP BY T1.Name
nvbench
CREATE TABLE table_204_342 ( id number, "#" number, "player" text, "span" text, "caps" number, "total caps" number, "win %" text )
only player to serve as captain from 1998-2007
SELECT "player" FROM table_204_342 WHERE "span" = '1998-2007'
squall
CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title 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 ...
what is patient 1114's gender?
SELECT patients.gender FROM patients WHERE patients.subject_id = 1114
mimic_iii
CREATE TABLE table_name_38 ( round INTEGER, overall VARCHAR )
What is the highest round of the player with an overall of 152?
SELECT MAX(round) FROM table_name_38 WHERE overall = 152
sql_create_context
CREATE TABLE has_amenity ( dormid VARCHAR ) CREATE TABLE dorm ( dormid VARCHAR, student_capacity INTEGER )
Find the number of amenities for each of the dorms that can accommodate more than 100 students.
SELECT COUNT(*), T1.dormid FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid = T2.dormid WHERE T1.student_capacity > 100 GROUP BY T1.dormid
sql_create_context
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 d_labitems ( row_id number, itemid number, label text ) CREATE TABLE microbiologyevents...
how much of a change is patient 19161's weight change second measured on the first hospital visit compared to the value first measured on the first hospital visit?
SELECT (SELECT chartevents.valuenum FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 19161 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1)) AND chartev...
mimic_iii
CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAd...
List of tags of users' questions and their count.
SELECT OuterUsers.DisplayName, OuterUsers.Id, (SELECT Tags.TagName FROM Users INNER JOIN Posts ON Posts.OwnerUserId = OuterUsers.Id INNER JOIN PostTags ON PostTags.PostId = Posts.Id INNER JOIN Tags ON PostTags.TagId = Tags.Id GROUP BY Tags.TagName ORDER BY COUNT(*) DESC LIMIT 1) AS TopTag FROM Users AS OuterUsers WHERE...
sede
CREATE TABLE table_17058116_5 ( high_points VARCHAR, date VARCHAR )
Who scored the high points on the date November 2?
SELECT high_points FROM table_17058116_5 WHERE date = "November 2"
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 ) ...
count the number of patients whose admission type is elective and admission location is phys referral/normal deli?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "ELECTIVE" AND demographic.admission_location = "PHYS REFERRAL/NORMAL DELI"
mimicsql_data
CREATE TABLE table_70812 ( "Heat" real, "Lane" real, "Name" text, "Nationality" text, "Time" text )
What is the highest lane for heat 6 with a time of dns?
SELECT MAX("Lane") FROM table_70812 WHERE "Heat" = '6' AND "Time" = 'dns'
wikisql
CREATE TABLE climber ( climber_id number, name text, country text, time text, points number, mountain_id number ) CREATE TABLE mountain ( mountain_id number, name text, height number, prominence number, range text, country text )
What are the names of mountains that have a height of over 5000 or a prominence of over 1000?
SELECT name FROM mountain WHERE height > 5000 OR prominence > 1000
spider
CREATE TABLE table_13612 ( "Model number" text, "sSpec number" text, "Frequency" text, "Turbo" text, "GPU frequency" text, "Cores" text, "L2 cache" text, "L3 cache" text, "I/O bus" text, "Mult." text, "Memory" text, "Voltage" text, "Socket" text, "Release date" te...
What is the L2 cache with ec number of slbmm(c2)slbsr(k0)?
SELECT "L2 cache" FROM table_13612 WHERE "sSpec number" = 'slbmm(c2)slbsr(k0)'
wikisql
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 text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, ...
医疗机构5433552现在一共多少人在院?
SELECT COUNT(*) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '5433552' AND t_kc21.HOSP_STS > 0
css
CREATE TABLE table_66291 ( "Proto-Germanic" text, "West Germanic" text, "Old English" text, "German" text, "Dutch" text )
What's the Proto-Germanic when the German is /t/?
SELECT "Proto-Germanic" FROM table_66291 WHERE "German" = '/t/'
wikisql
CREATE TABLE table_14767 ( "Class" text, "Type" text, "Fleet numbers" text, "Quantity made" real, "Manufacturer" text, "Date made" text, "1958 CI\u00c9" text, "1958 UTA" text, "Date withdrawn" text, "Notes" text )
Which Type has a Fleet numbers of 2 8, 91 92, 97 100?
SELECT "Type" FROM table_14767 WHERE "Fleet numbers" = '2–8, 91–92, 97–100'
wikisql
CREATE TABLE film_market_estimation ( estimation_id number, low_estimate number, high_estimate number, film_id number, type text, market_id number, year number ) CREATE TABLE film ( film_id number, title text, studio text, director text, gross_in_dollar number ) CREATE ...
What are the types of film market estimations in year 1995?
SELECT type FROM film_market_estimation WHERE year = 1995
spider
CREATE TABLE table_name_19 ( season VARCHAR, lost VARCHAR )
Name the 3rd for season less than 4 and lost of 61
SELECT 3 AS _rd FROM table_name_19 WHERE season < 4 AND lost = 61
sql_create_context
CREATE TABLE table_name_13 ( points_against INTEGER, tries_for VARCHAR, team VARCHAR )
How many Points against has Tries for smaller than 14, and a Team of llanelli?
SELECT AVG(points_against) FROM table_name_13 WHERE tries_for < 14 AND team = "llanelli"
sql_create_context
CREATE TABLE table_31874 ( "Year" real, "Competition" text, "Venue" text, "Position" text, "Event" text )
What competition was the World Championships before 2011?
SELECT "Event" FROM table_31874 WHERE "Competition" = 'world championships' AND "Year" < '2011'
wikisql
CREATE TABLE table_1341423_40 ( party VARCHAR, candidates VARCHAR )
what is the party when candidates is jim demint (r) 80%?
SELECT party FROM table_1341423_40 WHERE candidates = "Jim DeMint (R) 80%"
sql_create_context
CREATE TABLE table_1220125_4 ( commissioned VARCHAR, laid_down VARCHAR )
What is the comissioned for 4 may 1943?
SELECT commissioned FROM table_1220125_4 WHERE laid_down = "4 May 1943"
sql_create_context
CREATE TABLE table_name_30 ( tries_against VARCHAR, try_diff VARCHAR, points_for VARCHAR )
How many Tries against has a Try diff of 17 and Points for smaller than 80?
SELECT COUNT(tries_against) FROM table_name_30 WHERE try_diff = "–17" AND points_for < 80
sql_create_context
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...
从14年12月19日到16年5月24日,把所有在医院5285300就诊的姓任的病患的医疗就诊记录列出来
SELECT * FROM t_kc21 WHERE MED_SER_ORG_NO = '5285300' AND IN_HOSP_DATE BETWEEN '2014-12-19' AND '2016-05-24' AND PERSON_NM LIKE '任%'
css
CREATE TABLE table_10046 ( "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text )
Which Score has a Competition of uefa euro 2012 qualifying?
SELECT "Score" FROM table_10046 WHERE "Competition" = 'uefa euro 2012 qualifying'
wikisql
CREATE TABLE table_name_98 ( home_team VARCHAR, away_team VARCHAR )
Where did South Melbourne go to play a team at home?
SELECT home_team FROM table_name_98 WHERE away_team = "south melbourne"
sql_create_context
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(...
Show me the number of card type code by card type code in a histogram, sort X-axis in ascending order.
SELECT card_type_code, COUNT(card_type_code) FROM Customers_Cards GROUP BY card_type_code ORDER BY card_type_code
nvbench
CREATE TABLE table_name_94 ( catalogue VARCHAR, release_date VARCHAR, time VARCHAR )
What is the catalogue number for the song that is 3:17 and was released 9/21/71?
SELECT catalogue FROM table_name_94 WHERE release_date = "9/21/71" AND time = "3:17"
sql_create_context
CREATE TABLE table_23061 ( "Team" text, "Division Titles" real, "Playoff Berths" real, "AFL Titles" real, "AFC Championships" real, "Super Bowl Championships" real )
If the team in the New England Patriots, what is the super bowl championship minimum number?
SELECT MIN("Super Bowl Championships") FROM table_23061 WHERE "Team" = 'New England Patriots'
wikisql
CREATE TABLE table_name_17 ( score VARCHAR, date VARCHAR )
What is the score of the game on November 10, 2006?
SELECT score FROM table_name_17 WHERE date = "november 10, 2006"
sql_create_context
CREATE TABLE table_15376 ( "Year" real, "Entrant" text, "Chassis" text, "Engine" text, "Points" real )
What year did Bryant Heating enter?
SELECT SUM("Year") FROM table_15376 WHERE "Entrant" = 'bryant heating'
wikisql
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
what is drug dose of drug name ciprofloxacin hcl?
SELECT prescriptions.drug_dose FROM prescriptions WHERE prescriptions.drug = "Ciprofloxacin HCl"
mimicsql_data
CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate t...
select top(50) * from posts ORDER BY posts.ViewCount DESC.
SELECT TOP(50000) AS Id, Score, ViewCount, OwnerUserId FROM Posts WHERE Posts.ViewCount < 14597 ORDER BY Posts.ViewCount DESC
sede
CREATE TABLE table_17521433_1 ( swimsuit VARCHAR, country VARCHAR )
What was the swimsuit score for Illinois?
SELECT swimsuit FROM table_17521433_1 WHERE country = "Illinois"
sql_create_context
CREATE TABLE table_64502 ( "Track" text, "Song Title" text, "Writer(s)" text, "Original Artist" text, "Original Release" real, "Length" text )
What is the Original Artis of the Track with a Length of 2:38?
SELECT "Original Artist" FROM table_64502 WHERE "Length" = '2:38'
wikisql
CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE student ( student_id int, lastname varchar, firstname varchar, program_id int, declare_major varchar, total_credit int, total...
What are the requirements for a CS-LSA degree ?
SELECT DISTINCT program_requirement.additional_req, program_requirement.category, program_requirement.min_credit, program.name FROM program, program_requirement WHERE program.name LIKE '%CS-LSA%' AND program.program_id = program_requirement.program_id
advising
CREATE TABLE table_15623 ( "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text )
When was there a result of 8-1 and a score of 8-1?
SELECT "Date" FROM table_15623 WHERE "Result" = '8-1' AND "Score" = '8-1'
wikisql
CREATE TABLE table_204_770 ( id number, "season" number, "date" text, "jia-a/csl winner" text, "result" text, "fa cup winner" text, "scorers" text, "stadium" text )
how many were held at hongkou stadium ?
SELECT COUNT(*) FROM table_204_770 WHERE "stadium" = 'hongkou stadium'
squall
CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC text, RYBH text, XBDM number, XBMC text, XLDM text, XLMC text, XM text, ZYLBDM text, ZYMC text ) CREATE TABLE hz_info ( KH text, KLX number...
就诊的病患33852265号其检验报告单上对应的检查结果指标均不正常的单号是多少?
SELECT jybgb.BGDH FROM hz_info JOIN mzjzjlb JOIN jybgb 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 WHERE hz_info.RYBH = '33852265' AND NOT jybgb.BGDH IN (SELECT jyjgzbb.BGDH FROM jyjgzbb WH...
css
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 ...
How many single patients had a diagnosis long title protal hypertension?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.marital_status = "SINGLE" AND diagnoses.long_title = "Portal hypertension"
mimicsql_data
CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId numb...
top earners of multi-award badges.
SELECT Name, num, UserId AS "user_link" FROM (SELECT Name, num, UserId, ROW_NUMBER() OVER (PARTITION BY Name ORDER BY num DESC) AS rownum FROM (SELECT Name, UserId, COUNT(Id) AS num FROM Badges GROUP BY Name, UserId) AS uc) AS ucn WHERE rownum <= 5 AND num > 2 ORDER BY Name
sede
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 lab ( subject_id text, hadm_id text, ...
Give me location of admission and primary disease status of the patient with patient id 2560.
SELECT demographic.admission_location, demographic.diagnosis FROM demographic WHERE demographic.subject_id = "2560"
mimicsql_data
CREATE TABLE table_name_22 ( country VARCHAR, player VARCHAR )
What country is Tiger Woods from?
SELECT country FROM table_name_22 WHERE player = "tiger woods"
sql_create_context
CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE patients ( row_id number, subject_id num...
what are the numbers of patients who took a protein s, functional test since 2100?
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT labevents.hadm_id FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'protein s, functional') AND STRFTIME('%y', labevents.charttime) >= '2100')
mimic_iii
CREATE TABLE table_name_96 ( developer VARCHAR, year_of_release VARCHAR )
Which developer has a year of cancelled releases?
SELECT developer FROM table_name_96 WHERE year_of_release = "cancelled"
sql_create_context
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, outtime time ) ...
indicate the monthly maximum arterial bp [systolic] of patient 1561 since 08/01/2105.
SELECT MAX(chartevents.valuenum) FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 1561)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arter...
mimic_iii
CREATE TABLE table_70130 ( "Player" text, "Test Career" text, "Tests" real, "Catches" real, "Stumpings" real, "Total Dismissals" real )
What is the average dismissals of 83 test and catches less than 33?
SELECT AVG("Total Dismissals") FROM table_70130 WHERE "Tests" = '83' AND "Catches" < '33'
wikisql
CREATE TABLE table_44581 ( "Season" text, "Zone" real, "Champion" text, "Second" text, "Third" text, "Top scorer" text )
Which Third has a Champion of metalurh novomoskovsk?
SELECT "Third" FROM table_44581 WHERE "Champion" = 'metalurh novomoskovsk'
wikisql
CREATE TABLE Product_Categories ( production_type_code VARCHAR(15), product_type_description VARCHAR(80), vat_rating DECIMAL(19,4) ) CREATE TABLE Invoice_Line_Items ( order_item_id INTEGER, invoice_number INTEGER, product_id INTEGER, product_title VARCHAR(80), product_quantity VARCHAR(5...
Show order ids and the total quantity in each order by a scatter chart.
SELECT order_id, SUM(product_quantity) FROM Order_Items GROUP BY order_id
nvbench
CREATE TABLE table_name_78 ( name VARCHAR, moving_from VARCHAR )
What player was moving from manchester united?
SELECT name FROM table_name_78 WHERE moving_from = "manchester united"
sql_create_context
CREATE TABLE table_73561 ( "Seed" real, "Rank" real, "Player" text, "Points" real, "Points defending" text, "Points won" real, "New points" real, "Status" text )
Name the status for points 3185
SELECT "Status" FROM table_73561 WHERE "Points" = '3185'
wikisql
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, ...
when did patient 47460 receive a inject into thorax cavit procedure for the first time on their last hospital visit?
SELECT procedures_icd.charttime FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'inject into thorax cavit') AND procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 47460 AND ...
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 diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
what is procedure long title of subject name charles deshay?
SELECT procedures.long_title FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.name = "Charles Deshay"
mimicsql_data
CREATE TABLE table_name_41 ( worldwide VARCHAR, film VARCHAR )
WHAT IS THE WORLDWIDE BOX OFFICE FOR BRAVE?
SELECT worldwide FROM table_name_41 WHERE film = "brave"
sql_create_context
CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number,...
what is the name of the drug which has been prescribed to patient 30307 two times?
SELECT t1.drug FROM (SELECT prescriptions.drug, COUNT(prescriptions.startdate) AS c1 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 30307) GROUP BY prescriptions.drug) AS t1 WHERE t1.c1 = 2
mimic_iii
CREATE TABLE table_14087 ( "Year(s)" real, "Tournament or series" text, "Played in" text, "Games played ( Tests )" text, "Games won ( Tests )" text, "Games lost ( Tests )" text, "Games drawn ( Tests )" text, "Points for ( Tests )" text, "Points against ( Tests )" text )
What is the games lost when games played was 2, year was earlier than 1999, and points for was 24?
SELECT "Games lost ( Tests )" FROM table_14087 WHERE "Games played ( Tests )" = '2' AND "Year(s)" < '1999' AND "Points for ( Tests )" = '24'
wikisql
CREATE TABLE table_name_52 ( label VARCHAR, code VARCHAR )
What Label has a Code of cocy-78365?
SELECT label FROM table_name_52 WHERE code = "cocy-78365"
sql_create_context
CREATE TABLE table_73510 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
Name the date for score w 109 95 (ot)
SELECT "Date" FROM table_73510 WHERE "Score" = 'W 109–95 (OT)'
wikisql
CREATE TABLE person_info_hz_info ( RYBH text, KH number, KLX number, YLJGDM number ) 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,...
为韩飞双这个患者在05年4月12日到12年6月12日内检测过尿素的医务人员工号及姓名分别是什么?
SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb 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 mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzj...
css
CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title 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 ...
what is patient 7959's height for the last time in 03/this year?
SELECT chartevents.valuenum FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 7959)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'admit ht' ...
mimic_iii
CREATE TABLE table_name_97 ( athletes VARCHAR, country VARCHAR )
What is the name of the athlete from Myanmar?
SELECT athletes FROM table_name_97 WHERE country = "myanmar"
sql_create_context
CREATE TABLE table_name_75 ( result VARCHAR, game_site VARCHAR, opponent VARCHAR )
Name the result for kingdome game site and opponent of denver broncos
SELECT result FROM table_name_75 WHERE game_site = "kingdome" AND opponent = "denver broncos"
sql_create_context
CREATE TABLE table_203_528 ( id number, "year" number, "political rights" number, "civil liberties" number, "status" text, "president" text )
how many years was it before the first partly free status ?
SELECT COUNT("year") FROM table_203_528 WHERE id < (SELECT id FROM table_203_528 WHERE "status" = 'partly free')
squall
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 diagnoses ( ...
how many patients aged less than 45 years speak the language port?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.language = "PORT" AND demographic.age < "45"
mimicsql_data
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 prescriptions ( subject_id text, hadm_id...
count the number of patients whose year of death is less than or equal to 2115 and procedure icd9 code is 4341?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dod_year <= "2115.0" AND procedures.icd9_code = "4341"
mimicsql_data
CREATE TABLE table_10826 ( "Date" text, "Stadium" text, "Winners" text, "Runners-up" text, "Score" text, "Attendance" real )
Who was the winner when the runner-up was Chemnitzer FC II?
SELECT "Winners" FROM table_10826 WHERE "Runners-up" = 'chemnitzer fc ii'
wikisql
CREATE TABLE table_56551 ( "Year" text, "Type" text, "Nos." text, "GSWR Class" real, "GSWR Nos." text, "GSR Class" text, "Inchicore Class" text, "Withdrawn" text )
What Inchicore Class has a GSR Class of 235?
SELECT "Inchicore Class" FROM table_56551 WHERE "GSR Class" = '235'
wikisql
CREATE TABLE table_29568 ( "No. in series" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "U.S. Viewers (millions)" text )
Name the air date for alex taub
SELECT "Original air date" FROM table_29568 WHERE "Written by" = 'Alex Taub'
wikisql
CREATE TABLE table_name_37 ( wins INTEGER, poles VARCHAR, season VARCHAR, podiums VARCHAR )
What is the lowest Wins, when Season is 2011, when Podiums is 1, and when Poles is less than 0?
SELECT MIN(wins) FROM table_name_37 WHERE season = "2011" AND podiums = 1 AND poles < 0
sql_create_context
CREATE TABLE table_12146637_1 ( episode_title VARCHAR, writer_s_ VARCHAR )
What is the name of the episode written by Sheila Lawrence & Henry Alonso Myers?
SELECT episode_title FROM table_12146637_1 WHERE writer_s_ = "Sheila Lawrence & Henry Alonso Myers"
sql_create_context
CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime ti...
how many patients went through a biopsy test since 2105?
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT microbiologyevents.hadm_id FROM microbiologyevents WHERE microbiologyevents.spec_type_desc = 'biopsy' AND STRFTIME('%y', microbiologyevents.charttime) >= '2105')
mimic_iii
CREATE TABLE table_175980_2 ( viewers__in_millions_ VARCHAR, ranking VARCHAR, timeslot VARCHAR )
What is every value for viewers for ranking #51 for the Tuesday 9:00 p.m. timeslot?
SELECT viewers__in_millions_ FROM table_175980_2 WHERE ranking = "#51" AND timeslot = "Tuesday 9:00 p.m."
sql_create_context
CREATE TABLE table_203_731 ( id number, "pos." text, "city" text, "population\n(ab)" number, "surface\n(km2)" number, "density\n(ab/km2)" number, "altitude\n(mslm)" number )
what is the highest city in terms of altitude ?
SELECT "city" FROM table_203_731 ORDER BY "altitude\n(mslm)" DESC LIMIT 1
squall
CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE days ( days_code varchar, ...
tell me about the type of aircraft called an M80
SELECT DISTINCT aircraft_code FROM aircraft WHERE aircraft_code = 'M80'
atis
CREATE TABLE table_name_43 ( wins INTEGER, club VARCHAR, draws VARCHAR )
What is the average number of wins for the Terang Club, when there are less than 0 draws?
SELECT AVG(wins) FROM table_name_43 WHERE club = "terang" AND draws < 0
sql_create_context
CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABL...
After 10:00 , is there a section for PHYSICS 522 ?
SELECT DISTINCT course_offering.end_time, course_offering.section_number, course_offering.start_time FROM course, course_offering, semester WHERE course_offering.start_time > '10:00' AND course.course_id = course_offering.course_id AND course.department = 'PHYSICS' AND course.number = 522 AND semester.semester = 'WN' A...
advising
CREATE TABLE table_name_61 ( date VARCHAR, tie_no VARCHAR )
What is the Date of Tie no 9?
SELECT date FROM table_name_61 WHERE tie_no = "9"
sql_create_context
CREATE TABLE table_20040 ( "Position" real, "Team" text, "Points" real, "Played" real, "Won" real, "Drawn" real, "Lost" real, "For" real, "Against" real, "Difference" text )
What is the smalledt position when the difference was 6?
SELECT MIN("Position") FROM table_20040 WHERE "Difference" = '6'
wikisql
CREATE TABLE table_29154 ( "Common Name" text, "Genus & Species" text, "NCBI Accession Number" text, "Length (AA)" real, "% Identity to C7orf38" real, "% Similarity to C7orf38" real )
What is the genus & species of the animal whose accession number is XP_002439156.1?
SELECT "Genus & Species" FROM table_29154 WHERE "NCBI Accession Number" = 'XP_002439156.1'
wikisql
CREATE TABLE table_64379 ( "Round" real, "Dates" text, "Rally Name" text, "Rally HQ" text, "Support Category" text, "Surface" text )
Where was the Rally HQ for Round 1?
SELECT "Rally HQ" FROM table_64379 WHERE "Round" = '1'
wikisql
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 names of the five cities with the greatest proportion of white people?
SELECT name FROM city ORDER BY white DESC LIMIT 5
spider
CREATE TABLE table_53022 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
Who was the away team when Melbourne was the home team?
SELECT "Away team" FROM table_53022 WHERE "Home team" = 'melbourne'
wikisql
CREATE TABLE table_204_240 ( id number, "name" text, "current use" text, "completed" text, "namesake" text, "info" text )
which building is the oldest on the bw campus .
SELECT "name" FROM table_204_240 ORDER BY "completed" LIMIT 1
squall
CREATE TABLE table_15753 ( "Player" text, "League" real, "Scottish Cup" real, "League Cup" real, "Challenge Cup" real, "Total" real )
What is the least for Scottish Cup with a Challenge Cup greater than 0, Player Paul Keegan, and League Cup greater than 0?
SELECT MIN("Scottish Cup") FROM table_15753 WHERE "Challenge Cup" > '0' AND "Player" = 'paul keegan' AND "League Cup" > '0'
wikisql
CREATE TABLE table_name_59 ( score VARCHAR, date VARCHAR, home VARCHAR, visitor VARCHAR )
What is the score of the game on February 26 with the Chicago black hawks as the home team and the New York Rangers as the visitor team?
SELECT score FROM table_name_59 WHERE home = "chicago black hawks" AND visitor = "new york rangers" AND date = "february 26"
sql_create_context
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...
自二零零零年九月十八日开始,截止到二零一三年十月十六日,患者章俊晤的主治医生是哪位
SELECT OUT_DIAG_DOC_CD, OUT_DIAG_DOC_NM FROM t_kc21 WHERE PERSON_NM = '章俊晤' AND IN_HOSP_DATE BETWEEN '2000-09-18' AND '2013-10-16' GROUP BY OUT_DIAG_DOC_CD ORDER BY COUNT(*) DESC LIMIT 1
css
CREATE TABLE table_name_40 ( date VARCHAR, venue VARCHAR )
On which date was a game played at Junction Oval?
SELECT date FROM table_name_40 WHERE venue = "junction oval"
sql_create_context
CREATE TABLE table_name_26 ( to_par VARCHAR, score VARCHAR )
What was the To par for the player whose final score was 67-71=138?
SELECT to_par FROM table_name_26 WHERE score = 67 - 71 = 138
sql_create_context