instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_17566 ( "Stage" text, "Winner" text, "General classification" text, "Points classification" text, "Mountains classification" text, "Young rider classification" text, "Trofeo Fast Team" text ) -- Using valid SQLite, answer the following questions for the tables provided a...
SELECT COUNT("General classification") FROM table_17566 WHERE "Stage" = '15'
wikisql
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) 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,...
SELECT wdmzjzjlb.JZJSSJ FROM wdmzjzjlb WHERE wdmzjzjlb.JZLSH = '34024998197' UNION SELECT bdmzjzjlb.JZJSSJ FROM bdmzjzjlb WHERE bdmzjzjlb.JZLSH = '34024998197'
css
CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE course_offering ( offering_id int, course_id int, semes...
SELECT DISTINCT semester.year FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'RCIDIV' AND course.number = 302 AND semester.semester_id = course_offering.semester ORDER BY semester.year LIMIT 1
advising
CREATE TABLE mission ( Mission_ID int, Ship_ID int, Code text, Launched_Year int, Location text, Speed_knots int, Fate text ) CREATE TABLE ship ( Ship_ID int, Name text, Type text, Nationality text, Tonnage int ) -- Using valid SQLite, answer the following questions fo...
SELECT Nationality, COUNT(Nationality) FROM ship GROUP BY Type, Nationality
nvbench
CREATE TABLE table_24985 ( "Year" text, "Chairman" text, "Artistic Director" text, "Performance Liaison" text, "Secretary" text, "Business manager" text, "Production Stagemanager" text, "Dramaturge" text, "Public Relations" text, "First/Second Year Rep." text, "Male Rep." tex...
SELECT "Year" FROM table_24985 WHERE "First/Second Year Rep." = 'Katie Pautler and Devery North'
wikisql
CREATE TABLE table_name_8 ( firefox VARCHAR, netscape VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What percentage of users were using Firefox during the period in which *0.77% were using Netscape?
SELECT firefox FROM table_name_8 WHERE netscape = "*0.77%"
sql_create_context
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE allergy ( ...
SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'depression' AND DATETIME(diagnosis.diagnosistime) <= DATETIME(CURRENT_TIME(), '-1 year')) AS t1 JOIN (SELECT...
eicu
CREATE TABLE table_57201 ( "Type of sign" text, "Shape" text, "Border" text, "Background colour" text, "Text/Symbol" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which sign had a yellow background and a triangular shape?
SELECT "Border" FROM table_57201 WHERE "Background colour" = 'yellow' AND "Shape" = 'triangular'
wikisql
CREATE TABLE table_11254821_2 ( points_awarded__platinum_ INTEGER, finishing_position VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many platinum points were awarded for 5th place?
SELECT MAX(points_awarded__platinum_) FROM table_11254821_2 WHERE finishing_position = "5th"
sql_create_context
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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.gender = "M" AND prescriptions.formulary_drug_cd = "CLIN1000I"
mimicsql_data
CREATE TABLE table_20566 ( "Year" real, "GDP Nominal ($ billions)" text, "GDP Adjusted ($ billions)" text, "Population (millions)" text, "GDP per capita Nominal ($)" real, "GDP per capita Adjusted ($)" real ) -- Using valid SQLite, answer the following questions for the tables provided above. ...
SELECT MIN("GDP per capita Nominal ($)") FROM table_20566 WHERE "Population (millions)" = '63.056'
wikisql
CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) -- Using valid SQLite, answer the following questions for the...
SELECT T2.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T2.Name
nvbench
CREATE TABLE table_41587 ( "Position" text, "Jersey number" real, "Name v t e" text, "Height (cm)" real, "Weight (kg)" real, "Birthplace" text, "2008-09 team" text, "NHL rights, if any" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What...
SELECT AVG("Weight (kg)") FROM table_41587 WHERE "Height (cm)" = '180' AND "Position" = 'd'
wikisql
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE intakeoutput ( i...
SELECT intakeoutput.celllabel FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '004-64091')) AND intakeoutput.cellpath LIKE '%output%' AND S...
eicu
CREATE TABLE table_204_256 ( id number, "position" number, "club" text, "played" number, "points" number, "wins" number, "draws" number, "losses" number, "goals for" number, "goals against" number, "goal difference" number ) -- Using valid SQLite, answer the following quest...
SELECT SUM("wins") FROM table_204_256 WHERE "position" <= 3
squall
CREATE TABLE table_2931 ( "Player" text, "Position" text, "NASL years" text, "NASL club(s)" text, "Accolades (Pre-NASL)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many years of nasl years did the accolades read 'captained england to victory...
SELECT COUNT("NASL years") FROM table_2931 WHERE "Accolades (Pre-NASL)" = 'Captained England to victory at the 1966 World Cup'
wikisql
CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate tim...
SELECT ph.PostId AS "post_link", ph.CreationDate AS "protected_date", CASE ph.UserId WHEN NULL THEN ph.UserDisplayName ELSE ph.UserId END AS "user_link" FROM PostHistory AS ph WHERE ph.PostHistoryTypeId = 19 ORDER BY ph.PostId, ph.CreationDate
sede
CREATE TABLE table_4606 ( "Team" text, "Chassis" text, "Engine" text, "Tires" text, "Drivers" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What chassis did Gordon Johncock use with his cosworth engine?
SELECT "Chassis" FROM table_4606 WHERE "Engine" = 'cosworth' AND "Drivers" = 'gordon johncock'
wikisql
CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, countr...
SELECT COUNT(DISTINCT instructor.instructor_id) FROM course, course_offering, instructor, offering_instructor, semester WHERE course.course_id = course_offering.course_id AND course.department = 'EEB' AND course.number = 801 AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.offeri...
advising
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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.formulary_drug_cd = "METL25"
mimicsql_data
CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, last_wardid number, intime time, outtime time ) CREATE TABLE prescriptions ( row_id number, subject_id number, h...
SELECT MAX(chartevents.valuenum) 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 = 4368)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'sao2'...
mimic_iii
CREATE TABLE Documents_with_Expenses ( Document_ID INTEGER, Budget_Type_Code CHAR(15), Document_Details VARCHAR(255) ) CREATE TABLE Accounts ( Account_ID INTEGER, Statement_ID INTEGER, Account_Details VARCHAR(255) ) CREATE TABLE Ref_Budget_Codes ( Budget_Type_Code CHAR(15), Budget_Type...
SELECT Document_Date, COUNT(Document_Date) FROM Ref_Document_Types AS T1 JOIN Documents AS T2 ON T1.Document_Type_Code = T2.Document_Type_Code ORDER BY Document_Date 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 lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.icd9_code = "49320" AND lab.fluid = "Urine"
mimicsql_data
CREATE TABLE table_43387 ( "Rank" real, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many Gold medals did Great Britain with a Total of more than 2 medals receive?
SELECT MIN("Gold") FROM table_43387 WHERE "Nation" = 'great britain' AND "Total" > '2'
wikisql
CREATE TABLE table_20574 ( "Date (CE)" text, "Text" text, "Simplified characters" text, "Traditional characters" text, "Pinyin" text, "Wade-Giles" text, "Literal meaning" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the pinyin for 657...
SELECT "Pinyin" FROM table_20574 WHERE "Date (CE)" = '657'
wikisql
CREATE TABLE table_70169 ( "Season" real, "Series" text, "Team" text, "Races" real, "Wins" real, "Podiums" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many wins has a podiums greater than 1 and 9 as the races with a season after 1984?
SELECT COUNT("Wins") FROM table_70169 WHERE "Podiums" > '1' AND "Races" = '9' AND "Season" > '1984'
wikisql
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 t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM qtb JOIN t_kc22 ON qtb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE qtb.MED_SER_ORG_NO = '8227829' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY SUM(t_kc22.AMOUNT) DESC LIMIT 24 UNION SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM gyb JOIN t_kc22 ON gyb.ME...
css
CREATE TABLE hz_info ( KH text, KLX number, YLJGDM text, RYBH text ) CREATE TABLE person_info ( RYBH text, XBDM number, XBMC text, XM text, CSRQ time, CSD text, MZDM text, MZMC text, GJDM text, GJMC text, JGDM text, JGMC text, XLDM text, XLMC text...
SELECT SHRGH, SHRXM FROM jybgb WHERE JZLSH = '00619973238'
css
CREATE TABLE Settlements ( Settlement_ID INTEGER, Claim_ID INTEGER, Date_Claim_Made DATE, Date_Claim_Settled DATE, Amount_Claimed INTEGER, Amount_Settled INTEGER, Customer_Policy_ID INTEGER ) CREATE TABLE Customers ( Customer_ID INTEGER, Customer_Details VARCHAR(255) ) CREATE TABLE...
SELECT Date_Payment_Made, Amount_Payment FROM Payments WHERE Payment_Method_Code = 'Visa' ORDER BY Date_Payment_Made DESC
nvbench
CREATE TABLE table_50675 ( "Player" text, "Country" text, "Year(s) won" text, "Total" real, "To par" text, "Finish" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the finish for the golfer with a total of 285?
SELECT "Finish" FROM table_50675 WHERE "Total" = '285'
wikisql
CREATE TABLE table_name_46 ( away_team VARCHAR, tie_no VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- For the Tie number of 14 who was the away team?
SELECT away_team FROM table_name_46 WHERE tie_no = "14"
sql_create_context
CREATE TABLE table_9537 ( "Tournament" text, "2006" text, "2007" text, "2008" text, "2009" text, "2010" text, "2011" text, "2012" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What 2009 has statistics by surface in 2012?
SELECT "2009" FROM table_9537 WHERE "2012" = 'statistics by surface'
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 COUNT(*) FROM zyjzjlb WHERE YLJGDM = '5217265' AND JZKSDM = '476' AND RYDJSJ BETWEEN '2012-12-29' AND '2013-08-09'
css
CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), HIRE_DATE date, JOB_ID varchar(10), SALARY decimal(8,2), COMMISSION_PCT decimal(2,2), MANAGER_ID decimal(6,0), DEPARTMENT_ID decimal(...
SELECT JOB_ID, AVG(DEPARTMENT_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) GROUP BY JOB_ID
nvbench
CREATE TABLE table_72689 ( "Conflict" text, "United Nations Mission" text, "Sexual abuse 1" real, "Murder 2" real, "Extortion/Theft 3" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the sexual abuse rate where the conflict is the Burundi Civ...
SELECT MAX("Sexual abuse 1") FROM table_72689 WHERE "Conflict" = 'Burundi Civil War'
wikisql
CREATE TABLE table_51415 ( "Air Date" text, "Timeslot (EST)" text, "Season" text, "Rating" real, "Share" real, "18-49 (Rating/Share)" text, "Viewers (m)" real, "Weekly Rank (#)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the ...
SELECT MAX("Viewers (m)") FROM table_51415 WHERE "Rating" > '9.4'
wikisql
CREATE TABLE table_47602 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the score when the home team was Stockport County?
SELECT "Score" FROM table_47602 WHERE "Home team" = 'stockport county'
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(DISTINCT MED_SER_ORG_NO) FROM t_kc21 WHERE PERSON_NM = '苏家欣' AND IN_HOSP_DATE BETWEEN '2000-02-24' AND '2009-04-29'
css
CREATE TABLE fzzmzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH number, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZD...
SELECT jyjgzbb.YQBH, jyjgzbb.YQMC FROM hz_info JOIN zzmzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX AND zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH ...
css
CREATE TABLE table_15518 ( "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 is the average round of the match in the Hero'...
SELECT AVG("Round") FROM table_15518 WHERE "Time" = '5:00' AND "Event" = 'hero''s 9'
wikisql
CREATE TABLE table_51453 ( "Opponent" text, "Result" text, "Score" text, "Date" text, "Venue" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who won that game on 24 July 2010?
SELECT "Result" FROM table_51453 WHERE "Date" = '24 july 2010'
wikisql
CREATE TABLE table_name_80 ( ends VARCHAR, transfer_fee VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total number of ends when the transfer fee was dkk 14m?
SELECT COUNT(ends) FROM table_name_80 WHERE transfer_fee = "dkk 14m"
sql_create_context
CREATE TABLE table_10881 ( "Result" text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" real, "Location" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Event has the Opponent, Jason Yee?
SELECT "Event" FROM table_10881 WHERE "Opponent" = 'jason yee'
wikisql
CREATE TABLE table_name_21 ( away_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What did South Melbourne score when they were the Away team?
SELECT away_team AS score FROM table_name_21 WHERE away_team = "south melbourne"
sql_create_context
CREATE TABLE table_11462 ( "Tournament" text, "2006" text, "2007" text, "2008" text, "2009" text, "2010" text, "2011" text, "2012" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the 2007 value with NMS in 2011?
SELECT "2007" FROM table_11462 WHERE "2011" = 'nms'
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 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_ID = '87239192' AND t_kc22.STA_DATE BETWEEN '2008-09-22' AND '2012-04-12' AND t_kc21.MED_SER_ORG_NO = '3998921' AND t_kc22.MED_INV_ITEM_TYPE = '西药费'
css
CREATE TABLE projects ( project_id number, organisation_id number, project_details text ) CREATE TABLE staff_roles ( role_code text, role_description text ) CREATE TABLE organisations ( organisation_id number, organisation_type text, organisation_details text ) CREATE TABLE organisati...
SELECT COUNT(DISTINCT role_code) FROM project_staff
spider
CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, ...
SELECT vitalperiodic.observationtime FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '007-849') AND NOT patient.unitdischargetime IS NULL...
eicu
CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE restriction ( restriction_code text, advance_purchase int, stopovers text, saturday_stay_required text, minimum_stay int, maximum_stay int, application text, no_discounts text ) CREATE TA...
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 = 'SAN FRANCISCO' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = '...
atis
CREATE TABLE table_203_449 ( id number, "name" text, "lifetime" text, "nationality" text, "notable as" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many novelists are listed ?
SELECT COUNT(*) FROM table_203_449 WHERE "notable as" = 'novelist'
squall
CREATE TABLE bdmzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH number, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZ...
SELECT COUNT(*) FROM (SELECT jybgb.KSBM FROM wdmzjzjlb JOIN jybgb ON wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE wdmzjzjlb.YLJGDM = '4897749' AND jybgb.BGRQ BETWEEN '2000-07-30' AND '2004-02-29' GROUP BY jybgb.KSBM HAVING COUNT(*) > 30 UNION SELECT jybgb.KSBM FROM bdmzjzjlb J...
css
CREATE TABLE fgwyjzb ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, ...
SELECT * FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '8000303' AND gwyjzb.IN_HOSP_DATE BETWEEN '2009-08-01' AND '2015-07-07' UNION SELECT * FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '8000303' AND fgwyjzb.IN_HOSP_DATE BETWEEN '2009-08-01' AND '2015-07-07' EXCEPT SELECT * FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '800030...
css
CREATE TABLE table_23486853_8 ( score VARCHAR, location VARCHAR, points VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is every score at the location of Verizon Center and points of 68?
SELECT score FROM table_23486853_8 WHERE location = "Verizon Center" AND points = 68
sql_create_context
CREATE TABLE table_59626 ( "Player" text, "Team" text, "Matches" real, "Overs" real, "Runs" real, "Wickets" real, "Best" text, "Econ" real, "S/Rate" real, "4/inns" real, "5+/inns" real, "Average" real ) -- Using valid SQLite, answer the following questions for the table...
SELECT AVG("Wickets") FROM table_59626 WHERE "Overs" > '44' AND "Player" = 'danish kaneria' AND "Average" > '13.8'
wikisql
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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admityear < "2170" AND prescriptions.drug = "Clobetasol Propionate 0.05% Ointment"
mimicsql_data
CREATE TABLE table_76273 ( "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 "High points" FROM table_76273 WHERE "Game" < '10' AND "High assists" = 'chauncey billups (8)'
wikisql
CREATE TABLE table_33047 ( "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 Carlton's score when they were the away...
SELECT "Away team score" FROM table_33047 WHERE "Away team" = 'carlton'
wikisql
CREATE TABLE table_1566852_4 ( centerfold_model VARCHAR, cover_model VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many centerfold models were there when the cover model was Torrie Wilson?
SELECT COUNT(centerfold_model) FROM table_1566852_4 WHERE cover_model = "Torrie Wilson"
sql_create_context
CREATE TABLE table_71210 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who took the loss on May 25?
SELECT "Loss" FROM table_71210 WHERE "Date" = 'may 25'
wikisql
CREATE TABLE table_38228 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Attendance" real, "Record" text, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Date has a Visitor of boston?
SELECT "Date" FROM table_38228 WHERE "Visitor" = 'boston'
wikisql
CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE jo...
SELECT DISTINCT course.department, course.name, course.number FROM course, program, program_course WHERE program_course.category LIKE '%Other%' AND program_course.course_id = course.course_id AND program.name LIKE '%CS-LSA%' AND program.program_id = program_course.program_id
advising
CREATE TABLE table_train_3 ( "id" int, "pregnancy_or_lactation" bool, "severe_sepsis" bool, "systolic_blood_pressure_sbp" int, "mean_arterial_pressure_map" int, "leukocyte_count" int, "renal_disease" bool, "temperature" float, "sepsis" bool, "hypotension" bool, "heart_rate" i...
SELECT * FROM table_train_3 WHERE age > 18
criteria2sql
CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE...
SELECT COUNT(*) FROM Posts WHERE Posts.ViewCount > 58000
sede
CREATE TABLE table_18499 ( "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's the result with dbeingtrict being florida 4
SELECT "Result" FROM table_18499 WHERE "District" = 'Florida 4'
wikisql
CREATE TABLE field ( fieldid int ) CREATE TABLE paperfield ( fieldid int, paperid int ) CREATE TABLE venue ( venueid int, venuename varchar ) CREATE TABLE author ( authorid int, authorname varchar ) CREATE TABLE dataset ( datasetid int, datasetname varchar ) CREATE TABLE cite ( ...
SELECT DISTINCT COUNT(writes.paperid) FROM author, paper, writes WHERE author.authorname = 'michael i. jordan' AND paper.year = 2016 AND writes.authorid = author.authorid AND writes.paperid = paper.paperid
scholar
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 jybgb.SHSJ FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN hz_info_mzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB ...
css
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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Hypopotassemia" AND prescriptions.route = "BOTH EYES"
mimicsql_data
CREATE TABLE Reservations ( Code INTEGER, Room TEXT, CheckIn TEXT, CheckOut TEXT, Rate REAL, LastName TEXT, FirstName TEXT, Adults INTEGER, Kids INTEGER ) CREATE TABLE Rooms ( RoomId TEXT, roomName TEXT, beds INTEGER, bedType TEXT, maxOccupancy INTEGER, baseP...
SELECT decor, AVG(basePrice) FROM Rooms GROUP BY decor ORDER BY decor
nvbench
CREATE TABLE PersonFriend ( name varchar(20), friend varchar(20), year INTEGER ) CREATE TABLE Person ( name varchar(20), age INTEGER, city TEXT, gender TEXT, job TEXT ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Draw a bar chart for what i...
SELECT job, AVG(age) FROM Person WHERE gender = 'male' GROUP BY job ORDER BY job
nvbench
CREATE TABLE table_name_24 ( position VARCHAR, pick VARCHAR, college VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What position did the player from Rice College play who was picked under 15?
SELECT position FROM table_name_24 WHERE pick < 15 AND college = "rice"
sql_create_context
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_name varchar ) CREATE TABLE geographic ( city_name varchar, county varchar, reg...
SELECT location.house_number, restaurant.name FROM geographic, location, restaurant WHERE geographic.region = 'bay area' AND restaurant.city_name = geographic.city_name AND restaurant.food_type = 'american' AND restaurant.id = location.restaurant_id AND restaurant.rating = (SELECT MAX(RESTAURANTalias1.rating) FROM geog...
restaurants
CREATE TABLE table_7814 ( "Tournament" text, "Wins" real, "Top-10" real, "Top-25" real, "Events" real, "Cuts made" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the sum of top-10 values for the Open Championship and less than 3 in the t...
SELECT SUM("Top-10") FROM table_7814 WHERE "Tournament" = 'the open championship' AND "Top-25" < '3'
wikisql
CREATE TABLE table_name_2 ( series VARCHAR, season VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Series, when Season is 2007?
SELECT series FROM table_name_2 WHERE season = 2007
sql_create_context
CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDa...
SELECT COUNT(*) FROM CloseAsOffTopicReasonTypes WHERE NOT ApprovalDate IS NULL AND DeactivationDate IS NULL
sede
CREATE TABLE table_22020 ( "Club" text, "Played" text, "Won" text, "Drawn" text, "Lost" text, "Points for" text, "Points against" text, "Tries for" text, "Tries against" text, "Try bonus" text, "Losing bonus" text, "Points" text ) -- Using valid SQLite, answer the follo...
SELECT "Club" FROM table_22020 WHERE "Drawn" = '1' AND "Won" = '2'
wikisql
CREATE TABLE table_1231316_5 ( fastest_time__s_ VARCHAR, nation VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Nigeria had the fastest time once.
SELECT COUNT(fastest_time__s_) FROM table_1231316_5 WHERE nation = "Nigeria"
sql_create_context
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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.age < "24" AND procedures.long_title = "Endoscopic removal of stone(s) from biliary tract"
mimicsql_data
CREATE TABLE table_35497 ( "Player" text, "Position" text, "Overall Pick" real, "Round" text, "NFL Draft" real, "Franchise" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest NFL Draft that has jeff robinson as the player, with a...
SELECT MAX("NFL Draft") FROM table_35497 WHERE "Player" = 'jeff robinson' AND "Overall Pick" < '98'
wikisql
CREATE TABLE table_77984 ( "Player" text, "Position" text, "Round" real, "Pick" real, "NFL Club" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the latest round that Derek Pagel was selected with a pick higher than 50?
SELECT MAX("Round") FROM table_77984 WHERE "Pick" > '50' AND "Player" = 'derek pagel'
wikisql
CREATE TABLE table_name_4 ( date VARCHAR, score VARCHAR, opponents VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Date, when Score is '0-2', and when Opponents is 'Bayer Leverkusen'?
SELECT date FROM table_name_4 WHERE score = "0-2" AND opponents = "bayer leverkusen"
sql_create_context
CREATE TABLE table_name_17 ( d_40 VARCHAR, d_44 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- I want the D 40 with D 44 of d 15
SELECT d_40 FROM table_name_17 WHERE d_44 = "d 15"
sql_create_context
CREATE TABLE table_20680 ( "Dates (MDY)" text, "Position" real, "Gross sales" text, "Tickets sold / available" text, "Sellout (%)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the position of tickets sold/available when the sellout is 82%?...
SELECT COUNT("Tickets sold / available") FROM table_20680 WHERE "Sellout (%)" = '82%'
wikisql
CREATE TABLE table_16713 ( "Rnd" real, "Race" text, "Date" text, "Location" text, "Pole Position" text, "Fastest Lap" text, "Race Winner" text, "Constructor" text, "Report" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what's the po...
SELECT "Pole Position" FROM table_16713 WHERE "Location" = 'Hockenheimring'
wikisql
CREATE TABLE table_4685 ( "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. -- Who is the away team when the home team scores 12...
SELECT "Away team" FROM table_4685 WHERE "Home team score" = '12.20 (92)'
wikisql
CREATE TABLE table_8218 ( "University" text, "Common short form and abbreviation" text, "Location" text, "Enrollment" real, "Athletics nickname" text, "School Colors" text, "Founded" text, "Student newspaper" text ) -- Using valid SQLite, answer the following questions for the tables p...
SELECT "School Colors" FROM table_8218 WHERE "Enrollment" > '15,664' AND "Founded" = '1910' AND "Location" = 'bowling green'
wikisql
CREATE TABLE table_name_1 ( tournament VARCHAR, margin_of_victory VARCHAR, winning_score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What tournament had a victory of a 1 stroke margin and the final winning score 69-75-71-70?
SELECT tournament FROM table_name_1 WHERE margin_of_victory = "1 stroke" AND winning_score = "69-75-71-70"
sql_create_context
CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDispl...
SELECT Id AS "post_link" FROM Posts WHERE Body LIKE '%<code>%' AND OwnerUserId = @UserID ORDER BY CreationDate DESC
sede
CREATE TABLE table_42301 ( "Aces" real, "Player" text, "Opponent" text, "Year" real, "Event" text, "Sets" real, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what's the earliest year that serena williams had more than 2 sets?
SELECT MIN("Year") FROM table_42301 WHERE "Player" = 'serena williams' AND "Sets" > '2'
wikisql
CREATE TABLE table_27387 ( "Language" text, "Quillacollo Municipality" real, "Sipe Sipe Municipality" real, "Tiquipaya Municipality" real, "Vinto Municipality" real, "Colcapirhua Municipality" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What ...
SELECT MIN("Sipe Sipe Municipality") FROM table_27387 WHERE "Language" = 'Quechua'
wikisql
CREATE TABLE table_472 ( "Year" text, "Champion" text, "Country" text, "Score" text, "Tournament location" text, "Purse ($)" real, "Winners share ($)" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the winners Share ($) in the year 2...
SELECT MIN("Winners share ($)") FROM table_472 WHERE "Year" = '2004'
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 outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, ...
SELECT microbiologyevents.charttime FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 29635 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1) ORDER BY microbiologyevents.charttime DESC LIMIT 1
mimic_iii
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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.diagnosis = "INFECTED RIGHT THIGH GRAFT" AND procedures.short_title = "Coronar arteriogr-1 cath"
mimicsql_data
CREATE TABLE table_204_232 ( 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. -- which country scored the least medals ?
SELECT "nation" FROM table_204_232 WHERE "total" = (SELECT MIN("total") FROM table_204_232)
squall
CREATE TABLE table_15743 ( "Discipline" text, "2003 Cadiz" text, "2007 Cascais" text, "2011 Perth" text, "2014 Santander" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Discipline has a 2007 laser radial Cascais ?
SELECT "Discipline" FROM table_15743 WHERE "2007 Cascais" = 'laser radial'
wikisql
CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC text, RYBH text, XBDM number, XBMC text, XLDM text, XLMC text, XM text, ZYLBDM text, ZYMC text ) CREATE TABLE mzjzjlb ( HXPLC number, HZXM ...
SELECT COUNT(person_info.RYBH) FROM hz_info JOIN mzjzjlb 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 person_info_hz_info.KH = hz_info.KH AND person_info_hz_info.KLX = hz_info.KLX AND person_info_hz_info.YLJGDM = hz_info.YLJGD...
css
CREATE TABLE table_78974 ( "Lexton Plains" text, "Wins" real, "Byes" real, "Losses" real, "Draws" real, "Against" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What team has fewer than 9 wins and less than 1593 against?
SELECT "Lexton Plains" FROM table_78974 WHERE "Wins" < '9' AND "Against" < '1593'
wikisql
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic (...
SELECT procedures.icd9_code FROM procedures WHERE procedures.subject_id = "10317"
mimicsql_data
CREATE TABLE table_53115 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Decision" text, "Attendance" real, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the Lightning's record at their home game against Carolin...
SELECT "Record" FROM table_53115 WHERE "Decision" = 'holmqvist' AND "Attendance" > '16,526' AND "Visitor" = 'carolina'
wikisql
CREATE TABLE table_name_45 ( winning_driver VARCHAR, round VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Winning Driver has a Round of 9?
SELECT winning_driver FROM table_name_45 WHERE round = 9
sql_create_context
CREATE TABLE table_25773116_2 ( location VARCHAR, round VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where was the round 1 race?
SELECT location FROM table_25773116_2 WHERE round = 1
sql_create_context