context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_33733 (
"1st player's choice" text,
"2nd player's choice" text,
"Probability 1st player wins" text,
"Probability 2nd player wins" text,
"Probability of a draw" text
) | When the 2nd player's choice is r bb what is the probability the 1st player wins 0.11%? | SELECT "Probability of a draw" FROM table_33733 WHERE "2nd player's choice" = 'r bb' AND "Probability 1st player wins" = '0.11%' | wikisql |
CREATE TABLE table_25047 (
"Asian rank" real,
"World rank" real,
"Country" text,
"GDP per capita" text,
"GDP world rank" text
) | Name the gdp world rank for asian rank being 20 | SELECT "GDP world rank" FROM table_25047 WHERE "Asian rank" = '20' | wikisql |
CREATE TABLE table_name_18 (
tournament VARCHAR,
partner VARCHAR
) | In what Tournament was Janet Young a Partner? | SELECT tournament FROM table_name_18 WHERE partner = "janet young" | sql_create_context |
CREATE TABLE aircraft (
aircraft_code varchar,
aircraft_description varchar,
manufacturer varchar,
basic_type varchar,
engines int,
propulsion varchar,
wide_body varchar,
wing_span int,
length int,
weight int,
capacity int,
pay_load int,
cruising_speed int,
range_... | DALLAS to BALTIMORE | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'DALLAS' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BALTIMO... | atis |
CREATE TABLE table_name_25 (
years VARCHAR,
pct VARCHAR,
lost VARCHAR
) | What is the years coached by the person with a win percentage of 0.667 and 380 losses? | SELECT years FROM table_name_25 WHERE pct = 0.667 AND lost = 380 | sql_create_context |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellv... | what tests are the three most frequently ordered lab tests since 2101? | SELECT t1.labname FROM (SELECT lab.labname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM lab WHERE STRFTIME('%y', lab.labresulttime) >= '2101' GROUP BY lab.labname) AS t1 WHERE t1.c1 <= 3 | eicu |
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId numbe... | Tag edits with empty change. | SELECT 'site://posts/' + CAST(ph.PostId AS TEXT) + '/revisions' AS "revision_history" FROM PostHistory AS ph WHERE (ph.PostHistoryTypeId IN (6, 9)) AND (ph.Text = '') | sede |
CREATE TABLE table_203_574 (
id number,
"track number" number,
"russian title" text,
"english title" text,
"music" text,
"lyrics" text
) | what is the song title of the first track on the album smile ! ? | SELECT "english title" FROM table_203_574 WHERE "track number" = 1 | squall |
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... | 看一下在医疗就诊32751875737中给病患72112835做检验的科室编码及名称分别是啥 | SELECT jybgb.JYKSBM, jybgb.JYKSMC FROM jybgb WHERE jybgb.JZLSH = '32751875737' | css |
CREATE TABLE table_train_168 (
"id" int,
"cholesterol" float,
"hemoglobin_a1c_hba1c" float,
"triglyceride_tg" float,
"fasting_glucose" int,
"NOUSE" float
) | documented hemoglobin a1c ( hba1c ) < 7.5 % at time of entry | SELECT * FROM table_train_168 WHERE hemoglobin_a1c_hba1c < 7.5 | criteria2sql |
CREATE TABLE table_23280 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
) | How many were first elected in California 7? | SELECT "First elected" FROM table_23280 WHERE "District" = 'California 7' | wikisql |
CREATE TABLE table_36725 (
"Game" real,
"January" real,
"Opponent" text,
"Score" text,
"Record" text,
"Points" real
) | Which January is the lowest one that has an Opponent of florida panthers, and Points smaller than 59? | SELECT MIN("January") FROM table_36725 WHERE "Opponent" = 'florida panthers' AND "Points" < '59' | wikisql |
CREATE TABLE table_28515 (
"Institution" text,
"Location" text,
"Founded" real,
"Type" text,
"Enrollment" real,
"Joined" real,
"Nickname" text,
"Primary Conference when joining the MSFA" text,
"Current Primary Conference" text
) | Name the place that was founded in 1920 | SELECT "Institution" FROM table_28515 WHERE "Founded" = '1920' | wikisql |
CREATE TABLE table_1841901_1 (
greek__modern_ VARCHAR,
polish__extinct_ VARCHAR
) | Name the greek modern for s ysza e by / s ysza a by a | SELECT greek__modern_ FROM table_1841901_1 WHERE polish__extinct_ = "słyszałeś był / słyszałaś była" | sql_create_context |
CREATE TABLE table_31406 (
"Name" text,
"#" real,
"Position" text,
"Height" text,
"Weight ( lb. )" real,
"Year" text,
"Hometown" text,
"Previous School" text
) | How many different items appear in the weight column when Pittsburgh, PA is the hometown? | SELECT COUNT("Weight ( lb. )") FROM table_31406 WHERE "Hometown" = 'Pittsburgh, PA' | wikisql |
CREATE TABLE table_78414 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What is the home venue of essendon with a crowd larger than 19,760? | SELECT "Venue" FROM table_78414 WHERE "Crowd" > '19,760' AND "Home team" = 'essendon' | wikisql |
CREATE TABLE table_name_28 (
date VARCHAR,
against INTEGER
) | Which Date has an Against larger than 0? | SELECT date FROM table_name_28 WHERE against > 0 | sql_create_context |
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Comments (
Id number,... | Post scores for top 10. | SELECT p.OwnerUserId, p.Score FROM Posts AS p WHERE p.OwnerUserId IN (SELECT Id FROM Users ORDER BY Reputation DESC LIMIT 10) AND p.PostTypeId = 2 ORDER BY p.Score DESC | sede |
CREATE TABLE table_name_57 (
date VARCHAR,
result VARCHAR,
opponent VARCHAR
) | When has a Result of l 27-7 and an Opponent of at minnesota vikings? | SELECT date FROM table_name_57 WHERE result = "l 27-7" AND opponent = "at minnesota vikings" | sql_create_context |
CREATE TABLE table_name_56 (
long VARCHAR,
avg_g VARCHAR
) | For the Avg/G of 5.9, what was the long? | SELECT long FROM table_name_56 WHERE avg_g = "5.9" | sql_create_context |
CREATE TABLE table_name_68 (
games INTEGER,
date_of_birth VARCHAR,
debut_year VARCHAR
) | What is the average games a player born on 17 March 1915 and debut before 1935 had? | SELECT AVG(games) FROM table_name_68 WHERE date_of_birth = "17 march 1915" AND debut_year < 1935 | sql_create_context |
CREATE TABLE t_kc24 (
ACCOUNT_DASH_DATE time,
ACCOUNT_DASH_FLG number,
CASH_PAY number,
CIVIL_SUBSIDY number,
CKC102 number,
CLINIC_ID text,
CLINIC_SLT_DATE time,
COMP_ID text,
COM_ACC_PAY number,
COM_PAY number,
DATA_ID text,
ENT_ACC_PAY number,
ENT_PAY number,
F... | 医疗机构2488172使用次数top20的是哪些项目 | SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM gwyjzb JOIN t_kc22 ON gwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gwyjzb.MED_SER_ORG_NO = '2488172' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY COUNT(*) DESC LIMIT 20 UNION SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM fgwyjzb JOIN t_kc22 ON fgw... | css |
CREATE TABLE table_name_37 (
nation VARCHAR,
club VARCHAR,
competition VARCHAR,
year VARCHAR
) | What shows for nation when the Competition is preseason, Year less than 2011, and a Club of chivas de guadalajara? | SELECT nation FROM table_name_37 WHERE competition = "preseason" AND year < 2011 AND club = "chivas de guadalajara" | sql_create_context |
CREATE TABLE table_name_34 (
date VARCHAR,
race VARCHAR
) | Name the date of the italian grand prix | SELECT date FROM table_name_34 WHERE race = "italian grand prix" | sql_create_context |
CREATE TABLE table_34803 (
"Date" text,
"Tournament" text,
"Winning score" text,
"Margin of victory" text,
"Runner-up" text
) | Which Tournament has a Winning score of 14 (65-69-72-68=274)? | SELECT "Tournament" FROM table_34803 WHERE "Winning score" = '−14 (65-69-72-68=274)' | wikisql |
CREATE TABLE table_name_24 (
nationality VARCHAR,
name VARCHAR,
group VARCHAR,
result VARCHAR
) | Alana Boyd of group B with a 4.30 result has what nationality? | SELECT nationality FROM table_name_24 WHERE group = "b" AND result = "4.30" AND name = "alana boyd" | sql_create_context |
CREATE TABLE table_16764 (
"Race Name" text,
"Circuit" text,
"Date" text,
"Winning driver" text,
"Constructor" text,
"Report" text
) | What kind of report is for the Pau circuit? | SELECT "Report" FROM table_16764 WHERE "Circuit" = 'Pau' | wikisql |
CREATE TABLE table_19836 (
"Year" real,
"Starts" real,
"Wins" real,
"Top 5" real,
"Top 10" real,
"Poles" real,
"Avg. Start" text,
"Avg. Finish" text,
"Winnings" text,
"Position" text,
"Team(s)" text
) | How many times were the winnings $3,816,362? | SELECT COUNT("Avg. Finish") FROM table_19836 WHERE "Winnings" = '$3,816,362' | wikisql |
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... | Number of questions asked for a specific tag over time (absolute). | SELECT TIME_TO_STR(CreationDate, '%y') * 100 + TIME_TO_STR(CreationDate, '%M') AS yyyymm, COUNT(*) AS cnt FROM Posts AS p INNER JOIN PostTags AS pt ON pt.PostId = p.Id INNER JOIN Tags AS t ON t.Id = pt.TagId WHERE t.TagName = 'c++' GROUP BY TIME_TO_STR(CreationDate, '%y') * 100 + TIME_TO_STR(CreationDate, '%M') ORDER B... | sede |
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 demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob te... | what is drug code and drug route of drug name rituximab? | SELECT prescriptions.formulary_drug_cd, prescriptions.route FROM prescriptions WHERE prescriptions.drug = "Rituximab" | mimicsql_data |
CREATE TABLE table_name_17 (
round VARCHAR,
record VARCHAR
) | What round had a record of 4-1? | SELECT round FROM table_name_17 WHERE record = "4-1" | sql_create_context |
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
... | Give the name of each department and the number of employees in each in a bar chart, and order by the y-axis in asc please. | SELECT DEPARTMENT_NAME, COUNT(*) FROM employees AS T1 JOIN departments AS T2 ON T1.DEPARTMENT_ID = T2.DEPARTMENT_ID GROUP BY T2.DEPARTMENT_NAME ORDER BY COUNT(*) | nvbench |
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
U... | Top user from Tiruchirappalli, Tamil Nadu. | SELECT Id, DisplayName, Reputation, WebsiteUrl, Location FROM Users WHERE Location LIKE '%Malaysia%' ORDER BY Reputation DESC LIMIT 10 | sede |
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 time,
dischtime time,
admission_type text,
admission_location text,
... | had patient 12797 underwent any procedure until 2102? | SELECT COUNT(*) > 0 FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 12797) AND STRFTIME('%y', procedures_icd.charttime) <= '2102' | mimic_iii |
CREATE TABLE Dorm_amenity (
amenid INTEGER,
amenity_name VARCHAR(25)
)
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 Lives_in (
stuid INTEGER,
do... | Find the number of the first name of students who are living in the Smith Hall, I want to show Y in ascending order. | SELECT Fname, COUNT(Fname) FROM Student AS T1 JOIN Lives_in AS T2 ON T1.stuid = T2.stuid JOIN Dorm AS T3 ON T3.dormid = T2.dormid WHERE T3.dorm_name = 'Smith Hall' GROUP BY Fname ORDER BY COUNT(Fname) | nvbench |
CREATE TABLE table_32252 (
"Season" real,
"Series" text,
"Team" text,
"Races" text,
"Wins" text,
"Poles" text,
"Podiums" text,
"Points" text,
"Final Placing" text
) | What was the 2009 final placing? | SELECT "Final Placing" FROM table_32252 WHERE "Season" = '2009' | wikisql |
CREATE TABLE table_name_34 (
attendance VARCHAR,
tie_no VARCHAR
) | What is the attendance of tie no. 23? | SELECT attendance FROM table_name_34 WHERE tie_no = "23" | sql_create_context |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsysto... | give me the length of stay of patient 022-89058's first stay in the icu. | SELECT STRFTIME('%j', patient.unitdischargetime) - STRFTIME('%j', patient.unitadmittime) FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '022-89058') AND NOT patient.unitadmittime IS NULL ORDER BY patient.unitadmittime LIMIT 1 | eicu |
CREATE TABLE table_38198 (
"Team" text,
"Driver" text,
"Laps" real,
"Time" text,
"Grid" real
) | Which Grid is the lowest one that has a Team of germany, and Laps smaller than 45? | SELECT MIN("Grid") FROM table_38198 WHERE "Team" = 'germany' AND "Laps" < '45' | wikisql |
CREATE TABLE table_43550 (
"Official #" real,
"TF1 #" real,
"French title" text,
"English title" text,
"Air date (France)" text,
"Original Beechwood Bunny Tale / Source material" text
) | What is the Official # that has a French title of 'Pierre de Lune'? | SELECT "Official #" FROM table_43550 WHERE "French title" = 'pierre de lune' | wikisql |
CREATE TABLE table_204_146 (
id number,
"tie" number,
"home team" text,
"score" text,
"away team" text,
"attendance" number
) | what home team is above gloucester city ? | SELECT "home team" FROM table_204_146 WHERE id = (SELECT id FROM table_204_146 WHERE "home team" = 'gloucester city') - 1 | squall |
CREATE TABLE table_25006 (
"Character" text,
"Original Manchester Performer" text,
"Original West End Performer" text,
"Original Broadway Performer" text,
"Original UK Tour Performer" text,
"Original Non-Equity US Tour Performer" text,
"Original Italian Tour Performer" text,
"Original So... | What character did Richard Fleeshman portray? | SELECT "Character" FROM table_25006 WHERE "Original West End Performer" = 'Richard Fleeshman' | wikisql |
CREATE TABLE student (
ID varchar(5),
name varchar(20),
dept_name varchar(20),
tot_cred numeric(3,0)
)
CREATE TABLE department (
dept_name varchar(20),
building varchar(15),
budget numeric(12,2)
)
CREATE TABLE takes (
ID varchar(5),
course_id varchar(8),
sec_id varchar(8),
... | Find the number of courses that have more than one prerequisites for each title with a bar chart, show x axis from high to low order. | SELECT title, COUNT(title) FROM course AS T1 JOIN prereq AS T2 ON T1.course_id = T2.course_id GROUP BY title ORDER BY title DESC | nvbench |
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
Dele... | Top PHP users in Ahmedabad, India. | SELECT ROW_NUMBER() OVER (ORDER BY Users.Reputation DESC) AS "rank", Users.Id AS user_id, Users.DisplayName, Users.Reputation, Users.WebsiteUrl, Users.Location, Tags.TagName FROM Users JOIN Posts ON Posts.OwnerUserId = Users.Id JOIN PostTags ON PostTags.PostId = Posts.Id JOIN Tags ON PostTags.TagId = Tags.Id WHERE LOWE... | sede |
CREATE TABLE table_203_485 (
id number,
"year" text,
"show" text,
"role" text,
"notes" text
) | the show above left right left | SELECT "show" FROM table_203_485 WHERE id = (SELECT id FROM table_203_485 WHERE "show" = 'left right left') - 1 | squall |
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE student_record (
student_id int,
course_id int,
semester int,
grade varchar,
how varchar,
transfer_source varchar,
earn_credit varchar,
repeat_term varchar,
t... | Which classes did Dr. Franke Varca teach in the past ? | SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, instructor, offering_instructor WHERE course_offering.semester < (SELECT SEMESTERalias0.semester_id FROM semester AS SEMESTERalias0 WHERE SEMESTERalias0.semester = 'WN' AND SEMESTERalias0.year = 2016) AND course.course_id = cour... | advising |
CREATE TABLE table_name_93 (
score VARCHAR,
time VARCHAR,
venue VARCHAR
) | What is the score of the match at happy valley recreation ground pitch #2 with a 14:30 time? | SELECT score FROM table_name_93 WHERE time = "14:30" AND venue = "happy valley recreation ground pitch #2" | sql_create_context |
CREATE TABLE table_61807 (
"Tournament" text,
"2009" text,
"2010" text,
"2011" text,
"2012" text
) | What is 2011, when 2009 is 'A'? | SELECT "2011" FROM table_61807 WHERE "2009" = 'a' | wikisql |
CREATE TABLE table_46015 (
"Year" real,
"Best teenage/Young Adult" text,
"Reader's Vote" text,
"Best Non-Fiction" text,
"Lifetime Achievement" text
) | what is the reader's vote for 2011? | SELECT "Reader's Vote" FROM table_46015 WHERE "Year" = '2011' | wikisql |
CREATE TABLE table_38713 (
"Task No." real,
"Date given" text,
"Head of Household" text,
"Hand Grenade User" text,
"Hand Grenade Recipient" text
) | Who is the head of household for task number 7? | SELECT "Head of Household" FROM table_38713 WHERE "Task No." = '7' | wikisql |
CREATE TABLE table_name_90 (
qaxmuğal VARCHAR,
malax VARCHAR
) | What is the Qaxmu al village with a Malax village me ba ? | SELECT qaxmuğal FROM table_name_90 WHERE malax = "meşəbaş" | sql_create_context |
CREATE TABLE table_name_36 (
speed VARCHAR,
rank VARCHAR,
team VARCHAR
) | What is the speed when the rank is larger than 2, and team is 500cc norton manx? | SELECT speed FROM table_name_36 WHERE rank > 2 AND team = "500cc norton manx" | sql_create_context |
CREATE TABLE table_20466963_4 (
guest_3 VARCHAR,
guest_4 VARCHAR
) | Who is the guest 3 in the show where guest 4 is Jill Douglas? | SELECT guest_3 FROM table_20466963_4 WHERE guest_4 = "Jill Douglas" | sql_create_context |
CREATE TABLE t_kc24 (
ACCOUNT_DASH_DATE time,
ACCOUNT_DASH_FLG number,
CASH_PAY number,
CIVIL_SUBSIDY number,
CKC102 number,
CLINIC_ID text,
CLINIC_SLT_DATE time,
COMP_ID text,
COM_ACC_PAY number,
COM_PAY number,
DATA_ID text,
ENT_ACC_PAY number,
ENT_PAY number,
F... | 38500405339号在医疗就诊时使用的药品号码为234944950-z的药物使用频次和每一次剂量有多少? | 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 = '38500405339' AND t_kc22.SOC_SRT_DIRE_CD = '234944950-z' | css |
CREATE TABLE date_day (
month_number int,
day_number int,
year int,
day_name varchar
)
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE equipment_sequence (
aircraft_code_sequence varchar,
aircraft_code varchar
)
CREATE TABLE state (
state_code text,
... | round trip air fares from BALTIMORE to PHILADELPHIA less than 1000 dollars | 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 = 'BALTIMORE' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.c... | atis |
CREATE TABLE ref_calendar (
calendar_date time,
day_number number
)
CREATE TABLE document_locations (
document_id number,
location_code text,
date_in_location_from time,
date_in_locaton_to time
)
CREATE TABLE ref_document_types (
document_type_code text,
document_type_name text,
do... | What are all the location codes and location names? | SELECT location_code, location_name FROM ref_locations | spider |
CREATE TABLE table_52126 (
"Country" text,
"Date" text,
"Label" text,
"Format" text,
"Catalogue" text
) | What was Catalogue tojp 60121-22's Date? | SELECT "Date" FROM table_52126 WHERE "Catalogue" = 'tojp 60121-22' | wikisql |
CREATE TABLE table_33780 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What was the venue where the home team scored 13.9 (87)? | SELECT "Venue" FROM table_33780 WHERE "Home team score" = '13.9 (87)' | wikisql |
CREATE TABLE table_39141 (
"Round" real,
"Player" text,
"Position" text,
"Nationality" text,
"College/Junior/Club Team (League)" text
) | What is the nationality of Shaun Sabol? | SELECT "Nationality" FROM table_39141 WHERE "Player" = 'shaun sabol' | wikisql |
CREATE TABLE table_22815568_2 (
status VARCHAR,
population VARCHAR
) | How many status' are there with a population of 90565? | SELECT COUNT(status) FROM table_22815568_2 WHERE population = 90565 | sql_create_context |
CREATE TABLE stadium (
ID int,
name text,
Capacity int,
City text,
Country text,
Opening_year int
)
CREATE TABLE swimmer (
ID int,
name text,
Nationality text,
meter_100 real,
meter_200 text,
meter_300 text,
meter_400 text,
meter_500 text,
meter_600 text,
... | Find meter_300 and ID , and visualize them by a bar chart, and display y-axis from low to high order. | SELECT meter_300, ID FROM swimmer ORDER BY ID | nvbench |
CREATE TABLE table_21656 (
"Game" real,
"Date" text,
"Opponent" text,
"Score" text,
"Location" text,
"Attendance" real,
"Record" text,
"Points" real
) | What was the attendance when the opposing team was the Ottawa Senators and the record was 24-35-17? | SELECT MAX("Attendance") FROM table_21656 WHERE "Opponent" = 'Ottawa Senators' AND "Record" = '24-35-17' | wikisql |
CREATE TABLE table_23958944_6 (
us_viewers__in_millions_ VARCHAR,
production_number VARCHAR
) | Name the viewers for 520 | SELECT us_viewers__in_millions_ FROM table_23958944_6 WHERE production_number = 520 | sql_create_context |
CREATE TABLE table_204_371 (
id number,
"team" text,
"competition" text,
"category" text,
"appearances\nstart" number,
"appearances\nsub" number,
"goals" number,
"team record" text
) | which competition had the highest number of starts and goals ? | SELECT "competition" FROM table_204_371 ORDER BY "appearances\nstart" + "goals" DESC LIMIT 1 | squall |
CREATE TABLE state (
state_code text,
state_name text,
country_name text
)
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
dual_airline varchar,
service... | all flights from BOSTON to WASHINGTON on the 10 of 11 | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'WASHINGTON' AND date_day.day_number = 10 AND date_day.month_number = 11 A... | 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,
... | provide the number of patients who were born before the year 1887 and were transferred within this facility. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "TRSF WITHIN THIS FACILITY" AND demographic.dob_year < "1887" | mimicsql_data |
CREATE TABLE t_kc21_t_kc22 (
MED_CLINIC_ID text,
MED_EXP_DET_ID number
)
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,
H... | 2006-07-26到2015-09-13这段时间里,654这个科室药品0816的开药数量有多少 | SELECT COUNT(*) FROM t_kc22 WHERE t_kc22.MED_ORG_DEPT_CD = '654' AND t_kc22.STA_DATE BETWEEN '2006-07-26' AND '2015-09-13' AND t_kc22.SOC_SRT_DIRE_CD = '0816' | css |
CREATE TABLE table_name_95 (
nationality VARCHAR,
school_club_team VARCHAR
) | What is the nationality of Duke? | SELECT nationality FROM table_name_95 WHERE school_club_team = "duke" | sql_create_context |
CREATE TABLE table_6452 (
"Birth" text,
"Marriage" text,
"Became Duchess" text,
"Ceased to be Duchess" text,
"Death" text,
"Spouse" text
) | WHo Became Duchess that has a Death of 26 october 1614? | SELECT "Became Duchess" FROM table_6452 WHERE "Death" = '26 october 1614' | wikisql |
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 jyjgzbb (
BGDH text,
BGRQ tim... | 列出在2001-03-25到2020-05-29内患者马欣怿被开出的所有检验报告单的检验报告单号是什么? | SELECT jybgb.BGDH FROM person_info JOIN hz_info JOIN zzmzjzjlb JOIN jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX AND zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE person_info.XM = '马... | css |
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
)
... | what is the number of patients with subdural hematoma primary disease who have been discharged to psychiatric facility-partial hospitalization? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = "DISCH-TRAN TO PSYCH HOSP" AND demographic.diagnosis = "SDH" | mimicsql_data |
CREATE TABLE table_dev_25 (
"id" int,
"gender" string,
"pregnancy_or_lactation" bool,
"systolic_blood_pressure_sbp" int,
"hemoglobin_a1c_hba1c" float,
"diastolic_blood_pressure_dbp" int,
"alcohol_abuse" bool,
"hypertension" bool,
"NOUSE" float
) | for female a hemoglobin < 11.5 g / dl, and for male a hemoglobin < 12.5 g / dl. | SELECT * FROM table_dev_25 WHERE (gender = 'female' AND hemoglobin_a1c_hba1c < 11.5) OR (gender = 'male' AND hemoglobin_a1c_hba1c < 12.5) | criteria2sql |
CREATE TABLE table_name_8 (
release_date VARCHAR,
title VARCHAR
) | What was the release date of Rabbit Romeo? | SELECT release_date FROM table_name_8 WHERE title = "rabbit romeo" | sql_create_context |
CREATE TABLE table_7004 (
"City" text,
"Country" text,
"IATA" text,
"ICAO" text,
"Airport" text
) | Which Country that has a IATA of bal? | SELECT "Country" FROM table_7004 WHERE "IATA" = 'bal' | wikisql |
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 (
... | what is the number of patients admitted before 2137 who have diagnoses icd9 code v489? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2137" AND diagnoses.icd9_code = "V489" | mimicsql_data |
CREATE TABLE table_203_183 (
id number,
"season" text,
"tier" number,
"division" number,
"place" text
) | the team finished in the same position in 2001/02 as what other year ? | SELECT "season" FROM table_203_183 WHERE "season" <> '2001/02' AND "place" = (SELECT "place" FROM table_203_183 WHERE "season" = '2001/02') | squall |
CREATE TABLE customers (
customer_id number,
customer_name text,
customer_details text
)
CREATE TABLE products (
product_id number,
product_name text,
product_details text
)
CREATE TABLE order_items (
order_item_id number,
product_id number,
order_id number,
order_item_status t... | Which orders have shipment after 2000-01-01? Give me the order ids. | SELECT order_id FROM shipments WHERE shipment_date > "2000-01-01" | spider |
CREATE TABLE table_73938 (
"Round" real,
"Race" real,
"Circuit" text,
"Date" text,
"Pole Position" text,
"Fastest Lap" text,
"Winning driver" text,
"Winning team" text
) | What team won Race 17? | SELECT "Winning team" FROM table_73938 WHERE "Race" = '17' | wikisql |
CREATE TABLE table_test_26 (
"id" int,
"bleeding" int,
"left_ventricular_ejection_fraction_lvef" int,
"left_main_coronary_artery_disease" bool,
"uncontrolled_diabetes" bool,
"hiv_infection" bool,
"hemoglobin_a1c_hba1c" float,
"hepatitis_b_infection" bool,
"renal_disease" bool,
"u... | severe renal insufficiency ( creatinine clearance < 30 ml / min ) | SELECT * FROM table_test_26 WHERE renal_disease = 1 OR creatinine_clearance_cl < 30 | criteria2sql |
CREATE TABLE table_name_84 (
package_option VARCHAR,
television_service VARCHAR,
country VARCHAR,
content VARCHAR
) | What was the option from Italy with general television content, and the Cielo television service? | SELECT package_option FROM table_name_84 WHERE country = "italy" AND content = "general television" AND television_service = "cielo" | sql_create_context |
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),... | For those employees who do not work in departments with managers that have ids between 100 and 200, give me the comparison about manager_id over the email by a bar chart, and list x-axis in ascending order please. | SELECT EMAIL, MANAGER_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY EMAIL | nvbench |
CREATE TABLE Has_Allergy (
StuID INTEGER,
Allergy VARCHAR(20)
)
CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHAR(12),
Age INTEGER,
Sex VARCHAR(1),
Major INTEGER,
Advisor INTEGER,
city_code VARCHAR(3)
)
CREATE TABLE Allergy_Type (
Allergy VARCHAR(20),
... | Return a bar chart on how many students have each different allergy?, and display the total number in desc order. | SELECT Allergy, COUNT(*) FROM Has_Allergy GROUP BY Allergy ORDER BY COUNT(*) DESC | nvbench |
CREATE TABLE jyjgzbb (
BGDH text,
BGRQ time,
CKZFWDX text,
CKZFWSX number,
CKZFWXX number,
JCFF text,
JCRGH text,
JCRXM text,
JCXMMC text,
JCZBDM text,
JCZBJGDL number,
JCZBJGDW text,
JCZBJGDX text,
JCZBMC text,
JLDW text,
JYRQ time,
JYZBLSH text,
... | 胆囊炎患者46050151被门诊诊断确诊时其检测指标668302的结果定量及其单位分别是多少? | SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN wdmzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX AND wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jyb... | css |
CREATE TABLE table_58990 (
"Standard order" real,
"English translation" text,
"Transcription (based on Pinyin)" text,
"Traditional Chinese" text,
"Simplified Chinese" text
) | What is the English translation of ? | SELECT "English translation" FROM table_58990 WHERE "Simplified Chinese" = '山鬼' | wikisql |
CREATE TABLE table_204_573 (
id number,
"#" number,
"title" text,
"performer(s)" text,
"film" text,
"length" text
) | who sings the last song on this album ? | SELECT "performer(s)" FROM table_204_573 ORDER BY "#" DESC LIMIT 1 | squall |
CREATE TABLE table_45554 (
"Tournament" text,
"1988" text,
"1989" text,
"1990" text,
"1991" text,
"1992" text,
"1993" text,
"1994" text,
"1995" text,
"1996" text,
"1997" text,
"1998" text,
"1999" text,
"2000" text,
"2001" text,
"2002" text,
"2003" text... | What is 2001, when 1999 is '2R', and when 1992 is '3R'? | SELECT "2001" FROM table_45554 WHERE "1999" = '2r' AND "1992" = '3r' | wikisql |
CREATE TABLE artist (
Age VARCHAR
) | List the age of all music artists. | SELECT Age FROM artist | sql_create_context |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescription... | give me the number of patients whose days of hospital stay is greater than 9 and drug route is iv drip? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.days_stay > "9" AND prescriptions.route = "IV DRIP" | mimicsql_data |
CREATE TABLE table_70830 (
"Player" text,
"Country" text,
"Year(s) won" text,
"Total" real,
"To par" text,
"Finish" text
) | Who won in 1983? | SELECT "Player" FROM table_70830 WHERE "Year(s) won" = '1983' | wikisql |
CREATE TABLE table_71319 (
"School" text,
"Location" text,
"Total" real,
"Crimean War" real,
"Persian War" real,
"Indian Mutiny" real,
"1860-1878" real,
"Zulu War" real,
"Second Afghan War" text
) | What is the largest Persian War with a Crimean War of 0, an 1860-1878 larger than 0, a Location of united kingdom, and a Zulu War smaller than 1? | SELECT MAX("Persian War") FROM table_71319 WHERE "Crimean War" = '0' AND "1860-1878" > '0' AND "Location" = 'united kingdom' AND "Zulu War" < '1' | wikisql |
CREATE TABLE table_19573 (
"Rank" real,
"Country" text,
"International tourist arrivals (2012)" text,
"International tourist arrivals (2011)" text,
"Change (2011 to 2012)" text,
"Change (2010 to 2011)" text
) | When 24.1 million is international tourist arrivals (2012) what is the change (2010 to 2011) ? | SELECT "Change (2010 to 2011)" FROM table_19573 WHERE "International tourist arrivals (2012)" = '24.1 million' | wikisql |
CREATE TABLE table_name_26 (
total INTEGER,
new_south_wales VARCHAR,
victoria VARCHAR
) | Which is the lowest crop total with New South Wales at 42 kilotonnes and Victorian at less than 68 kilotonnes? | SELECT MIN(total) FROM table_name_26 WHERE new_south_wales = 42 AND victoria < 68 | sql_create_context |
CREATE TABLE table_30123 (
"Catalogue number" text,
"Artist" text,
"Release title" text,
"Format" text,
"Release date" real
) | What is the catalogue number for 'Waves in the Air'? | SELECT "Catalogue number" FROM table_30123 WHERE "Release title" = 'Waves In The Air' | wikisql |
CREATE TABLE table_60406 (
"Round" real,
"Pick" real,
"Overall Pick" real,
"Player" text,
"School/Club Team" text,
"Position" text
) | What team had a pick of 24 and an overall pick of 310? | SELECT "School/Club Team" FROM table_60406 WHERE "Pick" = '24' AND "Overall Pick" = '310' | wikisql |
CREATE TABLE table_42981 (
"Name" text,
"Location" text,
"Field" text,
"Capacity (MW)" real,
"Annual Generation (average GWh)" text,
"Commissioned" text
) | What is the Name of the power station in the Field of Mokai? | SELECT "Name" FROM table_42981 WHERE "Field" = 'mokai' | wikisql |
CREATE TABLE table_68267 (
"Year" real,
"Champion" text,
"Score" text,
"Defeated" text,
"Location" text
) | what is the location when the champion is brigham young-hawaii, defeated is western oregon and the score is 3-0 (15-5, 15-9, 15-6)? | SELECT "Location" FROM table_68267 WHERE "Champion" = 'brigham young-hawaii' AND "Defeated" = 'western oregon' AND "Score" = '3-0 (15-5, 15-9, 15-6)' | wikisql |
CREATE TABLE Document_Types (
document_type_code VARCHAR(10),
document_description VARCHAR(255)
)
CREATE TABLE Staff_Roles (
role_code VARCHAR(10),
role_description VARCHAR(255)
)
CREATE TABLE Organisations (
organisation_id INTEGER,
organisation_type VARCHAR(10),
organisation_details VARC... | A bar chart for listing the number of the description of the outcomes for all projects, rank in desc by the Y please. | SELECT outcome_description, COUNT(outcome_description) FROM Research_Outcomes AS T1 JOIN Project_Outcomes AS T2 ON T1.outcome_code = T2.outcome_code GROUP BY outcome_description ORDER BY COUNT(outcome_description) DESC | nvbench |
CREATE TABLE table_50706 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
) | What is the Place of the Player with a Score of 70-68=138? | SELECT "Place" FROM table_50706 WHERE "Score" = '70-68=138' | wikisql |
CREATE TABLE table_name_15 (
state VARCHAR,
member VARCHAR
) | What state is Tanya Plibersek from? | SELECT state FROM table_name_15 WHERE member = "tanya plibersek" | sql_create_context |
CREATE TABLE table_79230 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Score" text,
"Record" text
) | Who was the opponent in week 13? | SELECT "Opponent" FROM table_79230 WHERE "Week" = '13' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.