context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate time, ApprovalDate time, RejectionDate time, OwnerUserId number, Comment text, Text te...
Finding Front End developers in Kochi and Trivandram.
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", u.Id AS "user_link", u.Reputation, COUNT(p.Id) FROM Users AS u INNER JOIN Posts AS p ON p.OwnerUserId = u.Id INNER JOIN PostTags AS pt ON pt.PostId = p.Id INNER JOIN Tags AS t ON t.Id = pt.TagId WHERE (LOWER(Location) LIKE LOWER('%kochi%') OR LOWER(Location) L...
sede
CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), HIRE_DATE date, JOB_ID varchar(10), SALARY decimal(8,2), COMMISSION_PCT decimal(2,2), MANAGER_ID decimal(6,0), DEPARTMENT_ID decimal(...
For those employees who was hired before 2002-06-21, draw a bar chart about the distribution of job_id and the sum of salary , and group by attribute job_id, show in asc by the y axis.
SELECT JOB_ID, SUM(SALARY) FROM employees WHERE HIRE_DATE < '2002-06-21' GROUP BY JOB_ID ORDER BY SUM(SALARY)
nvbench
CREATE TABLE table_78397 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" real, "Time" text, "Location" text )
What is the method where there is a loss with time 5:00?
SELECT "Method" FROM table_78397 WHERE "Res." = 'loss' AND "Time" = '5:00'
wikisql
CREATE TABLE table_2563 ( "Series #" real, "Season #" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text )
Who directed 'loathe and marriage'?
SELECT "Directed by" FROM table_2563 WHERE "Title" = 'Loathe and Marriage'
wikisql
CREATE TABLE table_18334 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text )
How many times did an election feature the result robert l. leggett (d) 50.2% albert dehr (r) 49.8%?
SELECT COUNT("Result") FROM table_18334 WHERE "Candidates" = 'Robert L. Leggett (D) 50.2% Albert Dehr (R) 49.8%'
wikisql
CREATE TABLE table_name_34 ( points INTEGER, grid VARCHAR, time_retired VARCHAR )
What is the biggest points when the grid is less than 13 and the time/retired is +7.538 secs?
SELECT MAX(points) FROM table_name_34 WHERE grid < 13 AND time_retired = "+7.538 secs"
sql_create_context
CREATE TABLE table_name_30 ( senior_status VARCHAR, chief_judge VARCHAR )
Which Senior status has a Chief Judge of 1991 1995?
SELECT senior_status FROM table_name_30 WHERE chief_judge = "1991–1995"
sql_create_context
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsysto...
what were the four most commonly performed lab tests during the last year?
SELECT t1.labname FROM (SELECT lab.labname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM lab WHERE DATETIME(lab.labresulttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') GROUP BY lab.labname) AS t1 WHERE t1.c1 <= 4
eicu
CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Percent text, ACC_Home text, ACC_Road text, All_Games text, All_Games_Percent int, All_Home text, All_Road text, All_Neutral text ) CREATE TABLE university ( Scho...
Stacked bar chart of team_id for with each ACC_Road in each all home, I want to sort from low to high by the x-axis.
SELECT All_Home, Team_ID FROM basketball_match GROUP BY ACC_Road, All_Home ORDER BY All_Home
nvbench
CREATE TABLE table_name_11 ( status VARCHAR, monarch VARCHAR, reason VARCHAR )
What is the Status when Henry I is the Monarch and the Reason is succession unclear 1100-1103?
SELECT status FROM table_name_11 WHERE monarch = "henry i" AND reason = "succession unclear 1100-1103"
sql_create_context
CREATE TABLE table_name_34 ( scored_1 VARCHAR, years_played VARCHAR, name VARCHAR )
WHich Scored 1,500 Points has a Years Played of 2004 2008 and a Name of jolene anderson?
SELECT scored_1, 500 AS _points FROM table_name_34 WHERE years_played = "2004–2008" AND name = "jolene anderson"
sql_create_context
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 zyjzjlb ( CYBQDM text, CYBQMC...
患者的门诊诊断为急性支气管炎的触珠蛋白的参考值范围有哪些下限和上限?
SELECT jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM mzjzjlb JOIN jyjgzbb ON mzjzjlb.YLJGDM = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJZJLB WHERE mzjzjlb.JZZDSM = '急性支气管炎' AND jyjgzbb.JCZBMC = '触珠蛋白'
css
CREATE TABLE venue ( venueid int, venuename varchar ) CREATE TABLE paperdataset ( paperid int, datasetid int ) CREATE TABLE author ( authorid int, authorname varchar ) CREATE TABLE journal ( journalid int, journalname varchar ) CREATE TABLE writes ( paperid int, authorid int ...
what was the first deep learning paper ?
SELECT DISTINCT dataset.datasetid, paper.year FROM dataset, keyphrase, paper, paperdataset, paperkeyphrase WHERE keyphrase.keyphrasename = 'deep learning' AND paperdataset.datasetid = dataset.datasetid AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paperkeyphrase.paperid = paperdataset.paperid AND paper.pap...
scholar
CREATE TABLE table_24037660_2 ( lmpc_winning_team VARCHAR, rnd VARCHAR )
What was the winning team lmpc in rnd 3?
SELECT lmpc_winning_team FROM table_24037660_2 WHERE rnd = 3
sql_create_context
CREATE TABLE Apartment_Bookings ( apt_booking_id INTEGER, apt_id INTEGER, guest_id INTEGER, booking_status_code CHAR(15), booking_start_date DATETIME, booking_end_date DATETIME ) CREATE TABLE View_Unit_Status ( apt_id INTEGER, apt_booking_id INTEGER, status_date DATETIME, availa...
How many bookings does each booking status have? List the booking status code and the number of corresponding bookings in a pie chart.
SELECT booking_status_code, COUNT(*) FROM Apartment_Bookings GROUP BY booking_status_code
nvbench
CREATE TABLE table_name_55 ( date VARCHAR, matches VARCHAR, round VARCHAR )
What is Date, when Matches is less than 32, and when Round is Fifth Round Proper?
SELECT date FROM table_name_55 WHERE matches < 32 AND round = "fifth round proper"
sql_create_context
CREATE TABLE table_74455 ( "Tournament" text, "Player" text, "Nationality" text, "Team" text, "Games played" real, "Goals conceded" real, "Coefficient" text )
the 2010 clausura tournament?
SELECT "Coefficient" FROM table_74455 WHERE "Tournament" = '2010 Clausura'
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...
provide the number of patients whose days of hospital stay is greater than 11 and diagnoses long title is aftercare for healing traumatic fracture of lower leg?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.days_stay > "11" AND diagnoses.long_title = "Aftercare for healing traumatic fracture of lower leg"
mimicsql_data
CREATE TABLE table_name_8 ( points_classification_navy_blue_jersey VARCHAR, general_classification_yellow_jersey VARCHAR )
Which Points Classification Navy Blue Jersey that has a Jersey of Graeme Brown
SELECT points_classification_navy_blue_jersey FROM table_name_8 WHERE general_classification_yellow_jersey = "graeme brown"
sql_create_context
CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, outtime time ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CR...
in 2105, what are the three most frequent laboratory tests ordered for patients during the same month after receiving cv cath plcmt w guidance?
SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT t3.itemid FROM (SELECT t2.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_i...
mimic_iii
CREATE TABLE t_kc22 ( MED_EXP_DET_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, MED_EXP_BILL_ID text, SOC_SRT_DIRE_CD text, SOC_SRT_DIRE_NM text, DIRE_TYPE number, CHA_ITEM_LEV number, MED_INV_ITEM_TYPE text, MED_DIRE_CD text, MED_DIRE_NM text,...
医疗就诊24269888068中费用明细项目97020525044的处方号是多少?处方流水号是多少?
SELECT PRESCRIPTION_CODE, PRESCRIPTION_ID FROM t_kc22 WHERE MED_EXP_DET_ID = '97020525044'
css
CREATE TABLE table_47414 ( "Outcome" text, "Year" real, "Tournament" text, "Surface" text, "Partner" text, "Opponents" text, "Score" text )
What is the Surface of the court in the match with a Score of 4 6, 6 4, 3 6?
SELECT "Surface" FROM table_47414 WHERE "Score" = '4–6, 6–4, 3–6'
wikisql
CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, country varchar, zip int ) CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE area ( course_id int, area varchar ) CREATE TAB...
SPANISH 278 is offered every semester , correct ?
SELECT COUNT(*) > 0 FROM semester WHERE NOT semester IN (SELECT DISTINCT SEMESTERalias1.semester FROM course AS COURSEalias0, course_offering AS COURSE_OFFERINGalias0, semester AS SEMESTERalias1 WHERE COURSEalias0.course_id = COURSE_OFFERINGalias0.course_id AND COURSEalias0.department = 'SPANISH' AND COURSEalias0.numbe...
advising
CREATE TABLE table_14345690_5 ( finished VARCHAR, exited VARCHAR )
What is the finished place where exited is day 11?
SELECT finished FROM table_14345690_5 WHERE exited = "Day 11"
sql_create_context
CREATE TABLE table_26842217_8 ( time VARCHAR, visiting_team VARCHAR )
If the visiting team is Clemson, when was the time?
SELECT time FROM table_26842217_8 WHERE visiting_team = "Clemson"
sql_create_context
CREATE TABLE table_22022 ( "Club" text, "Played" text, "Won" text, "Drawn" text, "Lost" text, "Points for" text, "Points against" text, "Tries for" text, "Tries against" text, "Try bonus" text, "Losing bonus" text, "Points" text )
How many tries against were there with points of 150?
SELECT "Tries against" FROM table_22022 WHERE "Points for" = '150'
wikisql
CREATE TABLE table_30340 ( "Team" text, "Outgoing manager" text, "Manner of departure" text, "Date of vacancy" text, "Incoming manager" text, "Date of appointment" text )
how many managers left sunshine stars?
SELECT COUNT("Outgoing manager") FROM table_30340 WHERE "Team" = 'Sunshine Stars'
wikisql
CREATE TABLE table_19149550_9 ( london_borough VARCHAR, pakistani_population VARCHAR )
What's the London borough with 7797 Pakistani citizens?
SELECT london_borough FROM table_19149550_9 WHERE pakistani_population = 7797
sql_create_context
CREATE TABLE table_1352 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
Name the high assists for december 14
SELECT "High assists" FROM table_1352 WHERE "Date" = 'December 14'
wikisql
CREATE TABLE table_41402 ( "Date" text, "Tournament" text, "Winning score" text, "Margin of victory" text, "Runner(s)-up" text )
By how many strokes did Lema beat Jack Nicklaus?
SELECT "Margin of victory" FROM table_41402 WHERE "Runner(s)-up" = 'jack nicklaus'
wikisql
CREATE TABLE table_10718631_2 ( title VARCHAR, no_in_series VARCHAR )
How many titles were there for the 113 episode?
SELECT COUNT(title) FROM table_10718631_2 WHERE no_in_series = 113
sql_create_context
CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGu...
My answers for questions not containing Python tag.
SELECT q.Id AS "post_link", q.Tags FROM Posts AS q INNER JOIN Posts AS a ON q.Id = a.ParentId WHERE a.OwnerUserId = @UserId AND NOT q.Tags LIKE '%<python>%'
sede
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wa...
what was the name of the intake that patient 005-77687 on last month/30 first had?
SELECT intakeoutput.celllabel FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '005-77687')) AND intakeoutput.cellpath LIKE '%intake%' AND D...
eicu
CREATE TABLE table_11208143_9 ( stadium VARCHAR, capacity VARCHAR )
How many stadiums are there with a capacity of 7500?
SELECT COUNT(stadium) FROM table_11208143_9 WHERE capacity = 7500
sql_create_context
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
How many patients born before the year 2170 had a lab test named other cells?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "2170" AND lab.label = "Other Cells"
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 diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
what is diagnoses long title and procedure short title of subject id 23733?
SELECT diagnoses.long_title, procedures.short_title FROM diagnoses INNER JOIN procedures ON diagnoses.hadm_id = procedures.hadm_id WHERE diagnoses.subject_id = "23733"
mimicsql_data
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 TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE employees ( EMPLOYEE_I...
For those employees who do not work in departments with managers that have ids between 100 and 200, show me about the distribution of job_id and department_id in a bar chart.
SELECT JOB_ID, DEPARTMENT_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200)
nvbench
CREATE TABLE zyb ( CLINIC_ID text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, INSU_TYPE text, IN...
患者谢芷若在哪几次医疗记录中存在不低于5630.09元的药品消费?把医疗就诊编号列举出来
SELECT qtb.MED_CLINIC_ID FROM qtb WHERE qtb.PERSON_NM = '谢芷若' AND NOT qtb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT < 5630.09) UNION SELECT gyb.MED_CLINIC_ID FROM gyb WHERE gyb.PERSON_NM = '谢芷若' AND NOT gyb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT...
css
CREATE TABLE table_train_42 ( "id" int, "taking_vitamin_c" bool, "do_not_resuscitate_dnr" bool, "allergy_to_thiamine" bool, "taking_thiamine" bool, "receiving_vasopressor" bool, "sepsis" bool, "hypotension" bool, "allergy_to_vitamin_c" bool, "glucose_6_phosphate_dehydrogenase_def...
patients with a history of hypersensitivity to vitamin c or thiamine
SELECT * FROM table_train_42 WHERE allergy_to_vitamin_c = 1 OR allergy_to_thiamine = 1
criteria2sql
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 average age of students living in each dorm and the name of dorm Plot them as bar chart, rank by the bars in asc.
SELECT dorm_name, AVG(T1.Age) FROM Student AS T1 JOIN Lives_in AS T2 ON T1.stuid = T2.stuid JOIN Dorm AS T3 ON T3.dormid = T2.dormid GROUP BY T3.dorm_name ORDER BY dorm_name
nvbench
CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, UpVotes number, DownVotes number, ProfileImageUrl text, EmailHash text, AccountId number ) CRE...
what have you tried comments.
SELECT Id FROM Comments WHERE Text = 'http://whathaveyoutried.com'
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, ...
find the number of patients who were electively admitted to hospital before the year 2176.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "ELECTIVE" AND demographic.admityear < "2176"
mimicsql_data
CREATE TABLE table_name_64 ( round VARCHAR, time VARCHAR )
How many rounds have a time of 2:18?
SELECT COUNT(round) FROM table_name_64 WHERE time = "2:18"
sql_create_context
CREATE TABLE Person ( name VARCHAR, gender VARCHAR, age VARCHAR )
Find the name and age of all males in order of their age.
SELECT name FROM Person WHERE gender = 'male' ORDER BY age
sql_create_context
CREATE TABLE table_55111 ( "Rank" real, "Player" text, "Country" text, "Earnings ( $ )" real, "Events" real, "Wins" real )
Who has the least wins when ranked above 3 with over 10 events?
SELECT MIN("Wins") FROM table_55111 WHERE "Rank" < '3' AND "Events" > '10'
wikisql
CREATE TABLE table_name_52 ( number VARCHAR, born VARCHAR )
How many people were born in 1368?
SELECT COUNT(number) FROM table_name_52 WHERE born = "1368"
sql_create_context
CREATE TABLE table_22514845_4 ( trophy_presentation VARCHAR, year VARCHAR )
How many trophy presentations where in the year 1987?
SELECT COUNT(trophy_presentation) FROM table_22514845_4 WHERE year = 1987
sql_create_context
CREATE TABLE table_204_231 ( id number, "rank" number, "nation" text, "gold" number, "silver" number, "bronze" number, "total" number )
which nation won the most silver medals ?
SELECT "nation" FROM table_204_231 ORDER BY "silver" DESC LIMIT 1
squall
CREATE TABLE table_204_635 ( id number, "round" number, "selection" number, "player" text, "position" text, "college" text )
who was the only draftee to come from clemson ?
SELECT "player" FROM table_204_635 WHERE "college" = 'clemson'
squall
CREATE TABLE table_name_26 ( date VARCHAR, week VARCHAR, result VARCHAR )
Tell me the date that has a week larger than 3 and a result of w 28-27
SELECT date FROM table_name_26 WHERE week > 3 AND result = "w 28-27"
sql_create_context
CREATE TABLE courses ( course_id text, course_name text, course_description text, other_details text ) CREATE TABLE people_addresses ( person_address_id number, person_id number, address_id number, date_from time, date_to time ) CREATE TABLE addresses ( address_id number, l...
What are the names of the courses in alphabetical order?
SELECT course_name FROM courses ORDER BY course_name
spider
CREATE TABLE zyb ( CLINIC_ID text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, INSU_TYPE text, IN...
在9007676这个医院的患者冯明远,他的入院诊断疾病名称中不包含化脓性的医疗就诊记录编号是哪些
SELECT qtb.MED_CLINIC_ID FROM qtb WHERE qtb.PERSON_NM = '冯明远' AND qtb.MED_SER_ORG_NO = '9007676' AND NOT qtb.IN_DIAG_DIS_NM LIKE '%化脓性%' UNION SELECT gyb.MED_CLINIC_ID FROM gyb WHERE gyb.PERSON_NM = '冯明远' AND gyb.MED_SER_ORG_NO = '9007676' AND NOT gyb.IN_DIAG_DIS_NM LIKE '%化脓性%' UNION SELECT zyb.MED_CLINIC_ID FROM zyb ...
css
CREATE TABLE table_15801 ( "Year" real, "Tournament" text, "Venue" text, "Result" text, "Extra" text )
What was the extra info for the Commonwealth Games?
SELECT "Extra" FROM table_15801 WHERE "Tournament" = 'commonwealth games'
wikisql
CREATE TABLE record ( ID int, Result text, Swimmer_ID int, Event_ID int ) CREATE TABLE stadium ( ID int, name text, Capacity int, City text, Country text, Opening_year int ) CREATE TABLE event ( ID int, Name text, Stadium_ID int, Year text ) CREATE TABLE swimme...
Show me about the distribution of meter_700 and meter_100 in a bar chart, could you sort by the meter_700 in asc?
SELECT meter_700, meter_100 FROM swimmer ORDER BY meter_700
nvbench
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime t...
this year, patient 025-10988 was diagnosed for the first time with what?
SELECT diagnosis.diagnosisname FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '025-10988')) AND DATETIME(diagnosis.diagnosistime, 'start of year...
eicu
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, ...
for patient kenneth koeller, specify diagnosis icd9 code with short title
SELECT diagnoses.icd9_code, diagnoses.short_title FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.name = "Kenneth Koeller"
mimicsql_data
CREATE TABLE Customer_Orders ( Actual_Delivery_Date VARCHAR, Order_ID VARCHAR ) CREATE TABLE ORDER_ITEMS ( Order_ID VARCHAR, Order_Quantity VARCHAR )
What are the actual delivery dates of orders with quantity 1?
SELECT T1.Actual_Delivery_Date FROM Customer_Orders AS T1 JOIN ORDER_ITEMS AS T2 ON T1.Order_ID = T2.Order_ID WHERE T2.Order_Quantity = 1
sql_create_context
CREATE TABLE game ( stadium_id int, id int, Season int, Date text, Home_team text, Away_team text, Score text, Competition text ) CREATE TABLE stadium ( id int, name text, Home_Games int, Average_Attendance real, Total_Attendance real, Capacity_Percentage real ) ...
Show the number of games for each home team in a bar chart, and list by the X in ascending.
SELECT Home_team, COUNT(Home_team) FROM game GROUP BY Home_team ORDER BY Home_team
nvbench
CREATE TABLE table_name_24 ( constructor VARCHAR, location VARCHAR )
Who was the Long Beach constructor?
SELECT constructor FROM table_name_24 WHERE location = "long beach"
sql_create_context
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 allergy ( allergy...
what was the difference of sao2 of patient 021-111547 last measured on the current intensive care unit visit compared to the second to last value measured on the current intensive care unit visit?
SELECT (SELECT vitalperiodic.sao2 FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '021-111547') AND patient.unitdischargetime IS NULL) AN...
eicu
CREATE TABLE table_67211 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text )
What is the average attendance for the date of april 4?
SELECT AVG("Attendance") FROM table_67211 WHERE "Date" = 'april 4'
wikisql
CREATE TABLE table_67436 ( "Status" text, "Name" text, "First Performance" text, "Last Performance" text, "Style" text )
What was the status of joon-hyung park ?
SELECT "Status" FROM table_67436 WHERE "Name" = 'joon-hyung park 박준형'
wikisql
CREATE TABLE table_58132 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
Where did the away team play when they scored 12.13 (85)?
SELECT "Venue" FROM table_58132 WHERE "Away team score" = '12.13 (85)'
wikisql
CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number,...
Questions with multiple upvoted answers by the same user.
SELECT ParentId AS "Post Link", OwnerUserId AS "User Link", COUNT(*) AS "Number of Answers" FROM Posts WHERE ParentId > 0 AND OwnerUserId > 0 AND Score > 0 AND NOT (Title LIKE '%best%') AND NOT (Title LIKE '%worst%') AND NOT (Title LIKE '%hidden%') GROUP BY ParentId, OwnerUserId HAVING COUNT(*) >= 2 ORDER BY COUNT(*) D...
sede
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...
自2002-04-25起到2002-05-18医疗机构7767561的就诊记录里未就业人员的就诊记录有多少
SELECT COUNT(*) FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '7767561' AND gwyjzb.IN_HOSP_DATE BETWEEN '2002-04-25' AND '2002-05-18' AND gwyjzb.INSURED_STS = '未就业' UNION SELECT COUNT(*) FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '7767561' AND fgwyjzb.IN_HOSP_DATE BETWEEN '2002-04-25' AND '2002-05-18' AND fgwyjzb.INSURED_...
css
CREATE TABLE Elimination ( Elimination_ID text, Wrestler_ID text, Team text, Eliminated_By text, Elimination_Move text, Time text ) CREATE TABLE wrestler ( Wrestler_ID int, Name text, Reign text, Days_held text, Location text, Event text )
Give the proportion of the number of locations of all wrestlers with a pie chart.
SELECT Location, COUNT(Location) FROM wrestler GROUP BY Location
nvbench
CREATE TABLE railway ( Builder VARCHAR )
Show the most common builder of railways.
SELECT Builder FROM railway GROUP BY Builder ORDER BY COUNT(*) DESC LIMIT 1
sql_create_context
CREATE TABLE table_1942683_1 ( year_opened INTEGER )
What is the earliest year a house opened?
SELECT MIN(year_opened) FROM table_1942683_1
sql_create_context
CREATE TABLE table_22447251_2 ( age INTEGER, contestant VARCHAR )
How old is contestant Valerie Chardonnens Vargas?
SELECT MAX(age) FROM table_22447251_2 WHERE contestant = "Valerie Chardonnens Vargas"
sql_create_context
CREATE TABLE table_name_5 ( slalom INTEGER, average INTEGER )
What's the slalom when the average time was greater than 99.25?
SELECT AVG(slalom) FROM table_name_5 WHERE average > 99.25
sql_create_context
CREATE TABLE table_2897457_1 ( position VARCHAR, player VARCHAR )
What position does Olaf Kolzig play?
SELECT position FROM table_2897457_1 WHERE player = "Olaf Kolzig"
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 have received a int insert dual-cham dev procedure two times during this year?
SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, COUNT(*) AS c1 FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'int insert dual-cham ...
mimic_iii
CREATE TABLE table_203_316 ( id number, "party" text, "diet representation\nrepresentatives" number, "diet representation\ncouncillors" number, "party leader(s)" text, "comments" text )
how many of these parties currently have no councillors ?
SELECT COUNT("party") FROM table_203_316 WHERE "diet representation\ncouncillors" = 0
squall
CREATE TABLE table_name_16 ( player VARCHAR, years_in_orlando VARCHAR )
Who was the Player that spent the Year 2005 in Orlando?
SELECT player FROM table_name_16 WHERE years_in_orlando = "2005"
sql_create_context
CREATE TABLE table_name_20 ( pos VARCHAR, from_club VARCHAR )
What is Pos., when From Club is 'CSKA Moscow'?
SELECT pos FROM table_name_20 WHERE from_club = "cska moscow"
sql_create_context
CREATE TABLE t_kc21_t_kc24 ( MED_CLINIC_ID text, MED_SAFE_PAY_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...
在9007676这个医院的患者冯明远,他的入院诊断疾病名称中不包含化脓性的医疗就诊记录编号是哪些
SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_NM = '冯明远' AND t_kc21.MED_SER_ORG_NO = '9007676' AND NOT t_kc21.IN_DIAG_DIS_NM LIKE '%化脓性%'
css
CREATE TABLE Suppliers ( supplier_id INTEGER, supplier_name VARCHAR(80), supplier_phone VARCHAR(80) ) CREATE TABLE Order_Items ( order_item_id INTEGER, order_id INTEGER, product_id INTEGER ) CREATE TABLE Customer_Addresses ( customer_id INTEGER, address_id INTEGER, date_from DATETI...
Return the average price for each product type Visualize by bar chart, I want to display by the x axis in descending.
SELECT product_type_code, AVG(product_price) FROM Products GROUP BY product_type_code ORDER BY product_type_code DESC
nvbench
CREATE TABLE table_64496 ( "Japanese Title" text, "Romaji Title" text, "TV Station" text, "Episodes" real, "Average Ratings" text )
How many episodes when the tv station is ntv and the japanese title is ?
SELECT "Episodes" FROM table_64496 WHERE "TV Station" = 'ntv' AND "Japanese Title" = 'たったひとつの恋'
wikisql
CREATE TABLE table_name_49 ( bronze INTEGER, gold VARCHAR, total VARCHAR, rank VARCHAR )
What is the most number of Bronze medals won among the countries that have won more than 1 medal, more than 1 gold medal, and have a rank bigger than 1?
SELECT MAX(bronze) FROM table_name_49 WHERE total > 1 AND rank > 1 AND gold > 1
sql_create_context
CREATE TABLE table_name_2 ( place VARCHAR, event VARCHAR )
what is the place when the event is 4000 m individual pursuit?
SELECT place FROM table_name_2 WHERE event = "4000 m individual pursuit"
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 lab ( subject_id text, hadm_id text, ...
how many patients whose discharge location is snf and primary disease is abdominal pain?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = "SNF" AND demographic.diagnosis = "ABDOMINAL PAIN"
mimicsql_data
CREATE TABLE table_name_37 ( event VARCHAR, res VARCHAR, opponent VARCHAR )
Which event led to a loss against Josh Diekman?
SELECT event FROM table_name_37 WHERE res = "loss" AND opponent = "josh diekman"
sql_create_context
CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE instructor ( instructor_id int, name varchar, uniqname varchar ) CREATE TABLE course...
Who are the instructors for the hardware courses ?
SELECT DISTINCT instructor.name FROM instructor INNER JOIN offering_instructor ON offering_instructor.instructor_id = instructor.instructor_id INNER JOIN course_offering ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN area ON course_offering.course_id = area.course_id WHERE area.area LIKE '%...
advising
CREATE TABLE table_name_78 ( total_population__2005_estimate_ INTEGER, province VARCHAR, area__km_2__ VARCHAR )
Which Total population (2005 estimate) has a Province of west kalimantan (kalimantan barat), and an Area (km 2) smaller than 147,307.00?
SELECT AVG(total_population__2005_estimate_) FROM table_name_78 WHERE province = "west kalimantan (kalimantan barat)" AND area__km_2__ < 147 OFFSET 307.00
sql_create_context
CREATE TABLE table_9277 ( "Date" text, "Opponent" text, "Score" text, "Attendance" real, "Report" text )
What date was the game against inverurie loco works when more than 342 attend?
SELECT "Date" FROM table_9277 WHERE "Attendance" > '342' AND "Opponent" = 'inverurie loco works'
wikisql
CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDa...
most popular tags in 2013.
SELECT num.TagName AS Tag, ROW_NUMBER() OVER (ORDER BY rate.Rate DESC) AS MayRank, ROW_NUMBER() OVER (ORDER BY num.Num DESC) AS TotalRank, rate.Rate AS QuestionsIn2013, num.Num AS QuestionsTotal FROM (SELECT COUNT(PostId) AS Rate, TagName FROM Tags, PostTags, Posts WHERE Tags.Id = PostTags.TagId AND Posts.Id = PostId A...
sede
CREATE TABLE table_name_99 ( region_4_release VARCHAR, region_2_release VARCHAR )
What is the region 4 release that has july 20, 2009 as the region 2?
SELECT region_4_release FROM table_name_99 WHERE region_2_release = "july 20, 2009"
sql_create_context
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE treatment ( trea...
what were the five most frequently prescribed drugs to patients who previously received normal saline administration - fluid bolus (250-1000mls) within 2 months until 3 years ago?
SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'normal saline administration - fluid bolus (250-10...
eicu
CREATE TABLE table_62319 ( "Country" text, "Builder" text, "Location" text, "Ship" text, "Class / type" text )
What is Country, when Class / Type is 'Three masted full rigged ship'?
SELECT "Country" FROM table_62319 WHERE "Class / type" = 'three masted full rigged ship'
wikisql
CREATE TABLE table_31158 ( "Division" text, "Brigade" text, "Regiment" text, "Colonel" text, "County" text )
which regimen was in the arkansas county
SELECT "Regiment" FROM table_31158 WHERE "County" = 'Arkansas'
wikisql
CREATE TABLE tryout ( pid number, cname text, ppos text, decision text ) CREATE TABLE college ( cname text, state text, enr number ) CREATE TABLE player ( pid number, pname text, ycard text, hs number )
What are the names of schools with the top 3 largest size?
SELECT cname FROM college ORDER BY enr DESC LIMIT 3
spider
CREATE TABLE table_45863 ( "Player" text, "Club" text, "Games" real, "Goals" real, "Assists" real, "Points" real )
What is the average Games, when Player is Robert Hock, and when Goals is less than 24?
SELECT AVG("Games") FROM table_45863 WHERE "Player" = 'robert hock' AND "Goals" < '24'
wikisql
CREATE TABLE table_20871703_1 ( height VARCHAR, position VARCHAR )
What is the height if ot is the position?
SELECT height FROM table_20871703_1 WHERE position = "OT"
sql_create_context
CREATE TABLE aircraft ( aircraft_code varchar, aircraft_description varchar, manufacturer varchar, basic_type varchar, engines int, propulsion varchar, wide_body varchar, wing_span int, length int, weight int, capacity int, pay_load int, cruising_speed int, range_...
is there a TW flight from LAS VEGAS to NEW YORK
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 = 'NEW YORK' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'LAS ...
atis
CREATE TABLE table_name_59 ( release_date VARCHAR, developer_s_ VARCHAR, required_os VARCHAR, type VARCHAR )
Which Release date has a Required OS of windows, a Type of 2d, and a Developer(s) of zeonix?
SELECT release_date FROM table_name_59 WHERE required_os = "windows" AND type = "2d" AND developer_s_ = "zeonix"
sql_create_context
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,...
All the distinct days on which I created posts.
SELECT * FROM Posts
sede
CREATE TABLE member ( Member_ID int, Name text, Country text, College_ID int ) CREATE TABLE round ( Round_ID int, Member_ID int, Decoration_Theme text, Rank_in_Round int ) CREATE TABLE college ( College_ID int, Name text, Leader_Name text, College_Location text )
Return a bar chart showing how many members have visited for each college location, show from high to low by the y axis.
SELECT College_Location, COUNT(College_Location) FROM college AS T1 JOIN member AS T2 ON T1.College_ID = T2.College_ID GROUP BY College_Location ORDER BY COUNT(College_Location) DESC
nvbench
CREATE TABLE table_name_38 ( score VARCHAR, player VARCHAR, to_par VARCHAR, place VARCHAR )
What is Score, when To Par is greater than 7, when Place is 'T4', and when Player is 'Bob Rosburg'?
SELECT score FROM table_name_38 WHERE to_par > 7 AND place = "t4" AND player = "bob rosburg"
sql_create_context
CREATE TABLE table_26309085_1 ( partner VARCHAR, year VARCHAR )
Who was his partner in 1989?
SELECT partner FROM table_26309085_1 WHERE year = 1989
sql_create_context
CREATE TABLE table_21350772_2 ( gas_name VARCHAR )
What is the 100 year for Carbon Dioxide?
SELECT 100 AS _yr FROM table_21350772_2 WHERE gas_name = "Carbon dioxide"
sql_create_context