context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_76628 ( "Player" text, "Nationality" text, "Jersey Number(s)" text, "Position" text, "Years" text, "From" text )
Who wears the jersey number 20 and has the position of SG?
SELECT "Player" FROM table_76628 WHERE "Position" = 'sg' AND "Jersey Number(s)" = '20'
wikisql
CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC text, RYBH text, XBDM number, XBMC text, XLDM text, XLMC text, XM text, ZYLBDM text, ZYMC text ) CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC...
审核24240723184号检验结果指标记录的审核人工号以及姓名叫什么?
SELECT jyjgzbb.SHRGH, jyjgzbb.SHRXM FROM jyjgzbb WHERE jyjgzbb.JYZBLSH = '24240723184'
css
CREATE TABLE table_name_41 ( name VARCHAR, area VARCHAR, decile VARCHAR, authority VARCHAR )
What is the name of the school with a decile of 1, a state authority, and located in Otahuhu?
SELECT name FROM table_name_41 WHERE decile = "1" AND authority = "state" AND area = "otahuhu"
sql_create_context
CREATE TABLE artwork ( Artwork_ID int, Type text, Name text ) CREATE TABLE festival_detail ( Festival_ID int, Festival_Name text, Chair_Name text, Location text, Year int, Num_of_Audience int ) CREATE TABLE nomination ( Artwork_ID int, Festival_ID int, Result text )
, rank in desc by the the total number .
SELECT Type, COUNT(*) FROM artwork GROUP BY Type ORDER BY COUNT(*) DESC
nvbench
CREATE TABLE table_2516282_3 ( outcome VARCHAR, opponents VARCHAR )
When the opponent was Yan Zi Jie Zheng, what was the outcome?
SELECT outcome FROM table_2516282_3 WHERE opponents = "Yan Zi Jie Zheng"
sql_create_context
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 procedure performed to patient 007-16517, two or more times this month?
SELECT t1.treatmentname FROM (SELECT treatment.treatmentname, COUNT(treatment.treatmenttime) AS c1 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid ...
eicu
CREATE TABLE table_name_4 ( home_team VARCHAR, away_team VARCHAR )
Who played against away team hereford united?
SELECT home_team FROM table_name_4 WHERE away_team = "hereford united"
sql_create_context
CREATE TABLE table_204_223 ( id number, "party" text, "previous council" number, "staying councillors" number, "seats up for election" number, "election result" number, "new council" number )
which is the only one with 2 new council
SELECT "party" FROM table_204_223 WHERE "new council" = 2
squall
CREATE TABLE table_name_60 ( first_game INTEGER, played VARCHAR, lost VARCHAR )
When was the earliest first game with 11 played and 12 games lost?
SELECT MIN(first_game) FROM table_name_60 WHERE played > 11 AND lost = 12
sql_create_context
CREATE TABLE table_60305 ( "Shooter" text, "Event" text, "Rank points" text, "Score points" text, "Total" text )
Which Rank points has a Score points of olympic silver medalist?
SELECT "Rank points" FROM table_60305 WHERE "Score points" = 'olympic silver medalist'
wikisql
CREATE TABLE table_68193 ( "Year" text, "Start" text, "Qual" text, "Rank" text, "Finish" text, "Laps" real )
What is the start value for rank 11?
SELECT "Start" FROM table_68193 WHERE "Rank" = '11'
wikisql
CREATE TABLE table_8482 ( "School" text, "Locality" text, "Ages" text, "Capacity" real, "Ofsted" real )
Which Ages have an Ofsted larger than 106172, and a School of oakgrove school?
SELECT "Ages" FROM table_8482 WHERE "Ofsted" > '106172' AND "School" = 'oakgrove school'
wikisql
CREATE TABLE table_43829 ( "Team" text, "Manager" text, "Home city" text, "Stadium" text, "Capacity" real )
What is the name of the manager in the city of Osijek?
SELECT "Manager" FROM table_43829 WHERE "Home city" = 'osijek'
wikisql
CREATE TABLE table_63043 ( "Rank" real, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
What is the lowest Gold count if the Bronze is 4 and Silver is greater than 5?
SELECT MIN("Gold") FROM table_63043 WHERE "Bronze" = '4' AND "Silver" > '5'
wikisql
CREATE TABLE table_1670921_1 ( season VARCHAR, wicket VARCHAR )
Which season reported wickets of 7th?
SELECT season FROM table_1670921_1 WHERE wicket = "7th"
sql_create_context
CREATE TABLE table_name_30 ( score VARCHAR, home_team VARCHAR )
What is the Score of the Halifax Town Home game?
SELECT score FROM table_name_30 WHERE home_team = "halifax town"
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 d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) ...
is there any microbiology test results for patient 73652 until 141 months ago?
SELECT COUNT(*) > 0 FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 73652) AND DATETIME(microbiologyevents.charttime) <= DATETIME(CURRENT_TIME(), '-141 month')
mimic_iii
CREATE TABLE table_30317 ( "Year Location" text, "Mens Singles" text, "Womens Singles" text, "Mens Doubles" text, "Womens Doubles" text )
In what year and location did Liu Guozheng win the Mens Singles?
SELECT "Year Location" FROM table_30317 WHERE "Mens Singles" = 'Liu Guozheng'
wikisql
CREATE TABLE people ( people_id number, district text, name text, party text, age number ) CREATE TABLE debate ( debate_id number, date text, venue text, num_of_audience number ) CREATE TABLE debate_people ( debate_id number, affirmative number, negative number, if_...
Show the names of people, and dates and venues of debates they are on the affirmative side.
SELECT T3.name, T2.date, T2.venue FROM debate_people AS T1 JOIN debate AS T2 ON T1.debate_id = T2.debate_id JOIN people AS T3 ON T1.affirmative = T3.people_id
spider
CREATE TABLE table_name_59 ( away_team VARCHAR, home_team VARCHAR )
Who is the away side when st kilda is the home side?
SELECT away_team FROM table_name_59 WHERE home_team = "st kilda"
sql_create_context
CREATE TABLE table_76084 ( "Name" text, "Year commissioned" real, "Gross head (metres)" real, "Installed capacity (megawatts)" real, "Average annual output (million KWh)" real )
What is the Year Commissioned of the power stationo with a Gross head of less than 18?
SELECT AVG("Year commissioned") FROM table_76084 WHERE "Gross head (metres)" < '18'
wikisql
CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE airport ( airport_code varchar, airport_name text, airport_location text, state_code varchar, country_name varchar, time_zone_code varchar, minimum_connect_time int ) CREATE TABLE food_service ( meal_...
i would like a flight from BOSTON to ATLANTA
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 = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'ATLANTA...
atis
CREATE TABLE Suppliers ( supplier_id INTEGER, supplier_name VARCHAR(80), supplier_phone VARCHAR(80) ) CREATE TABLE Department_Store_Chain ( dept_store_chain_id INTEGER, dept_store_chain_name VARCHAR(80) ) CREATE TABLE Customer_Orders ( order_id INTEGER, customer_id INTEGER, order_statu...
What is the price of each product supplied by supplier id 3? Return a pie chart.
SELECT product_name, product_price FROM Product_Suppliers AS T1 JOIN Products AS T2 ON T1.product_id = T2.product_id WHERE T1.supplier_id = 3
nvbench
CREATE TABLE table_name_49 ( type VARCHAR, category VARCHAR, attribute VARCHAR )
Tell me the type for category of mouse and attribute of ondblclick
SELECT type FROM table_name_49 WHERE category = "mouse" AND attribute = "ondblclick"
sql_create_context
CREATE TABLE table_name_39 ( enrollment INTEGER, school VARCHAR )
What is the lowest enrollment at the pioneer school?
SELECT MIN(enrollment) FROM table_name_39 WHERE school = "pioneer"
sql_create_context
CREATE TABLE table_32978 ( "Name" text, "Type" text, "Planned Release" text, "CC License" text, "Sources available" text, "Open Source Movie" text )
What different types are there with a CC License of by-nc-sa 2.5?
SELECT "Type" FROM table_32978 WHERE "CC License" = 'by-nc-sa 2.5'
wikisql
CREATE TABLE table_45791 ( "Date" text, "Tournament" text, "Winning score" text, "Margin of victory" text, "Runner(s)-up" text )
On what date is the winning score 8 (70-71-67=208)?
SELECT "Date" FROM table_45791 WHERE "Winning score" = '–8 (70-71-67=208)'
wikisql
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( ...
what is the number of patients whose year of birth is before 2065 and procedure icd9 code 46?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dob_year < "2065" AND procedures.icd9_code = "46"
mimicsql_data
CREATE TABLE table_name_66 ( goals VARCHAR, caps VARCHAR )
What were the goals when the caps were set at 48?
SELECT goals FROM table_name_66 WHERE caps = 48
sql_create_context
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, return a bar chart about the distribution of name and the average of code , and group by attribute name.
SELECT T1.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name
nvbench
CREATE TABLE event ( ID int, Name text, Stadium_ID int, Year text ) CREATE TABLE swimmer ( ID int, name text, Nationality text, meter_100 real, meter_200 text, meter_300 text, meter_400 text, meter_500 text, meter_600 text, meter_700 text, Time text ) CREATE...
Plot meter_100 by grouped by meter 300 as a bar graph
SELECT meter_300, meter_100 FROM swimmer
nvbench
CREATE TABLE table_10338 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Game site" text, "Attendance" text )
What was the date of the game at Joe Robbie Stadium?
SELECT "Date" FROM table_10338 WHERE "Game site" = 'joe robbie stadium'
wikisql
CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH text, KH text, KLX number, MZBMLX number, MZJZLSH text, MZZDBM text, MZZDMC text, MZZYZDZZBM...
哪些人在93390516653的医疗就诊中审核检验报告单是超过21份的?列出这些审核人的工号,还有姓名也列出来
SELECT jybgb.SHRGH, jybgb.SHRXM FROM jybgb WHERE jybgb.JZLSH = '93390516653' GROUP BY jybgb.SHRGH HAVING COUNT(*) > 21
css
CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description varchar ) CREATE TABLE fare_basis ( fare_basis_code text, booking_class text, class_type text, premium text, econ...
oh let 's see does EA have a flight from ATLANTA to WASHINGTON
SELECT DISTINCT airline.airline_code FROM airline, airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE ((flight.airline_code = 'EA') AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'WASHINGTON' AND flight.to_airport = AIRPORT...
atis
CREATE TABLE table_name_70 ( points VARCHAR, engine VARCHAR )
How many points did the car with the brm v8 engine have?
SELECT COUNT(points) FROM table_name_70 WHERE engine = "brm v8"
sql_create_context
CREATE TABLE table_199666_1 ( wireless_lan VARCHAR, process_technology VARCHAR, centrino VARCHAR )
What Wireless LAN had a process technology of 90nm and a Carmel centrino?
SELECT wireless_lan FROM table_199666_1 WHERE process_technology = "90nm" AND centrino = "Carmel"
sql_create_context
CREATE TABLE Faculty ( FacID INTEGER, Lname VARCHAR(15), Fname VARCHAR(15), Rank VARCHAR(15), Sex VARCHAR(1), Phone INTEGER, Room VARCHAR(5), Building VARCHAR(13) ) CREATE TABLE Member_of ( FacID INTEGER, DNO INTEGER, Appt_Type VARCHAR(15) ) CREATE TABLE Student ( StuID...
Give the number of each course name with at least five enrollments Return a bar chart, and list by the Y-axis in ascending.
SELECT T1.CName, COUNT(T1.CName) FROM Course AS T1 JOIN Enrolled_in AS T2 ON T1.CID = T2.CID GROUP BY T1.CName, T2.CID HAVING COUNT(*) >= 5 ORDER BY COUNT(T1.CName)
nvbench
CREATE TABLE status ( station_id INTEGER, bikes_available INTEGER, docks_available INTEGER, time TEXT ) CREATE TABLE weather ( date TEXT, max_temperature_f INTEGER, mean_temperature_f INTEGER, min_temperature_f INTEGER, max_dew_point_f INTEGER, mean_dew_point_f INTEGER, min_...
Show how many installation date from each installation date
SELECT installation_date, COUNT(installation_date) FROM station
nvbench
CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, ...
has since 02/2105 patient 022-127032 been tested for pao2?
SELECT COUNT(*) > 0 FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '022-127032')) AND lab.labname = 'pao2' AND STRFTIME('%y-%m', lab.labresulttime) >= '2105...
eicu
CREATE TABLE table_72239 ( "#" real, "Date" text, "Visitor" text, "Score" text, "Home" text, "Leading scorer" text, "Attendance" text, "Record" text, "Streak" text )
what are all the records with a score is w 98 91
SELECT "Record" FROM table_72239 WHERE "Score" = 'W 98–91'
wikisql
CREATE TABLE player ( player_id number, name text, position text, club_id number, apps number, tries number, goals text, points number ) CREATE TABLE club_rank ( rank number, club_id number, gold number, silver number, bronze number, total number ) CREATE TABLE ...
What is the average number of gold medals for a club?
SELECT AVG(gold) FROM club_rank
spider
CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_...
For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, visualize a bar chart about the distribution of job_id and the average of salary , and group by attribute job_id, order from high to low by the x-axis.
SELECT JOB_ID, AVG(SALARY) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID ORDER BY JOB_ID DESC
nvbench
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...
give me the number of patients whose diagnoses short title is hx-penicillin allergy and lab test fluid is joint fluid?
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.short_title = "Hx-penicillin allergy" AND lab.fluid = "Joint Fluid"
mimicsql_data
CREATE TABLE table_27486 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "U.S. viewers (millions)" text, "Original U.S. air date" text, "Prod. code" real )
How many different original U.S. air dates appear where the U.S. viewers were 2.5 million?
SELECT COUNT("Original U.S. air date") FROM table_27486 WHERE "U.S. viewers (millions)" = '2.5'
wikisql
CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE ReviewTaskResults ( Id number, ...
Top 25 related tags of single tag.
SELECT t1.TagName AS Tag, t2.TagName AS "Related Tag", COUNT(t2.TagName) AS "Count" FROM PostTags AS pt1 INNER JOIN Tags AS t1 ON pt1.TagId = t1.Id INNER JOIN PostTags AS pt2 ON pt1.PostId = pt2.PostId AND pt1.TagId != pt2.TagId INNER JOIN Tags AS t2 ON pt2.TagId = t2.Id INNER JOIN Posts AS A ON pt2.PostId = A.Id WHERE...
sede
CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(4...
For those employees who do not work in departments with managers that have ids between 100 and 200, visualize a bar chart about the distribution of hire_date and the sum of salary bin hire_date by weekday, could you show from low to high by the Y please?
SELECT HIRE_DATE, SUM(SALARY) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY SUM(SALARY)
nvbench
CREATE TABLE table_76650 ( "Rider" text, "Manufacturer" text, "Laps" text, "Time/Retired" text, "Grid" text )
What is the time/retired for the rider with the manufacturuer yamaha, grod of 1 and 21 total laps?
SELECT "Time/Retired" FROM table_76650 WHERE "Laps" = '21' AND "Manufacturer" = 'yamaha' AND "Grid" = '1'
wikisql
CREATE TABLE table_36332 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" text )
Which driver had an accident and laps smaller than 53?
SELECT "Driver" FROM table_36332 WHERE "Laps" < '53' AND "Time/Retired" = 'accident'
wikisql
CREATE TABLE table_name_3 ( average_points_per_race_entered INTEGER, driver VARCHAR, entries VARCHAR )
What is the lowest average points per race entered of driver kimi r ikk nen, who has more than 194 entries?
SELECT MIN(average_points_per_race_entered) FROM table_name_3 WHERE driver = "kimi räikkönen" AND entries > 194
sql_create_context
CREATE TABLE table_53236 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" real, "Time" text, "Location" text )
Tell me the record for round more than 1
SELECT "Record" FROM table_53236 WHERE "Round" > '1'
wikisql
CREATE TABLE table_11135 ( "model" text, "max. motive power" text, "max. torque at rpm" text, "engine displacement" text, "engine type" text, "engine configuration & notes 0-100km/h" text )
What is the engine configuration & notes 0-100km/h with a model with 2.3 t5?
SELECT "engine configuration & notes 0-100km/h" FROM table_11135 WHERE "model" = '2.3 t5'
wikisql
CREATE TABLE table_10649 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real )
How many laps did BRM have with a grid of 11?
SELECT COUNT("Laps") FROM table_10649 WHERE "Constructor" = 'brm' AND "Grid" = '11'
wikisql
CREATE TABLE table_23346303_4 ( games_played INTEGER, player VARCHAR )
How many games did janae stokes play?
SELECT MAX(games_played) FROM table_23346303_4 WHERE player = "Janae Stokes"
sql_create_context
CREATE TABLE table_71415 ( "Position" real, "Club" text, "Played" real, "Points" text, "Wins" real, "Draws" real, "Losses" real, "Goals for" real, "Goals against" real, "Goal Difference" real )
Name the most goals with losses less than 15 and position more than 8 with points of 42+4
SELECT MAX("Goals for") FROM table_71415 WHERE "Losses" < '15' AND "Position" > '8' AND "Points" = '42+4'
wikisql
CREATE TABLE table_57428 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real )
Which driver has a Time/Retired of +6 laps?
SELECT "Driver" FROM table_57428 WHERE "Time/Retired" = '+6 laps'
wikisql
CREATE TABLE Prescribes ( Physician INTEGER, Patient INTEGER, Medication INTEGER, Date DATETIME, Appointment INTEGER, Dose VARCHAR(30) ) CREATE TABLE Trained_In ( Physician INTEGER, Treatment INTEGER, CertificationDate DATETIME, CertificationExpires DATETIME ) CREATE TABLE Unde...
How many patients do each physician take care of? List their names and number of patients they take care of Show bar chart, and list by the y-axis in desc.
SELECT T1.Name, COUNT(*) FROM Physician AS T1 JOIN Patient AS T2 ON T1.EmployeeID = T2.PCP GROUP BY T1.EmployeeID ORDER BY COUNT(*) DESC
nvbench
CREATE TABLE table_6440 ( "Location" text, "Culture" text, "# found" text, "Ball diameter" text, "Period" text )
What's the Ball Diameter with the Culture of Olmec?
SELECT "Ball diameter" FROM table_6440 WHERE "Culture" = 'olmec'
wikisql
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_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE out...
what was the last height of patient 18866 since 15 months ago?
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 = 18866)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'admit ht'...
mimic_iii
CREATE TABLE table_20597 ( "Western Title" text, "Chinese Title" text, "Pinyin" text, "Released Date" text, "Genre" text, "Game Modes" text )
What game modes are there when the pinyin is zh g n y b ?
SELECT "Game Modes" FROM table_20597 WHERE "Pinyin" = 'Zhígǎn Yī Bǐ'
wikisql
CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, Rejecti...
Highest Scoring Posts after HNQ Removal.
SELECT * FROM Posts WHERE CreationDate > '2018-10-19 00:00:00' ORDER BY Score DESC
sede
CREATE TABLE table_203_876 ( id number, "name" text, "birth" text, "marriages" text, "death" text )
which two monarchs had no children ?
SELECT "name" FROM table_203_876 WHERE "marriages" = 'no children'
squall
CREATE TABLE table_204_211 ( id number, "rank" number, "nation" text, "gold" number, "silver" number, "bronze" number, "total" number )
how has the most golds ?
SELECT "nation" FROM table_204_211 ORDER BY "gold" DESC LIMIT 1
squall
CREATE TABLE table_53841 ( "Year" real, "Class" text, "Tyres" text, "Team" text, "Co-Drivers" text, "Laps" real, "Pos." text, "Class Pos." text )
What position that has m tyres and 352 or more laps?
SELECT "Pos." FROM table_53841 WHERE "Tyres" = 'm' AND "Laps" > '352'
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, ...
give me the number of patients whose admission location is clinic referral/premature and year of birth is less than 2112?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "CLINIC REFERRAL/PREMATURE" AND demographic.dob_year < "2112"
mimicsql_data
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) ...
What is the average age of patients who stayed in the hospital for 26 days and were admitted in or after year 2105?
SELECT AVG(demographic.age) FROM demographic WHERE demographic.days_stay = "26" AND demographic.admityear >= "2105"
mimicsql_data
CREATE TABLE table_37232 ( "District" text, "Counties Represented" text, "Delegate" text, "Party" text, "First Elected" real, "Committee" text )
When Baltimore County, Howard are represented, what's the first elected when the committee is environmental matters (vice-chair)?
SELECT MAX("First Elected") FROM table_37232 WHERE "Counties Represented" = 'baltimore county, howard' AND "Committee" = 'environmental matters (vice-chair)'
wikisql
CREATE TABLE table_20246 ( "Date" text, "Cover model" text, "Centerfold model" text, "Interview subject" text, "20 Questions" text, "Pictorials" text )
Name the pictorials for terrel owens
SELECT "Pictorials" FROM table_20246 WHERE "20 Questions" = 'Terrel Owens'
wikisql
CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAno...
Recent comments on posts by a user.
SELECT p.Id AS "post_link", c.Text AS Comment, c.CreationDate FROM Posts AS p INNER JOIN Comments AS c ON c.PostId = p.Id WHERE p.OwnerUserId = '##Id##' ORDER BY c.CreationDate DESC
sede
CREATE TABLE table_name_30 ( place VARCHAR, player VARCHAR )
which Place has a Player of mark brooks?
SELECT place FROM table_name_30 WHERE player = "mark brooks"
sql_create_context
CREATE TABLE t_kc21_t_kc24 ( MED_CLINIC_ID text, MED_SAFE_PAY_ID number ) 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, ...
在医院4856304的不同科室编码下,列出所有医疗就诊记录的统筹基金支出与医疗费总额平均是多大比值?
SELECT t_kc21.MED_ORG_DEPT_CD, AVG(t_kc24.OVE_PAY) FROM t_kc21 JOIN t_kc24 JOIN t_kc21_t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc24.MED_CLINIC_ID AND t_kc21_t_kc24.MED_SAFE_PAY_ID = t_kc24.MED_SAFE_PAY_ID WHERE t_kc21.MED_SER_ORG_NO = '4856304' GROUP BY t_kc21.MED_ORG_DEPT_CD
css
CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, last_wardid number, intime time, outtime time ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, ...
what were the top five frequently prescribed drugs that patients were prescribed in the same hospital visit after having received a procedure-one vessel procedure during a year before?
SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime, admissions.hadm_id FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FR...
mimic_iii
CREATE TABLE table_name_88 ( british VARCHAR, examples VARCHAR )
Which British has Examples of exit?
SELECT british FROM table_name_88 WHERE examples = "exit"
sql_create_context
CREATE TABLE table_23462 ( "Year(s)" real, "Television commentator" text, "Dual Television commentator" text, "Radio commentator" text, "Spokesperson" text )
Who is the television commentator for the year 2006?
SELECT "Television commentator" FROM table_23462 WHERE "Year(s)" = '2006'
wikisql
CREATE TABLE table_65107 ( "Nat." text, "Name" text, "Moving from" text, "Type" text, "Transfer window" text, "Ends" real, "Transfer fee" text )
What nation had a moving from of espanyol?
SELECT "Nat." FROM table_65107 WHERE "Moving from" = 'espanyol'
wikisql
CREATE TABLE STUDENT ( LName VARCHAR, Sex VARCHAR, Age VARCHAR )
Find the last name of female (sex is F) students in the descending order of age.
SELECT LName FROM STUDENT WHERE Sex = "F" ORDER BY Age DESC
sql_create_context
CREATE TABLE table_49204 ( "Year" real, "Starts" real, "Wins" real, "Top 5" real, "Top 10" real, "Poles" real, "Avg. Start" real, "Avg. Finish" real, "Winnings" text, "Position" text )
in 1990, how many wins had an avg finish of 35 and a start less than 1?
SELECT MAX("Wins") FROM table_49204 WHERE "Avg. Finish" = '35' AND "Year" = '1990' AND "Starts" < '1'
wikisql
CREATE TABLE employee ( eid number(9,0), name varchar2(30), salary number(10,2) ) CREATE TABLE aircraft ( aid number(9,0), name varchar2(30), distance number(6,0) ) CREATE TABLE flight ( flno number(4,0), origin varchar2(20), destination varchar2(20), distance number(6,0), ...
A bar chart about what are the destinations and number of flights to each one?, could you show Y in ascending order?
SELECT destination, COUNT(*) FROM flight GROUP BY destination ORDER BY COUNT(*)
nvbench
CREATE TABLE table_31581 ( "Payee" text, "Purpose" text, "Amount (millions)" text, "Signatories" text, "Date signed" text )
What signatory has a purpose of police security and Infotalent payee?
SELECT "Signatories" FROM table_31581 WHERE "Purpose" = 'police security' AND "Payee" = 'infotalent'
wikisql
CREATE TABLE table_39225 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text )
What is the party in Ohio 6 District?
SELECT "Party" FROM table_39225 WHERE "District" = 'ohio 6'
wikisql
CREATE TABLE table_name_47 ( res VARCHAR, event VARCHAR )
Did he win or lose rof 32: respect?
SELECT res FROM table_name_47 WHERE event = "rof 32: respect"
sql_create_context
CREATE TABLE table_42537 ( "Result" text, "Opponent" text, "Type" text, "Round" text, "Date" text )
When is a Type of tko, and an Opponent of jesse brinkley
SELECT "Date" FROM table_42537 WHERE "Type" = 'tko' AND "Opponent" = 'jesse brinkley'
wikisql
CREATE TABLE table_4140 ( "Country" text, "MotoGP/500cc" real, "350cc" real, "Moto2/250cc" real, "Moto3/125cc" real, "80cc/50cc" real, "Total" real )
how many country has moto3/125cc with 15
SELECT "Country" FROM table_4140 WHERE "Moto3/125cc" = '15'
wikisql
CREATE TABLE table_42614 ( "Tournament" text, "Wins" real, "Top-5" real, "Top-10" real, "Top-25" real, "Events" real, "Cuts made" real )
What is the average Top-5 finishes with 2 as the Top-10 and a greater than 4 Top-25?
SELECT AVG("Top-5") FROM table_42614 WHERE "Top-10" = '2' AND "Top-25" > '4'
wikisql
CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Per...
Find Team_Name and ACC_Percent , and visualize them by a bar chart, and order by the ACC_Percent in ascending.
SELECT Team_Name, ACC_Percent FROM basketball_match ORDER BY ACC_Percent
nvbench
CREATE TABLE table_1342359_5 ( district VARCHAR, candidates VARCHAR )
what's the district with candidates being harry lane englebright (r) unopposed
SELECT district FROM table_1342359_5 WHERE candidates = "Harry Lane Englebright (R) Unopposed"
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 patient ( uniquep...
how many hours have passed since patient 018-20179 had last received a procedure on the current hospital visit?
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', treatment.treatmenttime)) FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '018-20179...
eicu
CREATE TABLE swimmer ( ID int, name text, Nationality text, meter_100 real, meter_200 text, meter_300 text, meter_400 text, meter_500 text, meter_600 text, meter_700 text, Time text ) CREATE TABLE stadium ( ID int, name text, Capacity int, City text, Coun...
Return a bar chart about the distribution of Nationality and the amount of Nationality , and group by attribute Nationality.
SELECT Nationality, COUNT(Nationality) FROM swimmer GROUP BY Nationality
nvbench
CREATE TABLE author ( authorid int, authorname varchar ) CREATE TABLE paperfield ( fieldid int, paperid int ) CREATE TABLE paper ( paperid int, title varchar, venueid int, year int, numciting int, numcitedby int, journalid int ) CREATE TABLE field ( fieldid int ) CREA...
papers by emina torlak published at popl
SELECT DISTINCT paper.paperid FROM author, paper, venue, writes WHERE author.authorname = 'emina torlak' AND venue.venueid = paper.venueid AND venue.venuename = 'popl' AND writes.authorid = author.authorid AND writes.paperid = paper.paperid
scholar
CREATE TABLE table_59928 ( "White" text, "Black" text, "Year" real, "Result" text, "Moves" real, "Tournament" text, "Opening" text )
What's the total number of moves with a result of and a black of Anand before 1999?
SELECT COUNT("Moves") FROM table_59928 WHERE "Result" = '½–½' AND "Year" < '1999' AND "Black" = 'anand'
wikisql
CREATE TABLE table_48752 ( "Rank" real, "Team" text, "Played" real, "Wins" real, "Ties" real, "Losses" real, "Points" real )
What is the highest Points, when Played is greater than 5?
SELECT MAX("Points") FROM table_48752 WHERE "Played" > '5'
wikisql
CREATE TABLE table_57037 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
When did an away team score 14.19 (103)?
SELECT "Date" FROM table_57037 WHERE "Away team score" = '14.19 (103)'
wikisql
CREATE TABLE repair ( repair_ID int, name text, Launch_Date text, Notes text ) CREATE TABLE technician ( technician_id real, Name text, Team text, Starting_Year real, Age int ) CREATE TABLE repair_assignment ( technician_id int, repair_ID int, Machine_ID int ) CREATE T...
Give me a bar chart that group and count names of technicians with a series of machines they are assigned to repair, sort X from high to low order.
SELECT Name, COUNT(Name) FROM repair_assignment AS T1 JOIN machine AS T2 ON T1.Machine_ID = T2.Machine_ID JOIN technician AS T3 ON T1.technician_id = T3.technician_id GROUP BY Name ORDER BY Name DESC
nvbench
CREATE TABLE table_2200 ( "Index (Year)" text, "Author / Editor / Source" text, "Year of publication" text, "Countries sampled" real, "World Ranking (1)" text, "Ranking L.A. (2)" text )
What's the wold ranking of the index by Transparency International?
SELECT "World Ranking (1)" FROM table_2200 WHERE "Author / Editor / Source" = 'Transparency International'
wikisql
CREATE TABLE table_name_43 ( grid VARCHAR, time_retired VARCHAR, laps VARCHAR )
What is the grid for the driver with an electrical time/retired and 51 laps?
SELECT grid FROM table_name_43 WHERE time_retired = "electrical" AND laps = 51
sql_create_context
CREATE TABLE table_50809 ( "Game" real, "February" real, "Opponent" text, "Score" text, "Record" text )
What is the average February that has 18-26-10 as the record, with a game less than 54?
SELECT AVG("February") FROM table_50809 WHERE "Record" = '18-26-10' AND "Game" < '54'
wikisql
CREATE TABLE table_203_346 ( id number, "date" text, "location" text, "venue" text, "opening act" text, "supporting" text )
who was the opening act at the viper room ?
SELECT "opening act" FROM table_203_346 WHERE "venue" = 'viper room'
squall
CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId n...
Top Saudi Developer Named Fahad.
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation, Location, CreationDate, LastAccessDate, Views FROM Users WHERE (LOWER(Location) LIKE '%saudi%' OR LOWER(Location) LIKE '% ksa%') AND LOWER(DisplayName) LIKE '%fahad%' ORDER BY Reputation DESC
sede
CREATE TABLE table_name_92 ( model INTEGER, maximum_memory VARCHAR )
Which model has a maximum memory of 512 mb?
SELECT MAX(model) FROM table_name_92 WHERE maximum_memory = "512 mb"
sql_create_context
CREATE TABLE table_27765443_2 ( model___computer_name VARCHAR, cpu_type VARCHAR )
Name the total number of model for amd opteron dual-core 2.6ghz
SELECT COUNT(model___computer_name) FROM table_27765443_2 WHERE cpu_type = "AMD Opteron dual-core 2.6GHz"
sql_create_context
CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE d_labitems ( row_id number, itemid num...
how many times did patient 95280 receive periph nerve div nec the previous year?
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 = 'periph nerve div nec') AND procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 95280) AND DATETIME(procedures...
mimic_iii