instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_name_42 (
finish VARCHAR,
year INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Give the Finish for years after 2007.
| SELECT finish FROM table_name_42 WHERE year > 2007 | sql_create_context |
CREATE TABLE table_name_38 (
date VARCHAR,
week VARCHAR,
opponent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the date of the game after week 6 with the New York Jets as the opponent?
| SELECT date FROM table_name_38 WHERE week > 6 AND opponent = "new york jets" | sql_create_context |
CREATE TABLE table_39801 (
"Name" text,
"Status" text,
"Authors" text,
"Unit" text,
"Location" text,
"Notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What unit is located in China and has Zhou Zhang as an author?
| SELECT "Unit" FROM table_39801 WHERE "Location" = 'china' AND "Authors" = 'zhou zhang' | wikisql |
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description varchar
)
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)
CREATE TABLE city (
city_code varchar,
... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'MIAMI' AND flight.arrival_time < 1600 AND flight.to_airport = AIRPORT_SERVICE_1.airport_... | atis |
CREATE TABLE table_78229 (
"Peak" text,
"Height (m)" real,
"Prom. (m)" real,
"Class" text,
"Parent" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Class is Peak Sail when it has a Prom larger than 30?
| SELECT "Class" FROM table_78229 WHERE "Prom. (m)" > '30' AND "Peak" = 'sail' | wikisql |
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE i... | SELECT prescriptions.dose_val_rx FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 64292) AND prescriptions.drug = 'sulfameth/trimethoprim ds' AND STRFTIME('%y-%m', prescriptions.startdate) <= '2105-03' ORDER BY prescriptions.startdate DESC LIMIT ... | mimic_iii |
CREATE TABLE table_34654 (
"Number of Decks" real,
"Non-Suited Match" text,
"Double Non-Suited Match" text,
"Suited Match" text,
"Suited + Non-Suited Match" text,
"Double Suited Match" text,
"House Edge" text
)
-- Using valid SQLite, answer the following questions for the tables provided a... | SELECT "Double Non-Suited Match" FROM table_34654 WHERE "Non-Suited Match" = '3:1' AND "House Edge" = '3.53%' | wikisql |
CREATE TABLE gyb (
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 SUM(mzb.MED_CLINIC_ID) FROM mzb WHERE mzb.PERSON_NM = '25376993' | css |
CREATE TABLE table_13214 (
"Rank" text,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Gold has a Total of 721?
| SELECT AVG("Gold") FROM table_13214 WHERE "Total" = '721' | wikisql |
CREATE TABLE table_26828 (
"Branding" text,
"Callsign" text,
"Frequency" text,
"Power kW" text,
"Coverage" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- when coverage is dumaguete central visayas region, what is the callsign?
| SELECT "Callsign" FROM table_26828 WHERE "Coverage" = 'Dumaguete Central Visayas Region' | wikisql |
CREATE TABLE table_17288825_6 (
date VARCHAR,
high_assists VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When aaron brooks (6) had the highest amount of assists what is the date?
| SELECT date FROM table_17288825_6 WHERE high_assists = "Aaron Brooks (6)" | sql_create_context |
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... | SELECT COUNT(*) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-200601' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient... | eicu |
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,... | SELECT COUNT(*) FROM t_kc22 WHERE t_kc22.MED_ORG_DEPT_NM = '白内障科' AND t_kc22.STA_DATE BETWEEN '2015-05-05' AND '2020-03-15' AND t_kc22.SOC_SRT_DIRE_CD = '663699179-x' | css |
CREATE TABLE Reservations (
Kids VARCHAR,
LastName VARCHAR,
CheckIn VARCHAR,
FirstName VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many kids stay in the room DAMIEN TRACHSEL checked in on Sep 21, 2010?
| SELECT Kids FROM Reservations WHERE CheckIn = "2010-09-21" AND FirstName = "DAMIEN" AND LastName = "TRACHSEL" | sql_create_context |
CREATE TABLE gwyjzb (
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.MED_CLINIC_ID FROM gwyjzb WHERE gwyjzb.PERSON_NM = '秦鸿德' AND gwyjzb.MED_SER_ORG_NO = '6682741' 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 = '6682741' AND NOT fgwyjzb.OUT_DIAG_DIS_NM LIKE '%脑瘫%' | css |
CREATE TABLE procedures (
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,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "CLINIC REFERRAL/PREMATURE" AND demographic.admityear < "2121" | mimicsql_data |
CREATE TABLE table_204_885 (
id number,
"season" text,
"competition" text,
"round" text,
"opponent" text,
"home" text,
"away" text,
"agg." text,
"bye" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- name the competition that occured d... | SELECT "competition" FROM table_204_885 WHERE "season" > (SELECT "season" FROM table_204_885 WHERE "competition" = 'european cup' AND "season" = '1985-86') ORDER BY "season" LIMIT 1 | squall |
CREATE TABLE table_name_42 (
points VARCHAR,
played INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the number of points when the played is less than 30?
| SELECT COUNT(points) FROM table_name_42 WHERE played < 30 | sql_create_context |
CREATE TABLE t_kc22 (
MED_EXP_DET_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
MED_EXP_BILL_ID text,
SOC_SRT_DIRE_CD text,
SOC_SRT_DIRE_NM text,
DIRE_TYPE number,
CHA_ITEM_LEV number,
MED_INV_ITEM_TYPE text,
MED_DIRE_CD text,
MED_DIRE_NM text,... | SELECT MED_SER_ORG_NO FROM t_kc21 WHERE PERSON_ID = '70715838' AND MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc22 WHERE SOC_SRT_DIRE_CD = '986663290') | 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 cost (
costid num... | SELECT lab.labresulttime FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-35481')) AND lab.labname = '-eos' AND DATETIME(lab.labresulttime, 'start of yea... | eicu |
CREATE TABLE table_name_51 (
score VARCHAR,
competition VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- A competition of test taking place on 23 Apr 1988 had what as a score?
| SELECT score FROM table_name_51 WHERE competition = "test" AND date = "23 apr 1988" | sql_create_context |
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
-- Using valid SQLite, answer the following questions for the... | SELECT Headquarter, COUNT(DISTINCT T1.Name) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code | nvbench |
CREATE TABLE table_train_269 (
"id" int,
"pregnancy_or_lactation" bool,
"hemoglobin_a1c_hba1c" float,
"diabetic" string,
"hba1c" float,
"prisoners" bool,
"age" float,
"NOUSE" float
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- pregnant femal... | SELECT * FROM table_train_269 WHERE pregnancy_or_lactation = 1 | criteria2sql |
CREATE TABLE table_14562722_2 (
episodes INTEGER,
region_4 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the most epiosdes when region 4 is march 13, 2008
| SELECT MAX(episodes) FROM table_14562722_2 WHERE region_4 = "March 13, 2008" | sql_create_context |
CREATE TABLE table_name_9 (
injured VARCHAR,
location VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the injured that has skierlik as the location?
| SELECT injured FROM table_name_9 WHERE location = "skierlik" | sql_create_context |
CREATE TABLE stock (
shop_id number,
device_id number,
quantity number
)
CREATE TABLE shop (
shop_id number,
shop_name text,
location text,
open_date text,
open_year number
)
CREATE TABLE device (
device_id number,
device text,
carrier text,
package_version text,
ap... | SELECT carrier FROM device ORDER BY carrier | spider |
CREATE TABLE table_48922 (
"Model Number" text,
"Clock Speed" text,
"L2 Cache" text,
"FSB Speed" text,
"Voltage Range" text,
"Socket" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the L2 Cache which has a Clock Speed of 1.5 ghz?
| SELECT "L2 Cache" FROM table_48922 WHERE "Clock Speed" = '1.5 ghz' | wikisql |
CREATE TABLE restriction (
restriction_code text,
advance_purchase int,
stopovers text,
saturday_stay_required text,
minimum_stay int,
maximum_stay int,
application text,
no_discounts text
)
CREATE TABLE flight (
aircraft_code_sequence text,
airline_code varchar,
airline_fli... | SELECT DISTINCT ground_service.transport_type FROM city, ground_service WHERE city.city_name = 'DENVER' AND ground_service.city_code = city.city_code | atis |
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 COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "HISPANIC OR LATINO" | mimicsql_data |
CREATE TABLE table_5595 (
"Date Released" text,
"Institute" text,
"Socialist" text,
"Social Democratic" text,
"Green-Communist" text,
"Left Bloc" text,
"People's Party" text,
"Lead" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the... | SELECT "People's Party" FROM table_5595 WHERE "Social Democratic" = '30.1%' | wikisql |
CREATE TABLE table_name_6 (
away_team VARCHAR,
home_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the away team score when Home team is fitzroy?
| SELECT away_team AS score FROM table_name_6 WHERE home_team = "fitzroy" | sql_create_context |
CREATE TABLE table_57489 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was Richmond's score as the home team at th... | SELECT "Home team score" FROM table_57489 WHERE "Crowd" > '15,130' AND "Home team" = 'richmond' | wikisql |
CREATE TABLE Faculty_Participates_in (
FacID INTEGER,
actid INTEGER
)
CREATE TABLE Participates_in (
stuid INTEGER,
actid INTEGER
)
CREATE TABLE Activity (
actid INTEGER,
activity_name varchar(25)
)
CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHAR(12),
Ag... | SELECT Building, COUNT(*) FROM Faculty GROUP BY Building | nvbench |
CREATE TABLE table_name_13 (
ccbs INTEGER,
payload_to_gto VARCHAR,
upper_stage VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the greatest CCBs with a Payload to GTO of , and an Upper stage of sec?
| SELECT MAX(ccbs) FROM table_name_13 WHERE payload_to_gto = "–" AND upper_stage = "sec" | sql_create_context |
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE locations (
LOCATIO... | SELECT PHONE_NUMBER, SALARY FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY PHONE_NUMBER DESC | nvbench |
CREATE TABLE table_name_2 (
total_region INTEGER,
year VARCHAR,
nebo VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the sum of Total Regions that have the Year 1954, and a Nebo greater than 447?
| SELECT SUM(total_region) FROM table_name_2 WHERE year = 1954 AND nebo > 447 | sql_create_context |
CREATE TABLE table_18989 (
"Country/Region" text,
"Local title" text,
"Television network" text,
"Seasons and winners" text,
"Judges" text,
"Presenters" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many local title with televbeingion netwo... | SELECT COUNT("Local title") FROM table_18989 WHERE "Television network" = 'TV Nova Website' | wikisql |
CREATE TABLE t_kc24 (
MED_SAFE_PAY_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
REF_SLT_FLG number,
CLINIC_SLT_DATE time,
COMP_ID text,
PERSON_ID text,
FLX_MED_ORG_ID text,
INSU_TYPE text,
MED_AMOUT number,
PER_ACC_PAY number,
OVE_PAY numb... | SELECT MED_ORG_DEPT_CD, MED_ORG_DEPT_NM FROM t_kc22 WHERE STA_DATE BETWEEN '2008-06-29' AND '2013-06-04' AND MED_INV_ITEM_TYPE = '手术费' GROUP BY MED_ORG_DEPT_CD ORDER BY COUNT(*) DESC LIMIT 24 | css |
CREATE TABLE hz_info (
KH text,
KLX number,
YLJGDM text,
RYBH text
)
CREATE TABLE mzjzjlb (
YLJGDM text,
JZLSH text,
KH text,
KLX number,
MJZH text,
HZXM text,
NLS number,
NLY number,
ZSEBZ number,
JZZTDM number,
JZZTMC text,
JZJSSJ time,
TXBZ number,... | SELECT JCZBMC, JCZBJGDW, AVG(JCZBJGDL) FROM jyjgzbb WHERE YLJGDM = '5826320' AND BGRQ BETWEEN '2010-02-23' AND '2014-09-26' GROUP BY JCZBMC, JCZBJGDW ORDER BY AVG(JCZBJGDL) DESC LIMIT 19 | css |
CREATE TABLE table_name_73 (
screen_size__inch_ VARCHAR,
intro_year VARCHAR,
model VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the size of the screen that came out in 2006 and is iliad
| SELECT screen_size__inch_ FROM table_name_73 WHERE intro_year = "2006" AND model = "iliad" | sql_create_context |
CREATE TABLE table_18840 (
"Club" text,
"Played" text,
"Won" text,
"Drawn" text,
"Lost" text,
"Points for" text,
"Points against" text,
"Tries for" text,
"Tries against" text,
"Try bonus" text,
"Losing bonus" text,
"Points" text
)
-- Using valid SQLite, answer the follo... | SELECT "Drawn" FROM table_18840 WHERE "Club" = 'Tylorstown RFC' | wikisql |
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 hz_info.person_info_JGDM, hz_info.person_info_JGMC, COUNT(hz_info.RYBH) FROM hz_info JOIN mzjzjlb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE mzjzjlb.JZZDBM = 'A73.395' GROUP BY hz_info.person_info_JGDM | css |
CREATE TABLE table_77509 (
"D 49" text,
"D 48" text,
"D 47" text,
"D 46" text,
"D 45" text,
"D 44" text,
"D 43" text,
"D 42" text,
"D 41" text,
"D 40" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- I want the D 46 for D 45 of r 5... | SELECT "D 46" FROM table_77509 WHERE "D 45" = 'r 5' | wikisql |
CREATE TABLE table_28522 (
"Institution" text,
"Location" text,
"Founded" real,
"Type" text,
"Enrollment" real,
"Joined" text,
"Left" text,
"Nickname" text,
"Primary Conference when joining the MSFA" text,
"Current Primary Conference" text
)
-- Using valid SQLite, answer the fo... | SELECT "Institution" FROM table_28522 WHERE "Joined" = '1996-97' AND "Left" = '2011-12' | wikisql |
CREATE TABLE table_203_634 (
id number,
"date" text,
"venue" text,
"score" text,
"victor" text,
"comments" text,
"match reports" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what year was the first union match between new zealand and wales... | SELECT MIN("date") FROM table_203_634 | squall |
CREATE TABLE table_2534 (
"Outcome" text,
"Year" real,
"Championship" text,
"Surface" text,
"Opponent in the final" text,
"Score in the final" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- List the final score of Wimbledon (2/2).
| SELECT "Score in the final" FROM table_2534 WHERE "Championship" = 'Wimbledon (2/2)' | wikisql |
CREATE TABLE table_203_794 (
id number,
"year" number,
"location" text,
"attendance" number,
"theme phrase" text,
"top messages" text,
"host" text,
"opening general session guest(s)" text,
"closing general session guest(s)" text,
"sunday night reception" text,
"wednesday nigh... | SELECT "year" FROM table_203_794 WHERE "location" = 'no event' | squall |
CREATE TABLE participates_in (
stuid number,
actid number
)
CREATE TABLE student (
stuid number,
lname text,
fname text,
age number,
sex text,
major number,
advisor number,
city_code text
)
CREATE TABLE activity (
actid number,
activity_name text
)
CREATE TABLE faculty... | SELECT building FROM faculty WHERE rank = "Professor" GROUP BY building HAVING COUNT(*) >= 10 | spider |
CREATE TABLE festival_detail (
festival_id number,
festival_name text,
chair_name text,
location text,
year number,
num_of_audience number
)
CREATE TABLE artwork (
artwork_id number,
type text,
name text
)
CREATE TABLE nomination (
artwork_id number,
festival_id number,
... | SELECT year FROM festival_detail GROUP BY year HAVING COUNT(*) > 1 | spider |
CREATE TABLE table_16799784_3 (
diameter__km_ VARCHAR,
latitude VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- At a latitude of 67.5n, what is the diameter?
| SELECT diameter__km_ FROM table_16799784_3 WHERE latitude = "67.5N" | sql_create_context |
CREATE TABLE table_21302_1 (
no_of_villages VARCHAR,
density_persons___ha VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many villages have a density persons/ha of 5.5?
| SELECT COUNT(no_of_villages) FROM table_21302_1 WHERE density_persons___ha = "5.5" | sql_create_context |
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABL... | SELECT MAX(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.hadm_id IN (SELECT diagnoses_icd.hadm_id FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'elev transaminase/ldh')) AND STRFTIME('%y', cost.chargetime) <=... | mimic_iii |
CREATE TABLE happy_hour (
MONTH VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which months have more than 2 happy hours?
| SELECT MONTH FROM happy_hour GROUP BY MONTH HAVING COUNT(*) > 2 | sql_create_context |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
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,
... | SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN wdmzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX AND wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jyb... | css |
CREATE TABLE wdmzjzjlb (
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 (SELECT COUNT(*) FROM person_info JOIN hz_info JOIN mzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE person_info.XM = '马璇珠' AND mzjzjlb.JZKSRQ BETWEEN '2021-08-25' AND '2021-09-05') + (SELECT COUNT(*) FROM person_info J... | css |
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text varchar
)
CREATE TABLE student_record (
student_id int,
course_id int,
semester int,
grade varc... | SELECT DISTINCT advisory_requirement, enforced_requirement, name FROM course WHERE department = 'EECS' AND number = 594 | advising |
CREATE TABLE table_20722805_1 (
obama_number INTEGER,
obama_percentage VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many votes did Obama have at 32.12%
| SELECT MIN(obama_number) FROM table_20722805_1 WHERE obama_percentage = "32.12%" | sql_create_context |
CREATE TABLE table_18161 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" text,
"Results" text,
"Candidates" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Incumbent Tim Holden belonged to what party?
| SELECT "Party" FROM table_18161 WHERE "Incumbent" = 'Tim Holden' | wikisql |
CREATE TABLE table_name_22 (
junior_marquee_player VARCHAR,
captain VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Junior Marquee team is Harry Kewell of?
| SELECT junior_marquee_player FROM table_name_22 WHERE captain = "harry kewell" | sql_create_context |
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 lab (
subject_id text,
hadm_id text,
... | SELECT AVG(demographic.age) FROM demographic WHERE demographic.gender = "F" AND demographic.insurance = "Medicaid" | mimicsql_data |
CREATE TABLE table_1198175_1 (
drafted VARCHAR,
pro_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is under drafted when pro team is arizona cardinals?
| SELECT drafted FROM table_1198175_1 WHERE pro_team = "Arizona Cardinals" | sql_create_context |
CREATE TABLE table_48598 (
"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.
-- What was the record when matt grice fought dennis b... | SELECT "Record" FROM table_48598 WHERE "Time" = '5:00' AND "Opponent" = 'dennis bermudez' | wikisql |
CREATE TABLE table_57178 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" real,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the record on july 24?
| SELECT "Record" FROM table_57178 WHERE "Date" = 'july 24' | wikisql |
CREATE TABLE table_name_50 (
authority VARCHAR,
scientic_name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the authority of the scientific name of O. Tricuspis?
| SELECT authority FROM table_name_50 WHERE scientic_name = "o. tricuspis" | sql_create_context |
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 cost (
costid number,
uniquepi... | SELECT t1.labname FROM (SELECT lab.labname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age BETWEEN 20 AND 29) AND STRFTIME('%y', lab.labresulttime) <= '2102' GROUP BY lab.labname) AS t1 WHERE t1.c1 <= 5 | eicu |
CREATE TABLE table_76905 (
"Class" text,
"Wheel arrangement" text,
"Fleet number(s)" text,
"Year made" text,
"Quantity made" text,
"Quantity preserved" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the wheel arrangement made in 1890?
| SELECT "Wheel arrangement" FROM table_76905 WHERE "Year made" = '1890' | wikisql |
CREATE TABLE teachers (
lastname text,
firstname text,
classroom number
)
CREATE TABLE list (
lastname text,
firstname text,
grade number,
classroom number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which students in third grade are not taug... | SELECT DISTINCT T1.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T1.grade = 3 AND T2.firstname <> "COVIN" AND T2.lastname <> "JEROME" | spider |
CREATE TABLE table_5779 (
"Call sign" text,
"Frequency" text,
"City of License" text,
"Owner" text,
"Format" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the call sign for the frequency of 0 105.7 fm?
| SELECT "Call sign" FROM table_5779 WHERE "Frequency" = '0 105.7 fm' | wikisql |
CREATE TABLE table_40684 (
"Tournament" text,
"Wins" real,
"Top-5" real,
"Top-10" real,
"Top-25" real,
"Events" real,
"Cuts made" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Cuts made has a Top-5 smaller than 3, and a Top-25 smaller... | SELECT "Cuts made" FROM table_40684 WHERE "Top-5" < '3' AND "Top-25" < '6' AND "Events" = '10' | wikisql |
CREATE TABLE table_204_915 (
id number,
"draw" number,
"artist" text,
"song" text,
"points" number,
"place" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- tell me the number of artists who ended up in 6th place .
| SELECT COUNT("artist") FROM table_204_915 WHERE "place" = 6 | squall |
CREATE TABLE table_204_954 (
id number,
"no." number,
"country" text,
"2009 winter\nuniversiade" number,
"2007 wjcc" number,
"2007 wwcc" number,
"2008 wjcc" number,
"2008 wwcc" number,
"points" number
)
-- Using valid SQLite, answer the following questions for the tables provided a... | SELECT "country" FROM table_204_954 WHERE "country" <> 'latvia' AND "points" = (SELECT "points" FROM table_204_954 WHERE "country" = 'latvia') | squall |
CREATE TABLE t_kc21 (
CLINIC_ID text,
CLINIC_TYPE text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
... | SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_NM = '秦娟丽' AND NOT t_kc21.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT <= 8902.92) | css |
CREATE TABLE table_78848 (
"Rank" real,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many total medals does a country with more than 1 silver medals have?
| SELECT SUM("Total") FROM table_78848 WHERE "Silver" > '1' | wikisql |
CREATE TABLE table_79188 (
"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.
-- In the tie where Southampton was the away team, who was the home team?
| SELECT "Home team" FROM table_79188 WHERE "Away team" = 'southampton' | wikisql |
CREATE TABLE table_48227 (
"Rank" real,
"Player" text,
"Years" text,
"Games" real,
"Reb. Avg." real,
"Total Rebounds" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total of rebound averages with more than 98 games and a rank of 7?
| SELECT SUM("Reb. Avg.") FROM table_48227 WHERE "Games" > '98' AND "Rank" = '7' | wikisql |
CREATE TABLE table_16016 (
"Season" text,
"Division" text,
"League Apps" real,
"League Goals" real,
"FA Cup Apps" real,
"FA Cup Goals" real,
"Total Apps" real,
"Total Goals" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When FA Cup Apps... | SELECT MIN("FA Cup Goals") FROM table_16016 WHERE "FA Cup Apps" = '9' | wikisql |
CREATE TABLE gwyjzb (
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 SUM(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT gwyjzb.MED_CLINIC_ID FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '9987120' AND gwyjzb.MED_ORG_DEPT_NM = '小儿胃肠外科' UNION SELECT fgwyjzb.MED_CLINIC_ID FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '9987120' AND fgwyjzb.MED_ORG_DEPT_NM = '小儿胃肠外科') A... | css |
CREATE TABLE table_73825 (
"Settlement" text,
"Cyrillic Name Other Names" text,
"Type" text,
"Population (2011)" real,
"Largest ethnic group (2002)" text,
"Dominant religion (2002)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many settlem... | SELECT COUNT("Settlement") FROM table_73825 WHERE "Cyrillic Name Other Names" = 'Ђурђин (Croatian: Đurđin)' | wikisql |
CREATE TABLE table_name_32 (
date VARCHAR,
attendance INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Date has an Attendance larger than 1,858?
| SELECT date FROM table_name_32 WHERE attendance > 1 OFFSET 858 | sql_create_context |
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
HIRE_DATE date,
JOB_ID varchar(10),
SALARY decimal(8,2),
COMMISSION_PCT decimal(2,2),
MANAGER_ID decimal(6,0),
DEPARTMENT_ID decimal(... | SELECT JOB_ID, SUM(DEPARTMENT_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) GROUP BY JOB_ID | nvbench |
CREATE TABLE table_name_71 (
title VARCHAR,
featuring VARCHAR,
series_sorted VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the title when the featuring is leela and series sorted is 4s/b?
| SELECT title FROM table_name_71 WHERE featuring = "leela" AND series_sorted = "4s/b" | sql_create_context |
CREATE TABLE Document_locations (
location_code VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the different location codes for documents?
| SELECT DISTINCT location_code FROM Document_locations | sql_create_context |
CREATE TABLE table_name_66 (
order INTEGER,
minister VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest order with a Minister that is joe hockey?
| SELECT MIN(order) FROM table_name_66 WHERE minister = "joe hockey" | sql_create_context |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
h... | 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 = 'septic shock' A... | eicu |
CREATE TABLE table_8313 (
"Years as tallest" text,
"Name" text,
"Height (m)" real,
"Height (ft)" real,
"Floors" real,
"Location" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the fewest floors for the building that has a height of 116 ... | SELECT MIN("Floors") FROM table_8313 WHERE "Height (m)" = '116' | wikisql |
CREATE TABLE Services (
Service_ID INTEGER,
Service_Type_Code CHAR(15)
)
CREATE TABLE Participants_in_Events (
Event_ID INTEGER,
Participant_ID INTEGER
)
CREATE TABLE Events (
Event_ID INTEGER,
Service_ID INTEGER,
Event_Details VARCHAR(255)
)
CREATE TABLE Participants (
Participant_ID... | SELECT Event_Details, COUNT(Event_Details) FROM Events AS T1 JOIN Services AS T2 ON T1.Service_ID = T2.Service_ID WHERE T2.Service_Type_Code = 'Marriage' GROUP BY Event_Details | nvbench |
CREATE TABLE WINE (
Winery VARCHAR,
Price INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Find the distinct winery of wines having price between 50 and 100.
| SELECT DISTINCT Winery FROM WINE WHERE Price BETWEEN 50 AND 100 | sql_create_context |
CREATE TABLE table_204_885 (
id number,
"season" text,
"competition" text,
"round" text,
"opponent" text,
"home" text,
"away" text,
"agg." text,
"bye" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many different competitions are... | SELECT COUNT(DISTINCT "competition") FROM table_204_885 | squall |
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
last_wardid number,
intime time,
outtime time
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_... | SELECT COUNT(*) > 0 FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 96833) AND DATETIME(microbiologyevents.charttime) >= DATETIME(CURRENT_TIME(), '-6 year') | 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,... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE procedures.long_title = "Venous catheterization, not elsewhere classified" | mimicsql_data |
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 demographic (
subject_id text,
hadm_id t... | SELECT AVG(demographic.age) FROM demographic WHERE demographic.marital_status = "MARRIED" AND demographic.admission_type = "URGENT" | mimicsql_data |
CREATE TABLE table_46657 (
"Player" text,
"Country" text,
"Year(s) won" text,
"Total" text,
"To par" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Player, when Total is '154'?
| SELECT "Player" FROM table_46657 WHERE "Total" = '154' | 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 procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Medicare" AND procedures.icd9_code = "7761" | 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 demographic.age, demographic.dob FROM demographic WHERE demographic.subject_id = "2560" | mimicsql_data |
CREATE TABLE table_name_71 (
year VARCHAR,
venue VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- COunt the Year which has a Venue of latakia , syria?
| SELECT COUNT(year) FROM table_name_71 WHERE venue = "latakia , syria" | sql_create_context |
CREATE TABLE table_204_338 (
id number,
"location" text,
"coordinates" text,
"type" text,
"built" text,
"details" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many voronezh radars were built before 2010 ?
| SELECT COUNT(*) FROM table_204_338 WHERE "built" < 2010 | squall |
CREATE TABLE table_name_83 (
year INTEGER,
venue VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest year that has athens, greece as the venue?
| SELECT MIN(year) FROM table_name_83 WHERE venue = "athens, greece" | sql_create_context |
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE diagnoses_icd (
row_id number,
... | SELECT MIN(outputevents.value) FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 62977)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'gas... | mimic_iii |
CREATE TABLE table_name_70 (
date INTEGER,
catalog VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- WHAT DATE HAS A CATALOG OF 486553.4?
| SELECT MAX(date) FROM table_name_70 WHERE catalog = "486553.4" | sql_create_context |
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 demographic.age, demographic.expire_flag FROM demographic WHERE demographic.name = "Robert Hyden" | mimicsql_data |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.