instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_71150 (
"Ensemble" text,
"Gold Medals" real,
"Silver Medals" real,
"Bronze Medals" real,
"Total Medals" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many gold medals for bellbrook HS with less than 1 silver?
| SELECT COUNT("Gold Medals") FROM table_71150 WHERE "Ensemble" = 'bellbrook hs' AND "Silver Medals" < '1' | wikisql |
CREATE TABLE table_name_3 (
year INTEGER,
engine VARCHAR,
entrant VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many years did John Player Lotus used Cosworth v8?
| SELECT SUM(year) FROM table_name_3 WHERE engine = "cosworth v8" AND entrant = "john player lotus" | sql_create_context |
CREATE TABLE Rooms (
RoomId TEXT,
roomName TEXT,
beds INTEGER,
bedType TEXT,
maxOccupancy INTEGER,
basePrice INTEGER,
decor TEXT
)
CREATE TABLE Reservations (
Code INTEGER,
Room TEXT,
CheckIn TEXT,
CheckOut TEXT,
Rate REAL,
LastName TEXT,
FirstName TEXT,
Adul... | SELECT bedType, COUNT(*) FROM Rooms GROUP BY bedType ORDER BY bedType | nvbench |
CREATE TABLE table_18123274_1 (
director VARCHAR,
original_title VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the total number of director for oro diablo
| SELECT COUNT(director) FROM table_18123274_1 WHERE original_title = "Oro Diablo" | sql_create_context |
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
Li... | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%India%' OR UPPER(Location) LIKE '%India%' OR Location LIKE '%India%' AND Reputation >= 1000 ORDER BY Reputation DESC | sede |
CREATE TABLE Person (
name varchar(20),
age INTEGER,
city TEXT,
gender TEXT,
job TEXT
)
CREATE TABLE PersonFriend (
name varchar(20),
friend varchar(20),
year INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who has friends that are ol... | SELECT friend, age FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T1.age > (SELECT AVG(age) FROM Person) | nvbench |
CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city varchar,
state varchar,
country varchar,
zip int
)
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE area (
course_id int,
area varchar... | SELECT COUNT(*) > 0 FROM course, course_offering, semester WHERE course_offering.start_time < '12:00:00' AND course_offering.start_time >= '08:00:00' AND course.course_id = course_offering.course_id AND course.department = 'MATSCIE' AND course.number = 526 AND semester.semester = 'WN' AND semester.semester_id = course_... | advising |
CREATE TABLE mill (
name VARCHAR,
LOCATION VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the names of the mills which are not located in 'Donceel'?
| SELECT name FROM mill WHERE LOCATION <> 'Donceel' | sql_create_context |
CREATE TABLE table_name_54 (
manager VARCHAR,
current_club VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the name of the manager of the Atl tico Baleares?
| SELECT manager FROM table_name_54 WHERE current_club = "atlético baleares" | sql_create_context |
CREATE TABLE table_21265 (
"Athlete" text,
"Event" text,
"Swim (1.5km)" text,
"Trans 1" text,
"Bike (40km)" text,
"Trans 2" text,
"Run (10km)" text,
"Total Time" text,
"Rank" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many at... | SELECT COUNT("Athlete") FROM table_21265 WHERE "Trans 1" = '0:26' | wikisql |
CREATE TABLE table_61708 (
"Pos." text,
"Class" text,
"Entrant" text,
"Drivers" text,
"Laps" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What were the highest laps for glenn seton gregg hansford?
| SELECT MAX("Laps") FROM table_61708 WHERE "Drivers" = 'glenn seton gregg hansford' | wikisql |
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
... | SELECT HIRE_DATE, AVG(DEPARTMENT_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY AVG(DEPARTMENT_ID) | nvbench |
CREATE TABLE table_37181 (
"Year(s)" real,
"Grand Final Television Commentator" text,
"Grand Final Dual Television Commentator" text,
"Spokesperson" text,
"Semi Final Television Commentator" text,
"Semi Final Dual Television Commentator" text
)
-- Using valid SQLite, answer the following quest... | SELECT "Semi Final Television Commentator" FROM table_37181 WHERE "Spokesperson" = 'unknown' AND "Year(s)" = '1962' | wikisql |
CREATE TABLE table_64263 (
"Game" text,
"Date" text,
"Opponent" text,
"Score" text,
"Location Attendance" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the game when the record was 31-15?
| SELECT "Game" FROM table_64263 WHERE "Record" = '31-15' | wikisql |
CREATE TABLE table_26352332_4 (
years_produced VARCHAR,
engine_family VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- For the engine family MaxxForce 11, what is the years produced?
| SELECT years_produced FROM table_26352332_4 WHERE engine_family = "MaxxForce 11" | sql_create_context |
CREATE TABLE table_16699 (
"Year" real,
"Winners" text,
"Grand Finalist" text,
"Scores" text,
"Venue" text,
"Crowd" real,
"Margin" real,
"Season Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who is the season result where margin... | SELECT "Season Result" FROM table_16699 WHERE "Margin" = '51' | wikisql |
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_type = "EMERGENCY" AND demographic.dod_year <= "2180.0" | mimicsql_data |
CREATE TABLE table_29203 (
"Rank" real,
"Rider" text,
"Sat 21 Aug" text,
"Mon 23 Aug" text,
"Tues 24 Aug" text,
"Wed 25 Aug" text,
"Thurs 26 Aug" text,
"Fri 27 Aug" text,
"Sat 28 Aug" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Wh... | SELECT "Sat 21 Aug" FROM table_29203 WHERE "Thurs 26 Aug" = '20'' 56.01 108.143mph' | wikisql |
CREATE TABLE table_15026994_2 (
writer VARCHAR,
viewing_figure VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What writers are associated with a viewing figure of 7.01 million?
| SELECT writer FROM table_15026994_2 WHERE viewing_figure = "7.01 million" | sql_create_context |
CREATE TABLE table_6566 (
"Rank" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total number of silver medals of the team ranked 7 with more than 1 total medal?
| SELECT COUNT("Silver") FROM table_6566 WHERE "Rank" = '7' AND "Total" > '1' | wikisql |
CREATE TABLE table_62905 (
"Rank" real,
"Actor" text,
"Character" text,
"Soap Opera" text,
"Years" text,
"Duration" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest Rank 1960 ?
| SELECT MAX("Rank") FROM table_62905 WHERE "Years" = '1960—' | wikisql |
CREATE TABLE Customers (
customer_id INTEGER,
customer_first_name VARCHAR(20),
customer_last_name VARCHAR(20),
customer_address VARCHAR(255),
customer_phone VARCHAR(255),
customer_email VARCHAR(255),
other_customer_details VARCHAR(255)
)
CREATE TABLE Accounts (
account_id INTEGER,
c... | SELECT customer_last_name, COUNT(customer_last_name) FROM Customers GROUP BY customer_last_name ORDER BY COUNT(customer_last_name) DESC | nvbench |
CREATE TABLE table_name_9 (
winning_driver VARCHAR,
race_name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which driver won the iv j.c.c. jersey road race?
| SELECT winning_driver FROM table_name_9 WHERE race_name = "iv j.c.c. jersey road race" | sql_create_context |
CREATE TABLE table_name_10 (
tie_no VARCHAR,
away_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What shows for Tie no when Sheffield United was the Away team?
| SELECT tie_no FROM table_name_10 WHERE away_team = "sheffield united" | 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 labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
value... | SELECT SUM(CASE WHEN patients.dod IS NULL THEN 1 WHEN STRFTIME('%j', patients.dod) - STRFTIME('%j', t2.charttime) > 4 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t1.subject_id, t1.charttime FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id... | mimic_iii |
CREATE TABLE t_kc21_t_kc22 (
MED_CLINIC_ID text,
MED_EXP_DET_ID number
)
CREATE TABLE t_kc22 (
AMOUNT number,
CHA_ITEM_LEV number,
DATA_ID text,
DIRE_TYPE number,
DOSE_FORM text,
DOSE_UNIT text,
EACH_DOSAGE text,
EXP_OCC_DATE time,
FLX_MED_ORG_ID text,
FXBZ number,
H... | SELECT (SELECT t_kc22.QTY * t_kc22.UNIVALENT FROM t_kc22 WHERE t_kc22.MED_EXP_DET_ID = '22687525523') = (SELECT t_kc22.AMOUNT FROM t_kc22 WHERE t_kc22.MED_EXP_DET_ID = '22687525523') | css |
CREATE TABLE table_14345690_4 (
finished VARCHAR,
exited VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the finished for exited day 13
| SELECT finished FROM table_14345690_4 WHERE exited = "Day 13" | sql_create_context |
CREATE TABLE table_name_64 (
distance VARCHAR,
pilot VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Distance, when Pilot is 'Stanislaw Wujczak'?
| SELECT distance FROM table_name_64 WHERE pilot = "stanislaw wujczak" | sql_create_context |
CREATE TABLE table_78546 (
"Tujunga" text,
"La Crescenta- Montrose" text,
"Glendale" text,
"La Ca\u00f1ada Flintridge" text,
"Pasadena" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the figure for Tujunga when Pasadena is 134,941?
| SELECT "Tujunga" FROM table_78546 WHERE "Pasadena" = '134,941' | wikisql |
CREATE TABLE customers (
customer_id number,
customer_first_name text,
customer_last_name text,
customer_address text,
customer_phone text,
customer_email text,
other_customer_details text
)
CREATE TABLE customers_cards (
card_id number,
customer_id number,
card_type_code text,
... | SELECT card_type_code FROM customers_cards GROUP BY card_type_code ORDER BY COUNT(*) DESC LIMIT 1 | spider |
CREATE TABLE table_name_5 (
lost INTEGER,
match INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the sum of losses for teams with under 10 matches?
| SELECT SUM(lost) FROM table_name_5 WHERE match < 10 | sql_create_context |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
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,
... | SELECT * FROM hz_info JOIN wdmzjzjlb ON hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX WHERE hz_info.RYBH = '06717706' AND hz_info.YLJGDM = '0879465' AND wdmzjzjlb.CYKSMC LIKE '%运动%' UNION SELECT * FROM hz_info JOIN bdmzjzjlb ON hz_info.YLJGDM = bdmzjzjlb.YLJGDM AND hz_i... | css |
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number... | SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions... | mimic_iii |
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 t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.IN_DIAG_DIS_NM = '瘙痒症' | css |
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.CKZFWXX, jyjgzbb.CKZFWSX FROM mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN mzjzjlb_jybgb ON mzjzjlb.YLJGDM = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH AND mzjzjlb_jybgb.YLJGDM = jybgb.YLJGDM AND mzjzjlb_jybgb.BGDH = jybgb.... | css |
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 INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.insurance = "Private" AND diagnoses.long_title = "Shock, unspecified" | mimicsql_data |
CREATE TABLE climber (
climber_id number,
name text,
country text,
time text,
points number,
mountain_id number
)
CREATE TABLE mountain (
mountain_id number,
name text,
height number,
prominence number,
range text,
country text
)
-- Using valid SQLite, answer the follo... | SELECT country FROM mountain GROUP BY country HAVING COUNT(*) > 1 | spider |
CREATE TABLE table_5681 (
"Gauge" text,
"Railway" text,
"Class" text,
"Works no." text,
"Year" text,
"Builder" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which builder has a railway of Rhodesia Railways?
| SELECT "Builder" FROM table_5681 WHERE "Railway" = 'rhodesia railways' | wikisql |
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 jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM mzjzjlb JOIN jybgb JOIN jyjgzbb ON mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE mzjzjlb.JZZDBM = 'X60.562' AND jyjgzbb.JCZBMC = '抗凝血酶III' | css |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
a... | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', diagnosis.diagnosistime)) FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '025-50213... | eicu |
CREATE TABLE table_26847237_1 (
home_team VARCHAR,
opposition VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the home team when the opposition was Buller?
| SELECT home_team FROM table_26847237_1 WHERE opposition = "Buller" | sql_create_context |
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Percent text,
ACC_Home text,
ACC_Road text,
All_Games text,
All_Games_Percent int,
All_Home text,
All_Road text,
All_Neutral text
)
CREATE TABLE university (
Scho... | SELECT ACC_Percent, All_Games_Percent FROM basketball_match GROUP BY Team_Name | nvbench |
CREATE TABLE table_12400 (
"Athlete" text,
"Country" text,
"Run 1" real,
"Run 2" real,
"Run 3" real,
"Run 4" real,
"Total" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Run 4 has a Country of united states, and an Athlete of bree scha... | SELECT SUM("Run 4") FROM table_12400 WHERE "Country" = 'united states' AND "Athlete" = 'bree schaaf emily azevedo' AND "Run 3" < '58.04' | wikisql |
CREATE TABLE table_11900773_6 (
paper_type VARCHAR,
design VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many paper types did Ian Drolet design stamps on?
| SELECT COUNT(paper_type) FROM table_11900773_6 WHERE design = "Ian Drolet" | sql_create_context |
CREATE TABLE table_name_89 (
bodyweight INTEGER,
snatch VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the average bodyweight when snatch is 80?
| SELECT AVG(bodyweight) FROM table_name_89 WHERE snatch = 80 | sql_create_context |
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
)... | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT procedures_icd.hadm_id FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'proximal gastrectomy')) | mimic_iii |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsysto... | SELECT patient.hospitaladmittime FROM patient WHERE patient.uniquepid = '028-45936' AND patient.hospitaladmitsource = 'recovery room' ORDER BY patient.hospitaladmittime DESC LIMIT 1 | eicu |
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... | SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, fare_basis, flight, flight_fare WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'ATLANTA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND... | atis |
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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE prescriptions.formulary_drug_cd = "LIDO2/5J" AND lab.fluid = "Urine" | mimicsql_data |
CREATE TABLE race (
Race_ID int,
Name text,
Class text,
Date text,
Track_ID text
)
CREATE TABLE track (
Track_ID int,
Name text,
Location text,
Seating real,
Year_Opened real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Visualize a... | SELECT Class, COUNT(*) FROM race GROUP BY Class ORDER BY COUNT(*) DESC | nvbench |
CREATE TABLE table_70486 (
"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 score for the game with an attendance greater than 33,658 and a record of... | SELECT "Score" FROM table_70486 WHERE "Attendance" > '33,658' AND "Record" = '73-66' | wikisql |
CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
CreationDate time,
OwnerUserId number,
AutoRenameCount number,
LastAutoRename time,
Score number,
ApprovedByUserId number,
ApprovalDate time
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId ... | SELECT A.* FROM Posts AS A INNER JOIN Posts AS Q ON A.ParentId = Q.Id INNER JOIN PostTags AS PT ON Q.Id = PT.PostId INNER JOIN Tags AS T ON PT.TagId = T.Id WHERE A.PostTypeId = 2 AND Q.PostTypeId = 1 AND A.Score >= 80 AND A.CreationDate >= CAST('2017-10-01' AS DATETIME) AND T.TagName = 'r' ORDER BY A.Score DESC | sede |
CREATE TABLE table_27998152_1 (
fee VARCHAR,
previous_club VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the fee for ankarag c previous club
| SELECT fee FROM table_27998152_1 WHERE previous_club = "Ankaragücü" | sql_create_context |
CREATE TABLE basketball_match (
team_id number,
school_id number,
team_name text,
acc_regular_season text,
acc_percent text,
acc_home text,
acc_road text,
all_games text,
all_games_percent number,
all_home text,
all_road text,
all_neutral text
)
CREATE TABLE university (... | SELECT team_name FROM basketball_match ORDER BY all_home DESC | spider |
CREATE TABLE table_67498 (
"Year" real,
"Team" text,
"Co-Drivers" text,
"Class" text,
"Laps" real,
"Pos." text,
"Class Pos." text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which class Pos has a Team of jml team panoz?
| SELECT "Class Pos." FROM table_67498 WHERE "Team" = 'jml team panoz' | wikisql |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
CREATE TABLE hz_info_zyjzjlb (
JZLSH number,
YLJGDM number,
zyjzjlb_id number
)
CREATE TABLE zyjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
... | SELECT COUNT(*) FROM zyjzjlb JOIN hz_info_zyjzjlb JOIN hz_info ON hz_info_zyjzjlb.JZLSH = zyjzjlb.JZLSH AND hz_info_zyjzjlb.YLJGDM = hz_info_zyjzjlb.YLJGDM AND hz_info_zyjzjlb.JZLSH = zyjzjlb.JZLSH AND hz_info_zyjzjlb.zyjzjlb_id = zyjzjlb.zyjzjlb_id AND hz_info_zyjzjlb.YLJGDM = hz_info.YLJGDM WHERE hz_info.YLJGDM = '20... | css |
CREATE TABLE table_name_76 (
jockey VARCHAR,
group VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which jockey had a group of G3?
| SELECT jockey FROM table_name_76 WHERE group = "g3" | sql_create_context |
CREATE TABLE table_78244 (
"D 48" text,
"D 47" text,
"D 46" text,
"D 45" text,
"D 44" text,
"D 43" text,
"D 42" text,
"D 41" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the D 47 when it has a D 45 of d 32
| SELECT "D 47" FROM table_78244 WHERE "D 45" = 'd 32' | wikisql |
CREATE TABLE Person (
name varchar(20),
age INTEGER,
city TEXT,
gender TEXT,
job TEXT
)
CREATE TABLE PersonFriend (
name varchar(20),
friend varchar(20),
year INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average age for... | SELECT gender, AVG(age) FROM Person GROUP BY gender | nvbench |
CREATE TABLE table_name_43 (
Id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What shows for 1998 when 1996 is 1R, and 2002 is not held?
| SELECT 1998 FROM table_name_43 WHERE 1996 = "1r" AND 2002 = "not held" | sql_create_context |
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 demographic.days_stay, diagnoses.short_title FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.subject_id = "87275" | mimicsql_data |
CREATE TABLE table_16494599_5 (
position VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which position did kevin edwards play for
| SELECT position FROM table_16494599_5 WHERE player = "Kevin Edwards" | 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.IN_DIAG_DIS_CD, qtb.IN_DIAG_DIS_NM FROM qtb WHERE qtb.PERSON_ID = '88247382' AND qtb.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT >= 6145.72) UNION SELECT gyb.IN_DIAG_DIS_CD, gyb.IN_DIAG_DIS_NM FROM gyb WHERE gyb.PERSON_ID = '88247382' AND gyb.MED_CLINIC_ID IN (SELECT t_kc... | css |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid num... | SELECT microlab.culturesite FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '025-44495')) AND STRFTIME('%y-%m', microlab.culturetakentime) >= '2104... | eicu |
CREATE TABLE genre (
g_name VARCHAR,
rating VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- List the names of all genres in alphabetical oder, together with its ratings.
| SELECT g_name, rating FROM genre ORDER BY g_name | sql_create_context |
CREATE TABLE equipment_sequence (
aircraft_code_sequence varchar,
aircraft_code varchar
)
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt int
)
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name 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_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'LONG BEACH' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'ST.... | atis |
CREATE TABLE table_name_9 (
away_team VARCHAR,
home_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the away team's score against Hawthorn?
| SELECT away_team AS score FROM table_name_9 WHERE home_team = "hawthorn" | sql_create_context |
CREATE TABLE table_name_53 (
nhl_team VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Tell me the NHL team for mike gaffney
| SELECT nhl_team FROM table_name_53 WHERE player = "mike gaffney" | sql_create_context |
CREATE TABLE table_56389 (
"Runs" text,
"Balls" text,
"Batsman" text,
"Versus" text,
"Venue" text,
"Date" text,
"Strike Rate" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many runs were scored when the strike rate was 101.42?
| SELECT "Runs" FROM table_56389 WHERE "Strike Rate" = '101.42' | wikisql |
CREATE TABLE table_name_13 (
location_attendance VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the location and attendance on the May 22 game?
| SELECT location_attendance FROM table_name_13 WHERE date = "may 22" | sql_create_context |
CREATE TABLE table_20319085_2 (
conference_record VARCHAR,
season VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many different conference records are there for season 2006?
| SELECT COUNT(conference_record) FROM table_20319085_2 WHERE season = 2006 | sql_create_context |
CREATE TABLE table_234886_3 (
title VARCHAR,
no_in_series VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total number of titles for the episode numbered 29 in the series?
| SELECT COUNT(title) FROM table_234886_3 WHERE no_in_series = 29 | sql_create_context |
CREATE TABLE table_202_276 (
id number,
"year 1958" text,
"title {the rebel" text,
"role" text,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what year was he most featured in shows ?
| SELECT "year 1958" FROM table_202_276 ORDER BY "notes" DESC LIMIT 1 | squall |
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 d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
... | SELECT COUNT(*) > 0 FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 23929) AND STRFTIME('%y-%m', labevents.charttime) >= '2102-05' | mimic_iii |
CREATE TABLE table_13845918_3 (
womens_doubles VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the number of women's doubles for 1986
| SELECT COUNT(womens_doubles) FROM table_13845918_3 WHERE year = "1986" | sql_create_context |
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
UserId number,
ContentLicense text
)
CREATE TABLE PostHistory (
Id number,
Po... | SELECT u.Id AS "user_link", u.WebsiteUrl, t.TagName, SUM(Score) AS totscore FROM Posts AS p, PostTags AS pt, Tags AS t, Users AS u WHERE PostTypeId = 2 AND p.ParentId = pt.PostId AND pt.TagId = t.Id AND p.OwnerUserId = u.Id AND t.TagName = '##tag:string?python##' GROUP BY u.Id, u.WebsiteUrl, t.TagName ORDER BY totscore... | sede |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE i... | SELECT t1.treatmentname FROM (SELECT treatment.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age >= 60) AND STRFTIME('%y', treatment.treatmenttime) = '2105' GROUP BY treatment.treatmentname... | eicu |
CREATE TABLE table_35588 (
"Year" text,
"Winners" text,
"Score" text,
"Runner-up" text,
"Venue" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who were the winners in 2010-2011?
| SELECT "Winners" FROM table_35588 WHERE "Year" = '2010-2011' | wikisql |
CREATE TABLE table_1914 (
"Township" text,
"County" text,
"Pop. (2010)" real,
"Land ( sqmi )" text,
"Water (sqmi)" text,
"Latitude" text,
"Longitude" text,
"GEO ID" real,
"ANSI code" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how... | SELECT COUNT("GEO ID") FROM table_1914 WHERE "Latitude" = '48.578664' | wikisql |
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,
ZZBZ number,
WDBZ number,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
... | SELECT COUNT(*) FROM mzjzjlb WHERE YLJGDM = '4671519' AND JZKSRQ BETWEEN '2001-01-01' AND '2021-09-10' AND TXBZ > 0 | css |
CREATE TABLE bank (
branch_id number,
bname text,
no_of_customers number,
city text,
state text
)
CREATE TABLE customer (
cust_id text,
cust_name text,
acc_type text,
acc_bal number,
no_of_loans number,
credit_score number,
branch_id number,
state text
)
CREATE TABL... | SELECT cust_name FROM customer ORDER BY acc_bal | spider |
CREATE TABLE table_name_70 (
session VARCHAR,
circuit VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the session at the circuit of lowes motor speedway?
| SELECT session FROM table_name_70 WHERE circuit = "lowes motor speedway" | sql_create_context |
CREATE TABLE table_62400 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Game site" text,
"Record" text,
"Attendance" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the game site of the game with the san diego chargers a... | SELECT "Game site" FROM table_62400 WHERE "Opponent" = 'san diego chargers' | wikisql |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
CREATE TABLE person_info (
CSD text,
CSRQ time,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
MZDM text,
MZMC text,
RYBH text,
XBDM number,
XBMC text,
XLDM text,
XLMC text,
XM text... | SELECT COUNT(mzjzjlb.ZZYSGH) 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 '2005-11-03' AND '2007-09-11' | css |
CREATE TABLE table_19632728_1 (
original_air_date VARCHAR,
episode__number VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When was the episode number 2 originally aired?
| SELECT original_air_date FROM table_19632728_1 WHERE episode__number = 2 | sql_create_context |
CREATE TABLE table_name_18 (
venue VARCHAR,
winner VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Where was the 1966 competition with a winner of Gary Cowan held?
| SELECT venue FROM table_name_18 WHERE winner = "gary cowan" AND year = "1966" | sql_create_context |
CREATE TABLE table_name_96 (
school VARCHAR,
location VARCHAR,
mascot VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which School in Wabash has a Mascot of knights?
| SELECT school FROM table_name_96 WHERE location = "wabash" AND mascot = "knights" | sql_create_context |
CREATE TABLE table_26455614_1 (
entries INTEGER,
winner VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the fewest recorded entrants against paris saint-germain?
| SELECT MIN(entries) FROM table_26455614_1 WHERE winner = "Paris Saint-Germain" | sql_create_context |
CREATE TABLE table_name_18 (
location VARCHAR,
floors VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Location has a Floors of 03.0 n/a?
| SELECT location FROM table_name_18 WHERE floors = "03.0 n/a" | sql_create_context |
CREATE TABLE table_name_84 (
byes VARCHAR,
against VARCHAR,
draws VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the total number of Byes for the team that had 1136 Against and fewer than 0 Draws?
| SELECT COUNT(byes) FROM table_name_84 WHERE against = 1136 AND draws < 0 | 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 demographic (
subject_id text,
hadm_id t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.age < "30" AND procedures.long_title = "Other electric countershock of heart" | mimicsql_data |
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
sh... | SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', labevents.charttime)) FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'ptt') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 92788 AND admissions.disc... | mimic_iii |
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 txmzjzjlb.JZLSH FROM hz_info JOIN txmzjzjlb ON hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX WHERE hz_info.RYBH = '22945235' AND NOT txmzjzjlb.JZLSH IN (SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ >= '2001-12-09') UNION SELECT ftxmzjzjlb.JZLSH FROM hz_info JOI... | css |
CREATE TABLE table_24910733_1 (
title VARCHAR,
us_viewers__millions_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many titles are listed with 8.44 million viewers?
| SELECT COUNT(title) FROM table_24910733_1 WHERE us_viewers__millions_ = "8.44" | sql_create_context |
CREATE TABLE table_65462 (
"Pick" real,
"Team" text,
"Player" text,
"Position" text,
"College" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What college was the quarterback from?
| SELECT "College" FROM table_65462 WHERE "Position" = 'quarterback' | 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 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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.icd9_code = "7756" AND lab."CATEGORY" = "Blood Gas" | mimicsql_data |
CREATE TABLE table_name_30 (
chassis VARCHAR,
driver VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What kind of chassis does Ricardo Zonta have?
| SELECT chassis FROM table_name_30 WHERE driver = "ricardo zonta" | sql_create_context |
CREATE TABLE table_13680 (
"Name" text,
"Ceremony" text,
"Year" text,
"Academy Award" text,
"Film" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Academy Award for the Film Educating Peter?
| SELECT "Academy Award" FROM table_13680 WHERE "Film" = 'educating peter' | wikisql |
CREATE TABLE t_kc22 (
AMOUNT number,
CHA_ITEM_LEV number,
DATA_ID text,
DIRE_TYPE number,
DOSE_FORM text,
DOSE_UNIT text,
EACH_DOSAGE text,
EXP_OCC_DATE time,
FLX_MED_ORG_ID text,
FXBZ number,
HOSP_DOC_CD text,
HOSP_DOC_NM text,
MED_CLINIC_ID text,
MED_DIRE_CD tex... | SELECT COUNT(*) FROM t_kc21 WHERE t_kc21.PERSON_ID = '35087658' AND t_kc21.IN_HOSP_DATE BETWEEN '2013-03-20' AND '2020-05-17' AND t_kc21.CLINIC_TYPE = '住院' | css |
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
AboutMe text,
Views number,
UpVotes number,
DownVotes number,
ProfileImage... | SELECT p.Id, p.PostTypeId, p.Score FROM Posts AS p WHERE p.Score > 1 AND p.PostTypeId = 1 AND p.Body LIKE '%judaism%' | sede |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.