context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_80440 (
"D 48 +" text,
"D 47 +" text,
"D 46 +" text,
"D 45 O" text,
"D 44 O" text,
"D 43 \u221a" text,
"D 42 \u221a" text,
"D 41 \u221a" text
) | What is the value of D 43 when the value of D 42 is d 42 ? | SELECT "D 43 \u221a" FROM table_80440 WHERE "D 42 \u221a" = 'd 42 √' | wikisql |
CREATE TABLE table_name_15 (
time VARCHAR,
city VARCHAR
) | What is the time for Sheffield? | SELECT time FROM table_name_15 WHERE city = "sheffield" | sql_create_context |
CREATE TABLE table_name_92 (
original_album VARCHAR,
performer VARCHAR
) | On the title feature brad mehldau as the performer, what is the original album? | SELECT original_album FROM table_name_92 WHERE performer = "brad mehldau" | sql_create_context |
CREATE TABLE table_name_69 (
pick__number INTEGER,
cfl_team VARCHAR
) | Can you tell me the sum of the Pick # that has the CFL Team of edmonton? | SELECT SUM(pick__number) FROM table_name_69 WHERE cfl_team = "edmonton" | sql_create_context |
CREATE TABLE course_offering (
offering_id int,
course_id int,
semester int,
section_number int,
start_time time,
end_time time,
monday varchar,
tuesday varchar,
wednesday varchar,
thursday varchar,
friday varchar,
saturday varchar,
sunday varchar,
has_final_proje... | IS ASTRO 255 offered in any section between the hours of 9:00 and 1:00 ? | SELECT DISTINCT course_offering.end_time, course_offering.section_number, course_offering.start_time FROM course, course_offering, semester WHERE course_offering.end_time <= '1:00' AND course_offering.start_time >= '9:00' AND course.course_id = course_offering.course_id AND course.department = 'ASTRO' AND course.number... | advising |
CREATE TABLE table_name_79 (
circuit VARCHAR,
winning_car VARCHAR,
round VARCHAR
) | What circuit had an ensign n180 as the winning car in round 5? | SELECT circuit FROM table_name_79 WHERE winning_car = "ensign n180" AND round = 5 | sql_create_context |
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description varchar
)
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varc... | now show me all the flights from ST. LOUIS to BURBANK | 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 = 'ST. LOUIS' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BURB... | atis |
CREATE TABLE month (
month_number int,
month_name text
)
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)
CREATE TABLE aircraft (
aircraft_code varchar,
aircraft_description varchar,
manufacturer... | i need a return flight from CHICAGO to KANSAS CITY leaving CHICAGO around 7 in the evening on the day following next wednesday | 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 (((flight.departure_time BETWEEN 1930 AND 1830) AND date_day.day_number = 23 AND date_day.month_number = 4 AND date_day.year = 1991 AND days.day_... | atis |
CREATE TABLE club (
Club_ID int,
name text,
Region text,
Start_year text
)
CREATE TABLE competition_result (
Competition_ID int,
Club_ID_1 int,
Club_ID_2 int,
Score text
)
CREATE TABLE competition (
Competition_ID int,
Year real,
Competition_type text,
Country text
)
C... | Show the number of different competition types with a bar graph, sort the number of competition type from high to low order. | SELECT Competition_type, COUNT(Competition_type) FROM competition GROUP BY Competition_type ORDER BY COUNT(Competition_type) DESC | nvbench |
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,
... | 报告人的检验报告单45876237401的工号是什么?姓名是什么? | SELECT zyjybgb.BGRGH, zyjybgb.BGRXM FROM zyjybgb WHERE zyjybgb.BGDH = '45876237401' UNION SELECT mzjybgb.BGRGH, mzjybgb.BGRXM FROM mzjybgb WHERE mzjybgb.BGDH = '45876237401' | css |
CREATE TABLE table_name_7 (
year_10_6th_quad VARCHAR,
open_2nd_viii VARCHAR,
year_11_2nd_viii VARCHAR
) | What is the Year 10 6th Quads for the Open 2nd VIII of ACGS and a Year 11 2nd VIII NC? | SELECT year_10_6th_quad FROM table_name_7 WHERE open_2nd_viii = "acgs" AND year_11_2nd_viii = "nc" | sql_create_context |
CREATE TABLE Student (
FacID VARCHAR,
advisor VARCHAR
)
CREATE TABLE Faculty_participates_in (
FacID VARCHAR,
advisor VARCHAR
) | Show the ids of all the faculty members who participate in an activity and advise a student. | SELECT FacID FROM Faculty_participates_in INTERSECT SELECT advisor FROM Student | sql_create_context |
CREATE TABLE table_15782 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Game site" text,
"Record" text,
"Attendance" text
) | Where was the game held when the attendance was 56,770? | SELECT "Game site" FROM table_15782 WHERE "Attendance" = '56,770' | wikisql |
CREATE TABLE table_73431 (
"Number" real,
"Name" text,
"Height (m)" real,
"Date of Birth" text,
"Position" text,
"Nationality" text
) | Name the height for date of birth being 17/08/75 | SELECT MIN("Height (m)") FROM table_73431 WHERE "Date of Birth" = '17/08/75' | wikisql |
CREATE TABLE table_1966992_1 (
administrative_capital VARCHAR,
lga_name VARCHAR
) | What is the administrative capital of LGA name Akuku-Toru? | SELECT administrative_capital FROM table_1966992_1 WHERE lga_name = "Akuku-Toru" | sql_create_context |
CREATE TABLE table_name_38 (
country VARCHAR,
to_par VARCHAR,
total VARCHAR
) | Which Country has a To par smaller than 7, and a Total of 148? | SELECT country FROM table_name_38 WHERE to_par < 7 AND total = 148 | sql_create_context |
CREATE TABLE table_4965 (
"Round" text,
"Player" text,
"Position" text,
"Nationality" text,
"College/Junior/Club Team (League)" text
) | Which player is from the United States, and played for the Bowling Green Falcons (CCHA) as their College/Junior/Club Team (League)? | SELECT "Player" FROM table_4965 WHERE "Nationality" = 'united states' AND "College/Junior/Club Team (League)" = 'bowling green falcons (ccha)' | wikisql |
CREATE TABLE table_76900 (
"Player" text,
"Country" text,
"Year(s) won" text,
"Total" real,
"To par" text,
"Finish" text
) | Which player finished at +10? | SELECT "Player" FROM table_76900 WHERE "To par" = '+10' | wikisql |
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text varchar
)
CREATE TABLE student (
student_id int,
lastname varchar,
firstname varchar,
program_id int,
declare_major varchar,
total_credit int,
total_gpa float,
entered_as varchar... | Who will be teaching PUBPOL 312 this Fall ? | SELECT DISTINCT instructor.name FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN offering_instructor ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN instructor ON offering_instructor.instructor_id = instructor.instructor_id INNER JOIN semester... | advising |
CREATE TABLE table_10113 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Game site" text,
"Attendance" text
) | Which opponent has a Result of l 6 3? | SELECT "Opponent" FROM table_10113 WHERE "Result" = 'l 6–3' | wikisql |
CREATE TABLE table_15353123_1 (
college VARCHAR,
player VARCHAR
) | Which college did Dean Kirkland go to | SELECT college FROM table_15353123_1 WHERE player = "Dean Kirkland" | sql_create_context |
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
value... | what are the costs of a magnesium lab test? | SELECT DISTINCT cost.cost FROM cost WHERE cost.event_type = 'labevents' AND cost.event_id IN (SELECT labevents.row_id FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'magnesium')) | mimic_iii |
CREATE TABLE table_33197 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | Which away team has a venue of Arden Street Oval? | SELECT "Away team" FROM table_33197 WHERE "Venue" = 'arden street oval' | wikisql |
CREATE TABLE table_14438 (
"Date" text,
"Tournament" text,
"Surface" text,
"Partner" text,
"Opponent in Final" text,
"Score in Final" text
) | In which Tournament was Mansour Bahrami Eric Winogradsky | SELECT "Tournament" FROM table_14438 WHERE "Opponent in Final" = 'mansour bahrami eric winogradsky' | wikisql |
CREATE TABLE table_10076 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" real
) | What is the highest to par of player mark brooks, who has a t2 place? | SELECT MAX("To par") FROM table_10076 WHERE "Place" = 't2' AND "Player" = 'mark brooks' | wikisql |
CREATE TABLE table_name_82 (
crowd INTEGER,
venue VARCHAR
) | What was the attendance when the VFL played Glenferrie Oval? | SELECT SUM(crowd) FROM table_name_82 WHERE venue = "glenferrie oval" | sql_create_context |
CREATE TABLE manufacturers (
founder VARCHAR,
name VARCHAR
) | Find the founder of the company whose name begins with the letter 'S'. | SELECT founder FROM manufacturers WHERE name LIKE 'S%' | sql_create_context |
CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationDate time,
ApprovalDate time,
RejectionDate time,
OwnerUserId number,
Comment text,
Text text,
Title text,
Tags text,
RevisionGUID other
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId nu... | Get average answer score by user. | SELECT AVG(CAST(Score AS FLOAT)) AS VOTE FROM Posts WHERE Posts.OwnerUserId = @UserId AND Posts.PostTypeId = 2 | sede |
CREATE TABLE table_10015132_21 (
nationality VARCHAR,
school_club_team VARCHAR
) | Which country is the player that went to Georgetown from? | SELECT nationality FROM table_10015132_21 WHERE school_club_team = "Georgetown" | sql_create_context |
CREATE TABLE table_8399 (
"Brigade" text,
"Staffing" text,
"Type" text,
"Location" text,
"Pumpers" real,
"Tankers" real,
"Telebooms" text,
"Platforms" text,
"Cars" text,
"Hazmat" text
) | Which Platforms have a Hazmat of , and a Type of urban & rural, and a Brigade of lara? | SELECT "Platforms" FROM table_8399 WHERE "Hazmat" = '–' AND "Type" = 'urban & rural' AND "Brigade" = 'lara' | wikisql |
CREATE TABLE t_kc21 (
CLINIC_ID text,
CLINIC_TYPE text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
... | 查一查2010年4月17号到2017年8月10日的这段时间,手术记录排倒数的6个科室编码和名称 | SELECT t_kc22.MED_ORG_DEPT_CD, t_kc22.MED_ORG_DEPT_NM FROM t_kc22 WHERE t_kc22.STA_DATE BETWEEN '2010-04-17' AND '2017-08-10' AND t_kc22.MED_INV_ITEM_TYPE = '手术费' GROUP BY t_kc22.MED_ORG_DEPT_CD ORDER BY COUNT(*) LIMIT 6 | css |
CREATE TABLE table_11964154_2 (
high_assists VARCHAR,
game VARCHAR
) | Who had the highest assists in game 4? | SELECT high_assists FROM table_11964154_2 WHERE game = 4 | sql_create_context |
CREATE TABLE table_63425 (
"State" text,
"Adopted" text,
"Population (2011-01-01)" text,
"Nominal GDP World Bank, 2009 (million USD)" real,
"Relative GDP of total (nominal)" text,
"GDP per capita World Bank, 2009 nominal (USD)" real
) | What is listed for the Adopted that has a Nominal GDP World Bank, 2009 (million USD) of 48477? | SELECT "Adopted" FROM table_63425 WHERE "Nominal GDP World Bank, 2009 (million USD)" = '48477' | wikisql |
CREATE TABLE table_47820 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" real
) | What is the date of the game on week 9 with attendance greater than 41,863? | SELECT "Date" FROM table_47820 WHERE "Attendance" > '41,863' AND "Week" = '9' | wikisql |
CREATE TABLE train (
id int,
train_number int,
name text,
origin text,
destination text,
time text,
interval text
)
CREATE TABLE weekly_weather (
station_id int,
day_of_week text,
high_temperature int,
low_temperature int,
precipitation real,
wind_speed_mph int
)
CR... | Give me a bar chart that the x-axis is the services and the Y is the count(services), list by the names from high to low please. | SELECT services, COUNT(services) FROM station GROUP BY services ORDER BY services DESC | nvbench |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id t... | How many male patients use the drug metronidazole? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.gender = "M" AND prescriptions.drug = "Metronidazole" | mimicsql_data |
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... | calculate patient 022-158475's length of stay during his last hospital stay. | SELECT STRFTIME('%j', patient.hospitaldischargetime) - STRFTIME('%j', patient.hospitaladmittime) FROM patient WHERE patient.uniquepid = '022-158475' AND NOT patient.hospitaladmittime IS NULL ORDER BY patient.hospitaladmittime DESC LIMIT 1 | eicu |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | what is drug type and drug route of drug code digo125? | SELECT prescriptions.drug_type, prescriptions.route FROM prescriptions WHERE prescriptions.formulary_drug_cd = "DIGO125" | mimicsql_data |
CREATE TABLE table_name_88 (
runner_up VARCHAR,
winner VARCHAR,
season VARCHAR
) | What was the Runner-up during the 2005-06 Season with Kiveton Park as the Winner? | SELECT runner_up FROM table_name_88 WHERE winner = "kiveton park" AND season = "2005-06" | sql_create_context |
CREATE TABLE table_80424 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" text,
"Record" text
) | What was the date for the game that had an attendance of 10,101? | SELECT "Date" FROM table_80424 WHERE "Attendance" = '10,101' | wikisql |
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE student (
student_id int,
lastname varchar,
firstname varchar,
program_id int,
declare_major varchar,
total_credit int,
total... | Next year , do you know which courses Prof. Bufford Ang will be teaching ? | SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, instructor, offering_instructor, semester WHERE course.course_id = course_offering.course_id AND instructor.name LIKE '%Bufford Ang%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.offer... | advising |
CREATE TABLE table_27533947_1 (
total_points INTEGER,
players VARCHAR
) | If the player is William Jakes, what are the total points? | SELECT MIN(total_points) FROM table_27533947_1 WHERE players = "William Jakes" | sql_create_context |
CREATE TABLE table_26348 (
"equation:" text,
"k_{\\mathrm{H,pc}} = \\frac{p}{c_\\mathrm{aq}}" text,
"k_{\\mathrm{H,cp}} = \\frac{c_\\mathrm{aq}}{p}" text,
"k_{\\mathrm{H,px}} = \\frac{p}{x}" text,
"k_{\\mathrm{H,cc}} = \\frac{c_{\\mathrm{aq}}}{c_{\\mathrm{gas}}}" text
) | What was the equation if k_{\mathrm{h,px}} = \frac{p}{x} is 12.30 10? | SELECT "equation:" FROM table_26348 WHERE "k_{\\mathrm{H,px}} = \\frac{p}{x}" = '12.30 × 10' | wikisql |
CREATE TABLE table_62231 (
"Round" real,
"Player" text,
"Position" text,
"Nationality" text,
"College/Junior/Club Team (League)" text
) | what is the position when the round is higher than 3, the nationality is united states and the player is nick pryor? | SELECT "Position" FROM table_62231 WHERE "Round" > '3' AND "Nationality" = 'united states' AND "Player" = 'nick pryor' | wikisql |
CREATE TABLE table_204_761 (
id number,
"rank" number,
"nation" text,
"gold" number,
"silver" number,
"bronze" number,
"total" number
) | what is the number of gold medals won by japan ? | SELECT "gold" FROM table_204_761 WHERE "nation" = 'japan' | squall |
CREATE TABLE table_75575 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Event" text,
"Round" real,
"Time" text,
"Location" text
) | What is the method of the match with 1 round and a time of 1:58? | SELECT "Method" FROM table_75575 WHERE "Round" = '1' AND "Time" = '1:58' | wikisql |
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,... | count the current patients whose age is 30s. | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.dischtime IS NULL AND admissions.age BETWEEN 30 AND 39 | mimic_iii |
CREATE TABLE table_64707 (
"Group" text,
"Name" text,
"Nationality" text,
"4.00" text,
"Result" text
) | Marion Buisson with a 4.00 of o had what result? | SELECT "Result" FROM table_64707 WHERE "4.00" = 'o' AND "Name" = 'marion buisson' | wikisql |
CREATE TABLE table_16650 (
"#" real,
"Episode" text,
"Air Date" text,
"Rating" text,
"Share" real,
"Rating/Share 18\u201349" text,
"Viewers (m)" text,
"Timeslot Rank" real,
"Night Rank" text,
"Overall Rank" real
) | what's the night rank with rating of 6.2 | SELECT "Night Rank" FROM table_16650 WHERE "Rating" = '6.2' | wikisql |
CREATE TABLE table_50611 (
"Athlete" text,
"Time" text,
"Country" text,
"Year" real,
"Place" real
) | Which Year is the lowest one that has an Athlete of markus thalmann, and a Time of 23:28:24? | SELECT MIN("Year") FROM table_50611 WHERE "Athlete" = 'markus thalmann' AND "Time" = '23:28:24' | wikisql |
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... | 在03年8月11日到14年7月7日内59190525患者在医疗机构2322054开了多少西药? | SELECT COUNT(*) FROM qtb JOIN t_kc22 ON qtb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE qtb.PERSON_ID = '59190525' AND t_kc22.STA_DATE BETWEEN '2003-08-11' AND '2014-07-07' AND qtb.MED_SER_ORG_NO = '2322054' 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 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... | how many living patients have procedure icd9 code 540? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.expire_flag = "0" AND procedures.icd9_code = "540" | mimicsql_data |
CREATE TABLE table_79084 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Date" text
) | What date did home team liverpool play? | SELECT "Date" FROM table_79084 WHERE "Home team" = 'liverpool' | wikisql |
CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
CreationDate time,
OwnerUserId number,
AutoRenameCount number,
LastAutoRename time,
Score number,
ApprovedByUserId number,
ApprovalDate time
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
... | how many posts are there in total?. | SELECT COUNT(*) FROM Posts | sede |
CREATE TABLE table_203_646 (
id number,
"year" number,
"competition" text,
"venue" text,
"position" text,
"notes" text
) | before 2004 , how many times has yelena koshcheyeva finished in the top 5 ? | SELECT COUNT(*) FROM table_203_646 WHERE "year" < 2004 AND "position" <= 5 | squall |
CREATE TABLE table_17964087_2 (
foreign_nationality VARCHAR,
romanised_name VARCHAR
) | For the name romanised name is lo yik-kee, victor what is the total number foreign nationality that is listed? | SELECT COUNT(foreign_nationality) FROM table_17964087_2 WHERE romanised_name = "Lo Yik-kee, Victor" | sql_create_context |
CREATE TABLE table_name_91 (
home_team VARCHAR,
attendance VARCHAR
) | Which Home team had attendance 160? | SELECT home_team FROM table_name_91 WHERE attendance = "160" | sql_create_context |
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE course_offering (
offering_id int,
course_id int,
semes... | Of ASTRO 389 , how many sections are there ? | SELECT COUNT(*) FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'ASTRO' AND course.number = 389 AND semester.semester = 'WN' AND semester.semester_id = course_offering.semester AND semester.year = 2016 | advising |
CREATE TABLE wine (
No INTEGER,
Grape TEXT,
Winery TEXT,
Appelation TEXT,
State TEXT,
Name TEXT,
Year INTEGER,
Price INTEGER,
Score INTEGER,
Cases INTEGER,
Drink TEXT
)
CREATE TABLE grapes (
ID INTEGER,
Grape TEXT,
Color TEXT
)
CREATE TABLE appellations (
No... | A bar chart about how many wines are there for each grape?, sort in ascending by the Grape. | SELECT Grape, COUNT(*) FROM wine GROUP BY Grape ORDER BY Grape | nvbench |
CREATE TABLE zyjzjlb (
YLJGDM text,
JZLSH text,
MZJZLSH text,
KH text,
KLX number,
HZXM text,
WDBZ number,
RYDJSJ time,
RYTJDM number,
RYTJMC text,
JZKSDM text,
JZKSMC text,
RZBQDM text,
RZBQMC text,
RYCWH text,
CYKSDM text,
CYKSMC text,
CYBQDM tex... | 在77422400113的这次医疗就诊中,为奚雅娴这个患者检验的科室和编码是什么 | SELECT JYKSBM, JYKSMC FROM jybgb WHERE JZLSH = '77422400113' | css |
CREATE TABLE table_2653 (
"Outcome" text,
"Year" real,
"Championship" text,
"Surface" text,
"Partner" text,
"Opponents in the final" text,
"Score in the final" text
) | If the opponents in the final is Hewitt McMillan and the partner is Fleming, what is the surface? | SELECT "Surface" FROM table_2653 WHERE "Partner" = 'Fleming' AND "Opponents in the final" = 'Hewitt McMillan' | wikisql |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,... | what is primary disease and drug type of subject id 2560? | SELECT demographic.diagnosis, prescriptions.drug_type FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.subject_id = "2560" | mimicsql_data |
CREATE TABLE player (
Player_ID int,
Player text,
Years_Played text,
Total_WL text,
Singles_WL text,
Doubles_WL text,
Team int
)
CREATE TABLE match_season (
Season real,
Player text,
Position text,
Country int,
Team int,
Draft_Pick_Number int,
Draft_Class text,
... | Give me a pie to show the total number from different position. | SELECT Position, COUNT(*) FROM match_season GROUP BY Position | nvbench |
CREATE TABLE table_242785_3 (
notes VARCHAR,
date_founded__founder VARCHAR
) | What are the notes during 57 bc caesar? | SELECT notes FROM table_242785_3 WHERE date_founded__founder = "57 BC Caesar" | sql_create_context |
CREATE TABLE table_49100 (
"Year" text,
"League Position" text,
"League" text,
"Domestic Cup" text,
"Cup Position" text
) | What year did the malaysia premier league get a position of 8/12? | SELECT "Year" FROM table_49100 WHERE "League" = 'malaysia premier league' AND "League Position" = '8/12' | 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,
... | How many newborn patients were admitted before the year 2154? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "NEWBORN" AND demographic.admityear < "2154" | mimicsql_data |
CREATE TABLE table_13758 (
"Debut year" real,
"Player" text,
"Games" real,
"Goals" real,
"Years at club" text
) | For player Wally Johnson, with goals larger than 0, the debut year later than 1904, and games greater than 136, what were the years at club? | SELECT "Years at club" FROM table_13758 WHERE "Goals" > '0' AND "Debut year" > '1904' AND "Games" > '136' AND "Player" = 'wally johnson' | wikisql |
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE procedures_icd (
row_id number,
subject_id nu... | how many times does patient 49654 in this year visit the icu? | SELECT COUNT(DISTINCT icustays.icustay_id) FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 49654) AND DATETIME(icustays.intime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') | mimic_iii |
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE cost (
row_id... | what was the diagnosis of patient 27591 for the last time? | SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT diagnoses_icd.icd9_code FROM diagnoses_icd WHERE diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 27591) ORDER BY diagnoses_icd.charttime DESC LIMIT 1) | mimic_iii |
CREATE TABLE table_80060 (
"Year" text,
"English title" text,
"Original title" text,
"Country" text,
"Director" text
) | What's the Original Title of the English title A Judgement in Stone? | SELECT "Original title" FROM table_80060 WHERE "English title" = 'a judgement in stone' | wikisql |
CREATE TABLE table_204_952 (
id number,
"rank" number,
"player" text,
"county" text,
"tally" text,
"total" number,
"opposition" text
) | what is the first name on the list ? | SELECT "player" FROM table_204_952 WHERE id = 1 | squall |
CREATE TABLE table_21451 (
"Team #1" text,
"Points" text,
"Team #2" text,
"1st leg" text,
"2nd leg" text
) | What was the game's points against Team 2 Deportivo Anzo tegui? | SELECT "Points" FROM table_21451 WHERE "Team #2" = 'Deportivo Anzoátegui' | wikisql |
CREATE TABLE record (
ID int,
Result text,
Swimmer_ID int,
Event_ID int
)
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 a bar chart showing total number of meter 100 across meter 200 | SELECT meter_200, SUM(meter_100) FROM swimmer GROUP BY meter_200 | nvbench |
CREATE TABLE table_53957 (
"Rank" real,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | What is the low silver medal total for nations with over 1 bronze ranked above 11? | SELECT MIN("Silver") FROM table_53957 WHERE "Bronze" > '1' AND "Rank" < '11' | 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... | 门诊就诊51309268056的治病结束时间是啥时候? | SELECT mzjzjlb.JZJSSJ FROM mzjzjlb WHERE mzjzjlb.JZLSH = '51309268056' | css |
CREATE TABLE Staff (
Id VARCHAR
) | How many staff in total? | SELECT COUNT(*) FROM Staff | sql_create_context |
CREATE TABLE table_name_91 (
venue VARCHAR,
score VARCHAR,
competition VARCHAR
) | Which venue has a Score of 1 0, and a Competition of 2002 world cup qualifier? | SELECT venue FROM table_name_91 WHERE score = "1–0" AND competition = "2002 world cup qualifier" | sql_create_context |
CREATE TABLE table_25380472_2 (
opponent VARCHAR,
week VARCHAR
) | On week 7, what were the opponents? | SELECT opponent FROM table_25380472_2 WHERE week = 7 | sql_create_context |
CREATE TABLE table_name_80 (
touchdowns VARCHAR,
average INTEGER
) | What is the number of touchdowns with the average is less than 2.6? | SELECT COUNT(touchdowns) FROM table_name_80 WHERE average < 2.6 | sql_create_context |
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress text
)
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
... | Where does Col Sharpnel place in downvoting percentage. Where does Col Sharpnel place in downvoting percentage | SELECT SUM(CASE WHEN DownVotes = 0 THEN 1 WHEN 1.0 * UpVotes / NULLIF(DownVotes, 0) >= y THEN 1 END), SUM(CASE WHEN 1.0 * UpVotes / NULLIF(DownVotes, 0) < y THEN 1 END) FROM Users CROSS JOIN (SELECT y = 1.0 * UpVotes / DownVotes FROM Users WHERE Id = 285587) AS x WHERE Users.UpVotes > 0 AND Users.Reputation > 1000 | sede |
CREATE TABLE t_kc24 (
ACCOUNT_DASH_DATE time,
ACCOUNT_DASH_FLG number,
CASH_PAY number,
CIVIL_SUBSIDY number,
CKC102 number,
CLINIC_ID text,
CLINIC_SLT_DATE time,
COMP_ID text,
COM_ACC_PAY number,
COM_PAY number,
DATA_ID text,
ENT_ACC_PAY number,
ENT_PAY number,
F... | 自2000年3月8日起,到2019年1月15日,医院2640814涉及医疗费总额不多于3787.33元的科室有多少 | SELECT COUNT(*) FROM (SELECT gwyjzb.MED_ORG_DEPT_CD FROM gwyjzb JOIN t_kc24 ON gwyjzb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE gwyjzb.MED_SER_ORG_NO = '2640814' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2000-03-08' AND '2019-01-15' GROUP BY gwyjzb.MED_ORG_DEPT_CD HAVING SUM(t_kc24.MED_AMOUT) <= 3787.33 UNION SELECT fgwyjzb... | css |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE vitalperiodic (
vitalpe... | how many patients received bicarbonate - sodium bicarbonate within 2 months in 2104 after they were diagnosed with s/p gastrostomy? | SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 's/p gastrostomy' AND STRFTIME('%y', diagnosis.diagnosistime) = '2104') AS t1 JOIN (SELECT patient.uniquepid,... | eicu |
CREATE TABLE diagnoses (
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
)
C... | count the number of patients taking lorazepam medication who were hospitalized for more than 29 days. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.days_stay > "29" AND prescriptions.drug = "Lorazepam" | mimicsql_data |
CREATE TABLE table_1067441_1 (
province VARCHAR,
density VARCHAR
) | Which province has a density of 971.4? | SELECT province FROM table_1067441_1 WHERE density = "971.4" | sql_create_context |
CREATE TABLE table_name_99 (
week VARCHAR,
record VARCHAR
) | What is the total number of weeks that the Steelers had a record of 1 0? | SELECT COUNT(week) FROM table_name_99 WHERE record = "1–0" | sql_create_context |
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGui... | Number of questions in a review queue per day. | SELECT TOP(100) AS CreationDate, COUNT(PostId) FROM ReviewTasks WHERE (ReviewTaskTypeId = '##type?2##') AND (CreationDate >= '##Date1?2020-01-01##') AND (CreationDate <= '##Date2?2020-03-01##') GROUP BY CreationDate ORDER BY CreationDate | sede |
CREATE TABLE table_name_80 (
label VARCHAR,
date_of_release VARCHAR
) | WHAT LABEL HAD A RELEASE DATE OF 1991? | SELECT label FROM table_name_80 WHERE date_of_release = 1991 | sql_create_context |
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... | how many patients whose primary disease is pituitary bleed and year of birth is less than 2056? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "PITUITARY BLEED" AND demographic.dob_year < "2056" | mimicsql_data |
CREATE TABLE table_name_37 (
prize VARCHAR,
runner_up VARCHAR,
winner VARCHAR
) | What is Prize, when Runner-Up is 'Simon Ehne', and when Winner is 'David Tighe'? | SELECT prize FROM table_name_37 WHERE runner_up = "simon ehne" AND winner = "david tighe" | sql_create_context |
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationDate time,
ApprovalDate time,
RejectionDate time,
O... | Questions being their own 'duplicates'. | SELECT PostLinks.PostId AS "post_link" FROM PostLinks, Posts AS D, Posts AS O WHERE PostLinks.PostId = D.Id AND PostLinks.RelatedPostId = O.Id AND PostLinks.LinkTypeId = 3 AND PostLinks.PostId = PostLinks.RelatedPostId ORDER BY PostId | sede |
CREATE TABLE table_name_50 (
year INTEGER,
position VARCHAR
) | What is the average year with 7th (heats) position? | SELECT AVG(year) FROM table_name_50 WHERE position = "7th (heats)" | sql_create_context |
CREATE TABLE table_12370 (
"Tournament" text,
"2008" text,
"2009" text,
"2010" text,
"2011" text,
"2012" text
) | What is the 2011 value with nms in 2008? | SELECT "2011" FROM table_12370 WHERE "2008" = 'nms' | wikisql |
CREATE TABLE table_25737 (
"Season" text,
"Oberbayern A" text,
"Oberbayern B" text,
"Niederbayern" text,
"Schwaben" text,
"Oberpfalz" text
) | When spvgg vohenstrau is the oberpfalz what is the season? | SELECT "Season" FROM table_25737 WHERE "Oberpfalz" = 'SpVgg Vohenstrauß' | 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... | how many patients posses private insurance and died in or before the year 2131? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.insurance = "Private" AND demographic.dod_year <= "2131.0" | mimicsql_data |
CREATE TABLE table_48566 (
"Driver" text,
"Entrant" text,
"Constructor" text,
"Time/Retired" text,
"Grid" text,
"Heat 1/2" text
) | Who was the driver for Rovero Campello? | SELECT "Driver" FROM table_48566 WHERE "Entrant" = 'rovero campello' | wikisql |
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE student (
student_id int,
lastname varchar,
firstname varchar,
program_id int,
declare_major varchar,
total_credit int,
total... | Is DANCE 131 harder than DANCE 695 ? | SELECT COUNT(*) > 0 FROM course AS COURSE_0, course AS COURSE_1, program_course AS PROGRAM_COURSE_0, program_course AS PROGRAM_COURSE_1 WHERE COURSE_0.department = 'DANCE' AND COURSE_0.number = 131 AND COURSE_1.department = 'DANCE' AND COURSE_1.number = 695 AND PROGRAM_COURSE_0.course_id = COURSE_0.course_id AND PROGRA... | advising |
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 text,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZDZZMC ... | 这个患者15591984往昔有什么住院诊断结果如何呢? | SELECT wdmzjzjlb.ZYZDBM, wdmzjzjlb.ZYZDMC 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 = '15591984' UNION SELECT bdmzjzjlb.ZYZDBM, bdmzjzjlb.ZYZDMC FROM hz_info JOIN bdmzjzjlb ON hz_info.YLJGDM = bdmzjzjlb.YLJGDM AND hz... | css |
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 jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE regions (
REGION_... | For all employees who have the letters D or S in their first name, return a bar chart about the distribution of job_id and the average of employee_id , and group by attribute job_id, and rank in asc by the y-axis. | SELECT JOB_ID, AVG(EMPLOYEE_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID ORDER BY AVG(EMPLOYEE_ID) | nvbench |
CREATE TABLE table_train_180 (
"id" int,
"gender" string,
"pregnancy_or_lactation" bool,
"systolic_blood_pressure_sbp" int,
"hemoglobin_a1c_hba1c" float,
"diabetic" string,
"post_load_glucose" int,
"diastolic_blood_pressure_dbp" int,
"impaired_glucose_tolerance" bool,
"fasting_gl... | blood pressure > 140 / 80 mmhg | SELECT * FROM table_train_180 WHERE systolic_blood_pressure_sbp > 140 OR diastolic_blood_pressure_dbp >= 80 | criteria2sql |
CREATE TABLE table_58118 (
"Cyclist" text,
"Nation" text,
"Team" text,
"Time" text,
"UCI ProTour Points" real
) | What nation is the cyclist from team discovery channel? | SELECT "Nation" FROM table_58118 WHERE "Team" = 'discovery channel' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.