context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
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 procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
... | how many patients stayed in hospital for more than 17 days and used the drug potassium phosphate? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.days_stay > "17" AND prescriptions.drug = "Potassium Phosphate" | mimicsql_data |
CREATE TABLE table_name_10 (
position VARCHAR,
overall VARCHAR,
college VARCHAR
) | What position went lower than 106 from the College of Virginia? | SELECT position FROM table_name_10 WHERE overall < 106 AND college = "virginia" | sql_create_context |
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDisplayName text... | Golden Tag Badges of the site. | SELECT ROW_NUMBER() OVER (ORDER BY Badges.UserId) AS Row, Badges.UserId AS "user_link", Tags.TagName AS "tagname", Badges.Date AS Date FROM Badges, Tags WHERE Badges.TagBased = 1 AND Badges.Class = 1 AND Badges.Name = Tags.TagName ORDER BY Badges.UserId, Badges.Date | sede |
CREATE TABLE tags (
id int,
msid int,
kid int
)
CREATE TABLE cast (
id int,
msid int,
aid int,
role text
)
CREATE TABLE director (
did int,
gender text,
name text,
nationality text,
birth_city text,
birth_year int
)
CREATE TABLE copyright (
id int,
msid int... | Find all movies featuring ' Kate Winslet | SELECT movie.title FROM actor, cast, movie WHERE actor.name = 'Kate Winslet' AND cast.aid = actor.aid AND movie.mid = cast.msid | imdb |
CREATE TABLE table_63427 (
"Rank" real,
"Player" text,
"Goals" real,
"Apps" real,
"Rate" real
) | What is the total Rank for mit karan when Apps is more than 39 and Rate is more than 0.58? | SELECT SUM("Rank") FROM table_63427 WHERE "Apps" > '39' AND "Player" = 'ümit karan' AND "Rate" > '0.58' | wikisql |
CREATE TABLE table_46079 (
"Name" text,
"Born-Died" text,
"Term start" text,
"Term end" text,
"Political Party" text
) | What is Born-Died, when Name is Maliq Bushati? | SELECT "Born-Died" FROM table_46079 WHERE "Name" = 'maliq bushati' | wikisql |
CREATE TABLE employees (
salary VARCHAR,
manager_id VARCHAR
) | Find the salary and manager number for those employees who is working under a manager. | SELECT salary, manager_id FROM employees WHERE manager_id <> "null" | sql_create_context |
CREATE TABLE table_69015 (
"Year" text,
"Venue" text,
"Winners" text,
"Runner-up" text,
"3rd place" text
) | what shows for 3rd place in 1990? | SELECT "3rd place" FROM table_69015 WHERE "Year" = '1990' | wikisql |
CREATE TABLE table_14382 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" real,
"Record" text
) | Tell me the record for the date of August 18. | SELECT "Record" FROM table_14382 WHERE "Date" = 'august 18' | wikisql |
CREATE TABLE t_kc21 (
CLINIC_ID text,
CLINIC_TYPE text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
... | 在2001年4月20日到2004年12月7日这段时间里,列出病患90461367在医院5572160中被开出全部的药品名称和编码分别是什么呢? | SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc22 WHERE t_kc22.MED_CLINIC_ID IN (SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_ID = '90461367' AND t_kc21.MED_SER_ORG_NO = '5572160' AND t_kc21.IN_HOSP_DATE BETWEEN '2001-04-20' AND '2004-12-07') | 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... | count the number of patients whose days of hospital stay is greater than 69 and drug code is myco500i? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.days_stay > "69" AND prescriptions.formulary_drug_cd = "MYCO500I" | mimicsql_data |
CREATE TABLE program_course (
program_id int,
course_id int,
workload int,
category varchar
)
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE com... | Are there any 500 -level classes offered in the Spring or Summer term ? | SELECT DISTINCT course.department, course.name, course.number, semester.semester FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'department0' AND course.number BETWEEN 500 AND 500 + 100 AND semester.semester IN ('SP', 'SU', 'SS') AND semester.semester_i... | advising |
CREATE TABLE table_61723 (
"Name" text,
"Country" text,
"Type" text,
"Moving from" text,
"Transfer window" text,
"Ends" text,
"Transfer fee" text,
"Source" text
) | What is the type that ends in 2009? | SELECT "Type" FROM table_61723 WHERE "Ends" = '2009' | wikisql |
CREATE TABLE table_203_149 (
id number,
"pick" number,
"player" text,
"team" text,
"position" text,
"school" text
) | steve hosey was picked above or below mo vaughn ? | SELECT (SELECT "pick" FROM table_203_149 WHERE "player" = 'steve hosey') < (SELECT "pick" FROM table_203_149 WHERE "player" = 'mo vaughn') | squall |
CREATE TABLE table_name_90 (
club VARCHAR,
venue VARCHAR,
established VARCHAR,
sport VARCHAR
) | What is the Club that has an Established more than 2000 for soccer plated in kuntz stadium? | SELECT club FROM table_name_90 WHERE established > 2000 AND sport = "soccer" AND venue = "kuntz stadium" | sql_create_context |
CREATE TABLE party (
Party_ID int,
Minister text,
Took_office text,
Left_office text,
Region_ID int,
Party_name text
)
CREATE TABLE region (
Region_ID int,
Region_name text,
Date text,
Label text,
Format text,
Catalogue text
)
CREATE TABLE party_events (
Event_ID in... | How many parties of the time they leave office, binning the leave office into WEEKDAY interval, display by the how many left office in descending please. | SELECT Left_office, COUNT(Left_office) FROM party ORDER BY COUNT(Left_office) DESC | nvbench |
CREATE TABLE table_name_70 (
court_rank VARCHAR,
courtesy_title VARCHAR
) | What is the court rank of the person with a courtesy title of nagato-no-kami? | SELECT court_rank FROM table_name_70 WHERE courtesy_title = "nagato-no-kami" | sql_create_context |
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
... | when was the last time patient 11688 was admitted into the hospital in 2104? | SELECT admissions.admittime FROM admissions WHERE admissions.subject_id = 11688 AND STRFTIME('%y', admissions.admittime) = '2104' ORDER BY admissions.admittime DESC LIMIT 1 | mimic_iii |
CREATE TABLE table_53134 (
"Driver" text,
"Constructor" text,
"Laps" text,
"Time/Retired" text,
"Grid" text
) | Which laps has a grid of 8? | SELECT "Laps" FROM table_53134 WHERE "Grid" = '8' | wikisql |
CREATE TABLE table_name_81 (
event VARCHAR,
competition VARCHAR
) | Which event was part of the World Cross Country championships? | SELECT event FROM table_name_81 WHERE competition = "world cross country championships" | 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... | give me the number of patients who have been diagnosed with tobacco use disorder and had closed biopsy of skin and subcutaneous tissue procedure. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE diagnoses.short_title = "Tobacco use disorder" AND procedures.long_title = "Closed biopsy of skin and subcutaneous tissue... | mimicsql_data |
CREATE TABLE t_kc22 (
AMOUNT number,
CHA_ITEM_LEV number,
DATA_ID text,
DIRE_TYPE number,
DOSE_FORM text,
DOSE_UNIT text,
EACH_DOSAGE text,
EXP_OCC_DATE time,
FLX_MED_ORG_ID text,
FXBZ number,
HOSP_DOC_CD text,
HOSP_DOC_NM text,
MED_DIRE_CD text,
MED_DIRE_NM text,... | 医院编码4079416全部医疗记录的个人账户支出对比医疗费总额在2012年9月11日到2014年12月7日这个时间段内有多大平均比值? | SELECT AVG(t_kc24.PER_ACC_PAY) FROM t_kc21 JOIN t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '4079416' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2012-09-11' AND '2014-12-07' | css |
CREATE TABLE table_name_13 (
week INTEGER,
game_site VARCHAR,
attendance VARCHAR
) | What week did the Jets play in the meadowlands with and attendance of 78,161? | SELECT SUM(week) FROM table_name_13 WHERE game_site = "the meadowlands" AND attendance = "78,161" | sql_create_context |
CREATE TABLE table_6639 (
"Series Ep." text,
"Episode" real,
"Segment A" text,
"Segment B" text,
"Segment C" text,
"Segment D" text
) | What segment A is associated with a Segment D of manual motorcycle transmissions? | SELECT "Segment A" FROM table_6639 WHERE "Segment D" = 'manual motorcycle transmissions' | wikisql |
CREATE TABLE table_17355408_12 (
game VARCHAR,
record VARCHAR
) | What game was the record 2-3? | SELECT COUNT(game) FROM table_17355408_12 WHERE record = "2-3" | sql_create_context |
CREATE TABLE table_18258 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
) | how many candidates with result being retired to run for u. s. senate republican hold | SELECT COUNT("Candidates") FROM table_18258 WHERE "Result" = 'Retired to run for U. S. Senate Republican hold' | wikisql |
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE course_offering (
offering_id int,
course_id int,
semester int,
section_number ... | Name the professors who teach 560 other than Prof. Joseph Doman . | SELECT DISTINCT instructor.name FROM course, course_offering, instructor, offering_instructor WHERE course.course_id = course_offering.course_id AND course.department = 'EECS' AND course.number = 560 AND NOT instructor.name LIKE '%Joseph Doman%' AND offering_instructor.instructor_id = instructor.instructor_id AND offer... | advising |
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 death status is 1 and diagnoses short title is proteus infection nos? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.expire_flag = "1" AND diagnoses.short_title = "Proteus infection NOS" | 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 procedures (
... | how many patients are admitted newborn and have a discharge location of disch-tran to psych hosp? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "NEWBORN" AND demographic.discharge_location = "DISCH-TRAN TO PSYCH HOSP" | mimicsql_data |
CREATE TABLE table_45051 (
"Season" text,
"Races" real,
"Wins" real,
"Podiums" real,
"Poles" real,
"Fastest Laps" real
) | What is the highest number of the fastest laps when there were 0 poles, more than 2 podiums, and more than 15 races? | SELECT MAX("Fastest Laps") FROM table_45051 WHERE "Poles" = '0' AND "Races" > '15' AND "Podiums" > '2' | wikisql |
CREATE TABLE table_2610582_7 (
frequency VARCHAR,
callsign VARCHAR
) | What frequency is dxec-fm? | SELECT frequency FROM table_2610582_7 WHERE callsign = "DXEC-FM" | sql_create_context |
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDisplayName text... | Histogram of order of magnitude of answer character count. | SELECT FLOOR(LOG(10, LENGTH(Body))), COUNT(*) FROM Posts WHERE PostTypeId = 2 GROUP BY FLOOR(LOG(10, LENGTH(Body))) ORDER BY FLOOR(LOG(10, LENGTH(Body))) | sede |
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)
CREATE TABLE equipment_sequence (
aircraft_code_sequence varchar,
aircraft_code varchar
)
CREATE TABLE flight_stop (
flight_id int,
stop_number int,
... | list all round trip fares from ST. PETERSBURG to WASHINGTON | 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 = 'ST. PETERSBURG' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY... | atis |
CREATE TABLE table_20771 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Ground" text,
"Crowd" real,
"Date" text
) | What was the away team score for the game with a crowd of 5391? | SELECT "Away team score" FROM table_20771 WHERE "Crowd" = '5391' | wikisql |
CREATE TABLE table_54826 (
"Year" real,
"Award" text,
"Category" text,
"Film or series" text,
"Result" text
) | Which category won the Sundance Film Festival award in 1998? | SELECT "Category" FROM table_54826 WHERE "Result" = 'won' AND "Year" = '1998' AND "Award" = 'sundance film festival' | wikisql |
CREATE TABLE table_36840 (
"149." real,
"9 February" text,
"Friendly" text,
"Israel" text,
"Croatia" text
) | Which Croatia has a Friendly of world cup 2006 qualifier, and a 149 of 152? | SELECT "Croatia" FROM table_36840 WHERE "Friendly" = 'world cup 2006 qualifier' AND "149." = '152' | wikisql |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE medication (
me... | what percentile is the value of the pt of 17.4 among patients of the same age as patient 011-14590 during the first hospital visit? | SELECT DISTINCT t1.c1 FROM (SELECT lab.labresult, PERCENT_RANK() OVER (ORDER BY lab.labresult) AS c1 FROM lab WHERE lab.labname = 'pt' AND lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age = (SELECT patient.age FROM patient WHERE patient.uniquepid = '011-14590' AND NOT patient.ho... | eicu |
CREATE TABLE table_name_23 (
pick INTEGER,
round VARCHAR,
position VARCHAR
) | What was the lowest pick for the kicker after round 12? | SELECT MIN(pick) FROM table_name_23 WHERE round > 12 AND position = "kicker" | 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... | find the age and name of patient with patient id 94762. | SELECT demographic.name, demographic.age FROM demographic WHERE demographic.subject_id = "94762" | mimicsql_data |
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,
... | what is maximum days of hospital stay of patients whose primary disease is bladder cancer/sda? | SELECT MAX(demographic.days_stay) FROM demographic WHERE demographic.diagnosis = "BLADDER CANCER/SDA" | mimicsql_data |
CREATE TABLE table_25262 (
"Week #" text,
"Theme" text,
"Song choice" text,
"Original artist" text,
"Order #" text,
"Result" text
) | What is the result if Coba is the song choice? | SELECT "Result" FROM table_25262 WHERE "Song choice" = 'Coba' | wikisql |
CREATE TABLE table_44827 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text,
"Money ( $ )" text
) | What country has to par E with Mark O'Meara? | SELECT "Country" FROM table_44827 WHERE "To par" = 'e' AND "Player" = 'mark o''meara' | wikisql |
CREATE TABLE ship (
Ship_ID int,
Name text,
Type text,
Nationality text,
Tonnage int
)
CREATE TABLE mission (
Mission_ID int,
Ship_ID int,
Code text,
Launched_Year int,
Location text,
Speed_knots int,
Fate text
) | Show me the comparison of the total number of all ships' nationalities with a bar graph, and order Nationality in asc order. | SELECT Nationality, COUNT(Nationality) FROM ship GROUP BY Nationality ORDER BY Nationality | nvbench |
CREATE TABLE table_28190534_1 (
chassis VARCHAR,
driver VARCHAR
) | Name the chassis for b. bira | SELECT chassis FROM table_28190534_1 WHERE driver = "B. Bira" | sql_create_context |
CREATE TABLE zyb (
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... | 在00年3月18日到21年5月7日这段时间参保编号为32352612的患者门诊手术费用是多些? | SELECT SUM(t_kc22.AMOUNT) FROM t_kc22 JOIN mzb ON mzb.MED_ORG_DEPT_CD = t_kc22.MED_CLINIC_ID WHERE mzb.PERSON_NM = '32352612' AND t_kc22.STA_DATE BETWEEN '2000-03-18' AND '2021-05-07' AND t_kc22.MED_INV_ITEM_TYPE = '手术费' | css |
CREATE TABLE table_name_53 (
kickoff_time VARCHAR,
week VARCHAR
) | What was the kickoff time on week 1? | SELECT kickoff_time FROM table_name_53 WHERE week = 1 | sql_create_context |
CREATE TABLE table_34845 (
"Tournament" text,
"1981" text,
"1982" text,
"1983" text,
"1984" text,
"1985" text,
"1986" text,
"1987" text,
"1988" text,
"1989" text
) | Which 1983 has a Tournament of wimbledon? | SELECT "1983" FROM table_34845 WHERE "Tournament" = 'wimbledon' | wikisql |
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event... | what was the total chlorpromazine dose that was prescribed since 15 months ago to patient 76275? | SELECT SUM(prescriptions.dose_val_rx) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 76275) AND prescriptions.drug = 'chlorpromazine' AND DATETIME(prescriptions.startdate) >= DATETIME(CURRENT_TIME(), '-15 month') | mimic_iii |
CREATE TABLE table_203_855 (
id number,
"date" text,
"city" text,
"venue" text,
"member" text,
"performance" text,
"notes" text
) | when was the first tour date of 2010 ? | SELECT "date" FROM table_203_855 ORDER BY "date" LIMIT 1 | squall |
CREATE TABLE table_46050 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Record" text
) | What was the score on January 14 when the Chicago Black Hawks were home against the New York Rangers? | SELECT "Score" FROM table_46050 WHERE "Home" = 'chicago black hawks' AND "Visitor" = 'new york rangers' AND "Date" = 'january 14' | wikisql |
CREATE TABLE Rating (
rID int,
mID int,
stars int,
ratingDate date
)
CREATE TABLE Reviewer (
rID int,
name text
)
CREATE TABLE Movie (
mID int,
title text,
year int,
director text
) | What are the titles of all movies that have between 3 and 5 stars, and count them by a bar chart | SELECT title, COUNT(title) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID WHERE T1.stars BETWEEN 3 AND 5 GROUP BY title | nvbench |
CREATE TABLE table_name_84 (
grid INTEGER,
driver VARCHAR
) | Tell me the sum of Grid for giancarlo fisichella | SELECT SUM(grid) FROM table_name_84 WHERE driver = "giancarlo fisichella" | sql_create_context |
CREATE TABLE table_name_9 (
genre VARCHAR,
year VARCHAR,
platform_s_ VARCHAR
) | What is the genre for 2009 on Playstation 3? | SELECT genre FROM table_name_9 WHERE year > 2009 AND platform_s_ = "playstation 3" | sql_create_context |
CREATE TABLE table_202_150 (
id number,
"election" number,
"member" text,
"party" text
) | how many members identified with the liberal party ? | SELECT COUNT("member") FROM table_202_150 WHERE "party" = 'liberal' | squall |
CREATE TABLE table_203_390 (
id number,
"year" number,
"venue" text,
"winners" text,
"runner-up" text,
"3rd place" text
) | what was the last year 3rd place finished with less than 25 points ? | SELECT "year" FROM table_203_390 WHERE "3rd place" < 25 ORDER BY "year" DESC LIMIT 1 | squall |
CREATE TABLE date_day (
month_number int,
day_number int,
year int,
day_name varchar
)
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE month (
month_number int,
month_name text
)
CREATE TABLE ground_service (
city_code text,
airport_co... | show me round trips from HOUSTON to LAS VEGAS nonstop | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, flight, flight_fare WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'LAS VEGAS' AND NOT fare.round_trip_cost IS NULL AND flight_fare.fare_... | atis |
CREATE TABLE table_204_185 (
id number,
"location" text,
"town" text,
"output (mw ac)" number,
"modules" number,
"number of arrays" number
) | what is the next town after riverside ? | SELECT "town" FROM table_204_185 WHERE id = (SELECT id FROM table_204_185 WHERE "town" = 'riverside') + 1 | squall |
CREATE TABLE table_11986 (
"Rank" real,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | What is the highest metal total when there are 2 Gold medals, 0 Bronze metals, and the rank is smaller than 2? | SELECT MAX("Total") FROM table_11986 WHERE "Gold" = '2' AND "Bronze" = '0' AND "Rank" < '2' | wikisql |
CREATE TABLE table_62997 (
"Pick" real,
"Team" text,
"Player" text,
"Position" text,
"College" text
) | What was the highest pick number of the player who went to LSU in college? | SELECT MAX("Pick") FROM table_62997 WHERE "College" = 'lsu' | wikisql |
CREATE TABLE table_61758 (
"Position" real,
"Club" text,
"Played" real,
"Points" real,
"Wins" real,
"Draws" real,
"Losses" real,
"Goals for" real,
"Goals against" real,
"Goal Difference" real
) | What were the highest goals against when the position was larger than 19 and the goals smaller than 36? | SELECT MAX("Goals against") FROM table_61758 WHERE "Position" > '19' AND "Goals for" < '36' | wikisql |
CREATE TABLE table_2013618_1 (
traditional VARCHAR,
area VARCHAR
) | Name the traditional for area 544 | SELECT traditional FROM table_2013618_1 WHERE area = 544 | sql_create_context |
CREATE TABLE table_204_197 (
id number,
"date" text,
"time" text,
"opponent#" text,
"site" text,
"tv" text,
"result" text,
"attendance" number
) | were there any games that were played before 6 pm ? | SELECT (SELECT COUNT(*) FROM table_204_197 WHERE "time" < 6) > 0 | squall |
CREATE TABLE table_15826 (
"Ranking" real,
"Nationality" text,
"Name" text,
"Years" text,
"Goals" real
) | What was the average ranking of Saudi Arabia in the years of 2000 ? | SELECT AVG("Ranking") FROM table_15826 WHERE "Nationality" = 'saudi arabia' AND "Years" = '2000–' | wikisql |
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmoun... | Number of users from INDIA. | SELECT COUNT(*) FROM Users WHERE Location LIKE '%India%' | sede |
CREATE TABLE table_11148572_1 (
mls_cup_winner VARCHAR,
mls_supporters_shield_runner_up VARCHAR
) | What is the name of the shield winner in which the mls cup winner and mls supporters shield runner up is Chivas usa? | SELECT mls_cup_winner FROM table_11148572_1 WHERE mls_supporters_shield_runner_up = "Chivas USA" | sql_create_context |
CREATE TABLE table_73056 (
"Game" real,
"Date" text,
"Opponent" text,
"Result" text,
"Giants points" real,
"Opponents" real,
"Record" text,
"Attendance" real
) | What is the record when the opponent is washington redskins? | SELECT "Record" FROM table_73056 WHERE "Opponent" = 'Washington Redskins' | wikisql |
CREATE TABLE Visitors (
Tourist_ID INTEGER,
Tourist_Details VARCHAR(255)
)
CREATE TABLE Ref_Hotel_Star_Ratings (
star_rating_code CHAR(15),
star_rating_description VARCHAR(80)
)
CREATE TABLE Hotels (
hotel_id INTEGER,
star_rating_code CHAR(15),
pets_allowed_yn CHAR(1),
price_range real... | Give me a histogram for what are the names and ids of the tourist attractions that are visited at most once?, and rank in asc by the y-axis. | SELECT T1.Name, T1.Tourist_Attraction_ID FROM Tourist_Attractions AS T1 JOIN Visits AS T2 ON T1.Tourist_Attraction_ID = T2.Tourist_Attraction_ID ORDER BY T1.Tourist_Attraction_ID | nvbench |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic ... | count the number of phys referral/normal deli patients who were admitted before 2176. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "PHYS REFERRAL/NORMAL DELI" AND demographic.admityear < "2176" | mimicsql_data |
CREATE TABLE table_22317 (
"No." real,
"#" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Canadian air date" text,
"U.S. air date" text,
"Production code" real,
"Canadian viewers (million)" text
) | Which episodes had production code 217? | SELECT "Title" FROM table_22317 WHERE "Production code" = '217' | wikisql |
CREATE TABLE table_66144 (
"Model number" text,
"sSpec number" text,
"Cores" text,
"Frequency" text,
"Turbo" text,
"L2 cache" text,
"L3 cache" text,
"GPU model" text,
"GPU frequency" text,
"Socket" text,
"I/O bus" text,
"Release date" text,
"Part number(s)" text,
... | What is the frequency of the processor released at $383, with a sSpec of sr15f(c0)? | SELECT "Frequency" FROM table_66144 WHERE "Release price ( USD )" = '$383' AND "sSpec number" = 'sr15f(c0)' | wikisql |
CREATE TABLE table_60547 (
"Player" text,
"Position" text,
"Ekstraklasa" real,
"Polish Cup" real,
"UEFA Cup" real,
"Total" real
) | What is the total number of UEFA Cup(s), when Total is greater than 3? | SELECT COUNT("UEFA Cup") FROM table_60547 WHERE "Total" > '3' | 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 diagnoses (
... | count the number of patients whose ethnicity is hispanic/latino - puerto rican and drug name is lidocaine-prilocaine? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "HISPANIC/LATINO - PUERTO RICAN" AND prescriptions.drug = "Lidocaine-Prilocaine" | mimicsql_data |
CREATE TABLE table_name_28 (
final_score VARCHAR,
attendance VARCHAR
) | What was the final score for the game with 65,309 people in attendance? | SELECT final_score FROM table_name_28 WHERE attendance = "65,309" | sql_create_context |
CREATE TABLE t_kc22 (
AMOUNT number,
CHA_ITEM_LEV number,
DATA_ID text,
DIRE_TYPE number,
DOSE_FORM text,
DOSE_UNIT text,
EACH_DOSAGE text,
EXP_OCC_DATE time,
FLX_MED_ORG_ID text,
FXBZ number,
HOSP_DOC_CD text,
HOSP_DOC_NM text,
MED_CLINIC_ID text,
MED_DIRE_CD tex... | 医疗记录中年龄没超过21岁的患者的医疗费平均金额是多少 | SELECT AVG(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.t_kc21_PERSON_AGE <= 21) | css |
CREATE TABLE table_name_75 (
b_mountain_channel VARCHAR,
station_call_letters VARCHAR
) | What B Mountain Channel has station call letters of k41go? | SELECT b_mountain_channel FROM table_name_75 WHERE station_call_letters = "k41go" | sql_create_context |
CREATE TABLE table_name_52 (
venue VARCHAR,
competition VARCHAR,
notes VARCHAR
) | Where was European Championships held with notes of 61.46 m? | SELECT venue FROM table_name_52 WHERE competition = "european championships" AND notes = "61.46 m" | sql_create_context |
CREATE TABLE table_10020178_1 (
canton VARCHAR,
name VARCHAR
) | What is the canton of grande dixence? | SELECT canton FROM table_10020178_1 WHERE name = "Grande Dixence" | sql_create_context |
CREATE TABLE table_name_7 (
freq_currently VARCHAR,
frequency VARCHAR
) | Which freq currently has 0 684? | SELECT freq_currently FROM table_name_7 WHERE frequency = "0 684" | sql_create_context |
CREATE TABLE table_18259 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
) | what's the result with district being louisiana 2 | SELECT "Result" FROM table_18259 WHERE "District" = 'Louisiana 2' | wikisql |
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE countries (
COUNT... | For those employees who was hired before 2002-06-21, show me about the distribution of job_id and the average of salary , and group by attribute job_id in a bar chart, order by the Y-axis from low to high please. | SELECT JOB_ID, AVG(SALARY) FROM employees WHERE HIRE_DATE < '2002-06-21' GROUP BY JOB_ID ORDER BY AVG(SALARY) | nvbench |
CREATE TABLE district (
district_id number,
district_name text,
headquartered_city text,
city_population number,
city_area number
)
CREATE TABLE store (
store_id number,
store_name text,
type text,
area_size number,
number_of_product_category number,
ranking number
)
CREATE... | What products are available at store named 'Miramichi'? | SELECT t1.product FROM product AS t1 JOIN store_product AS t2 ON t1.product_id = t2.product_id JOIN store AS t3 ON t2.store_id = t3.store_id WHERE t3.store_name = "Miramichi" | spider |
CREATE TABLE Apartment_Buildings (
building_id INTEGER,
building_short_name CHAR(15),
building_full_name VARCHAR(80),
building_description VARCHAR(255),
building_address VARCHAR(255),
building_manager VARCHAR(50),
building_phone VARCHAR(80)
)
CREATE TABLE Apartments (
apt_id INTEGER,
... | Show the number of apartment bookings in each weekday and bin booking start date by weekday with a bar chart. | SELECT booking_start_date, COUNT(booking_start_date) FROM Apartment_Bookings | nvbench |
CREATE TABLE school_details (
school_id number,
nickname text,
colors text,
league text,
class text,
division text
)
CREATE TABLE player (
player_id number,
player text,
team text,
age number,
position text,
school_id number
)
CREATE TABLE school (
school_id number,... | Show the locations of schools that have more than 1 player. | SELECT T2.location FROM player AS T1 JOIN school AS T2 ON T1.school_id = T2.school_id GROUP BY T1.school_id HAVING COUNT(*) > 1 | spider |
CREATE TABLE table_204_996 (
id number,
"no." text,
"air date" text,
"network" text,
"household\nrating" number,
"viewers\n(millions)" text
) | which network hosted the awards after abc did in june 2008 ? | SELECT "network" FROM table_204_996 WHERE id = (SELECT id FROM table_204_996 WHERE "air date" = 'june 20, 2008') + 1 | squall |
CREATE TABLE table_name_96 (
round INTEGER,
college_team VARCHAR,
pick VARCHAR
) | What is the lowest Round, when College/Team is 'Kansas', and when Pick is less than 56? | SELECT MIN(round) FROM table_name_96 WHERE college_team = "kansas" AND pick < 56 | sql_create_context |
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
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),
CO... | For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, find job_id and the amount of job_id , and group by attribute job_id, and visualize them by a bar chart, and I want to sort y axis in ascending order. | SELECT JOB_ID, COUNT(JOB_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID ORDER BY COUNT(JOB_ID) | nvbench |
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 Team_ID over the All_Home , and group by attribute ACC_Home, I want to list by the Team_ID in descending please. | SELECT All_Home, Team_ID FROM basketball_match GROUP BY ACC_Home, All_Home ORDER BY Team_ID DESC | nvbench |
CREATE TABLE table_77921 (
"Team 1" text,
"Agg." text,
"Team 2" text,
"1st leg" text,
"2nd leg" text
) | What is the 2nd leg of the Comunicaciones team? | SELECT "2nd leg" FROM table_77921 WHERE "Team 1" = 'comunicaciones' | wikisql |
CREATE TABLE table_name_42 (
rank VARCHAR,
bronze VARCHAR,
nation VARCHAR
) | What was the rank for czechoslovakia with 1 bronze? | SELECT rank FROM table_name_42 WHERE bronze = 1 AND nation = "czechoslovakia" | sql_create_context |
CREATE TABLE artwork (
Name VARCHAR,
Artwork_ID VARCHAR
)
CREATE TABLE festival_detail (
Festival_Name VARCHAR,
Festival_ID VARCHAR
)
CREATE TABLE nomination (
Artwork_ID VARCHAR,
Festival_ID VARCHAR
) | For each nomination, show the name of the artwork and name of the festival where it is nominated. | SELECT T2.Name, T3.Festival_Name FROM nomination AS T1 JOIN artwork AS T2 ON T1.Artwork_ID = T2.Artwork_ID JOIN festival_detail AS T3 ON T1.Festival_ID = T3.Festival_ID | sql_create_context |
CREATE TABLE table_76423 (
"Date" text,
"Opponent" text,
"Score" text,
"Result" text,
"Record" text
) | What is the Record of the game on June 24? | SELECT "Record" FROM table_76423 WHERE "Date" = 'june 24' | wikisql |
CREATE TABLE table_name_77 (
record VARCHAR,
home VARCHAR,
points VARCHAR
) | What is the record of the game with 35 points and pittsburgh as the home team? | SELECT record FROM table_name_77 WHERE home = "pittsburgh" AND points = 35 | sql_create_context |
CREATE TABLE table_name_64 (
wins INTEGER,
against VARCHAR,
draws VARCHAR
) | How many wins for team with 1800 Against and more than 0 byes? | SELECT MAX(wins) FROM table_name_64 WHERE against = 1800 AND draws > 0 | 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 allergy_type (
allergy text,
allergytype text
)
CREATE TABLE has_allergy (
stuid number,
allergy text
) | Show student ids for all male students. | SELECT stuid FROM student WHERE sex = 'M' | spider |
CREATE TABLE table_15944_5 (
sfc_in_g__kn·s_ VARCHAR,
specific_impulse__s_ VARCHAR
) | What is the SFC when the specific impulse is 453? | SELECT sfc_in_g__kn·s_ FROM table_15944_5 WHERE specific_impulse__s_ = 453 | sql_create_context |
CREATE TABLE table_3596 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" text,
"Result" text,
"Candidates" text
) | What party was represented by incumbent Richard Coulter ? | SELECT "Party" FROM table_3596 WHERE "Incumbent" = 'Richard Coulter' | wikisql |
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_code varchar
)
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
hi... | HOUSTON to DALLAS before 0 | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DALLAS' AND flight.departure_time < 0 AND flight.to_airport = AIRPORT_SERVICE_1.airport_c... | atis |
CREATE TABLE All_Documents (
Document_ID INTEGER,
Date_Stored DATETIME,
Document_Type_Code CHAR(15),
Document_Name CHAR(255),
Document_Description CHAR(255),
Other_Details VARCHAR(255)
)
CREATE TABLE Roles (
Role_Code CHAR(15),
Role_Name VARCHAR(255),
Role_Description VARCHAR(255)
)... | Give me line charts of worldwide gross how many date in locaton to over year date in locaton to by major genres Location_Code, display from high to low by the x axis. | SELECT Date_in_Locaton_To, COUNT(Date_in_Locaton_To) FROM Document_Locations GROUP BY Location_Code ORDER BY Date_in_Locaton_To DESC | nvbench |
CREATE TABLE table_65856 (
"Year (Ceremony)" text,
"Actor/Actress" text,
"Category" text,
"Film title used in nomination" text,
"Result" text
) | What is the year when sigourney weaver was nominated for best actress? | SELECT "Year (Ceremony)" FROM table_65856 WHERE "Category" = 'best actress' AND "Actor/Actress" = 'sigourney weaver' | wikisql |
CREATE TABLE table_22355_11 (
nation VARCHAR,
athlete VARCHAR
) | What nation had the athlete sebastian coe category:articles with hcards? | SELECT nation FROM table_22355_11 WHERE athlete = "Sebastian Coe Category:Articles with hCards" | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.