context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
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,
... | what are the genders of patient 002-56853? | SELECT DISTINCT patient.gender FROM patient WHERE patient.uniquepid = '002-56853' | eicu |
CREATE TABLE table_name_54 (
gross_capacity VARCHAR,
reactor_type VARCHAR
) | What is the gross capacity where the reactor is ABWR type? | SELECT gross_capacity FROM table_name_54 WHERE reactor_type = "abwr" | sql_create_context |
CREATE TABLE table_18162883_1 (
original_title VARCHAR,
film_title_used_in_nomination VARCHAR
) | What was the original title of Run for Money? | SELECT original_title FROM table_18162883_1 WHERE film_title_used_in_nomination = "Run for Money" | sql_create_context |
CREATE TABLE table_68109 (
"Year" text,
"Team" text,
"TTkl" real,
"Solo" real,
"Sacks" real,
"Pass Def" real
) | How many sacks have 72 as the solo and a TTkl less than 112? | SELECT COUNT("Sacks") FROM table_68109 WHERE "Solo" = '72' AND "TTkl" < '112' | wikisql |
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
last_wardid number,
intime time,
outtime time
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
sh... | what was the new medication of patient 83038 today compared to that of the patient yesterday? | SELECT prescriptions.drug FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 83038) AND DATETIME(prescriptions.startdate, 'start of day') = DATETIME(CURRENT_TIME(), 'start of day', '-0 day') EXCEPT SELECT prescriptions.drug FROM prescriptions WHERE... | mimic_iii |
CREATE TABLE table_55501 (
"Ship's name" text,
"Entered service" text,
"Ended service" text,
"Gross Tonnage" real,
"Type of Vessel" text
) | I want the total number of gross tonnage when entered service was 1903 | SELECT COUNT("Gross Tonnage") FROM table_55501 WHERE "Entered service" = '1903' | wikisql |
CREATE TABLE table_24933 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" text,
"U.S. viewers (million)" text
) | Name the viewers for production code being 3x6706 | SELECT "U.S. viewers (million)" FROM table_24933 WHERE "Production code" = '3X6706' | wikisql |
CREATE TABLE table_name_59 (
type VARCHAR,
ride_name VARCHAR
) | What type of ride is Rameses Revenge? | SELECT type FROM table_name_59 WHERE ride_name = "rameses revenge" | sql_create_context |
CREATE TABLE table_name_78 (
name VARCHAR,
overall VARCHAR
) | Which Name has an Overall of 235? | SELECT name FROM table_name_78 WHERE overall = 235 | sql_create_context |
CREATE TABLE table_52338 (
"Week" text,
"Performer(s)" text,
"Hot 100 Reaction" text,
"Hot Digital Songs Reaction" text,
"Notes" text
) | What is the hot 100 reaction in week of top 13 for Kanye West? | SELECT "Hot 100 Reaction" FROM table_52338 WHERE "Week" = 'top 13' AND "Performer(s)" = 'kanye west' | wikisql |
CREATE TABLE table_name_93 (
points VARCHAR,
artist VARCHAR,
draw VARCHAR
) | What's the total number of points for grace dunne with a draw over 5? | SELECT COUNT(points) FROM table_name_93 WHERE artist = "grace dunne" AND draw > 5 | sql_create_context |
CREATE TABLE table_30221 (
"Series #" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" text,
"U.S. viewers (million)" text
) | Who wrote the episode that 2.93 million viewers? | SELECT "Written by" FROM table_30221 WHERE "U.S. viewers (million)" = '2.93' | wikisql |
CREATE TABLE table_45733 (
"Name" text,
"Club" text,
"Age at debut" text,
"Debut round" real,
"Games (2008)" real,
"Goals (2008)" real
) | What is the total number of goals that have games under 11, debut round over 15, and age of 20 years, 71 days? | SELECT COUNT("Goals (2008)") FROM table_45733 WHERE "Games (2008)" < '11' AND "Debut round" > '15' AND "Age at debut" = '20 years, 71 days' | wikisql |
CREATE TABLE table_29378 (
"Season" real,
"Series" text,
"Team" text,
"Starts" real,
"Wins" real,
"Podiums" real,
"Poles" real,
"Fastest Laps" real,
"Points" text,
"Place" text
) | Name the number of poles for fastest laps being 6 | SELECT COUNT("Poles") FROM table_29378 WHERE "Fastest Laps" = '6' | wikisql |
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE microbiologyevents (
... | what's the first value of the arterial bp [diastolic] of patient 4269? | SELECT chartevents.valuenum FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 4269)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial b... | mimic_iii |
CREATE TABLE table_203_456 (
id number,
"player" text,
"-1967" text,
"3.3" text,
"3.31" text,
"4.04" text,
"10.14" text,
"1968" text,
"total" text
) | did mitsuo kamata have more than 40 total points ? | SELECT (SELECT "total" FROM table_203_456 WHERE "player" = 'mitsuo kamata') > 40 | squall |
CREATE TABLE instructor (
instructor_id int,
name varchar,
uniqname varchar
)
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text varchar
)
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE student_record (
studen... | in the CHE department , are any of the courses I 've taken among the hardest ? | SELECT DISTINCT course.department, course.name, course.number, program_course.workload FROM course INNER JOIN student_record ON student_record.course_id = course.course_id INNER JOIN program_course ON program_course.course_id = course.course_id WHERE course.department = 'CHE' AND program_course.workload = (SELECT MAX(P... | advising |
CREATE TABLE record (
ID int,
Result text,
Swimmer_ID int,
Event_ID int
)
CREATE TABLE event (
ID int,
Name text,
Stadium_ID int,
Year text
)
CREATE TABLE stadium (
ID int,
name text,
Capacity int,
City text,
Country text,
Opening_year int
)
CREATE TABLE swimme... | Show me a bar chart for how many stadiums does each country have?, could you display x axis in descending order? | SELECT Country, COUNT(*) FROM stadium GROUP BY Country ORDER BY Country DESC | nvbench |
CREATE TABLE table_79301 (
"Period" text,
"Internet Explorer" text,
"Firefox" text,
"Chrome" text,
"Safari" text,
"Opera" text,
"Other" text
) | What is the other that has 20.80% as the firefox? | SELECT "Other" FROM table_79301 WHERE "Firefox" = '20.80%' | wikisql |
CREATE TABLE t_kc21 (
MED_CLINIC_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
COMP_ID text,
PERSON_ID text,
PERSON_NM text,
IDENTITY_CARD text,
SOC_SRT_CARD text,
PERSON_SEX number,
PERSON_AGE number,
IN_HOSP_DATE time,
OUT_HOSP_DATE time,
DIFF_PLACE_FLG numb... | 医疗机构4451945从一九年七月十五号开始到二一年一月十一号所有就诊记录里有公务员就诊的记录数 | SELECT COUNT(*) FROM t_kc21 WHERE MED_SER_ORG_NO = '4451945' AND IN_HOSP_DATE BETWEEN '2019-07-05' AND '2021-01-11' AND SERVANT_FLG = '公务员' | css |
CREATE TABLE conference (
cid int,
homepage varchar,
name varchar
)
CREATE TABLE author (
aid int,
homepage varchar,
name varchar,
oid int
)
CREATE TABLE writes (
aid int,
pid int
)
CREATE TABLE cite (
cited int,
citing int
)
CREATE TABLE publication (
abstract varcha... | return me the number of papers by ' H. V. Jagadish ' on VLDB conference after 2000 . | SELECT COUNT(DISTINCT (publication.title)) FROM author, conference, publication, writes WHERE author.name = 'H. V. Jagadish' AND conference.name = 'VLDB' AND publication.cid = conference.cid AND publication.year > 2000 AND writes.aid = author.aid AND writes.pid = publication.pid | academic |
CREATE TABLE table_6345 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Event" text,
"Round" real,
"Time" text,
"Location" text
) | Which event is in round 1 with a record at 5-1? | SELECT "Event" FROM table_6345 WHERE "Round" = '1' AND "Record" = '5-1' | wikisql |
CREATE TABLE t_kc24 (
MED_SAFE_PAY_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
REF_SLT_FLG number,
CLINIC_SLT_DATE time,
COMP_ID text,
PERSON_ID text,
FLX_MED_ORG_ID text,
INSU_TYPE text,
MED_AMOUT number,
PER_ACC_PAY number,
OVE_PAY numb... | 在医院8860248患者孔子明入院诊断疾病名称不包含胃炎的是什么医疗就诊记录编号? | SELECT MED_CLINIC_ID FROM t_kc21 WHERE PERSON_NM = '孔子明' AND MED_SER_ORG_NO = '8860248' AND NOT IN_DIAG_DIS_NM LIKE '%胃炎%' | css |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | what is maximum age of patients whose days of hospital stay is 20 and year of death is less than 2131? | SELECT MAX(demographic.age) FROM demographic WHERE demographic.days_stay = "20" AND demographic.dod_year < "2131.0" | mimicsql_data |
CREATE TABLE table_26848 (
"Governorate" text,
"Kurdistan Democratic Party" real,
"Patriotic Union of Kurdistan" real,
"Total Kurdistan List" real,
"Total Governorate Seats" real
) | Name the most kirdistan list for diyala | SELECT MAX("Total Kurdistan List") FROM table_26848 WHERE "Governorate" = 'Diyala' | 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... | 投保人华嘉淑在2005年12月6日到2015年9月7日期间每一种药物最多都购买次了多少次? | SELECT COUNT(*) FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_NM = '华嘉淑' AND t_kc22.STA_DATE BETWEEN '2005-12-06' AND '2015-09-07' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY COUNT(*) DESC LIMIT 1 | css |
CREATE TABLE table_22034853_1 (
original_title VARCHAR,
film_title_used_in_nomination VARCHAR
) | How many original titles were listed as 'If the Sun Never Returns'? | SELECT COUNT(original_title) FROM table_22034853_1 WHERE film_title_used_in_nomination = "If the Sun Never Returns" | 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 diagnoses long title is other second degree atrioventricular block and drug route is oral? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.long_title = "Other second degree atrioventricular block" AND prescriptions.route = "ORAL" | mimicsql_data |
CREATE TABLE table_9615 (
"Week" real,
"Date" text,
"Opponent" text,
"Stadium" text,
"Result" text,
"Record" text,
"Streak" text,
"Attendance" real
) | What was the result in week 14? | SELECT "Result" FROM table_9615 WHERE "Week" = '14' | wikisql |
CREATE TABLE Elimination (
Elimination_Move VARCHAR,
Team VARCHAR
) | What are the elimination moves of wrestlers whose team is 'Team Orton'? | SELECT Elimination_Move FROM Elimination WHERE Team = "Team Orton" | sql_create_context |
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
HIRE_DATE date,
JOB_ID varchar(10),
SALARY decimal(8,2),
COMMISSION_PCT decimal(2,2),
MANAGER_ID decimal(6,0),
DEPARTMENT_ID decimal(... | For those employees who do not work in departments with managers that have ids between 100 and 200, a bar chart shows the distribution of hire_date and the amount of hire_date bin hire_date by weekday, and sort how many hire date in ascending order. | SELECT HIRE_DATE, COUNT(HIRE_DATE) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY COUNT(HIRE_DATE) | nvbench |
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 ... | 在06年1月1日到11年8月25日内病号56134698的所有检验结果指标记录中的仪器编号以及名称分别叫什么? | SELECT jyjgzbb.YQBH, jyjgzbb.YQMC FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN mzjzjlb_jybgb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM ... | css |
CREATE TABLE table_name_83 (
attendance INTEGER,
loss VARCHAR
) | What is the sum of the people in attendance when there was a Loss of clement (5 7)? | SELECT SUM(attendance) FROM table_name_83 WHERE loss = "clement (5–7)" | sql_create_context |
CREATE TABLE table_16323766_3 (
swimsuit VARCHAR,
semifinal_average VARCHAR
) | What was the swimsuit score for the one who had a semifinal average of 8.759 (5)? | SELECT swimsuit FROM table_16323766_3 WHERE semifinal_average = "8.759 (5)" | sql_create_context |
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
... | Popularity of Camera Brands by Time. | SELECT DATEADD(month, DATEDIFF(month, 0, CreationDate), 0) AS m, TagName, COUNT(*) FROM PostTags AS pt JOIN Posts AS q ON q.Id = pt.PostId JOIN Tags AS t ON t.Id = pt.TagId WHERE TagName IN ('pentax', 'sony', 'canon', 'nikon', 'fujifilm', 'olympus', 'panasonic', 'sigma') AND q.CreationDate < DATEADD(month, DATEDIFF(mon... | sede |
CREATE TABLE table_name_3 (
home_team VARCHAR,
away_team VARCHAR
) | What was the score of the Home team that played against Carlton's Away game? | SELECT home_team AS score FROM table_name_3 WHERE away_team = "carlton" | sql_create_context |
CREATE TABLE table_name_95 (
date VARCHAR,
away_team VARCHAR
) | What is the Date of the Everton Away game? | SELECT date FROM table_name_95 WHERE away_team = "everton" | sql_create_context |
CREATE TABLE table_41948 (
"8:00" text,
"8:30" text,
"9:00" text,
"9:30" text,
"10:00" text
) | What was on at 8:30 when dancing with the stars: the results was on at 9:30? | SELECT "8:30" FROM table_41948 WHERE "9:00" = 'dancing with the stars: the results' | wikisql |
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 whose gender is f and primary disease is 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_1601935_1 (
viewers__in_millions_ VARCHAR,
run_time VARCHAR
) | How many millions of viewers were there for the episode with a run time of 18:00? | SELECT viewers__in_millions_ FROM table_1601935_1 WHERE run_time = "18:00" | sql_create_context |
CREATE TABLE table_40775 (
"Ballarat FL" text,
"Wins" real,
"Byes" real,
"Losses" real,
"Draws" real,
"Against" real
) | What is the total number of Losses that Melton had when they had fewer Draws than 0? | SELECT SUM("Losses") FROM table_40775 WHERE "Ballarat FL" = 'melton' AND "Draws" < '0' | wikisql |
CREATE TABLE Bookings (
Booking_ID INTEGER,
Customer_ID INTEGER,
Workshop_Group_ID VARCHAR(100),
Status_Code CHAR(15),
Store_ID INTEGER,
Order_Date DATETIME,
Planned_Delivery_Date DATETIME,
Actual_Delivery_Date DATETIME,
Other_Order_Details VARCHAR(255)
)
CREATE TABLE Ref_Payment_Me... | Give me a histogram for how many drama workshop groups are there in each city? Return both the city and the count, display from low to high by the X-axis. | SELECT City_Town, COUNT(*) FROM Addresses AS T1 JOIN Drama_Workshop_Groups AS T2 ON T1.Address_ID = T2.Address_ID GROUP BY T1.City_Town ORDER BY City_Town | nvbench |
CREATE TABLE table_2330 (
"School" text,
"Location(s)" text,
"Control" text,
"Type" text,
"Enrollment (fall 2010)" real,
"Founded" real,
"Accreditation" text
) | What is the accrediation for united tribes technical college? | SELECT "Accreditation" FROM table_2330 WHERE "School" = 'United Tribes Technical College' | wikisql |
CREATE TABLE table_203_429 (
id number,
"year" number,
"competition" text,
"venue" text,
"position" text,
"notes" text
) | how many world championships has he been in ? | SELECT COUNT(*) FROM table_203_429 WHERE "competition" = 'world championships' | squall |
CREATE TABLE table_16988 (
"Institution" text,
"Location" text,
"Founded" real,
"Type" text,
"Enrollment" real,
"Joined" text,
"Nickname" text
) | what are the locations that joined in 2008 | SELECT "Location" FROM table_16988 WHERE "Joined" = '2008' | 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 diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | what is the number of patients whose insurance is medicaid and primary disease is bradycardia? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.insurance = "Medicaid" AND demographic.diagnosis = "BRADYCARDIA" | mimicsql_data |
CREATE TABLE marketing_regions (
marketing_region_code text,
marketing_region_name text,
marketing_region_descriptrion text,
other_details text
)
CREATE TABLE bookings_services (
order_id number,
product_id number
)
CREATE TABLE drama_workshop_groups (
workshop_group_id number,
address... | Count the number of customers recorded. | SELECT COUNT(*) FROM customers | spider |
CREATE TABLE Employees (
role_code VARCHAR
) | What is the role code with the largest number of employees? | SELECT role_code FROM Employees GROUP BY role_code ORDER BY COUNT(*) DESC LIMIT 1 | sql_create_context |
CREATE TABLE person_info (
RYBH text,
XBDM number,
XBMC text,
XM text,
CSRQ time,
CSD text,
MZDM text,
MZMC text,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
XLDM text,
XLMC text,
ZYLBDM text,
ZYMC text
)
CREATE TABLE jybgb (
YLJGDM text,
YLJGDM_M... | 41736838这位患者的妊娠相关性血浆蛋白-A指标在08年4月18日至10月22日期间的情况 | (SELECT * FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb 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 AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE hz_info.RYBH = ... | css |
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)
CREATE TABLE flight (
aircraft_code_sequence text,
airline_code varchar,
airline_flight text,
arrival_time int,
connections int,
departure_time... | i would like to fly from BOSTON to OAKLAND what airlines fly from BOSTON to OAKLAND | SELECT DISTINCT airline.airline_code FROM airline, airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_na... | atis |
CREATE TABLE team (
team_id number,
name text
)
CREATE TABLE country (
country_id number,
country_name text,
capital text,
official_native_language text
)
CREATE TABLE match_season (
season number,
player text,
position text,
country number,
team number,
draft_pick_numb... | For each player, what are their name, season, and country that they belong to? | SELECT T2.season, T2.player, T1.country_name FROM country AS T1 JOIN match_season AS T2 ON T1.country_id = T2.country | spider |
CREATE TABLE table_33589 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | When did the VFL pay at Victoria Park? | SELECT "Date" FROM table_33589 WHERE "Venue" = 'victoria park' | wikisql |
CREATE TABLE table_20286 (
"Kansas State vs." text,
"Games played" real,
"Overall Record" text,
"Last 5 Meetings" text,
"Last 10 Meetings" text,
"Current Streak" text,
"Last Meeting" text
) | how many games has kansas state and depaul played against each other | SELECT COUNT("Games played") FROM table_20286 WHERE "Kansas State vs." = 'DePaul' | wikisql |
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
CreationDate time,
UserId number,
UserDisplayName text,
Comment text,
Text text,
ContentLicense text
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description... | Most Upvotes for CSS in a given Location. Wanted to know who the serious players are in my city for various tags. Should turn TagName into an Input as well... | SELECT DisplayName, Reputation, TagName, Age, WebsiteUrl, COUNT(*) AS UpVotes FROM Tags INNER JOIN PostTags ON PostTags.TagId = Tags.Id INNER JOIN Posts ON Posts.ParentId = PostTags.PostId INNER JOIN Votes ON Votes.PostId = Posts.Id AND VoteTypeId = 2 INNER JOIN Users ON Posts.OwnerUserId = Users.Id WHERE LOWER(Locatio... | sede |
CREATE TABLE table_62639 (
"Club" text,
"Head Coach" text,
"City" text,
"Stadium" text,
"2002-2003 season" text
) | What place is listed in the 2002-2003 season for the City of Aveiro? | SELECT "2002-2003 season" FROM table_62639 WHERE "City" = 'aveiro' | wikisql |
CREATE TABLE table_name_19 (
against VARCHAR,
round VARCHAR,
surface VARCHAR
) | Who was the match against when on a clay surface during round 2r? | SELECT against FROM table_name_19 WHERE round = "2r" AND surface = "clay" | sql_create_context |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemics... | how many hours have elapsed since patient 027-188709 last received procedure during this hospital encounter? | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', treatment.treatmenttime)) FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-18870... | eicu |
CREATE TABLE table_name_85 (
date VARCHAR,
venue VARCHAR
) | What was the date of the game at MCG? | SELECT date FROM table_name_85 WHERE venue = "mcg" | sql_create_context |
CREATE TABLE table_65701 (
"Club" text,
"Wins" real,
"Losses" real,
"Draws" real,
"Against" real
) | What is the least amount of wins when against is 1314? | SELECT MIN("Wins") FROM table_65701 WHERE "Against" = '1314' | wikisql |
CREATE TABLE table_64278 (
"Heat" real,
"Lane" real,
"Name" text,
"Nationality" text,
"Time" text
) | How many Heats have a Name of miguel molina? | SELECT COUNT("Heat") FROM table_64278 WHERE "Name" = 'miguel molina' | wikisql |
CREATE TABLE debate_people (
Debate_ID int,
Affirmative int,
Negative int,
If_Affirmative_Win bool
)
CREATE TABLE people (
People_ID int,
District text,
Name text,
Party text,
Age int
)
CREATE TABLE debate (
Debate_ID int,
Date text,
Venue text,
Num_of_Audience int
... | Show different parties of people along with the number of people in each party Plot them as bar chart, display by the names in descending. | SELECT Party, COUNT(*) FROM people GROUP BY Party ORDER BY Party DESC | nvbench |
CREATE TABLE classroom (
building text,
room_number text,
capacity number
)
CREATE TABLE teaches (
id text,
course_id text,
sec_id text,
semester text,
year number
)
CREATE TABLE prereq (
course_id text,
prereq_id text
)
CREATE TABLE section (
course_id text,
sec_id te... | What are the names of students who have taken the prerequisite for the course International Finance? | SELECT T1.name FROM student AS T1 JOIN takes AS T2 ON T1.id = T2.id WHERE T2.course_id IN (SELECT T4.prereq_id FROM course AS T3 JOIN prereq AS T4 ON T3.course_id = T4.course_id WHERE T3.title = 'International Finance') | spider |
CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopi... | Top 100 users in Chennai. | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%chennai%' OR UPPER(Location) LIKE '%CHENNAI' ORDER BY Reputation DESC LIMIT 1000 | sede |
CREATE TABLE table_31134 (
"Country" text,
"Remittances 2008" text,
"Remittances 2009" text,
"Remittances 2010" text,
"Remittances 2011" text
) | how many remittances in 2010 for nigeria? | SELECT "Remittances 2010" FROM table_31134 WHERE "Country" = 'Nigeria' | wikisql |
CREATE TABLE table_train_88 (
"id" int,
"mini_mental_state_examination_mmse" int,
"mild_cognitive_impairment" bool,
"body_weight" float,
"renal_disease" bool,
"memantine" bool,
"rivastigmine" bool,
"lewy_body_dementia" bool,
"NOUSE" float
) | diagnosis of lewy body dementia or mild cognitive impairment | SELECT * FROM table_train_88 WHERE lewy_body_dementia = 1 OR mild_cognitive_impairment = 1 | criteria2sql |
CREATE TABLE table_60616 (
"English translation" text,
"Original album" text,
"Lyricist(s)" text,
"Composer(s)" text,
"Time" text
) | What is English Translation, when Lyricist(s) is 'Giorgos Moukidis', and when Original Album is 'Ena (New Edition) | SELECT "English translation" FROM table_60616 WHERE "Lyricist(s)" = 'giorgos moukidis' AND "Original album" = 'ena (new edition)' | wikisql |
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 ... | 从05年8月1日到21年1月3日,病人在8515930这个医疗机构的住院时间超过30天的记录有多少 | SELECT COUNT(*) FROM zyjzjlb JOIN hz_info_zyjzjlb JOIN hz_info ON hz_info_zyjzjlb.JZLSH = zyjzjlb.JZLSH AND hz_info_zyjzjlb.YLJGDM = hz_info_zyjzjlb.YLJGDM AND hz_info_zyjzjlb.JZLSH = zyjzjlb.JZLSH AND hz_info_zyjzjlb.zyjzjlb_id = zyjzjlb.zyjzjlb_id AND hz_info_zyjzjlb.YLJGDM = hz_info.YLJGDM WHERE hz_info.YLJGDM = '85... | css |
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE patients (
row_id number,
subj... | show me the heart rate change in patient 4401 last measured on the current intensive care unit visit compared to the first value measured on the current intensive care unit visit? | SELECT (SELECT chartevents.valuenum FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 4401) AND icustays.outtime IS NULL) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_it... | mimic_iii |
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE patients (... | what's the name of the drug that was first prescribed to patient 3229 in 12/2105? | SELECT prescriptions.drug FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 3229) AND STRFTIME('%y-%m', prescriptions.startdate) = '2105-12' ORDER BY prescriptions.startdate LIMIT 1 | mimic_iii |
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE instructor (
instructor_id int,
name varchar,
uniqname varchar
)
CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city varchar,
state varchar,
country varchar,
... | Is AEROSP 416 required for anything ? | SELECT DISTINCT COURSE_1.department, COURSE_1.name, COURSE_1.number FROM course AS COURSE_0, course AS COURSE_1, course_prerequisite WHERE COURSE_0.course_id = course_prerequisite.pre_course_id AND COURSE_0.department = 'AEROSP' AND COURSE_0.number = 416 AND COURSE_1.course_id = course_prerequisite.course_id | advising |
CREATE TABLE station (
id VARCHAR,
local_authority VARCHAR
)
CREATE TABLE weekly_weather (
station_id VARCHAR,
precipitation INTEGER
) | Find the id and local authority of the station whose maximum precipitation is higher than 50. | SELECT t2.id, t2.local_authority FROM weekly_weather AS t1 JOIN station AS t2 ON t1.station_id = t2.id GROUP BY t1.station_id HAVING MAX(t1.precipitation) > 50 | sql_create_context |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | what is minimum age of patients whose admission type is emergency and days of hospital stay is 0? | SELECT MIN(demographic.age) FROM demographic WHERE demographic.admission_type = "EMERGENCY" AND demographic.days_stay = "0" | mimicsql_data |
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... | Bar chart x axis all games y axis acc_percent, I want to order from high to low by the Y-axis. | SELECT All_Games, ACC_Percent FROM basketball_match ORDER BY ACC_Percent DESC | nvbench |
CREATE TABLE table_61432 (
"Artist" text,
"Album" text,
"Country" text,
"Year" real,
"Catalog #" text,
"Format" text
) | What is the format of the album Pacific Ocean Blue in 1991? | SELECT "Format" FROM table_61432 WHERE "Album" = 'pacific ocean blue' AND "Year" = '1991' | wikisql |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid numb... | when was patient 027-61708 given a procedure for the first time during the current hospital encounter? | SELECT treatment.treatmenttime FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-61708' AND patient.hospitaldischargetime IS NULL)) ORDER BY t... | eicu |
CREATE TABLE bank (
branch_ID int,
bname varchar(20),
no_of_customers int,
city varchar(10),
state varchar(20)
)
CREATE TABLE loan (
loan_ID varchar(3),
loan_type varchar(15),
cust_ID varchar(3),
branch_ID varchar(3),
amount int
)
CREATE TABLE customer (
cust_ID varchar(3),... | For each account type, find the average account balance of customers with credit score lower than 50 Show bar chart, and display by the bars in desc please. | SELECT acc_type, AVG(acc_bal) FROM customer WHERE credit_score < 50 GROUP BY acc_type ORDER BY acc_type DESC | nvbench |
CREATE TABLE table_10718984_2 (
original_air_date VARCHAR,
no_in_season VARCHAR
) | When did the no. 23 show originally air? | SELECT original_air_date FROM table_10718984_2 WHERE no_in_season = 23 | sql_create_context |
CREATE TABLE table_name_6 (
gross_revenue__2011_ VARCHAR,
gross_revenue__1982_ VARCHAR
) | What was the 2011 gross revenue for the venue that had a gross revenue of $156,315 in 1982? | SELECT gross_revenue__2011_ FROM table_name_6 WHERE gross_revenue__1982_ = "$156,315" | sql_create_context |
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 (
... | provide the number of patients whose primary disease is s/p fall and lab test fluid is urine? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.diagnosis = "S/P FALL" AND lab.fluid = "Urine" | mimicsql_data |
CREATE TABLE table_name_5 (
score VARCHAR,
surface VARCHAR,
date VARCHAR
) | What was the score on a clay surface on May 29, 2006? | SELECT score FROM table_name_5 WHERE surface = "clay" AND date = "may 29, 2006" | sql_create_context |
CREATE TABLE table_204_783 (
id number,
"position" text,
"player" text,
"free agency\ntag" text,
"date signed" text,
"2013 team" text
) | the top played position according to this chart . | SELECT "position" FROM table_204_783 GROUP BY "position" ORDER BY COUNT(*) DESC LIMIT 1 | squall |
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, give me the comparison about code over the name , and group by attribute headquarter, and show names from high to low order please. | SELECT T1.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter, T1.Name ORDER BY T1.Name DESC | nvbench |
CREATE TABLE table_51253 (
"Years" text,
"Displacement" text,
"Engine" text,
"Power" text,
"Torque" text
) | what is the years for the displacement 4.0l (242cid)? | SELECT "Years" FROM table_51253 WHERE "Displacement" = '4.0l (242cid)' | wikisql |
CREATE TABLE table_name_67 (
total INTEGER,
nation VARCHAR,
gold VARCHAR
) | What is the average total medals Egypt, who has less than 2 gold, has? | SELECT AVG(total) FROM table_name_67 WHERE nation = "egypt" AND gold < 2 | sql_create_context |
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 prescription... | calculate the maximum days for which patients admitted on or after 2177 were hospitalized. | SELECT MAX(demographic.days_stay) FROM demographic WHERE demographic.admityear >= "2177" | mimicsql_data |
CREATE TABLE table_57243 (
"NGC number" real,
"Object type" text,
"Constellation" text,
"Right ascension ( J2000 )" text,
"Declination ( J2000 )" text,
"Apparent magnitude" real
) | Tell me the declination for consellaion of ophiuchus and apparent magnitude less than 8.6 with right ascension of 16h47m14.5s | SELECT "Declination ( J2000 )" FROM table_57243 WHERE "Constellation" = 'ophiuchus' AND "Apparent magnitude" < '8.6' AND "Right ascension ( J2000 )" = '16h47m14.5s' | wikisql |
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description... | Number of posts by year. | SELECT DATEDIFF(day, CreationDate, GETDATE()) / 365 AS yearsBack, COUNT(Id) AS postsCount FROM Posts GROUP BY DATEDIFF(day, CreationDate, GETDATE()) / 365 ORDER BY DATEDIFF(day, CreationDate, GETDATE()) / 365 DESC | sede |
CREATE TABLE table_name_49 (
pd_per_game INTEGER,
pa_per_game VARCHAR,
streak VARCHAR,
rank VARCHAR,
winning__percentage VARCHAR
) | Which PD per game has a Rank smaller than 4, a Winning % of 78.6%, a Streak of w1, and a PA per game smaller than 81.5? | SELECT MIN(pd_per_game) FROM table_name_49 WHERE rank < 4 AND winning__percentage = "78.6%" AND streak = "w1" AND pa_per_game < 81.5 | sql_create_context |
CREATE TABLE table_name_48 (
roll INTEGER,
area VARCHAR,
authority VARCHAR
) | tell me the average roll for the featherston area and integrated authority. | SELECT AVG(roll) FROM table_name_48 WHERE area = "featherston" AND authority = "integrated" | sql_create_context |
CREATE TABLE table_31947 (
"Outcome" text,
"Date" text,
"Tournament" text,
"Surface" text,
"Opponent in the final" text,
"Score" text
) | Tell me the date for johanna konta | SELECT "Date" FROM table_31947 WHERE "Opponent in the final" = 'johanna konta' | wikisql |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
... | how many patients whose marital status is widowed and drug route is neb? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.marital_status = "WIDOWED" AND prescriptions.route = "NEB" | mimicsql_data |
CREATE TABLE table_name_81 (
kickoff VARCHAR,
opponent VARCHAR
) | What is the kickoff time for the Miami Dolphins? | SELECT kickoff FROM table_name_81 WHERE opponent = "miami dolphins" | sql_create_context |
CREATE TABLE exhibition (
Exhibition_ID int,
Year int,
Theme text,
Artist_ID int,
Ticket_Price real
)
CREATE TABLE artist (
Artist_ID int,
Name text,
Country text,
Year_Join int,
Age int
)
CREATE TABLE exhibition_record (
Exhibition_ID int,
Date text,
Attendance int... | Bin the Year into weekday interval, then group and count by Year, display Y-axis in desc order. | SELECT Year, COUNT(Year) FROM exhibition ORDER BY COUNT(Year) DESC | nvbench |
CREATE TABLE t_kc24 (
MED_SAFE_PAY_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
REF_SLT_FLG number,
CLINIC_SLT_DATE time,
COMP_ID text,
PERSON_ID text,
FLX_MED_ORG_ID text,
INSU_TYPE text,
MED_AMOUT number,
PER_ACC_PAY number,
OVE_PAY numb... | 关于个人自费金额,医疗就诊91446888857的具体是多些钱? | SELECT PER_EXP FROM t_kc24 WHERE MED_CLINIC_ID = '91446888857' | css |
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 ... | 有哪些人在医疗就诊32734390933中审核超过二十三份检验报告单?把这些审核人工号和姓名列出来都是什么? | SELECT zyjybgb.SHRGH, zyjybgb.SHRXM FROM zyjybgb WHERE zyjybgb.JZLSH = '32734390933' GROUP BY zyjybgb.SHRGH HAVING COUNT(*) > 23 UNION SELECT mzjybgb.SHRGH, mzjybgb.SHRXM FROM mzjybgb WHERE mzjybgb.JZLSH = '32734390933' GROUP BY mzjybgb.SHRGH HAVING COUNT(*) > 23 | css |
CREATE TABLE table_51336 (
"Driver" text,
"Constructor" text,
"Laps" text,
"Time/Retired" text,
"Grid" text
) | Which driver had a grid of 22? | SELECT "Driver" FROM table_51336 WHERE "Grid" = '22' | wikisql |
CREATE TABLE club (
clubid number,
clubname text,
clubdesc text,
clublocation text
)
CREATE TABLE member_of_club (
stuid number,
clubid number,
position text
)
CREATE TABLE student (
stuid number,
lname text,
fname text,
age number,
sex text,
major number,
advis... | Find the location of the club 'Pen and Paper Gaming'. | SELECT clublocation FROM club WHERE clubname = "Pen and Paper Gaming" | spider |
CREATE TABLE table_4696 (
"Tournament" text,
"2007" text,
"2009" text,
"2010" text,
"2011" text
) | What was the 2011 Wimbledon result? | SELECT "2011" FROM table_4696 WHERE "Tournament" = 'wimbledon' | wikisql |
CREATE TABLE table_name_99 (
record VARCHAR,
year VARCHAR
) | What's the record during 1925? | SELECT record FROM table_name_99 WHERE year = 1925 | sql_create_context |
CREATE TABLE table_name_88 (
attendance VARCHAR,
location VARCHAR,
time VARCHAR
) | How many attended the game at Busch Stadium (ii) when the time was 3:54? | SELECT attendance FROM table_name_88 WHERE location = "busch stadium (ii)" AND time = "3:54" | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.