context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_29697744_1 (
season VARCHAR,
position VARCHAR
) | in which year the season was in 5th position | SELECT season FROM table_29697744_1 WHERE position = "5th" | sql_create_context |
CREATE TABLE table_8389 (
"Title" text,
"Year" real,
"Studio" text,
"Role" text,
"Director" text,
"Other cast members" text
) | Which Title is from 1952? | SELECT "Title" FROM table_8389 WHERE "Year" = '1952' | wikisql |
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime ti... | what is patient 77980's last id of the ward until 4 years ago? | SELECT transfers.wardid FROM transfers WHERE transfers.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 77980) AND NOT transfers.wardid IS NULL AND DATETIME(transfers.intime) <= DATETIME(CURRENT_TIME(), '-4 year') ORDER BY transfers.intime DESC LIMIT 1 | mimic_iii |
CREATE TABLE table_64566 (
"Name" text,
"Years" text,
"A-League" text,
"Finals" text,
"Total" text
) | What A-League has 6 (1) for the finals, and leigh broxham as the name? | SELECT "A-League" FROM table_64566 WHERE "Finals" = '6 (1)' AND "Name" = 'leigh broxham' | wikisql |
CREATE TABLE table_name_15 (
team VARCHAR,
high_assists VARCHAR
) | What is Team, when High Assists is 'Rashard Lewis (4)'? | SELECT team FROM table_name_15 WHERE high_assists = "rashard lewis (4)" | sql_create_context |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime... | is patient 003-29149 prescribed any drugs in 2105? | 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 = '003-29149')) AND STRFTIME('%y', medication.drugstarttime) = '2105' | eicu |
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABLE days (
days_code varchar,
day_name varchar
)
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_code varchar
)
CREATE TABLE fligh... | what are the lowest one way fares from PITTSBURGH to ATLANTA | SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, flight, flight_fare WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'PITTSBURGH' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.c... | atis |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | how many patients whose admission location is emergency room admit and procedure long title is procedure on single vessel? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_location = "EMERGENCY ROOM ADMIT" AND procedures.long_title = "Procedure on single vessel" | mimicsql_data |
CREATE TABLE table_21080 (
"Name" text,
"Latitude" text,
"Longitude" text,
"Diameter (km)" text,
"Year named" real,
"Name origin" text
) | What is every name origin with the name Ovda Fluctus? | SELECT "Name origin" FROM table_21080 WHERE "Name" = 'Ovda Fluctus' | wikisql |
CREATE TABLE table_name_11 (
total_assists INTEGER,
ast_avg VARCHAR,
games VARCHAR
) | What is the total number of assists for players with under 55 games and over 6 assists per game average? | SELECT SUM(total_assists) FROM table_name_11 WHERE ast_avg > 6 AND games < 55 | sql_create_context |
CREATE TABLE table_68532 (
"Venue" text,
"City" text,
"Tickets Sold / Available" text,
"Gross Revenue (1979)" text,
"Gross Revenue (2012)" text
) | What is the amount of Tickets Sold/ Available at the Venue of hippodrome? | SELECT "Tickets Sold / Available" FROM table_68532 WHERE "Venue" = 'hippodrome' | wikisql |
CREATE TABLE technician (
technician_id number,
name text,
team text,
starting_year number,
age number
)
CREATE TABLE repair_assignment (
technician_id number,
repair_id number,
machine_id number
)
CREATE TABLE machine (
machine_id number,
making_year number,
class text,
... | What are the names of the technicians that have not been assigned to repair machines? | SELECT name FROM technician WHERE NOT technician_id IN (SELECT technician_id FROM repair_assignment) | spider |
CREATE TABLE jybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH text,
BGJGDM text,
BGJGMC text,
BGRGH text,
BGRQ time,
BGRXM text,
BGSJ time,
CJRQ time,
JSBBRQSJ time,
JSBBSJ time,
JYBBH text,
JYJGMC text,
JYJSGH text,
JYJSQM text,
JY... | 自2000年12月30日,到2020年10月26日,8951695这个医疗机构处理了多少次新生儿门诊 | SELECT COUNT(*) FROM mzjzjlb JOIN hz_info_mzjzjlb JOIN hz_info ON hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.mzjzjlb_id = mzjzjlb.mzjzjlb_id AND hz_info_mzjzjlb.YLJGDM = hz_info.YLJGDM WHERE hz_info.YLJGDM = '89... | css |
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 is the changing/difference of chloride of patient 010-9767 last measured on the last hospital visit compared to the first value measured on the last hospital visit? | SELECT (SELECT lab.labresult FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '010-9767' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospit... | eicu |
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_typ... | i would like to know the daily average amount of mvi that patient 31088 has received this month. | SELECT AVG(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 = 31088)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.lab... | mimic_iii |
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
outtime time
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,... | what is the monthly average amount of drain out #1 hemovac that patient 55503 had until 11/2104? | SELECT AVG(outputevents.value) FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 55503)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'dra... | mimic_iii |
CREATE TABLE table_34551 (
"Year" real,
"Tournament" text,
"Venue" text,
"Result" text,
"Distance" text
) | How far Venue of seoul, south korea is? | SELECT "Distance" FROM table_34551 WHERE "Venue" = 'seoul, south korea' | 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... | 在13年3月19到13年9月25的这几个月,共有多少患者在医疗机构9085196的特需门诊就诊 | SELECT COUNT(*) FROM mzjzjlb WHERE mzjzjlb.YLJGDM = '9085196' AND mzjzjlb.JZKSRQ BETWEEN '2013-03-19' AND '2013-09-25' AND mzjzjlb.TXBZ > 0 | css |
CREATE TABLE table_47800 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
) | What is the Score of Stewart Cink with a To par of +4? | SELECT "Score" FROM table_47800 WHERE "To par" = '+4' AND "Player" = 'stewart cink' | wikisql |
CREATE TABLE table_4287 (
"Townland" text,
"Area( acres )" real,
"Barony" text,
"Civil parish" text,
"Poor law union" text
) | How many different civil parishes is Canrooska a part of? | SELECT COUNT("Civil parish") FROM table_4287 WHERE "Townland" = 'Canrooska' | wikisql |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost numbe... | what was the name of the organism found in the first microbiological examination of patient 031-3355's other in this month? | SELECT microlab.organism FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-3355')) AND microlab.culturesite = 'other' AND DATETIME(microlab.cult... | eicu |
CREATE TABLE table_2008069_2 (
conventional VARCHAR,
uyghur___yenɡi_yezik̢__ VARCHAR
) | Name the conventional for defter | SELECT conventional FROM table_2008069_2 WHERE uyghur___yenɡi_yezik̢__ = "Defter" | sql_create_context |
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto 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 diagnoses_icd (
row_id number,
... | what's the number of times vitamin b complex w/c is prescribed? | SELECT COUNT(*) FROM prescriptions WHERE prescriptions.drug = 'vitamin b complex w/c' | mimic_iii |
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDispl... | Percentage of bounties with accepted answer depending on the weekday when the question was posted. | WITH tmp AS (SELECT p.Id, p.AcceptedAnswerId AS Acc, Period = TIME_TO_STR(p.CreationDate, '%W') FROM Posts AS p INNER JOIN Votes AS bs ON p.Id = bs.PostId AND bs.VoteTypeId = 8) SELECT Period, ROUND((COUNT(Acc)) * 100.0 / (COUNT(*)), 2) AS percentage FROM tmp GROUP BY Period ORDER BY Period | sede |
CREATE TABLE table_name_66 (
played INTEGER,
drawn VARCHAR,
against VARCHAR
) | What is the smallest played amount when there are 2 draws and an against of more than 73? | SELECT MIN(played) FROM table_name_66 WHERE drawn = 2 AND against > 73 | sql_create_context |
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city varchar,
state varchar,
country varchar,
zip int
)
CREATE TABLE area (
course_id int,
area varchar
)
... | Will there be any PATH 581 classes on Friday ? | SELECT DISTINCT course_offering.friday FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester WHERE course.department = 'PATH' AND course.number = 581 AND semester.semester = 'WN' AND semester.year = 2016 | advising |
CREATE TABLE table_name_78 (
qual VARCHAR,
rank VARCHAR
) | Name the qual for rank of 9 | SELECT qual FROM table_name_78 WHERE rank = "9" | sql_create_context |
CREATE TABLE table_name_56 (
ergative VARCHAR,
nominative VARCHAR
) | With a nominative of chven-i what is the ergative? | SELECT ergative FROM table_name_56 WHERE nominative = "chven-i" | sql_create_context |
CREATE TABLE table_35721 (
"Result" text,
"Date" text,
"Race" text,
"Venue" text,
"Group" text,
"Distance" text,
"Weight (kg)" real,
"Jockey" text,
"Winner/2nd" text
) | What was the race of the jockey in na group in 4th place? | SELECT "Race" FROM table_35721 WHERE "Group" = 'na' AND "Result" = '4th' | wikisql |
CREATE TABLE table_57709 (
"Year" text,
"Division" text,
"League" text,
"Reg. Season" text,
"Playoffs" text,
"Open Cup" text
) | Name the league for 1996 | SELECT "League" FROM table_57709 WHERE "Year" = '1996' | wikisql |
CREATE TABLE course (
course_id int,
name varchar,
department varchar,
number varchar,
credits varchar,
advisory_requirement varchar,
enforced_requirement varchar,
description varchar,
num_semesters int,
num_enrolled int,
has_discussion varchar,
has_lab varchar,
has_p... | In 560 is there a lab ? | SELECT COUNT(*) > 0 FROM course WHERE department = 'EECS' AND has_lab = 'Y' AND number = 560 | advising |
CREATE TABLE table_name_99 (
state VARCHAR,
rank VARCHAR,
city VARCHAR
) | What is the state of the city of denver, which has a rank less than 10? | SELECT state FROM table_name_99 WHERE rank < 10 AND city = "denver" | sql_create_context |
CREATE TABLE table_15113 (
"Week" text,
"Date" text,
"Opponent" text,
"Result" text,
"Game site" text,
"Record" text,
"Attendance" text
) | Name the result with week of 16 | SELECT "Result" FROM table_15113 WHERE "Week" = '16' | wikisql |
CREATE TABLE table_58139 (
"Player" text,
"Position" text,
"Date of Birth (Age)" text,
"Caps" real,
"Club/province" text
) | Which player was a fly-half? | SELECT "Player" FROM table_58139 WHERE "Position" = 'fly-half' | wikisql |
CREATE TABLE table_70101 (
"Tournament" text,
"2007" text,
"2008" text,
"2009" text,
"2010" text,
"2011" text
) | Name the 2009 for 2007 of 2r and tournament of wimbledon | SELECT "2009" FROM table_70101 WHERE "2007" = '2r' AND "Tournament" = 'wimbledon' | wikisql |
CREATE TABLE table_name_51 (
year INTEGER,
best_finish VARCHAR,
scoring_average VARCHAR
) | What is the latest year when the best finish is 2 and the scoring average is less than 71.24? | SELECT MAX(year) FROM table_name_51 WHERE best_finish = "2" AND scoring_average < 71.24 | sql_create_context |
CREATE TABLE gymnast (
gymnast_id number,
floor_exercise_points number,
pommel_horse_points number,
rings_points number,
vault_points number,
parallel_bars_points number,
horizontal_bar_points number,
total_points number
)
CREATE TABLE people (
people_id number,
name text,
a... | Return the age of the person with the greatest height. | SELECT age FROM people ORDER BY height DESC LIMIT 1 | spider |
CREATE TABLE table_name_65 (
place INTEGER,
artist VARCHAR,
televote VARCHAR
) | Which Place is the highest one that has an Artist of nikolas metaxas, and a Televote larger than 60? | SELECT MAX(place) FROM table_name_65 WHERE artist = "nikolas metaxas" AND televote > 60 | sql_create_context |
CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE T... | Top accepted answers per day. | SELECT a.OwnerUserId AS "user_link", COUNT(*) AS "count", v.CreationDate AS "date" FROM Votes AS v, Posts AS q, Posts AS a WHERE v.VoteTypeId = 1 AND v.PostId = a.Id AND q.AcceptedAnswerId = a.Id AND q.OwnerUserId != a.OwnerUserId GROUP BY v.CreationDate, a.OwnerUserId ORDER BY COUNT(*) DESC, v.CreationDate LIMIT 100 | sede |
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
UserId number,
ContentLicense text
)
CREATE TABLE SuggestedEdits (
Id number,
... | user activity by user id and month. | SELECT COUNT(Id) AS n_posts, 1.000 * TIME_TO_STR(CreationDate, '%Y') + 1.000 * TIME_TO_STR(CreationDate, '%m') / 12, OwnerUserId FROM Posts WHERE PostTypeId = 2 GROUP BY OwnerUserId, 1.000 * TIME_TO_STR(CreationDate, '%Y') + 1.000 * TIME_TO_STR(CreationDate, '%m') / 12 ORDER BY 1.000 * TIME_TO_STR(CreationDate, '%Y') +... | sede |
CREATE TABLE table_8069 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text,
"Money ( $ )" real
) | What country is Tom Kite from? | SELECT "Country" FROM table_8069 WHERE "Player" = 'tom kite' | wikisql |
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... | find the gender of subject id 6983. | SELECT demographic.gender FROM demographic WHERE demographic.subject_id = "6983" | mimicsql_data |
CREATE TABLE table_25030512_4 (
district VARCHAR,
incumbent VARCHAR
) | Name the district for spencer bachus | SELECT district FROM table_25030512_4 WHERE incumbent = "Spencer Bachus" | sql_create_context |
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... | 统计医疗记录中医院0652199的出院诊断为H88.444的最低医疗费总额和最高医疗费总额分别是多少钱? | SELECT MIN(MED_AMOUT), MAX(MED_AMOUT) FROM t_kc24 WHERE MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc21 WHERE MED_SER_ORG_NO = '0652199' AND OUT_DIAG_DIS_CD = 'H88.444') | css |
CREATE TABLE table_3903 (
"Standard" text,
"Date" text,
"CO (g/kWh)" text,
"NO x (g/kWh)" text,
"HC (g/kWh)" text,
"PM (g/kWh)" text
) | What's the HC for the standard with NO x of 7.0 g/kWh? | SELECT "HC (g/kWh)" FROM table_3903 WHERE "NO x (g/kWh)" = '7.0' | wikisql |
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
) | For those records from the products and each product's manufacturer, a scatter chart shows the correlation between manufacturer and revenue , and group by attribute founder. | SELECT Manufacturer, Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder | nvbench |
CREATE TABLE table_14633 (
"Rank" real,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | What is the lowest amount of gold a team with less than 2 total medals, ranked 17, and more than 0 silver medals, has? | SELECT MIN("Gold") FROM table_14633 WHERE "Total" < '2' AND "Rank" = '17' AND "Silver" > '0' | wikisql |
CREATE TABLE table_25811 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | Name the record for december 8 | SELECT "Record" FROM table_25811 WHERE "Date" = 'December 8' | wikisql |
CREATE TABLE CLASS (
CLASS_CODE varchar(5),
CRS_CODE varchar(10),
CLASS_SECTION varchar(2),
CLASS_TIME varchar(20),
CLASS_ROOM varchar(8),
PROF_NUM int
)
CREATE TABLE COURSE (
CRS_CODE varchar(10),
DEPT_CODE varchar(10),
CRS_DESCRIPTION varchar(35),
CRS_CREDIT float(8)
)
CREATE... | Show me the proportion on how many different locations does each school have? | SELECT SCHOOL_CODE, COUNT(DISTINCT DEPT_ADDRESS) FROM DEPARTMENT | nvbench |
CREATE TABLE table_30978 (
"Season no." real,
"Series no." real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" real,
"U.S. viewers (millions)" text
) | How many million viewers in the US did the episode titled 'Cadaver' have? | SELECT "U.S. viewers (millions)" FROM table_30978 WHERE "Title" = 'Cadaver' | wikisql |
CREATE TABLE table_name_33 (
result VARCHAR,
score VARCHAR,
city VARCHAR
) | What was the result of the match that took place in Perth, featuring a score of 48-12? | SELECT result FROM table_name_33 WHERE score = "48-12" AND city = "perth" | sql_create_context |
CREATE TABLE table_22603701_1 (
position VARCHAR,
college VARCHAR
) | What are the positions for Menlo College? | SELECT position FROM table_22603701_1 WHERE college = "Menlo college" | sql_create_context |
CREATE TABLE journalist (
journalist_ID int,
Name text,
Nationality text,
Age text,
Years_working int
)
CREATE TABLE event (
Event_ID int,
Date text,
Venue text,
Name text,
Event_Attendance int
)
CREATE TABLE news_report (
journalist_ID int,
Event_ID int,
Work_Type ... | Show me a bar chart for what are the nationalities and total ages of journalists?, and display from low to high by the total number. | SELECT Nationality, SUM(Age) FROM journalist GROUP BY Nationality ORDER BY SUM(Age) | nvbench |
CREATE TABLE table_name_16 (
shooter VARCHAR,
score_points VARCHAR,
event VARCHAR
) | Who got 13 score points at wc kerrville? | SELECT shooter FROM table_name_16 WHERE score_points = "13" AND event = "wc kerrville" | sql_create_context |
CREATE TABLE table_10247 (
"Sun Belt" text,
"Lost" real,
"Tied" real,
"Pct." real,
"Years" real,
"Total Games" real
) | What is the year total for teams with under 37 games tied, over 33 games, and 15 losses? | SELECT SUM("Years") FROM table_10247 WHERE "Tied" < '37' AND "Total Games" > '33' AND "Lost" = '15' | wikisql |
CREATE TABLE table_name_76 (
game INTEGER,
points VARCHAR,
score VARCHAR
) | Which Game is the highest one that has Points smaller than 92, and a Score of 1 3? | SELECT MAX(game) FROM table_name_76 WHERE points < 92 AND score = "1–3" | sql_create_context |
CREATE TABLE table_test_7 (
"id" int,
"bleeding" int,
"left_ventricular_ejection_fraction_lvef" int,
"intra_aortic_balloon_pump_iabp" bool,
"systolic_blood_pressure_sbp" int,
"dialysis" bool,
"intravenous_pressors" bool,
"non_infarct_related_vessel" bool,
"heart_disease" bool,
"b... | age >= 75 or < 18 | SELECT * FROM table_test_7 WHERE age >= 75 OR age < 18 | criteria2sql |
CREATE TABLE table_name_40 (
total INTEGER,
to_par VARCHAR
) | What is the highest total to par of +9? | SELECT MAX(total) FROM table_name_40 WHERE to_par = "+9" | sql_create_context |
CREATE TABLE t_kc21_t_kc22 (
MED_CLINIC_ID text,
MED_EXP_DET_ID number
)
CREATE TABLE t_kc21 (
CLINIC_ID text,
CLINIC_TYPE text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD ... | 查查编码为20724976的病人被开出过金额不低于7866.88元的医疗记录,看看这些医疗就诊的编号 | SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_ID = '20724976' AND t_kc21.MED_CLINIC_ID IN (SELECT t_kc21_t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT >= 7866.88) | css |
CREATE TABLE table_83 (
"Particulars and Characteristics" text,
"Shivalik Zone" text,
"Mid-Hill Zone" text,
"High hill zone" text,
"Trance- n Himalaya Zone" text
) | What is the percentage of the trance- n himalaya zone that corresponds with the high hill zone is 25%? | SELECT "Trance- n Himalaya Zone" FROM table_83 WHERE "High hill zone" = '25%' | wikisql |
CREATE TABLE table_41489 (
"Position" real,
"Team" text,
"Points" real,
"Played" real,
"Drawn" real,
"Lost" real,
"Against" real,
"Difference" text
) | What is the sum of Against when the drawn is less than 2, the position is more than 8, and the lost is more than 6. | SELECT SUM("Against") FROM table_41489 WHERE "Drawn" < '2' AND "Position" > '8' AND "Lost" > '6' | wikisql |
CREATE TABLE table_1341718_44 (
district VARCHAR,
incumbent VARCHAR
) | Which district elected incumbent Earle Cabell? | SELECT district FROM table_1341718_44 WHERE incumbent = "Earle Cabell" | sql_create_context |
CREATE TABLE table_name_38 (
year VARCHAR,
attendance VARCHAR
) | What year had an attendance of 90,000? | SELECT year FROM table_name_38 WHERE attendance = "90,000" | sql_create_context |
CREATE TABLE table_75312 (
"Season" text,
"Season Premiere" text,
"Season Finale" text,
"Winner" text,
"Runner-up" text,
"Number of Contestants" real,
"Winner's Country" text,
"Runner Up's Country" text
) | What season's premiere had puerto rico winning on May 20, 2012? | SELECT "Season Premiere" FROM table_75312 WHERE "Winner's Country" = 'puerto rico' AND "Season Finale" = 'may 20, 2012' | wikisql |
CREATE TABLE t_kc21_t_kc22 (
MED_CLINIC_ID text,
MED_EXP_DET_ID number
)
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,
C... | 这个药品201992217在医疗就诊42375139103中的使用频次和每次用量都是多少呀? | SELECT t_kc22.USE_FRE, t_kc22.EACH_DOSAGE FROM t_kc22 JOIN t_kc21_t_kc22 JOIN t_kc21 ON t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID AND t_kc21_t_kc22.MED_CLINIC_ID = t_kc21.MED_CLINIC_ID WHERE t_kc21.MED_CLINIC_ID = '42375139103' AND t_kc22.SOC_SRT_DIRE_CD = '201992217' | css |
CREATE TABLE state (
state_code text,
state_name text,
country_name text
)
CREATE TABLE restriction (
restriction_code text,
advance_purchase int,
stopovers text,
saturday_stay_required text,
minimum_stay int,
maximum_stay int,
application text,
no_discounts text
)
CREATE T... | what are the fares from NEWARK to LOS ANGELES monday and wednesday | SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day AS DATE_DAY_0, date_day AS DATE_DAY_1, days AS DAYS_0, days AS DAYS_1, fare, fare_basis, flight AS FLIGHT_0, flight AS FLIGHT_1, flight_fare AS FLIGHT_FARE, flight_fare ... | atis |
CREATE TABLE table_29012710_1 (
number_of_dairy_cows INTEGER,
province VARCHAR
) | what is the most amount of cattle where they live in british columbia | SELECT MAX(number_of_dairy_cows) FROM table_29012710_1 WHERE province = "British Columbia" | sql_create_context |
CREATE TABLE table_44426 (
"Year" real,
"Imports (tonnes)" real,
"Exports (tonnes)" real,
"Total trade (tonnes)" real,
"Vessels entering port" real
) | What is the total number of Total trade (tonnes) when the Imports is smaller than 114,287 tonnes and the year is higher than 2008? | SELECT COUNT("Total trade (tonnes)") FROM table_44426 WHERE "Imports (tonnes)" < '114,287' AND "Year" > '2008' | wikisql |
CREATE TABLE table_name_23 (
draw INTEGER,
lost VARCHAR
) | For entries with a lost of 5, what is the sum of the draw entry? | SELECT SUM(draw) FROM table_name_23 WHERE lost = 5 | sql_create_context |
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,
ZYLBDM text,
ZYMC text
)
CREATE TABLE mzjzjlb (
HXPLC number,
HZXM ... | 68211216患者的身高与体重分别多少? | SELECT mzjzjlb.SG, mzjzjlb.TZ FROM hz_info JOIN mzjzjlb JOIN person_info_hz_info JOIN person_info ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND person_info_hz_info.KH = hz_info.KH AND person_info_hz_info.KLX = hz_info.KLX AND person_info_hz_info.YLJGDM = hz_info.YLJGDM... | css |
CREATE TABLE member_of (
facid number,
dno number,
appt_type text
)
CREATE TABLE student (
stuid number,
lname text,
fname text,
age number,
sex text,
major number,
advisor number,
city_code text
)
CREATE TABLE department (
dno number,
division text,
dname text,... | What are the full names of students minoring in department 140? | SELECT T2.fname, T2.lname FROM minor_in AS T1 JOIN student AS T2 ON T1.stuid = T2.stuid WHERE T1.dno = 140 | spider |
CREATE TABLE table_name_57 (
venue VARCHAR,
away_team VARCHAR
) | Which venue does Fitzroy play as an away team? | SELECT venue FROM table_name_57 WHERE away_team = "fitzroy" | sql_create_context |
CREATE TABLE jybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH text,
BGJGDM text,
BGJGMC text,
BGRGH text,
BGRQ time,
BGRXM text,
BGSJ time,
CJRQ time,
JSBBRQSJ time,
JSBBSJ time,
JYBBH text,
JYJGMC text,
JYJSGH text,
JYJSQM text,
JY... | 检验报告单24571107359是哪个患者门诊就诊中开出的 | SELECT hz_info.person_info_XM FROM hz_info JOIN mzjzjlb JOIN jybgb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE jybgb.BGDH = '24571107359' | css |
CREATE TABLE table_52698 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What team was the away team when the home team scored 9.10 (64)? | SELECT "Away team" FROM table_52698 WHERE "Home team score" = '9.10 (64)' | wikisql |
CREATE TABLE table_name_8 (
Id VARCHAR
) | What was the result in 2013 in the tournament whose 2010 result was q2? | SELECT 2013 FROM table_name_8 WHERE 2010 = "q2" | sql_create_context |
CREATE TABLE table_name_81 (
frequency VARCHAR,
power VARCHAR
) | What is the frequency with 900w power? | SELECT frequency FROM table_name_81 WHERE power = "900w" | sql_create_context |
CREATE TABLE table_29012710_1 (
production__hectolitres_ VARCHAR,
province VARCHAR
) | what is the amount where the area is new brunswick | SELECT production__hectolitres_ FROM table_29012710_1 WHERE province = "New Brunswick" | sql_create_context |
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,
... | 从08.12.31开始,截止到13.11.25,药品908952总共被医院开出给患者朱涵蓄多少次 | SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 JOIN t_kc21_t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc22.MED_CLINIC_ID AND t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID WHERE t_kc21.PERSON_NM = '朱涵蓄' AND t_kc22.STA_DATE BETWEEN '2008-12-31' AND '2013-11-25' AND t_kc22.SOC_SRT_DIRE_CD = '908952' | css |
CREATE TABLE table_22380 (
"Species" text,
"Common name" text,
"Trinidad" text,
"Tobago" text,
"Bocas Is." text,
"Other" text
) | Name the trinidad for yellow-bellied puffing snake | SELECT "Trinidad" FROM table_22380 WHERE "Common name" = 'Yellow-bellied puffing snake' | wikisql |
CREATE TABLE table_41168 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Leading scorer" text,
"Record" text
) | What is the score of the home game for the Cavaliers where Lebron James (46) was the lead scorer? | SELECT "Score" FROM table_41168 WHERE "Home" = 'cavaliers' AND "Leading scorer" = 'lebron james (46)' | wikisql |
CREATE TABLE table_name_55 (
year VARCHAR,
role VARCHAR
) | In what Year is there a Role of (cameo)? | SELECT year FROM table_name_55 WHERE role = "(cameo)" | sql_create_context |
CREATE TABLE rooms (
roomid text,
roomname text,
beds number,
bedtype text,
maxoccupancy number,
baseprice number,
decor text
)
CREATE TABLE reservations (
code number,
room text,
checkin text,
checkout text,
rate number,
lastname text,
firstname text,
adults... | What are the bed type and name of all the rooms with traditional decor? | SELECT roomname, bedtype FROM rooms WHERE decor = "traditional" | spider |
CREATE TABLE table_8746 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" text
) | What was the result of the week 13 game? | SELECT "Result" FROM table_8746 WHERE "Week" = '13' | wikisql |
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
... | All the Minecraft Questions and Answers. | SELECT q.Id, q.Title, q.Body, q.Score, q.OwnerUserId, q.CreationDate, t.Name AS Type, u.Reputation, u.DisplayName, u.Location, '' AS ParentId, q.AcceptedAnswerId FROM Posts AS q INNER JOIN PostTypes AS t ON q.PostTypeId = t.Id INNER JOIN Users AS u ON q.OwnerUserId = u.Id WHERE q.Title LIKE '%minecraft%' OR q.Tags LIKE... | sede |
CREATE TABLE table_66844 (
"Sunday" text,
"Monday" text,
"Tuesday" text,
"Wednesday" text,
"Thursday" text,
"Friday" text,
"Saturday" text
) | Which Thursday has a Wednesday of xingqisen? | SELECT "Thursday" FROM table_66844 WHERE "Wednesday" = '星期三 xingqisen' | wikisql |
CREATE TABLE table_name_87 (
ball_diameter VARCHAR,
location VARCHAR,
period VARCHAR
) | What's the Ball Diameter with the Location oof El Manati, and the Period of 1200 BCE? | SELECT ball_diameter FROM table_name_87 WHERE location = "el manati" AND period = "1200 bce" | 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... | how many patients have been diagnosed with unspecified pseudomonas infection? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.short_title = "Pseudomonas infect NOS" | mimicsql_data |
CREATE TABLE table_23117208_5 (
no_in_series VARCHAR,
directed_by VARCHAR
) | For the episode directed by Matthew Penn, what is the total number in the series? | SELECT no_in_series FROM table_23117208_5 WHERE directed_by = "Matthew Penn" | sql_create_context |
CREATE TABLE table_48223 (
"Rank" real,
"Player" text,
"Years" text,
"Games" real,
"Reb. Avg." real,
"Total Rebounds" real
) | Which years have a rank less than 2? | SELECT "Years" FROM table_48223 WHERE "Rank" < '2' | wikisql |
CREATE TABLE table_25512 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text
) | How many people wrote episode 68 in the series? | SELECT COUNT("Written by") FROM table_25512 WHERE "No. in series" = '68' | wikisql |
CREATE TABLE table_name_7 (
nba_draft VARCHAR,
school VARCHAR
) | What was the NBA draft status for Northeast High School? | SELECT nba_draft FROM table_name_7 WHERE school = "northeast high school" | sql_create_context |
CREATE TABLE table_47776 (
"Rank" real,
"Company" text,
"Headquarters" text,
"Industry" text,
"Sales (billion $)" real,
"Profits (billion $)" real,
"Assets (billion $)" real,
"Market Value (billion $)" real
) | What was Germany's lowest sales when the profit was smaller than 6.7 billion? | SELECT MIN("Sales (billion $)") FROM table_47776 WHERE "Headquarters" = 'germany' AND "Profits (billion $)" < '6.7' | wikisql |
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 mzjzjlb (
YLJGDM text,
JZLSH ... | 检验结果指标记录46721684467的设备编码是什么?仪器编号是什么?名称是什么? | SELECT SBBM, YQBH, YQMC FROM jyjgzbb WHERE JYZBLSH = '46721684467' | css |
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
UserId number,
ContentLicense text
)
... | Progress towards Curious, Inquisitive and Socratic badges. How far are you towards the Curious, Inquisitive and Socratic badges? You need to count the days on which you had only positive questions, and no downvoted or closed questions. We cannot see deleted questions here so the count is going to be inaccurate, nor doe... | WITH ask_days AS (SELECT DATEADD(day, DATEDIFF(day, @epoch, CreationDate), @epoch) AS day, MIN(Score) AS worst, MAX(Score) AS best, COUNT(CASE WHEN NOT ClosedDate IS NULL AND DATEDIFF(day, CreationDate, ClosedDate) <= 60 THEN 1 ELSE NULL END) AS closed FROM Posts WHERE PostTypeId = 1 AND OwnerUserId IN ('##UserId##') G... | sede |
CREATE TABLE table_203_218 (
id number,
"pos" number,
"class" text,
"no" number,
"team" text,
"drivers" text,
"chassis" text,
"engine" text,
"laps" number
) | was the team that had the most laps above or below 250 ? | SELECT (SELECT MAX("laps") FROM table_203_218) > 250 | squall |
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 whose discharge location is disch-tran to psych hosp and diagnoses short title is chest pain nec? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.discharge_location = "DISCH-TRAN TO PSYCH HOSP" AND diagnoses.short_title = "Chest pain NEC" | mimicsql_data |
CREATE TABLE table_name_8 (
pada_1 VARCHAR,
pada_2 VARCHAR
) | What kind of Pada 1 has a Pada 2 of sa? | SELECT pada_1 FROM table_name_8 WHERE pada_2 = "सा sa" | sql_create_context |
CREATE TABLE table_204_276 (
id number,
"record" text,
"date" text,
"result" text,
"opponent" text,
"location" text,
"method" text,
"round" number
) | which location is listed the most according to this chart ? | SELECT "location" FROM table_204_276 GROUP BY "location" 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, visualize a bar chart about the distribution of name and code , and group by attribute name. | SELECT T1.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name, T1.Name | nvbench |
CREATE TABLE table_name_16 (
winners VARCHAR,
runners_up VARCHAR
) | Who was the winner in the competition in which the runner-up was Rosenborg? | SELECT winners FROM table_name_16 WHERE runners_up = "rosenborg" | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.