instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_23583 ( "Title" text, "Author" text, "Reader" text, "Format" text, "Company" text, "Release Date" text, "Notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many formats of books authored by day, martin martin day
SELECT COUNT("Format") FROM table_23583 WHERE "Author" = 'Day, Martin Martin Day'
wikisql
CREATE TABLE table_train_242 ( "id" int, "macroalbuminuria" bool, "hyperlipidemia" bool, "fasting_serum_triglycerides" int, "fasting_ldl_cholesterol" int, "panel_reactive_antibodies" int, "serum_creatinine" float, "albumin" float, "body_mass_index_bmi" float, "fasting_serum_chole...
SELECT * FROM table_train_242 WHERE hyperlipidemia = 1 OR (fasting_serum_triglycerides > 200 OR fasting_serum_cholesterol > 240 OR fasting_ldl_cholesterol > 140)
criteria2sql
CREATE TABLE table_26210 ( "Outcome" text, "Year" real, "Championship" text, "Partnering" text, "Opponents in Final" text, "Score in Final" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the score in the final in 1988?
SELECT "Score in Final" FROM table_26210 WHERE "Year" = '1988'
wikisql
CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversa...
SELECT Id FROM PostHistory
sede
CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW text, JCZBJGDX text, JCZBMC text, JLDW text, JYRQ time, JYZBLSH text, ...
SELECT zzmzjzjlb.JZLSH FROM person_info JOIN hz_info JOIN zzmzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX WHERE person_info.XM = '奚星光' AND NOT zzmzjzjlb.JZLSH IN (SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ <= '2006-11-1...
css
CREATE TABLE table_25744 ( "Outcome" text, "Year" real, "Championship" text, "Surface" text, "Opponent in the final" text, "Score in the final" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the score in the final when Mats Wilander was...
SELECT "Score in the final" FROM table_25744 WHERE "Championship" = 'Australian Open' AND "Opponent in the final" = 'Mats Wilander'
wikisql
CREATE TABLE table_name_55 ( pick INTEGER, new_team VARCHAR, round VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the biggest pick number for the new team of Texas Rangers, in the compensation-a round?
SELECT MAX(pick) FROM table_name_55 WHERE new_team = "texas rangers" AND round = "compensation-a"
sql_create_context
CREATE TABLE table_name_98 ( country VARCHAR, film VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which country made Le Portefeuille?
SELECT country FROM table_name_98 WHERE film = "le portefeuille"
sql_create_context
CREATE TABLE table_45248 ( "Name" text, "Pinnacle height" text, "Structure type" text, "Main use" text, "Country" text, "Town" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What type of structure is there at the American Tower Christmas?
SELECT "Structure type" FROM table_45248 WHERE "Name" = 'american tower christmas'
wikisql
CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, COM_PAY number, DATA_ID text, ENT_ACC_PAY number, ENT_PAY number, F...
SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_ID = '19242256' AND NOT t_kc22.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT < 3101.15)
css
CREATE TABLE table_50279 ( "Type" text, "Name" text, "Title" text, "Royal house" text, "From" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What title was used in 1911 bc?
SELECT "Title" FROM table_50279 WHERE "From" = '1911 bc'
wikisql
CREATE TABLE table_40524 ( "Match No." text, "Home Team" text, "Score" text, "Away Team" text, "Attendance" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the away team of match 9?
SELECT "Away Team" FROM table_40524 WHERE "Match No." = '9'
wikisql
CREATE TABLE table_name_75 ( attendance INTEGER, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many Attendances on may 24?
SELECT MIN(attendance) FROM table_name_75 WHERE date = "may 24"
sql_create_context
CREATE TABLE table_48628 ( "Team" text, "Head coach" text, "Team captain" text, "Kitmaker" text, "Shirt sponsor" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the shirt sponsor of the team Andreas Wolf is the captain of?
SELECT "Shirt sponsor" FROM table_48628 WHERE "Team captain" = 'andreas wolf'
wikisql
CREATE TABLE table_22128871_1 ( english_title VARCHAR, result VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is every English title for the result of nominee?
SELECT english_title FROM table_22128871_1 WHERE result = "Nominee"
sql_create_context
CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID ...
SELECT HIRE_DATE, COMMISSION_PCT FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY HIRE_DATE DESC
nvbench
CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE ReviewTas...
SELECT TIME_TO_STR(CreationDate, '%W'), SUM(CASE WHEN AnswerCount > 0 THEN 1 ELSE 0 END) AS Answered, COUNT(Posts.Id) AS Total, CAST(SUM(CASE WHEN AnswerCount > 0 THEN 1 ELSE 0 END) AS FLOAT) / COUNT(Posts.Id) AS Ratio FROM Posts WHERE (PostTypeId = 1 AND CreationDate >= '##Date1##' AND CreationDate <= '##Date2##') GRO...
sede
CREATE TABLE player_college ( player_id VARCHAR, college_id VARCHAR ) CREATE TABLE player ( height INTEGER, player_id VARCHAR ) CREATE TABLE college ( college_id VARCHAR, name_full VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the ...
SELECT AVG(T1.height) FROM player AS T1 JOIN player_college AS T2 ON T1.player_id = T2.player_id JOIN college AS T3 ON T3.college_id = T2.college_id WHERE T3.name_full = 'Yale University'
sql_create_context
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 COUNT(*) > 0 FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '008-46802')) AND vitalperiodic.sao2 BETWEEN sao2_lower AND sao2_uppe...
eicu
CREATE TABLE table_name_68 ( score VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Score, when Player is 'Brad Faxon'?
SELECT score FROM table_name_68 WHERE player = "brad faxon"
sql_create_context
CREATE TABLE table_name_52 ( round INTEGER, pick__number VARCHAR, position VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Round is the average one that has a Pick # larger than 26, and a Position of defensive back?
SELECT AVG(round) FROM table_name_52 WHERE pick__number > 26 AND position = "defensive back"
sql_create_context
CREATE TABLE table_name_7 ( points VARCHAR, performer VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Points has a Performer of rob burke band?
SELECT COUNT(points) FROM table_name_7 WHERE performer = "rob burke band"
sql_create_context
CREATE TABLE days ( days_code varchar, day_name varchar ) CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_fli...
SELECT DISTINCT flight.flight_id FROM airport, airport_service, city, flight WHERE airport.airport_code = 'DAL' AND city.city_code = airport_service.city_code AND flight.from_airport = airport_service.airport_code AND flight.to_airport = airport.airport_code
atis
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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Private" AND procedures.long_title = "Other diagnostic procedures on nasal sinuses"
mimicsql_data
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 t_kc24.MED_CLINIC_ID, t_kc24.t_kc21_PERSON_ID, t_kc24.t_kc21_PERSON_NM, t_kc24.t_kc21_IDENTITY_CARD, t_kc24.t_kc21_PERSON_SEX, t_kc24.t_kc21_PERSON_AGE FROM t_kc24 WHERE t_kc24.MED_AMOUT = (SELECT t_kc24.MED_AMOUT FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID = '37228773011')
css
CREATE TABLE table_203_345 ( id number, "name" text, "party" text, "took office" number, "left office" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the number of conservative representatives listed ?
SELECT COUNT("name") FROM table_203_345 WHERE "party" = 'conservative'
squall
CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE flight_stop ( flight_id int, stop_number int, stop_days text, stop_airport text, arrival_time int, arrival_airline text, arrival_flight_number int, departure_time int, departure_airline...
SELECT DISTINCT airport.airport_code FROM airport, airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1 WHERE AIRPORT_SERVICE_1.miles_distant = (SELECT MIN(AIRPORT_SERVICEalias2.miles_distant) FROM airport_service AS AIRPORT_SERVICEalias2, city AS CITYalias2 WHERE C...
atis
CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime tim...
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', icustays.intime)) FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 94229) AND icustays.outtime IS NULL
mimic_iii
CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABL...
SELECT admissions.insurance FROM admissions WHERE admissions.subject_id = 1903 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1
mimic_iii
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE diagnoses_icd ( ...
SELECT admissions.admittime FROM admissions WHERE admissions.subject_id = 55700 AND admissions.admission_location = 'clinic referral/premature' AND DATETIME(admissions.admittime) >= DATETIME(CURRENT_TIME(), '-4 year') ORDER BY admissions.admittime LIMIT 1
mimic_iii
CREATE TABLE status ( station_id INTEGER, bikes_available INTEGER, docks_available INTEGER, time TEXT ) CREATE TABLE station ( id INTEGER, name TEXT, lat NUMERIC, long NUMERIC, dock_count INTEGER, city TEXT, installation_date TEXT ) CREATE TABLE trip ( id INTEGER, d...
SELECT long, AVG(T2.duration) FROM station AS T1 JOIN trip AS T2 ON T1.id = T2.start_station_id GROUP BY T2.start_station_id
nvbench
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_kc21.IN_DIAG_DIS_CD, t_kc21.IN_DIAG_DIS_NM FROM t_kc21 WHERE t_kc21.PERSON_ID = '73506592' AND t_kc21.MED_CLINIC_ID IN (SELECT t_kc21_t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT > 2109.01)
css
CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE instructor ( instructor_id int, name varchar, uniqname varchar ) CREATE TABLE semester ( semester_id int, semester varchar, year int )...
SELECT DISTINCT program.name FROM course INNER JOIN program_course ON program_course.course_id = course.course_id INNER JOIN program ON program.program_id = program_course.program_id WHERE course.department = 'STRATEGY' AND course.number = 411
advising
CREATE TABLE table_1818471_1 ( afinsa VARCHAR, value VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many different numbers for Afinsa when value is 5p?
SELECT COUNT(afinsa) FROM table_1818471_1 WHERE value = "5P"
sql_create_context
CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE student ( student_id int, lastname varchar, firstname varchar, program_id int, declare_major varchar, total_credit int, total_gpa float, entered_as ...
SELECT DISTINCT instructor.name FROM instructor INNER JOIN offering_instructor ON offering_instructor.instructor_id = instructor.instructor_id INNER JOIN course_offering ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN course ON course.course_id = course_offering.course_id WHERE course.name L...
advising
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT demographic.gender, demographic.days_stay FROM demographic WHERE demographic.subject_id = "990"
mimicsql_data
CREATE TABLE table_20166 ( "No. in series" text, "No. in season" text, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "U.S. viewers (million)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name who wrote the ...
SELECT "Written by" FROM table_20166 WHERE "No. in season" = '11'
wikisql
CREATE TABLE table_14613 ( "Year" text, "Start" text, "Qual" text, "Rank" text, "Finish" text, "Laps" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many laps did Duke Nelson complete when his qualifying time was 122.951?
SELECT SUM("Laps") FROM table_14613 WHERE "Qual" = '122.951'
wikisql
CREATE TABLE table_76326 ( "Episode" text, "First broadcast" text, "Graeme's guest" text, "Jeremy's guest" text, "Votes (%)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Episode, when Jeremy's Guest is 'Pauline McLynn'?
SELECT "Episode" FROM table_76326 WHERE "Jeremy's guest" = 'pauline mclynn'
wikisql
CREATE TABLE table_name_2 ( population__2007_ VARCHAR, population__2010_ INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- WHAT IS THE POPULATION OF 2007 WHEN 2010 POPULATION WAS SMALLER THAN 1282?
SELECT COUNT(population__2007_) FROM table_name_2 WHERE population__2010_ < 1282
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, Revenue FROM Manufacturers ORDER BY Revenue DESC
nvbench
CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE admissions ( row_id number, subject_id number, ...
SELECT (SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 366 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.lab...
mimic_iii
CREATE TABLE city ( city_id number, county_id number, name text, white number, black number, amerindian number, asian number, multiracial number, hispanic number ) CREATE TABLE county_public_safety ( county_id number, name text, population number, police_officers num...
SELECT MIN(crime_rate), MAX(crime_rate) FROM county_public_safety
spider
CREATE TABLE table_name_43 ( team_1 VARCHAR, team_2 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the team 1 with team 2 Mount Cameroon FC?
SELECT team_1 FROM table_name_43 WHERE team_2 = "mount cameroon fc"
sql_create_context
CREATE TABLE table_name_43 ( crowd VARCHAR, away_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many people were in the crowd when Carlton was the away team?
SELECT COUNT(crowd) FROM table_name_43 WHERE away_team = "carlton"
sql_create_context
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE lab ( labid number, pa...
SELECT (SELECT lab.labresult FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '021-25408' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospi...
eicu
CREATE TABLE student ( fname VARCHAR, city_code VARCHAR, age VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Find the first name of students living in city PHL whose age is between 20 and 25.
SELECT fname FROM student WHERE city_code = 'PHL' AND age BETWEEN 20 AND 25
sql_create_context
CREATE TABLE table_65466 ( "Model" text, "Years" text, "Type/code" text, "Power@rpm" text, "Torque@rpm" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name Model which has a Years of 2006 2008 and a Torque@rpm of n m (lb ft) @1900 3500?
SELECT "Model" FROM table_65466 WHERE "Years" = '2006–2008' AND "Torque@rpm" = 'n·m (lb·ft) @1900–3500'
wikisql
CREATE TABLE diagnoses ( 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 procedures ( ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND procedures.short_title = "Opn rt hemicolectomy NEC"
mimicsql_data
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE mzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH text, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH te...
SELECT jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN jybgb_jyjgzbb ON mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jybgb_jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH AND jybgb_jyjgzbb.JYZBLSH = jyjgzbb.JYZBLSH AND jybgb_jyjgzbb.jyjgzbb_id ...
css
CREATE TABLE table_70274 ( "Episode #" real, "Title" text, "Airdate" text, "Viewers (millions)" real, "Channel 4 weekly rank a" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average Channel 4 weekly rank for less than 2.19 million viewe...
SELECT AVG("Channel 4 weekly rank a") FROM table_70274 WHERE "Viewers (millions)" < '2.19' AND "Airdate" = 'december 7, 2007'
wikisql
CREATE TABLE table_name_56 ( planet VARCHAR, radial_velocity__m_s_ INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What type of planet has a radial velocity of 45.2 m/s?
SELECT planet AS Type FROM table_name_56 WHERE radial_velocity__m_s_ > 45.2
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 WHERE demographic.admission_location = "** INFO NOT AVAILABLE **"
mimicsql_data
CREATE TABLE table_19753079_41 ( party VARCHAR, candidates VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When mark critz (d) 50.8% tim burns (r) 49.2% are the candidates what is the party?
SELECT party FROM table_19753079_41 WHERE candidates = "Mark Critz (D) 50.8% Tim Burns (R) 49.2%"
sql_create_context
CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense text ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswer...
SELECT num.TagName AS Tag, ROW_NUMBER() OVER (ORDER BY rate.Rate DESC) AS MayRank, ROW_NUMBER() OVER (ORDER BY num.Num DESC) AS TotalRank, rate.Rate AS Questions14, num.Num AS QuestionsTotal FROM (SELECT COUNT(PostId) AS Rate, TagName FROM Tags, PostTags, Posts WHERE Tags.Id = PostTags.TagId AND Posts.Id = PostId AND P...
sede
CREATE TABLE table_24325 ( "Season" real, "Episode" real, "Episode Summary" text, "Premier date" text, "External Link" text, "Coach" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the number of external links with a coach named Katie Kan...
SELECT COUNT("External Link") FROM table_24325 WHERE "Coach" = 'Katie Kansas'
wikisql
CREATE TABLE table_80265 ( "Year" real, "Entrant" text, "Chassis" text, "Engine" text, "Pts." text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which entrant has 4 points and BRM p25 for the Chassis?
SELECT "Entrant" FROM table_80265 WHERE "Pts." = '4' AND "Chassis" = 'brm p25'
wikisql
CREATE TABLE table_name_94 ( state VARCHAR, title VARCHAR, royal_house VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What state had a title of duke for the royal house of ji?
SELECT state FROM table_name_94 WHERE title = "duke" AND royal_house = "ji"
sql_create_context
CREATE TABLE table_16370 ( "No. in series" real, "No. in season" real, "Title" text, "Director" text, "Writer(s)" text, "Original air date" text, "Production code" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the number of the episo...
SELECT MAX("No. in series") FROM table_16370 WHERE "Title" = 'Melrose Unglued'
wikisql
CREATE TABLE paperfield ( fieldid int, paperid int ) CREATE TABLE field ( fieldid int ) CREATE TABLE venue ( venueid int, venuename varchar ) CREATE TABLE writes ( paperid int, authorid int ) CREATE TABLE cite ( citingpaperid int, citedpaperid int ) CREATE TABLE paper ( pape...
SELECT DISTINCT COUNT(1), paper.venueid FROM author, paper, writes WHERE author.authorname = 'Luke Zettlemoyer' AND writes.authorid = author.authorid AND writes.paperid = paper.paperid GROUP BY paper.venueid ORDER BY COUNT(1) DESC
scholar
CREATE TABLE table_name_57 ( total VARCHAR, year_s__won VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In 1997, what was the final total?
SELECT total FROM table_name_57 WHERE year_s__won = "1997"
sql_create_context
CREATE TABLE WINE ( Name VARCHAR, Grape VARCHAR, price VARCHAR ) CREATE TABLE Grapes ( Grape VARCHAR, Color VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the wines that have prices higher than 50 and made of Red color grapes?
SELECT T2.Name FROM Grapes AS T1 JOIN WINE AS T2 ON T1.Grape = T2.Grape WHERE T1.Color = "Red" AND T2.price > 50
sql_create_context
CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location text, insurance text, language text, marital_status text, ethnicity text, age number ) CREATE ...
SELECT d_items.label FROM d_items WHERE d_items.itemid IN (SELECT inputevents_cv.itemid FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 7165)) ORDER BY inputevents_cv.chart...
mimic_iii
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND diagnoses.long_title = "Personal history of malignant neoplasm of rectum, rectosigmoid junction, and anus"
mimicsql_data
CREATE TABLE table_74124 ( "Game" real, "December" real, "Opponent" text, "Score" text, "Decision" text, "Location/Attendance" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the score for 29 game
SELECT "Score" FROM table_74124 WHERE "Game" = '29'
wikisql
CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABL...
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', admissions.admittime)) FROM admissions WHERE admissions.subject_id = 15447 AND admissions.dischtime IS NULL
mimic_iii
CREATE TABLE table_name_32 ( location_attendance VARCHAR, game INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Location Attendance has a Game larger than 5?
SELECT location_attendance FROM table_name_32 WHERE game > 5
sql_create_context
CREATE TABLE table_19210674_1 ( finale VARCHAR, rank VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the finale number ranked at number 7?
SELECT finale FROM table_19210674_1 WHERE rank = 7
sql_create_context
CREATE TABLE table_200_12 ( id number, "year" text, "award" text, "category" text, "nominated work" text, "result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what year was prime suspects nominated for the bafta tv award ?
SELECT "year" FROM table_200_12 WHERE "nominated work" = 'prime suspect' AND "award" = 'bafta tv award'
squall
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 WHERE demographic.diagnosis = "VENTRICULAR TACHYCARDIA" AND demographic.age < "70"
mimicsql_data
CREATE TABLE table_29583441_1 ( original_air_date VARCHAR, directed_by VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What date did the episode that was directed by Christian i. nyby ii originally air on?
SELECT original_air_date FROM table_29583441_1 WHERE directed_by = "Christian I. Nyby II"
sql_create_context
CREATE TABLE table_76095 ( "Week of" text, "Tier" text, "Winner" text, "Runner-up" text, "Semi finalists" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the winner in the week listed as 26 June 2 weeks, when the runner-up is Arantxa S nchez V...
SELECT "Winner" FROM table_76095 WHERE "Week of" = '26 june 2 weeks' AND "Runner-up" = 'arantxa sánchez vicario'
wikisql
CREATE TABLE table_name_20 ( album VARCHAR, remixed_by VARCHAR, version VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which album is the royal g's club mix version, which is remixed by royal garden sound, from?
SELECT album FROM table_name_20 WHERE remixed_by = "royal garden sound" AND version = "royal g's club mix"
sql_create_context
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 vitalperiodic.sao2 FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '028-7951')) AND NOT vitalperiodic.sao2 IS NULL AND DATETIME(vi...
eicu
CREATE TABLE table_60094 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Results" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Republican District had Incumbent First Elected in 2000 then Re-elected?
SELECT "District" FROM table_60094 WHERE "Party" = 'republican' AND "Results" = 're-elected' AND "First elected" = '2000'
wikisql
CREATE TABLE table_name_6 ( to_par VARCHAR, place VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the To Par that has Tommy Bolt with a Place of t6?
SELECT to_par FROM table_name_6 WHERE place = "t6" AND player = "tommy bolt"
sql_create_context
CREATE TABLE table_68480 ( "Year" real, "Entrant" text, "Chassis" text, "Engine" text, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the total number of years for talbot-lago t26c and points less than 3
SELECT COUNT("Year") FROM table_68480 WHERE "Chassis" = 'talbot-lago t26c' AND "Points" < '3'
wikisql
CREATE TABLE table_name_79 ( opponent VARCHAR, game_site VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the opponent on the game that will be played at metropolitan stadium?
SELECT opponent FROM table_name_79 WHERE game_site = "metropolitan stadium"
sql_create_context
CREATE TABLE table_24113 ( "Game" real, "Date" text, "Opponent" text, "Result" text, "Black Knights points" real, "Opponents" real, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the most game
SELECT MAX("Game") FROM table_24113
wikisql
CREATE TABLE ftxmzjzjlb ( 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.JCRGH, jyjgzbb.JCRXM FROM person_info JOIN hz_info JOIN txmzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX AND txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZ...
css
CREATE TABLE table_1456056_1 ( country VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the minimum for 2500-3000 ft for scotland
SELECT MIN(2500 AS _3000ft) FROM table_1456056_1 WHERE country = "Scotland"
sql_create_context
CREATE TABLE table_204_448 ( id number, "team" text, "winners" number, "runners-up" number, "years won" text, "years runner-up" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many teams have been winners at least 5 times ?
SELECT COUNT("team") FROM table_204_448 WHERE "winners" >= 5
squall
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, ...
SELECT admissions.age FROM admissions WHERE admissions.subject_id = 15945 AND admissions.dischtime IS NULL
mimic_iii
CREATE TABLE table_name_13 ( player VARCHAR, school_club_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the player that played for the school/club team Maryland?
SELECT player FROM table_name_13 WHERE school_club_team = "maryland"
sql_create_context
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE outputevents ( row_id number, subject_id number, ...
SELECT COUNT(DISTINCT admissions.hadm_id) FROM admissions WHERE admissions.subject_id = 808 AND STRFTIME('%y', admissions.admittime) >= '2102'
mimic_iii
CREATE TABLE COURSE ( CRS_CODE varchar(10), DEPT_CODE varchar(10), CRS_DESCRIPTION varchar(35), CRS_CREDIT float(8) ) CREATE TABLE CLASS ( CLASS_CODE varchar(5), CRS_CODE varchar(10), CLASS_SECTION varchar(2), CLASS_TIME varchar(20), CLASS_ROOM varchar(8), PROF_NUM int ) CREATE...
SELECT CRS_DESCRIPTION, COUNT(CRS_DESCRIPTION) FROM CLASS AS T1 JOIN EMPLOYEE AS T2 ON T1.PROF_NUM = T2.EMP_NUM JOIN COURSE AS T3 ON T1.CRS_CODE = T3.CRS_CODE JOIN PROFESSOR AS T4 ON T2.EMP_NUM = T4.EMP_NUM GROUP BY CRS_DESCRIPTION ORDER BY COUNT(CRS_DESCRIPTION) DESC
nvbench
CREATE TABLE zyb ( CLINIC_ID text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, INSU_TYPE text, IN...
SELECT qtb.IN_DIAG_DIS_CD, qtb.IN_DIAG_DIS_NM FROM qtb WHERE qtb.PERSON_NM = '秦芳华' AND qtb.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT > 6792.26) UNION SELECT gyb.IN_DIAG_DIS_CD, gyb.IN_DIAG_DIS_NM FROM gyb WHERE gyb.PERSON_NM = '秦芳华' AND gyb.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLIN...
css
CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW text, JCZBJGDX text, JCZBMC text, JLDW text, JYRQ time, JYZBLSH text, ...
SELECT COUNT(*) FROM (SELECT zyjybgb.KSBM FROM mzjzjlb JOIN zyjybgb ON mzjzjlb.YLJGDM = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB WHERE mzjzjlb.YLJGDM = '4198073' AND zyjybgb.BGRQ BETWEEN '2005-01-17' AND '2012-01-10' GROUP BY zyjybgb.KSBM HAVING COUNT(*) <= 30 UNION SELECT mzjybgb.KSBM FROM mzjz...
css
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 d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE proce...
SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'emtriva' AND DATETIME(prescriptions.startdate) >= DATETIME(CURREN...
mimic_iii
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 SUM(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.PERSON_ID = '50121099' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2002-04-06' AND '2006-03-31'
css
CREATE TABLE table_name_73 ( win__percentage VARCHAR, name VARCHAR, wins VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Win % has a Name of tony rice, and Wins smaller than 28?
SELECT COUNT(win__percentage) FROM table_name_73 WHERE name = "tony rice" AND wins < 28
sql_create_context
CREATE TABLE table_342 ( "Number Range" text, "Introduced" text, "Builder" text, "Engine" text, "Weight (long tons)" text, "Seats" text, "Withdrawn" text, "Notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what's the engine where num...
SELECT "Engine" FROM table_342 WHERE "Number Range" = '8–9, 13–16'
wikisql
CREATE TABLE table_1318 ( "Episode" real, "Title" text, "Story" text, "Adapted by" text, "Director" text, "Airdate" text, "Exists?" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the msot episode that was adapted by leon griffiths
SELECT MAX("Episode") FROM table_1318 WHERE "Adapted by" = 'Leon Griffiths'
wikisql
CREATE TABLE table_17751942_4 ( final_win__percentage VARCHAR, team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the final win percentage of the Sault Ste. Marie Greyhounds?
SELECT final_win__percentage FROM table_17751942_4 WHERE team = "Sault Ste. Marie Greyhounds"
sql_create_context
CREATE TABLE table_name_97 ( points INTEGER, goals_conceded VARCHAR, goals_scored VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the average points when goals conceded is 14 and goals scored is less than 32?
SELECT AVG(points) FROM table_name_97 WHERE goals_conceded = 14 AND goals_scored < 32
sql_create_context
CREATE TABLE table_123462_2 ( election VARCHAR, _number_of_seats_won VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What year was the election when the # of seats won was 65?
SELECT election FROM table_123462_2 WHERE _number_of_seats_won = 65
sql_create_context
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE hz_info_zyjzjlb ( JZLSH number, YLJGDM number, zyjzjlb_id number ) CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, ...
SELECT zyjzjlb.ZYZYZDZZBM, zyjzjlb.ZYZYZDZZMC FROM zyjzjlb WHERE zyjzjlb.JZLSH = '41737510564'
css
CREATE TABLE artist ( artist_name varchar2(50), country varchar2(20), gender varchar2(20), preferred_genre varchar2(50) ) CREATE TABLE files ( f_id number(10), artist_name varchar2(50), file_size varchar2(20), duration varchar2(20), formats varchar2(20) ) CREATE TABLE genre ( g...
SELECT genre_is, MIN(T2.rating) FROM files AS T1 JOIN song AS T2 ON T1.f_id = T2.f_id GROUP BY genre_is ORDER BY T2.genre_is
nvbench
CREATE TABLE useracct ( name VARCHAR, u_id VARCHAR ) CREATE TABLE trust ( target_u_id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Find the name of the target user with the lowest trust score.
SELECT T1.name FROM useracct AS T1 JOIN trust AS T2 ON T1.u_id = T2.target_u_id ORDER BY trust LIMIT 1
sql_create_context
CREATE TABLE table_19278 ( "Player" text, "Position" text, "Starter" text, "Touchdowns" real, "Extra points" real, "Field goals" real, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many points did the player who was right guard...
SELECT COUNT("Points") FROM table_19278 WHERE "Position" = 'Right guard'
wikisql