instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_12438 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Date, when Home Team is 'Chester City'?
| SELECT "Date" FROM table_12438 WHERE "Home team" = 'chester city' | wikisql |
CREATE TABLE table_name_31 (
unit VARCHAR,
type VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which unite had the type wwer-440/213?
| SELECT unit FROM table_name_31 WHERE type = "wwer-440/213" | sql_create_context |
CREATE TABLE table_23191 (
"Player" text,
"Games Played" real,
"Rebounds" real,
"Assists" real,
"Steals" real,
"Blocks" real,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many rebounds did Rhonda Mapp make?
| SELECT MAX("Rebounds") FROM table_23191 WHERE "Player" = 'Rhonda Mapp' | 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 demographic (... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "WHITE - RUSSIAN" AND demographic.admityear < "2154" | mimicsql_data |
CREATE TABLE table_name_37 (
power_rpm VARCHAR,
torque__nm__rpm VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Tell me the power when the torque is n m (lb ft)/*n m (lb ft) @1750
| SELECT power_rpm FROM table_name_37 WHERE torque__nm__rpm = "n·m (lb·ft)/*n·m (lb·ft) @1750" | sql_create_context |
CREATE TABLE ref_document_types (
document_type_code text,
document_type_name text,
document_type_description text
)
CREATE TABLE employees (
employee_id number,
role_code text,
employee_name text,
gender_mfu text,
date_of_birth time,
other_details text
)
CREATE TABLE document_loca... | SELECT role_code FROM employees GROUP BY role_code HAVING COUNT(*) >= 3 | spider |
CREATE TABLE table_2110959_1 (
season VARCHAR,
pct__percentage VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In what season was the pct % 0.552?
| SELECT season FROM table_2110959_1 WHERE pct__percentage = "0.552" | sql_create_context |
CREATE TABLE jybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH text,
BGJGDM text,
BGJGMC text,
BGRGH text,
BGRQ time,
BGRXM text,
BGSJ time,
CJRQ time,
JSBBRQSJ time,
JSBBSJ time,
JYBBH text,
JYJGMC text,
JYJSGH text,
JYJSQM text,
JY... | SELECT jybgb.SHSJ FROM hz_info JOIN mzjzjlb JOIN jybgb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE hz_info.RYBH = '17320230' AND jybgb.BGRQ BETWEEN '2013-09-23' AND '2019-11-29' UNION... | css |
CREATE TABLE table_name_66 (
in_production VARCHAR,
codename VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Is Jasper being producted?
| SELECT in_production FROM table_name_66 WHERE codename = "jasper" | sql_create_context |
CREATE TABLE table_60033 (
"Letter" text,
"American" text,
"British" text,
"Australian" text,
"Examples" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Australian for the American ?
| SELECT "Australian" FROM table_60033 WHERE "American" = 'ɑ' | 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 MED_CLINIC_ID FROM t_kc21 WHERE PERSON_ID = '16935106' AND MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc22 WHERE AMOUNT > 853.43) | css |
CREATE TABLE table_60049 (
"Draft" real,
"Round" text,
"Pick" real,
"Player" text,
"Nationality" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Player has a Draft of 1994, a Pick larger than 8, a Round of 10, and a Nationality of canada?
| SELECT "Player" FROM table_60049 WHERE "Draft" = '1994' AND "Pick" > '8' AND "Round" = '10' AND "Nationality" = 'canada' | wikisql |
CREATE TABLE table_67650 (
"Res." text,
"Record" text,
"Opponent" text,
"Type" text,
"Rd., Time" text,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the record of the match on 2009-07-18?
| SELECT "Record" FROM table_67650 WHERE "Date" = '2009-07-18' | wikisql |
CREATE TABLE aircraft (
aid number(9,0),
name varchar2(30),
distance number(6,0)
)
CREATE TABLE employee (
eid number(9,0),
name varchar2(30),
salary number(10,2)
)
CREATE TABLE certificate (
eid number(9,0),
aid number(9,0)
)
CREATE TABLE flight (
flno number(4,0),
origin var... | SELECT origin, COUNT(*) FROM flight GROUP BY origin | nvbench |
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 prescriptions (
subject_id text,
hadm_id... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.marital_status = "MARRIED" AND demographic.admityear < "2198" | mimicsql_data |
CREATE TABLE table_57939 (
"Year" text,
"Driver" text,
"Constructor" text,
"Category" text,
"Location" text,
"Report" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What company constructed the vehicle when the driver shows as not held?
| SELECT "Constructor" FROM table_57939 WHERE "Driver" = 'not held' | wikisql |
CREATE TABLE table_24807774_1 (
afghan VARCHAR,
arabic VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many arabic scottish is afghan
| SELECT afghan FROM table_24807774_1 WHERE arabic = "Scottish" | sql_create_context |
CREATE TABLE student_course_attendance (
student_id VARCHAR,
course_id VARCHAR,
date_of_attendance VARCHAR
)
CREATE TABLE courses (
course_id VARCHAR,
course_name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- List the id of students who attende... | SELECT T2.student_id FROM courses AS T1 JOIN student_course_attendance AS T2 ON T1.course_id = T2.course_id WHERE T1.course_name = "statistics" ORDER BY T2.date_of_attendance | sql_create_context |
CREATE TABLE table_name_72 (
shot__percentage INTEGER,
country VARCHAR,
ends_lost VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the sum shot % when the country is finland, and an ends lost is larger than 49?
| SELECT SUM(shot__percentage) FROM table_name_72 WHERE country = "finland" AND ends_lost > 49 | sql_create_context |
CREATE TABLE table_name_50 (
position VARCHAR,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the position of Allen Gamboa?
| SELECT position FROM table_name_50 WHERE name = "allen gamboa" | 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 diagnoses.short_title, diagnoses.long_title FROM diagnoses WHERE diagnoses.icd9_code = "7761" | mimicsql_data |
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAc... | SELECT Posts.Id AS "post_link", Posts.Title, Posts.AnswerCount, Posts.CommunityOwnedDate FROM Posts WHERE Posts.OwnerUserId = @UserId AND Posts.CommunityOwnedDate > 0 ORDER BY Posts.CommunityOwnedDate DESC | sede |
CREATE TABLE Accounts (
account_id INTEGER,
customer_id INTEGER,
account_name VARCHAR(50),
other_account_details VARCHAR(255)
)
CREATE TABLE Financial_Transactions (
transaction_id INTEGER,
previous_transaction_id INTEGER,
account_id INTEGER,
card_id INTEGER,
transaction_type VARCHA... | SELECT customer_last_name, COUNT(customer_last_name) FROM Customers GROUP BY customer_last_name ORDER BY customer_last_name DESC | nvbench |
CREATE TABLE table_3284 (
"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.
-- How many starters are there at right tackle?
| SELECT COUNT("Starter") FROM table_3284 WHERE "Position" = 'Right tackle' | wikisql |
CREATE TABLE table_29258 (
"Overall rank" real,
"Country" text,
"Overall life expectancy" real,
"Male life expectancy" real,
"Male rank" real,
"Female life expectancy" real,
"Female rank" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name t... | SELECT MAX("Female life expectancy") FROM table_29258 WHERE "Country" = 'Djibouti' | wikisql |
CREATE TABLE PersonFriend (
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Find the person who has exactly one friend.
| SELECT name FROM PersonFriend GROUP BY name HAVING COUNT(*) = 1 | sql_create_context |
CREATE TABLE table_name_54 (
icao VARCHAR,
city VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the ICAO for the airport in Ningbo?
| SELECT icao FROM table_name_54 WHERE city = "ningbo" | sql_create_context |
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
-- Using valid SQLite, answer the following questions for the... | SELECT Founder, SUM(Revenue) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder ORDER BY Founder | nvbench |
CREATE TABLE table_14899 (
"Season" text,
"Tier" text,
"League" text,
"Pos." text,
"Postseason" text,
"Cup competitions" text,
"European competitions" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the position for european competitions... | SELECT "Pos." FROM table_14899 WHERE "European competitions" = 'eurocup regular season' | wikisql |
CREATE TABLE table_name_50 (
pba_team VARCHAR,
college VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the pba team for the player who went to santo tomas college?
| SELECT pba_team FROM table_name_50 WHERE college = "santo tomas" | sql_create_context |
CREATE TABLE table_9532 (
"Date" text,
"Tournament" text,
"Winning score" text,
"Margin of victory" text,
"Runner(s)-up" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What tournament had a 1 point margin of victory?
| SELECT "Tournament" FROM table_9532 WHERE "Margin of victory" = '1 point' | wikisql |
CREATE TABLE table_203_8 (
id number,
"player" text,
"rec." number,
"yards" number,
"avg." number,
"td's" number,
"long" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many touchdowns did anthony hines and boo williams have altogether ... | SELECT SUM("td's") FROM table_203_8 WHERE "player" IN ('anthony hines', 'boo williams') | squall |
CREATE TABLE table_name_2 (
year VARCHAR,
round VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which year has a Round of 17?
| SELECT year FROM table_name_2 WHERE round = "17" | sql_create_context |
CREATE TABLE table_20278716_2 (
mccain__percentage VARCHAR,
others__percentage VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What percentage of voters chose McCain in the county where 2.1% of voters voted third party?
| SELECT mccain__percentage FROM table_20278716_2 WHERE others__percentage = "2.1%" | sql_create_context |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
... | SELECT medication.drugstarttime FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '005-87465')) AND medication.drugname = 'ondansetron' AND DATET... | eicu |
CREATE TABLE table_name_72 (
opponent VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the opponent of player phil graham?
| SELECT opponent FROM table_name_72 WHERE player = "phil graham" | sql_create_context |
CREATE TABLE table_17941032_3 (
try_bonus VARCHAR,
lost VARCHAR,
losing_bonus VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the try bonus for lost being 11 and losing bonus is 6
| SELECT try_bonus FROM table_17941032_3 WHERE lost = "11" AND losing_bonus = "6" | sql_create_context |
CREATE TABLE table_name_20 (
race VARCHAR,
length VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the race 12 hours in length?
| SELECT race FROM table_name_20 WHERE length = "12 hours" | sql_create_context |
CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Per... | SELECT ACC_Road, COUNT(ACC_Road) FROM basketball_match GROUP BY ACC_Road | nvbench |
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 SUM(t_kc22.AMOUNT) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_NM = '魏初雪' AND t_kc21.CLINIC_TYPE = '门诊' AND t_kc22.STA_DATE BETWEEN '2004-09-03' AND '2009-03-08' AND t_kc22.MED_INV_ITEM_TYPE = '手术费' | css |
CREATE TABLE table_50258 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text,
"Money ( $ )" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which money has a Country of united states, and a Place of t6?
| SELECT AVG("Money ( $ )") FROM table_50258 WHERE "Country" = 'united states' AND "Place" = 't6' | wikisql |
CREATE TABLE table_9841 (
"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.
-- What was the maximum attendance when Chicago is the visiting team?
| SELECT MAX("Attendance") FROM table_9841 WHERE "Visitor" = 'chicago' | wikisql |
CREATE TABLE professor (
emp_num number,
dept_code text,
prof_office text,
prof_extension text,
prof_high_degree text
)
CREATE TABLE department (
dept_code text,
dept_name text,
school_code text,
emp_num number,
dept_address text,
dept_extension text
)
CREATE TABLE enroll (... | SELECT school_code FROM department WHERE dept_name = "Accounting" | spider |
CREATE TABLE table_13973 (
"Team" text,
"Tries for" real,
"Tries against" real,
"Try diff" text,
"Points for" real,
"Points against" real,
"Points diff" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average tries for less than 1... | SELECT AVG("Tries for") FROM table_13973 WHERE "Points for" < '117' AND "Tries against" < '48' | 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 demographic (... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Government" AND procedures.long_title = "Colonoscopy" | mimicsql_data |
CREATE TABLE table_48490 (
"Date" text,
"Opponent#" text,
"Site" text,
"Result" text,
"Attendance" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the result of 10/18/1947?
| SELECT "Result" FROM table_48490 WHERE "Date" = '10/18/1947' | wikisql |
CREATE TABLE fgwyjzb (
CLINIC_ID text,
CLINIC_TYPE text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
... | SELECT SUM(t_kc24.OVE_PAY) FROM gwyjzb JOIN t_kc24 ON gwyjzb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE gwyjzb.PERSON_NM = '褚永昌' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2004-09-13' AND '2019-10-02' UNION SELECT SUM(t_kc24.OVE_PAY) FROM fgwyjzb JOIN t_kc24 ON fgwyjzb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE fgwyjzb.PERSON... | css |
CREATE TABLE Employees (
Employee_ID INTEGER,
Role_Code CHAR(15),
Employee_Name VARCHAR(255),
Gender_MFU CHAR(1),
Date_of_Birth DATETIME,
Other_Details VARCHAR(255)
)
CREATE TABLE All_Documents (
Document_ID INTEGER,
Date_Stored DATETIME,
Document_Type_Code CHAR(15),
Document_Na... | SELECT Location_Code, COUNT(*) FROM Document_Locations GROUP BY Location_Code ORDER BY Location_Code DESC | 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 demographic.expire_flag, procedures.short_title FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.subject_id = "26285" | mimicsql_data |
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 mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN mzjzjlb_jybgb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGD... | css |
CREATE TABLE table_17634290_7 (
ends VARCHAR,
moving_from VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the end when moving from is listed as cary clarets?
| SELECT ends FROM table_17634290_7 WHERE moving_from = "Cary Clarets" | sql_create_context |
CREATE TABLE table_204_676 (
id number,
"year" number,
"division" number,
"league" text,
"regular season" text,
"playoffs" text,
"open cup" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- the richmond kickers future made the national semifina... | SELECT "year" FROM table_204_676 WHERE "playoffs" = 'national semifinals' | squall |
CREATE TABLE Residents_Services (
resident_id INTEGER,
service_id INTEGER,
date_moved_in DATETIME,
property_id INTEGER,
date_requested DATETIME,
date_provided DATETIME,
other_details VARCHAR(255)
)
CREATE TABLE Organizations (
organization_id INTEGER,
parent_organization_id INTEGER,... | SELECT Type_of_Thing_Code, COUNT(Type_of_Thing_Code) FROM Timed_Status_of_Things AS T1 JOIN Things AS T2 ON T1.thing_id = T2.thing_id WHERE T1.Status_of_Thing_Code = 'Close' OR T1.Date_and_Date < '2017-06-19 02:59:21' GROUP BY Type_of_Thing_Code ORDER BY Type_of_Thing_Code DESC | nvbench |
CREATE TABLE table_name_74 (
home_team VARCHAR,
venue VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When the venue was punt road oval, what was the Home teams score?
| SELECT home_team AS score FROM table_name_74 WHERE venue = "punt road oval" | sql_create_context |
CREATE TABLE reservations (
code number,
room text,
checkin text,
checkout text,
rate number,
lastname text,
firstname text,
adults number,
kids number
)
CREATE TABLE rooms (
roomid text,
roomname text,
beds number,
bedtype text,
maxoccupancy number,
basepric... | SELECT COUNT(*) FROM reservations AS T1 JOIN rooms AS T2 ON T1.room = T2.roomid WHERE T2.maxoccupancy = T1.adults + T1.kids | spider |
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CR... | SELECT Reputation, DisplayName, Location FROM Users WHERE LOWER(Location) LIKE '%poland%' ORDER BY Reputation DESC | sede |
CREATE TABLE zyjzjlb (
YLJGDM text,
JZLSH text,
MZJZLSH text,
KH text,
KLX number,
HZXM text,
WDBZ number,
RYDJSJ time,
RYTJDM number,
RYTJMC text,
JZKSDM text,
JZKSMC text,
RZBQDM text,
RZBQMC text,
RYCWH text,
CYKSDM text,
CYKSMC text,
CYBQDM tex... | SELECT CYKSDM, CYKSMC FROM zyjzjlb WHERE JZLSH = '51106126836' | css |
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, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DALLAS' AND flight.departure_time > 1600 AND flight.to_airport = AIRPORT_SERVICE_1.airpor... | atis |
CREATE TABLE table_58218 (
"Date" text,
"Competition" text,
"Venue" text,
"Result" text,
"Score" text,
"Goals" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which competition has a Goal of deacon 8/8 and a Score of 32-14?
| SELECT "Competition" FROM table_58218 WHERE "Goals" = 'deacon 8/8' AND "Score" = '32-14' | wikisql |
CREATE TABLE table_14482 (
"Player" text,
"Country" text,
"Year(s) won" text,
"Total" real,
"To par" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average Total for the United States with a To par more than 6 and 1996 was won?
| SELECT AVG("Total") FROM table_14482 WHERE "Country" = 'united states' AND "To par" > '6' AND "Year(s) won" = '1996' | wikisql |
CREATE TABLE table_61391 (
"Season" text,
"Premier" real,
"First" real,
"Second" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest Total, when Season is '1996-97', and when Second is less than 33?
| SELECT MAX("Total") FROM table_61391 WHERE "Season" = '1996-97' AND "Second" < '33' | wikisql |
CREATE TABLE payments (
payment_id number,
booking_id number,
customer_id number,
payment_type_code text,
amount_paid_in_full_yn text,
payment_date time,
amount_due number,
amount_paid number
)
CREATE TABLE bookings (
booking_id number,
customer_id number,
booking_status_cod... | SELECT payment_date FROM payments WHERE amount_paid > 300 OR payment_type_code = 'Check' | spider |
CREATE TABLE table_204_902 (
id number,
"rank" number,
"name" text,
"nationality" text,
"time" text,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who finished next after kaitlin sandeno ?
| SELECT "name" FROM table_204_902 WHERE "rank" = (SELECT "rank" FROM table_204_902 WHERE "name" = 'kaitlin sandeno') + 1 | squall |
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
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,
sp... | SELECT d_items.label FROM d_items WHERE d_items.itemid IN (SELECT t1.itemid FROM (SELECT inputevents_cv.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM inputevents_cv WHERE STRFTIME('%y', inputevents_cv.charttime) = '2102' GROUP BY inputevents_cv.itemid) AS t1 WHERE t1.c1 <= 4) | mimic_iii |
CREATE TABLE table_75085 (
"Round" real,
"Pick" real,
"Player" text,
"Nationality" text,
"School/Club Team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the nationality of the player from Drexel who had a pick larger than 183?
| SELECT "Nationality" FROM table_75085 WHERE "Pick" > '183' AND "School/Club Team" = 'drexel' | wikisql |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetake... | SELECT (SELECT SUM(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-122567')) AND intakeoutput.cellpath ... | eicu |
CREATE TABLE table_19722664_5 (
assists VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many assists did Delisha Milton-Jones make?
| SELECT assists FROM table_19722664_5 WHERE player = "DeLisha Milton-Jones" | sql_create_context |
CREATE TABLE table_27922491_20 (
wickets INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the fewest number of wickets recorded?
| SELECT MIN(wickets) FROM table_27922491_20 | sql_create_context |
CREATE TABLE table_56608 (
"Congress" text,
"Bill number" text,
"Date introduced" text,
"Sponsor" text,
"# of cosponsors" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the sponsor on April 22, 2004?
| SELECT "Sponsor" FROM table_56608 WHERE "Date introduced" = 'april 22, 2004' | wikisql |
CREATE TABLE schedule (
Cinema_ID int,
Film_ID int,
Date text,
Show_times_per_day int,
Price float
)
CREATE TABLE cinema (
Cinema_ID int,
Name text,
Openning_year int,
Capacity int,
Location text
)
CREATE TABLE film (
Film_ID int,
Rank_in_series int,
Number_in_seaso... | SELECT Openning_year, SUM(Capacity) FROM cinema ORDER BY Openning_year | nvbench |
CREATE TABLE table_54080 (
"D 39 \u221a" text,
"D 40 \u221a" text,
"D 41 \u221a" text,
"D 42 \u221a" text,
"D 43 \u221a" text,
"D 44 \u221a" text,
"D 45 \u221a" text,
"D 46 \u221a" text,
"D 47 \u221a" text,
"D 48 \u221a" text
)
-- Using valid SQLite, answer the following questi... | SELECT "D 42 \u221a" FROM table_54080 WHERE "D 46 \u221a" = 'majority→' | 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 t_kc22.t_kc21_MED_SER_ORG_NO FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_NM = '喻奇文' AND t_kc22.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.SOC_SRT_DIRE_NM = '氯雷他定片') | css |
CREATE TABLE table_63022 (
"Artist" text,
"Song" text,
"Lyrics (l) / Music (m)" text,
"Votes" text,
"Place" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Artist of the Song with a Place of withdrawn?
| SELECT "Artist" FROM table_63022 WHERE "Place" = 'withdrawn' | wikisql |
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE course_offering (
offering_id int,
course_id int,
... | SELECT DISTINCT name, number FROM course WHERE credits = 8 AND department = 'EECS' | advising |
CREATE TABLE table_name_63 (
body_width_mm INTEGER,
lead_pitch_mm VARCHAR,
part_number VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Body Width/mm has a Lead Pitch/mm smaller than 0.55, and a Part Number of tsop48?
| SELECT MIN(body_width_mm) FROM table_name_63 WHERE lead_pitch_mm < 0.55 AND part_number = "tsop48" | sql_create_context |
CREATE TABLE paperkeyphrase (
paperid int,
keyphraseid int
)
CREATE TABLE cite (
citingpaperid int,
citedpaperid int
)
CREATE TABLE paper (
paperid int,
title varchar,
venueid int,
year int,
numciting int,
numcitedby int,
journalid int
)
CREATE TABLE writes (
paperid i... | SELECT DISTINCT writes.paperid FROM author, writes WHERE author.authorname = 'mayank goel' AND writes.authorid = author.authorid | scholar |
CREATE TABLE table_62113 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is To Par, when Country is 'Australia'?
| SELECT "To par" FROM table_62113 WHERE "Country" = 'australia' | wikisql |
CREATE TABLE professor (
emp_num number,
dept_code text,
prof_office text,
prof_extension text,
prof_high_degree text
)
CREATE TABLE employee (
emp_num number,
emp_lname text,
emp_fname text,
emp_initial text,
emp_jobcode text,
emp_hiredate time,
emp_dob time
)
CREATE T... | SELECT COUNT(DISTINCT dept_name) FROM department | spider |
CREATE TABLE Customers (
first_name VARCHAR,
last_name VARCHAR,
amount_outstanding INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- List the first name and last name of customers have the amount of outstanding between 1000 and 3000.
| SELECT first_name, last_name FROM Customers WHERE amount_outstanding BETWEEN 1000 AND 3000 | sql_create_context |
CREATE TABLE WINE (
Name VARCHAR,
score INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- List the names of all distinct wines that have scores higher than 90.
| SELECT Name FROM WINE WHERE score > 90 | sql_create_context |
CREATE TABLE airport (
airport_code varchar,
airport_name text,
airport_location text,
state_code varchar,
country_name varchar,
time_zone_code varchar,
minimum_connect_time int
)
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description... | SELECT DISTINCT flight_id FROM flight WHERE (((flight_days IN (SELECT DAYSalias0.days_code FROM days AS DAYSalias0 WHERE DAYSalias0.day_name IN (SELECT DATE_DAYalias0.day_name FROM date_day AS DATE_DAYalias0 WHERE DATE_DAYalias0.day_number = 22 AND DATE_DAYalias0.month_number = 3 AND DATE_DAYalias0.year = 1991)) AND to... | atis |
CREATE TABLE table_26368963_2 (
under_11 VARCHAR,
under_17 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is every value for Under-11 when value of under-17 is Salma Nassar?
| SELECT under_11 FROM table_26368963_2 WHERE under_17 = "Salma Nassar" | sql_create_context |
CREATE TABLE table_203_729 (
id number,
"township" text,
"fips" number,
"population\ncenter" text,
"population" number,
"population\ndensity\n/km2 (/sq mi)" text,
"land area\nkm2 (sq mi)" text,
"water area\nkm2 (sq mi)" text,
"water %" text,
"geographic coordinates" text
)
-- U... | SELECT "water %" FROM table_203_729 WHERE "township" = 'mulberry' | 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 diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
... | SELECT labevents.charttime FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 2238) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'fibrinogen, functional') AND DATETIME(labevents.charttime, 'start of year') = DA... | mimic_iii |
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(*) FROM (SELECT MED_ORG_DEPT_CD FROM t_kc21 WHERE MED_SER_ORG_NO = '4547254' GROUP BY MED_ORG_DEPT_CD HAVING MIN(IN_HOSP_DAYS) > 27) AS T | css |
CREATE TABLE table_name_75 (
fa_cup_goals VARCHAR,
euro_competitions VARCHAR,
league_goals VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is FA Cup Goals, when Euro Competitions is 1, and when League Goals is 11?
| SELECT fa_cup_goals FROM table_name_75 WHERE euro_competitions = "1" AND league_goals = "11" | sql_create_context |
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE treatment (
treat... | SELECT (SELECT vitalperiodic.systemicmean FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-167444') AND NOT patient.unitdischargetime... | eicu |
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_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc22 WHERE t_kc22.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_NM = '方雅珺' AND t_kc22.t_kc21_MED_SER_ORG_NO = '4446242' AND t_kc22.t_kc21_IN_HOSP_DATE BETWEEN '2003-04-08' AND '2011-10-21') | css |
CREATE TABLE table_name_80 (
conference VARCHAR,
city VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which conference is in Portland, Oregon?
| SELECT conference FROM table_name_80 WHERE city = "portland, oregon" | sql_create_context |
CREATE TABLE table_72161 (
"Character" text,
"Fate" text,
"Actor" text,
"First Episode" text,
"Final Episode" text,
"Duration" text,
"Final Episode Count" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what's the character with fate being de... | SELECT "Character" FROM table_72161 WHERE "Fate" = 'Deceased: Knife Wound' | wikisql |
CREATE TABLE table_42189 (
"Week" real,
"Home Team" text,
"Away Team" text,
"Overall Record" text,
"Divisional Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Can you tell me the Week that has the Home Team of detroit, and the Divisional Reco... | SELECT "Week" FROM table_42189 WHERE "Home Team" = 'detroit' AND "Divisional Record" = '(3-0)' AND "Overall Record" = '(5-1)' AND "Away Team" = 'minnesota' | wikisql |
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE Posts (
Id number,
PostTypeId nu... | SELECT LAST_DATE_OF_MONTH(CreationDate), COUNT(Id) AS Posts, SUM(CASE WHEN PostTypeId = 1 THEN 1 ELSE 0 END) AS Questions, SUM(CASE WHEN PostTypeId = 2 THEN 1 ELSE 0 END) AS Answers FROM Posts WHERE Score >= '##min?50##' GROUP BY LAST_DATE_OF_MONTH(CreationDate) ORDER BY LAST_DATE_OF_MONTH(CreationDate) | sede |
CREATE TABLE table_79339 (
"Draw" real,
"Singer" text,
"Song" text,
"Televoting (votes)" text,
"Jury" text,
"Place" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What song was 2nd (25,517) in televoting (votes)?
| SELECT "Song" FROM table_79339 WHERE "Televoting (votes)" = '2nd (25,517)' | wikisql |
CREATE TABLE Students (
student_id INTEGER,
date_of_registration DATETIME,
date_of_latest_logon DATETIME,
login_name VARCHAR(40),
password VARCHAR(10),
personal_name VARCHAR(40),
middle_name VARCHAR(40),
family_name VARCHAR(40)
)
CREATE TABLE Subjects (
subject_id INTEGER,
subje... | SELECT T2.personal_name, T1.student_id FROM Student_Course_Enrolment AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id | nvbench |
CREATE TABLE table_name_60 (
country VARCHAR,
finish VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- From what Country is T2 Finish Player Gary Player?
| SELECT country FROM table_name_60 WHERE finish = "t2" AND player = "gary player" | sql_create_context |
CREATE TABLE table_name_25 (
left_office VARCHAR,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- On what date did ke eaumoku p pa iahiahi leave office?
| SELECT left_office FROM table_name_25 WHERE name = "ke ʻ eaumoku pāpa ʻ iahiahi" | sql_create_context |
CREATE TABLE table_66448 (
"Year" real,
"Game" text,
"Genre" text,
"Platform(s)" text,
"Developer(s)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the developer of XCom: Enemy Unknown?
| SELECT "Developer(s)" FROM table_66448 WHERE "Game" = 'xcom: enemy unknown' | wikisql |
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
Creation... | SELECT * FROM dbo.Users WHERE CreationDate BETWEEN '2016/01/01' AND '2016/12/31' | sede |
CREATE TABLE table_27252 (
"Rank" real,
"WS Points" real,
"Name" text,
"Country" text,
"09-10 I/O best" real,
"09-10 GP/JGP best" real,
"09-10 GP/JGP 2nd" real,
"09-10 OI best" real,
"09-10 OI 2nd" real,
"08-09 I/O best" real,
"08-09 GP/JGP best" real,
"08-09 GP/JGP 2nd" ... | SELECT MAX("09-10 I/O best") FROM table_27252 | wikisql |
CREATE TABLE table_61715 (
"Pos." real,
"Club" text,
"Points" real,
"Played" real,
"Wins" real,
"Draw" real,
"Lost" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the average Played for a draw of 5 and more than 43 points?
| SELECT AVG("Played") FROM table_61715 WHERE "Draw" = '5' AND "Points" > '43' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.