instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
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 HIRE_DATE, SUM(DEPARTMENT_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) | nvbench |
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 demographic.admittime, diagnoses.icd9_code FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.subject_id = "74032" | mimicsql_data |
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 procedures.short_title, procedures.long_title FROM procedures WHERE procedures.icd9_code = "5361" | mimicsql_data |
CREATE TABLE course_tags_count (
course_id int,
clear_grading int,
pop_quiz int,
group_projects int,
inspirational int,
long_lectures int,
extra_credit int,
few_tests int,
good_feedback int,
tough_tests int,
heavy_papers int,
cares_for_students int,
heavy_assignments ... | SELECT COUNT(*) > 0 FROM course, course_offering, semester WHERE course_offering.friday = 'N' AND course_offering.monday = 'Y' AND course_offering.thursday = 'N' AND course_offering.tuesday = 'N' AND course_offering.wednesday = 'Y' AND course.course_id = course_offering.course_id AND course.department = 'EECS' AND cour... | advising |
CREATE TABLE table_27537518_6 (
first_star VARCHAR,
record VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the first star of the game with record of 17-11-5?
| SELECT first_star FROM table_27537518_6 WHERE record = "17-11-5" | sql_create_context |
CREATE TABLE table_27208311_1 (
episode_no_episode_no_refers_to_the_episodes_number_in_the_overall_series VARCHAR,
_whereas_series_no_refers_to_the_episodes_number_in_this_particular_series VARCHAR,
series_no VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-... | SELECT episode_no_episode_no_refers_to_the_episodes_number_in_the_overall_series, _whereas_series_no_refers_to_the_episodes_number_in_this_particular_series FROM table_27208311_1 WHERE series_no = 3 | sql_create_context |
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 job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
... | SELECT HIRE_DATE, SUM(EMPLOYEE_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 | nvbench |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.label = "Lymphs" | mimicsql_data |
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val... | SELECT prescriptions.drug FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 80555) AND DATETIME(prescriptions.startdate, 'start of day') = DATETIME(CURRENT_TIME(), 'start of day', '-0 day') EXCEPT SELECT prescriptions.drug FROM prescriptions WHERE... | mimic_iii |
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABLE fare_basis (
fare_basis_code text,
booking_class text,
class_type text,
premium text,
economy text,
discounted text,
night text,
season text,
basis_days text
)
CREATE TABLE month (
... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight, state WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'LONG BEACH' AND date_day.day_number = 21 AND date_day.month_number... | atis |
CREATE TABLE table_7452 (
"Player" text,
"Nationality" text,
"Position" text,
"Years in Orlando" text,
"School/Club Team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Years in Orlando has a Nationality of united states, and a School/Club Tea... | SELECT "Years in Orlando" FROM table_7452 WHERE "Nationality" = 'united states' AND "School/Club Team" = 'illinois' | wikisql |
CREATE TABLE table_225204_4 (
date_successor_seated VARCHAR,
district VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the date successor seated for pennsylvania 17th
| SELECT date_successor_seated FROM table_225204_4 WHERE district = "Pennsylvania 17th" | 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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2180" AND lab.itemid = "51362" | mimicsql_data |
CREATE TABLE table_59835 (
"Place" text,
"Player" text,
"Country" text,
"Score" real,
"To par" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was Bernhard Langer's highest score?
| SELECT MAX("Score") FROM table_59835 WHERE "Player" = 'bernhard langer' | wikisql |
CREATE TABLE table_204_335 (
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 COUNT(*) FROM table_204_335 WHERE "partner" = 'jim mcmanus' | squall |
CREATE TABLE table_name_71 (
frequency VARCHAR,
genre VARCHAR,
station VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What frequency is the xfm station, which is part of the talk music genre?
| SELECT frequency FROM table_name_71 WHERE genre = "talk music" AND station = "xfm" | sql_create_context |
CREATE TABLE table_name_88 (
gold INTEGER,
silver VARCHAR,
total VARCHAR,
bronze VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many Gold medals did the Nation with less than 8 Total medals including 1 Bronze and 0 Silver receive?
| SELECT MIN(gold) FROM table_name_88 WHERE total < 8 AND bronze < 1 AND silver < 1 | sql_create_context |
CREATE TABLE CLASS (
CLASS_CODE varchar(5),
CRS_CODE varchar(10),
CLASS_SECTION varchar(2),
CLASS_TIME varchar(20),
CLASS_ROOM varchar(8),
PROF_NUM int
)
CREATE TABLE DEPARTMENT (
DEPT_CODE varchar(10),
DEPT_NAME varchar(30),
SCHOOL_CODE varchar(8),
EMP_NUM int,
DEPT_ADDRESS... | SELECT PROF_OFFICE, COUNT(PROF_OFFICE) FROM CLASS AS T1 JOIN EMPLOYEE AS T2 ON T1.PROF_NUM = T2.EMP_NUM JOIN COURSE AS T3 ON T1.CRS_CODE = T3.CRS_CODE JOIN PROFESSOR AS T4 ON T2.EMP_NUM = T4.EMP_NUM GROUP BY CRS_DESCRIPTION, PROF_OFFICE ORDER BY PROF_OFFICE | nvbench |
CREATE TABLE table_71612 (
"Date" text,
"Company" text,
"Business" text,
"Country" text,
"Value ( USD )" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What company has an unknown date and is an energy business?
| SELECT "Company" FROM table_71612 WHERE "Business" = 'energy' AND "Date" = 'unknown' | wikisql |
CREATE TABLE available_policies (
customer_phone VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Find all the phone numbers.
| SELECT customer_phone FROM available_policies | sql_create_context |
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_NM, IN_DIAG_DIS_NM, AVG(PERSON_AGE) FROM t_kc21 WHERE MED_SER_ORG_NO = '5826228' GROUP BY MED_ORG_DEPT_NM, IN_DIAG_DIS_NM | css |
CREATE TABLE table_1204998_2 (
pinyin VARCHAR,
english_name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the pinyin for the English name Wuping County?
| SELECT pinyin FROM table_1204998_2 WHERE english_name = "Wuping County" | sql_create_context |
CREATE TABLE table_38948 (
"Rank" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the lowest bronze with a 6 rank, smaller than 5 gold, and a total of more than 1?
| SELECT MIN("Bronze") FROM table_38948 WHERE "Gold" < '5' AND "Rank" = '6' AND "Total" > '1' | wikisql |
CREATE TABLE table_32104 (
"Title" text,
"Japan" text,
"North America" text,
"Europe" text,
"Australia" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Tell me the north america for september 18, 2009
| SELECT "North America" FROM table_32104 WHERE "Europe" = 'september 18, 2009' | wikisql |
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE instructor (
instructor_id int,
name varchar,
uniqname ... | SELECT DISTINCT student.firstname, student.lastname FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN gsi ON gsi.course_offering_id = course_offering.offering_id INNER JOIN student ON student.student_id = gsi.student_id INNER JOIN semester ON semester.semester_id = course... | advising |
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId number,
PostId number,
SuggestedEditId number,
CompletedByReviewTaskId number
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Bod... | SELECT 'http://www.stackoverflow.com/questions/' + CAST(p2.ParentId AS TEXT) AS "URL", SUBSTRING(p2.Body, 1, 30) AS TITLE, Score AS VOTES FROM Posts AS p2, (SELECT p1.Id FROM Posts AS p1, PostTypes AS ptypes1, PostTags AS ptags1, Tags AS t1 WHERE p1.PostTypeId = ptypes1.Id AND ptypes1.Id = 1 AND p1.Id = ptags1.PostId A... | sede |
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_code varchar
)
CREATE TABLE flight_stop (
flight_id int,
stop_number int,
stop_days text,
stop_airp... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, flight, flight_stop WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DALLAS' AND CITY_2.cit... | atis |
CREATE TABLE table_59799 (
"Season" text,
"League" text,
"Teams" text,
"Home" text,
"Away" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What season has an away 2-0?
| SELECT "Season" FROM table_59799 WHERE "Away" = '2-0' | wikisql |
CREATE TABLE t_kc21_t_kc24 (
MED_CLINIC_ID text,
MED_SAFE_PAY_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,
... | SELECT AVG(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc21_t_kc24.MED_CLINIC_ID IN (SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_AGE >= 6) | css |
CREATE TABLE table_name_13 (
lead_pitch_mm INTEGER,
part_number VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Lead Pitch/mm has a Part Number of tsop24/28?
| SELECT MAX(lead_pitch_mm) FROM table_name_13 WHERE part_number = "tsop24/28" | sql_create_context |
CREATE TABLE table_10823 (
"Year" real,
"Artist" text,
"Mintage (Proof)" text,
"Issue Price (Proof)" text,
"Mintage (BU)[ clarification needed ]" text,
"Issue Price (BU)[ clarification needed ]" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who... | SELECT "Artist" FROM table_10823 WHERE "Issue Price (BU)[ clarification needed ]" = 'n/a' AND "Year" > '2004' AND "Mintage (Proof)" = '25,000' | wikisql |
CREATE TABLE table_2562572_2 (
population__2002_ VARCHAR,
population__2011_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the number of 2002 populations having a 2011 population of exactly 5399?
| SELECT COUNT(population__2002_) FROM table_2562572_2 WHERE population__2011_ = 5399 | sql_create_context |
CREATE TABLE table_76483 (
"Model" text,
"Sensor Size" text,
"Resolution" text,
"Active Pixels" text,
"Display" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which model has a sensor sized 48x36 mm, pixels of 6726 x 5040, and a 33 mp resolution?
| SELECT "Model" FROM table_76483 WHERE "Sensor Size" = '48x36 mm' AND "Active Pixels" = '6726 x 5040' AND "Resolution" = '33 mp' | wikisql |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE labevents (
row_id number,
subject_id number,
h... | SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT diagnoses_icd.icd9_code FROM diagnoses_icd WHERE diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 54825 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime D... | mimic_iii |
CREATE TABLE table_name_43 (
country VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What country has david toms as the player?
| SELECT country FROM table_name_43 WHERE player = "david toms" | sql_create_context |
CREATE TABLE table_24825 (
"Institution" text,
"Location" text,
"Enrollment" text,
"Athletic nickname" text,
"School Colors" text,
"Founded" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- For the location of quezon city , metro manila what is th... | SELECT "Athletic nickname" FROM table_24825 WHERE "Location" = 'Quezon City , Metro Manila' | wikisql |
CREATE TABLE table_name_74 (
byes VARCHAR,
draws INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the total byes for more than 1 draw?
| SELECT COUNT(byes) FROM table_name_74 WHERE draws > 1 | sql_create_context |
CREATE TABLE equipment_sequence (
aircraft_code_sequence varchar,
aircraft_code varchar
)
CREATE TABLE ground_service (
city_code text,
airport_code text,
transport_type text,
ground_fare int
)
CREATE TABLE restriction (
restriction_code text,
advance_purchase int,
stopovers text,
... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, flight, flight_stop WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'ST. LOUIS' AND CITY_2.... | atis |
CREATE TABLE table_13745 (
"Year" real,
"Title" text,
"Director" text,
"Studio(s)" text,
"Notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Year of Rio?
| SELECT "Year" FROM table_13745 WHERE "Title" = 'rio' | wikisql |
CREATE TABLE table_name_75 (
tournament VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which tournament had a 1994 finish of RR and 1996 and 1998 finishes of A?
| SELECT tournament FROM table_name_75 WHERE 1996 = "a" AND 1998 = "a" AND 1994 = "rr" | sql_create_context |
CREATE TABLE table_203_13 (
id number,
"year" number,
"champion" text,
"score" text,
"runner-up" text,
"coach" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many times did boston college score more than 7 points in a game ?
| SELECT COUNT(*) FROM table_203_13 WHERE "score" > 7 AND "champion" = 'boston college' | squall |
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, SALARY FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) | nvbench |
CREATE TABLE table_5557 (
"Number" real,
"Builder" text,
"Type" text,
"Date" real,
"Works number" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Date has a Builder of alco schenectady, and a Number larger than 835, and Works number of 56566?
| SELECT AVG("Date") FROM table_5557 WHERE "Builder" = 'alco schenectady' AND "Number" > '835' AND "Works number" = '56566' | wikisql |
CREATE TABLE EMPLOYEE (
EMP_NUM int,
EMP_LNAME varchar(15),
EMP_FNAME varchar(12),
EMP_INITIAL varchar(1),
EMP_JOBCODE varchar(5),
EMP_HIREDATE datetime,
EMP_DOB datetime
)
CREATE TABLE DEPARTMENT (
DEPT_CODE varchar(10),
DEPT_NAME varchar(30),
SCHOOL_CODE varchar(8),
EMP_NU... | SELECT EMP_FNAME, COUNT(EMP_FNAME) FROM EMPLOYEE WHERE EMP_JOBCODE = 'PROF' GROUP BY EMP_FNAME ORDER BY EMP_DOB | nvbench |
CREATE TABLE table_66071 (
"Game" text,
"Date" text,
"Opponent" text,
"Result" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the record for Game 8?
| SELECT "Record" FROM table_66071 WHERE "Game" = '8' | wikisql |
CREATE TABLE table_35636 (
"Date" text,
"City" text,
"Opponent" text,
"Results\u00b9" text,
"Type of game" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What were the results on September 7?
| SELECT "Results\u00b9" FROM table_35636 WHERE "Date" = 'september 7' | wikisql |
CREATE TABLE table_5343 (
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Gold larger than 0, and a Bronze larger than 1 includes what total number of silver?
| SELECT COUNT("Silver") FROM table_5343 WHERE "Gold" > '0' AND "Bronze" > '1' | wikisql |
CREATE TABLE table_name_9 (
score VARCHAR,
opponent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Score, when Opponent is '@ New York Knicks'?
| SELECT score FROM table_name_9 WHERE opponent = "@ new york knicks" | sql_create_context |
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 (SELECT lab.labresult FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '015-7988' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospit... | eicu |
CREATE TABLE table_name_60 (
Id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the 1989 result of the tournament in which Katerina Maleeva finished 4r in 1991?
| SELECT 1989 FROM table_name_60 WHERE 1991 = "4r" | sql_create_context |
CREATE TABLE table_34320 (
"Date" text,
"Episode" real,
"Performer 1" text,
"Performer 2" text,
"Performer 3" text,
"Performer 4" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total number of episodes where jim sweeney was the 1st p... | SELECT COUNT("Episode") FROM table_34320 WHERE "Performer 1" = 'jim sweeney' AND "Performer 2" = 'steve steen' | wikisql |
CREATE TABLE table_52746 (
"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 was the final score in the game against the Cincinnati Bengals?
| SELECT "Final Score" FROM table_52746 WHERE "Visiting Team" = 'cincinnati bengals' | wikisql |
CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE PostLinks (
Id num... | SELECT COUNT(Id) FROM Users | sede |
CREATE TABLE table_10102 (
"Venue" text,
"Hosted" real,
"Average" real,
"Highest" real,
"Lowest" real,
"Total" real,
"Last Year" text,
"Up/Down" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the smallest hosted when the average ... | SELECT MIN("Hosted") FROM table_10102 WHERE "Average" < '35,208' AND "Total" > '593,202' | wikisql |
CREATE TABLE table_9313 (
"Player" text,
"Team" text,
"Matches" real,
"Innings" real,
"Runs" real,
"Average" real,
"Highest Score" text,
"100s" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the largest number of innings with les... | SELECT MAX("Innings") FROM table_9313 WHERE "Runs" < '342' AND "Matches" > '4' | wikisql |
CREATE TABLE table_17070 (
"Player" text,
"Position" text,
"School" text,
"Hometown" text,
"College" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- WHAT IS THE HOMETOWN OF TONY STEWARD?
| SELECT "Hometown" FROM table_17070 WHERE "Player" = 'Tony Steward' | wikisql |
CREATE TABLE table_1616608_2 (
game_modes VARCHAR,
pinyin VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What game modes are there when the pinyin is zh g n y b ?
| SELECT game_modes FROM table_1616608_2 WHERE pinyin = "Zhígǎn Yī Bǐ" | sql_create_context |
CREATE TABLE table_79316 (
"Rank" real,
"Heat" real,
"Lane" real,
"Nationality" text,
"Time" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Can you tell me the Time that has the Heat of 1, and the Lane of 2?
| SELECT "Time" FROM table_79316 WHERE "Heat" = '1' AND "Lane" = '2' | wikisql |
CREATE TABLE table_11734041_11 (
position VARCHAR,
school_club_team_country VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the position of the player that came from the school/club team/country of Purdue?
| SELECT position FROM table_11734041_11 WHERE school_club_team_country = "Purdue" | sql_create_context |
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABLE fare_basis (
fare_basis_code text,
booking_class text,
class_type text,
premium text,
economy text,
discounted text,
night text,
season text,
basis_days text
)
CREATE TABLE flight_s... | SELECT DISTINCT airport_service.miles_distant FROM airport, airport_service, city WHERE airport.airport_code = 'LAX' AND airport.airport_code = airport_service.airport_code AND city.city_code = airport_service.city_code AND city.city_name = 'LOS ANGELES' | atis |
CREATE TABLE table_name_82 (
role VARCHAR,
tournament VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Role in the 1st Division Honduras Tournament?
| SELECT role FROM table_name_82 WHERE tournament = "1st division honduras" | sql_create_context |
CREATE TABLE table_16059 (
"Round" real,
"Choice" real,
"Overall" real,
"Player name" text,
"Position" text,
"College" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which overall pick was traded to the Cleveland Browns?
| SELECT "Overall" FROM table_16059 WHERE "College" = 'Traded to the Cleveland Browns' | wikisql |
CREATE TABLE Customer (
CustomerId integer,
FirstName varchar(40),
LastName varchar(20),
Company varchar(80),
Address varchar(70),
City varchar(40),
State varchar(40),
Country varchar(40),
PostalCode varchar(10),
Phone varchar(24),
Fax varchar(24),
Email varchar(60),
... | SELECT InvoiceDate, COUNT(InvoiceDate) FROM Customer AS T1 JOIN Invoice AS T2 ON T1.CustomerId = T2.CustomerId WHERE T1.FirstName = "Astrid" AND LastName = "Gruber" ORDER BY COUNT(InvoiceDate) | nvbench |
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(gwyjzb.IN_DIAG_DIS_CD) FROM gwyjzb WHERE gwyjzb.PERSON_ID = '22165131' AND gwyjzb.IN_HOSP_DATE BETWEEN '2010-10-05' AND '2014-07-21' UNION SELECT COUNT(fgwyjzb.IN_DIAG_DIS_CD) FROM fgwyjzb WHERE fgwyjzb.PERSON_ID = '22165131' AND fgwyjzb.IN_HOSP_DATE BETWEEN '2010-10-05' AND '2014-07-21' | css |
CREATE TABLE table_name_34 (
national_university_of_ireland VARCHAR,
agricultural_panel VARCHAR,
labour_panel VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- I want to know the total number of national university of ireland with agricultural panel of 0 an... | SELECT COUNT(national_university_of_ireland) FROM table_name_34 WHERE agricultural_panel = 0 AND labour_panel > 0 | sql_create_context |
CREATE TABLE table_41630 (
"Rank" real,
"Location" text,
"Total Passengers" real,
"Annual change" text,
"Capacity in use" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average rank of the airport in S o Paulo with passengers totaling le... | SELECT AVG("Rank") FROM table_41630 WHERE "Location" = 'são paulo' AND "Total Passengers" < '18,795,596' | wikisql |
CREATE TABLE table_19624708_1 (
handicap__st_lb_ VARCHAR,
horse VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which handicap has the horse knowhere?
| SELECT handicap__st_lb_ FROM table_19624708_1 WHERE horse = "Knowhere" | sql_create_context |
CREATE TABLE table_67384 (
"Position" text,
"Number" real,
"Name" text,
"Class" text,
"Injury (Status)" text,
"Last Update" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- for the position of rb what is the name?
| SELECT "Name" FROM table_67384 WHERE "Position" = 'rb' | wikisql |
CREATE TABLE table_60447 (
"Year" real,
"Delegate" text,
"Hometown" text,
"Placement in Miss Universe" text,
"Other awards" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What kind of Placement in Miss Universe that rosita cornell capuyon is in?
| SELECT "Placement in Miss Universe" FROM table_60447 WHERE "Delegate" = 'rosita cornell capuyon' | wikisql |
CREATE TABLE table_70971 (
"Year" text,
"Venue" text,
"Winners" text,
"Runner-up" text,
"3rd place" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the runner-up in 1980 at the Pocking venue?
| SELECT "Runner-up" FROM table_70971 WHERE "Venue" = 'pocking' AND "Year" = '1980' | wikisql |
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 SUM(MED_AMOUT) FROM t_kc21 WHERE PERSON_NM = '戚文栋' AND CLINIC_TYPE = '门诊' | css |
CREATE TABLE table_1467 (
"C/W 15+" real,
"Oblast\\Age" text,
"15 to 17" real,
"18 to 19" real,
"20 to 24" real,
"25 to 29" real,
"30 to 34" real,
"35 to 39" real,
"40 to 44" real,
"45 to 49" real,
"50 to 54" real,
"55 to 59" real,
"60 to 64" real,
"65 to 69" real... | SELECT COUNT("65 to 69") FROM table_1467 WHERE "Oblast\\Age" = 'Komis in Nenetskiy AO' | wikisql |
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
-- Using valid SQLite, answer the following questions for the... | SELECT T1.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name, T1.Name ORDER BY T1.Code | nvbench |
CREATE TABLE table_47750 (
"Elector" text,
"Nationality" text,
"Order and title" text,
"Elevated" text,
"Elevator" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When Giovanni Gaetano Orsini was the elector who was the elevator?
| SELECT "Elevator" FROM table_47750 WHERE "Elector" = 'giovanni gaetano orsini' | 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 IN_DIAG_DIS_CD, IN_DIAG_DIS_NM FROM t_kc21 WHERE PERSON_ID = '14360011' AND IN_HOSP_DATE BETWEEN '2006-02-17' AND '2013-01-19' GROUP BY IN_DIAG_DIS_CD ORDER BY COUNT(*) DESC LIMIT 1 | css |
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE offering_instructor (
... | SELECT COUNT(*) = 0 FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE course.has_exams = 'N' AND program_course.category LIKE '%ULCS%' | advising |
CREATE TABLE table_203_721 (
id number,
"school" text,
"location" text,
"control" text,
"type" text,
"enrollment" number,
"founded" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the total number of schools listed in the table ?
| SELECT COUNT("school") FROM table_203_721 | squall |
CREATE TABLE table_12323 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What did the United States score in the T5?
| SELECT "Score" FROM table_12323 WHERE "Country" = 'united states' AND "Place" = 't5' | wikisql |
CREATE TABLE table_28003469_1 (
approx_duration VARCHAR,
event_details VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is every value for approximate duration when event details is women's foil?
| SELECT approx_duration FROM table_28003469_1 WHERE event_details = "Women's Foil" | sql_create_context |
CREATE TABLE table_203_834 (
id number,
"rank" number,
"census subdivision" text,
"province" text,
"type" text,
"land area\n(km2, 2011)" number,
"population 2011" number,
"population 2006" number,
"population 2001" number,
"population 1996" number,
"change in % 2006-2011" num... | SELECT (SELECT "population 2011" FROM table_203_834 WHERE "census subdivision" = 'ottawa') > (SELECT "population 2011" FROM table_203_834 WHERE "census subdivision" = 'vancouver') | squall |
CREATE TABLE table_17675675_2 (
tries_against VARCHAR,
club VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- For club Swansea Uplands RFC, what is the amount of tries against?
| SELECT tries_against FROM table_17675675_2 WHERE club = "Swansea Uplands RFC" | sql_create_context |
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConce... | SELECT Title, Tags FROM Posts WHERE NOT Posts.Title IS NULL LIMIT 100 | sede |
CREATE TABLE table_56594 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what's the highest lap that contains the driver of graham hill and a grid that is larger than 18?
| SELECT MAX("Laps") FROM table_56594 WHERE "Driver" = 'graham hill' AND "Grid" > '18' | wikisql |
CREATE TABLE table_name_98 (
date VARCHAR,
attendance VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- On what date was the attendance 24,976?
| SELECT date FROM table_name_98 WHERE attendance = "24,976" | sql_create_context |
CREATE TABLE table_name_93 (
born___died VARCHAR,
connection_with_australia VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Born Died for the person whose family moved to Australia at age 6?
| SELECT born___died FROM table_name_93 WHERE connection_with_australia = "family moved to australia at age 6" | sql_create_context |
CREATE TABLE table_54747 (
"Father" text,
"Birth" text,
"Marriage" text,
"Became Queen" text,
"Ceased to be Queen" text,
"Death" text,
"Spouse" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the birth date of the person who died on 1... | SELECT "Birth" FROM table_54747 WHERE "Death" = '18 october 1335' | wikisql |
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId... | SELECT * FROM Posts WHERE Id = 25279607 | sede |
CREATE TABLE table_name_16 (
year VARCHAR,
finish VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What year did the finish of 15 happen in?
| SELECT year FROM table_name_16 WHERE finish = "15" | sql_create_context |
CREATE TABLE table_name_28 (
lost INTEGER,
points VARCHAR,
played VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average for games Lost where the Points are 25 and games Played are more than 18?
| SELECT AVG(lost) FROM table_name_28 WHERE points = 25 AND played > 18 | sql_create_context |
CREATE TABLE table_name_75 (
wins INTEGER,
rank VARCHAR,
played VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest Wins, when Rank is greater than 2, and when Played is less than 5?
| SELECT MAX(wins) FROM table_name_75 WHERE rank > 2 AND played < 5 | sql_create_context |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE 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 INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE procedures.long_title = "Angiocardiography of right heart structures" AND lab.fluid = "Blood" | mimicsql_data |
CREATE TABLE table_16894 (
"Name" text,
"Number" text,
"Builder" text,
"Date built" text,
"Wheel arrangement" text,
"Driving wheels" text,
"Cylinders" text,
"Boiler pressure" text,
"Notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
... | SELECT "Name" FROM table_16894 WHERE "Notes" = 'Ex-industrial' AND "Builder" = 'Manning Wardle' | wikisql |
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit ... | SELECT COUNT(*) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 61751) AND STRFTIME('%y', prescriptions.startdate) = '2105' | mimic_iii |
CREATE TABLE table_1342292_42 (
candidates VARCHAR,
incumbent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who are all the candidates when Sam Rayburn was incumbent?
| SELECT candidates FROM table_1342292_42 WHERE incumbent = "Sam Rayburn" | sql_create_context |
CREATE TABLE table_30919 (
"No. overall" real,
"No. for series" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"UK viewers (million)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the airdate o... | SELECT "Original air date" FROM table_30919 WHERE "UK viewers (million)" = '6.02' | wikisql |
CREATE TABLE table_name_8 (
deleted VARCHAR,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What site in the RCA Del Caribe was deleted?
| SELECT deleted FROM table_name_8 WHERE name = "rca del caribe" | sql_create_context |
CREATE TABLE table_203_747 (
id number,
"rank" number,
"nation" text,
"gold" number,
"silver" number,
"bronze" number,
"total" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the difference between the total amount of medals won by ... | SELECT ABS((SELECT "total" FROM table_203_747 WHERE "nation" = 'qatar') - (SELECT "total" FROM table_203_747 WHERE "nation" = 'indonesia')) | squall |
CREATE TABLE conference (
cid int,
homepage varchar,
name varchar
)
CREATE TABLE domain_author (
aid int,
did int
)
CREATE TABLE publication (
abstract varchar,
cid int,
citation_num int,
jid int,
pid int,
reference_num int,
title varchar,
year int
)
CREATE TABLE d... | SELECT author.name FROM author, organization WHERE organization.name = 'University of Michigan' AND organization.oid = author.oid | academic |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2197" AND lab.fluid = "Other Body Fluid" | mimicsql_data |
CREATE TABLE table_25264 (
"Week #" text,
"Theme" text,
"Song choice" text,
"Original artist" text,
"Order #" text,
"Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- If Crazy In Love is the song choice, what is the theme?
| SELECT "Theme" FROM table_25264 WHERE "Song choice" = 'Crazy In Love' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.