instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_name_46 ( game INTEGER, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Game # that scored 87-92?
SELECT SUM(game) FROM table_name_46 WHERE score = "87-92"
sql_create_context
CREATE TABLE table_name_8 ( goal_difference INTEGER, club VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average goal difference using slavia sofia club?
SELECT AVG(goal_difference) FROM table_name_8 WHERE club = "slavia sofia"
sql_create_context
CREATE TABLE table_name_92 ( rank_in_sp INTEGER, rank_in_fs VARCHAR, final_rank VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average SP rank for skaters with a Rank in FS larger than 2, and a Final Rank larger than 5?
SELECT AVG(rank_in_sp) FROM table_name_92 WHERE rank_in_fs > 2 AND final_rank > 5
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 demographic.admittime, diagnoses.short_title FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.subject_id = "98220"
mimicsql_data
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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.marital_status = "DIVORCED" AND diagnoses.long_title = "Pressure ulcer, stage I"
mimicsql_data
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescription...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "SIGMOID DIVERTICULITIS, COLOVESTICAL FISTULA/SDA" AND demographic.days_stay > "2"
mimicsql_data
CREATE TABLE Accounts ( customer_id VARCHAR ) CREATE TABLE Customers ( customer_id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Show the number of all customers without an account.
SELECT COUNT(*) FROM Customers WHERE NOT customer_id IN (SELECT customer_id FROM Accounts)
sql_create_context
CREATE TABLE table_name_15 ( fa_cup INTEGER, player VARCHAR, fa_trophy VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average FA Cup that has gary jones as the player, and an FA trophy greater than 5?
SELECT AVG(fa_cup) FROM table_name_15 WHERE player = "gary jones" AND fa_trophy > 5
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 COUNT(*) FROM t_kc21 WHERE PERSON_NM = '秦慧月' AND CLINIC_TYPE = '住院' AND MOD(MED_AMOUT, 1) = 0
css
CREATE TABLE table_name_87 ( silver INTEGER, total VARCHAR, bronze VARCHAR, nation VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average amount of silver medals Montenegro, who has less than 15 bronze and more than 11 total medals, has?
SELECT AVG(silver) FROM table_name_87 WHERE bronze < 15 AND nation = "montenegro" AND total > 11
sql_create_context
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) 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, ...
SELECT jyjgzbb.JCFF FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE hz_in...
css
CREATE TABLE table_25615 ( "date (dd.mm.yyyy)" text, "Tail number" text, "Location" text, "Fatalities" text, "Brief description" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many different brief descriptions are there for crashes with 0/161 fa...
SELECT COUNT("Brief description") FROM table_25615 WHERE "Fatalities" = '0/161'
wikisql
CREATE TABLE table_name_38 ( pick VARCHAR, school VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What pick did Clemson choose?
SELECT pick FROM table_name_38 WHERE school = "clemson"
sql_create_context
CREATE TABLE table_1165048_1 ( win_loss VARCHAR, season VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what are all the win/loss where season is 2009
SELECT win_loss FROM table_1165048_1 WHERE season = 2009
sql_create_context
CREATE TABLE table_name_96 ( crowd VARCHAR, home_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How big was the crowd when Geelong was the home team?
SELECT COUNT(crowd) FROM table_name_96 WHERE home_team = "geelong"
sql_create_context
CREATE TABLE table_58066 ( "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 is the lowest crowd at kardinia park
SELECT MIN("Crowd") FROM table_58066 WHERE "Venue" = 'kardinia park'
wikisql
CREATE TABLE table_28489 ( "Institution" text, "Nickname" text, "Location (Population)" text, "Founded" real, "Type" text, "Undergraduate Enrollment" real, "Joined" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When 9386 is the undergraduat...
SELECT "Nickname" FROM table_28489 WHERE "Undergraduate Enrollment" = '9386'
wikisql
CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) CREATE TABLE student_record ( student_id int, course_id int, semester int, grade varchar, how varchar, transfer_source varchar, earn_credit varchar, repeat_term varchar, test...
SELECT DISTINCT instructor.name FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN offering_instructor ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN instructor ON offering_instructor.instructor_id = instructor.instructor_id INNER JOIN semester...
advising
CREATE TABLE table_53956 ( "Rank" text, "Name" text, "Headquarters" text, "Revenue (Mil.\u20ac)" text, "Profit (Mil.\u20ac)" text, "Employees (World)" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which HQ is associated with a number of employe...
SELECT "Headquarters" FROM table_53956 WHERE "Employees (World)" = '100'
wikisql
CREATE TABLE table_203_74 ( id number, "rank" number, "urban area" text, "population\n(2001 census)" number, "area (km2)" number, "density (people/km2)" number, "major subdivisions" text, "metropolitan area" text ) -- Using valid SQLite, answer the following questions for the tables pr...
SELECT "urban area" FROM table_203_74 ORDER BY "density (people/km2)" DESC LIMIT 1
squall
CREATE TABLE table_name_45 ( attendance VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many people attended the match on 1/11?
SELECT attendance FROM table_name_45 WHERE date = "1/11"
sql_create_context
CREATE TABLE table_61873 ( "Club" text, "Played" 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 following questions f...
SELECT "Points for" FROM table_61873 WHERE "Club" = 'tycroes rfc'
wikisql
CREATE TABLE table_53852 ( "Rank" real, "Date" text, "Stadium" text, "Opponent" text, "Competition" text, "Score Scotland's score is shown first." text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was Scotland's score at the rank 3 Competition...
SELECT "Score Scotland's score is shown first." FROM table_53852 WHERE "Competition" = 'bhc' AND "Rank" = '3'
wikisql
CREATE TABLE station ( id INTEGER, name TEXT, lat NUMERIC, long NUMERIC, dock_count INTEGER, city TEXT, installation_date TEXT ) CREATE TABLE weather ( date TEXT, max_temperature_f INTEGER, mean_temperature_f INTEGER, min_temperature_f INTEGER, max_dew_point_f INTEGER, ...
SELECT start_station_name, start_station_id FROM trip ORDER BY start_station_name DESC
nvbench
CREATE TABLE mzjybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH number, BGJGDM text, BGJGMC text, BGRGH text, BGRQ time, BGRXM text, BGSJ time, CJRQ time, JSBBRQSJ time, JSBBSJ time, JYBBH text, JYJGMC text, JYJSGH text, JYJSQM text, ...
SELECT jyjgzbb.JCZBMC, jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM zyjybgb JOIN jyjgzbb ON zyjybgb.YLJGDM = jyjgzbb.YLJGDM AND zyjybgb.BGDH = jyjgzbb.BGDH WHERE zyjybgb.JZLSH = '06900614343' AND jyjgzbb.JCRXM LIKE '邹%' UNION SELECT jyjgzbb.JCZBMC, jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM mzjybgb JOIN jyjgzbb ON mzjybgb.YLJG...
css
CREATE TABLE table_1341865_20 ( incumbent VARCHAR, district VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the winner in the Louisiana 7 district?
SELECT incumbent FROM table_1341865_20 WHERE district = "Louisiana 7"
sql_create_context
CREATE TABLE table_name_28 ( obama VARCHAR, source VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What kind of Obama that has a Source of rasmussen reports?
SELECT obama FROM table_name_28 WHERE source = "rasmussen reports"
sql_create_context
CREATE TABLE table_name_71 ( serial_format VARCHAR, issued VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What serial format was issued in 1972?
SELECT serial_format FROM table_name_71 WHERE issued = 1972
sql_create_context
CREATE TABLE table_name_90 ( kit_factory VARCHAR, manufacturer VARCHAR, model VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Kit/Factory has a J250 model made by Jabiru?
SELECT kit_factory FROM table_name_90 WHERE manufacturer = "jabiru" AND model = "j250"
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 diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.language = "RUSS"
mimicsql_data
CREATE TABLE table_train_192 ( "id" int, "hemoglobin_a1c_hba1c" float, "renal_disease" bool, "diabetic" string, "fasting_plasma_glucose" int, "NOUSE" float ) -- Using valid SQLite, answer the following questions for the tables provided above. -- a1c level is >= 7.5 %
SELECT * FROM table_train_192 WHERE hemoglobin_a1c_hba1c > 7.5
criteria2sql
CREATE TABLE college ( college_id TEXT, name_full TEXT, city TEXT, state TEXT, country TEXT ) CREATE TABLE manager_award ( player_id TEXT, award_id TEXT, year INTEGER, league_id TEXT, tie TEXT, notes NUMERIC ) CREATE TABLE player_award_vote ( award_id TEXT, year INT...
SELECT yearid, COUNT(*) FROM hall_of_fame GROUP BY yearid
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_kc22.SOC_SRT_DIRE_CD FROM t_kc22 JOIN t_kc21_t_kc22 JOIN t_kc21 ON t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID AND t_kc21_t_kc22.MED_CLINIC_ID = t_kc21.MED_CLINIC_ID WHERE t_kc21.MED_CLINIC_ID = '87668608517' AND t_kc22.SOC_SRT_DIRE_NM = '卡马西平片'
css
CREATE TABLE table_24101 ( "Game" real, "Date" text, "Opponent" text, "Result" text, "Bruins points" real, "Opponents" real, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the record for game 9?
SELECT "Record" FROM table_24101 WHERE "Game" = '9'
wikisql
CREATE TABLE table_12875 ( "Parish (Prestegjeld)" text, "Sub-Parish (Sogn)" text, "Church Name" text, "Year Built" real, "Location of the Church" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- WHAT IS THE SUB-PARISH WITH A YEAR AFTER 1916, IN ortnev...
SELECT "Sub-Parish (Sogn)" FROM table_12875 WHERE "Year Built" > '1916' AND "Location of the Church" = 'ortnevik'
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.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM, t_kc22.QTY, t_kc22.UNIVALENT, 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_ID = '05783525' AND t_kc21.IN_HOSP_DATE BETWEEN...
css
CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE days ( days_code varchar, day_name varchar ) CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE food_service ( meal_code text, meal_number int, compa...
SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, flight, flight_fare WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'HOUSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.cit...
atis
CREATE TABLE table_14641 ( "Institution" text, "Location" text, "Nickname" text, "Founded" real, "Type" text, "Enrollment" real, "Joined" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the average founded with joined less than 2008
SELECT AVG("Founded") FROM table_14641 WHERE "Joined" < '2008'
wikisql
CREATE TABLE table_67257 ( "School" text, "Location" text, "Mascot" text, "# / County" text, "Enrollment 08-09" real, "IHSAA Class" text, "Year Joined" real, "Previous Conference" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which scho...
SELECT "School" FROM table_67257 WHERE "# / County" = '29 hamilton'
wikisql
CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) CREATE TABLE...
SELECT DISTINCT flight_id FROM flight WHERE ((from_airport IN (SELECT AIRPORT_SERVICEalias0.airport_code FROM airport_service AS AIRPORT_SERVICEalias0 WHERE AIRPORT_SERVICEalias0.city_code IN (SELECT CITYalias0.city_code FROM city AS CITYalias0 WHERE CITYalias0.city_name = 'MILWAUKEE')) AND to_airport IN (SELECT AIRPOR...
atis
CREATE TABLE table_name_65 ( date VARCHAR, attendance VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What date was the game when 40,000 attended?
SELECT date FROM table_name_65 WHERE attendance = "40,000"
sql_create_context
CREATE TABLE table_33505 ( "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 is the largest crowd when north melbourne i...
SELECT MAX("Crowd") FROM table_33505 WHERE "Home team" = 'north melbourne'
wikisql
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.MED_ORG_DEPT_NM, t_kc21.IN_DIAG_DIS_NM, AVG(t_kc21.PERSON_AGE) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '7863848' GROUP BY t_kc21.MED_ORG_DEPT_NM, t_kc21.IN_DIAG_DIS_NM
css
CREATE TABLE table_29496 ( "No." real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" text, "U.S. viewers (million)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many viewers watched th...
SELECT "U.S. viewers (million)" FROM table_29496 WHERE "Written by" = 'Shana Goldberg-Meehan & Greg Malins'
wikisql
CREATE TABLE table_name_49 ( cerclis_id VARCHAR, listed VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What CERCLIS ID was listed 10/14/1992?
SELECT cerclis_id FROM table_name_49 WHERE listed = "10/14/1992"
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 CLINIC_ID FROM t_kc24 WHERE MED_CLINIC_ID = '16828447710'
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 MIN(demographic.age) FROM demographic WHERE demographic.admission_type = "EMERGENCY" AND demographic.dod_year < "2131.0"
mimicsql_data
CREATE TABLE hz_info_zyjzjlb ( JZLSH number, YLJGDM number, zyjzjlb_id number ) CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC t...
SELECT zyjzjlb.JZLSH FROM hz_info JOIN zyjzjlb JOIN hz_info_zyjzjlb ON hz_info.YLJGDM = hz_info_zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX AND hz_info_zyjzjlb.JZLSH = zyjzjlb.JZLSH AND hz_info_zyjzjlb.YLJGDM = hz_info_zyjzjlb.YLJGDM AND hz_info_zyjzjlb.JZLSH = zyjzjlb.JZLSH AND hz_info_zyj...
css
CREATE TABLE table_48015 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Opponent" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What type of surface did Thomaz Bellucci play against tommy robredo?
SELECT "Surface" FROM table_48015 WHERE "Opponent" = 'tommy robredo'
wikisql
CREATE TABLE table_name_26 ( size__steps_ VARCHAR, just_ratio VARCHAR, size__cents_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the value of the size (steps) that has just ratio 10:9 and a size (cents) more than 160
SELECT COUNT(size__steps_) FROM table_name_26 WHERE just_ratio = "10:9" AND size__cents_ > 160
sql_create_context
CREATE TABLE table_6083 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the visiting team at the Chicago home game?
SELECT "Visitor" FROM table_6083 WHERE "Home" = 'chicago'
wikisql
CREATE TABLE airport ( airport_code varchar, airport_name text, airport_location text, state_code varchar, country_name varchar, time_zone_code varchar, minimum_connect_time int ) CREATE TABLE month ( month_number int, month_name text ) CREATE TABLE time_zone ( time_zone_code t...
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 ((flight.departure_time <= 2359 AND flight.departure_time >= 1200) AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PITTSBURGH' AND fli...
atis
CREATE TABLE table_name_15 ( country VARCHAR, play VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What country had the play Cyclops?
SELECT country FROM table_name_15 WHERE play = "cyclops"
sql_create_context
CREATE TABLE table_name_25 ( kickoff_ VARCHAR, a_ VARCHAR, week VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the kickoff time for week 3?
SELECT kickoff_ AS "a_" FROM table_name_25 WHERE week = "3"
sql_create_context
CREATE TABLE table_name_58 ( influence INTEGER, inhabitants_per_mep VARCHAR, population_millions VARCHAR, meps VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest influence with population in the millions less than 60.64, and MEPs less ...
SELECT MIN(influence) FROM table_name_58 WHERE population_millions < 60.64 AND meps < 22 AND inhabitants_per_mep = 454 OFFSET 059
sql_create_context
CREATE TABLE table_66135 ( "Rank" real, "Athlete" text, "Country" text, "Time" text, "Notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who is the athlete with the time 6:02.46?
SELECT "Athlete" FROM table_66135 WHERE "Time" = '6:02.46'
wikisql
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ...
SELECT COUNT(DISTINCT t2.uniquepid) FROM (SELECT t1.uniquepid, t1.diagnosistime FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'anemia - anemia of critical illness') AS t1 GROUP BY t1.uniquepi...
eicu
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.gender = "M" AND demographic.age < "79"
mimicsql_data
CREATE TABLE table_2850912_7 ( player VARCHAR, college_junior_club_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name of the player when the college/junior/club team is new westminster bruins (whl)?
SELECT player FROM table_2850912_7 WHERE college_junior_club_team = "New Westminster Bruins (WHL)"
sql_create_context
CREATE TABLE table_203_780 ( id number, "rank" number, "diver" text, "preliminary\npoints" number, "preliminary\nrank" number, "final\npoints" number, "final\nrank" number, "final\ntotal" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- ...
SELECT COUNT("diver") FROM table_203_780 WHERE NOT "preliminary\nrank" IS NULL AND "final\nrank" IS NULL
squall
CREATE TABLE table_name_42 ( nationality VARCHAR, pick VARCHAR, round VARCHAR, college VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the nationality of the player from Round 2, Pick 19 from College of Kansas State?
SELECT nationality FROM table_name_42 WHERE round = "2" AND college = "kansas state" AND pick = "19"
sql_create_context
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 AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) FROM zzmzjzjlb JOIN jybgb JOIN jyjgzbb ON zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE zzmzjzjlb.JZZDSM = '慢性牙周炎' AND jyjgzbb.JCZBMC = 'α-...
css
CREATE TABLE gyb ( 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.MED_SER_ORG_NO FROM qtb WHERE qtb.PERSON_ID = '61218284' AND qtb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.SOC_SRT_DIRE_CD = '2524-6') UNION SELECT gyb.MED_SER_ORG_NO FROM gyb WHERE gyb.PERSON_ID = '61218284' AND gyb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE...
css
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.diagnosis = "BRAIN MASS;INTRACRANIAL HEMORRHAGE" AND lab.flag = "delta"
mimicsql_data
CREATE TABLE table_44740 ( "Coach" text, "First Yr" real, "Last Yr" real, "W-L%" real, "G > .500" real, "Yr plyf" real, "G plyf" real, "W plyf" real, "L plyf" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the earliest last y...
SELECT MIN("Last Yr") FROM table_44740 WHERE "Yr plyf" < '0'
wikisql
CREATE TABLE table_57619 ( "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. -- How large was the crowd at the Kardinia Park ven...
SELECT SUM("Crowd") FROM table_57619 WHERE "Venue" = 'kardinia park'
wikisql
CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE ReviewTaskResults ( Id number, ...
SELECT questao.Id AS "post_link", questao.Score, questao.Title, questao.Body, questao.Tags, questao.ViewCount, comentario.Id, comentario.Score AS socre_comentario, comentario.ViewCount AS views_comentario FROM Posts AS questao JOIN Posts AS comentario ON questao.Id = comentario.ParentId WHERE questao.Tags LIKE '%<windo...
sede
CREATE TABLE table_name_88 ( m809_series VARCHAR, m939_series VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the M809 seris with M939 series of M931/932
SELECT m809_series FROM table_name_88 WHERE m939_series = "m931/932"
sql_create_context
CREATE TABLE table_name_44 ( money_list_rank INTEGER, top_25 INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the greatest money list ranking that has a Top 25 higher than 2?
SELECT MAX(money_list_rank) FROM table_name_44 WHERE top_25 < 2
sql_create_context
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid numb...
SELECT patient.wardid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-3059') AND STRFTIME('%y', patient.unitadmittime) >= '2103' ORDER BY patient.unitadmittime DESC LIMIT 1
eicu
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_CLINIC_ID text, MED_DIRE_CD tex...
SELECT COUNT(qtb.MED_SER_ORG_NO) FROM qtb WHERE qtb.PERSON_NM = '袁永安' AND qtb.IN_HOSP_DATE BETWEEN '2011-03-27' AND '2015-03-22' UNION SELECT COUNT(gyb.MED_SER_ORG_NO) FROM gyb WHERE gyb.PERSON_NM = '袁永安' AND gyb.IN_HOSP_DATE BETWEEN '2011-03-27' AND '2015-03-22' UNION SELECT COUNT(zyb.MED_SER_ORG_NO) FROM zyb WHERE zy...
css
CREATE TABLE table_27298240_28 ( pronoun VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is 2nd when the pronoun is vi (you pl.)?
SELECT 2 AS nd FROM table_27298240_28 WHERE pronoun = "vi (you pl.)"
sql_create_context
CREATE TABLE table_61098 ( "Rider" text, "Bike" text, "Laps" real, "Time" text, "Grid" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest grid for rider Fonsi Nieto?
SELECT MAX("Grid") FROM table_61098 WHERE "Rider" = 'fonsi nieto'
wikisql
CREATE TABLE table_24019 ( "Player" text, "Played" real, "Legs Won" real, "Legs Lost" real, "LWAT" real, "100+" real, "140+" real, "180s" real, "High Checkout" real, "3-dart Average" text ) -- Using valid SQLite, answer the following questions for the tables provided above. --...
SELECT "Legs Won" FROM table_24019 WHERE "3-dart Average" = '95.29'
wikisql
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 gwyjzb.MED_ORG_DEPT_CD, gwyjzb.IN_DIAG_DIS_NM, AVG(gwyjzb.PERSON_AGE) FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '7831903' GROUP BY gwyjzb.MED_ORG_DEPT_CD, gwyjzb.IN_DIAG_DIS_NM UNION SELECT fgwyjzb.MED_ORG_DEPT_CD, fgwyjzb.IN_DIAG_DIS_NM, AVG(fgwyjzb.PERSON_AGE) FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '78319...
css
CREATE TABLE table_name_48 ( location VARCHAR, attendance VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- At what Location was the Attendance 70,283?
SELECT location FROM table_name_48 WHERE attendance = "70,283"
sql_create_context
CREATE TABLE table_name_35 ( gain INTEGER, name VARCHAR, avg_g VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest gain that has toben opurum as the name, with an avg/g less than 54.1?
SELECT MIN(gain) FROM table_name_35 WHERE name = "toben opurum" AND avg_g < 54.1
sql_create_context
CREATE TABLE body_builder ( body_builder_id number, people_id number, snatch number, clean_jerk number, total number ) CREATE TABLE people ( people_id number, name text, height number, weight number, birth_date text, birth_place text ) -- Using valid SQLite, answer the fol...
SELECT T2.name FROM body_builder AS T1 JOIN people AS T2 ON T1.people_id = T2.people_id
spider
CREATE TABLE table_204_958 ( id number, "episode" number, "original broadcast date" text, "average" number, "rank" number, "remarks" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what was the only episode broadcasted in july 2012 ?
SELECT "episode" FROM table_204_958 WHERE "original broadcast date" = 7 AND "original broadcast date" = 2012
squall
CREATE TABLE table_78588 ( "Year" text, "Award" text, "Category" text, "Nominated" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What year was Teen Angels 2 nominated?
SELECT "Year" FROM table_78588 WHERE "Nominated" = 'teen angels 2'
wikisql
CREATE TABLE table_name_34 ( genre VARCHAR, developer VARCHAR, japanese_title VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What genre is the Banpresto game tittled Ranma : netsuretsu kakutouhen?
SELECT genre FROM table_name_34 WHERE developer = "banpresto" AND japanese_title = "ranma ½: netsuretsu kakutouhen"
sql_create_context
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeri...
SELECT t1.celllabel FROM (SELECT intakeoutput.celllabel, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM intakeoutput WHERE intakeoutput.cellpath LIKE '%intake%' AND DATETIME(intakeoutput.intakeoutputtime) <= DATETIME(CURRENT_TIME(), '-4 year') GROUP BY intakeoutput.celllabel) AS t1 WHERE t1.c1 <= 4
eicu
CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE diagnoses_icd ( row_id numbe...
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 = 'penicillamine' AND DATETIME(prescriptions.startdate) <= DATETIME(...
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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.diagnosis = "ABDOMINAL PAIN" AND prescriptions.route = "PO/NG"
mimicsql_data
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 SUM(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT qtb.MED_CLINIC_ID FROM qtb WHERE qtb.MED_SER_ORG_NO = '4553878' AND qtb.MED_ORG_DEPT_CD = '4597' UNION SELECT gyb.MED_CLINIC_ID FROM gyb WHERE gyb.MED_SER_ORG_NO = '4553878' AND gyb.MED_ORG_DEPT_CD = '4597' UNION SELECT zyb.MED_CLINIC_ID FRO...
css
CREATE TABLE table_204_110 ( id number, "year" number, "champion" text, "city" text, "llws" text, "record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which 1 ` st place champion had a record of 2-0 ?
SELECT "champion" FROM table_204_110 WHERE "record" = '2-0'
squall
CREATE TABLE table_11578 ( "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. -- Tell m...
SELECT "High assists" FROM table_11578 WHERE "Team" = 'orlando'
wikisql
CREATE TABLE table_46171 ( "Date" text, "Opponent" text, "Score" text, "Result" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Score has an Opponent of @ la lakers, and a Record of 8-6?
SELECT "Score" FROM table_46171 WHERE "Opponent" = '@ la lakers' AND "Record" = '8-6'
wikisql
CREATE TABLE Faculty_participates_in ( FacID VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many faculty members participate in an activity?
SELECT COUNT(DISTINCT FacID) FROM Faculty_participates_in
sql_create_context
CREATE TABLE table_name_45 ( d_41 VARCHAR, d_43 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the D 41 which has a D 43 of r 18
SELECT d_41 FROM table_name_45 WHERE d_43 = "r 18"
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 (SELECT qtb.MED_ORG_DEPT_CD FROM qtb JOIN t_kc24 ON qtb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE qtb.MED_SER_ORG_NO = '2596003' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2011-10-17' AND '2018-11-04' GROUP BY qtb.MED_ORG_DEPT_CD HAVING SUM(t_kc24.MED_AMOUT) <= 1825.05 UNION SELECT gyb.MED_ORG_DEPT_CD FR...
css
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 * FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJZJLB WHERE person_info.XM = '曹俊郎'...
css
CREATE TABLE company ( Company_ID real, Name text, Headquarters text, Industry text, Sales_in_Billion real, Profits_in_Billion real, Assets_in_Billion real, Market_Value_in_Billion real ) CREATE TABLE people ( People_ID int, Age int, Name text, Nationality text, Grad...
SELECT Industry, COUNT(Industry) FROM company GROUP BY Industry ORDER BY COUNT(Industry) DESC
nvbench
CREATE TABLE table_32569 ( "Rank" real, "Stadium" text, "Capacity" text, "City" text, "Country" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the capacity of the stadium with a rank lower than 31 located in the city of Bel m ?
SELECT "Capacity" FROM table_32569 WHERE "Rank" < '31' AND "City" = 'belém'
wikisql
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) ...
SELECT demographic.days_stay FROM demographic WHERE demographic.subject_id = "17519"
mimicsql_data
CREATE TABLE zyjzjlb_jybgb ( YLJGDM_ZYJZJLB text, BGDH number, YLJGDM number ) CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC te...
SELECT AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) FROM mzjzjlb JOIN jybgb JOIN jyjgzbb ON mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE mzjzjlb.JZZDBM = 'J42.599' AND jyjgzbb.JCZBDM = '805062'
css
CREATE TABLE table_name_73 ( wins VARCHAR, rank VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the total number of wins with player Mike Hill with a rank bigger than 2?
SELECT COUNT(wins) FROM table_name_73 WHERE rank > 2 AND player = "mike hill"
sql_create_context
CREATE TABLE table_train_175 ( "id" int, "lipid_lowering_therapy" bool, "hemoglobin_a1c_hba1c" float, "diabetic" string, "fasting_serum_triglycerides" int, "gilbert_syndrome" bool, "age" float, "alanine_aminotransferase" bool, "NOUSE" float ) -- Using valid SQLite, answer the follo...
SELECT * FROM table_train_175 WHERE fasting_serum_triglycerides > 400 OR (fasting_serum_triglycerides > 250 AND lipid_lowering_therapy = 0)
criteria2sql
CREATE TABLE table_63267 ( "City of license" text, "Identifier" text, "Frequency" text, "Power" text, "Class" text, "RECNet" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the identifier when the power is 22500 watts?
SELECT "Identifier" FROM table_63267 WHERE "Power" = '22500 watts'
wikisql
CREATE TABLE table_204_529 ( id number, "year" number, "personnel" text, "album" text, "label" text, "peak positions\nnor" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which album was the first to peak in the top ten positions ?
SELECT "album" FROM table_204_529 WHERE "peak positions\nnor" <= 10 ORDER BY "year" LIMIT 1
squall