instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_16423070_4 (
golf VARCHAR,
soccer VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many teams won at golf when wooster won soccer
| SELECT COUNT(golf) FROM table_16423070_4 WHERE soccer = "Wooster" | sql_create_context |
CREATE TABLE table_78540 (
"Round" real,
"Pick" text,
"Player" text,
"Position" text,
"School" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which round was Tom Morris picked in?
| SELECT COUNT("Round") FROM table_78540 WHERE "Player" = 'tom morris' | wikisql |
CREATE TABLE table_75904 (
"RR Romaja" text,
"M\u2013R Romaja" text,
"Hangul/Chosongul" text,
"Hanja" text,
"Area" text,
"Capital" text,
"Region" text,
"Country" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which capital has a Hangul o... | SELECT "Capital" FROM table_75904 WHERE "Hangul/Chosongul" = '경상남도' | wikisql |
CREATE TABLE table_29697744_1 (
movements VARCHAR,
position VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the name of the movement in the 7th position
| SELECT movements FROM table_29697744_1 WHERE position = "7th" | sql_create_context |
CREATE TABLE jybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH text,
BGJGDM text,
BGJGMC text,
BGRGH text,
BGRQ time,
BGRXM text,
BGSJ time,
CJRQ time,
JSBBRQSJ time,
JSBBSJ time,
JYBBH text,
JYJGMC text,
JYJSGH text,
JYJSQM text,
JY... | SELECT jyjgzbb.YQBH, jyjgzbb.YQMC FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN person_info_hz_info ON person_info.RYBH = person_info_hz_info.RYBH AND 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... | css |
CREATE TABLE Ref_Calendar (
Calendar_Date DATETIME,
Day_Number INTEGER
)
CREATE TABLE Roles (
Role_Code CHAR(15),
Role_Name VARCHAR(255),
Role_Description VARCHAR(255)
)
CREATE TABLE Ref_Document_Types (
Document_Type_Code CHAR(15),
Document_Type_Name VARCHAR(255),
Document_Type_Descri... | SELECT Date_in_Locaton_To, COUNT(Date_in_Locaton_To) FROM Document_Locations GROUP BY Date_in_Locaton_To | nvbench |
CREATE TABLE table_name_35 (
second VARCHAR,
nation VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was second for the United States team?
| SELECT second FROM table_name_35 WHERE nation = "united states" | sql_create_context |
CREATE TABLE equipment_sequence (
aircraft_code_sequence varchar,
aircraft_code varchar
)
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_code varchar
)
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
... | 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 = 26 AND da... | atis |
CREATE TABLE table_28484 (
"Week #" text,
"Theme" text,
"Song choice" text,
"Original artist" text,
"Order #" text,
"Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many times is the original artist Alicia keys?
| SELECT COUNT("Result") FROM table_28484 WHERE "Original artist" = 'Alicia Keys' | wikisql |
CREATE TABLE zyb (
CLINIC_ID text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
INSU_TYPE text,
IN... | SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM qtb JOIN t_kc22 ON qtb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE qtb.PERSON_ID = '39270764' AND t_kc22.MED_INV_ITEM_TYPE = '治疗费' UNION SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM gyb JOIN t_kc22 ON gyb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE ... | css |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE cost (
costid number,
... | SELECT COUNT(*) > 0 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-62367')) AND treatment.treatmentname = 'therapeutic antibacterials - van... | eicu |
CREATE TABLE table_name_89 (
place VARCHAR,
score VARCHAR,
country VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When the score is 71 and the player is from United States what is the place?
| SELECT place FROM table_name_89 WHERE score = 71 AND country = "united states" | sql_create_context |
CREATE TABLE table_7254 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What score has notts county as the home team?
| SELECT "Score" FROM table_7254 WHERE "Home team" = 'notts county' | wikisql |
CREATE TABLE files (
f_id number,
artist_name text,
file_size text,
duration text,
formats text
)
CREATE TABLE song (
song_name text,
artist_name text,
country text,
f_id number,
genre_is text,
rating number,
languages text,
releasedate time,
resolution number
)
... | SELECT artist_name FROM artist WHERE country = "UK" AND gender = "Male" | spider |
CREATE TABLE table_75955 (
"Tournament" text,
"2006" text,
"2009" text,
"2012" text,
"2013" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the 2006 when the 2013 is 1r, and the 2012 is 1r?
| SELECT "2006" FROM table_75955 WHERE "2013" = '1r' AND "2012" = '1r' | wikisql |
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
discharge_location text,
insurance text,
language text,
marital_status text,
ethnicity text,
age number
)
CREATE ... | SELECT t1.drug FROM (SELECT prescriptions.drug, COUNT(prescriptions.startdate) AS c1 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 22648) AND DATETIME(prescriptions.startdate, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-0 ... | mimic_iii |
CREATE TABLE table_204_699 (
id number,
"district" text,
"name" text,
"party" text,
"residence" text,
"first served" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- nelsano albano served in the same year as which washington twp . member ?
| SELECT "name" FROM table_204_699 WHERE "name" <> 'nelson albano' AND "first served" = (SELECT "first served" FROM table_204_699 WHERE "name" = 'nelson albano') AND "residence" = 'washington twp' | squall |
CREATE TABLE table_name_95 (
score VARCHAR,
place VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Score has a Place of t2?
| SELECT score FROM table_name_95 WHERE place = "t2" | sql_create_context |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE cost (
costid number,
uniquepid text,... | SELECT vitalperiodic.observationtime FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-2586')) AND NOT vitalperiodic.respiration IS NU... | eicu |
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDisplayName text... | SELECT Id, LastActivityDate, CreationDate, Score, ViewCount, Body, OwnerUserId, Title, Tags, AnswerCount FROM Posts WHERE Tags LIKE '%<windows-phone%' AND PostTypeId = 1 AND CreationDate >= '01/01/2018' ORDER BY LastActivityDate DESC | sede |
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
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 ... | SELECT SALARY, COMMISSION_PCT FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) | nvbench |
CREATE TABLE table_53963 (
"NGC number" real,
"Object type" text,
"Constellation" text,
"Right ascension ( J2000 )" text,
"Declination ( J2000 )" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What type of object has an NGC number higher than 2090 a... | SELECT "Object type" FROM table_53963 WHERE "NGC number" > '2090' AND "Right ascension ( J2000 )" = '05h52m19s' | wikisql |
CREATE TABLE table_14378 (
"Year" real,
"Tournament" text,
"Venue" text,
"Result" text,
"Distance" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In which year did he finish 8th?
| SELECT "Year" FROM table_14378 WHERE "Result" = '8th' | wikisql |
CREATE TABLE table_name_77 (
year VARCHAR,
national_champion VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In what Year was Rhode Island the National Champion?
| SELECT year FROM table_name_77 WHERE national_champion = "rhode island" | sql_create_context |
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABLE fare_basis (
fare_basis_code text,
booking_class text,
class_type text,
premium text,
economy text,
discounted text,
night text,
season text,
basis_days text
)
CREATE TABLE flight_s... | 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 = 'MIAMI' AND date_day.day_number = 23 AND date_day.month_number = 4 AND da... | atis |
CREATE TABLE table_19778010_5 (
game INTEGER,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the number of the game played on June 22?
| SELECT MAX(game) FROM table_19778010_5 WHERE date = "June 22" | sql_create_context |
CREATE TABLE table_19338 (
"Rank" real,
"Name" text,
"Nationality" text,
"1st (m)" text,
"2nd (m)" text,
"Points" text,
"Overall FHT points" text,
"Overall WC points (Rank)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many total p... | SELECT "Overall WC points (Rank)" FROM table_19338 WHERE "Name" = 'Roman Koudelka' | wikisql |
CREATE TABLE table_name_22 (
tries_against VARCHAR,
tries_for VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Tries Against, when Tries For is 20?
| SELECT tries_against FROM table_name_22 WHERE tries_for = "20" | sql_create_context |
CREATE TABLE mzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH text,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZDZZMC ... | SELECT * FROM person_info JOIN hz_info JOIN mzjzjlb JOIN hz_info_mzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info_mzjz... | css |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime... | SELECT vitalperiodic.observationtime FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '015-52724')) AND NOT vitalperiodic.heartrate IS NUL... | eicu |
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_... | SELECT DISTINCT food_service.compartment, food_service.meal_code, food_service.meal_number FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, flight, food_service WHERE (((CITY_1.city_code = AIRPORT_SERVI... | atis |
CREATE TABLE table_3313 (
"Position" real,
"Sail number" text,
"Yacht" text,
"State/country" text,
"Yacht type" text,
"LOA (Metres)" text,
"Skipper" text,
"Corrected time d:hh:mm:ss" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What we... | SELECT "LOA (Metres)" FROM table_3313 WHERE "Yacht" = 'Ichi Ban' | wikisql |
CREATE TABLE table_58606 (
"Year" real,
"Tournament" text,
"Venue" text,
"Result" text,
"Extra" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which tournament resulted in 6th place?
| SELECT "Tournament" FROM table_58606 WHERE "Result" = '6th' | wikisql |
CREATE TABLE Documents_to_be_Destroyed (
Document_ID INTEGER,
Destruction_Authorised_by_Employee_ID INTEGER,
Destroyed_by_Employee_ID INTEGER,
Planned_Destruction_Date DATETIME,
Actual_Destruction_Date DATETIME,
Other_Details VARCHAR(255)
)
CREATE TABLE All_Documents (
Document_ID INTEGER,
... | SELECT Date_in_Locaton_To, COUNT(Date_in_Locaton_To) FROM Document_Locations GROUP BY Location_Code, Date_in_Locaton_To ORDER BY Date_in_Locaton_To | nvbench |
CREATE TABLE table_59946 (
"Rank" text,
"Name" text,
"Height ft (m)" text,
"Floors" real,
"Year" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How tall is the structure built in 1907?
| SELECT "Height ft (m)" FROM table_59946 WHERE "Year" = '1907' | wikisql |
CREATE TABLE table_49496 (
"Issued" real,
"Type" text,
"Design" text,
"Serial format" text,
"Serials issued" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the issued serial given in 1966?
| SELECT "Serials issued" FROM table_49496 WHERE "Issued" = '1966' | wikisql |
CREATE TABLE bank (
branch_ID int,
bname varchar(20),
no_of_customers int,
city varchar(10),
state varchar(20)
)
CREATE TABLE customer (
cust_ID varchar(3),
cust_name varchar(20),
acc_type char(1),
acc_bal int,
no_of_loans int,
credit_score int,
branch_ID int,
state ... | SELECT cust_name, acc_bal FROM customer WHERE cust_name LIKE '%a%' ORDER BY acc_bal DESC | nvbench |
CREATE TABLE table_name_77 (
object_type VARCHAR,
right_ascension___j2000__ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the object type when the right ascension (j2000) is 11h10m42.8s?
| SELECT object_type FROM table_name_77 WHERE right_ascension___j2000__ = "11h10m42.8s" | sql_create_context |
CREATE TABLE table_name_96 (
loss VARCHAR,
record VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What loss has 26-9 as a loss?
| SELECT loss FROM table_name_96 WHERE record = "26-9" | sql_create_context |
CREATE TABLE table_203_620 (
id number,
"tie no" number,
"home team" text,
"score" text,
"away team" text,
"attendance" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which team was the first team to score six goals ?
| SELECT "home team" FROM table_203_620 WHERE "score" = 6 LIMIT 1 | squall |
CREATE TABLE table_68203 (
"Team" text,
"City" text,
"Stadium" text,
"Manager" text,
"Past season" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what stadium has a prior record of 7th?
| SELECT "Stadium" FROM table_68203 WHERE "Past season" = '7th' | wikisql |
CREATE TABLE table_47749 (
"Elector" text,
"Nationality" text,
"Order and title" text,
"Elevated" text,
"Elevator" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When the elevator was Innocent IV what was the nationality?
| SELECT "Nationality" FROM table_47749 WHERE "Elevator" = 'innocent iv' | wikisql |
CREATE TABLE attribute_definitions (
attribute_id number,
attribute_name text,
attribute_data_type text
)
CREATE TABLE catalog_contents (
catalog_entry_id number,
catalog_level_number number,
parent_entry_id number,
previous_entry_id number,
next_entry_id number,
catalog_entry_name ... | SELECT DISTINCT (catalog_publisher) FROM catalogs WHERE catalog_publisher LIKE "%Murray%" | spider |
CREATE TABLE table_31945 (
"Outcome" text,
"Date" text,
"Tournament" text,
"Surface" text,
"Opponent in the final" text,
"Score" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Tell me the tournament with a hard surface for 6 1, 6 2
| SELECT "Tournament" FROM table_31945 WHERE "Surface" = 'hard' AND "Score" = '6–1, 6–2' | wikisql |
CREATE TABLE table_66262 (
"Event" text,
"Performance" text,
"Athlete" text,
"Nation" text,
"Place" text,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the date when Yelena Isinbayeva for Russia was in Beijing, China?
| SELECT "Date" FROM table_66262 WHERE "Nation" = 'russia' AND "Place" = 'beijing, china' AND "Athlete" = 'yelena isinbayeva' | wikisql |
CREATE TABLE table_28540609_2 (
earnings__ VARCHAR,
best_finish VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many earnings values are associated with players who had a best finish of T38?
| SELECT COUNT(earnings__) AS €_ FROM table_28540609_2 WHERE best_finish = "T38" | sql_create_context |
CREATE TABLE table_58991 (
"Name" text,
"Years" text,
"MLS Cup" real,
"U.S. Open Cup" real,
"CONCACAF" real,
"Other" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total where there are 4 MLS Cups and more US Open C... | SELECT COUNT("Total") FROM table_58991 WHERE "MLS Cup" = '4' AND "U.S. Open Cup" > '1' | wikisql |
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGu... | SELECT Id AS "user_link", DisplayName, Reputation FROM Users WHERE Reputation > @RepLimit AND NOT EXISTS(SELECT Id FROM Badges AS b WHERE b.UserId = Users.Id AND b.Name = 'Peer Pressure') ORDER BY Reputation DESC | sede |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dod_year <= "2115.0" AND prescriptions.formulary_drug_cd = "GLYB5" | mimicsql_data |
CREATE TABLE table_4036 (
"Pick #" real,
"Player" text,
"Position" text,
"Nationality" text,
"NHL team" text,
"College/junior/club team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which junior team is associated with an NHL pick by the Buffa... | SELECT "College/junior/club team" FROM table_4036 WHERE "NHL team" = 'Buffalo Sabres' | wikisql |
CREATE TABLE table_name_29 (
jianshu INTEGER,
rank VARCHAR,
qiangshu VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average Jianshu higher than rank 2, with a Qiangshu smaller than 9.85?
| SELECT AVG(jianshu) FROM table_name_29 WHERE rank < 2 AND qiangshu < 9.85 | sql_create_context |
CREATE TABLE table_204_443 (
id number,
"week" number,
"date" text,
"opponent" text,
"result" text,
"game site" text,
"attendance" number,
"bye" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the date for the first game played in... | SELECT "date" FROM table_204_443 WHERE "game site" = 'the meadowlands' ORDER BY "date" LIMIT 1 | squall |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_location = "PHYS REFERRAL/NORMAL DELI" AND diagnoses.short_title = "29-30 comp wks gestation" | mimicsql_data |
CREATE TABLE table_name_33 (
top_25 INTEGER,
events VARCHAR,
cuts_made VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Tell me the average top 25 with events of 5 and cuts madde less than 3
| SELECT AVG(top_25) FROM table_name_33 WHERE events = 5 AND cuts_made < 3 | sql_create_context |
CREATE TABLE neighborhood (
id int,
business_id varchar,
neighborhood_name varchar
)
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,
rat... | SELECT city FROM business WHERE name = 'Taj Mahal' | yelp |
CREATE TABLE table_17330069_1 (
fin_pos VARCHAR,
points VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- If the points is 15, what is the fin. pos?
| SELECT COUNT(fin_pos) FROM table_17330069_1 WHERE points = "15" | 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,
... | SELECT gwyjzb.IN_DIAG_DIS_CD, gwyjzb.IN_DIAG_DIS_NM FROM gwyjzb WHERE gwyjzb.PERSON_ID = '32023982' AND gwyjzb.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT >= 3281.11) UNION SELECT fgwyjzb.IN_DIAG_DIS_CD, fgwyjzb.IN_DIAG_DIS_NM FROM fgwyjzb WHERE fgwyjzb.PERSON_ID = '32023982' AND fg... | css |
CREATE TABLE table_name_68 (
percent_yes VARCHAR,
jurisdiction VARCHAR,
percent_no VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the percent yes of Alberta, which had a percent no larger than 60.2?
| SELECT COUNT(percent_yes) FROM table_name_68 WHERE jurisdiction = "alberta" AND percent_no > 60.2 | sql_create_context |
CREATE TABLE zyb (
CLINIC_ID text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
INSU_TYPE text,
IN... | SELECT qtb.MED_ORG_DEPT_CD, qtb.MED_ORG_DEPT_NM, AVG(qtb.IN_HOSP_DAYS) FROM qtb WHERE qtb.MED_SER_ORG_NO = '2092473' GROUP BY qtb.MED_ORG_DEPT_CD ORDER BY AVG(qtb.IN_HOSP_DAYS) UNION SELECT gyb.MED_ORG_DEPT_CD, gyb.MED_ORG_DEPT_NM, AVG(gyb.IN_HOSP_DAYS) FROM gyb WHERE gyb.MED_SER_ORG_NO = '2092473' GROUP BY gyb.MED_ORG... | css |
CREATE TABLE table_37099 (
"Title" text,
"Date" text,
"Theatre" text,
"Role" text,
"Dance Partner" text,
"Director" text,
"Lyrics" text,
"Music" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Title has a Dance Partner of adele asta... | SELECT "Title" FROM table_37099 WHERE "Dance Partner" = 'adele astaire' AND "Lyrics" = 'ira gershwin' AND "Director" = 'felix edwardes' | wikisql |
CREATE TABLE table_28499 (
"Institution" text,
"Location" text,
"Founded" real,
"Type" text,
"Enrollment" real,
"Joined" real,
"Nickname" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many joined when the enrollment was 1150 in Sioux Ci... | SELECT "Joined" FROM table_28499 WHERE "Enrollment" = '1150' AND "Location" = 'Sioux City, Iowa' | wikisql |
CREATE TABLE table_name_44 (
year_opened VARCHAR,
arena_venue VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What year did the San Agustin gym open?
| SELECT year_opened FROM table_name_44 WHERE arena_venue = "san agustin gym" | sql_create_context |
CREATE TABLE table_23398 (
"No. in series" text,
"No. in season" real,
"Family/families" text,
"Location(s)" text,
"Original air date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What episode in the season was episode us18 in the series?
| SELECT COUNT("No. in season") FROM table_23398 WHERE "No. in series" = 'US18' | wikisql |
CREATE TABLE tryout (
enr INTEGER,
cName VARCHAR,
pPos VARCHAR
)
CREATE TABLE college (
enr INTEGER,
cName VARCHAR,
pPos VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total number of enrollment of schools that do not have any go... | SELECT SUM(enr) FROM college WHERE NOT cName IN (SELECT cName FROM tryout WHERE pPos = "goalie") | sql_create_context |
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE cost (
row_id number,
subject_id... | SELECT MAX(t1.c1) FROM (SELECT COUNT(DISTINCT diagnoses_icd.hadm_id) AS c1 FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'chro kidney dis stage ii') AND STRFTIME('%y', diagnoses_icd.charttime) >= '2102' GROUP BY STRFTIME('%y... | mimic_iii |
CREATE TABLE table_4195 (
"Season" real,
"Series" text,
"Team" text,
"Races" real,
"Wins" real,
"Poles" real,
"F/Laps" real,
"Podiums" real,
"Points" real,
"Position" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many season... | SELECT COUNT("Season") FROM table_4195 WHERE "Position" = '3rd' | wikisql |
CREATE TABLE table_23285849_10 (
game VARCHAR,
team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When the clippers are the team how many games are there?
| SELECT COUNT(game) FROM table_23285849_10 WHERE team = "Clippers" | sql_create_context |
CREATE TABLE table_204_109 (
id number,
"district" text,
"incumbent" text,
"party" text,
"first\nelected" text,
"result" text,
"candidates" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what are the number of times re elected is listed as t... | SELECT COUNT(*) FROM table_204_109 WHERE "result" = 're-elected' | squall |
CREATE TABLE track (
track_id number,
name text,
location text,
seating number,
year_opened number
)
CREATE TABLE race (
race_id number,
name text,
class text,
date text,
track_id text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- W... | SELECT name, seating FROM track WHERE year_opened > 2000 ORDER BY seating | spider |
CREATE TABLE cite (
citingpaperid int,
citedpaperid int
)
CREATE TABLE keyphrase (
keyphraseid int,
keyphrasename varchar
)
CREATE TABLE paperfield (
fieldid int,
paperid int
)
CREATE TABLE paperdataset (
paperid int,
datasetid int
)
CREATE TABLE paperkeyphrase (
paperid int,
... | SELECT DISTINCT paperid FROM paper WHERE year = 2014 | scholar |
CREATE TABLE table_name_69 (
visitor VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which team was the visitor on January 10?
| SELECT visitor FROM table_name_69 WHERE date = "january 10" | sql_create_context |
CREATE TABLE table_2192 (
"Year(s)" real,
"Commentator" text,
"Dual Commentator" text,
"Spokesperson" text,
"Channel" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- state all spokesperson for the channel where dual commentator was elena batinova
| SELECT "Spokesperson" FROM table_2192 WHERE "Dual Commentator" = 'Elena Batinova' | wikisql |
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,
... | SELECT zyjzjlb.ZYZDBM, zyjzjlb.ZYZDMC FROM hz_info JOIN zyjzjlb JOIN person_info_hz_info JOIN person_info ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX AND person_info_hz_info.KH = hz_info.KH AND person_info_hz_info.KLX = hz_info.KLX AND person_info_hz_info.YLJGDM = hz_inf... | css |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admityear < "2107" | mimicsql_data |
CREATE TABLE table_43083 (
"Usage" text,
"Sn/Sb (%)" text,
"Liquid at (\u00b0C)" text,
"Casting at (\u00b0C)" text,
"Remelting at (\u00b0C)" text,
"Hardness" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the remelting temperature for th... | SELECT "Remelting at (\u00b0C)" FROM table_43083 WHERE "Sn/Sb (%)" = '9.5/15' | wikisql |
CREATE TABLE table_2697 (
"Year" real,
"Date" text,
"Driver" text,
"Team" text,
"Manufacturer" text,
"Laps" text,
"Miles (km)" text,
"Race Time" text,
"Average Speed (mph)" text,
"Report" text
)
-- Using valid SQLite, answer the following questions for the tables provided above... | SELECT COUNT("Report") FROM table_2697 WHERE "Date" = 'July 23' | wikisql |
CREATE TABLE table_14962316_9 (
recopa_sudamericana_1998 VARCHAR,
team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Did Flamengo play in the Recopa Sudamericana in 1998
| SELECT recopa_sudamericana_1998 FROM table_14962316_9 WHERE team = "Flamengo" | sql_create_context |
CREATE TABLE table_1612760_1 (
line VARCHAR,
service_pattern VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which line offers Fast to Norwood Junction?
| SELECT line FROM table_1612760_1 WHERE service_pattern = "Fast to Norwood Junction" | sql_create_context |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime... | SELECT COUNT(*) > 0 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-9636')) AND medication.drugname = 'calcium gluconate 10%' AND STRFTIME... | eicu |
CREATE TABLE Addresses (
city VARCHAR,
address_id VARCHAR
)
CREATE TABLE Staff (
staff_address_id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which city lives most of staffs? List the city name and number of staffs.
| SELECT T1.city, COUNT(*) FROM Addresses AS T1 JOIN Staff AS T2 ON T1.address_id = T2.staff_address_id GROUP BY T1.city ORDER BY COUNT(*) DESC LIMIT 1 | sql_create_context |
CREATE TABLE table_21429 (
"Season" real,
"Series" text,
"Team" text,
"Races" real,
"Wins" real,
"Poles" real,
"FLaps" real,
"Podiums" real,
"Points" real,
"Position" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which season di... | SELECT MAX("Season") FROM table_21429 WHERE "Points" = '0' AND "Position" = '31st' | wikisql |
CREATE TABLE table_204_55 (
id number,
"date" text,
"time" text,
"opponent#" text,
"rank#" text,
"site" text,
"tv" text,
"result" text,
"attendance" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what date is after october 1st ?
| SELECT "date" FROM table_204_55 WHERE "date" > (SELECT "date" FROM table_204_55 WHERE "date" = 'october 1, 2005') ORDER BY "date" LIMIT 1 | squall |
CREATE TABLE table_name_47 (
year INTEGER,
position VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the average Year for the Position of 7th (sf)?
| SELECT AVG(year) FROM table_name_47 WHERE position = "7th (sf)" | sql_create_context |
CREATE TABLE table_name_4 (
against INTEGER,
played INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest Against when the played is more than 10?
| SELECT MIN(against) FROM table_name_4 WHERE played > 10 | sql_create_context |
CREATE TABLE schedule (
Cinema_ID int,
Film_ID int,
Date text,
Show_times_per_day int,
Price float
)
CREATE TABLE cinema (
Cinema_ID int,
Name text,
Openning_year int,
Capacity int,
Location text
)
CREATE TABLE film (
Film_ID int,
Rank_in_series int,
Number_in_seaso... | SELECT Directed_by, COUNT(Directed_by) FROM film GROUP BY Directed_by ORDER BY COUNT(Directed_by) | 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,
... | SELECT DISTINCT patient.gender FROM patient WHERE patient.uniquepid = '027-144847' | eicu |
CREATE TABLE table_1057262_2 (
tasmania VARCHAR,
new_south_wales VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what's the total number of tasmania with new south wales crop of 190 kilotonnes
| SELECT COUNT(tasmania) FROM table_1057262_2 WHERE new_south_wales = 190 | sql_create_context |
CREATE TABLE table_27922491_8 (
wickets INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the least amount of wickets?
| SELECT MIN(wickets) FROM table_27922491_8 | sql_create_context |
CREATE TABLE table_202_179 (
id number,
"pos" text,
"no" number,
"driver" text,
"constructor" text,
"laps" number,
"time/retired" text,
"grid" number,
"points" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who were the top 3 finis... | SELECT "driver" FROM table_202_179 ORDER BY "points" DESC LIMIT 3 | squall |
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,... | SELECT prescriptions.drug_type FROM prescriptions WHERE prescriptions.drug = "Nafcillin" | mimicsql_data |
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... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "AMERICAN INDIAN/ALASKA NATIVE" AND demographic.diagnosis = "INFECTED RIGHT THIGH GRAFT" | mimicsql_data |
CREATE TABLE Employees (
Employee_ID INTEGER,
Role_Code CHAR(15),
Employee_Name VARCHAR(255),
Gender_MFU CHAR(1),
Date_of_Birth DATETIME,
Other_Details VARCHAR(255)
)
CREATE TABLE Document_Locations (
Document_ID INTEGER,
Location_Code CHAR(15),
Date_in_Location_From DATETIME,
D... | SELECT Date_in_Locaton_To, COUNT(Date_in_Locaton_To) FROM Document_Locations GROUP BY Location_Code ORDER BY COUNT(Date_in_Locaton_To) DESC | nvbench |
CREATE TABLE table_name_45 (
position VARCHAR,
round VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Position has a Round larger than 4, and a Player of patrick johnson?
| SELECT position FROM table_name_45 WHERE round > 4 AND player = "patrick johnson" | sql_create_context |
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
... | SELECT labevents.charttime FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 31482 AND admissions.dischtime IS NULL) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'calcium, total') ORDER BY labevents.valuenum, ... | mimic_iii |
CREATE TABLE table_66332 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Event" text,
"Round" real,
"Time" text,
"Location" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the fight against when loss was the result ... | SELECT "Opponent" FROM table_66332 WHERE "Res." = 'loss' AND "Event" = 'gladiator challenge 87: collision course' | wikisql |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE allergy (
allergyid number... | SELECT intakeoutput.intakeoutputtime FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '010-1155')) AND intakeoutput.cellpath LIKE '%intake%'... | eicu |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | SELECT demographic.diagnosis, prescriptions.route FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.name = "Albert Bauer" | mimicsql_data |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time... | SELECT COUNT(*) > 0 FROM allergy WHERE allergy.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-171217')) AND DATETIME(allergy.allergytime, 'start of year') = DATETIME(CURR... | eicu |
CREATE TABLE table_12963 (
"Opposing Teams" text,
"Against" real,
"Date" text,
"Venue" text,
"Status" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which venue had an against smaller than 7?
| SELECT "Venue" FROM table_12963 WHERE "Against" < '7' | wikisql |
CREATE TABLE table_77498 (
"Date" text,
"Tournament" text,
"Winning score" text,
"To par" text,
"Margin of victory" text,
"Runner-up" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the to par of the tournament that had Ken Duke as a run... | SELECT "To par" FROM table_77498 WHERE "Runner-up" = 'ken duke' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.