context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_70273 (
"Episode #" real,
"Title" text,
"Airdate" text,
"Viewers (millions)" real,
"Channel 4 weekly rank a" real
) | What is the number for the Channel 4 weekly rank when there are more than 2.19 million viewers for the episode 'zero worship' which was earlier than episode 34? | SELECT COUNT("Channel 4 weekly rank a") FROM table_70273 WHERE "Viewers (millions)" > '2.19' AND "Title" = 'zero worship' AND "Episode #" < '34' | 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... | 奚雅逸患者被门诊诊断为疾病S71.943时的检测指标976587的结果定量及其单位分别是都是多少? | SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN mzjzjlb_jybgb ON person_info.RYBH = hz_info.RYBH AND 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.J... | css |
CREATE TABLE table_36514 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" real,
"Record" text
) | Who is the opponent on July 2 with more than 39,290 attendance? | SELECT "Opponent" FROM table_36514 WHERE "Attendance" > '39,290' AND "Date" = 'july 2' | wikisql |
CREATE TABLE table_name_70 (
silver VARCHAR,
bronze VARCHAR,
gold VARCHAR,
rank VARCHAR
) | How many values for silver occur when gold is less than 1, the rank is 13, and bronze is greater than 2? | SELECT COUNT(silver) FROM table_name_70 WHERE gold < 1 AND rank = 13 AND bronze > 2 | sql_create_context |
CREATE TABLE table_name_97 (
date VARCHAR,
format VARCHAR
) | On what date was the format of ed remaster cd? | SELECT date FROM table_name_97 WHERE format = "ed remaster cd" | sql_create_context |
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
) | For those records from the products and each product's manufacturer, return a bar chart about the distribution of founder and the sum of code , and group by attribute founder, and could you rank from high to low by the sum code? | SELECT T2.Founder, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Founder ORDER BY T1.Code DESC | nvbench |
CREATE TABLE t_kc21_t_kc22 (
MED_CLINIC_ID text,
MED_EXP_DET_ID number
)
CREATE TABLE t_kc21 (
CLINIC_ID text,
CLINIC_TYPE text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD ... | 查询5586017这个医疗机构在07年12月26到14年5月19日内的医疗费总额 | SELECT SUM(t_kc24.MED_AMOUT) FROM t_kc21 JOIN t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '5586017' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2007-12-26' AND '2014-05-19' | css |
CREATE TABLE ground_service (
city_code text,
airport_code text,
transport_type text,
ground_fare int
)
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
CREATE TABLE flight (
aircraft_code_sequence... | list all flights on CO leaving SEATTLE on sunday after 1630 | SELECT DISTINCT flight.flight_id FROM airport_service, city, date_day, days, flight WHERE ((date_day.day_number = 27 AND date_day.month_number = 8 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.departure_time > 1630 AND flight.flight_days = days.days_code) AND city.city_code = airport_service... | atis |
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... | how many patients are diagnosed with open wound of face nos and suggested the drug route via po/ng? | 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.short_title = "Open wound of face NOS" AND prescriptions.route = "PO/NG" | mimicsql_data |
CREATE TABLE diagnoses (
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 demographic (... | provide me the number of patients who are younger than 31 years and had a hospital stay of more than 2 days. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.age < "31" AND demographic.days_stay > "2" | mimicsql_data |
CREATE TABLE table_name_44 (
bronze VARCHAR,
nation VARCHAR,
silver VARCHAR
) | The Soviet Union has won more than 2 Silver, but how many Bronzes? | SELECT COUNT(bronze) FROM table_name_44 WHERE nation = "soviet union" AND silver > 2 | sql_create_context |
CREATE TABLE table_49410 (
"Outcome" text,
"Date" real,
"Championship" text,
"Surface" text,
"Opponent in the final" text,
"Score in the final" text
) | How many Dates have a Score in the final of 6 4, 6 2? | SELECT SUM("Date") FROM table_49410 WHERE "Score in the final" = '6–4, 6–2' | wikisql |
CREATE TABLE table_60807 (
"Rank" real,
"Res." text,
"Wind" text,
"Athlete" text,
"Date" text,
"Location" text
) | What was the highest rink for Kingston? | SELECT MAX("Rank") FROM table_60807 WHERE "Location" = 'kingston' | wikisql |
CREATE TABLE table_name_82 (
date VARCHAR,
week VARCHAR,
attendance VARCHAR
) | What was the date of the game after week 5 with 62,262 fans attending? | SELECT date FROM table_name_82 WHERE week > 5 AND attendance = "62,262" | sql_create_context |
CREATE TABLE Dorm (
dormid INTEGER,
dorm_name VARCHAR(20),
student_capacity INTEGER,
gender VARCHAR(1)
)
CREATE TABLE Has_amenity (
dormid INTEGER,
amenid INTEGER
)
CREATE TABLE Dorm_amenity (
amenid INTEGER,
amenity_name VARCHAR(25)
)
CREATE TABLE Student (
StuID INTEGER,
LNa... | A bar chart about what is the average age for each city and what are those cities?, order in asc by the y axis please. | SELECT city_code, AVG(Age) FROM Student GROUP BY city_code ORDER BY AVG(Age) | nvbench |
CREATE TABLE table_66382 (
"Club" text,
"Sport" text,
"Founded" real,
"League" text,
"Venue" text
) | What club team plays at the champion window field? | SELECT "Club" FROM table_66382 WHERE "Venue" = 'champion window field' | wikisql |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE treatment (
... | count the number of cases in which patient 027-203413 had received a mpv laboratory test. | SELECT COUNT(*) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-203413')) AND lab.labname = 'mpv' | eicu |
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE prescriptions (
... | how many times has patient 65467 been in hospital during a year before? | SELECT COUNT(DISTINCT admissions.hadm_id) FROM admissions WHERE admissions.subject_id = 65467 AND DATETIME(admissions.admittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') | mimic_iii |
CREATE TABLE table_name_3 (
driver VARCHAR,
grid VARCHAR
) | Who drove the grid 10 car? | SELECT driver FROM table_name_3 WHERE grid = 10 | sql_create_context |
CREATE TABLE gas_station (
Station_ID int,
Open_Year int,
Location text,
Manager_Name text,
Vice_Manager_Name text,
Representative_Name text
)
CREATE TABLE company (
Company_ID int,
Rank int,
Company text,
Headquarters text,
Main_Industry text,
Sales_billion real,
Pr... | Draw a bar chart of manager name versus how many manager name, I want to sort how many manager name in desc order. | SELECT Manager_Name, COUNT(Manager_Name) FROM gas_station GROUP BY Manager_Name ORDER BY COUNT(Manager_Name) DESC | nvbench |
CREATE TABLE table_61524 (
"Quarterback" text,
"Games" real,
"Teams" text,
"Wins" real,
"Losses" real,
"Percent" real
) | what is games when the losses is more than 1, percent is 0.5 and wins is 2? | SELECT "Games" FROM table_61524 WHERE "Losses" > '1' AND "Percent" = '0.5' AND "Wins" = '2' | wikisql |
CREATE TABLE table_name_9 (
week INTEGER,
date VARCHAR
) | What's the mean week number for November 12, 1978? | SELECT AVG(week) FROM table_name_9 WHERE date = "november 12, 1978" | sql_create_context |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | provide the number of patients whose lab test chart time is 2137-08-30 14:39:00. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.charttime = "2137-08-30 14:39:00" | mimicsql_data |
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... | 找出在一零年十二月二十七号到二一年十二月六号这些年里患者92724967在医院4295408开的所有药的编码和药名 | SELECT SOC_SRT_DIRE_CD, SOC_SRT_DIRE_NM FROM t_kc22 WHERE MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc21 WHERE PERSON_ID = '92724967' AND MED_SER_ORG_NO = '4295408' AND IN_HOSP_DATE BETWEEN '2010-12-27' AND '2021-12-06') | css |
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype tex... | what are the three most frequently prescribed drugs that patients were prescribed within 2 months after having received a contrast arteriogram-leg procedure until 1 year ago? | SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures ... | mimic_iii |
CREATE TABLE table_55002 (
"Year" text,
"Make & Model" text,
"Length" text,
"Engine Type" text,
"Numbers" text
) | If length is ft (m) with numbers of 6600-6684 (84 buses) for 2003, what is the engine type? | SELECT "Engine Type" FROM table_55002 WHERE "Length" = 'ft (m)' AND "Year" = '2003' AND "Numbers" = '6600-6684 (84 buses)' | wikisql |
CREATE TABLE table_name_4 (
player VARCHAR,
current_club VARCHAR,
year_born VARCHAR
) | Which player from the Ironi Nahariya club was born in 1980? | SELECT player FROM table_name_4 WHERE current_club = "ironi nahariya" AND year_born = 1980 | sql_create_context |
CREATE TABLE table_33575 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What is the largest crowd that has the away side scoring 10.14 (74)? | SELECT MAX("Crowd") FROM table_33575 WHERE "Away team score" = '10.14 (74)' | wikisql |
CREATE TABLE Participants (
Participant_ID INTEGER,
Participant_Type_Code CHAR(15),
Participant_Details VARCHAR(255)
)
CREATE TABLE Participants_in_Events (
Event_ID INTEGER,
Participant_ID INTEGER
)
CREATE TABLE Events (
Event_ID INTEGER,
Service_ID INTEGER,
Event_Details VARCHAR(255)... | What are the ids and details of events that have more than one participants. Visualize by bar chart. | SELECT T1.Event_Details, T1.Event_ID FROM Events AS T1 JOIN Participants_in_Events AS T2 ON T1.Event_ID = T2.Event_ID GROUP BY T1.Event_Details | nvbench |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE microlab (
microlabid number,
... | when they visited the hospital last time was acetaminophen (tylenol) tab 650 mg prescribed to patient 030-28944? | SELECT COUNT(*) > 0 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-28944' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.... | eicu |
CREATE TABLE table_37516 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Venue" text,
"Attendance" real
) | What is the attendance in texas stadium? | SELECT SUM("Attendance") FROM table_37516 WHERE "Venue" = 'texas stadium' | wikisql |
CREATE TABLE table_6333 (
"Club" text,
"Played" text,
"Drawn" text,
"Lost" text,
"Points for" text,
"Points against" text,
"Tries for" text,
"Tries against" text,
"Try bonus" text,
"Losing bonus" text,
"Points" text
) | Name the played with losing bonus of 3 and points against of 426 | SELECT "Played" FROM table_6333 WHERE "Losing bonus" = '3' AND "Points against" = '426' | wikisql |
CREATE TABLE table_11677691_10 (
player VARCHAR,
school VARCHAR
) | What player represented Vista Murrieta High School? | SELECT player FROM table_11677691_10 WHERE school = "Vista Murrieta High school" | sql_create_context |
CREATE TABLE table_31255 (
"Rank by average" real,
"Place" real,
"Couple" text,
"Total points" text,
"Number of dances" real,
"Average" text
) | How many times is the couple laura and colin? | SELECT COUNT("Place") FROM table_31255 WHERE "Couple" = 'Laura and Colin' | wikisql |
CREATE TABLE table_name_60 (
score VARCHAR,
team_2 VARCHAR
) | What is the 2nd round with a score of 3 - 3, and a team 2 fc lorient (d2)? | SELECT 2 AS nd_round FROM table_name_60 WHERE score = "3 - 3" AND team_2 = "fc lorient (d2)" | sql_create_context |
CREATE TABLE table_29598261_1 (
year VARCHAR,
name VARCHAR
) | what year is chris mcnamara? | SELECT year FROM table_29598261_1 WHERE name = "Chris McNamara" | sql_create_context |
CREATE TABLE table_17900 (
"Unit" text,
"Type" text,
"Net power" text,
"Total power" text,
"Construction start" text,
"Construction finish" text,
"Commercial operation" text,
"Shut down" text
) | What's the total power of the unit whose construction finished on 14.06.1963? | SELECT "Total power" FROM table_17900 WHERE "Construction finish" = '14.06.1963' | wikisql |
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswe... | Potential collisions between tag badges and regular badges. | SELECT t.TagName, t.Count FROM Badges AS b INNER JOIN Tags AS t ON LOWER(b.Name) = REPLACE(t.TagName, '-', ' ') WHERE b.TagBased = 0 GROUP BY t.TagName, t.Count ORDER BY t.Count DESC | sede |
CREATE TABLE table_22514845_4 (
race_caller VARCHAR,
s_host VARCHAR,
year VARCHAR
) | Who is the race caller when jim mckay and al michaels were s hosts in the year 1987? | SELECT race_caller FROM table_22514845_4 WHERE s_host = "Jim McKay and Al Michaels" AND year = 1987 | sql_create_context |
CREATE TABLE table_name_64 (
delivered_as VARCHAR,
locomotive VARCHAR
) | What is the Delivered as name of the H3 Locomotive? | SELECT delivered_as FROM table_name_64 WHERE locomotive = "h3" | sql_create_context |
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
AboutMe text,
Views number,
UpVotes number,
DownVotes number,
ProfileImageUrl text,
EmailHash text,
AccountId number
)
CRE... | Questions post by users in the given list. | SELECT Id AS "post_link", OwnerDisplayName, CreationDate, Score, Tags FROM Posts WHERE PostTypeId = 1 AND OwnerDisplayName IN ('##list##') ORDER BY Id DESC | sede |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospita... | count the number of patients who have received a pulmonary/ccm consultation procedure in the same month after they had been diagnosed with diabetes mellitus - type ii. | SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'diabetes mellitus - type ii') AS t1 JOIN (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment J... | eicu |
CREATE TABLE table_4183 (
"Outcome" text,
"Year" real,
"Championship" text,
"Surface" text,
"Partner" text,
"Opponents" text,
"Score" text
) | Who was Bob Bryan's partner/s on a hard surface in 2003? | SELECT "Partner" FROM table_4183 WHERE "Year" = '2003' AND "Surface" = 'Hard' | wikisql |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | what is the number of patients admitted before 2131 due to ruq pain? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "RUQ PAIN" AND demographic.admityear < "2131" | mimicsql_data |
CREATE TABLE table_18112 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Results" text,
"Candidates" text
) | Name the number of party for new york 29 | SELECT COUNT("Party") FROM table_18112 WHERE "District" = 'New York 29' | wikisql |
CREATE TABLE table_name_93 (
week VARCHAR,
opponent VARCHAR,
attendance VARCHAR
) | For the 1967 Cleveland Browns season what is the total number of times they played the Minnesota Vikings and had an atttendance smaller than 68,431? | SELECT COUNT(week) FROM table_name_93 WHERE opponent = "minnesota vikings" AND attendance < 68 OFFSET 431 | sql_create_context |
CREATE TABLE table_name_74 (
player VARCHAR,
position VARCHAR,
school_club_team VARCHAR
) | What Utah Jazz Forward played for Southern Methodist? | SELECT player FROM table_name_74 WHERE position = "forward" AND school_club_team = "southern methodist" | sql_create_context |
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,... | recreate TAGS field, REPLACING [EXCEL-VBA] with [EXCEL]+[VBA] *where applicable. 271974 answers to 203085 questions, have at least one of the 3 tags | SELECT COUNT(*) FROM Posts AS q WHERE (q.Tags LIKE '%<vba>%' OR q.Tags LIKE '%<excel>%' OR q.Tags LIKE '%<excel-vba>%') AND PostTypeId = 1 | sede |
CREATE TABLE table_204_917 (
id number,
"date" text,
"opponent#" text,
"rank#" text,
"site" text,
"result" text,
"attendance" number
) | what was the last game to be attended by fewer than 30,000 people ? | SELECT "date" FROM table_204_917 WHERE "attendance" < 30000 | squall |
CREATE TABLE table_20069 (
"Name" text,
"Year" real,
"Landfall" text,
"NHC Advisory Number" text,
"V(mph)" real,
"R(miles)" real,
"Saffir-Simpson Category" real,
"CHI" text
) | What are the miles when the Carvill Hurricane Index (CHI) is equal to 9.9? | SELECT "R(miles)" FROM table_20069 WHERE "CHI" = '9.9' | wikisql |
CREATE TABLE table_name_21 (
title VARCHAR,
peak_position VARCHAR,
country VARCHAR
) | What is the title of the single with the peak position of 10 and from France? | SELECT title FROM table_name_21 WHERE peak_position = 10 AND country = "france" | sql_create_context |
CREATE TABLE table_name_7 (
field VARCHAR,
date VARCHAR
) | What is the field of the game on July 22? | SELECT field FROM table_name_7 WHERE date = "july 22" | sql_create_context |
CREATE TABLE table_43781 (
"Position" real,
"Team" text,
"Played" real,
"Drawn" real,
"Lost" real,
"Goals For" real,
"Goals Against" real,
"Goal Difference" text,
"Points 1" text
) | What is the highest number drawn when the position was 12? | SELECT MAX("Drawn") FROM table_43781 WHERE "Position" = '12' | wikisql |
CREATE TABLE table_203_506 (
id number,
"opponent" text,
"played" number,
"won" number,
"lost" number,
"drawn" number,
"% won overall" text
) | for how many teams was the win percentage below 90 % | SELECT COUNT("opponent") FROM table_203_506 WHERE "% won overall" < 90 | squall |
CREATE TABLE table_name_9 (
year INTEGER,
additional_colour_s_ VARCHAR
) | What is the average year of entries with additional color black? | SELECT AVG(year) FROM table_name_9 WHERE additional_colour_s_ = "black" | sql_create_context |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
... | How many patients of black/cape verdean ethnicity are diagnosed with the primary disease st elevated myocardial infarction/cardiac cath? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "BLACK/CAPE VERDEAN" AND demographic.diagnosis = "ST ELEVATED MYOCARDIAL INFARCTION\CARDIAC CATH" | mimicsql_data |
CREATE TABLE table_67657 (
"Date" text,
"Round" text,
"Opponent" text,
"Venue" text,
"Result" text,
"Attendance" real,
"Scorers" text
) | Which date has an A venue with an Opponent of stoke city? | SELECT "Date" FROM table_67657 WHERE "Venue" = 'a' AND "Opponent" = 'stoke city' | wikisql |
CREATE TABLE qtb (
CLINIC_ID text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
INSU_TYPE text,
IN... | 在21年2月24到21年6月19日的这几个月,共有多少异地病患在医院6947584看过病 | SELECT COUNT(*) FROM qtb WHERE qtb.MED_SER_ORG_NO = '6947584' AND qtb.IN_HOSP_DATE BETWEEN '2021-02-24' AND '2021-06-19' AND qtb.REMOTE_SETTLE_FLG = '异地1' OR qtb.REMOTE_SETTLE_FLG = '异地2' UNION SELECT COUNT(*) FROM gyb WHERE gyb.MED_SER_ORG_NO = '6947584' AND gyb.IN_HOSP_DATE BETWEEN '2021-02-24' AND '2021-06-19' AND g... | css |
CREATE TABLE table_name_69 (
top_speed VARCHAR,
model_name VARCHAR
) | Which Top Speed has a Model Name of d14/4 supreme d14/4 sports & bushman? | SELECT top_speed FROM table_name_69 WHERE model_name = "d14/4 supreme d14/4 sports & bushman" | sql_create_context |
CREATE TABLE table_30472 (
"Date" text,
"Time" text,
"Visiting team" text,
"Home team" text,
"Site" text,
"Broadcast" text,
"Result" text,
"Attendance" real
) | What was the final score of Washington's home game? | SELECT "Result" FROM table_30472 WHERE "Home team" = 'Washington' | wikisql |
CREATE TABLE table_203_160 (
id number,
"rank" number,
"heat" number,
"nation" text,
"competitors" text,
"time" text,
"notes" text
) | which nation came before spain ? | SELECT "nation" FROM table_203_160 WHERE "rank" = (SELECT "rank" FROM table_203_160 WHERE "nation" = 'spain') - 1 | squall |
CREATE TABLE table_197638_7 (
_number INTEGER,
french_open VARCHAR
) | What is the number for the french open 1974? | SELECT MAX(_number) FROM table_197638_7 WHERE french_open = 1974 | sql_create_context |
CREATE TABLE student (
stuid number,
lname text,
fname text,
age number,
sex text,
major number,
advisor number,
city_code text
)
CREATE TABLE plays_games (
stuid number,
gameid number,
hours_played number
)
CREATE TABLE sportsinfo (
stuid number,
sportname text,
... | What are the ids of all students along with how many sports and games did they play? | SELECT stuid, COUNT(*), SUM(gamesplayed) FROM sportsinfo GROUP BY stuid | spider |
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25),
COUNTRY_ID varchar(2)
)
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
... | For those employees who was hired before 2002-06-21, return a bar chart about the distribution of job_id and the sum of salary , and group by attribute job_id, and list from high to low by the Y. | SELECT JOB_ID, SUM(SALARY) FROM employees WHERE HIRE_DATE < '2002-06-21' GROUP BY JOB_ID ORDER BY SUM(SALARY) DESC | nvbench |
CREATE TABLE table_12189 (
"Week 1" text,
"Week 2" text,
"Week 3" text,
"Week 4" text,
"Week 5" text
) | Which week 2 had a week 3 of Cidney Carson? | SELECT "Week 2" FROM table_12189 WHERE "Week 3" = 'cidney carson' | wikisql |
CREATE TABLE table_8839 (
"Model Number" text,
"Frequency" text,
"L2-Cache" text,
"Front Side Bus" text,
"Multiplier" text,
"Voltage" text,
"Socket" text
) | Which L2-Cache has a Frequency of 1333 mhz, and a Model Number of c3 1.3a? | SELECT "L2-Cache" FROM table_8839 WHERE "Frequency" = '1333 mhz' AND "Model Number" = 'c3 1.3a' | wikisql |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
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,
... | 从2017-09-06到2021-12-14,医疗机构6088792的头颈肿瘤外科有多少处理的住院就诊数? | 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 = '60... | css |
CREATE TABLE table_name_4 (
points INTEGER,
engine VARCHAR,
year VARCHAR
) | What is the average Points when the engine was a climax straight-4 earlier than 1958? | SELECT AVG(points) FROM table_name_4 WHERE engine = "climax straight-4" AND year < 1958 | sql_create_context |
CREATE TABLE table_72963 (
"Rank" real,
"Railway Station" text,
"Annual entry/exit (millions) 2011\u201312" text,
"Annual interchanges (millions) 2011\u201312" text,
"Total Passengers (millions) 2011\u201312" text,
"Location" text,
"Main Services" text,
"Number of Platforms" real
) | Which location has 103.534 million passengers in 2011-12? | SELECT "Location" FROM table_72963 WHERE "Total Passengers (millions) 2011\u201312" = '103.534' | 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 ReviewTaskResults (
Id number,
ReviewTaskId number,
... | is score can be negative. | SELECT MAX(Score) FROM Posts WHERE PostTypeId = 1 | sede |
CREATE TABLE table_52447 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Decision" text,
"Attendance" real,
"Record" text
) | What was the lowest Attendance for Games played on the Date of February 5? | SELECT MIN("Attendance") FROM table_52447 WHERE "Date" = 'february 5' | wikisql |
CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTas... | Title and Body of 5 tags. | SELECT p.Body, 'swing', p.Title FROM Posts AS p, PostTags AS pt, Tags AS t WHERE p.CreationDate < '2014-03-01' AND pt.PostId = p.Id AND pt.TagId = t.Id AND t.TagName = 'swing' LIMIT 50000 | sede |
CREATE TABLE table_1341423_13 (
first_elected INTEGER,
incumbent VARCHAR
) | What year was Luis Gutierrez election | SELECT MIN(first_elected) FROM table_1341423_13 WHERE incumbent = "Luis Gutierrez" | sql_create_context |
CREATE TABLE table_55580 (
"Party" text,
"Results 2004" text,
"CSA 5/28/09" text,
"Ifop 5/30/09" text,
"Ipsos 5/30/09" text,
"BVA 6/1/09" text,
"TNS-Sofres 6/2/09" text,
"OpinionWay 6/3/09" text,
"Ipsos 6/3/09" text,
"TNS-Sofres 6/4/09" text,
"CSA 6/4/09" text,
"Ifop 6/4/... | What was the TNS-Sofres when the Iflop was 5%? | SELECT "TNS-Sofres 6/2/09" FROM table_55580 WHERE "Ifop 5/30/09" = '5%' | wikisql |
CREATE TABLE table_15125 (
"Year" real,
"Entrant" text,
"Chassis" text,
"Engine" text,
"Points" real
) | Name the points with chassis of march 751 | SELECT "Points" FROM table_15125 WHERE "Chassis" = 'march 751' | wikisql |
CREATE TABLE table_37894 (
"Call sign" text,
"Frequency MHz" real,
"City of license" text,
"ERP W" real,
"Class" text,
"FCC info" text
) | Which ERP W is the lowest one that has a Frequency MHz of 91.3? | SELECT MIN("ERP W") FROM table_37894 WHERE "Frequency MHz" = '91.3' | wikisql |
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... | Give me the comparison about ACC_Percent over the ACC_Regular_Season , sort by the ACC_Percent in ascending. | SELECT ACC_Regular_Season, ACC_Percent FROM basketball_match ORDER BY ACC_Percent | nvbench |
CREATE TABLE table_13201 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Record" text
) | What is the score for 4-1? | SELECT "Score" FROM table_13201 WHERE "Record" = '4-1' | wikisql |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
CREATE TABLE person_info (
CSD text,
CSRQ time,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
MZDM text,
MZMC text,
RYBH text,
XBDM number,
XBMC text,
XLDM text,
XLMC text,
XM text... | 编号为09476292的这位患者被门诊诊断为疾病S98.901,查一下他游离甲状腺素(三代)的结果定量及其单位 | SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN txmzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX AND txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jyb... | css |
CREATE TABLE table_46096 (
"Club" text,
"Played" text,
"Drawn" text,
"Lost" text,
"Points for" text,
"Points against" text,
"Tries for" text,
"Tries against" text,
"Try bonus" text,
"Losing bonus" text,
"Points" text
) | How many points against when 41 is the tries for? | SELECT "Points against" FROM table_46096 WHERE "Tries for" = '41' | wikisql |
CREATE TABLE table_name_16 (
goals INTEGER,
apps INTEGER
) | Tell me the average goals with apps less than 3 | SELECT AVG(goals) FROM table_name_16 WHERE apps < 3 | sql_create_context |
CREATE TABLE table_55388 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Record" text
) | What is the score of the game with an 11-32-11 record? | SELECT "Score" FROM table_55388 WHERE "Record" = '11-32-11' | wikisql |
CREATE TABLE table_22753 (
"Character" text,
"Original Broadway performer" text,
"Original Australian performer" text,
"Original West End performer" text,
"2005 World AIDS Day Benefit Dream Cast" text
) | Who is the 2005 World AIDS Day Benefit 'Dream' Cast when the Original Australian performer is Susan-Ann Walker? | SELECT "2005 World AIDS Day Benefit Dream Cast" FROM table_22753 WHERE "Original Australian performer" = 'Susan-Ann Walker' | wikisql |
CREATE TABLE table_dev_9 (
"id" int,
"heart_disease" bool,
"hba1c" float,
"coronary_artery_disease_cad" bool,
"triglyceride_tg" float,
"hypertension" bool,
"NOUSE" float
) | uncontrolled hypertension | SELECT * FROM table_dev_9 WHERE hypertension = 1 | criteria2sql |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE cost (
costid number,
u... | when did patient 015-21757 first have maximum sao2 on 11/18/last year? | SELECT vitalperiodic.observationtime FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '015-21757')) AND NOT vitalperiodic.sao2 IS NULL AND... | eicu |
CREATE TABLE paperdataset (
paperid int,
datasetid int
)
CREATE TABLE keyphrase (
keyphraseid int,
keyphrasename varchar
)
CREATE TABLE author (
authorid int,
authorname varchar
)
CREATE TABLE paper (
paperid int,
title varchar,
venueid int,
year int,
numciting int,
nu... | papers by steve seitz | SELECT DISTINCT writes.paperid FROM author, writes WHERE author.authorname = 'steve seitz' AND writes.authorid = author.authorid | scholar |
CREATE TABLE table_56686 (
"Route Name" text,
"Direction" text,
"Termini" text,
"Junctions" text,
"Length" text,
"Population Area" text
) | What's the termini of the route with junctions of i-35 fm 3338 sh 255? | SELECT "Termini" FROM table_56686 WHERE "Junctions" = 'i-35 fm 3338 sh 255' | wikisql |
CREATE TABLE table_45252 (
"Position" real,
"Team" text,
"Played" real,
"Wins" real,
"Draws" real,
"Losses" real,
"Scored" real,
"Conceded" real,
"Bonus Points" text,
"Points" real
) | Name the Wins which has Points smaller than 10, Losses smaller than 3, and a Scored of 11? | SELECT MIN("Wins") FROM table_45252 WHERE "Points" < '10' AND "Losses" < '3' AND "Scored" = '11' | 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 of the patients discharged-transfer to psych hospital had endosc inser stent bile | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.discharge_location = "DISCH-TRAN TO PSYCH HOSP" AND procedures.short_title = "Endosc inser stent bile" | mimicsql_data |
CREATE TABLE Apartments (
apt_id INTEGER,
building_id INTEGER,
apt_type_code CHAR(15),
apt_number CHAR(10),
bathroom_count INTEGER,
bedroom_count INTEGER,
room_count CHAR(5)
)
CREATE TABLE View_Unit_Status (
apt_id INTEGER,
apt_booking_id INTEGER,
status_date DATETIME,
avail... | A bar chart showing the number of start date of the apartment bookings made by female guests (gender code 'Female') for each weekday. | SELECT booking_start_date, COUNT(booking_start_date) FROM Apartment_Bookings AS T1 JOIN Guests AS T2 ON T1.guest_id = T2.guest_id WHERE T2.gender_code = "Female" | nvbench |
CREATE TABLE table_203_572 (
id number,
"judge" text,
"court" text,
"began active\nservice" text,
"ended active\nservice" text,
"ended senior\nstatus" text
) | is morris s. arnold above or below maryanne trump barry in in the list ? | SELECT (SELECT id FROM table_203_572 WHERE "judge" = 'morris s. arnold') < (SELECT id FROM table_203_572 WHERE "judge" = 'maryanne trump barry') | squall |
CREATE TABLE table_71782 (
"Date" text,
"Region" text,
"Label" text,
"Catalogue" text,
"Format" text
) | What label has brol 34531 as it's catalogue? | SELECT "Label" FROM table_71782 WHERE "Catalogue" = 'brol 34531' | wikisql |
CREATE TABLE table_21357 (
"Date" text,
"Opponent" text,
"Venue" text,
"Result" text,
"Attendance" real,
"Competition" text,
"Man of the Match" text
) | Who was the man of the match when they lost 2-4? | SELECT "Man of the Match" FROM table_21357 WHERE "Result" = 'Lost 2-4' | wikisql |
CREATE TABLE table_15069 (
"Tournament" text,
"2009" text,
"2010" text,
"2011" text,
"2012" text
) | what is the tournament when the performance in 2012 is 3r and 2011 is qf? | SELECT "Tournament" FROM table_15069 WHERE "2012" = '3r' AND "2011" = 'qf' | wikisql |
CREATE TABLE table_3495 (
"Institution" text,
"Location" text,
"Founded" real,
"Type" text,
"Enrollment" text,
"Nickname" text,
"Joined" text,
"Left" text,
"Football Conference" text,
"Primary Conference" text
) | How many different types are allocated to the institution in Bridgewater, Massachusetts? | SELECT COUNT("Type") FROM table_3495 WHERE "Location" = 'Bridgewater, Massachusetts' | wikisql |
CREATE TABLE table_71013 (
"From" text,
"Until" text,
"Name" text,
"Party" text,
"Function" text
) | What is the Until date associated with a beginning From date of July 5, 2007? | SELECT "Until" FROM table_71013 WHERE "From" = 'july 5, 2007' | wikisql |
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title te... | among the patients of the age 60 or above since 2102, what is the top four prescribed drugs? | SELECT t1.drug FROM (SELECT prescriptions.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age >= 60) AND STRFTIME('%y', prescriptions.startdate) >= '2102' GROUP BY prescriptions.drug) AS t1 WHERE t1.c1 <... | 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,
... | Of the Hist Urb Form courses , which are the ones which satisfy the MDE requirement ? | SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN area ON course.course_id = area.course_id INNER JOIN program_course ON program_course.course_id = course.course_id WHERE (area.area LIKE '%Hist Urb Form%' OR course.description LIKE '%Hist Urb Form%' OR course.name LIKE '%Hist Urb Form... | advising |
CREATE TABLE table_174151_5 (
power_provided VARCHAR,
transfer_speed__mb_s_ VARCHAR,
max_cable_length__m_ VARCHAR
) | Name the power provided where transfer speed mb/s is 300 and max cable length of 10 | SELECT power_provided FROM table_174151_5 WHERE transfer_speed__mb_s_ = "300" AND max_cable_length__m_ = "10" | sql_create_context |
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
... | what was the total amount of input that patient 15794 got during the previous day? | SELECT SUM(inputevents_cv.amount) 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 DATETIME(inputevents_cv.charttime, 'start of day') = DATETIME(CURRENT_TIME(), ... | mimic_iii |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.