instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_name_73 (
mult VARCHAR,
release_date VARCHAR,
model_number VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the mult value of the microprocessor with a release date q4 2007 and model number pentium dual-core t2310?
| SELECT mult FROM table_name_73 WHERE release_date = "q4 2007" AND model_number = "pentium dual-core t2310" | sql_create_context |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code tex... | SELECT t1.diagnosisname FROM (SELECT diagnosis.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnosis WHERE DATETIME(diagnosis.diagnosistime) >= DATETIME(CURRENT_TIME(), '-3 year') GROUP BY diagnosis.diagnosisname) AS t1 WHERE t1.c1 <= 3 | eicu |
CREATE TABLE table_47611 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"TV Time" text,
"Record" text,
"Attendance" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Result, when Opponent is New England Patriots?
| SELECT "Result" FROM table_47611 WHERE "Opponent" = 'new england patriots' | wikisql |
CREATE TABLE table_dev_30 (
"id" int,
"gender" string,
"leukopenia" int,
"cd4_count" int,
"stroke" bool,
"platelets" int,
"hematocrit_hct" float,
"fasting_triglycerides" int,
"coronary_stenosis" int,
"hyperlipidemia" bool,
"lymphopenia" int,
"fasting_ldl_cholesterol" int,... | SELECT * FROM table_dev_30 WHERE stroke = 1 OR peripheral_arterial_disease = 1 OR coronary_artery_disease_cad = 1 OR coronary_stenosis >= 50 OR myocardial_infarction = 1 | criteria2sql |
CREATE TABLE table_41060 (
"Date" text,
"Title" text,
"Director" text,
"Production Cost" text,
"Singapore Gross" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What film did Pen-Ek Ratanaruang direct?
| SELECT "Title" FROM table_41060 WHERE "Director" = 'pen-ek ratanaruang' | wikisql |
CREATE TABLE table_63310 (
"School" text,
"Location" text,
"Mascot" text,
"Enrollment" real,
"IHSAA Class" text,
"# / County" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the enrollment at the school of Hamilton community?
| SELECT AVG("Enrollment") FROM table_63310 WHERE "School" = 'hamilton community' | wikisql |
CREATE TABLE table_71212 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" real,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the date of the game that had a loss of Politte (0-2)?
| SELECT "Date" FROM table_71212 WHERE "Loss" = 'politte (0-2)' | wikisql |
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescription text,
CreationDate time,
CreationModeratorId number,
ApprovalDa... | SELECT Id AS "post_link", Score, Text, CreationDate, CAST(CAST(CAST(Score AS FLOAT) * 20 AS INT) AS TEXT(5)) + '%' AS PunditProgress FROM Comments WHERE UserId = '##UserID:int##' ORDER BY Score DESC LIMIT 10 | sede |
CREATE TABLE table_name_31 (
draws INTEGER,
points VARCHAR,
wins VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average number of draws of the team with less than 17 points and less than 4 wins?
| SELECT AVG(draws) FROM table_name_31 WHERE points < 17 AND wins < 4 | sql_create_context |
CREATE TABLE table_name_77 (
super_g VARCHAR,
overall VARCHAR,
combined VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the Super G when the combined was 13 and the overall was more than 7?
| SELECT super_g FROM table_name_77 WHERE overall > 7 AND combined = "13" | sql_create_context |
CREATE TABLE table_64848 (
"Date" text,
"Course" text,
"Distance" text,
"Type" text,
"Winner" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the winner at Rest Day course?
| SELECT "Winner" FROM table_64848 WHERE "Course" = 'rest day' | wikisql |
CREATE TABLE table_50822 (
"Model number" text,
"sSpec number" text,
"Frequency" text,
"L2 cache" text,
"Mult." text,
"Voltage" text,
"Socket" text,
"Release date" text,
"Part number(s)" text,
"Release price ( USD )" text
)
-- Using valid SQLite, answer the following questions ... | SELECT "Mult." FROM table_50822 WHERE "Release price ( USD )" = 'n/a' AND "sSpec number" = 'slgpr(c0)' | wikisql |
CREATE TABLE table_name_34 (
rounds VARCHAR,
chassis VARCHAR,
driver VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many rounds did germ n s nchez drive in where the chassis was dallara f308?
| SELECT rounds FROM table_name_34 WHERE chassis = "dallara f308" AND driver = "germán sánchez" | sql_create_context |
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)
CREATE TABLE equipment_sequence (
aircraft_code_sequence varchar,
aircraft_code varchar
)
CREATE TABLE flight_stop (
flight_id int,
stop_number int,
... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'HOUSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'ORLAND... | atis |
CREATE TABLE table_name_19 (
record VARCHAR,
november VARCHAR,
game VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Record, when November is less than 10, and when Game is less than 13?
| SELECT record FROM table_name_19 WHERE november < 10 AND game < 13 | sql_create_context |
CREATE TABLE table_48423 (
"Season" text,
"Skip" text,
"Third" text,
"Second" text,
"Lead" text,
"Alternate" text,
"Events" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the lead with an alternate of li dongyan?
| SELECT "Lead" FROM table_48423 WHERE "Alternate" = 'li dongyan' | wikisql |
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)... | SELECT prescriptions.startdate FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 75658) AND prescriptions.route = 'dialys' ORDER BY prescriptions.startdate DESC LIMIT 1 | mimic_iii |
CREATE TABLE takes (
ID varchar(5),
course_id varchar(8),
sec_id varchar(8),
semester varchar(6),
year numeric(4,0),
grade varchar(2)
)
CREATE TABLE department (
dept_name varchar(20),
building varchar(15),
budget numeric(12,2)
)
CREATE TABLE prereq (
course_id varchar(8),
... | SELECT semester, COUNT(semester) FROM course AS T1 JOIN section AS T2 ON T1.course_id = T2.course_id WHERE T1.dept_name = 'Psychology' GROUP BY semester | nvbench |
CREATE TABLE table_55468 (
"Season" text,
"Club" text,
"Competition" text,
"Apps" real,
"Goals" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the most goals for total club and apps less than 120
| SELECT MAX("Goals") FROM table_55468 WHERE "Club" = 'total' AND "Apps" < '120' | wikisql |
CREATE TABLE table_28208 (
"Celebrity" text,
"Known for" text,
"Age" real,
"Professional" text,
"Series" real,
"Place" text,
"Dances" real,
"Highest score" real,
"Lowest score" real,
"Aggregate" real,
"Average" text
)
-- Using valid SQLite, answer the following questions fo... | SELECT MAX("Aggregate") FROM table_28208 WHERE "Celebrity" = 'Ricky Groves' | wikisql |
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE o... | SELECT chartevents.charttime 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 = 15447) AND icustays.outtime IS NULL) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WH... | mimic_iii |
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
CREATE TABLE compartment_class (
compartment varchar,
class_type varchar
)
CREATE TABLE class_of_service (
booking_class varchar,
rank int,
class_description text
)
CREATE TABLE fare (
fare_id int,
from_... | SELECT DISTINCT flight.flight_id FROM airport_service, city, flight WHERE city.city_code = airport_service.city_code AND city.city_name = 'PHILADELPHIA' AND flight.departure_time BETWEEN 1800 AND 2200 AND flight.to_airport = airport_service.airport_code | atis |
CREATE TABLE mzb (
CLINIC_ID text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
INSU_TYPE text,
IN... | SELECT COUNT(qtb.PERSON_ID) FROM qtb WHERE qtb.MED_SER_ORG_NO = '9055373' AND qtb.REMOTE_SETTLE_FLG = '异地1' OR qtb.REMOTE_SETTLE_FLG = '异地2' UNION SELECT COUNT(gyb.PERSON_ID) FROM gyb WHERE gyb.MED_SER_ORG_NO = '9055373' AND gyb.REMOTE_SETTLE_FLG = '异地1' OR gyb.REMOTE_SETTLE_FLG = '异地2' UNION SELECT COUNT(zyb.PERSON_ID... | css |
CREATE TABLE table_name_24 (
country VARCHAR,
abbreviation VARCHAR,
assets_us$billion VARCHAR,
inception VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which country has assets of x, an inception of 2007, and an abbreviation of adic?
| SELECT country FROM table_name_24 WHERE assets_us$billion = "x" AND inception = "2007" AND abbreviation = "adic" | sql_create_context |
CREATE TABLE table_dev_16 (
"id" int,
"white_blood_cell_count_wbc" int,
"autoimmune_disease" bool,
"creatinine_clearance_cl" float,
"platelet_count" float,
"collagen_vascular_disease" bool,
"hypertension" bool,
"systemic_corticosteroids" bool,
"NOUSE" float
)
-- Using valid SQLite,... | SELECT * FROM table_dev_16 WHERE hypertension = 1 | criteria2sql |
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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.gender = "M" AND procedures.long_title = "Other electric countershock of heart" | mimicsql_data |
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 MIN(demographic.age) FROM demographic WHERE demographic.gender = "M" AND demographic.age >= "50" | mimicsql_data |
CREATE TABLE Dorm_amenity (
amenid INTEGER,
amenity_name VARCHAR(25)
)
CREATE TABLE Has_amenity (
dormid INTEGER,
amenid INTEGER
)
CREATE TABLE Dorm (
dormid INTEGER,
dorm_name VARCHAR(20),
student_capacity INTEGER,
gender VARCHAR(1)
)
CREATE TABLE Lives_in (
stuid INTEGER,
do... | SELECT Fname, COUNT(Fname) FROM Student WHERE Age < (SELECT AVG(Age) FROM Student) GROUP BY Fname ORDER BY Fname | nvbench |
CREATE TABLE zyjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
HZXM text,
JZKSDM text,
JZKSMC text,
JZLSH text,
KH text,
KLX number,
MZBMLX number,
MZJZLSH text,
MZZDBM text,
MZZDMC text,
MZZYZDZZBM... | SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN person_info_hz_info JOIN person_info 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 AND jybgb.Y... | css |
CREATE TABLE table_26632 (
"Name" text,
"Deceased Spouse" text,
"Cause of Death" text,
"Date of Spouses Death" text,
"Length of Marriage" text,
"Children Together" text,
"Current Marital Status" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
--... | SELECT "Children Together" FROM table_26632 WHERE "Length of Marriage" = '9 years' | wikisql |
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
AboutMe text,
Views number,
UpVotes number,
DownVotes number,
ProfileImageUrl text,
EmailHash text,
AccountId number
)
CRE... | SELECT COUNT(*) FROM PostTags | sede |
CREATE TABLE On_Call (
Nurse INTEGER,
BlockFloor INTEGER,
BlockCode INTEGER,
OnCallStart DATETIME,
OnCallEnd DATETIME
)
CREATE TABLE Appointment (
AppointmentID INTEGER,
Patient INTEGER,
PrepNurse INTEGER,
Physician INTEGER,
Start DATETIME,
End DATETIME,
ExaminationRoom ... | SELECT T1.Name, COUNT(*) FROM Physician AS T1 JOIN Patient AS T2 ON T1.EmployeeID = T2.PCP GROUP BY T1.EmployeeID ORDER BY T1.Name DESC | nvbench |
CREATE TABLE table_name_7 (
no_2 VARCHAR,
no_6 VARCHAR,
no_3 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What name is in the number 2 spot when Ethan is in the number 6 spot and Mason is in the number 3 spot?
| SELECT no_2 FROM table_name_7 WHERE no_6 = "ethan" AND no_3 = "mason" | sql_create_context |
CREATE TABLE table_5855 (
"Designation" text,
"Car numbers" text,
"Manufacturer" text,
"Model No." text,
"First used" text,
"Quantity" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Car numbers have a First used of currently on order?
| SELECT "Car numbers" FROM table_5855 WHERE "First used" = 'currently on order' | wikisql |
CREATE TABLE qualifying (
qualifyId INTEGER,
raceId INTEGER,
driverId INTEGER,
constructorId INTEGER,
number INTEGER,
position INTEGER,
q1 TEXT,
q2 TEXT,
q3 TEXT
)
CREATE TABLE status (
statusId INTEGER,
status TEXT
)
CREATE TABLE constructors (
constructorId INTEGER,
... | SELECT location, circuitId FROM circuits WHERE country = "France" OR country = "Belgium" ORDER BY location DESC | nvbench |
CREATE TABLE table_23005 (
"House name" text,
"House mascot" text,
"House colour" text,
"Year opened" real,
"House leader" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many house mascots are associated with yellow house colours?
| SELECT COUNT("House mascot") FROM table_23005 WHERE "House colour" = 'Yellow' | wikisql |
CREATE TABLE table_1977630_2 (
yo VARCHAR,
vosotros___vosotras VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are all the conjugated forms of the verb moler where the vosotros / vosotras is mol is for the yo tense?
| SELECT yo FROM table_1977630_2 WHERE vosotros___vosotras = "moláis" | sql_create_context |
CREATE TABLE table_203_70 (
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 france 's and egypt 's silver medal... | SELECT (SELECT "silver" FROM table_203_70 WHERE "nation" = 'france') - (SELECT "silver" FROM table_203_70 WHERE "nation" = 'egypt') | squall |
CREATE TABLE table_16275 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"U.S. viewers (millions)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many viewers t... | SELECT "U.S. viewers (millions)" FROM table_16275 WHERE "Directed by" = 'Matt Earl Beesley' | wikisql |
CREATE TABLE table_name_46 (
province VARCHAR,
city VARCHAR,
date_of_official_foundation_of_municipality VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Province, when 2006 is less than 153748, when Date of Official Foundation of Municipality is a... | SELECT province FROM table_name_46 WHERE 2006 < 153748 AND date_of_official_foundation_of_municipality > 1958 AND city = "pakdasht" | sql_create_context |
CREATE TABLE table_62729 (
"Week" real,
"Partner" text,
"Dance" text,
"Song" text,
"Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What week was she safe for a salsa dance?
| SELECT SUM("Week") FROM table_62729 WHERE "Result" = 'safe' AND "Dance" = 'salsa' | wikisql |
CREATE TABLE table_15601 (
"Margin" real,
"Score" text,
"Opponent" text,
"Venue" text,
"Round" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the score of the game that had a round of Rd 26, 2001?
| SELECT "Score" FROM table_15601 WHERE "Round" = 'rd 26, 2001' | wikisql |
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
CreationDate time,
UserId number,
UserDisplayName text,
... | SELECT COUNT(A.Id) AS numberofanswers, A.OwnerUserId AS "user_link" FROM Posts AS A WHERE PostTypeId = 2 AND (Score > 0 OR (SELECT COUNT(B.Id) FROM Posts AS B WHERE B.AcceptedAnswerId = A.Id) > 0 OR (SELECT COUNT(C.Id) FROM Posts AS C WHERE C.ParentId = A.ParentId AND C.Score > 0) = 0) GROUP BY A.OwnerUserId ORDER BY n... | sede |
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.JCFF 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.YLJGDM AND jybgb.BGDH... | css |
CREATE TABLE table_50562 (
"Tournament" text,
"Surface" text,
"Week" text,
"Winner and score" text,
"Finalist" text,
"Semifinalists" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Winner and score has a Finalist of aaron krickstein?
| SELECT "Winner and score" FROM table_50562 WHERE "Finalist" = 'aaron krickstein' | wikisql |
CREATE TABLE hz_info_zyjzjlb (
JZLSH number,
YLJGDM number,
zyjzjlb_id number
)
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 tim... | SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb 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 AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jy... | css |
CREATE TABLE course_offering (
offering_id int,
course_id int,
semester int,
section_number int,
start_time time,
end_time time,
monday varchar,
tuesday varchar,
wednesday varchar,
thursday varchar,
friday varchar,
saturday varchar,
sunday varchar,
has_final_proje... | SELECT DISTINCT name, number FROM course WHERE credits = 3 AND department = 'EECS' | advising |
CREATE TABLE table_name_64 (
constituency VARCHAR,
rank VARCHAR,
result VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the constituency when the rank is less than 5 and the result is con hold?
| SELECT constituency FROM table_name_64 WHERE rank < 5 AND result = "con hold" | sql_create_context |
CREATE TABLE table_15160 (
"Year" text,
"League" text,
"Position" text,
"Leading Scorer" text,
"Goals" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Leading Scorer of Ian rush is what lowest # of goals?
| SELECT MIN("Goals") FROM table_15160 WHERE "Leading Scorer" = 'ian rush' | wikisql |
CREATE TABLE table_58257 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the home team score when the away team ... | SELECT "Home team score" FROM table_58257 WHERE "Away team score" = '13.17 (95)' | wikisql |
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures_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... | SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', transfers.intime)) FROM transfers WHERE transfers.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 18866 AND admissions.dischtime IS NULL) AND transfers.careunit = 'micu' ORDER BY transfers.intime LIMIT 1 | mimic_iii |
CREATE TABLE event (
ID int,
Name text,
Stadium_ID int,
Year text
)
CREATE TABLE record (
ID int,
Result text,
Swimmer_ID int,
Event_ID int
)
CREATE TABLE stadium (
ID int,
name text,
Capacity int,
City text,
Country text,
Opening_year int
)
CREATE TABLE swimme... | SELECT meter_500, meter_100 FROM swimmer ORDER BY meter_100 DESC | nvbench |
CREATE TABLE state (
state_code text,
state_name text,
country_name 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 date_day ... | SELECT DISTINCT flight.flight_id FROM airport_service, city, flight, flight_stop WHERE city.city_code = airport_service.city_code AND city.city_name = 'DENVER' AND flight_stop.stop_airport = airport_service.airport_code AND flight.airline_code = 'NW' AND flight.flight_id = flight_stop.flight_id | atis |
CREATE TABLE table_54640 (
"Rd #" real,
"Pick #" real,
"Player" text,
"Team (League)" text,
"Reg GP" real,
"Pl GP" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which team has a Reg GP over 62?
| SELECT "Team (League)" FROM table_54640 WHERE "Reg GP" > '62' | wikisql |
CREATE TABLE table_27818 (
"Position" real,
"Sail Number" text,
"Yacht" text,
"State/Country" text,
"Yacht Type" text,
"LOA (Metres)" text,
"Skipper" text,
"Elapsed Time d:hh:mm:ss" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is ... | SELECT "LOA (Metres)" FROM table_27818 WHERE "Yacht" = 'Brindabella' | wikisql |
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
... | WITH Raw AS (SELECT CreationDate, SUM(CASE WHEN VoteTypeId = 2 THEN 1 END) AS Ups, SUM(CASE WHEN VoteTypeId = 3 THEN 1 END) AS Downs FROM Votes WHERE PostId = '##PostId:int##' AND VoteTypeId BETWEEN 2 AND 3 GROUP BY CreationDate) SELECT CreationDate, SUM(Raw.Ups) OVER (ORDER BY CreationDate ROWS BETWEEN UNBOUNDED PRECE... | sede |
CREATE TABLE table_57559 (
"Stations" text,
"Place" text,
"Managed By" text,
"Platforms" real,
"Zone" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the total number of platforms that waddon railway station has
| SELECT COUNT("Platforms") FROM table_57559 WHERE "Stations" = 'waddon railway station' | wikisql |
CREATE TABLE t_kc24 (
MED_SAFE_PAY_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
REF_SLT_FLG number,
CLINIC_SLT_DATE time,
COMP_ID text,
PERSON_ID text,
FLX_MED_ORG_ID text,
INSU_TYPE text,
MED_AMOUT number,
PER_ACC_PAY number,
OVE_PAY numb... | SELECT CHA_ITEM_LEV FROM t_kc22 WHERE MED_CLINIC_ID = '69850313527' AND SOC_SRT_DIRE_NM = '瑞舒伐他汀钙片' | css |
CREATE TABLE table_58417 (
"Rider" text,
"Manufacturer" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest number of laps with a time of +6.643 and grid less than 2?
| SELECT MAX("Laps") FROM table_58417 WHERE "Time/Retired" = '+6.643' AND "Grid" < '2' | wikisql |
CREATE TABLE table_67397 (
"Region" text,
"Date" text,
"Label" text,
"Format" text,
"Catalog" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the region for february 14, 2002
| SELECT "Region" FROM table_67397 WHERE "Date" = 'february 14, 2002' | wikisql |
CREATE TABLE table_171236_2 (
area_km_2 VARCHAR,
census_ranking VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Area KM 2 of the place that has a Census ranking of 1,608 of 5,008?
| SELECT area_km_2 FROM table_171236_2 WHERE census_ranking = "1,608 of 5,008" | sql_create_context |
CREATE TABLE table_10983 (
"Grand Prix" text,
"Pole Position" text,
"Fastest Lap" text,
"Winning Driver" text,
"Constructor" text,
"Report" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the constructor for Brazilian Grand Prix?
| SELECT "Constructor" FROM table_10983 WHERE "Grand Prix" = 'brazilian grand prix' | wikisql |
CREATE TABLE table_18439 (
"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.
-- When party did the incumbent in the Arkansas 5 district belong to?
| SELECT "Party" FROM table_18439 WHERE "District" = 'Arkansas 5' | wikisql |
CREATE TABLE savings (
balance INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many accounts have a savings balance above the average savings balance?
| SELECT COUNT(*) FROM savings WHERE balance > (SELECT AVG(balance) FROM savings) | sql_create_context |
CREATE TABLE t_kc22 (
AMOUNT number,
CHA_ITEM_LEV number,
DATA_ID text,
DIRE_TYPE number,
DOSE_FORM text,
DOSE_UNIT text,
EACH_DOSAGE text,
EXP_OCC_DATE time,
FLX_MED_ORG_ID text,
FXBZ number,
HOSP_DOC_CD text,
HOSP_DOC_NM text,
MED_CLINIC_ID text,
MED_DIRE_CD tex... | SELECT COUNT(*) FROM gwyjzb WHERE gwyjzb.PERSON_ID = '94302117' AND gwyjzb.CLINIC_TYPE = '住院' AND MOD(gwyjzb.MED_AMOUT, 1) = 0 UNION SELECT COUNT(*) FROM fgwyjzb WHERE fgwyjzb.PERSON_ID = '94302117' AND fgwyjzb.CLINIC_TYPE = '住院' AND MOD(fgwyjzb.MED_AMOUT, 1) = 0 | css |
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE charte... | SELECT admissions.admission_type FROM admissions WHERE admissions.subject_id = 74624 AND DATETIME(admissions.admittime) >= DATETIME(CURRENT_TIME(), '-4 year') ORDER BY admissions.admittime LIMIT 1 | mimic_iii |
CREATE TABLE table_28178 (
"Episode" real,
"Reward" text,
"Leader Battle" text,
"Immunity" text,
"Individual Immunity" text,
"Eliminated" text,
"Vote" text,
"Finish" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the leader battle f... | SELECT "Leader Battle" FROM table_28178 WHERE "Eliminated" = 'Plamen' | wikisql |
CREATE TABLE table_50701 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- From what Country is T6 Place Player Tom Weiskopf?
| SELECT "Country" FROM table_50701 WHERE "Place" = 't6' AND "Player" = 'tom weiskopf' | wikisql |
CREATE TABLE zyb (
CLINIC_ID text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
INSU_TYPE text,
IN... | SELECT COUNT(*) FROM qtb JOIN t_kc22 ON qtb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE qtb.MED_SER_ORG_NO = '5124932' AND t_kc22.SOC_SRT_DIRE_CD = '4987-7' UNION SELECT COUNT(*) FROM gyb JOIN t_kc22 ON gyb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gyb.MED_SER_ORG_NO = '5124932' AND t_kc22.SOC_SRT_DIRE_CD = '4987-7' UN... | css |
CREATE TABLE table_48167 (
"Rank" text,
"Administrative Division" text,
"Area (km\u00b2)" real,
"Area (sq mi)" real,
"National Share (%)" real,
"Comparable Country" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average area in squar... | SELECT AVG("Area (sq mi)") FROM table_48167 WHERE "Area (km\u00b2)" = '9,630,960' AND "National Share (%)" > '100' | wikisql |
CREATE TABLE table_24039597_26 (
matches VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What ist he matches where the player is ms dhoni?
| SELECT matches FROM table_24039597_26 WHERE player = "MS Dhoni" | sql_create_context |
CREATE TABLE routes (
dst_apid VARCHAR,
src_apid VARCHAR,
apid VARCHAR,
country VARCHAR
)
CREATE TABLE airports (
dst_apid VARCHAR,
src_apid VARCHAR,
apid VARCHAR,
country VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Find the numbe... | SELECT COUNT(*) FROM routes WHERE dst_apid IN (SELECT apid FROM airports WHERE country = 'Canada') AND src_apid IN (SELECT apid FROM airports WHERE country = 'United States') | sql_create_context |
CREATE TABLE exhibition_record (
Exhibition_ID int,
Date text,
Attendance int
)
CREATE TABLE artist (
Artist_ID int,
Name text,
Country text,
Year_Join int,
Age int
)
CREATE TABLE exhibition (
Exhibition_ID int,
Year int,
Theme text,
Artist_ID int,
Ticket_Price real... | SELECT Country, COUNT(Country) FROM artist GROUP BY Country | nvbench |
CREATE TABLE table_2982 (
"Member State" text,
"Population in thousands" text,
"Population % of EU" text,
"Area km 2" real,
"Area % of EU" text,
"Pop. density People/km 2" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the area of Austri... | SELECT "Area km 2" FROM table_2982 WHERE "Member State" = 'Austria' | wikisql |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id 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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "2167" AND lab.itemid = "51478" | mimicsql_data |
CREATE TABLE table_44192 (
"Season" text,
"Competition" text,
"Round" text,
"Club" text,
"1st Leg" text,
"2nd Leg" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the 1st leg of the UEFA Champions League Compeition in the Skonto Riga Club... | SELECT "1st Leg" FROM table_44192 WHERE "Competition" = 'uefa champions league' AND "Club" = 'skonto riga' | wikisql |
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 diagnosis (
diagn... | SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'cardiac arrest' AND STRFTIME('%y', diagnosis.diagnosistime) = '2104') AS t1 JOIN (SELECT patient.uniquepid, ... | eicu |
CREATE TABLE table_test_3 (
"id" int,
"gender" string,
"pregnancy_or_lactation" bool,
"severe_hemodynamic_instability" bool,
"consent" bool,
"hemoglobin_a1c_hba1c" float,
"metallic_implants" bool,
"allergy_to_aspirin" bool,
"creatinine_clearance_cl" float,
"post_menopausal" bool,... | SELECT * FROM table_test_3 WHERE hypertension = 1 | criteria2sql |
CREATE TABLE table_18781 (
"Rnd" real,
"Race" text,
"Pole position" text,
"Fastest lap" text,
"Most laps led" text,
"Winning driver" text,
"Winning team" text,
"Report" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many have times o... | SELECT COUNT("Fastest lap") FROM table_18781 WHERE "Rnd" = '6' | wikisql |
CREATE TABLE t_kc24 (
MED_SAFE_PAY_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
REF_SLT_FLG number,
CLINIC_SLT_DATE time,
COMP_ID text,
PERSON_ID text,
FLX_MED_ORG_ID text,
INSU_TYPE text,
MED_AMOUT number,
PER_ACC_PAY number,
OVE_PAY numb... | SELECT COUNT(*) FROM t_kc21 WHERE MED_SER_ORG_NO = '2335631' AND IN_HOSP_DATE BETWEEN '2011-06-24' AND '2021-07-31' AND INSURED_STS = '未就业' AND MED_AMOUT >= 7979.89 | css |
CREATE TABLE table_27902171_7 (
date VARCHAR,
location_attendance VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What dated was the game played at the location delta center 19,911?
| SELECT date FROM table_27902171_7 WHERE location_attendance = "Delta Center 19,911" | sql_create_context |
CREATE TABLE table_name_65 (
record VARCHAR,
game INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the record when the game is greater than 24?
| SELECT record FROM table_name_65 WHERE game > 24 | sql_create_context |
CREATE TABLE table_2850 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who has... | SELECT "High points" FROM table_2850 WHERE "Game" = '69' | wikisql |
CREATE TABLE table_2701 (
"Constituency" text,
"Winner" text,
"Party" text,
"Margin" real,
"Runner-up a" text,
"Party a" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who won when V. A. Muthiah was the runner-up?
| SELECT "Winner" FROM table_2701 WHERE "Runner-up a" = 'V. A. Muthiah' | wikisql |
CREATE TABLE table_2049 (
"Province" text,
"Latin Americans 2001" real,
"% 2001" text,
"Latin Americans 2011" real,
"% 2011" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many Latin Americans were there in 2001 in the province with 0.0% 2001 an... | SELECT MAX("Latin Americans 2001") FROM table_2049 WHERE "% 2001" = '0.0%' AND "% 2011" = '0.2%' | wikisql |
CREATE TABLE table_37405 (
"Squad No" real,
"Player" text,
"Position" text,
"Tries" real,
"Goals" real,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the largest amount of goals when the points are less than 0?
| SELECT MAX("Goals") FROM table_37405 WHERE "Points" < '0' | wikisql |
CREATE TABLE table_63444 (
"Game" real,
"Date" text,
"Opponent" text,
"Score" text,
"Location" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest game that has July 31 as the date?
| SELECT MAX("Game") FROM table_63444 WHERE "Date" = 'july 31' | wikisql |
CREATE TABLE table_name_6 (
wrestler VARCHAR,
elimination VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who's the wrestler with an elimination of 1?
| SELECT wrestler FROM table_name_6 WHERE elimination = "1" | sql_create_context |
CREATE TABLE table_11558 (
"Year" real,
"Theme" text,
"Mintage" real,
"Issue Price" text,
"Finish" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many cowboy coins were minted?
| SELECT "Mintage" FROM table_11558 WHERE "Theme" = 'cowboy' | wikisql |
CREATE TABLE table_204_193 (
id number,
"year" number,
"artist" text,
"album" text,
"chart position" text,
"role" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what other album did eddie harris & les mccain had besides swiss movement
| SELECT "album" FROM table_204_193 WHERE "artist" = 'eddie harris & les mccann' AND "album" <> 'swiss movement' | squall |
CREATE TABLE table_23478 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- For th... | SELECT "High assists" FROM table_23478 WHERE "Team" = 'Iowa' | wikisql |
CREATE TABLE writes (
paperid int,
authorid int
)
CREATE TABLE journal (
journalid int,
journalname varchar
)
CREATE TABLE keyphrase (
keyphraseid int,
keyphrasename varchar
)
CREATE TABLE paper (
paperid int,
title varchar,
venueid int,
year int,
numciting int,
numcit... | SELECT DISTINCT writes.paperid FROM author, writes WHERE author.authorname = 'torlak' AND writes.authorid = author.authorid | scholar |
CREATE TABLE table_name_98 (
slalom VARCHAR,
super_g VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Slalom has a Super G of 4?
| SELECT slalom FROM table_name_98 WHERE super_g = "4" | sql_create_context |
CREATE TABLE table_25735_1 (
teams INTEGER,
winner VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the number of teams in the competition that wynnum manly seagulls won?
| SELECT MIN(teams) FROM table_25735_1 WHERE winner = "Wynnum Manly Seagulls" | sql_create_context |
CREATE TABLE table_204_699 (
id number,
"district" text,
"name" text,
"party" text,
"residence" text,
"first served" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what was the total number of members in all the districts ?
| SELECT COUNT(*) FROM table_204_699 | squall |
CREATE TABLE table_44651 (
"Outcome" text,
"Date" text,
"Tournament" text,
"Surface" text,
"Partner" text,
"Opponents in the final" text,
"Score" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Opponents In The Final, when Score is 4-... | SELECT "Opponents in the final" FROM table_44651 WHERE "Score" = '4-1 5-4 (7) 4-2' | wikisql |
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE T... | SELECT a2."age" AS "UsersCopyAge", a2.Location AS "UsersCopyLocation", COUNT(*) AS "count_posts" FROM "Posts " AS a1 LEFT OUTER JOIN Users AS a2 ON (a2.Id = a1."LastEditorUserId ") WHERE (a2.Location IN ('France', 'India')) GROUP BY a2."age", a2.Location ORDER BY 'UsersCopyAge' DESC, 'UsersCopyLocation' DESC | sede |
CREATE TABLE table_name_15 (
call_sign VARCHAR,
frequency_mhz VARCHAR,
erp_w VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which callsign has ERP W of 99 and a frequency of greater than 88.7MHz?
| SELECT call_sign FROM table_name_15 WHERE frequency_mhz > 88.7 AND erp_w = 99 | sql_create_context |
CREATE TABLE store_district (
store_id VARCHAR,
district_id VARCHAR
)
CREATE TABLE district (
District_name VARCHAR,
district_id VARCHAR
)
CREATE TABLE store (
store_id VARCHAR,
Type VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Find the n... | SELECT t3.District_name FROM store AS t1 JOIN store_district AS t2 ON t1.store_id = t2.store_id JOIN district AS t3 ON t2.district_id = t3.district_id WHERE t1.Type = "City Mall" INTERSECT SELECT t3.District_name FROM store AS t1 JOIN store_district AS t2 ON t1.store_id = t2.store_id JOIN district AS t3 ON t2.district_... | sql_create_context |
CREATE TABLE class_of_service (
booking_class varchar,
rank int,
class_description text
)
CREATE TABLE fare (
fare_id int,
from_airport varchar,
to_airport varchar,
fare_basis_code text,
fare_airline text,
restriction_code text,
one_direction_cost int,
round_trip_cost int,
... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'WASHINGTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BO... | atis |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.