context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE business (
bid int,
business_id varchar,
name varchar,
full_address varchar,
city varchar,
latitude varchar,
longitude varchar,
review_count bigint,
is_open tinyint,
rating float,
state varchar
)
CREATE TABLE neighborhood (
id int,
business_id varchar,
... | How many users have reviewed Irish Pub in Dallas ? | SELECT COUNT(DISTINCT (user.name)) FROM business, category, review, user WHERE business.city = 'Dallas' AND category.business_id = business.business_id AND category.category_name = 'Irish Pub' AND review.business_id = business.business_id AND user.user_id = review.user_id | yelp |
CREATE TABLE table_30030477_1 (
original_air_date VARCHAR,
written_by VARCHAR
) | What dated the episode written by is adam e. fierro & glen mazzara air? | SELECT original_air_date FROM table_30030477_1 WHERE written_by = "Adam E. Fierro & Glen Mazzara" | sql_create_context |
CREATE TABLE FACULTY (
Room VARCHAR,
Rank VARCHAR,
Building VARCHAR
) | Find the rooms of faculties with rank professor who live in building NEB. | SELECT Room FROM FACULTY WHERE Rank = "Professor" AND Building = "NEB" | 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... | provide the number of patients whose age is less than 31 and lab test category is blood gas? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "31" AND lab."CATEGORY" = "Blood Gas" | mimicsql_data |
CREATE TABLE table_20795 (
"School Year" text,
"Volleyball" text,
"Cross Country" text,
"Soccer" text,
"Tennis" text,
"Golf" text,
"Basketball" text,
"Swimming" text,
"Softball" text,
"Track & Field" text
) | Who won soccer when madison won volleyball, lexington won cross country and orrville won softball | SELECT "Soccer" FROM table_20795 WHERE "Volleyball" = 'Madison' AND "Cross Country" = 'Lexington' AND "Softball" = 'Orrville' | wikisql |
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 inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
... | has the arterial bp mean of patient 22782 ever been less than 76.0 in 04/this year. | SELECT COUNT(*) > 0 FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 22782)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial bp mean'... | mimic_iii |
CREATE TABLE table_17625749_3 (
tries_for VARCHAR,
won VARCHAR
) | How many tries for are there when 11 were won? | SELECT tries_for FROM table_17625749_3 WHERE won = "11" | sql_create_context |
CREATE TABLE table_name_83 (
lost VARCHAR,
win__percentage VARCHAR,
played VARCHAR
) | How many games were lost where the win percentage is smaller than 16.7 and the played games is 3? | SELECT COUNT(lost) FROM table_name_83 WHERE win__percentage < 16.7 AND played = 3 | sql_create_context |
CREATE TABLE qtb (
CLINIC_ID text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
INSU_TYPE text,
IN... | 患者葛秀洁在二00八年三月二十一日到二0一二年七月十八日期间,刷医保卡的医疗费总额有多少 | SELECT SUM(t_kc24.MED_AMOUT) FROM qtb JOIN t_kc24 ON qtb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE qtb.PERSON_NM = '葛秀洁' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2008-03-21' AND '2012-07-18' UNION SELECT SUM(t_kc24.MED_AMOUT) FROM gyb JOIN t_kc24 ON gyb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE gyb.PERSON_NM = '葛秀洁' AND t... | css |
CREATE TABLE table_name_59 (
floors INTEGER,
name VARCHAR,
rank VARCHAR
) | What is the lowest number of floors for the number 2 ranked Joyus Housing? | SELECT MIN(floors) FROM table_name_59 WHERE name = "joyus housing" AND rank < 2 | sql_create_context |
CREATE TABLE table_20041 (
"Season" real,
"# of Episodes" real,
"Timeslot" text,
"Season Premiere" text,
"Season Final" text,
"Peak Audience" real,
"Average Audience" real,
"Average Nightly Rank" text,
"Average Weekly Rank" text,
"Average Yearly Ranking" text
) | How many were the show's average weekly ranking when it reached No. 2 in average nightly ranking? | SELECT COUNT("Average Weekly Rank") FROM table_20041 WHERE "Average Nightly Rank" = 'No. 2' | wikisql |
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25... | Visualize a bar chart for simply displaying the email address of the employee and the corresponding employee id, and could you order by the Y in desc? | SELECT EMAIL, EMPLOYEE_ID FROM employees ORDER BY EMPLOYEE_ID DESC | nvbench |
CREATE TABLE table_62980 (
"Year" real,
"Category" text,
"Nominee(s)" text,
"Episode" text,
"Result" text
) | When the nominee(s) is john wells what is the episode for a year before 2004? | SELECT "Episode" FROM table_62980 WHERE "Year" < '2004' AND "Nominee(s)" = 'john wells' | 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 demographic (... | how many patients are diagnosed with primary disease acidosis and are below 79 years of age? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "ACIDOSIS" AND demographic.age < "79" | mimicsql_data |
CREATE TABLE table_2766 (
"Series #" real,
"Season #" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" real,
"U.S. viewers (millions)" text
) | Who wrote the episode directed by Ken Whittingham? | SELECT "Written by" FROM table_2766 WHERE "Directed by" = 'Ken Whittingham' | wikisql |
CREATE TABLE table_name_65 (
count_palatine_of_the_rhine VARCHAR,
interregnum_began VARCHAR
) | What is the name of the Count Palatine of the Rhine with a Interregnum began of 2 april 1657 death of ferdinand iii? | SELECT count_palatine_of_the_rhine FROM table_name_65 WHERE interregnum_began = "2 april 1657 death of ferdinand iii" | sql_create_context |
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE Comments (
Id number,
PostId number,
Score number,... | Compare occurrence of two tags month by month. | SELECT * FROM Posts AS p JOIN PostTags AS pt ON pt.PostId = p.Id WHERE p.Id = 27323 | sede |
CREATE TABLE table_204_489 (
id number,
"rank" number,
"name" text,
"height" text,
"floors" number,
"year" number,
"notes" text
) | what is the tallest building in bosie , idaho ? | SELECT "name" FROM table_204_489 ORDER BY "height" DESC LIMIT 1 | squall |
CREATE TABLE table_1473672_8 (
player VARCHAR,
nhl_team VARCHAR
) | Name the player for chicago black hawks | SELECT player FROM table_1473672_8 WHERE nhl_team = "Chicago Black Hawks" | sql_create_context |
CREATE TABLE table_15467476_2 (
try_bonus VARCHAR,
tries_for VARCHAR
) | Name the try bonus and tries for 30 | SELECT try_bonus FROM table_15467476_2 WHERE tries_for = "30" | sql_create_context |
CREATE TABLE table_6107 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Game site" text,
"Attendance" text
) | Name the date for week more than 1 and game site of bye | SELECT "Date" FROM table_6107 WHERE "Game site" = 'bye' AND "Week" > '1' | wikisql |
CREATE TABLE table_name_86 (
round VARCHAR,
series VARCHAR,
season VARCHAR
) | What is the Round when the series shows 5th place, and a Season of 2006 07? | SELECT round FROM table_name_86 WHERE series = "5th place" AND season = "2006–07" | sql_create_context |
CREATE TABLE table_15530244_5 (
driver VARCHAR,
race_2 VARCHAR
) | Name the driver for race 2 2 | SELECT driver FROM table_15530244_5 WHERE race_2 = "2" | sql_create_context |
CREATE TABLE playlist (
playlistid number,
name text
)
CREATE TABLE track (
trackid number,
name text,
albumid number,
mediatypeid number,
genreid number,
composer text,
milliseconds number,
bytes number,
unitprice number
)
CREATE TABLE artist (
artistid number,
nam... | What are the album titles for albums containing both 'Reggae' and 'Rock' genre tracks? | SELECT T1.title FROM album AS T1 JOIN track AS T2 ON T1.albumid = T2.albumid JOIN genre AS T3 ON T2.genreid = T3.genreid WHERE T3.name = 'Reggae' INTERSECT SELECT T1.title FROM album AS T1 JOIN track AS T2 ON T1.albumid = T2.albumid JOIN genre AS T3 ON T2.genreid = T3.genreid WHERE T3.name = 'Rock' | spider |
CREATE TABLE table_203_506 (
id number,
"opponent" text,
"played" number,
"won" number,
"lost" number,
"drawn" number,
"% won overall" text
) | against which country did the england women 's rfu not rate at an overall percentage of at least 70 % ? | SELECT "opponent" FROM table_203_506 WHERE "% won overall" < 70 | squall |
CREATE TABLE table_34861 (
"Year" real,
"Pick" text,
"Player" text,
"Position" text,
"Country" text,
"Previous team (League)" text
) | What is the position that is shown for 2011? | SELECT "Position" FROM table_34861 WHERE "Year" = '2011' | wikisql |
CREATE TABLE journal (
homepage varchar,
jid int,
name varchar
)
CREATE TABLE organization (
continent varchar,
homepage varchar,
name varchar,
oid int
)
CREATE TABLE domain (
did int,
name varchar
)
CREATE TABLE domain_journal (
did int,
jid int
)
CREATE TABLE domain_key... | return me the number of authors who have papers containing keyword ' Relational Database ' . | SELECT COUNT(DISTINCT (author.name)) FROM author, keyword, publication, publication_keyword, writes WHERE keyword.keyword = 'Relational Database' AND publication_keyword.kid = keyword.kid AND publication.pid = publication_keyword.pid AND writes.aid = author.aid AND writes.pid = publication.pid | academic |
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
... | what was the last careunit of patient 73693? | SELECT transfers.careunit FROM transfers WHERE transfers.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 73693) AND NOT transfers.careunit IS NULL ORDER BY transfers.intime DESC LIMIT 1 | mimic_iii |
CREATE TABLE wrestler (
Reign VARCHAR,
Days_held VARCHAR
) | Show the reign and days held of wrestlers. | SELECT Reign, Days_held FROM wrestler | sql_create_context |
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
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,
admittime time,
... | get me the drug that patient 8005 has been last prescribed in 03/last year. | SELECT prescriptions.drug FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 8005) AND DATETIME(prescriptions.startdate, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') AND STRFTIME('%m', prescriptions.startdate) = '03' ORDE... | mimic_iii |
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 lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,... | calculate the average age of widow patients who were hospitalized for 27 days. | SELECT AVG(demographic.age) FROM demographic WHERE demographic.marital_status = "WIDOWED" AND demographic.days_stay = "27" | 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 (
... | count the number of patients whose drug code is morp2-4 and lab test category is hematology? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE prescriptions.formulary_drug_cd = "MORP2-4" AND lab."CATEGORY" = "Hematology" | mimicsql_data |
CREATE TABLE student (
student_id int,
lastname varchar,
firstname varchar,
program_id int,
declare_major varchar,
total_credit int,
total_gpa float,
entered_as varchar,
admit_term int,
predicted_graduation_semester int,
degree varchar,
minor varchar,
internship varch... | Does anyone else teach Animation for non-Majors other than Prof. Lay ? | SELECT DISTINCT course.department, course.name, course.number, instructor.name FROM course, course_offering, instructor, offering_instructor WHERE course.course_id = course_offering.course_id AND course.name LIKE '%Animation for non-Majors%' AND NOT instructor.name LIKE '%Lay%' AND offering_instructor.instructor_id = i... | advising |
CREATE TABLE table_train_139 (
"id" int,
"ascvd_risk_calculator" float,
"systolic_blood_pressure_sbp" int,
"stomach_problems" bool,
"muscle_weakness" bool,
"heart_disease" bool,
"stroke" bool,
"renal_disease" bool,
"cerebrovascular_disease" bool,
"hepatic_disease" bool,
"card... | stomach or bowel problems ( e.g., blockage, muscle weakness, ulcerative colitis ) | SELECT * FROM table_train_139 WHERE stomach_problems = 1 OR bowel_problems = 1 OR (blockage = 1 OR muscle_weakness = 1 OR ulcerative_colitis = 1) | criteria2sql |
CREATE TABLE Behavior_Incident (
incident_id INTEGER,
incident_type_code VARCHAR(10),
student_id INTEGER,
date_incident_start DATETIME,
date_incident_end DATETIME,
incident_summary VARCHAR(255),
recommendations VARCHAR(255),
other_details VARCHAR(255)
)
CREATE TABLE Addresses (
addr... | Draw a bar chart about the distribution of date_address_to and the amount of date_address_to , and group by attribute other_details and bin date_address_to by time. | SELECT date_address_to, COUNT(date_address_to) FROM Student_Addresses GROUP BY other_details ORDER BY monthly_rental DESC | nvbench |
CREATE TABLE table_23829490_1 (
media_type VARCHAR,
genre VARCHAR
) | What is every media type for the Psychedelic Trance genre? | SELECT media_type FROM table_23829490_1 WHERE genre = "Psychedelic Trance" | sql_create_context |
CREATE TABLE table_name_94 (
census_ranking VARCHAR,
area_km_2 VARCHAR,
official_name VARCHAR
) | Which Census Ranking has an Area km 2 larger than 753.06, and an Official Name of stanley? | SELECT census_ranking FROM table_name_94 WHERE area_km_2 > 753.06 AND official_name = "stanley" | sql_create_context |
CREATE TABLE table_25490 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | Name the high rebounds for american airlines center | SELECT "High rebounds" FROM table_25490 WHERE "Location Attendance" = 'American Airlines Center' | wikisql |
CREATE TABLE table_name_79 (
results VARCHAR,
first_elected VARCHAR
) | What are the results of the incumbent who was first elected in 1996? | SELECT results FROM table_name_79 WHERE first_elected = 1996 | sql_create_context |
CREATE TABLE table_204_971 (
id number,
"m" number,
"date" text,
"tournament" text,
"round" text,
"ground" text,
"opponent" text,
"score" text,
"attendance" number,
"dinamo scorers" text,
"report" text
) | which game had the highest attendance ? | SELECT "date" FROM table_204_971 ORDER BY "attendance" DESC LIMIT 1 | squall |
CREATE TABLE table_name_24 (
nat VARCHAR,
name VARCHAR
) | What nation had a ship named Roma? | SELECT nat FROM table_name_24 WHERE name = "roma" | sql_create_context |
CREATE TABLE train (
Train_ID int,
Name text,
Time text,
Service text
)
CREATE TABLE station (
Station_ID int,
Name text,
Annual_entry_exit real,
Annual_interchanges real,
Total_Passengers real,
Location text,
Main_Services text,
Number_of_Platforms int
)
CREATE TABLE t... | Show the total number of passengers of each location in a bar chart, and sort Y-axis in asc order. | SELECT Location, SUM(Total_Passengers) FROM station GROUP BY Location ORDER BY SUM(Total_Passengers) | nvbench |
CREATE TABLE table_name_10 (
visitor VARCHAR,
record VARCHAR
) | What was the visitor with a record of 5 8 4? | SELECT visitor FROM table_name_10 WHERE record = "5–8–4" | sql_create_context |
CREATE TABLE table_name_55 (
venue VARCHAR,
tournament VARCHAR
) | What's the venue for the asian games tournament? | SELECT venue FROM table_name_55 WHERE tournament = "asian games" | sql_create_context |
CREATE TABLE table_47970 (
"Date" text,
"Opponent" text,
"Home / Away" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location/Attendance" text,
"Record" text
) | What were the high points on March 29? | SELECT "High points" FROM table_47970 WHERE "Date" = 'march 29' | wikisql |
CREATE TABLE table_name_82 (
opponent VARCHAR,
score VARCHAR
) | Who is the opponent with a score of 6 5 13? | SELECT opponent FROM table_name_82 WHERE score = "6–5 13" | sql_create_context |
CREATE TABLE table_8130 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Record" text
) | What is the Visitor on January 1? | SELECT "Visitor" FROM table_8130 WHERE "Date" = 'january 1' | wikisql |
CREATE TABLE student_tests_taken (
registration_id number,
date_test_taken time,
test_result text
)
CREATE TABLE student_course_enrolment (
registration_id number,
student_id number,
course_id number,
date_of_enrolment time,
date_of_completion time
)
CREATE TABLE students (
student... | What are the login names of the students with family name 'Ward'? | SELECT login_name FROM students WHERE family_name = "Ward" | spider |
CREATE TABLE table_31067 (
"Week of" text,
"Tournament" text,
"Champion" text,
"Runner-up" text,
"Semifinalists" text,
"Quarterfinalists" text
) | which tournament was the champion pat cash 4 6, 6 4, 6 3? | SELECT "Tournament" FROM table_31067 WHERE "Champion" = 'Pat Cash 4–6, 6–4, 6–3' | wikisql |
CREATE TABLE table_10886 (
"Season" text,
"Games" real,
"Lost" real,
"Tied" real,
"Points" real,
"Goals for" real,
"Goals against" real,
"Standing" text
) | How many games were lost by more than 27 but not more 78 with goals less than 300? | SELECT AVG("Games") FROM table_10886 WHERE "Lost" > '27' AND "Points" < '78' AND "Goals against" < '300' | wikisql |
CREATE TABLE table_20963074_1 (
original_title VARCHAR,
result VARCHAR,
film_title_used_in_nomination VARCHAR
) | Name the original title for not nominated result with report on death | SELECT original_title FROM table_20963074_1 WHERE result = "Not Nominated" AND film_title_used_in_nomination = "Report on Death" | sql_create_context |
CREATE TABLE t_kc21_t_kc24 (
MED_CLINIC_ID text,
MED_SAFE_PAY_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,
... | 查一下范升荣这个病人的医疗记录中,有哪几次医疗记录中被开出过金额超过5540.22元的药品?列出医疗就诊编码 | SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_NM = '范升荣' AND t_kc21.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT > 5540.22) | 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 procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
... | count the number of patients whose marital status is divorced and procedure icd9 code is 4523? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.marital_status = "DIVORCED" AND procedures.icd9_code = "4523" | mimicsql_data |
CREATE TABLE table_203_255 (
id number,
"no" number,
"test no" number,
"1st team" text,
"2nd team" text,
"winner" text,
"margin" text,
"toss" text,
"bat" text,
"date" text
) | what year was the first game ? | SELECT "date" FROM table_203_255 WHERE id = 1 | squall |
CREATE TABLE table_67182 (
"Season" text,
"Series" text,
"Team" text,
"Races" text,
"wins" text,
"Fast laps" text,
"Points" text,
"Pos." text
) | What is the position with 0 points in Season of 2007 08? | SELECT "Pos." FROM table_67182 WHERE "Points" = '0' AND "Season" = '2007–08' | wikisql |
CREATE TABLE table_18206 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Status" text,
"Opponent" text
) | Who is the incumbent in district Massachusetts7? | SELECT "Incumbent" FROM table_18206 WHERE "District" = 'Massachusetts7' | wikisql |
CREATE TABLE table_name_22 (
country VARCHAR
) | What is the 2013 index of economic freedom of Slovenia? | SELECT 2013 AS _index_of_economic_freedom FROM table_name_22 WHERE country = "slovenia" | sql_create_context |
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Suggeste... | Longest gap between question posting and answer acceptance. | SELECT V.PostId AS "post_link", V.CreationDate AS "accept_date", Q.CreationDate AS "question_date", CAST((JULIANDAY(V.CreationDate) - JULIANDAY(Q.CreationDate)) * 86400.0 AS INT) AS "difference" FROM Votes AS V INNER JOIN Posts AS A ON (V.PostId = A.Id AND A.PostTypeId = 2) INNER JOIN Posts AS Q ON (Q.AcceptedAnswerId ... | sede |
CREATE TABLE table_17782308_1 (
date VARCHAR,
opponent VARCHAR
) | What was the date of the game when the opponent was the Miami Dolphins? | SELECT date FROM table_17782308_1 WHERE opponent = "Miami Dolphins" | sql_create_context |
CREATE TABLE table_48984 (
"Position" real,
"Team" text,
"Played" real,
"Drawn" real,
"Lost" real,
"Goals For" real,
"Goals Against" real,
"Goal Difference" text,
"Points 1" real
) | What average drawn has a played greater than 42? | SELECT AVG("Drawn") FROM table_48984 WHERE "Played" > '42' | wikisql |
CREATE TABLE table_21535453_1 (
source VARCHAR,
brian_moran VARCHAR
) | What source gave 26% of the votes to Brian Moran? | SELECT source FROM table_21535453_1 WHERE brian_moran = "26%" | sql_create_context |
CREATE TABLE instruments (
songid number,
bandmateid number,
instrument text
)
CREATE TABLE vocals (
songid number,
bandmate number,
type text
)
CREATE TABLE band (
id number,
firstname text,
lastname text
)
CREATE TABLE performance (
songid number,
bandmate number,
st... | What are the different instruments listed in the database? | SELECT DISTINCT instrument FROM instruments | spider |
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 procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
... | what were the hospital hospital admission times of patient 23620 until 2104? | SELECT admissions.admittime FROM admissions WHERE admissions.subject_id = 23620 AND STRFTIME('%y', admissions.admittime) <= '2104' | mimic_iii |
CREATE TABLE table_203_322 (
id number,
"club" text,
"played" number,
"won" number,
"drawn" number,
"lost" number,
"points for" number,
"points against" number,
"bonus points" number,
"points" number
) | besides montpellier rc , which other club received 10 bonus points ? | SELECT "club" FROM table_203_322 WHERE "club" <> 'montpellier rc' AND "bonus points" = 10 | squall |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE microlab (
microlabid number,
... | what are the top five frequently prescribed drugs that patients have been prescribed in the same hospital visit after being diagnosed with pneumonia in this year? | SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'pneumonia' AND ... | eicu |
CREATE TABLE organizations (
organization_id number,
date_formed time,
organization_name text,
uk_vat_number text
)
CREATE TABLE party_addresses (
party_id number,
address_id number,
date_address_from time,
address_type_code text,
date_address_to time
)
CREATE TABLE parties (
p... | What is the name of organization that has the greatest number of contact individuals? | SELECT t1.organization_name FROM organizations AS t1 JOIN organization_contact_individuals AS t2 ON t1.organization_id = t2.organization_id GROUP BY t1.organization_name ORDER BY COUNT(*) DESC LIMIT 1 | spider |
CREATE TABLE table_72499 (
"Outcome" text,
"Year" text,
"Location" text,
"Surface" text,
"Partner" text,
"Opponents" text,
"Score" text
) | Who were all of the opponents in 1984? | SELECT "Opponents" FROM table_72499 WHERE "Year" = '1984' | wikisql |
CREATE TABLE table_203_102 (
id number,
"event" text,
"performance" text,
"athlete" text,
"nation" text,
"place" text,
"date" text
) | what country 's 200 m was the quickest ? | SELECT "nation" FROM table_203_102 WHERE "event" = '200 m' | squall |
CREATE TABLE table_31842 (
"Week" text,
"Date" text,
"Opponent" text,
"Time" text,
"Game Site" text,
"Result/Score" text,
"Record" text
) | Tell me thee record for week of hf | SELECT "Record" FROM table_31842 WHERE "Week" = 'hf' | wikisql |
CREATE TABLE PersonFriend (
name varchar(20),
friend varchar(20),
year INTEGER
)
CREATE TABLE Person (
name varchar(20),
age INTEGER,
city TEXT,
gender TEXT,
job TEXT
) | What is minimum age for different job title. | SELECT job, MIN(age) FROM Person GROUP BY job | nvbench |
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,
... | tell me the two year survival rate of patients who have been prescribed nacl 0.9% mbp after having been diagnosed with abdominal compartment syndrome? | SELECT SUM(CASE WHEN patient.hospitaldischargestatus = 'alive' THEN 1 WHEN STRFTIME('%j', patient.hospitaldischargetime) - STRFTIME('%j', t4.diagnosistime) > 2 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t2.uniquepid, t2.diagnosistime FROM (SELECT t1.uniquepid, t1.diagnosistime FROM (SELECT patient.uniquepid... | eicu |
CREATE TABLE table_2008 (
"Branding" text,
"Callsign" text,
"Frequency" text,
"Power (kW)" text,
"Location" text
) | What is the brand in Metro Manila? | SELECT "Branding" FROM table_2008 WHERE "Location" = 'Metro Manila' | wikisql |
CREATE TABLE table_name_52 (
airport VARCHAR,
iata VARCHAR
) | Which airport has an IATA of TYN? | SELECT airport FROM table_name_52 WHERE iata = "tyn" | sql_create_context |
CREATE TABLE fgwyjzb (
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,
... | 查询名为褚莹华的这个病人在医院9536805中,出院诊断疾病名称除胃肠炎以外的医疗就诊记录编号 | SELECT gwyjzb.MED_CLINIC_ID FROM gwyjzb WHERE gwyjzb.PERSON_NM = '褚莹华' AND gwyjzb.MED_SER_ORG_NO = '9536805' AND NOT gwyjzb.OUT_DIAG_DIS_NM LIKE '%胃肠炎%' UNION SELECT fgwyjzb.MED_CLINIC_ID FROM fgwyjzb WHERE fgwyjzb.PERSON_NM = '褚莹华' AND fgwyjzb.MED_SER_ORG_NO = '9536805' AND NOT fgwyjzb.OUT_DIAG_DIS_NM LIKE '%胃肠炎%' | css |
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 zyjzjlb (
CYBQDM text,
CYBQMC... | 患者27615170在13年4月2日到21年3月6日内被开出的所有检验报告单的科室编码以及名称都是什么? | SELECT jybgb.KSBM, jybgb.KSMC 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 hz_info.RYBH = '27615170' AND jybgb.BGRQ BETWEEN '2013-04-02' AND '2021-... | css |
CREATE TABLE table_name_1 (
rank INTEGER,
athletes VARCHAR
) | What is Calvin Mokoto's average rank? | SELECT AVG(rank) FROM table_name_1 WHERE athletes = "calvin mokoto" | sql_create_context |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (... | how many hispanic or latino patients have stayed in the hospital for more than 20 days? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "HISPANIC OR LATINO" AND demographic.days_stay > "20" | mimicsql_data |
CREATE TABLE table_name_92 (
series VARCHAR,
actor VARCHAR
) | Which Series has an Actor of tom ward? | SELECT series FROM table_name_92 WHERE actor = "tom ward" | sql_create_context |
CREATE TABLE table_26371 (
"Lines" text,
"Opening" real,
"Traction" text,
"Length" text,
"Stations" real,
"Route" text,
"Stops" real,
"Travel time" text
) | Name the stops for stations 36 | SELECT "Stops" FROM table_26371 WHERE "Stations" = '36' | wikisql |
CREATE TABLE table_1011906_1 (
population_canada_2011_census INTEGER,
seat_of_rcm VARCHAR
) | what is the minimum population canada 2011 census with seat of rcm being cowansville | SELECT MIN(population_canada_2011_census) FROM table_1011906_1 WHERE seat_of_rcm = "Cowansville" | sql_create_context |
CREATE TABLE class_of_service (
booking_class varchar,
rank int,
class_description text
)
CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE month (
month_number int,
month_name text
)
CREATE TABLE... | show me all flights from CHICAGO to KANSAS CITY on thursday june seventeenth arriving in KANSAS CITY at around 7 o'clock in the evening | 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 (((flight.arrival_time <= 1930 AND flight.arrival_time >= 1830) AND date_day.day_number = 24 AND date_day.month_number = 5 AND date_day.year = 19... | atis |
CREATE TABLE home_game (
year INTEGER,
league_id TEXT,
team_id TEXT,
park_id TEXT,
span_first TEXT,
span_last TEXT,
games INTEGER,
openings INTEGER,
attendance INTEGER
)
CREATE TABLE batting_postseason (
year INTEGER,
round TEXT,
player_id TEXT,
team_id TEXT,
lea... | count yearid for visualizing a line chart, and could you show x-axis in desc order? | SELECT yearid, COUNT(yearid) FROM hall_of_fame ORDER BY yearid DESC | nvbench |
CREATE TABLE table_name_91 (
theme VARCHAR,
year INTEGER
) | What is the theme of the coin from before 2006? | SELECT theme FROM table_name_91 WHERE year < 2006 | sql_create_context |
CREATE TABLE table_26206 (
"Country" text,
"% of all immigrants 2008" text,
"% of all immigrants 2007" text,
"% of all immigrants 2006" text,
"% of all immigrants 2005" text,
"% of all immigrants 2004" text
) | How many different percentages of immigrants are there for the year of 2007 in the countries with 1.2% of the immigrants in the year of 2005? | SELECT COUNT("% of all immigrants 2007") FROM table_26206 WHERE "% of all immigrants 2005" = '1.2%' | wikisql |
CREATE TABLE table_67512 (
"Tournament" text,
"2007" text,
"2008" text,
"2009" text,
"2010" text,
"2011" text,
"2012" text
) | What shows for 2009 when the 2012 is 1R? | SELECT "2009" FROM table_67512 WHERE "2012" = '1r' | wikisql |
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,... | 查查医疗就诊61409941156相对应的门诊号,或者是住院号也可以 | SELECT t_kc21.CLINIC_ID FROM t_kc21 WHERE t_kc21.MED_CLINIC_ID = '61409941156' | css |
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... | 从2003年5月27日至2017年1月18日结束医疗机构4580460里面的未就业人员医疗就诊记录数量有多少? | SELECT COUNT(*) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '4580460' AND t_kc21.IN_HOSP_DATE BETWEEN '2003-05-27' AND '2017-01-18' AND t_kc21.INSURED_STS = '未就业' | css |
CREATE TABLE table_57064 (
"Race" text,
"Date" text,
"Location" text,
"Pole Position" text,
"Fastest Lap" text,
"Race Winner" text,
"Constructor" text,
"Report" text
) | What Brands Hatch race had Niki Lauda as its Fastest Lap? | SELECT "Race" FROM table_57064 WHERE "Fastest Lap" = 'niki lauda' AND "Location" = 'brands hatch' | wikisql |
CREATE TABLE record (
ID int,
Result text,
Swimmer_ID int,
Event_ID int
)
CREATE TABLE event (
ID int,
Name text,
Stadium_ID int,
Year text
)
CREATE TABLE stadium (
ID int,
name text,
Capacity int,
City text,
Country text,
Opening_year int
)
CREATE TABLE swimme... | A bar chart shows the distribution of meter_400 and ID , order by the y axis in asc. | SELECT meter_400, ID FROM swimmer ORDER BY ID | nvbench |
CREATE TABLE participates_in (
stuid number,
actid number
)
CREATE TABLE activity (
actid number,
activity_name text
)
CREATE TABLE student (
stuid number,
lname text,
fname text,
age number,
sex text,
major number,
advisor number,
city_code text
)
CREATE TABLE faculty... | Which activity has the most faculty members participating in? Find the activity name. | SELECT T1.activity_name FROM activity AS T1 JOIN faculty_participates_in AS T2 ON T1.actid = T2.actid GROUP BY T1.actid ORDER BY COUNT(*) DESC LIMIT 1 | spider |
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,
... | 列出姓蒋的检测人负责的所有检测指标在医疗就诊59894458645中,名称是什么?结果定量是什么?结果定量单位是什么? | SELECT jyjgzbb.JCZBMC, jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM zyjybgb JOIN jyjgzbb ON zyjybgb.YLJGDM = jyjgzbb.YLJGDM AND zyjybgb.BGDH = jyjgzbb.BGDH WHERE zyjybgb.JZLSH = '59894458645' AND jyjgzbb.JCRXM LIKE '蒋%' UNION SELECT jyjgzbb.JCZBMC, jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM mzjybgb JOIN jyjgzbb ON mzjybgb.YLJG... | css |
CREATE TABLE table_51606 (
"Entrant" text,
"Constructor" text,
"Chassis" text,
"Engine" text,
"Tyre" text,
"Driver" text,
"Rounds" text
) | What engine did Riccardo Patrese use? | SELECT "Engine" FROM table_51606 WHERE "Driver" = 'riccardo patrese' | wikisql |
CREATE TABLE table_28809 (
"Name" text,
"Sweet" text,
"Species" text,
"Gender" text,
"Attribute" text,
"Birthday" text,
"Media Debut" text,
"Voice Actor" text
) | what is the sweet for voice actor saki fujita? | SELECT "Sweet" FROM table_28809 WHERE "Voice Actor" = 'Saki Fujita' | 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 demographic (... | how many patients whose year of birth is less than 2073 and drug route is iv? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dob_year < "2073" AND prescriptions.route = "IV" | mimicsql_data |
CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Per... | Return a scatter chart about the correlation between ACC_Percent and All_Games_Percent , and group by attribute Team_Name. | SELECT ACC_Percent, All_Games_Percent FROM basketball_match GROUP BY Team_Name | nvbench |
CREATE TABLE table_16681 (
"English Name" text,
"Japanese orthography" text,
"Pronouciation" text,
"abbreviation" text,
"Provider(IAI)" text,
"Foundation" real
) | What is the Japanese orthography for the English name National Farmers Academy? | SELECT "Japanese orthography" FROM table_16681 WHERE "English Name" = 'National Farmers Academy' | wikisql |
CREATE TABLE table_name_73 (
opponent VARCHAR,
record VARCHAR
) | Who was the opponent at the game that had a record of 93-54? | SELECT opponent FROM table_name_73 WHERE record = "93-54" | sql_create_context |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wa... | in a year before what was patient 021-93953's first hospital discharge time? | SELECT patient.hospitaldischargetime FROM patient WHERE patient.uniquepid = '021-93953' AND DATETIME(patient.hospitaldischargetime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') ORDER BY patient.hospitaldischargetime LIMIT 1 | eicu |
CREATE TABLE table_13026 (
"Rank" real,
"Map Reference Number" real,
"Census Statistical Area" text,
"2007 Population" real,
"Lake(s)" text
) | What is the lowest rank with a smaller population in 2007 than 117,201 and whose map reference number is 22? | SELECT MIN("Rank") FROM table_13026 WHERE "2007 Population" > '117,201' AND "Map Reference Number" = '22' | wikisql |
CREATE TABLE table_29446183_2 (
season VARCHAR,
third_place VARCHAR
) | How many seasons did Otsuka Pharmaceuticals come in third? | SELECT COUNT(season) FROM table_29446183_2 WHERE third_place = "Otsuka Pharmaceuticals" | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.