context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_name_98 ( result VARCHAR, category VARCHAR )
What is the result for the best orchestrations category?
SELECT result FROM table_name_98 WHERE category = "best orchestrations"
sql_create_context
CREATE TABLE table_74130 ( "Game" real, "November" real, "Opponent" text, "Score" text, "Location/Attendance" text, "Record" text, "Points" real )
What is the least entry for game if the score is 1-0?
SELECT MIN("Game") FROM table_74130 WHERE "Score" = '1-0'
wikisql
CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe tex...
Total bad questions, good questions, and total questions..
SELECT COUNT(*) FROM Posts WHERE PostTypeId = 1 AND AnswerCount > 1
sede
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code tex...
when was patient 016-18575 admitted to the hospital first via the step-down unit (sdu) since 2105?
SELECT patient.hospitaladmittime FROM patient WHERE patient.uniquepid = '016-18575' AND patient.hospitaladmitsource = 'step-down unit (sdu)' AND STRFTIME('%y', patient.hospitaladmittime) >= '2105' ORDER BY patient.hospitaladmittime LIMIT 1
eicu
CREATE TABLE table_20099 ( "Club" text, "Played" text, "Won" text, "Drawn" text, "Lost" text, "Points for" text, "Points against" text, "Points difference" text, "Tries For" text, "Tries Against" text, "Try Bonus" text, "Losing Bonus" text, "Points" text )
How many games played for teams with 277 points?
SELECT "Played" FROM table_20099 WHERE "Points for" = '277'
wikisql
CREATE TABLE table_64074 ( "School" text, "Location" text, "Mascot" text, "County" text, "Year Joined" text, "Previous Conference" text, "Year Left" text )
what is the school when the location is rochester?
SELECT "School" FROM table_64074 WHERE "Location" = 'rochester'
wikisql
CREATE TABLE table_68096 ( "Year" real, "Group" text, "Award" text, "Film/Show" text, "Result" text )
Before 2012, which Group has the Result, nominated, the Film/Show, East West 101, and the Award, Best Lead Actor in A Television Drama?
SELECT "Group" FROM table_68096 WHERE "Result" = 'nominated' AND "Year" < '2012' AND "Film/Show" = 'east west 101' AND "Award" = 'best lead actor in a television drama'
wikisql
CREATE TABLE table_name_45 ( vmax VARCHAR, capacity VARCHAR )
What was the maximum speed of the car with 1.556 cc capacity?
SELECT vmax FROM table_name_45 WHERE capacity = "1.556 cc"
sql_create_context
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, ...
how much does it cost vancocin.
SELECT DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'medication' AND cost.eventid IN (SELECT medication.medicationid FROM medication WHERE medication.drugname = 'vancocin')
eicu
CREATE TABLE table_12784134_1 ( participle VARCHAR, verbal_noun VARCHAR )
What's the participle when the verbal noun is i-bil-tze?
SELECT participle FROM table_12784134_1 WHERE verbal_noun = "i-bil-tze"
sql_create_context
CREATE TABLE table_name_48 ( position VARCHAR, college_hall_of_fame VARCHAR )
What Position has no College Hall of Fame?
SELECT position FROM table_name_48 WHERE college_hall_of_fame = "no"
sql_create_context
CREATE TABLE table_16494599_5 ( years_for_grizzlies VARCHAR, school_club_team VARCHAR )
when was the school/club team for grizzles was maryland
SELECT years_for_grizzlies FROM table_16494599_5 WHERE school_club_team = "Maryland"
sql_create_context
CREATE TABLE table_6934 ( "Player" text, "Club" text, "League" real, "FA Cup" real, "FA Trophy" real, "League Cup" real, "Total" real )
How many FA Trophies had a total of 27, 2 FA cups, and a league larger than 24?
SELECT SUM("FA Trophy") FROM table_6934 WHERE "Total" = '27' AND "FA Cup" = '2' AND "League" > '24'
wikisql
CREATE TABLE table_16198 ( "Institution" text, "Nickname" text, "Location" text, "Founded" real, "Type" text, "Enrollment" real )
How many institutions are located in wilmore, kentucky and private
SELECT MAX("Founded") FROM table_16198 WHERE "Type" = 'Private' AND "Location" = 'Wilmore, Kentucky'
wikisql
CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number...
Because it's NOT AN ACRONYM.
SELECT * FROM Posts WHERE CONCAT(Title, Body) COLLATE SQL_Latin1_General_CP1_CS_AS LIKE '%SCRUM%' AND ClosedDate IS NULL
sede
CREATE TABLE table_101336_1 ( no_of_cu_o_planes_in_unit_cell VARCHAR, formula VARCHAR )
How many times is the formula tl 2 ba 2 cuo 6?
SELECT no_of_cu_o_planes_in_unit_cell FROM table_101336_1 WHERE formula = "Tl 2 Ba 2 CuO 6"
sql_create_context
CREATE TABLE table_29504 ( "No." real, "Title" text, "Directed by" text, "Written by" text, "U.S. viewers (million)" text, "Original air date" text, "Production code" text )
How many U.S. viewers in millions watched the episode titled 'The Truth About Dads and Moms'?
SELECT COUNT("U.S. viewers (million)") FROM table_29504 WHERE "Title" = 'The Truth About Dads and Moms'
wikisql
CREATE TABLE table_name_35 ( score VARCHAR, tie_no VARCHAR )
What's the score when the tie number was 6?
SELECT score FROM table_name_35 WHERE tie_no = "6"
sql_create_context
CREATE TABLE table_name_15 ( total VARCHAR, rank VARCHAR, gold VARCHAR, silver VARCHAR )
What is the total medal count when there are more than 1 gold and more than 2 silver medals won and the rank is less than 1?
SELECT total FROM table_name_15 WHERE gold > 1 AND silver > 2 AND rank < 2
sql_create_context
CREATE TABLE table_name_5 ( year INTEGER, best_goalkeeper VARCHAR, runner_up VARCHAR, third_place VARCHAR )
What year was the runner-up Portugal with Italy in third place, and the gold keeper Nuno Hidalgo?
SELECT AVG(year) FROM table_name_5 WHERE runner_up = "portugal" AND third_place = "italy" AND best_goalkeeper = "nuno hidalgo"
sql_create_context
CREATE TABLE table_14395920_2 ( winner VARCHAR, combativity_award VARCHAR )
Who won the stage when Fumiyuki Beppu won the combativity award?
SELECT winner FROM table_14395920_2 WHERE combativity_award = "Fumiyuki Beppu"
sql_create_context
CREATE TABLE table_69557 ( "Round" real, "Pick #" real, "Overall" real, "Name" text, "Position" text, "College" text )
What is the overall pick average with the pick # lower than 15?
SELECT AVG("Overall") FROM table_69557 WHERE "Pick #" < '15'
wikisql
CREATE TABLE actor ( Actor_ID int, Name text, Musical_ID int, Character text, Duration text, age int ) CREATE TABLE musical ( Musical_ID int, Name text, Year int, Award text, Category text, Nominee text, Result text )
Bar chart x axis duration y axis how many duration, and rank by the y-axis in descending.
SELECT Duration, COUNT(Duration) FROM actor GROUP BY Duration ORDER BY COUNT(Duration) DESC
nvbench
CREATE TABLE Products ( product_id INTEGER, product_details VARCHAR(255) ) CREATE TABLE Customers ( customer_id INTEGER, payment_method VARCHAR(15), customer_name VARCHAR(80), date_became_customer DATETIME, other_customer_details VARCHAR(255) ) CREATE TABLE Customer_Contact_Channels ( ...
What are the dates when customers with ids between 10 and 20 became customers, and count them by a bar chart, and I want to rank y-axis in ascending order.
SELECT date_became_customer, COUNT(date_became_customer) FROM Customers WHERE customer_id BETWEEN 10 AND 20 ORDER BY COUNT(date_became_customer)
nvbench
CREATE TABLE table_name_35 ( mission VARCHAR, local_position VARCHAR, resident_country VARCHAR )
What is the mission that has ambassador of local position, and a resident country of democratic republic of congo?
SELECT mission FROM table_name_35 WHERE local_position = "ambassador" AND resident_country = "democratic republic of congo"
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 diagnosed with short title sec neuroendo tumor-bone have blood gas lab test category?
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 = "Sec neuroendo tumor-bone" AND lab."CATEGORY" = "Blood Gas"
mimicsql_data
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number,...
during this hospital encounter what was the first ward id of patient 40059?
SELECT transfers.wardid FROM transfers WHERE transfers.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 40059 AND admissions.dischtime IS NULL) AND NOT transfers.wardid IS NULL ORDER BY transfers.intime LIMIT 1
mimic_iii
CREATE TABLE table_41516 ( "Date" text, "Cover model" text, "Centerfold model" text, "Interview subject" text, "20 Questions" text )
Who was the Centerfold Model on 5-95?
SELECT "Centerfold model" FROM table_41516 WHERE "Date" = '5-95'
wikisql
CREATE TABLE wdmzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH number, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZ...
在2015年11月6日到2021年10月2日内列出患者编号02589232所有检验结果指标记录的检验人为昌飞烟的检验指标流水序列号有多少?
SELECT jyjgzbb.JYZBLSH FROM hz_info JOIN wdmzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX AND wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.B...
css
CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), ...
For those employees who did not have any job in the past, draw a scatter chart about the correlation between employee_id and commission_pct .
SELECT EMPLOYEE_ID, COMMISSION_PCT FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history)
nvbench
CREATE TABLE table_9964 ( "Party" text, "Ward" real, "PR top-up" real, "Total" real, "Percentage" text )
WHAT IS THE TOTAL WITH WARD LARGER THAN 60?
SELECT MIN("Total") FROM table_9964 WHERE "Ward" > '60'
wikisql
CREATE TABLE artist ( country VARCHAR, artist_name VARCHAR, gender VARCHAR ) CREATE TABLE song ( artist_name VARCHAR, languages VARCHAR )
What is the country of origin of the artist who is female and produced a song in Bangla?
SELECT T1.country FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T1.gender = "Female" AND T2.languages = "bangla"
sql_create_context
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE intakeoutput ( i...
give me the top four most common diagnoses since 5 years ago?
SELECT t1.diagnosisname FROM (SELECT diagnosis.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnosis WHERE DATETIME(diagnosis.diagnosistime) >= DATETIME(CURRENT_TIME(), '-5 year') GROUP BY diagnosis.diagnosisname) AS t1 WHERE t1.c1 <= 4
eicu
CREATE TABLE table_56914 ( "Year" text, "2010" real, "2009" real, "2008" real, "2005" real, "2000" real )
Name the average 2008 for beijing and 2005 more than 2
SELECT AVG("2008") FROM table_56914 WHERE "Year" = 'beijing' AND "2005" > '2'
wikisql
CREATE TABLE table_204_212 ( id number, "wager" text, "winner" text, "loser" text, "location" text, "date" text, "notes" text )
how many times is psycho clown the winner ?
SELECT COUNT(*) FROM table_204_212 WHERE "winner" = 'psycho clown'
squall
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...
在门诊就诊65477459453中,中医诊断名是什么?对应的编码呢
SELECT wdmzjzjlb.MZZYZDZZBM, wdmzjzjlb.MZZYZDZZMC FROM wdmzjzjlb WHERE wdmzjzjlb.JZLSH = '65477459453' UNION SELECT bdmzjzjlb.MZZYZDZZBM, bdmzjzjlb.MZZYZDZZMC FROM bdmzjzjlb WHERE bdmzjzjlb.JZLSH = '65477459453'
css
CREATE TABLE table_name_15 ( points INTEGER, year VARCHAR, chassis VARCHAR )
What are the lowest number of points with a Year of 1978, and a Chassis of ensign n177?
SELECT MIN(points) FROM table_name_15 WHERE year = 1978 AND chassis = "ensign n177"
sql_create_context
CREATE TABLE table_74964 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Opponent" text, "Score" text )
When is an Opponent of evie dominikovic?
SELECT "Date" FROM table_74964 WHERE "Opponent" = 'evie dominikovic'
wikisql
CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ) CREATE TABLE Lives_in ( stuid INTEGER, dormid INTEGER, room_number INTEGER ) CREATE TABLE Dorm_amenity ( ameni...
Find the number of students for the cities where have more than one student.
SELECT city_code, COUNT(*) FROM Student GROUP BY city_code
nvbench
CREATE TABLE table_57640 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What is the crowd number for the event that has a score of 8.25 (73) for the Away team?
SELECT COUNT("Crowd") FROM table_57640 WHERE "Away team score" = '8.25 (73)'
wikisql
CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_dista...
show me all flights from BOSTON to ATLANTA which leave ATLANTA after 1200 tomorrow
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, date_day, days, flight WHERE ((date_day.day_number = 20 AND date_day.month_number = 1 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.departure_time...
atis
CREATE TABLE table_4507 ( "STAPLE:" text, "Maize / Corn [A ]" text, "Rice [B ]" text, "Wheat [C ]" text, "Potato [D ]" text, "Cassava [E ]" text, "Soybean (Green) [F ]" text, "Sweet potato [G ]" text, "Yam [Y ]" text )
What is the rice amount when the potato amount is 79?
SELECT "Rice [B ]" FROM table_4507 WHERE "Potato [D ]" = '79'
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...
what is the number of patients whose primary disease is left internal jugular vein thrombosis;left arm edema and days of hospital stay is greater than 29?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "LEFT INTERNAL JUGULAR VEIN THROMBOSIS;LEFT ARM EDEMA" AND demographic.days_stay > "29"
mimicsql_data
CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE PostNotices ( Id number...
Jon Skeet answers per month.
WITH answersWITHMonth AS (SELECT p.OwnerUserId, DATEADD(month, DATEDIFF(month, 0, creationDate), 0) AS month FROM Posts AS p WHERE PostTypeId = 2) SELECT a.month, COUNT(*) FROM answersWITHMonth AS a INNER JOIN Users AS u ON u.Id = a.OwnerUserId WHERE u.Id = 22656 GROUP BY a.month ORDER BY a.month
sede
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost numbe...
how patient 018-81471 was admitted to hospital in 2102 for the first time?
SELECT patient.hospitaladmitsource FROM patient WHERE patient.uniquepid = '018-81471' AND STRFTIME('%y', patient.hospitaladmittime) = '2102' ORDER BY patient.hospitaladmittime LIMIT 1
eicu
CREATE TABLE table_name_74 ( gdp___bn__ VARCHAR, area__sq_mi_ VARCHAR )
What is the GDP for the region with an area of 7,263 sq. mi.?
SELECT gdp___bn__ FROM table_name_74 WHERE area__sq_mi_ = "7,263"
sql_create_context
CREATE TABLE t_kc21_t_kc22 ( MED_CLINIC_ID text, MED_EXP_DET_ID number ) CREATE TABLE t_kc21 ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD ...
列出开出药品的超限价自付金额在医疗就诊93533608212中高于7130.31元的所有药品有多少?
SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc22 JOIN t_kc21_t_kc22 JOIN t_kc21 ON t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID AND t_kc21_t_kc22.MED_CLINIC_ID = t_kc21.MED_CLINIC_ID WHERE t_kc21.MED_CLINIC_ID = '93533608212' AND t_kc22.OVE_SELF_AMO > 7130.31
css
CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number...
how many stackexchange non-meta sites?.
SELECT COUNT(name) FROM sys.databases WHERE (NOT name LIKE '%.Meta' OR name = 'StackExchange.Meta') AND database_id > 5
sede
CREATE TABLE table_name_19 ( pick INTEGER, player VARCHAR, round VARCHAR )
What is the pick for Mickey Johnson with fewer than 4 rounds?
SELECT SUM(pick) FROM table_name_19 WHERE player = "mickey johnson" AND round < 4
sql_create_context
CREATE TABLE table_19835 ( "Stage" real, "Winner" text, "General classification" text, "Points classification" text, "Mountains classification" text, "Combination classification" text, "Team classification" text )
How many teams have a combination classification of Alejandro Valverde and a Points classification of Alessandro Petacchi?
SELECT COUNT("Team classification") FROM table_19835 WHERE "Combination classification" = 'Alejandro Valverde' AND "Points classification" = 'Alessandro Petacchi'
wikisql
CREATE TABLE table_68106 ( "Player" text, "Wkts" real, "Runs" real, "Econ" real, "Ovrs" real )
If Adam Voges had less than 28.5 Ovrs, what are his highest Wkts?
SELECT MAX("Wkts") FROM table_68106 WHERE "Ovrs" < '28.5' AND "Player" = 'adam voges'
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 lab test fluid is other body fluid and were admitted before the year 2111.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2111" AND lab.fluid = "Other Body Fluid"
mimicsql_data
CREATE TABLE table_name_78 ( april_14 VARCHAR, mar_3 VARCHAR, april_21 VARCHAR )
What is the April 14 rank when the Mar 3rd is nr, and the April 21 is 13?
SELECT april_14 FROM table_name_78 WHERE mar_3 = "nr" AND april_21 = "13"
sql_create_context
CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilege...
Top 150 users from bulgaria.
SELECT Id, DisplayName, Reputation, WebsiteUrl, Location FROM Users WHERE Location LIKE '%Bulgaria%' OR Location LIKE '%sofia%' ORDER BY Reputation DESC LIMIT 150
sede
CREATE TABLE table_51407 ( "Year" real, "Film" text, "Role" text, "Leading Man" text, "Director" text )
What leading man earlier than 1932 was directed by archie mayo?
SELECT "Leading Man" FROM table_51407 WHERE "Year" < '1932' AND "Director" = 'archie mayo'
wikisql
CREATE TABLE table_58906 ( "Name" text, "Pos." text, "Height" text, "Weight" text, "Date of Birth" text, "Club" text )
What is the Height of the Player with a Date of Birth of 1979-06-12?
SELECT "Height" FROM table_58906 WHERE "Date of Birth" = '1979-06-12'
wikisql
CREATE TABLE table_train_69 ( "id" int, "systolic_blood_pressure_sbp" int, "language" string, "valvular_dysfunction" bool, "heart_disease" bool, "temperature" float, "sepsis" bool, "heart_rate" int, "lipid_metabolism" bool, "organ_failure" bool, "NOUSE" float )
congestive heart failure or valvular heart disease ( as a known prior diagnosis or in the judgment of the managing clinician )
SELECT * FROM table_train_69 WHERE heart_disease = 1 OR valvular_dysfunction = 1
criteria2sql
CREATE TABLE entrepreneur ( entrepreneur_id number, people_id number, company text, money_requested number, investor text ) CREATE TABLE people ( people_id number, name text, height number, weight number, date_of_birth text )
Give the total money requested by entrepreneurs who are taller than 1.85.
SELECT SUM(T1.money_requested) FROM entrepreneur AS T1 JOIN people AS T2 ON T1.people_id = T2.people_id WHERE T2.height > 1.85
spider
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 )
Please tell the revenues of the companies with the highest revenues in each headquarter city, and could you sort by the X in asc?
SELECT Headquarter, MAX(Revenue) FROM Manufacturers GROUP BY Headquarter ORDER BY Headquarter
nvbench
CREATE TABLE table_name_59 ( player VARCHAR, pick VARCHAR )
Who is the Pick 7 player?
SELECT player FROM table_name_59 WHERE pick = "7"
sql_create_context
CREATE TABLE table_79627 ( "Race" text, "Dist (f)" real, "Course" text, "Class" text, "Prize (\u00a3K)" real, "Odds" text, "Runners" real, "Placing" real, "Margin" text, "Time" text, "Jockey" text, "Trainer" text )
Which Dist (f) has a Race of irish derby?
SELECT "Dist (f)" FROM table_79627 WHERE "Race" = 'irish derby'
wikisql
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, a bar chart shows the distribution of name and the sum of code , and group by attribute name, sort in asc by the bars.
SELECT T2.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T2.Name
nvbench
CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location text, insurance text, language text, marital_status text, ethnicity text, age number ) CREATE ...
when did patient 83182 last get diagnosed with need prphyl vc vrl hepat during the current hospital visit?
SELECT diagnoses_icd.charttime FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'need prphyl vc vrl hepat') AND diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 83182 AND admissi...
mimic_iii
CREATE TABLE representative ( Representative_ID int, Name text, State text, Party text, Lifespan text ) CREATE TABLE election ( Election_ID int, Representative_ID int, Date text, Votes real, Vote_Percent real, Seats real, Place real )
List the dates and vote percents of elections. Show bar chart.
SELECT Date, Vote_Percent FROM election
nvbench
CREATE TABLE film ( film_id number, title text, studio text, director text, gross_in_dollar number ) 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 ...
What is the name of teh studio that created the most films?
SELECT studio FROM film GROUP BY studio ORDER BY COUNT(*) DESC LIMIT 1
spider
CREATE TABLE weekly_weather ( station_id int, day_of_week text, high_temperature int, low_temperature int, precipitation real, wind_speed_mph int ) CREATE TABLE train ( id int, train_number int, name text, origin text, destination text, time text, interval text ) CR...
Visualize a bar chart for the number of trains for each station by the station network name, rank in asc by the X.
SELECT network_name, COUNT(*) FROM station AS t1 JOIN route AS t2 ON t1.id = t2.station_id GROUP BY t2.station_id ORDER BY network_name
nvbench
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 ( ...
count the number of patients whose ethnicity is asian and admission year is less than 2112?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "ASIAN" AND demographic.admityear < "2112"
mimicsql_data
CREATE TABLE apartment_facilities ( apt_id number, facility_code text ) CREATE TABLE apartment_bookings ( apt_booking_id number, apt_id number, guest_id number, booking_status_code text, booking_start_date time, booking_end_date time ) CREATE TABLE apartments ( apt_id number, b...
What is the average room count of the apartments whose booking status code is 'Provisional'?
SELECT AVG(room_count) FROM apartment_bookings AS T1 JOIN apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T1.booking_status_code = "Provisional"
spider
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE cost ( costid number, ...
when was patient 021-79544 for the last time prescribed a medication via the sl route on the current hospital encounter?
SELECT medication.drugstarttime FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '021-79544' AND patient.hospitaldischargetime IS NULL)) AND med...
eicu
CREATE TABLE table_31966 ( "Calls" text, "Frequency" text, "Branding" text, "Format" text, "Timeslot" text, "Group owner" text )
Tell me the branding for frequency of 680 khz
SELECT "Branding" FROM table_31966 WHERE "Frequency" = '680 khz'
wikisql
CREATE TABLE table_7186 ( "Date" text, "Opponent" text, "Venue" text, "Result" text, "Attendance" real )
What is the Date with an Opponent that is hearts?
SELECT "Date" FROM table_7186 WHERE "Opponent" = 'hearts'
wikisql
CREATE TABLE jybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH text, BGJGDM text, BGJGMC text, BGRGH text, BGRQ time, BGRXM text, BGSJ time, CJRQ time, JSBBRQSJ time, JSBBSJ time, JYBBH text, JYJGMC text, JYJSGH text, JYJSQM text, JY...
门诊给08451089这个病人诊断为高血压病,看看编号为516626的这个检测指标的结果定量及其单位
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN txmzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX AND txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jyb...
css
CREATE TABLE stock ( Shop_ID int, Device_ID int, Quantity int ) CREATE TABLE shop ( Shop_ID int, Shop_Name text, Location text, Open_Date text, Open_Year int ) CREATE TABLE device ( Device_ID int, Device text, Carrier text, Package_Version text, Applications text, ...
What are the different software platforms for devices, and how many devices have each.
SELECT Software_Platform, COUNT(*) FROM device GROUP BY Software_Platform
nvbench
CREATE TABLE table_name_1 ( courtesy_title VARCHAR, tenure VARCHAR )
What is the courtesy title of the person whose tenure goes from 1766 1794?
SELECT courtesy_title FROM table_name_1 WHERE tenure = "1766–1794"
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 whose admission type is elective and year of birth is less than 2078?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "ELECTIVE" AND demographic.dob_year < "2078"
mimicsql_data
CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), ...
For those employees who did not have any job in the past, visualize a bar chart about the distribution of job_id and the sum of employee_id , and group by attribute job_id, and could you rank in ascending by the y-axis?
SELECT JOB_ID, SUM(EMPLOYEE_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) GROUP BY JOB_ID ORDER BY SUM(EMPLOYEE_ID)
nvbench
CREATE TABLE qtb ( 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...
在医疗机构0896805患者66990606从08年8月22日到15年12月14日有多少次检查?
SELECT COUNT(*) FROM qtb JOIN t_kc22 ON qtb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE qtb.PERSON_ID = '66990606' AND t_kc22.STA_DATE BETWEEN '2008-08-22' AND '2015-12-14' AND qtb.MED_SER_ORG_NO = '0896805' AND t_kc22.MED_INV_ITEM_TYPE = '检查费' UNION SELECT COUNT(*) FROM gyb JOIN t_kc22 ON gyb.MED_CLINIC_ID = t_kc22.MED...
css
CREATE TABLE table_1342249_35 ( first_elected VARCHAR, district VARCHAR )
What is the first electedfor district ohio 18
SELECT first_elected FROM table_1342249_35 WHERE district = "Ohio 18"
sql_create_context
CREATE TABLE table_name_42 ( winner VARCHAR, season VARCHAR )
Who was the winner during the 2009 season?
SELECT winner FROM table_name_42 WHERE season = 2009
sql_create_context
CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) 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 tex...
among the patients of age 40s , what was the top five most frequent procedure?
SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t1.icd9_code FROM (SELECT procedures_icd.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age B...
mimic_iii
CREATE TABLE table_name_72 ( week_5 VARCHAR, week_3 VARCHAR )
Who was the girl on week 5 that came after week 3's Mikaela James?
SELECT week_5 FROM table_name_72 WHERE week_3 = "mikaela james"
sql_create_context
CREATE TABLE person_info_hz_info ( RYBH text, KH number, KLX number, YLJGDM number ) CREATE TABLE mzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH text, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC...
查询在医院0257610患者33343634的门诊诊断包括期的门诊就诊记录
SELECT * FROM hz_info JOIN mzjzjlb JOIN person_info_hz_info JOIN person_info ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND person_info_hz_info.KH = hz_info.KH AND person_info_hz_info.KLX = hz_info.KLX AND person_info_hz_info.YLJGDM = hz_info.YLJGDM AND person_info_hz_i...
css
CREATE TABLE table_name_79 ( performer_3 VARCHAR, date VARCHAR, performer_1 VARCHAR, performer_2 VARCHAR )
Performer 1 of Stephen Frost, and a Performer 2 of Josie Lawrence, and a Date of 15 September 1995 is what performer 3?
SELECT performer_3 FROM table_name_79 WHERE performer_1 = "stephen frost" AND performer_2 = "josie lawrence" AND date = "15 september 1995"
sql_create_context
CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time...
My Top-ranked comments >= 5 since 1/1/2019. The 50 highest ranked comments with post links
SELECT PostId AS "post_link", Score, Text FROM Comments WHERE UserId = @UserId AND Score >= 5 AND CreationDate > '1/1/2019' ORDER BY Score LIMIT 2500
sede
CREATE TABLE table_14616 ( "Round" text, "Date and time" text, "Opponent team" text, "Home/Away" text, "Result" text )
What opponent was in the match that resulted in 1-2?
SELECT "Opponent team" FROM table_14616 WHERE "Result" = '1-2'
wikisql
CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAc...
Questions with RAW tag at first revision and no RAW tag now.
SELECT Posts.Id AS "post_link", Posts.Tags, PostInits.Text AS "initial_tags", Posts.CreationDate FROM Posts INNER JOIN (SELECT PostId, Text FROM PostHistory WHERE PostHistoryTypeId = 3 AND Text LIKE '%rules-as-written%') AS PostInits ON Posts.Id = PostInits.PostId WHERE NOT Posts.Tags LIKE '%rules-as-written%' AND (DAT...
sede
CREATE TABLE table_19330 ( "Rank" real, "Name" text, "Nationality" text, "1st (m)" text, "2nd (m)" text, "Points" text, "Overall WC points (Rank)" text )
For the nationality of FIN and the points of 418.8 what is the overall wc points?
SELECT "Overall WC points (Rank)" FROM table_19330 WHERE "Nationality" = 'FIN' AND "Points" = '418.8'
wikisql
CREATE TABLE table_36413 ( "Country" text, "Launches" real, "Successes" real, "Failures" real, "Partial failures" real )
Successes smaller than 6, and Launches larger than 1, and a Failures of 2 is what sum of the partial failures?
SELECT SUM("Partial failures") FROM table_36413 WHERE "Successes" < '6' AND "Launches" > '1' AND "Failures" = '2'
wikisql
CREATE TABLE table_48241 ( "Region" text, "Date" text, "Label" text, "Format" text, "Catalog" text )
What is Label, when Format is Double CD?
SELECT "Label" FROM table_48241 WHERE "Format" = 'double cd'
wikisql
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
find out the number of patients with lab test item id 50994.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.itemid = "50994"
mimicsql_data
CREATE TABLE table_73606 ( "Code name" text, "Brand name" text, "Model (list)" text, "Frequency" text, "Cores/Threads" text, "Max Memory Speed" text )
List the number of cores for ddr3-1333 with frequencies between 2.66-2.8ghz.
SELECT "Cores/Threads" FROM table_73606 WHERE "Max Memory Speed" = 'DDR3-1333' AND "Frequency" = '2.66-2.8GHz'
wikisql
CREATE TABLE program_course ( program_id int, course_id int, workload int, category varchar ) CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, country varchar, zip int ) CREATE TABLE course ( c...
Is it true that all upper level classes are 14 credits ?
SELECT COUNT(*) = 0 FROM course, program_course WHERE course.credits <> 14 AND course.department = 'EECS' AND program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id
advising
CREATE TABLE table_23763 ( "Poll source" text, "Dates administered" text, "Joe Miller (R)" text, "Lisa Murkowski (R) write-in candidate *" text, "Scott McAdams (D)" text )
When 30% is scott mcadams (d) percentage how many poll sources are there?
SELECT COUNT("Poll source") FROM table_23763 WHERE "Scott McAdams (D)" = '30%'
wikisql
CREATE TABLE table_name_64 ( viewers__m_ VARCHAR, episode VARCHAR )
What Viewers (m) has an Episode of 40 days?
SELECT viewers__m_ FROM table_name_64 WHERE episode = "40 days"
sql_create_context
CREATE TABLE table_name_39 ( constructor VARCHAR, driver VARCHAR )
Who was the constructor of the car driven by Heikki Kovalainen?
SELECT constructor FROM table_name_39 WHERE driver = "heikki kovalainen"
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 of the male patients had icd9 code 51889?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.gender = "M" AND diagnoses.icd9_code = "51889"
mimicsql_data
CREATE TABLE table_14903081_1 ( country VARCHAR, location VARCHAR )
Rome is in which country?
SELECT country FROM table_14903081_1 WHERE location = "Rome"
sql_create_context
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...
在医院2065470病患50675305出院诊断疾病名称不包含失眠症的医疗就诊记录编号是多少号?
SELECT gwyjzb.MED_CLINIC_ID FROM gwyjzb WHERE gwyjzb.PERSON_ID = '50675305' AND gwyjzb.MED_SER_ORG_NO = '2065470' AND NOT gwyjzb.OUT_DIAG_DIS_NM LIKE '%失眠症%' UNION SELECT fgwyjzb.MED_CLINIC_ID FROM fgwyjzb WHERE fgwyjzb.PERSON_ID = '50675305' AND fgwyjzb.MED_SER_ORG_NO = '2065470' AND NOT fgwyjzb.OUT_DIAG_DIS_NM LIKE '...
css
CREATE TABLE table_name_15 ( charter_range VARCHAR, status VARCHAR, state VARCHAR )
What years were the inactive North Carolina chapter active?
SELECT charter_range FROM table_name_15 WHERE status = "inactive" AND state = "north carolina"
sql_create_context
CREATE TABLE dataset ( datasetid int, datasetname varchar ) CREATE TABLE paperfield ( fieldid int, paperid int ) CREATE TABLE writes ( paperid int, authorid int ) CREATE TABLE field ( fieldid int ) CREATE TABLE keyphrase ( keyphraseid int, keyphrasename varchar ) CREATE TABLE jo...
keyphrases used by torlak at popl or pldi
SELECT DISTINCT paperkeyphrase.keyphraseid FROM author, paper, paperkeyphrase, venue, writes WHERE author.authorname = 'torlak' AND paper.paperid = paperkeyphrase.paperid AND venue.venueid = paper.venueid AND venue.venuename IN ('popl', 'pldi') AND writes.authorid = author.authorid AND writes.paperid = paper.paperid
scholar