instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_name_20 (
name VARCHAR,
games VARCHAR,
assists VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who played over 37 games and had 202 assists?
| SELECT name FROM table_name_20 WHERE games > 37 AND assists = 202 | sql_create_context |
CREATE TABLE table_59759 (
"Round" text,
"Club" text,
"Home" text,
"Away" text,
"Aggregate" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which club had round of group stage round 1 and 5?
| SELECT "Club" FROM table_59759 WHERE "Round" = 'group stage round 1 and 5' | wikisql |
CREATE TABLE table_44594 (
"Season" text,
"Series" text,
"Team Name" text,
"Races" real,
"Poles" real,
"Wins" real,
"Points" real,
"Final Placing" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Can you tell me the Series that has the Win... | SELECT "Series" FROM table_44594 WHERE "Wins" = '0' AND "Season" = '2002' | wikisql |
CREATE TABLE mzjzjlb (
YLJGDM text,
JZLSH text,
KH text,
KLX number,
MJZH text,
HZXM text,
NLS number,
NLY number,
ZSEBZ number,
JZZTDM number,
JZZTMC text,
JZJSSJ time,
TXBZ number,
ZZBZ number,
WDBZ number,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
... | SELECT BGRQ FROM jybgb WHERE BGDH = '76529320990' | css |
CREATE TABLE table_18454 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the most first elected for james c. davis?
| SELECT MAX("First elected") FROM table_18454 WHERE "Incumbent" = 'James C. Davis' | wikisql |
CREATE TABLE table_name_12 (
round INTEGER,
player VARCHAR,
pick__number VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which the highest Round has a Player of mike williams, and a Pick # larger than 4?
| SELECT MAX(round) FROM table_name_12 WHERE player = "mike williams" AND pick__number > 4 | sql_create_context |
CREATE TABLE table_5639 (
"Round" real,
"Player" text,
"Position" text,
"Nationality" text,
"College/Junior/Club Team (League)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What league has a 10 for round with Paul Cain?
| SELECT "College/Junior/Club Team (League)" FROM table_5639 WHERE "Round" = '10' AND "Player" = 'paul cain' | wikisql |
CREATE TABLE table_63105 (
"Rank" real,
"Lane" real,
"Name" text,
"Nationality" text,
"Time" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Time has a Lane smaller than 4, and a Rank larger than 6?
| SELECT AVG("Time") FROM table_63105 WHERE "Lane" < '4' AND "Rank" > '6' | wikisql |
CREATE TABLE t_kc22 (
MED_EXP_DET_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
MED_EXP_BILL_ID text,
SOC_SRT_DIRE_CD text,
SOC_SRT_DIRE_NM text,
DIRE_TYPE number,
CHA_ITEM_LEV number,
MED_INV_ITEM_TYPE text,
MED_DIRE_CD text,
MED_DIRE_NM text,... | SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_NM = '喻萍雅' AND t_kc22.STA_DATE BETWEEN '2000-10-01' AND '2010-09-21' AND t_kc22.MED_INV_ITEM_TYPE = '检查费' | css |
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 All_Neutral, School_ID FROM basketball_match | nvbench |
CREATE TABLE table_12628 (
"Result" text,
"Opponent" text,
"Method" text,
"Event" text,
"Notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the opponent when the method was points (4 x 0)?
| SELECT "Opponent" FROM table_12628 WHERE "Method" = 'points (4 x 0)' | wikisql |
CREATE TABLE table_name_13 (
location VARCHAR,
result VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the location of the match that had a result of 3-3?
| SELECT location FROM table_name_13 WHERE result = "3-3" | sql_create_context |
CREATE TABLE table_79580 (
"Rank" text,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the fewest number of silver medals won by Canada with fewer than 3 total medals?
| SELECT MIN("Silver") FROM table_79580 WHERE "Nation" = 'canada' AND "Total" < '3' | wikisql |
CREATE TABLE table_test_2 (
"id" int,
"loss_of_consciousness" bool,
"gender" string,
"bleeding" int,
"systolic_blood_pressure_sbp" int,
"stroke" bool,
"renal_disease" bool,
"hemorrhagic_diathesis" bool,
"transient_ischemic_attack" bool,
"creatinine_clearance_cl" float,
"demen... | SELECT * FROM table_test_2 WHERE loss_of_consciousness = 1 OR glasgow_come_score_gcs < 14 | 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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.insurance = "Medicaid" AND diagnoses.icd9_code = "3569" | mimicsql_data |
CREATE TABLE table_name_1 (
final_round VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In 1975, what was the final round?
| SELECT final_round FROM table_name_1 WHERE year = "1975" | sql_create_context |
CREATE TABLE table_19131 (
"Character Name" text,
"Voice Actor (Japanese)" text,
"Voice Actor (English 1997 / Saban)" text,
"Voice Actor (English 1998 / Pioneer)" text,
"Voice Actor (English 2006 / FUNimation)" text
)
-- Using valid SQLite, answer the following questions for the tables provided ab... | SELECT "Character Name" FROM table_19131 WHERE "Voice Actor (English 1997 / Saban)" = 'Ian James Corlett' | wikisql |
CREATE TABLE table_name_87 (
a_side VARCHAR,
catalog_number VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the A-side for catalog 902?
| SELECT a_side FROM table_name_87 WHERE catalog_number = "902" | sql_create_context |
CREATE TABLE t_kc22 (
MED_EXP_DET_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
MED_EXP_BILL_ID text,
SOC_SRT_DIRE_CD text,
SOC_SRT_DIRE_NM text,
DIRE_TYPE number,
CHA_ITEM_LEV number,
MED_INV_ITEM_TYPE text,
MED_DIRE_CD text,
MED_DIRE_NM text,... | SELECT AVG(MED_AMOUT) FROM t_kc21 WHERE MED_ORG_DEPT_CD = '706' AND IN_HOSP_DATE BETWEEN '2015-07-24' AND '2015-08-24' AND IN_DIAG_DIS_CD = 'H52.059' AND CLINIC_TYPE = '住院' | css |
CREATE TABLE table_name_20 (
venue VARCHAR,
winner VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the venue when Jerran Hart won?
| SELECT venue FROM table_name_20 WHERE winner = "jerran hart" | sql_create_context |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.long_title = "Acute parametritis and pelvic cellulitis" | mimicsql_data |
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 department, name, number FROM course WHERE (description LIKE '%Independent Studies%' OR name LIKE '%Independent Studies%') AND credits = 15 | advising |
CREATE TABLE table_22081847_1 (
money_list_rank VARCHAR,
earnings__$_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- If the earning amount is $309,886, what is the money list ranking?
| SELECT money_list_rank FROM table_22081847_1 WHERE earnings__$_ = "309,886" | sql_create_context |
CREATE TABLE Lots (
lot_id INTEGER,
investor_id INTEGER,
lot_details VARCHAR(255)
)
CREATE TABLE Transactions_Lots (
transaction_id INTEGER,
lot_id INTEGER
)
CREATE TABLE Transactions (
transaction_id INTEGER,
investor_id INTEGER,
transaction_type_code VARCHAR(10),
date_of_transact... | SELECT date_of_transaction, COUNT(date_of_transaction) FROM Transactions ORDER BY date_of_transaction DESC | nvbench |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.diagnosis = "ST ELEVATED MYOCARDIAL INFARCTION\CARDIAC CATH" AND lab.fluid = "Blood" | mimicsql_data |
CREATE TABLE table_30423 (
"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.
-- What i... | SELECT "Score" FROM table_30423 WHERE "Date" = 'January 2' | wikisql |
CREATE TABLE table_name_29 (
tournament VARCHAR,
runner_s__up VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- For what tournament was Bubba Watson the runner-up?
| SELECT tournament FROM table_name_29 WHERE runner_s__up = "bubba watson" | sql_create_context |
CREATE TABLE table_name_5 (
Id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the 2012 for 2011 being 1r
| SELECT 2012 FROM table_name_5 WHERE 2011 = "1r" | sql_create_context |
CREATE TABLE qtb (
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.PERSON_NM = '凤高翰' AND t_kc22.STA_DATE BETWEEN '2010-05-21' AND '2019-08-03' AND t_kc22.SELF_PAY_PRO < 0.48 UNION SELECT COUNT(*) FROM gyb JOIN t_kc22 ON gyb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gyb.PERSON_NM = '凤高翰' AND t_k... | css |
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE transfers (
row_id number,
subject_id number,
... | SELECT admissions.age FROM admissions WHERE admissions.subject_id = 97733 AND admissions.dischtime IS NULL | mimic_iii |
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt int
)
CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description varchar
)
CREATE TABLE ground_service (
... | 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 = 'CHICAGO' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'NEWAR... | atis |
CREATE TABLE table_21004 (
"Province" text,
"Population" real,
"Region" text,
"Name of City" text,
"Districts" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the region containing the Constitutional Province of Callao?
| SELECT "Region" FROM table_21004 WHERE "Province" = 'Constitutional Province of Callao' | wikisql |
CREATE TABLE table_38716 (
"Date" text,
"Opponent" text,
"Result" text,
"Score" text,
"Record" text,
"Streak" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the record in the win 7 streak?
| SELECT "Record" FROM table_38716 WHERE "Streak" = 'win 7' | wikisql |
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
... | SELECT SUM(CASE WHEN patients.dod IS NULL THEN 1 WHEN STRFTIME('%j', patients.dod) - STRFTIME('%j', t4.charttime) > 1 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t2.subject_id, t2.charttime FROM (SELECT t1.subject_id, t1.charttime FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd... | mimic_iii |
CREATE TABLE table_14570857_1 (
situation VARCHAR,
original_us_airdate VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which situation has an original u.s. airdate of December 5, 2007?
| SELECT situation FROM table_14570857_1 WHERE original_us_airdate = "December 5, 2007" | sql_create_context |
CREATE TABLE table_25505246_8 (
outcome VARCHAR,
partner VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How did the match end when she played with caroline wozniacki?
| SELECT outcome FROM table_25505246_8 WHERE partner = "Caroline Wozniacki" | sql_create_context |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE patient (
uniquepid text,
pati... | SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.patientunitstayid IN (SELECT medication.patientunitstayid FROM medication WHERE medication.drugname = 'zosyn' AND DATETIME(medication.drugstarttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')) | eicu |
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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.age < "86" AND diagnoses.long_title = "Wheelchair dependence" | mimicsql_data |
CREATE TABLE gwyjzb (
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 COUNT(*) FROM gwyjzb JOIN t_kc22 ON gwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gwyjzb.PERSON_NM = '钱嘉慕' AND t_kc22.STA_DATE BETWEEN '2006-10-01' AND '2018-12-20' AND t_kc22.SELF_PAY_PRO < 0.14 UNION SELECT COUNT(*) FROM fgwyjzb JOIN t_kc22 ON fgwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE fgwyjzb.PERS... | css |
CREATE TABLE t_kc22 (
AMOUNT number,
CHA_ITEM_LEV number,
DATA_ID text,
DIRE_TYPE number,
DOSE_FORM text,
DOSE_UNIT text,
EACH_DOSAGE text,
EXP_OCC_DATE time,
FLX_MED_ORG_ID text,
FXBZ number,
HOSP_DOC_CD text,
HOSP_DOC_NM text,
MED_DIRE_CD text,
MED_DIRE_NM text,... | SELECT SUM(t_kc22.AMOUNT) FROM t_kc21 JOIN t_kc22 JOIN t_kc21_t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc22.MED_CLINIC_ID AND t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID WHERE t_kc21.PERSON_NM = '郎颖初' AND t_kc21.CLINIC_TYPE = '门诊' AND t_kc22.STA_DATE BETWEEN '2003-12-09' AND '2012-01-10' AND t_kc22.MED_INV_IT... | css |
CREATE TABLE table_204_939 (
id number,
"year" number,
"chassis" text,
"engine" text,
"start" text,
"finish" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many chassis in the 80 's were penske 's ?
| SELECT COUNT("chassis") FROM table_204_939 WHERE "chassis" = 'penske' | squall |
CREATE TABLE table_42179 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the opponent of the game played on November 20, 1995?
| SELECT "Opponent" FROM table_42179 WHERE "Date" = 'november 20, 1995' | wikisql |
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number... | SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, prescriptions.startdate, admissions.hadm_id FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'neomycin-polymyxin-bacitracin' AND DATETIME(p... | mimic_iii |
CREATE TABLE customers (
customer_type_code VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many customers are there in the customer type with the most customers?
| SELECT COUNT(*) FROM customers GROUP BY customer_type_code ORDER BY COUNT(*) DESC LIMIT 1 | sql_create_context |
CREATE TABLE voting_record (
stuid number,
registration_date text,
election_cycle text,
president_vote number,
vice_president_vote number,
secretary_vote number,
treasurer_vote number,
class_president_vote number,
class_senator_vote number
)
CREATE TABLE student (
stuid number,
... | SELECT DISTINCT registration_date, election_cycle FROM voting_record | spider |
CREATE TABLE time_slot (
time_slot_id varchar(4),
day varchar(1),
start_hr numeric(2),
start_min numeric(2),
end_hr numeric(2),
end_min numeric(2)
)
CREATE TABLE classroom (
building varchar(15),
room_number varchar(7),
capacity numeric(4,0)
)
CREATE TABLE takes (
ID varchar(5)... | SELECT year, COUNT(year) FROM course AS T1 JOIN section AS T2 ON T1.course_id = T2.course_id WHERE T1.dept_name = 'Psychology' ORDER BY year DESC | 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 diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | SELECT demographic.days_stay, lab.label FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.subject_id = "32418" | mimicsql_data |
CREATE TABLE table_52678 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Series" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which ... | SELECT MAX("Game") FROM table_52678 WHERE "High rebounds" = 'evans (7)' AND "High assists" = 'evans, ollie (3)' | wikisql |
CREATE TABLE table_69942 (
"Date" text,
"Visitor" text,
"Result" text,
"Score" text,
"Home" text,
"Record" text,
"Attendance" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the home for 21-17
| SELECT "Home" FROM table_69942 WHERE "Score" = '21-17' | wikisql |
CREATE TABLE Courses (
course_id INTEGER,
author_id INTEGER,
subject_id INTEGER,
course_name VARCHAR(120),
course_description VARCHAR(255)
)
CREATE TABLE Student_Course_Enrolment (
registration_id INTEGER,
student_id INTEGER,
course_id INTEGER,
date_of_enrolment DATETIME,
date_o... | SELECT date_of_completion, COUNT(date_of_completion) FROM Student_Course_Enrolment GROUP BY date_of_completion ORDER BY date_of_completion | nvbench |
CREATE TABLE table_name_96 (
permanent_account VARCHAR,
updated_in_past_30_days VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Permanent Account, when Updated In Past 30 Days is 10324?
| SELECT permanent_account FROM table_name_96 WHERE updated_in_past_30_days = "10324" | sql_create_context |
CREATE TABLE table_name_43 (
country VARCHAR,
place VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What country was the player, rod pampling, from who placed t10?
| SELECT country FROM table_name_43 WHERE place = "t10" AND player = "rod pampling" | sql_create_context |
CREATE TABLE table_3166 (
"Week" real,
"Date" text,
"Kickoff" text,
"Opponent" text,
"Final score" text,
"Team record" text,
"Game site" text,
"Attendance" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many weeks are teams playing a... | SELECT COUNT("Week") FROM table_3166 WHERE "Opponent" = 'Barcelona Dragons' | wikisql |
CREATE TABLE table_8380 (
"Pick" real,
"Player" text,
"Pos." text,
"Nationality" text,
"Team" text,
"Previous team" text,
"NBA years [a ]" text,
"Career with the franchise [b ]" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Care... | SELECT "Career with the franchise [b ]" FROM table_8380 WHERE "Player" = 'willie anderson category:articles with hcards' | wikisql |
CREATE TABLE table_name_51 (
points INTEGER,
against INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Points with an Against smaller than 16?
| SELECT AVG(points) FROM table_name_51 WHERE against < 16 | 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 swimmer (
ID int,
name text,
Nationality text,
meter_100 real,
meter_20... | SELECT meter_200, SUM(meter_100) FROM swimmer GROUP BY meter_200 ORDER BY meter_200 DESC | nvbench |
CREATE TABLE table_204_330 (
id number,
"finished" text,
"horse" text,
"jockey" text,
"trainer" text,
"owner" text,
"time / behind" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who finished earlier , hindoocraft or spokane ?
| SELECT "horse" FROM table_204_330 WHERE "horse" IN ('hindoocraft', 'spokane') ORDER BY "finished" LIMIT 1 | squall |
CREATE TABLE table_15510 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" real,
"Series" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what was the score in the loss to tapani (0-1)?
| SELECT "Score" FROM table_15510 WHERE "Loss" = 'tapani (0-1)' | wikisql |
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE PostFeedback (
Id number,
PostId numb... | SELECT ROW_NUMBER() OVER (ORDER BY 'views_to_rep' DESC) AS "#", * FROM (SELECT u.Id AS "user_link", u.Views, u.Reputation, 1. * u.Views / u.Reputation AS "views_to_rep" FROM Users AS u WHERE u.Location LIKE '%Ukraine%') AS q ORDER BY 'views_to_rep' DESC LIMIT 500 | sede |
CREATE TABLE table_name_6 (
pts VARCHAR,
year VARCHAR,
event VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the pts for 2004, and the ro event?
| SELECT pts FROM table_name_6 WHERE year = "2004" AND event = "ro" | sql_create_context |
CREATE TABLE table_203_116 (
id number,
"no." number,
"player" text,
"birth date" text,
"weight" number,
"height" number,
"position" text,
"current club" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how much taller in oliver venno than... | SELECT (SELECT "height" FROM table_203_116 WHERE "player" = 'oliver venno') - (SELECT "height" FROM table_203_116 WHERE "player" = 'rait rikberg') | squall |
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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "68" AND prescriptions.drug_type = "BASE" | mimicsql_data |
CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationDate time,
ApprovalDate time,
RejectionDate time,
OwnerUserId number,
Comment text,
Text text,
Title text,
Tags text,
RevisionGUID other
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedA... | SELECT Q.Id AS "post_link", Q.Score, Q.AnswerCount, Q.ClosedDate FROM Posts AS Q WHERE Q.PostTypeId = 1 AND Q.Body LIKE '%help.dyalog.com%' OR EXISTS(SELECT * FROM Posts AS A WHERE A.ParentId = Q.Id AND A.PostTypeId = 2 AND A.Body LIKE '%help.dyalog.com%') ORDER BY Q.ClosedDate, Q.AnswerCount, Q.Score DESC | sede |
CREATE TABLE table_3397 (
"Player" text,
"Touchdowns (5 points)" real,
"Extra points 1 point" real,
"Field goals (4 points)" real,
"Safeties (2 points)" real,
"Total Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many extra points di... | SELECT "Extra points 1 point" FROM table_3397 WHERE "Player" = 'Germany Schultz' | wikisql |
CREATE TABLE people (
people_id number,
name text,
age number,
height number,
hometown text
)
CREATE TABLE gymnast (
gymnast_id number,
floor_exercise_points number,
pommel_horse_points number,
rings_points number,
vault_points number,
parallel_bars_points number,
horizo... | SELECT T2.hometown FROM gymnast AS T1 JOIN people AS T2 ON T1.gymnast_id = T2.people_id GROUP BY T2.hometown HAVING COUNT(*) >= 2 | spider |
CREATE TABLE table_18904 (
"Rnd" real,
"Circuit" text,
"GTO Winning Team" text,
"GTU Winning Team" text,
"TO Winning Team" text,
"TU Winning Team" text,
"Results" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is GTO Winning Team Mike K... | SELECT "Rnd" FROM table_18904 WHERE "GTO Winning Team" = 'Mike Keyser' | wikisql |
CREATE TABLE table_name_14 (
away_team VARCHAR,
venue VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who plays at Victoria Park?
| SELECT away_team FROM table_name_14 WHERE venue = "victoria park" | sql_create_context |
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 countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_... | SELECT HIRE_DATE, DEPARTMENT_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) | nvbench |
CREATE TABLE table_25800134_1 (
director VARCHAR,
airdate VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who directed the episodes that aired December 15, 1956?
| SELECT director FROM table_25800134_1 WHERE airdate = "December 15, 1956" | sql_create_context |
CREATE TABLE table_name_44 (
crowd VARCHAR,
away_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many people attended the game where Fitzroy was the away team?
| SELECT COUNT(crowd) FROM table_name_44 WHERE away_team = "fitzroy" | sql_create_context |
CREATE TABLE t_kc21_t_kc22 (
MED_CLINIC_ID text,
MED_EXP_DET_ID number
)
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,
C... | SELECT t_kc21.OUT_HOSP_DATE FROM t_kc21 WHERE t_kc21.MED_CLINIC_ID = '16021187507' | css |
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.admission_type = "URGENT" AND lab.label = "WBC, Joint Fluid" | mimicsql_data |
CREATE TABLE producer (
pid int,
gender text,
name text,
nationality text,
birth_city text,
birth_year int
)
CREATE TABLE cast (
id int,
msid int,
aid int,
role text
)
CREATE TABLE writer (
wid int,
gender text,
name text,
nationality text,
birth_city text,
... | SELECT movie.title FROM actor, cast, movie WHERE actor.name = 'Rowan Atkinson' AND cast.aid = actor.aid AND cast.role = 'Mr. Bean' AND movie.mid = cast.msid | imdb |
CREATE TABLE table_name_89 (
Home INTEGER,
institution VARCHAR,
wins VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the sum of the home wins of the Boston College Eagles, which has more than 6 wins?
| SELECT SUM(Home) AS wins FROM table_name_89 WHERE institution = "boston college eagles" AND wins > 6 | sql_create_context |
CREATE TABLE table_10236830_1 (
actors_name VARCHAR,
director VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the actors name that vadim ilyenko directed?
| SELECT actors_name FROM table_10236830_1 WHERE director = "Vadim Ilyenko" | sql_create_context |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses (
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 INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admityear < "2167" AND procedures.long_title = "Percutaneous (endoscopic) jejunostomy [PEJ]" | mimicsql_data |
CREATE TABLE table_2570269_2 (
cast VARCHAR,
episode_title VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- If the episode title is Pressures, what are the names of the cast?
| SELECT cast FROM table_2570269_2 WHERE episode_title = "Pressures" | sql_create_context |
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_kc21.MED_ORG_DEPT_CD, t_kc21.MED_ORG_DEPT_NM, AVG(t_kc21.IN_HOSP_DAYS) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '6489822' GROUP BY t_kc21.MED_ORG_DEPT_CD ORDER BY AVG(t_kc21.IN_HOSP_DAYS) | css |
CREATE TABLE swimmer (
ID int,
name text,
Nationality text,
meter_100 real,
meter_200 text,
meter_300 text,
meter_400 text,
meter_500 text,
meter_600 text,
meter_700 text,
Time text
)
CREATE TABLE event (
ID int,
Name text,
Stadium_ID int,
Year text
)
CREATE... | SELECT Time, meter_100 FROM swimmer ORDER BY meter_100 DESC | nvbench |
CREATE TABLE table_name_23 (
median_family_income VARCHAR,
per_capita_income VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the median family income when the per capita is $24,114?
| SELECT median_family_income FROM table_name_23 WHERE per_capita_income = "$24,114" | sql_create_context |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.discharge_location = "REHAB/DISTINCT PART HOSP" AND procedures.icd9_code = "3491" | mimicsql_data |
CREATE TABLE table_17900317_5 (
matches INTEGER,
runs VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the least matches for runs being 276
| SELECT MIN(matches) FROM table_17900317_5 WHERE runs = 276 | 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 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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dob_year < "2121" AND prescriptions.route = "PR" | mimicsql_data |
CREATE TABLE table_204_242 (
id number,
"season" text,
"record" text,
"finish" text,
"manager" text,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what season had the least amount of wins ?
| SELECT "season" FROM table_204_242 ORDER BY "record" LIMIT 1 | squall |
CREATE TABLE table_name_45 (
round_4 VARCHAR,
round_1 VARCHAR,
round_2 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Round 4 for larger than 19 Round 1 and a 27 Round 2?
| SELECT round_4 FROM table_name_45 WHERE round_1 > 19 AND round_2 = "27" | sql_create_context |
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConce... | SELECT Tags.TagName, wiki.CreationDate AS "wiki_date", excerpt.CreationDate AS "excerpt_date", MIN(Posts.CreationDate) AS "first_post", COUNT(Tags.TagName) AS Uses FROM (((PostTags INNER JOIN Posts ON PostTags.PostId = Posts.Id) INNER JOIN Tags ON PostTags.TagId = Tags.Id) INNER JOIN Posts AS wiki ON Tags.WikiPostId = ... | sede |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "SQUAMOUS CELL CARCINOMA ORAL TONGUE/SDA" AND demographic.dod_year <= "2131.0" | mimicsql_data |
CREATE TABLE table_24239 (
"Nr." real,
"District" text,
"Former Name" text,
"Area ( ha )" real,
"Population (2005)" real,
"No. of villages" real,
"Density persons / ha" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- With the population in 20... | SELECT "Former Name" FROM table_24239 WHERE "Population (2005)" = '572' | wikisql |
CREATE TABLE geographic (
city_name varchar,
county varchar,
region varchar
)
CREATE TABLE restaurant (
id int,
name varchar,
food_type varchar,
city_name varchar,
rating "decimal
)
CREATE TABLE location (
restaurant_id int,
house_number int,
street_name varchar,
city_n... | SELECT location.house_number, restaurant.name FROM location, restaurant WHERE location.city_name = 'san francisco' AND location.street_name = 'buchanan' AND restaurant.food_type = 'arabic' AND restaurant.id = location.restaurant_id AND restaurant.rating > 2.5 | restaurants |
CREATE TABLE table_22756549_1 (
party VARCHAR,
winner VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What party is the winner K. Anbazhagan from?
| SELECT party AS a FROM table_22756549_1 WHERE winner = "K. Anbazhagan" | 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 qtb.MED_ORG_DEPT_CD, qtb.IN_DIAG_DIS_NM, MAX(t_kc24.CIVIL_SUBSIDY) FROM qtb JOIN t_kc24 ON qtb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE qtb.MED_SER_ORG_NO = '7999719' GROUP BY qtb.MED_ORG_DEPT_CD, qtb.IN_DIAG_DIS_NM ORDER BY MAX(t_kc24.CIVIL_SUBSIDY / t_kc24.MED_AMOUT) DESC UNION SELECT gyb.MED_ORG_DEPT_CD, gy... | css |
CREATE TABLE table_38747 (
"Round" real,
"Player" text,
"Position" text,
"Nationality" text,
"College/Junior/Club Team (League)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What nationality is Daryn Fersovich?
| SELECT "Nationality" FROM table_38747 WHERE "Player" = 'daryn fersovich' | wikisql |
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE student (
student_id int,
lastname varchar,
firstname varchar,
program_id int,
... | SELECT DISTINCT course.name, course.number, semester.semester, semester.year FROM course, course_offering, semester WHERE ((semester.semester = 'FA' AND semester.year = 2016) OR (semester.semester = 'FA' AND semester.year = 2017) OR (semester.semester = 'FA' AND semester.year = 2018) OR (semester.semester = 'WN' AND se... | advising |
CREATE TABLE table_name_91 (
doubles_w_l VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Tell me the doubles W-L for player of laurynas grigelis
| SELECT doubles_w_l FROM table_name_91 WHERE player = "laurynas grigelis" | sql_create_context |
CREATE TABLE table_75327 (
"NTFA Div 2" text,
"Wins" real,
"Byes" real,
"Losses" real,
"Draws" real,
"Against" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest number of against of NTFA Div 2 Fingal Valley?
| SELECT MIN("Against") FROM table_75327 WHERE "NTFA Div 2" = 'fingal valley' | 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 diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dod_year <= "2180.0" AND procedures.icd9_code = "4105" | mimicsql_data |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE cost (
c... | SELECT DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'lab' AND cost.eventid IN (SELECT lab.labid FROM lab WHERE lab.labname = '-monos') | eicu |
CREATE TABLE table_name_69 (
week INTEGER,
game_site VARCHAR,
result VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest week when the game site was Verizon Wireless Arena, and the result was w 59 42?
| SELECT MAX(week) FROM table_name_69 WHERE game_site = "verizon wireless arena" AND result = "w 59–42" | sql_create_context |
CREATE TABLE table_203_270 (
id number,
"year" number,
"competition" text,
"venue" text,
"position" text,
"event" text,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- number of races not finished
| SELECT COUNT(*) FROM table_203_270 WHERE "position" IS NULL | squall |
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
Rejectio... | SELECT MIN(CreationDate) FROM Comments | sede |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.