context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_name_50 (
qual_1 VARCHAR,
best VARCHAR,
qual_2 VARCHAR
) | Which qualifying 1 time has a best under 58.669 and a qualifying 2 time under 57.897? | SELECT qual_1 FROM table_name_50 WHERE best < 58.669 AND qual_2 < 57.897 | sql_create_context |
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID ... | 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, a line chart shows the trend of manager_id over hire_date . | SELECT HIRE_DATE, MANAGER_ID FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 | nvbench |
CREATE TABLE table_22801165_1 (
date VARCHAR,
cowboys_points VARCHAR
) | When did the Cowboys score 13 points in 1966? | SELECT date FROM table_22801165_1 WHERE cowboys_points = 13 | sql_create_context |
CREATE TABLE table_24027047_1 (
population_density___km²_2011_ VARCHAR,
area__km²__2011 VARCHAR
) | What was the population density in km2 for 2011 in the division where area in km2 was 684.37 in 2011? | SELECT population_density___km²_2011_ FROM table_24027047_1 WHERE area__km²__2011 * * = "684.37" | 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 prescriptions (
subject_id text,
hadm_id... | what is the insurance of the patient name jerry deberry? | SELECT demographic.insurance FROM demographic WHERE demographic.name = "Jerry Deberry" | mimicsql_data |
CREATE TABLE table_8590 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | With the game that was less than 16 what was the high assists? | SELECT "High assists" FROM table_8590 WHERE "Game" < '16' | wikisql |
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
Par... | Accepted non-self-answers without accept-vote, where question owner exists. | SELECT p.AcceptedAnswerId AS "post_link", p.OwnerUserId AS "user_link" FROM Posts AS p WHERE NOT p.OwnerUserId IS NULL AND p.AcceptedAnswerId NOT IN (SELECT v.PostId FROM Votes AS v WHERE v.VoteTypeId = 1) AND p.AcceptedAnswerId NOT IN (SELECT q.Id FROM Posts AS q WHERE q.OwnerUserId = p.OwnerUserId) ORDER BY p.Accepte... | sede |
CREATE TABLE table_21321804_3 (
player VARCHAR,
cfl_team VARCHAR
) | Which player plays for the Winnipeg Blue Bombers? | SELECT player FROM table_21321804_3 WHERE cfl_team = "Winnipeg Blue Bombers" | sql_create_context |
CREATE TABLE table_24856090_1 (
average INTEGER,
hk_viewers VARCHAR
) | What is the largest average for the episode with 1.97 million Hong Kong viewers? | SELECT MAX(average) FROM table_24856090_1 WHERE hk_viewers = "1.97 million" | sql_create_context |
CREATE TABLE table_name_34 (
record VARCHAR,
loss VARCHAR
) | What was the record at the game that had a loss of Lemanczyk (0 1)? | SELECT record FROM table_name_34 WHERE loss = "lemanczyk (0–1)" | sql_create_context |
CREATE TABLE table_35261 (
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | Nation of total has what sum of gold? | SELECT SUM("Gold") FROM table_35261 WHERE "Nation" = 'total' | wikisql |
CREATE TABLE table_27940569_1 (
pts_bns VARCHAR,
driver VARCHAR
) | How many points and bonuses did Kurt Busch get? | SELECT pts_bns FROM table_27940569_1 WHERE driver = "Kurt Busch" | sql_create_context |
CREATE TABLE table_name_61 (
natural_change__per_1000_ VARCHAR,
crude_death_rate__per_1000_ VARCHAR
) | what is the natural change (per 1000) when the crude death rate (per 1000) is 10? | SELECT natural_change__per_1000_ FROM table_name_61 WHERE crude_death_rate__per_1000_ = 10 | sql_create_context |
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
UserId number,
ContentLicense text
)
CREATE TABLE PostLinks (
Id number,
Crea... | Get Users by Location and Tag. | SELECT u.DisplayName, 'http://stackoverflow.com/users/' + CAST(u.Id AS TEXT(255)) AS "httplink", u.Reputation, COUNT(p.Title) AS "questions_answered" FROM Users AS u INNER JOIN Posts AS p ON p.OwnerUserId = u.Id INNER JOIN Posts AS ans ON p.Id = ans.ParentId INNER JOIN PostTags AS pt ON p.Id = pt.PostId INNER JOIN Tags... | sede |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescription... | what is the number of patients whose age is less than 49 and diagnoses icd9 code is 29590? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.age < "49" AND diagnoses.icd9_code = "29590" | mimicsql_data |
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
va... | i mean how many hours has it been since the first time patient 15794 had a gastric meds intake on the current icu visit? | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', inputevents_cv.charttime)) FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 15794) AND icustays.outtime IS NULL)... | mimic_iii |
CREATE TABLE gas_station (
Station_ID int,
Open_Year int,
Location text,
Manager_Name text,
Vice_Manager_Name text,
Representative_Name text
)
CREATE TABLE station_company (
Station_ID int,
Company_ID int,
Rank_of_the_Year int
)
CREATE TABLE company (
Company_ID int,
Rank i... | Bar chart of how many headquarters from each headquarters, order from high to low by the bars. | SELECT Headquarters, COUNT(Headquarters) FROM company GROUP BY Headquarters ORDER BY Headquarters DESC | nvbench |
CREATE TABLE table_203_513 (
id number,
"no." number,
"date" text,
"home team" text,
"visiting team" text,
"goals" text,
"score" text,
"result" text,
"venue" text,
"competition" text
) | what was the name of the first competition according to this chart ? | SELECT "competition" FROM table_203_513 WHERE id = 1 | squall |
CREATE TABLE jyjgzbb (
BGDH text,
BGRQ time,
CKZFWDX text,
CKZFWSX number,
CKZFWXX number,
JCFF text,
JCRGH text,
JCRXM text,
JCXMMC text,
JCZBDM text,
JCZBJGDL number,
JCZBJGDW text,
JCZBJGDX text,
JCZBMC text,
JLDW text,
JYRQ time,
JYZBLSH text,
... | 列举出病患苏兰娜在06年7月30日到19年10月4日内被开出的所有检验报告单的名称以及科室编号是什么? | SELECT jybgb.KSBM, jybgb.KSMC FROM person_info JOIN hz_info JOIN wdmzjzjlb JOIN jybgb ON person_info.RYBH = hz_info.RYBH AND 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 WHERE person_... | css |
CREATE TABLE table_13836704_7 (
international_passengers VARCHAR,
rank VARCHAR
) | What is the total number of passengers of the airport ranked 15? | SELECT international_passengers FROM table_13836704_7 WHERE rank = 15 | sql_create_context |
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE instructor (
instructor_id int,
... | What is the possibility of being able to take ACC 990 in Winter of 2014 ? | SELECT COUNT(*) > 0 FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'ACC' AND course.number = 990 AND semester.semester = 'Winter' AND semester.semester_id = course_offering.semester AND semester.year = 2014 | advising |
CREATE TABLE table_204_961 (
id number,
"title" text,
"director" text,
"production" text,
"music" text,
"cast" text,
"release date" text
) | what film was released before devakanya ? | SELECT "title" FROM table_204_961 WHERE id = (SELECT id FROM table_204_961 WHERE "title" = 'devakanya') - 1 | squall |
CREATE TABLE races (
raceId INTEGER,
year INTEGER,
round INTEGER,
circuitId INTEGER,
name TEXT,
date TEXT,
time TEXT,
url TEXT
)
CREATE TABLE driverStandings (
driverStandingsId INTEGER,
raceId INTEGER,
driverId INTEGER,
points REAL,
position INTEGER,
positionTex... | Show me a bar chart about the number of races held in each year after 2014, and order X-axis from high to low order please. | SELECT year, COUNT(year) FROM races AS T1 JOIN results AS T2 ON T1.raceId = T2.raceId WHERE T1.year > 2014 GROUP BY year ORDER BY year DESC | nvbench |
CREATE TABLE table_name_68 (
result VARCHAR,
goal VARCHAR
) | What is the Result where Goal is 9? | SELECT result FROM table_name_68 WHERE goal = 9 | sql_create_context |
CREATE TABLE table_name_50 (
h_a_n VARCHAR,
date VARCHAR
) | What is H/A/N, when Date is October 31? | SELECT h_a_n FROM table_name_50 WHERE date = "october 31" | sql_create_context |
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE course (
course_id int,
name varchar,
dep... | When can I take EECS 574 ? | SELECT DISTINCT semester.semester, semester.year FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'EECS' AND course.number = 574 AND course_offering.semester = semester.semester_id AND semester.semester_id > (SELECT SEMESTERalias1.semester_id FROM semeste... | advising |
CREATE TABLE table_24682 (
"No" real,
"Driver" text,
"Entrant" text,
"Constructor" text,
"Chassis" text,
"Engine" text
) | The Maserati 4cl's minimum no was? | SELECT MIN("No") FROM table_24682 WHERE "Chassis" = 'Maserati 4CL' | wikisql |
CREATE TABLE camera_lens (
focal_length_mm INTEGER
) | How many camera lenses have a focal length longer than 15 mm? | SELECT COUNT(*) FROM camera_lens WHERE focal_length_mm > 15 | sql_create_context |
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... | what was patient 030-42006's last intake time on 12/29/this year. | SELECT intakeoutput.intakeoutputtime FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-42006')) AND intakeoutput.cellpath LIKE '%intake%... | eicu |
CREATE TABLE table_name_55 (
performer_1 VARCHAR,
performer_2 VARCHAR
) | Performer 2 of compilation 1 had what performer 1? | SELECT performer_1 FROM table_name_55 WHERE performer_2 = "compilation 1" | sql_create_context |
CREATE TABLE Sales (
sales_transaction_id INTEGER,
sales_details VARCHAR(255)
)
CREATE TABLE Transactions_Lots (
transaction_id INTEGER,
lot_id INTEGER
)
CREATE TABLE Transactions (
transaction_id INTEGER,
investor_id INTEGER,
transaction_type_code VARCHAR(10),
date_of_transaction DATE... | Give me a bar chart for how many date of transaction of each date of transaction, and display by the the number of date of transaction in ascending. | SELECT date_of_transaction, COUNT(date_of_transaction) FROM Transactions ORDER BY COUNT(date_of_transaction) | nvbench |
CREATE TABLE table_45668 (
"Macedonian population in Vojvodina" text,
"1961" real,
"Number 1971" real,
"1981" real,
"1991" real,
"2002" real
) | What is the lowest 1971 number of the Macedonian population with a 2002 value greater than 133 and a 1991 value less than 171? | SELECT MIN("Number 1971") FROM table_45668 WHERE "2002" > '133' AND "1991" < '171' | wikisql |
CREATE TABLE table_60981 (
"Date" text,
"Opponent#" text,
"Rank #" text,
"Site" text,
"Result" text,
"Attendance" text
) | WHAT DATE HAD 6 RANK? | SELECT "Date" FROM table_60981 WHERE "Rank #" = '6' | wikisql |
CREATE TABLE table_name_75 (
torque VARCHAR,
model VARCHAR
) | What was the torque@rpm of the sl 65 amg? | SELECT torque AS @rpm FROM table_name_75 WHERE model = "sl 65 amg" | sql_create_context |
CREATE TABLE table_25020 (
"Year" real,
"1st Venue" text,
"2nd Venue" text,
"3rd Venue" text,
"4th Venue" text,
"5th Venue" text
) | How many 5th venue cities were there when Doha was the 1st venue city? | SELECT COUNT("5th Venue") FROM table_25020 WHERE "1st Venue" = 'Doha' | wikisql |
CREATE TABLE table_26533354_8 (
position VARCHAR,
player VARCHAR
) | Name the position for stanley havili | SELECT position FROM table_26533354_8 WHERE player = "Stanley Havili" | sql_create_context |
CREATE TABLE table_36790 (
"Rank" text,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | What is the sum of silver values that have bronze values under 4, golds over 2, and a rank of 3? | SELECT SUM("Silver") FROM table_36790 WHERE "Bronze" < '4' AND "Rank" = '3' AND "Gold" > '2' | wikisql |
CREATE TABLE table_16529 (
"Year" text,
"Champion" text,
"Score" text,
"Runner-Up" text,
"Location" text,
"Semi-Finalist #1" text,
"Semi-Finalist #2" text
) | who is the runner-up where location is ellenton, fl and year is 2004 | SELECT "Runner-Up" FROM table_16529 WHERE "Location" = 'Ellenton, FL' AND "Year" = '2004' | wikisql |
CREATE TABLE table_48714 (
"Game" real,
"Date" text,
"Opponent" text,
"Score" text,
"Location" text,
"Attendance" real,
"Record" text,
"Points" real
) | Which Game has an Attendance smaller than 18,277, and Points of 64? | SELECT MAX("Game") FROM table_48714 WHERE "Attendance" < '18,277' AND "Points" = '64' | wikisql |
CREATE TABLE table_name_5 (
seats_2006 INTEGER,
parties_and_voter_communities VARCHAR,
_percentage_2006 VARCHAR
) | What is the highest number of Seats 2006 held by the communities of B rger F r Gro -Rohrheim Party/Voter Community, with a %2006 less than 21.3? | SELECT MAX(seats_2006) FROM table_name_5 WHERE parties_and_voter_communities = "bürger für groß-rohrheim" AND _percentage_2006 < 21.3 | sql_create_context |
CREATE TABLE table_49584 (
"Nat." text,
"Name" text,
"Moving to" text,
"Type" text,
"Transfer window" text,
"Transfer fee" text,
"Source" text
) | What is the type of POR? | SELECT "Type" FROM table_49584 WHERE "Nat." = 'por' | wikisql |
CREATE TABLE table_name_60 (
time_retired VARCHAR,
driver VARCHAR
) | What is the time/retired for alain prost? | SELECT time_retired FROM table_name_60 WHERE driver = "alain prost" | sql_create_context |
CREATE TABLE table_30388 (
"Outcome" text,
"Year" real,
"Championship" text,
"Surface" text,
"Partner" text,
"Opponents in the final" text,
"Score in the final" text
) | Who was Betty's partner when the surface is hard? | SELECT "Partner" FROM table_30388 WHERE "Surface" = 'Hard' | wikisql |
CREATE TABLE table_name_60 (
pick INTEGER,
school VARCHAR
) | What is the highest pick for a player from auburn? | SELECT MAX(pick) FROM table_name_60 WHERE school = "auburn" | sql_create_context |
CREATE TABLE table_8196 (
"Date" text,
"Home" text,
"Score" text,
"Away" text,
"Attendance" real
) | Who was the home team in the game with more than 1675, and Olimpia was the away side? | SELECT "Home" FROM table_8196 WHERE "Attendance" > '1675' AND "Away" = 'olimpia' | 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,
... | how many female patients were diagnosed with aortic valve insuffiency\aortic valve replacement /sda? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "F" AND demographic.diagnosis = "AORTIC VALVE INSUFFIENCY\AORTIC VALVE REPLACEMENT /SDA" | mimicsql_data |
CREATE TABLE table_15315816_1 (
winners_share__$_ VARCHAR,
year VARCHAR
) | How much are all winners share ($) in the year 2004? | SELECT winners_share__$_ FROM table_15315816_1 WHERE year = "2004" | sql_create_context |
CREATE TABLE table_42213 (
"Volume:Issue" text,
"Issue Date(s)" text,
"Weeks on Top" real,
"Song" text,
"Artist" text
) | What is the sum of Weeks on Top for the Volume:Issue 34:9-12? | SELECT SUM("Weeks on Top") FROM table_42213 WHERE "Volume:Issue" = '34:9-12' | wikisql |
CREATE TABLE table_7464 (
"Ep No" text,
"Prod Code" text,
"Original Air Date" text,
"Episode Title" text,
"Ratings" text
) | What was the title of the episode with a production code of 1gowo04? | SELECT "Episode Title" FROM table_7464 WHERE "Prod Code" = '1gowo04' | wikisql |
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_... | Draw a bar chart of last name versus department_id, and order in desc by the X please. | SELECT LAST_NAME, DEPARTMENT_ID FROM employees ORDER BY LAST_NAME DESC | nvbench |
CREATE TABLE table_46019 (
"Game" real,
"Date" text,
"Opponent" text,
"Score" text,
"Location" text,
"Record" text
) | What was the game number when record is 59-15? | SELECT MIN("Game") FROM table_46019 WHERE "Record" = '59-15' | wikisql |
CREATE TABLE table_name_38 (
rank INTEGER,
country VARCHAR
) | What is Hungary's highest Rank? | SELECT MAX(rank) FROM table_name_38 WHERE country = "hungary" | sql_create_context |
CREATE TABLE table_26198709_1 (
original_air_date VARCHAR,
us_viewers__million_ VARCHAR
) | How many air dates does the episode with 15.50 million viewers have? | SELECT COUNT(original_air_date) FROM table_26198709_1 WHERE us_viewers__million_ = "15.50" | sql_create_context |
CREATE TABLE table_name_85 (
high_points VARCHAR,
location_attendance VARCHAR
) | At Time Warner Cable Arena 12,096, what was the high points? | SELECT high_points FROM table_name_85 WHERE location_attendance = "time warner cable arena 12,096" | sql_create_context |
CREATE TABLE table_1231 (
"Station" text,
"Year opened" text,
"Metropolitan borough [c ]" text,
"Zone" real,
"Servedby Route maps:- [ dead link ] [ dead link ]" text,
"Station users 2006\u201307" real,
"Station users 2007\u201308" real
) | What's the biggest zone? | SELECT MAX("Zone") FROM table_1231 | wikisql |
CREATE TABLE table_name_55 (
red_cards INTEGER,
season VARCHAR,
games VARCHAR
) | Which Red Cards has a Season of 1998/1999, and a Games larger than 41? | SELECT MIN(red_cards) FROM table_name_55 WHERE season = "1998/1999" AND games > 41 | sql_create_context |
CREATE TABLE table_14174 (
"Year" real,
"Competition" text,
"Venue" text,
"Position" text,
"Event" text
) | What is the position for Discus in 2013? | SELECT "Position" FROM table_14174 WHERE "Event" = 'discus' AND "Year" = '2013' | wikisql |
CREATE TABLE table_73914 (
"Outcome" text,
"No." text,
"Date" text,
"Championship" text,
"Surface" text,
"Opponent in the final" text,
"Score in the final" text
) | In the championship Indian Wells, United States (2), who are the opponents in the final? | SELECT "Opponent in the final" FROM table_73914 WHERE "Championship" = 'Indian Wells, United States (2)' | wikisql |
CREATE TABLE table_name_7 (
lb VARCHAR,
scr_no VARCHAR,
sr_no VARCHAR
) | Name the LB&SCR number that has SR number of 8597 8600 | SELECT lb & scr_no FROM table_name_7 WHERE sr_no = "8597–8600" | sql_create_context |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE proced... | what are the hospitals admission times of patient 60515 until 3 years ago? | SELECT admissions.admittime FROM admissions WHERE admissions.subject_id = 60515 AND DATETIME(admissions.admittime) <= DATETIME(CURRENT_TIME(), '-3 year') | mimic_iii |
CREATE TABLE table_name_98 (
years VARCHAR,
name VARCHAR
) | What are the years for Kawerau Putauaki School? | SELECT years FROM table_name_98 WHERE name = "kawerau putauaki school" | sql_create_context |
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Tags (
Id number,
TagName text,
... | Test of Poorly Answer Questions by Tag. | SELECT * FROM Posts WHERE AnswerCount > 2 AND ViewCount > 20 AND ClosedDate IS NULL AND AcceptedAnswerId IS NULL AND Tags LIKE '%##Tag1##%' AND CreationDate > '2015-12-21' | sede |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses (
... | count the number of patients whose insurance is government and procedure long title is intravenous infusion of clofarabine? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Government" AND procedures.long_title = "Intravenous infusion of clofarabine" | mimicsql_data |
CREATE TABLE artist (
artist_name varchar2(50),
country varchar2(20),
gender varchar2(20),
preferred_genre varchar2(50)
)
CREATE TABLE genre (
g_name varchar2(20),
rating varchar2(10),
most_popular_in varchar2(50)
)
CREATE TABLE song (
song_name varchar2(50),
artist_name varchar2(5... | Show me mean rating by languages in a histogram, and list by the names from low to high please. | SELECT languages, AVG(rating) FROM song GROUP BY languages ORDER BY languages | nvbench |
CREATE TABLE table_25527255_2 (
average_squad_age VARCHAR,
shirt_sponsor VARCHAR,
kit_manufacturer VARCHAR
) | What is the average squad age of the team whose shirt sponsor is Sho'rtan Gaz Mahsulot and whose kit manufacturer is Adidas? | SELECT average_squad_age FROM table_25527255_2 WHERE shirt_sponsor = "Sho'rtan Gaz Mahsulot" AND kit_manufacturer = "Adidas" | sql_create_context |
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTyp... | How many questions did SO have X days after its creation?. Note that the public beta started on September 15th, 2008 | SELECT COUNT(*) FROM Posts WHERE PostTypeId = 1 AND CreationDate < DATEADD(day, '##Days##', '2008-07-15') | sede |
CREATE TABLE table_46708 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" text
) | What was the Week on September 5, 1993? | SELECT "Week" FROM table_46708 WHERE "Date" = 'september 5, 1993' | wikisql |
CREATE TABLE table_name_45 (
player VARCHAR,
place VARCHAR,
country VARCHAR
) | Name the Player who has a Place of t7 in Country of united states? | SELECT player FROM table_name_45 WHERE place = "t7" AND country = "united states" | sql_create_context |
CREATE TABLE t_kc22 (
AMOUNT number,
CHA_ITEM_LEV number,
DATA_ID text,
DIRE_TYPE number,
DOSE_FORM text,
DOSE_UNIT text,
EACH_DOSAGE text,
EXP_OCC_DATE time,
FLX_MED_ORG_ID text,
FXBZ number,
HOSP_DOC_CD text,
HOSP_DOC_NM text,
MED_CLINIC_ID text,
MED_DIRE_CD tex... | 看一下病患鲁同济的医疗记录中哪几次开的药品金额大于8376.61元?列出医疗就诊编码 | SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_NM = '鲁同济' AND t_kc21.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT > 8376.61) | css |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescription... | count the number of patients whose days of hospital stay is greater than 1 and lab test fluid is joint fluid? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.days_stay > "1" AND lab.fluid = "Joint Fluid" | mimicsql_data |
CREATE TABLE table_28707 (
"Rank" real,
"Athlete" text,
"Country" text,
"Distance (metres)" text,
"Points" text,
"Adjusted Points" real
) | What is the country(s) where the points equal 723.075? | SELECT "Country" FROM table_28707 WHERE "Points" = '723.075' | wikisql |
CREATE TABLE table_15187735_16 (
netflix VARCHAR,
segment_a VARCHAR
) | Whats the season/episode of segment a digital dentistry | SELECT netflix FROM table_15187735_16 WHERE segment_a = "Digital Dentistry" | sql_create_context |
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... | Visualize a bar chart about the distribution of ACC_Road and the sum of School_ID , and group by attribute ACC_Road, show in descending by the bars please. | SELECT ACC_Road, SUM(School_ID) FROM basketball_match GROUP BY ACC_Road ORDER BY ACC_Road DESC | nvbench |
CREATE TABLE table_name_59 (
career_with_the_franchise_ VARCHAR,
b_ VARCHAR,
player VARCHAR
) | What is Career with the franchise [b ], when Player is 'Willie Anderson Category:Articles with hCards'? | SELECT career_with_the_franchise_ AS "b_" FROM table_name_59 WHERE player = "willie anderson category:articles with hcards" | sql_create_context |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id t... | count the number of inpatient hospital admitted patients who were discharged to skilled nursing facility. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "TRSF WITHIN THIS FACILITY" AND demographic.discharge_location = "SNF" | mimicsql_data |
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... | 病人年龄7岁以上的医疗记录的平均医疗费总额有多少 | SELECT AVG(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.t_kc21_PERSON_AGE > 7) | css |
CREATE TABLE table_name_87 (
competition VARCHAR,
date VARCHAR
) | Tell me the competition of 20 august 2008 | SELECT competition FROM table_name_87 WHERE date = "20 august 2008" | sql_create_context |
CREATE TABLE table_19363 (
"Application" text,
"Version" text,
"Cmdlets" text,
"Provider" text,
"Management GUI" text
) | How many of the cmdlets are the 2008 version? | SELECT COUNT("Cmdlets") FROM table_19363 WHERE "Version" = '2008' | wikisql |
CREATE TABLE table_name_30 (
d_45_o VARCHAR,
d_46_o VARCHAR
) | Name the D 45 O that has D 46 O of d 26 | SELECT d_45_o FROM table_name_30 WHERE d_46_o = "d 26" | sql_create_context |
CREATE TABLE table_61329 (
"Outcome" text,
"Date" real,
"Tournament" text,
"Surface" text,
"Partner" text,
"Opponents in the final" text,
"Score in the final" text
) | Name the date of Tournament of paris indoor , france? | SELECT SUM("Date") FROM table_61329 WHERE "Tournament" = 'paris indoor , france' | wikisql |
CREATE TABLE Candidate_Assessments (
candidate_id INTEGER,
qualification CHAR(15),
assessment_date DATETIME,
asessment_outcome_code CHAR(15)
)
CREATE TABLE Student_Course_Registrations (
student_id INTEGER,
course_id INTEGER,
registration_date DATETIME
)
CREATE TABLE Student_Course_Attenda... | what is the total number of last names of all candidates? | SELECT last_name, COUNT(last_name) FROM People GROUP BY last_name | nvbench |
CREATE TABLE t_kc22 (
AMOUNT number,
CHA_ITEM_LEV number,
DATA_ID text,
DIRE_TYPE number,
DOSE_FORM text,
DOSE_UNIT text,
EACH_DOSAGE text,
EXP_OCC_DATE time,
FLX_MED_ORG_ID text,
FXBZ number,
HOSP_DOC_CD text,
HOSP_DOC_NM text,
MED_CLINIC_ID text,
MED_DIRE_CD tex... | 患者马曼丽的医保金额被花了多少,时间是从11年3月22日到19年4月16日 | SELECT SUM(t_kc24.PER_ACC_PAY) FROM t_kc24 WHERE t_kc24.t_kc21_PERSON_NM = '马曼丽' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2011-03-22' AND '2019-04-16' | css |
CREATE TABLE table_27879 (
"Settlement" text,
"Cyrillic Name Other Names" text,
"Type" text,
"Population (2011)" real,
"Largest ethnic group (2002)" text,
"Dominant religion (2002)" text
) | What was the largest ethnic group in in the settlement with the cyrillic name ? | SELECT "Largest ethnic group (2002)" FROM table_27879 WHERE "Cyrillic Name Other Names" = 'Банатски Карловац' | wikisql |
CREATE TABLE table_29202 (
"Rank" real,
"Rider" text,
"Sat 21 Aug" text,
"Mon 23 Aug" text,
"Tues 24 Aug" text,
"Wed 25 Aug" text,
"Thurs 26 Aug" text,
"Fri 27 Aug" text,
"Sat 28 Aug" text
) | What was the Weds 25 Aug time for the driver whose Aug 27 time was 22' 23.97 101.065mph? | SELECT "Wed 25 Aug" FROM table_29202 WHERE "Fri 27 Aug" = '22'' 23.97 101.065mph' | wikisql |
CREATE TABLE table_204_557 (
id number,
"#" number,
"date" text,
"visitor" text,
"score" text,
"home" text,
"record" text,
"pts" number
) | which month had the most games ? | SELECT "date" FROM table_204_557 GROUP BY "date" ORDER BY COUNT(*) DESC LIMIT 1 | squall |
CREATE TABLE program (
program_id number,
name text,
origin text,
launch number,
owner text
)
CREATE TABLE broadcast (
channel_id number,
program_id number,
time_of_day text
)
CREATE TABLE broadcast_share (
channel_id number,
program_id number,
date text,
share_in_perce... | Show me the owner of the channel with the highest rating. | SELECT owner FROM channel ORDER BY rating_in_percent DESC LIMIT 1 | spider |
CREATE TABLE table_49473 (
"Tongan" text,
"Niuean" text,
"S\u0101moan" text,
"Takuu" text,
"Tahitian" text,
"Rarotongan" text,
"M\u0101ori" text,
"North Marquesan" text,
"South Marquesan" text,
"Hawai'ian" text,
"Mangarevan" text
) | What kind of North Marquesan has a Takuu of / ani/? | SELECT "North Marquesan" FROM table_49473 WHERE "Takuu" = '/ɾani/' | wikisql |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
CREATE TABLE bdmzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH number,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
K... | 以前69072554这个患者是在哪就真的 | SELECT wdmzjzjlb.YLJGDM FROM hz_info JOIN wdmzjzjlb ON hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX WHERE hz_info.RYBH = '69072554' UNION SELECT bdmzjzjlb.YLJGDM FROM hz_info JOIN bdmzjzjlb ON hz_info.YLJGDM = bdmzjzjlb.YLJGDM AND hz_info.KH = bdmzjzjlb.KH AND hz_info.... | css |
CREATE TABLE state (
state_code text,
state_name text,
country_name text
)
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... | give me the earliest flight on AA tomorrow from ST. PETERSBURG to MILWAUKEE | 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 (((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'MILWAUKEE' AND date_day.day_number = 20 AND date_day.month_number = 1 A... | atis |
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_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE diagn... | tell me the cost for a circumcision? | SELECT DISTINCT cost.cost FROM cost WHERE cost.event_type = 'procedures_icd' AND cost.event_id IN (SELECT procedures_icd.row_id FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'circumcision')) | mimic_iii |
CREATE TABLE table_name_31 (
ht VARCHAR,
venue VARCHAR
) | What was the HT for the game at Stadio Luigi Ferraris? | SELECT ht FROM table_name_31 WHERE venue = "stadio luigi ferraris" | sql_create_context |
CREATE TABLE table_23281862_6 (
score VARCHAR,
high_rebounds VARCHAR
) | What's the end score of the game where Shane Battier (8) did the high rebounds? | SELECT score FROM table_23281862_6 WHERE high_rebounds = "Shane Battier (8)" | sql_create_context |
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number... | has patient 12797 received a procedure until 2102. | SELECT COUNT(*) > 0 FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 12797) AND STRFTIME('%y', procedures_icd.charttime) <= '2102' | mimic_iii |
CREATE TABLE jyjgzbb (
BGDH text,
BGRQ time,
CKZFWDX text,
CKZFWSX number,
CKZFWXX number,
JCFF text,
JCRGH text,
JCRXM text,
JCXMMC text,
JCZBDM text,
JCZBJGDL number,
JCZBJGDW text,
JCZBJGDX text,
JCZBMC text,
JLDW text,
JYRQ time,
JYZBLSH text,
... | 就诊的病患33852265号其检验报告单上对应的检查结果指标均不正常的单号是多少? | SELECT jybgb.BGDH FROM hz_info JOIN mzjzjlb JOIN jybgb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE hz_info.RYBH = '33852265' AND NOT jybgb.BGDH IN (SELECT jyjgzbb.BGDH FROM jyjgzbb WH... | css |
CREATE TABLE table_name_47 (
year INTEGER,
saar VARCHAR,
hessen VARCHAR
) | What is the average year for a Saar of FK Pirmasens and Hessen of Wormatia Worms? | SELECT AVG(year) FROM table_name_47 WHERE saar = "fk pirmasens" AND hessen = "wormatia worms" | sql_create_context |
CREATE TABLE student_record (
student_id int,
course_id int,
semester int,
grade varchar,
how varchar,
transfer_source varchar,
earn_credit varchar,
repeat_term varchar,
test_id varchar
)
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
ins... | What courses are offered this Fall ? | SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'EECS' AND semester.semester = 'Fall' AND semester.semester_id = course_offering.semester AND semester.year = 2016 | advising |
CREATE TABLE table_74601 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What was the away team's score when Fitzroy's score was 16.27 (123) on May 13, 1950. | SELECT "Away team score" FROM table_74601 WHERE "Home team score" = '16.27 (123)' | wikisql |
CREATE TABLE table_25458 (
"#" real,
"Date" text,
"Visitor" text,
"Score" text,
"Arena Attendance" text,
"High Points" text,
"High Rebounds" text,
"High Assists" text,
"Record" text
) | Name the high rebounds for td garden 18,624 | SELECT "High Rebounds" FROM table_25458 WHERE "Arena Attendance" = 'TD Garden 18,624' | wikisql |
CREATE TABLE table_name_49 (
minimum_height VARCHAR,
name_of_the_tunnel VARCHAR
) | What is the minimum Height of the Little Switzerland Tunnel? | SELECT minimum_height FROM table_name_49 WHERE name_of_the_tunnel = "little switzerland tunnel" | sql_create_context |
CREATE TABLE medicine_enzyme_interaction (
enzyme_id int,
medicine_id int,
interaction_type text
)
CREATE TABLE medicine (
id int,
name text,
Trade_Name text,
FDA_approved text
)
CREATE TABLE enzyme (
id int,
name text,
Location text,
Product text,
Chromosome text,
... | Return a pie chart on what are the ids and trade names of the medicine that can interact with at least 3 enzymes? | SELECT Trade_Name, id FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id = T1.id | nvbench |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.