context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_name_60 (
score VARCHAR,
game VARCHAR,
march VARCHAR
) | Game larger than 76, and a March larger than 26 involves what score? | SELECT score FROM table_name_60 WHERE game > 76 AND march > 26 | sql_create_context |
CREATE TABLE table_42942 (
"Year" text,
"Venue" text,
"Champion" text,
"Country" text,
"Score" text,
"Runner-up" text
) | What is the score of the match won by Willie Hunter at the Royal Liverpool Golf Club? | SELECT "Score" FROM table_42942 WHERE "Venue" = 'royal liverpool golf club' AND "Champion" = 'willie hunter' | wikisql |
CREATE TABLE table_name_9 (
date VARCHAR,
venue VARCHAR,
goal VARCHAR
) | When was the venue mexico city, mexico with a goal of 8? | SELECT date FROM table_name_9 WHERE venue = "mexico city, mexico" AND goal = 8 | sql_create_context |
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
... | what laboratory test was given to patient 70267 last time during this month? | SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT labevents.itemid FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 70267) AND DATETIME(labevents.charttime, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-0 month... | mimic_iii |
CREATE TABLE table_5627 (
"Stage" text,
"Winner" text,
"General classification" text,
"Points classification" text,
"Mountains classification" text,
"Team classification" text
) | What is the general classification of Mapei-clas in stage 12? | SELECT "General classification" FROM table_5627 WHERE "Team classification" = 'mapei-clas' AND "Stage" = '12' | wikisql |
CREATE TABLE table_33972 (
"Season" real,
"Team" text,
"Wins" real,
"Losses" real,
"Draws" real
) | Which Wins is the lowest one that has a Season smaller than 1920, and Losses smaller than 14? | SELECT MIN("Wins") FROM table_33972 WHERE "Season" < '1920' AND "Losses" < '14' | wikisql |
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
) | For those records from the products and each product's manufacturer, give me the comparison about revenue over the name , and group by attribute founder by a bar chart, could you show Y from high to low order? | SELECT T1.Name, T2.Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder, T1.Name ORDER BY T2.Revenue DESC | nvbench |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id... | how many patients are with asian ethnicity and under 49 years of age? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "ASIAN" AND demographic.age < "49" | mimicsql_data |
CREATE TABLE table_63081 (
"Rank" text,
"Name" text,
"Height ft (m)" text,
"Floors" real,
"Year" real
) | How many floors when the rank is 73.0 72=? | SELECT "Floors" FROM table_63081 WHERE "Rank" = '73.0 72=' | wikisql |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text,
person_info_CSD text,
person_info_CSRQ time,
person_info_GJDM text,
person_info_GJMC text,
person_info_JGDM text,
person_info_JGMC text,
person_info_MZDM text,
person_info_MZMC text,
person_info_XBDM ... | 哪个人门诊就诊中开出的检验报告单21844290233 | SELECT hz_info.person_info_XM FROM hz_info JOIN mzjzjlb JOIN jybgb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE jybgb.BGDH = '21844290233' | css |
CREATE TABLE station (
id int,
network_name text,
services text,
local_authority text
)
CREATE TABLE route (
train_id int,
station_id int
)
CREATE TABLE weekly_weather (
station_id int,
day_of_week text,
high_temperature int,
low_temperature int,
precipitation real,
win... | A bar graph listing the local authorities and how many local authorities provided by all stations, rank from high to low by the the number of local authority. | SELECT local_authority, COUNT(local_authority) FROM station GROUP BY local_authority ORDER BY COUNT(local_authority) DESC | nvbench |
CREATE TABLE table_29475 (
"Team" text,
"Outgoing head coach" text,
"Manner of departure" text,
"Date of vacancy" text,
"Position in table" real,
"Incoming head coach" text,
"Date of appointment" text
) | When is the date of appointment when the position in table is 16? | SELECT "Date of appointment" FROM table_29475 WHERE "Position in table" = '16' | 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 microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,... | what were the top three most frequent lab tests that followed in the same hospital visit, for patients who were given thoracentesis the previous year? | SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT t3.itemid FROM (SELECT t2.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime, admissions.hadm_id FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_i... | mimic_iii |
CREATE TABLE table_171361_2 (
area_km_2 VARCHAR,
official_name VARCHAR
) | Name the area km 2 for balmoral | SELECT area_km_2 FROM table_171361_2 WHERE official_name = "Balmoral" | sql_create_context |
CREATE TABLE debate_people (
Debate_ID int,
Affirmative int,
Negative int,
If_Affirmative_Win bool
)
CREATE TABLE debate (
Debate_ID int,
Date text,
Venue text,
Num_of_Audience int
)
CREATE TABLE people (
People_ID int,
District text,
Name text,
Party text,
Age int
... | Show the number of debates for each person on the affirmative side in a bar chart, display by the x axis in ascending. | SELECT Name, COUNT(Name) FROM debate_people AS T1 JOIN debate AS T2 ON T1.Debate_ID = T2.Debate_ID JOIN people AS T3 ON T1.Affirmative = T3.People_ID GROUP BY Name ORDER BY Name | nvbench |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | what is the number of self pay insurance patients who have had allogeneic hematopoietic stem cell transplant without purging? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Self Pay" AND procedures.long_title = "Allogeneic hematopoietic stem cell transpant without purging" | mimicsql_data |
CREATE TABLE table_name_21 (
erp_w INTEGER,
frequency_mhz INTEGER
) | Name the lowest ERP W with a frequency mhz less than 103.1 | SELECT MIN(erp_w) FROM table_name_21 WHERE frequency_mhz < 103.1 | sql_create_context |
CREATE TABLE table_48073 (
"State" text,
"Abbreviation" text,
"Capital" text,
"Area (km\u00b2)" real,
"Population (2005)" real,
"Density (2005)" real,
"GDP (% total) (2004)" text,
"GDP per capita (US$) (2004)" real,
"HDI (2005)" real,
"Literacy (2003)" text,
"Infant Mortality... | Which GDP per capita (US$) (2004) is the highest one that has an Area (km ) larger than 148825.6, and a State of roraima? | SELECT MAX("GDP per capita (US$) (2004)") FROM table_48073 WHERE "Area (km\u00b2)" > '148825.6' AND "State" = 'roraima' | wikisql |
CREATE TABLE table_21954 (
"Country / Region" text,
"Name" text,
"Host(s)" text,
"Channel" text,
"Premiere / Aired" text,
"Seasons" text
) | What is the title that aired from 17 may 2008 21 june 2008 on Nederland 3? | SELECT "Name" FROM table_21954 WHERE "Channel" = 'Nederland 3' AND "Premiere / Aired" = '17 May 2008 – 21 June 2008' | wikisql |
CREATE TABLE table_1935 (
"Country" text,
"Contestant" text,
"Age" real,
"Height (cm)" real,
"Height (ft)" text,
"Hometown" text
) | When valora roucek is the contestant how many heights in centimeters are there? | SELECT COUNT("Height (cm)") FROM table_1935 WHERE "Contestant" = 'Valora Roucek' | wikisql |
CREATE TABLE table_name_33 (
losses INTEGER,
draws VARCHAR,
position VARCHAR,
wins VARCHAR,
goal_difference VARCHAR
) | What is the highest losses for more than 11 wins, a goal difference greater than 5, a 3 position, and more than 3 draws? | SELECT MAX(losses) FROM table_name_33 WHERE wins > 11 AND goal_difference > 5 AND position = 3 AND draws > 3 | sql_create_context |
CREATE TABLE table_204_809 (
id number,
"draw" number,
"country" text,
"language" text,
"artist" text,
"song" text,
"english translation" text,
"national final" text,
"place" number,
"points" number
) | how many participants sang english language songs ? | SELECT COUNT(*) FROM table_204_809 WHERE "language" = 'english' | squall |
CREATE TABLE Users (
user_id INTEGER,
role_code VARCHAR(15),
user_name VARCHAR(40),
user_login VARCHAR(40),
password VARCHAR(40)
)
CREATE TABLE Document_Sections_Images (
section_id INTEGER,
image_id INTEGER
)
CREATE TABLE Document_Structures (
document_structure_code VARCHAR(15),
... | Find the number of users in each role Plot them as bar chart, display total number from low to high order please. | SELECT role_code, COUNT(*) FROM Users GROUP BY role_code ORDER BY COUNT(*) | nvbench |
CREATE TABLE table_43796 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" real
) | What was the attendance in week 9? | SELECT AVG("Attendance") FROM table_43796 WHERE "Week" = '9' | wikisql |
CREATE TABLE table_6749 (
"Rank" real,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | What is the sum of all silver medals with more than 2 bronze? | SELECT SUM("Silver") FROM table_6749 WHERE "Bronze" > '2' | wikisql |
CREATE TABLE table_5908 (
"Season" text,
"W(OT)" real,
"W(GWS)*" text,
"L(GWS)*" text,
"L(OT)" real
) | How many OT wins associated with a L(GWS)* of 3, and a L(OT) larger than 1? | SELECT SUM("W(OT)") FROM table_5908 WHERE "L(GWS)*" = '3' AND "L(OT)" > '1' | wikisql |
CREATE TABLE table_15682 (
"Year" real,
"Entrant" text,
"Chassis" text,
"Engine" text,
"Points" real
) | What chassis did team lotus use after 1964? | SELECT "Chassis" FROM table_15682 WHERE "Entrant" = 'team lotus' AND "Year" > '1964' | wikisql |
CREATE TABLE table_name_27 (
stls INTEGER,
rebs INTEGER
) | What is the lowest Stls, when Rebs is greater than 8.6? | SELECT MIN(stls) FROM table_name_27 WHERE rebs > 8.6 | sql_create_context |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime t... | what is the name of a drug patient 009-9534 had been prescribed two or more times until 08/2104? | SELECT t1.drugname FROM (SELECT medication.drugname, COUNT(medication.drugstarttime) AS c1 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '009... | eicu |
CREATE TABLE table_18974269_1 (
original_season VARCHAR,
player VARCHAR
) | What was the season where Evelyn Smith was on? | SELECT original_season FROM table_18974269_1 WHERE player = "Evelyn Smith" | sql_create_context |
CREATE TABLE mill (
architect_id int,
id int,
location text,
name text,
type text,
built_year int,
notes text
)
CREATE TABLE bridge (
architect_id int,
id int,
name text,
location text,
length_meters real,
length_feet real
)
CREATE TABLE architect (
id text,
... | How many mills of 'Grondzeiler' type are built in each year? Give me the trend, order in descending by the X. | SELECT built_year, COUNT(built_year) FROM mill WHERE type = 'Grondzeiler' ORDER BY built_year DESC | nvbench |
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE jo... | Courses in Continental Rationalism that satisfy the MDE requirement ? | SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN area ON course.course_id = area.course_id INNER JOIN program_course ON program_course.course_id = course.course_id WHERE (area.area LIKE '%Continental Rationalism%' OR course.description LIKE '%Continental Rationalism%' OR course.name ... | advising |
CREATE TABLE table_59012 (
"Shooter" text,
"Prone" real,
"Stand" real,
"Kneel" real,
"Qual" real
) | What is the sum of the stand with a qual more than 589? | SELECT SUM("Stand") FROM table_59012 WHERE "Qual" > '589' | wikisql |
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE cost (
costid num... | how many patients in 2102 underwent a vte prophylaxis - low molecular weight heparin within 2 months after the diagnosis of a pleural effusion - right? | SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'pleural effusion - right' AND STRFTIME('%y', diagnosis.diagnosistime) = '2102') AS t1 JOIN (SELECT patient.u... | eicu |
CREATE TABLE table_74410 (
"Institution" text,
"Location" text,
"Mascot" text,
"Colors" text,
"Affiliation" text,
"9\u201312 enrollment" real,
"School website" text
) | What colors can you see players from Tolono, Illinois wearing? | SELECT "Colors" FROM table_74410 WHERE "Location" = 'Tolono, Illinois' | wikisql |
CREATE TABLE table_203_526 (
id number,
"team 1" text,
"agg." text,
"team 2" text,
"1st leg" text,
"2nd leg" text
) | how many teams were in the play offs ? | SELECT COUNT("team 1") + COUNT("team 2") FROM table_203_526 | squall |
CREATE TABLE table_name_59 (
club VARCHAR,
home_ground VARCHAR
) | What was the club when home ground was Central Reserve? | SELECT club FROM table_name_59 WHERE home_ground = "central reserve" | sql_create_context |
CREATE TABLE table_25196 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | What was the location and attendance for the game against the team with a 51-15 record with the Cavaliers? | SELECT "Location Attendance" FROM table_25196 WHERE "Record" = '51-15' | wikisql |
CREATE TABLE table_179174_2 (
spacecraft VARCHAR,
flights VARCHAR
) | What spacecrafts had 22 orbital flights? | SELECT spacecraft FROM table_179174_2 WHERE flights = "22 Orbital" | sql_create_context |
CREATE TABLE table_204_951 (
id number,
"candidate" text,
"votes" number,
"percentage" text,
"counties" number,
"delegates" number
) | how many votes did alan keyes receive ? | SELECT "votes" FROM table_204_951 WHERE "candidate" = 'alan keyes' | squall |
CREATE TABLE table_name_93 (
result VARCHAR,
district VARCHAR
) | What was the District of California 2 result? | SELECT result FROM table_name_93 WHERE district = "california 2" | sql_create_context |
CREATE TABLE discount_coupons (
coupon_id number,
date_issued time,
coupon_amount number
)
CREATE TABLE products_booked (
booking_id number,
product_id number,
returned_yn text,
returned_late_yn text,
booked_count number,
booked_amount number
)
CREATE TABLE view_product_availabilit... | What is the maximum total amount paid by a customer? List the customer id and amount. | SELECT customer_id, SUM(amount_paid) FROM payments GROUP BY customer_id ORDER BY SUM(amount_paid) DESC LIMIT 1 | spider |
CREATE TABLE table_1136 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Record" text,
"Game Site" text,
"Attendance" real
) | Name the total number of weeks for at cleveland browns | SELECT COUNT("Week") FROM table_1136 WHERE "Opponent" = 'at Cleveland Browns' | wikisql |
CREATE TABLE table_41085 (
"Airline" text,
"Fleet Size" real,
"Notes" text,
"IOSA (IATA)" text,
"EASA (EU)" text,
"IASA (FAA)" text
) | What is the Airline when the notes show aoc 135? | SELECT "Airline" FROM table_41085 WHERE "Notes" = 'aoc 135' | wikisql |
CREATE TABLE table_27218 (
"Round" text,
"Opposition" text,
"Time" text,
"Date" text,
"Home/Away" text,
"Venue" text,
"Score" text,
"Result/Margin" text,
"Broadcaster" text,
"TV" text,
"Ladder Position" text
) | Which network broadcast the game when the Western Bulldogs played melbourne? | SELECT "Broadcaster" FROM table_27218 WHERE "Opposition" = 'Melbourne' | wikisql |
CREATE TABLE flight (
aircraft_code_sequence text,
airline_code varchar,
airline_flight text,
arrival_time int,
connections int,
departure_time int,
dual_carrier text,
flight_days text,
flight_id int,
flight_number int,
from_airport varchar,
meal_code text,
stops int,... | what flights depart BALTIMORE and arrive by 2000 friday in SAN FRANCISCO | 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 < 41 OR flight.time_elapsed >= 60) AND flight.departure_time > flight.arrival_time) AND date_day.day_number = 25 AND da... | atis |
CREATE TABLE table_14132239_3 (
defensive VARCHAR,
rookie VARCHAR,
offensive VARCHAR
) | Who was the defensive award winner when the rookie award was given to Daryl Veltman and the offensive award was given to Mark Steenhuis? | SELECT defensive FROM table_14132239_3 WHERE rookie = "Daryl Veltman" AND offensive = "Mark Steenhuis" | sql_create_context |
CREATE TABLE table_27590 (
"June 10-11" text,
"March 27-29" text,
"January 15-16" text,
"November 3" text,
"August 21-22" text
) | january 15-16 when august 21-22 is august 22, 1979? | SELECT "January 15-16" FROM table_27590 WHERE "August 21-22" = 'August 22, 1979' | wikisql |
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_ty... | what are the four most commonly prescribed medications for patients for whom lactated ringers is also prescribed at the same time, in 2103? | SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'lactated ringers' AND STRFTIME('%y', prescriptions.startdate) = '... | mimic_iii |
CREATE TABLE table_name_72 (
crowd INTEGER,
home_team VARCHAR
) | Which average Crowd has a Home team of south melbourne? | SELECT AVG(crowd) FROM table_name_72 WHERE home_team = "south melbourne" | sql_create_context |
CREATE TABLE table_name_10 (
recopa_sudamericana_1996 VARCHAR,
copa_conmebol_1996 VARCHAR,
team VARCHAR
) | What is the recoupa sudaamericana 1996 result of team flamengo, which did not qualify for the copa conmebol 1996? | SELECT recopa_sudamericana_1996 FROM table_name_10 WHERE copa_conmebol_1996 = "did not qualify" AND team = "flamengo" | sql_create_context |
CREATE TABLE table_train_13 (
"id" int,
"active_infection" bool,
"procalcitonin" int,
"receiving_vasopressor" bool,
"sepsis" bool,
"septic_shock" bool,
"age" float,
"lactate" int,
"NOUSE" float
) | septic shock patients must have suspected or confirmed infection and lactate > 2 mmol / l and receiving vasopressors | SELECT * FROM table_train_13 WHERE septic_shock = 1 AND active_infection = 1 AND lactate > 2 AND receiving_vasopressor = 1 | criteria2sql |
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 flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
CREATE TABLE days (
days_code varchar,
... | please list flights between DENVER and BOSTON | 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 = 'DENVER' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BOSTON'... | atis |
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE offering_instructor (
offering_ins... | Which upper level classes can I take without having 511 ? | SELECT DISTINCT COURSE_0.department, COURSE_0.name, COURSE_0.number FROM course AS COURSE_0, course AS COURSE_1, course_prerequisite, program_course WHERE NOT COURSE_1.course_id IN (SELECT course_prerequisite.pre_course_id FROM course AS COURSE_0, course_prerequisite WHERE COURSE_0.course_id = course_prerequisite.cours... | advising |
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress text
)
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
... | casperOne's Top Answers by Tags. casperOne's answers aggregated by tag, where
the number of answers per tag is greater
than or equal to five. | SELECT t.TagName, COUNT(t.Id) AS AnswersForTag FROM Posts AS q INNER JOIN PostTags AS pt ON pt.PostId = q.Id INNER JOIN Tags AS t ON t.Id = pt.TagId INNER JOIN Posts AS a ON a.ParentId = q.Id WHERE a.OwnerUserId = 68172 GROUP BY t.TagName HAVING COUNT(t.Id) >= 5 ORDER BY 2 DESC | sede |
CREATE TABLE table_name_64 (
date VARCHAR,
opera VARCHAR,
internet_explorer VARCHAR
) | Which date has an Opera usage percentage of 5.1% and Internet Explorer usage of 59.5%? | SELECT date FROM table_name_64 WHERE opera = "5.1%" AND internet_explorer = "59.5%" | sql_create_context |
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
)
... | what is the number of patients whose admission location is clinic referral/premature and with primary disease celo-vessicula fistula? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "CLINIC REFERRAL/PREMATURE" AND demographic.diagnosis = "CELO-VESSICLE FISTULA" | mimicsql_data |
CREATE TABLE research_staff (
staff_id number,
employer_organisation_id number,
staff_details text
)
CREATE TABLE documents (
document_id number,
document_type_code text,
grant_id number,
sent_date time,
response_received_date time,
other_details text
)
CREATE TABLE grants (
gr... | What is the complete description of the researcher role. | SELECT role_description FROM staff_roles WHERE role_code = 'researcher' | spider |
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_code varchar
)
CREATE TABLE days (
days_code varchar,
day_name varchar
)
CREATE TABLE date_day (
month_number int,
day_number int,
year int,
day_name varchar
)
CRE... | show me the flights from DALLAS to BALTIMORE at economy level | 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, fare_basis, flight, flight_fare WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BALTIMORE' AND fare_basis.economy = 'YES' AND fare.fare_ba... | atis |
CREATE TABLE table_name_30 (
date VARCHAR,
outcome VARCHAR,
partner VARCHAR
) | What Date has an Outcome of runner up, and a Partner of tyra calderwood? | SELECT date FROM table_name_30 WHERE outcome = "runner up" AND partner = "tyra calderwood" | sql_create_context |
CREATE TABLE table_name_17 (
bronze INTEGER,
gold INTEGER
) | Which is the highest bronze with gold less than 0? | SELECT MAX(bronze) FROM table_name_17 WHERE gold < 0 | sql_create_context |
CREATE TABLE zyjzjlb (
YLJGDM text,
JZLSH text,
MZJZLSH text,
KH text,
KLX number,
HZXM text,
WDBZ number,
RYDJSJ time,
RYTJDM number,
RYTJMC text,
JZKSDM text,
JZKSMC text,
RZBQDM text,
RZBQMC text,
RYCWH text,
CYKSDM text,
CYKSMC text,
CYBQDM tex... | 2006-04-21到2010-09-27期间,在小儿耳鼻喉科门诊就诊的人数有多少 | SELECT COUNT(*) FROM mzjzjlb WHERE JZKSMC = '小儿耳鼻喉科' AND JZKSRQ BETWEEN '2006-04-21' AND '2010-09-27' | css |
CREATE TABLE table_80355 (
"Date" text,
"Venue" text,
"Score" text,
"Result" text,
"Competition" text
) | Which item has a score of 5-1? | SELECT "Score" FROM table_80355 WHERE "Result" = '5-1' | wikisql |
CREATE TABLE table_2926 (
"Year" real,
"Population" real,
"Serbs" text,
"Germans" text,
"Romanians" text,
"Hungarians" text,
"Croats" text,
"Roma" text,
"Slovaks" text,
"Rest" text
) | What is the largest value of population? | SELECT MAX("Population") FROM table_2926 | wikisql |
CREATE TABLE table_31990 (
"Rank" real,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | Tell me the lowest silver for rank of 9 and bronze less than 2 | SELECT MIN("Silver") FROM table_31990 WHERE "Rank" = '9' AND "Bronze" < '2' | wikisql |
CREATE TABLE table_name_19 (
railway_number_s_ VARCHAR,
quantity VARCHAR
) | Which railway number has 3 quantity? | SELECT railway_number_s_ FROM table_name_19 WHERE quantity = 3 | sql_create_context |
CREATE TABLE table_name_13 (
oricon VARCHAR,
romaji_title VARCHAR
) | How many oricon's have a romaji title of rakuen -memorial tracks- (maxi-single)? | SELECT COUNT(oricon) FROM table_name_13 WHERE romaji_title = "rakuen -memorial tracks- (maxi-single)" | sql_create_context |
CREATE TABLE table_47623 (
"Portfolio" text,
"Minister" text,
"Took office" text,
"Left office" text,
"Party" text
) | What is Party, when Minister is 'Franco Frattini'? | SELECT "Party" FROM table_47623 WHERE "Minister" = 'franco frattini' | wikisql |
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE chartevents (
... | what is the amount of isosorbide dinitrate sa that was prescribed to patient 55360 for the last time on the current hospital visit? | SELECT prescriptions.dose_val_rx FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 55360 AND admissions.dischtime IS NULL) AND prescriptions.drug = 'isosorbide dinitrate sa' ORDER BY prescriptions.startdate DESC LIMIT 1 | mimic_iii |
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE d_icd_procedures ... | what was the last time patient 31300 was prescribed pantoprazole and furosemide in 03/2103, at the same time? | SELECT t1.startdate FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'pantoprazole' AND admissions.subject_id = 31300 AND STRFTIME('%y-%m', prescriptions.startdate) = '2103-03') AS t1 JOIN (SELECT admi... | mimic_iii |
CREATE TABLE table_204_212 (
id number,
"wager" text,
"winner" text,
"loser" text,
"location" text,
"date" text,
"notes" text
) | what is the total number of times hair has been a wager ? | SELECT COUNT(*) FROM table_204_212 WHERE "wager" = 'hair' | squall |
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
CreationDate time,
U... | Logarithmic diagram of vote delay after post. | SELECT LN(10) / LN(2) | sede |
CREATE TABLE table_72786 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Ground" text,
"Crowd" real,
"Date" text
) | On what date did the away team Fremantle play? | SELECT "Date" FROM table_72786 WHERE "Away team" = 'Fremantle' | wikisql |
CREATE TABLE table_train_90 (
"id" int,
"gender" string,
"alzheimer" bool,
"breast_cancer" bool,
"smoking" bool,
"heart_rate" int,
"age" float,
"NOUSE" float
) | heart rate < 45 or > 100 ; | SELECT * FROM table_train_90 WHERE heart_rate < 45 OR heart_rate > 100 | criteria2sql |
CREATE TABLE table_73242 (
"Player" text,
"Australian Open" real,
"French Open" real,
"Wimbledon" real,
"US Open" real
) | When did Shirley Fry Irvin win the US Open? | SELECT MIN("US Open") FROM table_73242 WHERE "Player" = 'Shirley Fry Irvin' | wikisql |
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... | how many patients have phys referral/normal deli as the admission location procedure icd9 code 309? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_location = "PHYS REFERRAL/NORMAL DELI" AND procedures.icd9_code = "309" | mimicsql_data |
CREATE TABLE bdmzjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
HZXM text,
JZKSDM text,
JZKSMC text,
JZLSH number,
KH text,
KLX number,
MZBMLX number,
MZJZLSH text,
MZZDBM text,
MZZDMC text,
MZZYZD... | 名为李红旭的病人有哪些检验报告单的报告日期在零六年三月二十日以后?这些报告单所对应的住院就诊的流水号是什么 | SELECT wdmzjzjlb.JZLSH FROM person_info JOIN hz_info JOIN wdmzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX WHERE person_info.XM = '李红旭' AND NOT wdmzjzjlb.JZLSH IN (SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ <= '2006-03-2... | css |
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE lab (
labid numbe... | what are the five most commonly given microbiology tests for patients who previously received anti-psychotic agent within 2 months? | SELECT t3.culturesite FROM (SELECT t2.culturesite, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'anti-psychotic agent') AS t1 JOIN (SELECT pa... | eicu |
CREATE TABLE table_58196 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What is the name of the home team that played away team Footscray? | SELECT "Home team" FROM table_58196 WHERE "Away team" = 'footscray' | wikisql |
CREATE TABLE zyjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
HZXM text,
JZKSDM text,
JZKSMC text,
JZLSH text,
KH text,
KLX number,
MZBMLX number,
MZJZLSH text,
MZZDBM text,
MZZDMC text,
MZZYZDZZBM... | 患者77448008在2009年8月4日到2021年6月15日内都做了什么检查把检验报告单号列出来 | SELECT zyjybgb.BGDH FROM hz_info JOIN mzjzjlb JOIN zyjybgb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB WHERE hz_info.RYBH = '77448008' AND zyjybgb.BGRQ BETWEEN '2009-08-04' AND '2021-06... | css |
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,
test_id varchar
)
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TAB... | List the prerequisites I 've finished for GREEKMOD 501 . | SELECT DISTINCT COURSE_0.department, COURSE_0.name, COURSE_0.number FROM course AS COURSE_0, course AS COURSE_1, course_prerequisite, student_record WHERE COURSE_0.course_id = course_prerequisite.pre_course_id AND COURSE_1.course_id = course_prerequisite.course_id AND COURSE_1.department = 'GREEKMOD' AND COURSE_1.numbe... | advising |
CREATE TABLE table_7933 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | Which High rebounds has a Game of 76? | SELECT "High rebounds" FROM table_7933 WHERE "Game" = '76' | wikisql |
CREATE TABLE table_55443 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | Where was the game when Geelong was the away team? | SELECT "Venue" FROM table_55443 WHERE "Away team" = 'geelong' | wikisql |
CREATE TABLE table_61344 (
"Name" text,
"Number" real,
"Position" text,
"Height" text,
"Year" text,
"Hometown" text
) | What is the Name of the Player from Albuquerque, New Mexico? | SELECT "Name" FROM table_61344 WHERE "Hometown" = 'albuquerque, new mexico' | wikisql |
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text... | Get user comments by tag. | SELECT Comments.Id AS "comment_link", Posts.Tags, Comments.Score, Text FROM Comments INNER JOIN Posts ON Comments.PostId = Posts.Id WHERE UserId = '##UserId##' AND Posts.Tags LIKE '%##Tag##%' ORDER BY Comments.CreationDate DESC | sede |
CREATE TABLE table_8914 (
"Name" text,
"Pos." text,
"Year" text,
"Height" text,
"Weight" real,
"Hometown" text,
"Last School" text
) | What is the hometown of Devon Bookert who is 6-3 tall? | SELECT "Hometown" FROM table_8914 WHERE "Height" = '6-3' AND "Name" = 'devon bookert' | wikisql |
CREATE TABLE table_43134 (
"Pick #" real,
"CFL Team" text,
"Player" text,
"Position" text,
"College" text
) | Which position's cfl team was the Montreal Alouettes when the pick number was less than 15? | SELECT "Position" FROM table_43134 WHERE "CFL Team" = 'montreal alouettes' AND "Pick #" < '15' | wikisql |
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_... | list all flights from CHICAGO to SEATTLE on CO which depart on saturday and serve meals | 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, food_service WHERE (((date_day.day_number = 26 AND date_day.month_number = 7 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight... | atis |
CREATE TABLE table_22344463_2 (
date_of_birth VARCHAR,
name VARCHAR
) | If the name is Timo Higgins, what is the total date of birth amount? | SELECT COUNT(date_of_birth) FROM table_22344463_2 WHERE name = "Timo Higgins" | sql_create_context |
CREATE TABLE table_name_91 (
tie_no VARCHAR,
away_team VARCHAR
) | What was the tie number when the away team was Wrexham? | SELECT tie_no FROM table_name_91 WHERE away_team = "wrexham" | sql_create_context |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | how many of the patients with nutritional marasmus had a hospital stay of more than 5 days? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.days_stay > "5" AND diagnoses.long_title = "Nutritional marasmus" | 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,
... | how many patients admitted before the year 2124 have diagnoses icd9 code 042? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2124" AND diagnoses.icd9_code = "042" | mimicsql_data |
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 whose gender is m and drug code is cefe1i? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.gender = "M" AND prescriptions.formulary_drug_cd = "CEFE1I" | mimicsql_data |
CREATE TABLE table_33880 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Record" text
) | Score of 3 - 2 had what record? | SELECT "Record" FROM table_33880 WHERE "Score" = '3 - 2' | wikisql |
CREATE TABLE table_name_62 (
place VARCHAR,
score VARCHAR
) | WHAT IS THE PLACE WITH A SCORE OF 76-69-64-70=279? | SELECT place FROM table_name_62 WHERE score = 76 - 69 - 64 - 70 = 279 | sql_create_context |
CREATE TABLE table_54592 (
"Player" text,
"Rec." real,
"Yards" real,
"Avg." real,
"TD's" real,
"Long" real
) | What was the long of Trandon Harvey who had an greater than 8 average, more than 3 rec., and more than 28 TD's? | SELECT SUM("Long") FROM table_54592 WHERE "Avg." > '8' AND "Rec." > '3' AND "Player" = 'trandon harvey' AND "TD's" > '28' | wikisql |
CREATE TABLE table_41010 (
"Bowl Game" text,
"Date" text,
"Stadium" text,
"City" text,
"Television" text,
"Conference Matchups" text,
"Payout ( US$ )" text
) | Which bowl game had a conference matchup of Ohio State vs. Texas? | SELECT "Bowl Game" FROM table_41010 WHERE "Conference Matchups" = 'ohio state vs. texas' | wikisql |
CREATE TABLE table_47960 (
"Cycle" real,
"Premiere date" text,
"Winner" text,
"Runner-up" text,
"Number of contestants" text,
"International Destinations" text
) | What is Number of Contestants, when International Destinations is London Lisbon? | SELECT "Number of contestants" FROM table_47960 WHERE "International Destinations" = 'london lisbon' | wikisql |
CREATE TABLE customers (
customer_name VARCHAR,
customer_id VARCHAR,
payment_method_code VARCHAR
)
CREATE TABLE customer_orders (
customer_id VARCHAR
) | Show the names of customers who use Credit Card payment method and have more than 2 orders. | SELECT T1.customer_name FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id = T2.customer_id WHERE T1.payment_method_code = 'Credit Card' GROUP BY T1.customer_id HAVING COUNT(*) > 2 | sql_create_context |
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,
... | when was the first time patient 002-30780 had been prescribed medication through the pegtube route during their first hospital visit? | SELECT medication.drugstarttime FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-30780' AND NOT patient.hospitaldischargetime IS NULL ORDER... | eicu |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.