instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25), COUNTRY_ID varc...
SELECT HIRE_DATE, SALARY FROM employees WHERE NOT FIRST_NAME LIKE '%M%'
nvbench
CREATE TABLE table_10581768_2 ( founded VARCHAR, institution VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many founded dates are listed for carlow university 1
SELECT COUNT(founded) FROM table_10581768_2 WHERE institution = "Carlow University 1"
sql_create_context
CREATE TABLE table_204_659 ( id number, "seat" text, "state" text, "majority" number, "member" text, "party" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who is listed before don randall ?
SELECT "member" FROM table_204_659 WHERE id = (SELECT id FROM table_204_659 WHERE "member" = 'don randall') - 1
squall
CREATE TABLE table_name_39 ( score VARCHAR, home VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the score of the Boston Bruins game from April 11?
SELECT score FROM table_name_39 WHERE home = "boston bruins" AND date = "april 11"
sql_create_context
CREATE TABLE table_11900378_1 ( tournament VARCHAR, singles_champions VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many singles tournaments did Ludovic Walter win?
SELECT COUNT(tournament) FROM table_11900378_1 WHERE singles_champions = "Ludovic Walter"
sql_create_context
CREATE TABLE table_1341472_34 ( district VARCHAR, first_elected VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name thedistrict for 1994
SELECT district FROM table_1341472_34 WHERE first_elected = 1994
sql_create_context
CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE days ( days_code varchar, day_name varchar ) CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CRE...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BALTIMORE' AND date_day.day_number = 27 AND date_day.month_number = 8 AN...
atis
CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE student ( student_id int, lastname varchar, firstname varchar, program_id int, declare_major varchar, total_credit int, total_gpa float, entered_as varchar, admit_term int, predicted_gradu...
SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN area ON course.course_id = area.course_id INNER JOIN program_course ON program_course.course_id = course.course_id WHERE (area.area LIKE '%Advanced Leadership and Service Learning%' OR course.description LIKE '%Advanced Leadership and ...
advising
CREATE TABLE table_11960944_11 ( date VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What date was the game for the score L 88 79?
SELECT date FROM table_11960944_11 WHERE score = "L 88–79"
sql_create_context
CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Per...
SELECT All_Road, Team_ID FROM basketball_match
nvbench
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 WHERE demographic.diagnosis = "LEFT INTERNAL JUGULAR VEIN THROMBOSIS;LEFT ARM EDEMA" AND demographic.admityear < "2177"
mimicsql_data
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 zyjybgb.BGDH FROM hz_info JOIN mzjzjlb JOIN zyjybgb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB WHERE hz_info.RYBH = '33852265' AND NOT zyjybgb.BGDH IN (SELECT jyjgzbb.BGDH FROM ...
css
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_CLINIC_ID text, MED_DIRE_CD tex...
SELECT gwyjzb.MED_ORG_DEPT_CD, gwyjzb.MED_ORG_DEPT_NM, AVG(gwyjzb.IN_HOSP_DAYS) FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '0310745' GROUP BY gwyjzb.MED_ORG_DEPT_CD ORDER BY AVG(gwyjzb.IN_HOSP_DAYS) UNION SELECT fgwyjzb.MED_ORG_DEPT_CD, fgwyjzb.MED_ORG_DEPT_NM, AVG(fgwyjzb.IN_HOSP_DAYS) FROM fgwyjzb WHERE fgwyjzb.MED_SE...
css
CREATE TABLE table_name_31 ( attendance VARCHAR, away_team VARCHAR, home_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many people attended the game when the away team was dynamo kyiv, and a Home team of torpedo zaporizhia?
SELECT attendance FROM table_name_31 WHERE away_team = "dynamo kyiv" AND home_team = "torpedo zaporizhia"
sql_create_context
CREATE TABLE table_34154 ( "Round" text, "Player" text, "Position" text, "Nationality" text, "College/Junior/Club Team (League)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What position is Sweden in round 2?
SELECT "Position" FROM table_34154 WHERE "Nationality" = 'sweden' AND "Round" = '2'
wikisql
CREATE TABLE course_offering ( offering_id int, course_id int, semester int, section_number int, start_time time, end_time time, monday varchar, tuesday varchar, wednesday varchar, thursday varchar, friday varchar, saturday varchar, sunday varchar, has_final_proje...
SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester WHERE course_offering.friday = 'N' AND course.department = 'MATSCIE' AND semester.semester = 'WN' AN...
advising
CREATE TABLE table_59243 ( "Name" text, "Total" real, "Outstanding Performance" real, "Fighting Spirit" real, "Technique" real, "Years" text, "Highest rank" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are asashio's years?
SELECT "Years" FROM table_59243 WHERE "Name" = 'asashio'
wikisql
CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) CREATE TABLE Users ( Id number, Reputation number, CreationDate time, Di...
SELECT Title, Body, Id, Tags, AnswerCount, CommentCount, CONCAT('https://stackoverflow.com/questions/', Id), CreationDate, AcceptedAnswerId, ViewCount, FavoriteCount FROM Posts WHERE Tags LIKE '%api%' ORDER BY RAND() LIMIT 400
sede
CREATE TABLE table_71344 ( "Molecule" text, "Percent of Mass" text, "Mol.Weight (daltons)" text, "Molecules" text, "Percent of Molecules" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the molecules when the percent mass is 1.0?
SELECT "Molecules" FROM table_71344 WHERE "Percent of Mass" = '1.0'
wikisql
CREATE TABLE table_55071 ( "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. -- When did South Melbourne play as the home team?
SELECT "Date" FROM table_55071 WHERE "Home team" = 'south melbourne'
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 SOC_SRT_DIRE_NM, EACH_DOSAGE, USE_FRE FROM t_kc22 WHERE MED_CLINIC_ID = '84336968126'
css
CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, v...
SELECT d_icd_diagnoses.long_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'screening for diphtheria' UNION SELECT d_icd_procedures.long_title FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'screening for diphtheria'
mimic_iii
CREATE TABLE table_name_97 ( rank INTEGER, location VARCHAR, fastest_time__s_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the highest rank in dresden with a time faster than 10.88?
SELECT MAX(rank) FROM table_name_97 WHERE location = "dresden" AND fastest_time__s_ < 10.88
sql_create_context
CREATE TABLE music_festival ( id number, music_festival text, date_of_ceremony text, category text, volume number, result text ) CREATE TABLE artist ( artist_id number, artist text, age number, famous_title text, famous_release_date text ) CREATE TABLE volume ( volume_i...
SELECT song FROM volume ORDER BY song
spider
CREATE TABLE table_25467 ( "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. -- Who di...
SELECT "High points" FROM table_25467 WHERE "Date" = 'December 18'
wikisql
CREATE TABLE table_20906 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original airdate" text, "Production code" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many days are associate...
SELECT COUNT("Original airdate") FROM table_20906 WHERE "Production code" = '210'
wikisql
CREATE TABLE table_37425 ( "Round" real, "Pick" real, "Player" text, "Position" text, "School/Club Team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Player has a Round smaller than 11, and a Pick smaller than 152, and a Position of guard?
SELECT "Player" FROM table_37425 WHERE "Round" < '11' AND "Pick" < '152' AND "Position" = 'guard'
wikisql
CREATE TABLE table_name_66 ( position VARCHAR, pick__number VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- The position that has a pick # of 16 is what?
SELECT position FROM table_name_66 WHERE pick__number = 16
sql_create_context
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.long_title = "Transitory tachypnea of newborn"
mimicsql_data
CREATE TABLE table_name_57 ( home_team VARCHAR, venue VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the home team of lake oval's score?
SELECT home_team AS score FROM table_name_57 WHERE venue = "lake oval"
sql_create_context
CREATE TABLE table_18735 ( "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. -- Who was the incumbent when ran william b. oliver (d) unopposed?
SELECT "Incumbent" FROM table_18735 WHERE "Candidates" = 'William B. Oliver (D) Unopposed'
wikisql
CREATE TABLE table_55623 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many laps in total does the driver named Eddie Irvine have?
SELECT COUNT("Laps") FROM table_55623 WHERE "Driver" = 'eddie irvine'
wikisql
CREATE TABLE table_name_12 ( aspect VARCHAR, programming VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Aspect has a Programming of Saigon Network Television?
SELECT aspect FROM table_name_12 WHERE programming = "saigon network television"
sql_create_context
CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDisplayName text...
SELECT t.TagName, CEIL(AVG(LENGTH(p.Body)) / 5.1) AS average_word_length FROM Posts AS p INNER JOIN PostTags AS pg ON pg.PostId = p.Id INNER JOIN Tags AS t ON pg.TagId = t.Id WHERE p.PostTypeId = 1 GROUP BY t.TagName, t.Count ORDER BY t.Count DESC
sede
CREATE TABLE table_name_33 ( rank VARCHAR, events VARCHAR, prize_money__$__ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the rank for the player with events greater than 23 and prize money in excess of $823,783?
SELECT COUNT(rank) FROM table_name_33 WHERE events > 23 AND prize_money__$__ > 823 OFFSET 783
sql_create_context
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 text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZZMC ...
SELECT * FROM hz_info JOIN zyjzjlb JOIN person_info_hz_info JOIN person_info ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.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.YLJGDM AND person_info_hz_i...
css
CREATE TABLE table_13514348_7 ( umpires VARCHAR, simpson_medal VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who were the umpires when Paul Medhurst (C) won the Simpson Medal?
SELECT umpires FROM table_13514348_7 WHERE simpson_medal = "Paul Medhurst (C)"
sql_create_context
CREATE TABLE table_name_45 ( final_year INTEGER, notes VARCHAR, first_year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the most minimal Final year that has a Notes of replaced by i-75 and m-25, and a First year larger than 1926?
SELECT MIN(final_year) FROM table_name_45 WHERE notes = "replaced by i-75 and m-25" AND first_year > 1926
sql_create_context
CREATE TABLE table_69712 ( "Player" text, "Games" text, "Tries" text, "Goals" text, "F. Goals" text, "Points" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the F. Goals for games of 22 22 and points of 012 12
SELECT "F. Goals" FROM table_69712 WHERE "Games" = '22 22' AND "Points" = '012 12'
wikisql
CREATE TABLE t_kc21_t_kc24 ( MED_CLINIC_ID text, MED_SAFE_PAY_ID number ) CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, ...
SELECT t_kc21.OUT_DIAG_DOC_CD, t_kc21.OUT_DIAG_DOC_NM FROM t_kc21 WHERE t_kc21.PERSON_NM = '葛玉山' GROUP BY t_kc21.OUT_DIAG_DOC_CD ORDER BY COUNT(*) DESC
css
CREATE TABLE table_name_62 ( mintage INTEGER, issue_price VARCHAR, artist VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the mintage having an issue price of $1,099.99, artist being Pamela Stagg?
SELECT AVG(mintage) FROM table_name_62 WHERE issue_price = "$1,099.99" AND artist = "pamela stagg"
sql_create_context
CREATE TABLE table_9363 ( "Date" text, "Series" text, "Circuit" text, "City / State" text, "Winner" text, "Team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the City / State, when Series is ATCC Round 3?
SELECT "City / State" FROM table_9363 WHERE "Series" = 'atcc round 3'
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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admityear < "2157" AND procedures.long_title = "Endoscopic sphincterotomy and papillotomy"
mimicsql_data
CREATE TABLE table_1042 ( "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 touchdowns were scored by players who scor...
SELECT COUNT("Touchdowns") FROM table_1042 WHERE "Extra points" > '5.0'
wikisql
CREATE TABLE table_name_12 ( high_assists VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the High assists for February 2?
SELECT high_assists FROM table_name_12 WHERE date = "february 2"
sql_create_context
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(MANAGER_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID
nvbench
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 text, RYBH text, XBDM number, XBMC text, XLDM text, XLMC text, XM text...
SELECT jybgb.SHRGH, jybgb.SHRXM FROM jybgb WHERE jybgb.BGDH = '16846879997'
css
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, t_kc22.UNIVALENT FROM t_kc22 WHERE t_kc22.MED_CLINIC_ID IN (SELECT qtb.MED_CLINIC_ID FROM qtb WHERE qtb.PERSON_NM = '施颖秀' AND qtb.MED_SER_ORG_NO = '2985604' UNION SELECT gyb.MED_CLINIC_ID FROM gyb WHERE gyb.PERSON_NM = '施颖秀' AND gyb.MED_SER_ORG_NO = '2985604' UNION...
css
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE l...
SELECT SUM(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '017-59454') AND NOT patient.unitdischargetime IS...
eicu
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE medication ( me...
SELECT medication.drugstarttime FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '033-3009')) AND DATETIME(medication.drugstarttime, 'start of y...
eicu
CREATE TABLE table_42068 ( "Name" text, "Nationality" text, "Position" text, "Appearances" real, "Goals" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many appearances did batram suri category:articles with hcards have scoring less than 2 goals...
SELECT COUNT("Appearances") FROM table_42068 WHERE "Name" = 'batram suri category:articles with hcards' AND "Goals" < '2'
wikisql
CREATE TABLE table_name_2 ( week INTEGER, attendance VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- For what week was the attendance 40,429?
SELECT SUM(week) FROM table_name_2 WHERE attendance = 40 OFFSET 429
sql_create_context
CREATE TABLE table_33185 ( "Positional or Automatic" text, "Opponents" text, "Suits" text, "Material or Non-material" text, "Count Rectified" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Is it material or non-material when there are 2 suits for ei...
SELECT "Material or Non-material" FROM table_33185 WHERE "Suits" = '2' AND "Opponents" = 'either'
wikisql
CREATE TABLE table_14226 ( "Rank" text, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the sum of the bronze medals won by south korea?
SELECT SUM("Bronze") FROM table_14226 WHERE "Nation" = 'south korea'
wikisql
CREATE TABLE table_19418696_3 ( qb_rating VARCHAR, completions VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many QB ratings for the player with 1069 completions?
SELECT COUNT(qb_rating) FROM table_19418696_3 WHERE completions = 1069
sql_create_context
CREATE TABLE table_65926 ( "Year" real, "Venue" text, "Competition" text, "Kilkenny score" text, "Waterford score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the waterford score that has a year prior to 1963, with all-ireland hurling fin...
SELECT "Waterford score" FROM table_65926 WHERE "Year" < '1963' AND "Competition" = 'all-ireland hurling final replay'
wikisql
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 zzmzjzjlb WHERE zzmzjzjlb.YLJGDM = '7510294' AND zzmzjzjlb.JZKSRQ BETWEEN '2004-09-06' AND '2020-10-17' AND zzmzjzjlb.ZSEBZ > 0 UNION SELECT COUNT(*) FROM fzzmzjzjlb WHERE fzzmzjzjlb.YLJGDM = '7510294' AND fzzmzjzjlb.JZKSRQ BETWEEN '2004-09-06' AND '2020-10-17' AND fzzmzjzjlb.ZSEBZ > 0
css
CREATE TABLE Rating ( stars INTEGER, mID VARCHAR ) CREATE TABLE Movie ( title VARCHAR, director VARCHAR, mID VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Find the title and score of the movie with the lowest rating among all movies directed by...
SELECT T2.title, T1.stars, T2.director, MIN(T1.stars) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID GROUP BY T2.director
sql_create_context
CREATE TABLE table_59524 ( "Rank" real, "City" text, "State" text, "Population" real, "Metro Population of 4 aspects" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the state of the city of denver, which has a rank less than 10?
SELECT "State" FROM table_59524 WHERE "Rank" < '10' AND "City" = 'denver'
wikisql
CREATE TABLE table_name_52 ( pommel_horse VARCHAR, vault VARCHAR, total VARCHAR, team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many pommel horses have a Total smaller than 230.019, a Team of china (chn), and a Vault smaller than 38.437?
SELECT COUNT(pommel_horse) FROM table_name_52 WHERE total < 230.019 AND team = "china (chn)" AND vault < 38.437
sql_create_context
CREATE TABLE jybgb_jyjgzbb ( JYZBLSH number, YLJGDM text, jyjgzbb_id number ) 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, ...
SELECT * FROM jyjgzbb WHERE jyjgzbb.JCZBMC = (SELECT jyjgzbb.JCZBMC FROM jyjgzbb WHERE jyjgzbb.JYZBLSH = '63771807598') AND jyjgzbb.JCZBJGDW = (SELECT jyjgzbb.JCZBJGDW FROM jyjgzbb WHERE jyjgzbb.JYZBLSH = '63771807598') AND jyjgzbb.JCZBJGDL <= (SELECT jyjgzbb.JCZBJGDL FROM jyjgzbb WHERE jyjgzbb.JYZBLSH = '63771807598')
css
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 microlab.culturetakentime FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '025-28600' AND NOT patient.hospitaldischargetime IS NULL ORDER BY...
eicu
CREATE TABLE table_61541 ( "Date" text, "Opponents" text, "H / A" text, "Result F \u2013 A" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many people attended the game against the Kaizer Chiefs?
SELECT SUM("Attendance") FROM table_61541 WHERE "Opponents" = 'kaizer chiefs'
wikisql
CREATE TABLE table_59832 ( "Date" text, "Round" text, "Opponent" text, "Venue" text, "Result" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest attendance for the opponents Club Brugge in Venue A?
SELECT MAX("Attendance") FROM table_59832 WHERE "Opponent" = 'club brugge' AND "Venue" = 'a'
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 SUM(MED_AMOUT) FROM t_kc21 WHERE PERSON_ID = '36015603' AND CLINIC_TYPE = '门诊'
css
CREATE TABLE section ( course_id varchar(8), sec_id varchar(8), semester varchar(6), year numeric(4,0), building varchar(15), room_number varchar(7), time_slot_id varchar(4) ) CREATE TABLE classroom ( building varchar(15), room_number varchar(7), capacity numeric(4,0) ) CREATE ...
SELECT building, COUNT(building) FROM department WHERE budget > (SELECT AVG(budget) FROM department) GROUP BY building ORDER BY COUNT(building) DESC
nvbench
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_typ...
SELECT SUM(CASE WHEN patients.dod IS NULL THEN 1 WHEN STRFTIME('%j', patients.dod) - STRFTIME('%j', t2.charttime) > 2 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t1.subject_id, t1.charttime FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id...
mimic_iii
CREATE TABLE table_14407512_9 ( points VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the 1st(m) score for the Person who had a total points of 272.7
SELECT 1 AS st__m_ FROM table_14407512_9 WHERE points = "272.7"
sql_create_context
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 inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttim...
SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT t1.itemid FROM (SELECT labevents.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM labevents WHERE DATETIME(labevents.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') GROUP BY labevents.itemid) AS t1...
mimic_iii
CREATE TABLE instructor ( dept_name VARCHAR, salary INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Find the names and average salaries of all departments whose average salary is greater than 42000.
SELECT dept_name, AVG(salary) FROM instructor GROUP BY dept_name HAVING AVG(salary) > 42000
sql_create_context
CREATE TABLE table_22761 ( "Player" text, "Nat" text, "Pos" text, "L Apps" real, "L G" real, "C Apps" real, "Total Apps" real, "Total G" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the nat for total apps for 27
SELECT "Nat" FROM table_22761 WHERE "Total Apps" = '27'
wikisql
CREATE TABLE table_66479 ( "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 class has cbon-fm-23 as the identifier?
SELECT "Class" FROM table_66479 WHERE "Identifier" = 'cbon-fm-23'
wikisql
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 employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25...
SELECT HIRE_DATE, COUNT(HIRE_DATE) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history)
nvbench
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_id varchar ) CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE...
SELECT DISTINCT instructor.name FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester INNER JOIN program_course ON program_course.course_id = course_offering.course_id INNER JOIN offering_instructor ON offering_instr...
advising
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CRE...
SELECT COUNT(*) > 0 FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-38131')) AND intakeoutput.cellpath LIKE '%output%' AND intakeoutpu...
eicu
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY ...
SELECT SALARY, COMMISSION_PCT FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200)
nvbench
CREATE TABLE table_78939 ( "City" text, "Country" text, "Airport" text, "IATA" text, "ICAO" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Airport's ICAO is ENTO?
SELECT "Airport" FROM table_78939 WHERE "ICAO" = 'ento'
wikisql
CREATE TABLE bank ( branch_id number, bname text, no_of_customers number, city text, state text ) CREATE TABLE loan ( loan_id text, loan_type text, cust_id text, branch_id text, amount number ) CREATE TABLE customer ( cust_id text, cust_name text, acc_type text, ...
SELECT city, state FROM bank WHERE bname = 'morningside'
spider
CREATE TABLE table_26617 ( "Week" real, "Date" text, "Opponent" text, "Location" text, "Final Score" text, "Attendance" real, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When 4 is the week what is the location?
SELECT "Location" FROM table_26617 WHERE "Week" = '4'
wikisql
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE 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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_type = "URGENT" AND prescriptions.drug = "Tacrolimus"
mimicsql_data
CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE course_tags_count ( course_id int, clear_grading int, pop_quiz int, group_projects int, inspirational int, long_lectures int, extra_credit int, few_tests int, good_feedback int, tough_...
SELECT DISTINCT instructor.name FROM course, course_offering, instructor, offering_instructor WHERE course.course_id = course_offering.course_id AND course.department = 'EDCURINS' AND course.number = 575 AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.offering_id = course_offeri...
advising
CREATE TABLE table_name_3 ( round INTEGER, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the round for jake gardiner?
SELECT AVG(round) FROM table_name_3 WHERE player = "jake gardiner"
sql_create_context
CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25...
SELECT HIRE_DATE, SUM(DEPARTMENT_ID) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200)
nvbench
CREATE TABLE table_204_929 ( id number, "location" text, "name of mill and\ngrid reference" text, "type" text, "maps" text, "first mention\nor built" text, "last mention\nor demise" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many l...
SELECT COUNT(*) FROM (SELECT "location" FROM table_204_929 GROUP BY "location" HAVING COUNT(*) >= 2)
squall
CREATE TABLE pilot ( Pilot_Id int(11), Name varchar(50), Age int(11) ) CREATE TABLE aircraft ( Aircraft_ID int(11), Aircraft varchar(50), Description varchar(50), Max_Gross_Weight varchar(50), Total_disk_area varchar(50), Max_disk_Loading varchar(50) ) CREATE TABLE airport ( Ai...
SELECT Aircraft, COUNT(*) FROM aircraft AS T1 JOIN match AS T2 ON T1.Aircraft_ID = T2.Winning_Aircraft GROUP BY T2.Winning_Aircraft
nvbench
CREATE TABLE table_name_45 ( show VARCHAR, year VARCHAR, episode_title VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which show had a part 3 before 2011?
SELECT show FROM table_name_45 WHERE year < 2011 AND episode_title = "part 3"
sql_create_context
CREATE TABLE table_64119 ( "Date of release" text, "Title" text, "Billboard peak" text, "RIAA cert." text, "Label" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the Billboard peak for the album released on September 12, 2000 by sanctuary?
SELECT "Billboard peak" FROM table_64119 WHERE "Label" = 'sanctuary' AND "Date of release" = 'september 12, 2000'
wikisql
CREATE TABLE Customer_Orders ( order_id INTEGER, customer_id INTEGER, order_status VARCHAR(15), order_date DATETIME, order_details VARCHAR(255) ) CREATE TABLE Order_Items ( order_id INTEGER, product_id INTEGER, order_quantity VARCHAR(15) ) CREATE TABLE Customer_Contact_Channels ( c...
SELECT date_became_customer, COUNT(date_became_customer) FROM Customers WHERE customer_id BETWEEN 10 AND 20
nvbench
CREATE TABLE table_32766 ( "Freq" real, "Call" text, "City" text, "Owner" text, "Day Power ( W )" real, "Night Power" real, "Format" text, "Stereo" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Triad frew with a day power of...
SELECT COUNT("Freq") FROM table_32766 WHERE "Day Power ( W )" = '5,000' AND "Owner" = 'triad'
wikisql
CREATE TABLE table_27537518_6 ( decision VARCHAR, first_star VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who made the decisions in the game whose first star was V. Lecavalier?
SELECT decision FROM table_27537518_6 WHERE first_star = "V. Lecavalier"
sql_create_context
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.short_title = "Dementia w/o behav dist" AND lab.fluid = "Cerebrospinal Fluid (CSF)"
mimicsql_data
CREATE TABLE table_58592 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which driver drove in grid 19?
SELECT "Driver" FROM table_58592 WHERE "Grid" = '19'
wikisql
CREATE TABLE zzmzjzjlb ( 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 zzmzjzjlb.JZKSRQ FROM zzmzjzjlb WHERE zzmzjzjlb.JZLSH = '75820096573' UNION SELECT fzzmzjzjlb.JZKSRQ FROM fzzmzjzjlb WHERE fzzmzjzjlb.JZLSH = '75820096573'
css
CREATE TABLE table_name_28 ( frequency_mhz VARCHAR, city_of_license VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Give me the MHz Frequency of Allapattah, Florida.
SELECT frequency_mhz FROM table_name_28 WHERE city_of_license = "allapattah, florida"
sql_create_context
CREATE TABLE table_name_17 ( place VARCHAR, country VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What did United States place when the score was 71-70-72-68=281?
SELECT place FROM table_name_17 WHERE country = "united states" AND score = 71 - 70 - 72 - 68 = 281
sql_create_context
CREATE TABLE table_4142 ( "By-election" real, "Electorate" text, "Date" text, "Incumbent" text, "Reason" text, "Winner" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When ihaia tainui is the incumbent what is the date?
SELECT "Date" FROM table_4142 WHERE "Incumbent" = 'Ihaia Tainui'
wikisql
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) 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, ...
SELECT jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM txmzjzjlb JOIN jybgb JOIN jyjgzbb ON txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE txmzjzjlb.JZZDSM = '痴呆' AND jyjgzbb.JCZBMC = '白蛋白' UNION SELECT jyjgzbb.CKZFWXX, jyjgz...
css
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugsto...
SELECT COUNT(*) > 0 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '005-4044')) AND STRFTIME('%y', treatment.treatmenttime) <= '2101'
eicu
CREATE TABLE block ( blockfloor number, blockcode number ) CREATE TABLE medication ( code number, name text, brand text, description text ) CREATE TABLE trained_in ( physician number, treatment number, certificationdate time, certificationexpires time ) CREATE TABLE procedures...
SELECT head FROM department GROUP BY departmentid ORDER BY COUNT(departmentid) LIMIT 1
spider
CREATE TABLE table_42071 ( "Region" text, "Province" text, "Capital" text, "No. of Communes" real, "Area" real, "2002 Population" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What province has a v valpara so region and an area of 927.2?
SELECT "Province" FROM table_42071 WHERE "Region" = 'v valparaíso' AND "Area" = '927.2'
wikisql