instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
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.JCRGH, jyjgzbb.JCRXM FROM hz_info JOIN zzmzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX AND zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGD... | css |
CREATE TABLE table_203_534 (
id number,
"week" number,
"date" text,
"opponent" text,
"home/away" text,
"result" text,
"bye" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which team was the philadelphia soul 's next opponent after playing th... | SELECT "opponent" FROM table_203_534 WHERE id = (SELECT id FROM table_203_534 WHERE "opponent" = 'chicago rush') + 1 | squall |
CREATE TABLE table_23501776_16 (
status VARCHAR,
points VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the status for points 3185
| SELECT status FROM table_23501776_16 WHERE points = 3185 | sql_create_context |
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.JZKSBM, txmzjzjlb.JZKSMC FROM txmzjzjlb WHERE txmzjzjlb.JZLSH = '46372324753' UNION SELECT ftxmzjzjlb.JZKSBM, ftxmzjzjlb.JZKSMC FROM ftxmzjzjlb WHERE ftxmzjzjlb.JZLSH = '46372324753' | css |
CREATE TABLE table_1528 (
"Club" text,
"Played" text,
"Won" text,
"Drawn" text,
"Lost" text,
"Points for" text,
"Points against" text,
"Points difference" text,
"Points" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What club has 69... | SELECT "Club" FROM table_1528 WHERE "Points for" = '693' | wikisql |
CREATE TABLE table_1341598_10 (
candidates VARCHAR,
first_elected VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the candidate in election where the incumbent was first elected in 1980?
| SELECT candidates FROM table_1341598_10 WHERE first_elected = 1980 | sql_create_context |
CREATE TABLE table_18671 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what are all the party with district being kansas 1
| SELECT "Party" FROM table_18671 WHERE "District" = 'Kansas 1' | wikisql |
CREATE TABLE table_1043 (
"Player" text,
"Position" text,
"Starter" text,
"Touchdowns" real,
"Extra points" real,
"Field goals" real,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest amount of field goals on the cha... | SELECT MIN("Field goals") FROM table_1043 | wikisql |
CREATE TABLE table_31295 (
"Eliminated" real,
"Wrestler" text,
"Entered" real,
"Eliminated by" text,
"Method of elimination" text,
"Time" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What number was the person eliminated at 22:50?
| SELECT "Eliminated" FROM table_31295 WHERE "Time" = '22:50' | wikisql |
CREATE TABLE table_69362 (
"Outcome" text,
"Year" real,
"Tournament" text,
"Opponent" text,
"Score" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Malaysia Satellite tournaments were played after 1998?
| SELECT "Outcome" FROM table_69362 WHERE "Year" > '1998' AND "Tournament" = 'malaysia satellite' | wikisql |
CREATE TABLE table_name_96 (
to_par VARCHAR,
player VARCHAR,
country VARCHAR,
place VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is To Par, when Country is 'United States', when Place is 'T4', and when Player is 'Arnold Palmer'?
| SELECT to_par FROM table_name_96 WHERE country = "united states" AND place = "t4" AND player = "arnold palmer" | sql_create_context |
CREATE TABLE table_6536 (
"Year" real,
"Location" text,
"Gold" text,
"Silver" text,
"Bronze" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who won bronze in Seoul?
| SELECT "Bronze" FROM table_6536 WHERE "Location" = 'seoul' | wikisql |
CREATE TABLE table_name_5 (
date VARCHAR,
away_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the date when Footscray was the away team?
| SELECT date FROM table_name_5 WHERE away_team = "footscray" | sql_create_context |
CREATE TABLE table_68381 (
"Rank" real,
"Lane" real,
"Name" text,
"Nationality" text,
"Time" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the rank of the swimmer with a time of 2:11.83?
| SELECT "Rank" FROM table_68381 WHERE "Time" = '2:11.83' | wikisql |
CREATE TABLE table_13337 (
"Name" text,
"Platform" text,
"Indication" text,
"Status" text,
"Collaboration" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What company collaborated in non-hodgkin lymphoma?
| SELECT "Collaboration" FROM table_13337 WHERE "Indication" = 'non-hodgkin lymphoma' | wikisql |
CREATE TABLE table_name_30 (
crowd INTEGER,
venue VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How big was the crowd size, at the Junction Oval venue?
| SELECT SUM(crowd) FROM table_name_30 WHERE venue = "junction oval" | sql_create_context |
CREATE TABLE table_56549 (
"Position" real,
"Club" text,
"Played" real,
"Points" text,
"Wins" real,
"Draws" real,
"Losses" real,
"Goals for" real,
"Goals against" real,
"Goal Difference" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.... | SELECT COUNT("Played") FROM table_56549 WHERE "Wins" = '8' AND "Goals against" > '58' | wikisql |
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
dual_airline varchar,
service_name text
)
CREATE TABLE compartment_class (
compartment varchar,
class_type varchar
)
CREATE TABLE airport (
airport_code varchar,
airport_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, fare, flight, flight_fare WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PITTSBURGH' AND fare.one_direction_cost = 329 AND fare.round_trip_requ... | atis |
CREATE TABLE t_kc24 (
ACCOUNT_DASH_DATE time,
ACCOUNT_DASH_FLG number,
CASH_PAY number,
CIVIL_SUBSIDY number,
CKC102 number,
CLINIC_ID text,
CLINIC_SLT_DATE time,
COMP_ID text,
COM_ACC_PAY number,
COM_PAY number,
DATA_ID text,
ENT_ACC_PAY number,
ENT_PAY number,
F... | SELECT t_kc24.t_kc21_MED_ORG_DEPT_CD, t_kc24.t_kc21_MED_ORG_DEPT_NM FROM t_kc24 WHERE t_kc24.t_kc21_MED_SER_ORG_NO = '7045795' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2001-02-25' AND '2009-10-24' GROUP BY t_kc24.t_kc21_MED_ORG_DEPT_CD ORDER BY SUM(t_kc24.OVE_PAY) DESC LIMIT 11 | css |
CREATE TABLE table_20095 (
"Name" text,
"Position" text,
"Number" real,
"School/Club Team" text,
"Season" text,
"Acquisition via" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many players with a position are listed for the 2009 season?
| SELECT COUNT("Position") FROM table_20095 WHERE "Season" = '2009' | wikisql |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic ... | SELECT demographic.age, demographic.gender FROM demographic WHERE demographic.name = "Paul Dunn" | mimicsql_data |
CREATE TABLE table_name_65 (
gold VARCHAR,
nation VARCHAR,
bronze VARCHAR,
rank VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which gold has a Bronze of 1, a Rank of 47, and a Nation of spain?
| SELECT gold FROM table_name_65 WHERE bronze = "1" AND rank = "47" AND nation = "spain" | sql_create_context |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.expire_flag = "0" AND lab.label = "Globulin" | mimicsql_data |
CREATE TABLE table_76567 (
"Date" text,
"Opponent" text,
"Venue" text,
"Result" text,
"Attendance" text,
"Competition" text,
"Man of the Match" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the date when the attendance was n/a and ... | SELECT "Date" FROM table_76567 WHERE "Attendance" = 'n/a' AND "Man of the Match" = 'unknown' | wikisql |
CREATE TABLE Allergy_Type (
Allergy VARCHAR(20),
AllergyType VARCHAR(20)
)
CREATE TABLE Has_Allergy (
StuID INTEGER,
Allergy VARCHAR(20)
)
CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHAR(12),
Age INTEGER,
Sex VARCHAR(1),
Major INTEGER,
Advisor INTEGER... | SELECT Allergy, COUNT(*) FROM Has_Allergy GROUP BY Allergy ORDER BY COUNT(*) DESC | nvbench |
CREATE TABLE table_14811 (
"Office" text,
"Representative" text,
"Party" text,
"Residence" text,
"First Elected" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Residence has a Party of dem, and a Representative of linda lawson?
| SELECT "Residence" FROM table_14811 WHERE "Party" = 'dem' AND "Representative" = 'linda lawson' | wikisql |
CREATE TABLE Ship (
Ship_ID int,
Name text,
Type text,
Built_Year real,
Class text,
Flag text
)
CREATE TABLE captain (
Captain_ID int,
Name text,
Ship_ID int,
age text,
Class text,
Rank text
)
-- Using valid SQLite, answer the following questions for the tables provide... | SELECT Class, COUNT(Class) FROM captain GROUP BY Rank, Class ORDER BY COUNT(Class) DESC | nvbench |
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardi... | SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT t3.itemid FROM (SELECT t2.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime, admissions.hadm_id FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id W... | mimic_iii |
CREATE TABLE Guests (
guest_id INTEGER,
gender_code CHAR(1),
guest_first_name VARCHAR(80),
guest_last_name VARCHAR(80),
date_of_birth DATETIME
)
CREATE TABLE View_Unit_Status (
apt_id INTEGER,
apt_booking_id INTEGER,
status_date DATETIME,
available_yn BIT
)
CREATE TABLE Apartments ... | SELECT booking_start_date, COUNT(booking_start_date) FROM Apartment_Bookings AS T1 JOIN Guests AS T2 ON T1.guest_id = T2.guest_id ORDER BY COUNT(booking_start_date) | nvbench |
CREATE TABLE table_name_81 (
tournament_location VARCHAR,
margin_of_victory VARCHAR,
purse___$__ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What tournament location has 1 stroke as the margin of victory, with 1,200,000 as the purse ($)?
| SELECT tournament_location FROM table_name_81 WHERE margin_of_victory = "1 stroke" AND purse___$__ = "1,200,000" | sql_create_context |
CREATE TABLE table_name_25 (
year INTEGER,
result VARCHAR,
venue VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What year has a result of 3 in the venue of Jarama.
| SELECT MIN(year) FROM table_name_25 WHERE result = "3" AND venue = "jarama" | sql_create_context |
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE instructor (
instructor_id int,
name varchar,
uniqname varchar
)
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)... | SELECT DISTINCT COURSE_1.department, COURSE_1.name, COURSE_1.number FROM course AS COURSE_0, course AS COURSE_1, course_prerequisite WHERE COURSE_0.course_id = course_prerequisite.pre_course_id AND COURSE_0.department = 'BIOSTAT' AND COURSE_0.number = 524 AND COURSE_1.course_id = course_prerequisite.course_id | advising |
CREATE TABLE table_49043 (
"Name (English)" text,
"Name (German)" text,
"Abbr." text,
"Ideology" text,
"Position" text,
"Votes (2011)" text,
"Seats in Hamburgische B\u00fcrgerschaft" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- WHAT ARE TH... | SELECT "Seats in Hamburgische B\u00fcrgerschaft" FROM table_49043 WHERE "Name (English)" = 'alliance ''90/the greens' | wikisql |
CREATE TABLE table_73657 (
"Team" text,
"City" text,
"Stadium" text,
"Capacity" real,
"Founded" real,
"Folded" real,
"History" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the maximum founded year of the Worcester Tornadoes?
| SELECT MAX("Founded") FROM table_73657 WHERE "Team" = 'Worcester Tornadoes' | wikisql |
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
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),
... | SELECT HIRE_DATE, SUM(EMPLOYEE_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY SUM(EMPLOYEE_ID) | nvbench |
CREATE TABLE table_53050 (
"reported isn" real,
"On July 2007 Press Release" text,
"Disposition" text,
"Citizenship" text,
"Country of Act" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the lowest reported isn for russia
| SELECT MIN("reported isn") FROM table_53050 WHERE "Citizenship" = 'russia' | wikisql |
CREATE TABLE table_name_24 (
oberliga_bayern VARCHAR,
season VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Oberliga Bayern has a Season of 1981-82?
| SELECT oberliga_bayern FROM table_name_24 WHERE season = "1981-82" | 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 admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type t... | SELECT chartevents.valuenum FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 8116)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'admit wt' ... | mimic_iii |
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25),
COUNTRY_ID varchar(2)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decima... | SELECT JOB_ID, SUM(DEPARTMENT_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' GROUP BY JOB_ID ORDER BY SUM(DEPARTMENT_ID) DESC | nvbench |
CREATE TABLE table_3429 (
"Series #" real,
"Season #" real,
"Title" text,
"Director" text,
"Writer(s)" text,
"Airdate" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who directed series # 422?
| SELECT "Director" FROM table_3429 WHERE "Series #" = '422' | 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 lab ON demographic.hadm_id = lab.hadm_id WHERE lab.itemid = "51457" AND lab.flag = "delta" | mimicsql_data |
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 INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.gender = "F" AND diagnoses.icd9_code = "76519" | mimicsql_data |
CREATE TABLE table_name_75 (
lost INTEGER,
goals_for VARCHAR,
drawn VARCHAR,
position VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest lost with a drawn more than 11, a position lower than 17 and more than 61 goals?
| SELECT MAX(lost) FROM table_name_75 WHERE drawn > 11 AND position < 17 AND goals_for > 61 | sql_create_context |
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.ethnicity = "ASIAN" AND diagnoses.long_title = "Panic disorder without agoraphobia" | mimicsql_data |
CREATE TABLE table_name_91 (
week INTEGER,
opponent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- On which week was the opponent the oakland raiders?
| SELECT SUM(week) FROM table_name_91 WHERE opponent = "oakland raiders" | sql_create_context |
CREATE TABLE table_1682026_2 (
company VARCHAR,
market_value__billion_$_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which company has a market value of 147.4?
| SELECT company FROM table_1682026_2 WHERE market_value__billion_$_ = "147.4" | sql_create_context |
CREATE TABLE table_10979 (
"Name" text,
"Street address in Detroit" text,
"Years as tallest" text,
"Height feet / m" text,
"Floors" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the sum of Floors at st. joseph church?
| SELECT SUM("Floors") FROM table_10979 WHERE "Name" = 'st. joseph church' | 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 mzjzjlb.JZLSH FROM hz_info JOIN mzjzjlb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE hz_info.RYBH = '50606376' AND NOT mzjzjlb.JZLSH IN (SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ <= '2011-11-27') | css |
CREATE TABLE table_74875 (
"Position" real,
"Team" text,
"Points" real,
"Played" real,
"Drawn" real,
"Lost" real,
"Against" real,
"Difference" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which average Played has a Drawn smaller than 1... | SELECT AVG("Played") FROM table_74875 WHERE "Drawn" < '1' AND "Points" > '4' | wikisql |
CREATE TABLE t_kc24 (
ACCOUNT_DASH_DATE time,
ACCOUNT_DASH_FLG number,
CASH_PAY number,
CIVIL_SUBSIDY number,
CKC102 number,
CLINIC_ID text,
CLINIC_SLT_DATE time,
COMP_ID text,
COM_ACC_PAY number,
COM_PAY number,
DATA_ID text,
ENT_ACC_PAY number,
ENT_PAY number,
F... | SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_ID = '31294224' AND t_kc22.STA_DATE BETWEEN '2004-11-03' AND '2019-06-03' AND t_kc21.MED_SER_ORG_NO = '3614796' AND t_kc22.MED_INV_ITEM_TYPE = '检查费' | css |
CREATE TABLE table_49254 (
"Date" text,
"H/A/N" text,
"Opponent" text,
"Score" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the opponent on January 7?
| SELECT "Opponent" FROM table_49254 WHERE "Date" = 'january 7' | wikisql |
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 number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE d_icd_diag... | SELECT COUNT(*) FROM prescriptions WHERE prescriptions.drug = 'bendamustine' AND STRFTIME('%y', prescriptions.startdate) >= '2100' | mimic_iii |
CREATE TABLE table_11234 (
"Date" text,
"Visiting Team" text,
"Final Score" text,
"Host Team" text,
"Stadium" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What stadium hosted the game that had a final score of 9-14?
| SELECT "Stadium" FROM table_11234 WHERE "Final Score" = '9-14' | wikisql |
CREATE TABLE table_name_26 (
runner_up VARCHAR,
winning_score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who is the runner-up when the winning score is 16 (68-70-65-65=268)?
| SELECT runner_up FROM table_name_26 WHERE winning_score = −16(68 - 70 - 65 - 65 = 268) | sql_create_context |
CREATE TABLE table_207795_1 (
published_in_russian VARCHAR,
type_of_work VARCHAR,
published_in_english VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- when type of work is novel and published in english is 1977, what was published in russian?
| SELECT published_in_russian FROM table_207795_1 WHERE type_of_work = "novel" AND published_in_english = "1977" | sql_create_context |
CREATE TABLE table_name_19 (
singular VARCHAR,
plural VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the singular if the plural is xweer(a)du?
| SELECT singular FROM table_name_19 WHERE plural = "xweer(a)du" | sql_create_context |
CREATE TABLE table_name_86 (
wins INTEGER,
top_25 VARCHAR,
top_5 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Wins with a Top-25 of 3, and a Top-5 larger than 1?
| SELECT AVG(wins) FROM table_name_86 WHERE top_25 = 3 AND top_5 > 1 | sql_create_context |
CREATE TABLE table_559 (
"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 followi... | SELECT "Tries against" FROM table_559 WHERE "Points" = '60' | wikisql |
CREATE TABLE table_62878 (
"Team" text,
"Matches" real,
"Wins" real,
"Wins %" text,
"Draws" real,
"Draws %" text,
"Losses" real,
"Losses %" text,
"Against" real,
"For & Against Ratio" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-... | SELECT SUM("Wins") FROM table_62878 WHERE "For & Against Ratio" = '0.83' AND "Losses" > '1' | wikisql |
CREATE TABLE table_224837_4 (
date_successor_seated VARCHAR,
district VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the date successor seated is south carolina 3rd
| SELECT date_successor_seated FROM table_224837_4 WHERE district = "South Carolina 3rd" | sql_create_context |
CREATE TABLE table_8893 (
"Position" real,
"Name" text,
"Played" real,
"Drawn" real,
"Lost" real,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which name has more than 14 points with less than 1 draw?
| SELECT "Name" FROM table_8893 WHERE "Points" > '14' AND "Drawn" < '1' | wikisql |
CREATE TABLE table_76247 (
"City" text,
"Country" text,
"IATA" text,
"ICAO" text,
"Airport" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What airport has an IATA of ARN?
| SELECT "Airport" FROM table_76247 WHERE "IATA" = 'arn' | wikisql |
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event... | SELECT AVG(chartevents.valuenum) FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 31880)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arte... | mimic_iii |
CREATE TABLE workshop (
Workshop_ID int,
Date text,
Venue text,
Name text
)
CREATE TABLE submission (
Submission_ID int,
Scores real,
Author text,
College text
)
CREATE TABLE Acceptance (
Submission_ID int,
Workshop_ID int,
Result text
)
-- Using valid SQLite, answer the ... | SELECT Venue, COUNT(Venue) FROM workshop GROUP BY Venue | nvbench |
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 t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM, t_kc22.QTY, t_kc22.UNIVALENT, t_kc22.AMOUNT FROM gwyjzb JOIN t_kc22 ON gwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gwyjzb.PERSON_ID = '38274476' AND gwyjzb.IN_HOSP_DATE BETWEEN '2006-12-30' AND '2018-12-15' UNION SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_... | css |
CREATE TABLE table_name_86 (
time_retired VARCHAR,
laps VARCHAR,
driver VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which time/retired had 75 laps and Pedro de la Rosa as a driver?
| SELECT time_retired FROM table_name_86 WHERE laps = 75 AND driver = "pedro de la rosa" | sql_create_context |
CREATE TABLE table_name_46 (
set_3 VARCHAR,
time VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the score for set 3 with a time at 15:04?
| SELECT set_3 FROM table_name_46 WHERE time = "15:04" | sql_create_context |
CREATE TABLE table_name_38 (
Id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the 2008 of the 2r 2011 and A 2010?
| SELECT 2008 FROM table_name_38 WHERE 2011 = "2r" AND 2010 = "a" | sql_create_context |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "HYPERTENSION;RULE OUT CORONARY ARTERY DISEASE\CARDIAC CATH" AND demographic.dob_year < "2110" | mimicsql_data |
CREATE TABLE table_4947 (
"Date" text,
"Tournament" text,
"Location" text,
"Winner" text,
"Score" text,
"Winner's share ( $ )" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What date was the tournament that had a winner's share of $28,000?
| SELECT "Date" FROM table_4947 WHERE "Winner's share ( $ )" = '28,000' | wikisql |
CREATE TABLE student_record (
student_id int,
course_id int,
semester int,
grade varchar,
how varchar,
transfer_source varchar,
earn_credit varchar,
repeat_term varchar,
test_id varchar
)
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE instructor (
... | SELECT DISTINCT instructor.name FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester INNER JOIN program_course ON program_course.course_id = course_offering.course_id INNER JOIN offering_instructor ON offering_instr... | advising |
CREATE TABLE table_59247 (
"County" text,
"Precincts" text,
"E. Greenberg" text,
"G. Hager" text,
"T. Wyka" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the G. Hager of E. Greenberg of 266 (14%)?
| SELECT "G. Hager" FROM table_59247 WHERE "E. Greenberg" = '266 (14%)' | wikisql |
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress text
)
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Descr... | WITH UserActivityStats AS (SELECT COALESCE(PostInfoByUser.UserId, CommentInfoByUser.UserId) AS UserId, (SELECT MAX(LastCreationDate) FROM (VALUES (PostInfoByUser.LastCreationDate), (CommentInfoByUser.LastCreationDate)) AS MaxValues) AS LastActivityDate FROM (SELECT OwnerUserId AS UserId, MAX(CreationDate) AS LastCreati... | sede |
CREATE TABLE table_63738 (
"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 is the even when the location is tokyo, japan ... | SELECT "Event" FROM table_63738 WHERE "Location" = 'tokyo, japan' AND "Record" = '6-1' | wikisql |
CREATE TABLE table_5836 (
"Round" real,
"Selection" text,
"Name" text,
"Position" text,
"College" text,
"Contract" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many rounds does Jamaal Charles have?
| SELECT COUNT("Round") FROM table_5836 WHERE "Name" = 'jamaal charles' | 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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dob_year < "1821" AND prescriptions.formulary_drug_cd = "THIAM100I" | mimicsql_data |
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 patients.dob FROM patients WHERE patients.subject_id = 19096 | mimic_iii |
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolea... | SELECT RANK() OVER (ORDER BY SUM(CASE pf.VoteTypeId WHEN 2 THEN 1 WHEN 3 THEN -1 END) DESC) AS Rank, pf.PostId AS "post_link", SUM(CASE WHEN pf.VoteTypeId = 2 THEN 1 ELSE NULL END) AS UpFeedback, SUM(CASE WHEN pf.VoteTypeId = 3 THEN 1 ELSE NULL END) AS DownFeedback, SUM(CASE pf.VoteTypeId WHEN 2 THEN 1 WHEN 3 THEN -1 E... | sede |
CREATE TABLE table_204_938 (
id number,
"year" number,
"edmonton\nhundred" number,
"elthorne\nhundred" number,
"gore\nhundred" number,
"isleworth\nhundred" number,
"ossulstone\nhundred\nholborn\ndivision" number,
"ossulstone\nhundred\nfinsbury\ndivision" number,
"ossulstone\nhundred\... | SELECT "year" FROM table_204_938 ORDER BY "ossulstone\nhundred\ntower\ndivision" DESC LIMIT 1 | squall |
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE lab (
labid numbe... | SELECT MAX(vitalperiodic.temperature) FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-140654')) AND NOT vitalperiodic.temperature IS... | eicu |
CREATE TABLE table_203_848 (
id number,
"outcome" text,
"no." number,
"date" number,
"tournament" text,
"surface" text,
"partner" text,
"opponents in the final" text,
"score in the final" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-... | SELECT "partner" FROM table_203_848 ORDER BY id DESC LIMIT 1 | squall |
CREATE TABLE table_70745 (
"Year" real,
"Entrant" text,
"Chassis" text,
"Engine" text,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who used Eurobrun er189b after 1989?
| SELECT "Entrant" FROM table_70745 WHERE "Year" > '1989' AND "Chassis" = 'eurobrun er189b' | wikisql |
CREATE TABLE postseason (
year INTEGER,
round TEXT,
team_id_winner TEXT,
league_id_winner TEXT,
team_id_loser TEXT,
league_id_loser TEXT,
wins INTEGER,
losses INTEGER,
ties INTEGER
)
CREATE TABLE batting (
player_id TEXT,
year INTEGER,
stint INTEGER,
team_id TEXT,
... | SELECT yearid, COUNT(*) FROM hall_of_fame GROUP BY yearid ORDER BY yearid | nvbench |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | SELECT AVG(demographic.age) FROM demographic WHERE demographic.marital_status = "SINGLE" AND demographic.dob_year > "2175" | mimicsql_data |
CREATE TABLE table_1057262_2 (
south_australia VARCHAR,
victoria VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what's the total number of south australia with victoria value of 2173
| SELECT COUNT(south_australia) FROM table_1057262_2 WHERE victoria = 2173 | sql_create_context |
CREATE TABLE table_32197 (
"Round" real,
"Overall" real,
"Player" text,
"Position" text,
"School/Club Team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which was the lowest overall that Wisconsin's team managed?
| SELECT MIN("Overall") FROM table_32197 WHERE "School/Club Team" = 'wisconsin' | wikisql |
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number... | SELECT * FROM Posts AS p LEFT JOIN PostTypes AS pt ON pt.Id = p.PostTypeId WHERE p.Tags LIKE '%artificial-intelligence%' OR p.Tags LIKE '%machine-learning%' | sede |
CREATE TABLE song (
song_name varchar2(50),
artist_name varchar2(50),
country varchar2(20),
f_id number(10),
genre_is varchar2(20),
rating number(10),
languages varchar2(20),
releasedate Date,
resolution number(10)
)
CREATE TABLE genre (
g_name varchar2(20),
rating varchar2(... | SELECT formats, COUNT(*) FROM files GROUP BY formats | nvbench |
CREATE TABLE table_75640 (
"Poll Source" text,
"Date" text,
"Candidate" text,
"Support" text,
"Consider" text,
"Oppose" text,
"Unsure" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What percentage of people were opposed to the candidate bas... | SELECT "Oppose" FROM table_75640 WHERE "Unsure" = '8%' AND "Poll Source" = 'wnbc/marist poll' | wikisql |
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 (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND diagnoses.long_title = "Personal history of antineoplastic chemotherapy" | mimicsql_data |
CREATE TABLE table_name_45 (
country VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which country was the player from who scored 66-72-70=207?
| SELECT country FROM table_name_45 WHERE score = 66 - 72 - 70 = 207 | sql_create_context |
CREATE TABLE table_22580855_1 (
production_code INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which is the biggest production code?
| SELECT MAX(production_code) FROM table_22580855_1 | sql_create_context |
CREATE TABLE table_name_7 (
province VARCHAR,
iata VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- WHich province has an IATA of WNZ?
| SELECT province FROM table_name_7 WHERE iata = "wnz" | sql_create_context |
CREATE TABLE table_name_93 (
city_of_license VARCHAR,
power VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the City of license that has a 1,400 watts Power
| SELECT city_of_license FROM table_name_93 WHERE power = "1,400 watts" | sql_create_context |
CREATE TABLE table_61863 (
"Pick" real,
"Player" text,
"Team" text,
"Position" text,
"Hometown/School" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- WHAT PLAYER HAS UPLAND HIGH SCHOOL?
| SELECT "Player" FROM table_61863 WHERE "Hometown/School" = 'upland high school' | wikisql |
CREATE TABLE t_kc21 (
MED_CLINIC_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
COMP_ID text,
PERSON_ID text,
PERSON_NM text,
IDENTITY_CARD text,
SOC_SRT_CARD text,
PERSON_SEX number,
PERSON_AGE number,
IN_HOSP_DATE time,
OUT_HOSP_DATE time,
DIFF_PLACE_FLG numb... | SELECT COUNT(DISTINCT IN_DIAG_DIS_CD) FROM t_kc21 WHERE PERSON_ID = '22994447' AND IN_HOSP_DATE BETWEEN '2012-01-31' AND '2017-08-07' | css |
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 AVG(t_kc21.MED_AMOUT) FROM t_kc21 WHERE t_kc21.MED_ORG_DEPT_NM = '乳腺肿瘤科' AND t_kc21.IN_HOSP_DATE BETWEEN '2007-05-11' AND '2012-06-01' AND t_kc21.IN_DIAG_DIS_CD = 'I35.324' AND t_kc21.CLINIC_TYPE = '住院' | css |
CREATE TABLE course (
course_id int,
name varchar,
department varchar,
number varchar,
credits varchar,
advisory_requirement varchar,
enforced_requirement varchar,
description varchar,
num_semesters int,
num_enrolled int,
has_discussion varchar,
has_lab varchar,
has_p... | SELECT DISTINCT course.department, course.name, course.number, program_course.category FROM course, course_offering, program_course, semester WHERE course.course_id = course_offering.course_id AND program_course.category IN ('PreMajor', 'MDE') AND program_course.course_id = course.course_id AND semester.semester = 'Fal... | advising |
CREATE TABLE table_56680 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Decision" text,
"Attendance" real,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which home has a Decision of kolzig, and a Date of november 5?
| SELECT "Home" FROM table_56680 WHERE "Decision" = 'kolzig' AND "Date" = 'november 5' | wikisql |
CREATE TABLE table_65126 (
"Player" text,
"Int'l Debut" text,
"Year" text,
"Cross Code Debut" text,
"Date" text,
"Position" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Cross Code Debut for a player that had their Int'l Debut of RU... | SELECT "Cross Code Debut" FROM table_65126 WHERE "Int'l Debut" = 'ru test new zealand v australia' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.