instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_name_99 (
visiting_team VARCHAR,
stadium VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the visiting team at the matchup at the RCA Dome?
| SELECT visiting_team FROM table_name_99 WHERE stadium = "rca dome" | sql_create_context |
CREATE TABLE table_name_95 (
points VARCHAR,
driver VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total number of points of driver enrique bernoldi (r)?
| SELECT COUNT(points) FROM table_name_95 WHERE driver = "enrique bernoldi (r)" | sql_create_context |
CREATE TABLE table_name_33 (
winner VARCHAR,
course VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who won the Granada course?
| SELECT winner FROM table_name_33 WHERE course = "granada" | sql_create_context |
CREATE TABLE movie (
mid number,
title text,
year number,
director text
)
CREATE TABLE reviewer (
rid number,
name text
)
CREATE TABLE rating (
rid number,
mid number,
stars number,
ratingdate time
)
-- Using valid SQLite, answer the following questions for the tables provide... | SELECT T2.title, T1.rid, T1.stars, MIN(T1.stars) FROM rating AS T1 JOIN movie AS T2 ON T1.mid = T2.mid GROUP BY T1.rid | spider |
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 patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CR... | SELECT admissions.marital_status FROM admissions WHERE admissions.subject_id = 28343 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1 | mimic_iii |
CREATE TABLE table_16217 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Game site" text,
"Record" text,
"Attendance" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many people attended the game against the indianapolis colt... | SELECT COUNT("Attendance") FROM table_16217 WHERE "Opponent" = 'Indianapolis Colts' | wikisql |
CREATE TABLE table_name_77 (
bowl_game VARCHAR,
conference_matchups VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which bowl game had a conference matchup of Ohio State vs. Texas?
| SELECT bowl_game FROM table_name_77 WHERE conference_matchups = "ohio state vs. texas" | sql_create_context |
CREATE TABLE table_52505 (
"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.
-- At the home game in Collingwood, how much did th... | SELECT "Away team score" FROM table_52505 WHERE "Home team" = 'collingwood' | wikisql |
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 demographic.admission_type, diagnoses.icd9_code FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.subject_id = "28588" | mimicsql_data |
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,
... | SELECT * FROM Posts WHERE Tags = 'Python' AND CreationDate > '2020-01-01' | sede |
CREATE TABLE table_76146 (
"Pick #" real,
"NFL Team" text,
"Player" text,
"Position" text,
"College" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Position has a Pick # lower than 278 for Player Charles Benson?
| SELECT "Position" FROM table_76146 WHERE "Pick #" < '278' AND "Player" = 'charles benson' | wikisql |
CREATE TABLE table_45591 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- On what Date is the Detroit Falcons the Home team in a game with a Score of 63 66?
| SELECT "Date" FROM table_45591 WHERE "Home" = 'detroit falcons' AND "Score" = '63–66' | wikisql |
CREATE TABLE table_49802 (
"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.
-- When the score was 71-71-70-70=282 what was the To par recorded?
| SELECT "To par" FROM table_49802 WHERE "Score" = '71-71-70-70=282' | wikisql |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellv... | SELECT t3.culturesite FROM (SELECT t2.culturesite, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'bacteremia - gram negative rod' AND STRFTIME... | eicu |
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 t_kc21 WHERE MED_SER_ORG_NO = '9587006' AND IN_HOSP_DATE BETWEEN '2006-02-19' AND '2013-12-18' AND CLINIC_TYPE = '购药' | css |
CREATE TABLE table_66984 (
"Ship" text,
"Pennant number" text,
"Laid down" text,
"Launched" text,
"Completed" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the launched for 13 september 1934 completion
| SELECT "Launched" FROM table_66984 WHERE "Completed" = '13 september 1934' | wikisql |
CREATE TABLE table_name_33 (
tournament VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the info for the year 2010, for the Australian Open tournament?
| SELECT 2010 FROM table_name_33 WHERE tournament = "australian open" | 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 lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "ELECTIVE" AND demographic.diagnosis = "STEMI" | mimicsql_data |
CREATE TABLE course (
course_id int,
name varchar,
department varchar,
number varchar,
credits varchar,
advisory_requirement varchar,
enforced_requirement varchar,
description varchar,
num_semesters int,
num_enrolled int,
has_discussion varchar,
has_lab varchar,
has_p... | SELECT DISTINCT name, number FROM course WHERE department = 'EECS' AND has_lab = 'N' AND number < 400 + 100 AND number >= 400 | advising |
CREATE TABLE table_name_29 (
country VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which country scored 70-68-71-71=280?
| SELECT country FROM table_name_29 WHERE score = 70 - 68 - 71 - 71 = 280 | sql_create_context |
CREATE TABLE table_66405 (
"Opposing Team" text,
"Against" real,
"Date" text,
"Venue" text,
"Status" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Opposing Team has an Against smaller than 19, and a Date of 20/05/1979?
| SELECT "Opposing Team" FROM table_66405 WHERE "Against" < '19' AND "Date" = '20/05/1979' | wikisql |
CREATE TABLE table_name_99 (
position VARCHAR,
pick VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Position of the Pick 8 Player?
| SELECT position FROM table_name_99 WHERE pick = 8 | sql_create_context |
CREATE TABLE table_203_594 (
id number,
"canal" text,
"length (miles)" number,
"locks" number,
"max length (ft)" number,
"width (ft)" number,
"year opened" number,
"year abandoned" number,
"year restored" number
)
-- Using valid SQLite, answer the following questions for the tables... | SELECT COUNT("canal") FROM table_203_594 | squall |
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 = '76340683' AND MED_SER_ORG_NO = '3169811' AND OUT_DIAG_DIS_NM LIKE '%妊娠%' | css |
CREATE TABLE jybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH text,
BGJGDM text,
BGJGMC text,
BGRGH text,
BGRQ time,
BGRXM text,
BGSJ time,
CJRQ time,
JSBBRQSJ time,
JSBBSJ time,
JYBBH text,
JYJGMC text,
JYJSGH text,
JYJSQM text,
JY... | SELECT wdmzjzjlb.JLSJ FROM wdmzjzjlb WHERE wdmzjzjlb.JZLSH = '96264599846' UNION SELECT bdmzjzjlb.JLSJ FROM bdmzjzjlb WHERE bdmzjzjlb.JZLSH = '96264599846' | css |
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationD... | SELECT OwnerUserId AS "user_link", Id AS "post_link", Score, ViewCount FROM Posts WHERE Body LIKE '%http://%.jpg%' OR Body LIKE '%http://%.png%' ORDER BY ViewCount DESC | sede |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses (
... | SELECT demographic.dob, lab."CATEGORY" FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.name = "Jerry Deberry" | mimicsql_data |
CREATE TABLE table_dev_51 (
"id" int,
"gender" string,
"antihypertensive_agents" bool,
"systolic_blood_pressure_sbp" int,
"hemoglobin_a1c_hba1c" float,
"obesity" bool,
"diastolic_blood_pressure_dbp" int,
"body_mass_index_bmi" float,
"hypertension" bool,
"prehypertension" bool,
... | SELECT * FROM table_dev_51 WHERE (prehypertension = 1 OR hypertension = 1) AND ((systolic_blood_pressure_sbp > 120 OR diastolic_blood_pressure_dbp > 80) AND (systolic_blood_pressure_sbp < 145 OR diastolic_blood_pressure_dbp < 90)) AND antihypertensive_agents = 1 | criteria2sql |
CREATE TABLE table_12243817_1 (
tournament_location VARCHAR,
champion VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the tournament location when Vicky Hurst in the champion?
| SELECT tournament_location FROM table_12243817_1 WHERE champion = "Vicky Hurst" | sql_create_context |
CREATE TABLE table_name_69 (
notes VARCHAR,
position VARCHAR,
event VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the notes of the 400 m event before 2004 with a position of 12th (h)?
| SELECT notes FROM table_name_69 WHERE event = "400 m" AND year < 2004 AND position = "12th (h)" | sql_create_context |
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 text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
... | SELECT prescriptions.route FROM prescriptions WHERE prescriptions.drug = "Oxycodone SR (OxyconTIN)" | mimicsql_data |
CREATE TABLE table_28794440_1 (
location VARCHAR,
frequency VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Where are all the 1485khz frequency located?
| SELECT location FROM table_28794440_1 WHERE frequency = "1485kHz" | sql_create_context |
CREATE TABLE table_57956 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many laps for martin brundle with a grid of less than 10?
| SELECT COUNT("Laps") FROM table_57956 WHERE "Driver" = 'martin brundle' AND "Grid" < '10' | wikisql |
CREATE TABLE Organisation_Types (
organisation_type VARCHAR(10),
organisation_type_description VARCHAR(255)
)
CREATE TABLE Organisations (
organisation_id INTEGER,
organisation_type VARCHAR(10),
organisation_details VARCHAR(255)
)
CREATE TABLE Documents (
document_id INTEGER,
document_type... | SELECT T2.organisation_details, T1.organisation_id FROM Grants AS T1 JOIN Organisations AS T2 ON T1.organisation_id = T2.organisation_id GROUP BY T2.organisation_details ORDER BY T2.organisation_details | 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 demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob te... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.days_stay > "5" AND lab.label = "Iron" | mimicsql_data |
CREATE TABLE table_34755 (
"Rank" real,
"Centre" text,
"Country" text,
"Rating" real,
"Change" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Rank is the highest one that has a Change smaller than 44, and a Centre of buenos aires, and a Rating... | SELECT MAX("Rank") FROM table_34755 WHERE "Change" < '44' AND "Centre" = 'buenos aires' AND "Rating" > '628' | wikisql |
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_leg (
flight_id int,
leg_number int,
leg_flight int
)
CREATE TABLE flight_far... | SELECT DISTINCT ground_service.transport_type FROM airport, airport_service, city AS CITY_0, city AS CITY_1, ground_service WHERE airport.airport_code = airport_service.airport_code AND CITY_0.city_code = airport_service.city_code AND CITY_0.city_name = 'DENVER' AND CITY_1.city_name = 'DENVER' AND ground_service.airpor... | atis |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
CREATE TABLE mzjybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH number,
BGJGDM text,
BGJGMC text,
BGRGH text,
BGRQ time,
BGRXM text,
BGSJ time,
CJRQ time,
JSBBRQSJ time,
... | SELECT zyjybgb.JYSQJGMC, zyjybgb.JYJGMC FROM zyjybgb WHERE zyjybgb.BGDH = '01566167620' UNION SELECT mzjybgb.JYSQJGMC, mzjybgb.JYJGMC FROM mzjybgb WHERE mzjybgb.BGDH = '01566167620' | css |
CREATE TABLE table_38974 (
"Preseason" text,
"Week 1 Aug 26" text,
"Week 2 Sept 2" text,
"Week 3 Sept 8" text,
"Week 4 Sept 15" text,
"Week 5 Sept 22" text,
"Week 6 Sept 29" text,
"Week 7 Oct 6" text,
"Week 8 Oct 13" text,
"Week 9 Oct 20" text,
"Week 10 Oct 27" text,
"Wee... | SELECT "Week 1 Aug 26" FROM table_38974 WHERE "Week 7 Oct 6" = 'usc (3-2)' | wikisql |
CREATE TABLE table_13746866_2 (
number_of_deputies VARCHAR,
number_of_votes_received VARCHAR,
election_date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what's the number of deputies with number of votes received being smaller than 1549176.2765483726 a... | SELECT number_of_deputies FROM table_13746866_2 WHERE number_of_votes_received < 1549176.2765483726 AND election_date = 1969 | sql_create_context |
CREATE TABLE table_68172 (
"Year" real,
"Fighter" text,
"Nation represented" text,
"Sport" text,
"Sanctioning body or league" text,
"Weight class represented or contested" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which sport did the United... | SELECT "Sport" FROM table_68172 WHERE "Nation represented" = 'united states' | wikisql |
CREATE TABLE table_name_65 (
word_wrap_support VARCHAR,
format VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Word wrap support has a Format of mobipocket?
| SELECT word_wrap_support FROM table_name_65 WHERE format = "mobipocket" | sql_create_context |
CREATE TABLE program (
program_id number,
name text,
origin text,
launch number,
owner text
)
CREATE TABLE broadcast (
channel_id number,
program_id number,
time_of_day text
)
CREATE TABLE broadcast_share (
channel_id number,
program_id number,
date text,
share_in_perce... | SELECT name, origin, owner FROM program | spider |
CREATE TABLE table_25474825_1 (
license VARCHAR,
description VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the license that is described as a tool for designing and executing workflows?
| SELECT license FROM table_25474825_1 WHERE description = "Tool for designing and executing workflows" | sql_create_context |
CREATE TABLE table_15728 (
"Year" real,
"Venue" text,
"Position" text,
"Event" text,
"Notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Is there a Position for Notes 53.96?
| SELECT "Position" FROM table_15728 WHERE "Notes" = '53.96' | wikisql |
CREATE TABLE elimination (
elimination_id text,
wrestler_id text,
team text,
eliminated_by text,
elimination_move text,
time text
)
CREATE TABLE wrestler (
wrestler_id number,
name text,
reign text,
days_held text,
location text,
event text
)
-- Using valid SQLite, ans... | SELECT COUNT(DISTINCT team) FROM elimination | spider |
CREATE TABLE table_3437 (
"Series #" real,
"Season #" real,
"Title" text,
"Director" text,
"Writer(s)" text,
"Airdate" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- name the most series number for season 22
| SELECT MAX("Series #") FROM table_3437 WHERE "Season #" = '22' | wikisql |
CREATE TABLE table_14503 (
"Status" text,
"Name" text,
"First Performance" text,
"Last Performance" text,
"Style" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Style of the First Performance of Billy Elliot on 15 November 2007?
| SELECT "Style" FROM table_14503 WHERE "First Performance" = '15 november 2007' | wikisql |
CREATE TABLE election (
election_id number,
counties_represented text,
district number,
delegate text,
party number,
first_elected number,
committee text
)
CREATE TABLE county (
county_id number,
county_name text,
population number,
zip_code text
)
CREATE TABLE party (
... | SELECT DISTINCT year FROM party WHERE governor = "Eliot Spitzer" | spider |
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate ... | SELECT * FROM Users WHERE Id <= 100 AND Id > 0 AND DisplayName LIKE 'Tim%' OR DisplayName LIKE 'Dav%' | sede |
CREATE TABLE t_kc21 (
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 t_kc22.MED_DIRE_CD, t_kc22.MED_DIRE_NM FROM t_kc22 JOIN t_kc21_t_kc22 JOIN t_kc21 ON t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID AND t_kc21_t_kc22.MED_CLINIC_ID = t_kc21.MED_CLINIC_ID WHERE t_kc21.MED_CLINIC_ID = '32855231921' AND t_kc22.SOC_SRT_DIRE_NM = '血塞通软胶囊' | css |
CREATE TABLE table_22226 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" text,
"U.S. viewers (millions)" text
)
-- Using valid SQLite, answer the following questions for the tables provided a... | SELECT COUNT("No. in season") FROM table_22226 WHERE "U.S. viewers (millions)" = '2.65' | wikisql |
CREATE TABLE table_name_51 (
date VARCHAR,
oil_pattern VARCHAR,
event VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the Date which has a Oil Pattern of chameleon, and a Event of lake county indiana classic?
| SELECT date FROM table_name_51 WHERE oil_pattern = "chameleon" AND event = "lake county indiana classic" | sql_create_context |
CREATE TABLE player (
player_id text,
birth_year text,
birth_month text,
birth_day text,
birth_country text,
birth_state text,
birth_city text,
death_year text,
death_month text,
death_day text,
death_country text,
death_state text,
death_city text,
name_first tex... | SELECT player_id FROM player_award_vote WHERE year = "1971" ORDER BY points_won DESC LIMIT 1 | thehistoryofbaseball |
CREATE TABLE table_75372 (
"Game" real,
"March" real,
"Opponent" text,
"Score" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the score when they had a 25-41-9 record?
| SELECT "Score" FROM table_75372 WHERE "Record" = '25-41-9' | wikisql |
CREATE TABLE table_name_5 (
laps INTEGER,
time_retired VARCHAR,
grid VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total number of laps where time/retired is +2 laps and the grid number is bigger than 18?
| SELECT SUM(laps) FROM table_name_5 WHERE time_retired = "+2 laps" AND grid > 18 | sql_create_context |
CREATE TABLE table_train_162 (
"id" int,
"gender" string,
"pregnancy_or_lactation" bool,
"serum_potassium" float,
"systolic_blood_pressure_sbp" int,
"hemoglobin_a1c_hba1c" float,
"diastolic_blood_pressure_dbp" int,
"NOUSE" float
)
-- Using valid SQLite, answer the following questions f... | SELECT * FROM table_train_162 WHERE hemoglobin_a1c_hba1c > 12 | criteria2sql |
CREATE TABLE table_train_112 (
"id" int,
"systolic_blood_pressure_sbp" int,
"modified_geriatric_depression_scale_gds" int,
"diastolic_blood_pressure_dbp" int,
"rosen_modified_hachinski_ischemic_score" int,
"body_mass_index_bmi" float,
"hypertension" bool,
"NOUSE" float
)
-- Using valid... | SELECT * FROM table_train_112 WHERE body_mass_index_bmi >= 20 AND body_mass_index_bmi <= 35 | criteria2sql |
CREATE TABLE table_name_68 (
cross_code_debut VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Bev Risman's Cross Code Debut?
| SELECT cross_code_debut FROM table_name_68 WHERE player = "bev risman" | sql_create_context |
CREATE TABLE table_name_34 (
season VARCHAR,
goals VARCHAR,
apps VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Season has Goals greater than 0 and less than 33 Apps?
| SELECT season FROM table_name_34 WHERE goals > 0 AND apps < 33 | sql_create_context |
CREATE TABLE table_name_97 (
capacity VARCHAR,
city_area VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the capacity for the arena in Chester?
| SELECT capacity FROM table_name_97 WHERE city_area = "chester" | sql_create_context |
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 event (
ID int,
Name text,
Stadium_ID int,
Year text
)
CREATE TABLE swimme... | SELECT name, meter_100 FROM swimmer ORDER BY name | nvbench |
CREATE TABLE table_name_95 (
australian VARCHAR,
examples VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Australian, when Examples is 'am ba, anemone, ascesis'?
| SELECT australian FROM table_name_95 WHERE examples = "amœba, anemone, ascesis" | sql_create_context |
CREATE TABLE table_2329 (
"School" text,
"Location(s)" text,
"Control" text,
"Type" text,
"Enrollment (fall 2010)" real,
"Founded" real,
"Accreditation" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many schools founded in 2006?
| SELECT COUNT("Accreditation") FROM table_2329 WHERE "Founded" = '2006' | wikisql |
CREATE TABLE table_256286_20 (
no_votes INTEGER,
_percentage_yes VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- HOw many no votes were there when there were 45.60% yes votes
| SELECT MIN(no_votes) FROM table_256286_20 WHERE _percentage_yes = "45.60%" | sql_create_context |
CREATE TABLE table_name_67 (
year VARCHAR,
drivers VARCHAR,
flaps VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many years have Drivers of ben hanley, and Flaps smaller than 0?
| SELECT COUNT(year) FROM table_name_67 WHERE drivers = "ben hanley" AND flaps < 0 | 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 AVG(t_kc21.MED_AMOUT) FROM t_kc21 WHERE t_kc21.MED_ORG_DEPT_NM = '体检科' AND t_kc21.IN_HOSP_DATE BETWEEN '2011-06-26' AND '2012-02-08' AND t_kc21.IN_DIAG_DIS_NM = '腔隙性脑梗死' AND t_kc21.CLINIC_TYPE = '住院' | css |
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 DATEADD(m, DATEDIFF(m, 0, CreationDate), 0) AS Month, COUNT(*) AS AcceptedAnswers FROM Tags LEFT JOIN PostTags ON PostTags.TagId = Tags.Id LEFT JOIN Posts ON Posts.Id = PostTags.PostId LEFT JOIN PostTypes ON PostTypes.Id = Posts.PostTypeId WHERE Tags.TagName = 'meteor' AND PostTypeId = 1 AND CommunityOwnedDate I... | sede |
CREATE TABLE table_42746 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what was the date of the game on week 2?
| SELECT "Date" FROM table_42746 WHERE "Week" = '2' | wikisql |
CREATE TABLE body_builder (
Total VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- List the total scores of body builders in ascending order.
| SELECT Total FROM body_builder ORDER BY Total | sql_create_context |
CREATE TABLE table_name_8 (
rounds VARCHAR,
driver VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- None of the rounds has Roger Williamson as a driver.
| SELECT rounds FROM table_name_8 WHERE driver = "roger williamson" | sql_create_context |
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE SuggestedEdits (
... | SELECT (CAST(COUNT(DISTINCT q.Id) AS FLOAT) / (SELECT COUNT(*) FROM Posts WHERE Posts.CreationDate < @until AND PostTypeId = 1) * 100) AS AcceptedPercentage FROM Posts AS q INNER JOIN Posts AS a ON q.Id = a.ParentId WHERE a.PostTypeId = 2 AND q.CreationDate < @until AND q.PostTypeId = 1 | sede |
CREATE TABLE table_204_910 (
id number,
"rank" number,
"name" text,
"nationality" text,
"result" number,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the difference between huang qiuyan 's result and fumiyo yoshida 's result ?
| SELECT ABS((SELECT "result" FROM table_204_910 WHERE "name" = 'huang qiuyan') - (SELECT "result" FROM table_204_910 WHERE "name" = 'fumiyo yoshida')) | squall |
CREATE TABLE table_name_80 (
gold VARCHAR,
nation VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many total gold medals did Australia receive?
| SELECT COUNT(gold) FROM table_name_80 WHERE nation = "australia" | sql_create_context |
CREATE TABLE table_9214 (
"Model Number" text,
"sSpec Number" text,
"Frequency" text,
"L2 Cache" text,
"Mult" text,
"Voltage" text,
"Socket" text,
"Release Date" text,
"Part Number(s)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- W... | SELECT "Socket" FROM table_9214 WHERE "Part Number(s)" = 'rk80530pz001256' | wikisql |
CREATE TABLE table_name_71 (
home_team VARCHAR,
date VARCHAR,
tie_no VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the home team on 8 January 1946 with a tie no of 4?
| SELECT home_team FROM table_name_71 WHERE date = "8 january 1946" AND tie_no = "4" | sql_create_context |
CREATE TABLE table_17941111_2 (
volume VARCHAR,
co_2 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the volume for co 2 for 168 g/km
| SELECT volume FROM table_17941111_2 WHERE co_2 = "168 g/km" | sql_create_context |
CREATE TABLE flight (
vehicle_flight_number VARCHAR,
date VARCHAR,
pilot VARCHAR,
altitude VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- List the vehicle flight number, date and pilot of all the flights, ordered by altitude.
| SELECT vehicle_flight_number, date, pilot FROM flight ORDER BY altitude | sql_create_context |
CREATE TABLE products (
code number,
name text,
price number,
manufacturer number
)
CREATE TABLE manufacturers (
code number,
name text,
headquarter text,
founder text,
revenue number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Select... | SELECT name FROM products WHERE price <= 200 | spider |
CREATE TABLE table_64309 (
"Club" text,
"Wins" real,
"Losses" real,
"Draws" real,
"Against" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Mortlake club has more than 924 against, less than 14 losses, and how many total draws?
| SELECT COUNT("Draws") FROM table_64309 WHERE "Against" > '924' AND "Club" = 'mortlake' AND "Losses" < '14' | wikisql |
CREATE TABLE table_5327 (
"Bullet weight gram (grain)" text,
"8.23 g (127 gr)" real,
"9.72 g (150 gr)" real,
"11.34 g (175 gr)" real,
"12.96 g (200 gr)" real,
"14.26 g (220 gr)" real,
"Case capacity (%)" real
)
-- Using valid SQLite, answer the following questions for the tables provided a... | SELECT AVG("Case capacity (%)") FROM table_5327 WHERE "9.72 g (150 gr)" > '112.3' | wikisql |
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId number,
PostId number,
SuggestedEditId number,
CompletedByReviewTaskId number
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId... | SELECT CAST((SELECT COUNT(*) FROM Posts WHERE PostTypeId = 2 AND CreationDate > @months_ago) AS FLOAT) / (SELECT COUNT(*) FROM Posts WHERE PostTypeId = 1 AND CreationDate > @months_ago) AS "answer_ratio" | sede |
CREATE TABLE table_name_40 (
record VARCHAR,
opponent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the record in the game where the opponent wasd the atlanta falcons?
| SELECT record FROM table_name_40 WHERE opponent = "atlanta falcons" | sql_create_context |
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_... | SELECT HIRE_DATE, COMMISSION_PCT FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) | nvbench |
CREATE TABLE table_29050051_3 (
_number INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest listed number for a player?
| SELECT MIN(_number) FROM table_29050051_3 | sql_create_context |
CREATE TABLE table_74977 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What date did the Indians have a record of 14-28?
| SELECT "Date" FROM table_74977 WHERE "Record" = '14-28' | wikisql |
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 time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE days (
d... | 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 WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'LAS VEGAS' AND date_day.day_number = 2 AND date_day.month_number = 3 AND... | atis |
CREATE TABLE table_203_835 (
id number,
"season" text,
"club" text,
"country" text,
"competition" text,
"apps." number,
"goals" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many had at least 10 goals ?
| SELECT COUNT(*) FROM table_203_835 WHERE "goals" >= 10 | squall |
CREATE TABLE table_51031 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Ground" text,
"Crowd" real,
"Date" text,
"Time" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the Home team Carlton... | SELECT "Ground" FROM table_51031 WHERE "Home team" = 'carlton' | wikisql |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.age < "68" AND procedures.short_title = "Arterial catheterization" | mimicsql_data |
CREATE TABLE Staff (
staff_id INTEGER,
staff_address_id INTEGER,
nickname VARCHAR(80),
first_name VARCHAR(80),
middle_name VARCHAR(80),
last_name VARCHAR(80),
date_of_birth DATETIME,
date_joined_staff DATETIME,
date_left_staff DATETIME
)
CREATE TABLE Lessons (
lesson_id INTEGER,... | SELECT payment_method_code, COUNT(*) FROM Customer_Payments GROUP BY payment_method_code ORDER BY payment_method_code | nvbench |
CREATE TABLE table_3460 (
"Year" real,
"Starts" real,
"Wins" real,
"Top 5" real,
"Top 10" real,
"Poles" real,
"Avg. Start" text,
"Avg. Finish" text,
"Winnings" text,
"Position" text,
"Team(s)" text
)
-- Using valid SQLite, answer the following questions for the tables provi... | SELECT COUNT("Winnings") FROM table_3460 WHERE "Avg. Start" = '19.0' | wikisql |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic ... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.marital_status = "MARRIED" AND lab.charttime = "2111-12-31 14:29:00" | mimicsql_data |
CREATE TABLE table_166346_1 (
region VARCHAR,
production___bbl__day_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which regions had a production (bbl/day) of 1,213,000 (21st)?
| SELECT region FROM table_166346_1 WHERE production___bbl__day_ = "1,213,000 (21st)" | sql_create_context |
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 Name, Code FROM Products WHERE Price BETWEEN 60 AND 120 | nvbench |
CREATE TABLE invoices (
id number,
customer_id number,
invoice_date time,
billing_address text,
billing_city text,
billing_state text,
billing_country text,
billing_postal_code text,
total number
)
CREATE TABLE customers (
id number,
first_name text,
last_name text,
... | SELECT title, phone, hire_date FROM employees WHERE first_name = "Nancy" AND last_name = "Edwards" | spider |
CREATE TABLE table_name_16 (
gold INTEGER,
silver VARCHAR,
bronze VARCHAR,
rank VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the fewest gold medals when there is 0 bronze medals, and the rank is 19, and silver medals are less than 1?
| SELECT MIN(gold) FROM table_name_16 WHERE bronze = 0 AND rank = "19" AND silver < 1 | sql_create_context |
CREATE TABLE table_32511 (
"Year" real,
"Game" text,
"Team" text,
"Runner-up" text,
"Score" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What team defeated the Capital City Giants?
| SELECT "Team" FROM table_32511 WHERE "Runner-up" = 'capital city giants' | wikisql |
CREATE TABLE table_15581 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Event" text,
"Round" real,
"Time" text,
"Location" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What event ended in 3:02 of round 1?
| SELECT "Event" FROM table_15581 WHERE "Round" = '1' AND "Time" = '3:02' | wikisql |
CREATE TABLE table_name_61 (
ngc_number INTEGER,
object_type VARCHAR,
right_ascension___j2000__ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which NGC number has an Object type of open cluster, and a Right ascension (J2000) of 06h01m06s?
| SELECT MAX(ngc_number) FROM table_name_61 WHERE object_type = "open cluster" AND right_ascension___j2000__ = "06h01m06s" | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.