instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_name_12 ( home VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the home team of the game on 2 February 2006?
SELECT home FROM table_name_12 WHERE date = "2 february 2006"
sql_create_context
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_CLINIC_ID text, MED_DIRE_CD tex...
SELECT 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 t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_ID = '97104929' AND t_kc22.t_kc21_MED_SER_ORG_NO = '0510522') ORDER BY t_kc22.UNIVALENT DESC LIMIT 1
css
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.long_title = "Incision of vessel, abdominal arteries"
mimicsql_data
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.age < "49" AND procedures.long_title = "Biopsy of tonsils and adenoids"
mimicsql_data
CREATE TABLE table_9894 ( "Ship" text, "Guns" text, "Commander" text, "Complement" real, "Notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the sum of complement commander Valkenburg received?
SELECT COUNT("Complement") FROM table_9894 WHERE "Commander" = 'valkenburg'
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 prescriptions...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE prescriptions.formulary_drug_cd = "CLIN150" AND lab.fluid = "Other Body Fluid"
mimicsql_data
CREATE TABLE table_204_332 ( id number, "administrative\narea" text, "area\nkm2" number, "area\nsq mi" number, "population" number, "administrative\ncentre" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the total of the first population...
SELECT "population" FROM table_204_332 WHERE id = 1
squall
CREATE TABLE table_5351 ( "Nation" text, "Skip" text, "Third" text, "Second" text, "Lead" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Third has a Nation of hungary?
SELECT "Third" FROM table_5351 WHERE "Nation" = 'hungary'
wikisql
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2135" AND diagnoses.long_title = "Urinary incontinence, unspecified"
mimicsql_data
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.admission_location, demographic.discharge_location FROM demographic WHERE demographic.name = "Elizabeth Bateman"
mimicsql_data
CREATE TABLE Room ( RoomNumber INTEGER, RoomType VARCHAR(30), BlockFloor INTEGER, BlockCode INTEGER, Unavailable BOOLEAN ) CREATE TABLE Appointment ( AppointmentID INTEGER, Patient INTEGER, PrepNurse INTEGER, Physician INTEGER, Start DATETIME, End DATETIME, ExaminationRo...
SELECT T1.Name, COUNT(*) FROM Physician AS T1 JOIN Patient AS T2 ON T1.EmployeeID = T2.PCP GROUP BY T1.EmployeeID
nvbench
CREATE TABLE table_8594 ( "Track Name" text, "Location" text, "Length" text, "Sanction" text, "Program" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What programs are there for the South Fork Dirt Riders track?
SELECT "Program" FROM table_8594 WHERE "Track Name" = 'south fork dirt riders'
wikisql
CREATE TABLE jybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH text, 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, JY...
SELECT jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX 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 = 'Z83.066' AND jyjgzbb.JCZBDM = '549027'
css
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE d_labitems ( row_id number, itemid...
SELECT COUNT(*) > 0 FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 25312) AND microbiologyevents.spec_type_desc = 'peritoneal fluid' AND DATETIME(microbiologyevents.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year...
mimic_iii
CREATE TABLE table_204_197 ( id number, "date" text, "time" text, "opponent#" text, "site" text, "tv" text, "result" text, "attendance" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what was the highest number of points scored in a si...
SELECT MAX("result") FROM table_204_197
squall
CREATE TABLE table_41390 ( "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the score for the 2014 FIFA World Cup Qualification (UEFA)?
SELECT "Score" FROM table_41390 WHERE "Competition" = '2014 fifa world cup qualification (uefa)'
wikisql
CREATE TABLE zyjzjlb ( YLJGDM text, JZLSH text, MZJZLSH text, KH text, KLX number, HZXM text, WDBZ number, RYDJSJ time, RYTJDM number, RYTJMC text, JZKSDM text, JZKSMC text, RZBQDM text, RZBQMC text, RYCWH text, CYKSDM text, CYKSMC text, CYBQDM tex...
SELECT mzjzjlb.JZZDBM, mzjzjlb.JZZDSM FROM hz_info JOIN mzjzjlb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE hz_info.RYBH = '79096915'
css
CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Per...
SELECT All_Home, COUNT(All_Home) FROM basketball_match GROUP BY All_Home ORDER BY COUNT(All_Home) DESC
nvbench
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 demographic (...
SELECT demographic.admittime, prescriptions.drug FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.subject_id = "18480"
mimicsql_data
CREATE TABLE table_20626467_1 ( jockey VARCHAR, distance VARCHAR, class VARCHAR, venue VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the jockey in group 1 at the 1400m distance at randwick?
SELECT jockey FROM table_20626467_1 WHERE class = "Group 1" AND venue = "Randwick" AND distance = "1400m"
sql_create_context
CREATE TABLE table_name_74 ( goals VARCHAR, points INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many goals did the player with less than 4 points have?
SELECT COUNT(goals) FROM table_name_74 WHERE points < 4
sql_create_context
CREATE TABLE table_44600 ( "Region" text, "Date" text, "Label" text, "Catalog" text, "Format" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the region when the label was the universal music group?
SELECT "Region" FROM table_44600 WHERE "Label" = 'universal music group'
wikisql
CREATE TABLE table_name_24 ( on_air_id VARCHAR, frequency VARCHAR, purpose VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the On-air ID with the frequency of 105.9, and purpose of commercial?
SELECT on_air_id FROM table_name_24 WHERE frequency = "105.9" AND purpose = "commercial"
sql_create_context
CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC text, RYBH text, XBDM number, XBMC text, XLDM text, XLMC text, XM text, ZYLBDM text, ZYMC text ) CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC...
SELECT jybgb.SHSJ FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb 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 = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE person_info.XM = '赵思美' AND jybg...
css
CREATE TABLE table_856 ( "Rnd" real, "Circuit" text, "GTP Winning Team" text, "GTO Winning Team" text, "GTU Winning Team" text, "Results" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What us the number of the round during which #56 Blue Thunde...
SELECT "Rnd" FROM table_856 WHERE "GTP Winning Team" = '#56 Blue Thunder Racing' AND "GTO Winning Team" = '#38 Mandeville Auto Tech'
wikisql
CREATE TABLE table_79558 ( "Date" text, "Location" text, "Lineup" text, "Assist/pass" text, "Score" text, "Result" text, "Competition" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which Score has a Location of mex cancun?
SELECT "Score" FROM table_79558 WHERE "Location" = 'mex cancun'
wikisql
CREATE TABLE table_name_47 ( area__sqdeg_ INTEGER, area__msr_ VARCHAR, right_ascension__hm_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total sum of Areas (sq.deg) that have an Area (msr) of 43.059 and a Right ascension (hm) larger than 74...
SELECT SUM(area__sqdeg_) FROM table_name_47 WHERE area__msr_ = 43.059 AND right_ascension__hm_ > 747.73
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 prescriptions...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "EMERGENCY ROOM ADMIT" AND demographic.diagnosis = "T5 FRACTURE"
mimicsql_data
CREATE TABLE table_23534 ( "Year" text, "Team" text, "Games" real, "Mins" text, "FG%" text, "3P%" text, "FT%" text, "Rebounds" text, "Assists" text, "Steals" text, "Blocks" text, "Points" text ) -- Using valid SQLite, answer the following questions for the tables provid...
SELECT "Points" FROM table_23534 WHERE "Rebounds" = '4.4'
wikisql
CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, ...
SELECT COUNT(*) AS cnt, SUM(totscore) AS totalscore FROM (SELECT u.Id AS id, COUNT(*) AS cnt, SUM(a.Score) AS totscore FROM Users AS u INNER JOIN Posts AS a ON u.Id = a.OwnerUserId AND a.PostTypeId = 2 LEFT OUTER JOIN Posts AS q ON q.OwnerUserId = u.Id AND q.PostTypeId = 1 WHERE u.CreationDate BETWEEN DATEADD(d, -90, G...
sede
CREATE TABLE table_name_80 ( result VARCHAR, goal VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What result has a goal of 5?
SELECT result FROM table_name_80 WHERE goal = 5
sql_create_context
CREATE TABLE Regular_Orders ( regular_order_id INTEGER, distributer_id INTEGER ) CREATE TABLE Order_Deliveries ( location_code VARCHAR(10), actual_order_id INTEGER, delivery_status_code VARCHAR(10), driver_employee_id INTEGER, truck_id INTEGER, delivery_date DATETIME ) CREATE TABLE Cus...
SELECT state_province_county, COUNT(*) FROM Customer_Addresses AS t1 JOIN Addresses AS t2 ON t1.address_id = t2.address_id GROUP BY t2.state_province_county ORDER BY state_province_county DESC
nvbench
CREATE TABLE table_name_77 ( capacity INTEGER, margin VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the lowest capacity when the margin is 03:30?
SELECT MIN(capacity) FROM table_name_77 WHERE margin = "03:30"
sql_create_context
CREATE TABLE table_79009 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" real, "Money ( $ )" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which country has a to par less than 19 and a score of 75-79-77-73=304?
SELECT "Country" FROM table_79009 WHERE "To par" < '19' AND "Score" = '75-79-77-73=304'
wikisql
CREATE TABLE Faculty_Participates_in ( FacID INTEGER, actid INTEGER ) CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ) CREATE TABLE Activity ( actid INTEGER, a...
SELECT activity_name, COUNT(*) FROM Activity AS T1 JOIN Faculty_Participates_in AS T2 ON T1.actid = T2.actid GROUP BY T1.actid ORDER BY COUNT(*) DESC
nvbench
CREATE TABLE t_kc24 ( MED_SAFE_PAY_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, REF_SLT_FLG number, CLINIC_SLT_DATE time, COMP_ID text, PERSON_ID text, FLX_MED_ORG_ID text, INSU_TYPE text, MED_AMOUT number, PER_ACC_PAY number, OVE_PAY numb...
SELECT COUNT(*) FROM t_kc21 WHERE MED_SER_ORG_NO = '6462423' AND IN_HOSP_DATE BETWEEN '2003-01-10' AND '2006-09-27' AND INSURED_STS = '未就业'
css
CREATE TABLE table_39772 ( "Date" text, "Cover model" text, "Centerfold model" text, "20 Questions" text, "Pictorials" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Cover model has a Pictorials of brande roderick-pmoy, naked news?
SELECT "Cover model" FROM table_39772 WHERE "Pictorials" = 'brande roderick-pmoy, naked news'
wikisql
CREATE TABLE table_name_75 ( final_ladder_position VARCHAR, finals_qualification VARCHAR, teams VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the ladder position when team is less than 10 and the Finals qualifications were DNQ?
SELECT final_ladder_position FROM table_name_75 WHERE finals_qualification = "dnq" AND teams < 10
sql_create_context
CREATE TABLE photos ( id int, camera_lens_id int, mountain_id int, color text, name text ) CREATE TABLE mountain ( id int, name text, Height real, Prominence real, Range text, Country text ) CREATE TABLE camera_lens ( id int, brand text, name text, focal_len...
SELECT color, COUNT(color) FROM photos GROUP BY color ORDER BY color DESC
nvbench
CREATE TABLE table_36842 ( "Rank" text, "Film" text, "Director(s)" text, "Producer(s)" text, "Writer(s)" text, "Production Company" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the director that worked with Dana Dorian as the writer?
SELECT "Director(s)" FROM table_36842 WHERE "Writer(s)" = 'dana dorian'
wikisql
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_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE cost ( row_id...
SELECT COUNT(*) > 0 FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 49141) AND microbiologyevents.spec_type_desc = 'peritoneal fluid' AND DATETIME(microbiologyevents.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year...
mimic_iii
CREATE TABLE table_71373 ( "Name" text, "Period" text, "Matches" text, "Wins" text, "Draws" text, "Losses" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many matches were played when there was 1 draw and 1 win?
SELECT "Matches" FROM table_71373 WHERE "Draws" = '1' AND "Wins" = '1'
wikisql
CREATE TABLE table_name_50 ( silver INTEGER, gold INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Average for Silver medals that have more than 17 Golds?
SELECT AVG(silver) FROM table_name_50 WHERE gold > 17
sql_create_context
CREATE TABLE table_name_19 ( erp_w VARCHAR, frequency_mhz VARCHAR, city_of_license VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the ERP W with a frequency mhz more than 93.3 and city license of washington, georgia
SELECT erp_w FROM table_name_19 WHERE frequency_mhz > 93.3 AND city_of_license = "washington, georgia"
sql_create_context
CREATE TABLE table_name_88 ( Id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the 2008 with 1998 of a and 2002 of 1r with 2004 of 2r
SELECT 2008 FROM table_name_88 WHERE 1998 = "a" AND 2002 = "1r" AND 2004 = "2r"
sql_create_context
CREATE TABLE table_8086 ( "Season" text, "President" text, "General Sec" text, "Treasurer" text, "Fixtures Sec" text, "Social Sec Bradford" text, "Social Sec Leeds" text, "Media Officer" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Nam...
SELECT "Social Sec Leeds" FROM table_8086 WHERE "President" = 'tom dawson'
wikisql
CREATE TABLE table_68112 ( "Name" text, "Years" text, "Gender" text, "Area" text, "Authority" text, "Decile" real, "Roll" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the decile of the school with a roll larger than 513?
SELECT SUM("Decile") FROM table_68112 WHERE "Roll" > '513'
wikisql
CREATE TABLE mzb ( CLINIC_ID text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, INSU_TYPE text, IN...
SELECT COUNT(*) FROM zyb WHERE zyb.PERSON_SEX = '袁项明' AND zyb.IN_HOSP_DAYS BETWEEN '2020-10-22' AND '2021-08-10'
css
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 jybgb.BGDH FROM hz_info JOIN mzjzjlb JOIN jybgb 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 WHERE hz_info.person_info_XM = '姜岚翠' AND NOT jybgb.BGDH IN (SELECT jyjgzbb.BGDH FROM jyjgz...
css
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 * FROM hz_info JOIN mzjzjlb JOIN zyjybgb JOIN jyjgzbb 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 AND zyjybgb.YLJGDM = jyjgzbb.YLJGDM AND zyjybgb.BGDH = jyjgzbb.BGDH WHERE hz_inf...
css
CREATE TABLE table_name_24 ( latitude INTEGER, pop__2010_ VARCHAR, water__sqmi_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is latitude when 2010 population is 24 and water is more than 0.319?
SELECT MAX(latitude) FROM table_name_24 WHERE pop__2010_ = 24 AND water__sqmi_ > 0.319
sql_create_context
CREATE TABLE table_23486 ( "Season" real, "Network" text, "Host" text, "Contestants" real, "Winner" text, "Destination" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What network showed the season with Australia as the destination?
SELECT "Network" FROM table_23486 WHERE "Destination" = 'Australia'
wikisql
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) 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),...
SELECT JOB_ID, AVG(EMPLOYEE_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID ORDER BY AVG(EMPLOYEE_ID)
nvbench
CREATE TABLE student_tests_taken ( registration_id number, date_test_taken time, test_result text ) CREATE TABLE course_authors_and_tutors ( author_id number, author_tutor_atb text, login_name text, password text, personal_name text, middle_name text, family_name text, gende...
SELECT address_line_1 FROM course_authors_and_tutors
spider
CREATE TABLE table_name_41 ( team VARCHAR, shirt_sponsor VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the team captain for the team with sparkasse (d sseldorf) as the shirt sponsor?
SELECT team AS captain FROM table_name_41 WHERE shirt_sponsor = "sparkasse (düsseldorf)"
sql_create_context
CREATE TABLE table_14752 ( "Country" text, "Film title used in nomination" text, "Language" text, "Original name" text, "Director" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What title did the film from Colombia use in its nomination?
SELECT "Film title used in nomination" FROM table_14752 WHERE "Country" = 'colombia'
wikisql
CREATE TABLE table_name_85 ( attendance INTEGER, opponents VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the average attendance when the opponents are dundalk?
SELECT AVG(attendance) FROM table_name_85 WHERE opponents = "dundalk"
sql_create_context
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 comment_instructor ( instructor_id int, student_id int, score int, ...
SELECT COUNT(DISTINCT COURSE_1.department, COURSE_0.number) FROM course AS COURSE_0, course AS COURSE_1, course_prerequisite, student_record WHERE COURSE_0.course_id = course_prerequisite.pre_course_id AND COURSE_1.course_id = course_prerequisite.course_id AND COURSE_1.department = 'ORGSTUDY' AND COURSE_1.number = 215 ...
advising
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE diagnosis ( diag...
SELECT COUNT(*) FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-14712')) AND treatment.treatmentname = 'vasodilator - hydralazine' AND DATET...
eicu
CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId ...
SELECT dd.Id AS id, dd.Body AS body, dd.date AS date FROM (SELECT p.Id AS id, p.ParentId AS parentid, c.Text AS body, c.CreationDate AS date FROM (SELECT Id, ParentId FROM Posts WHERE Tags LIKE '%iquibase%' OR Tags LIKE '%iquidbase%') AS p JOIN Comments AS c ON p.Id = c.PostId) AS dd
sede
CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE student ( student_id int, lastname varchar, firstname varchar, program_id int, declare_major varchar, total_credit int, total_gpa float, entered_as varchar, a...
SELECT COUNT(*) > 0 FROM course WHERE department = 'EECS' AND has_lab = 'Y' AND number = 521
advising
CREATE TABLE table_838 ( "District" text, "Incumbent" text, "Party" text, "Elected" real, "Status" text, "2007 Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In what district was the incumbent Charles Hawkins?
SELECT "District" FROM table_838 WHERE "Incumbent" = 'Charles Hawkins'
wikisql
CREATE TABLE table_name_2 ( venue VARCHAR, competition VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- At what venue was the 2010 FIFA World Cup Qualification?
SELECT venue FROM table_name_2 WHERE competition = "2010 fifa world cup qualification"
sql_create_context
CREATE TABLE table_22402438_7 ( player VARCHAR, pick__number VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the player with the pick# 80?
SELECT player FROM table_22402438_7 WHERE pick__number = 80
sql_create_context
CREATE TABLE PersonFriend ( name varchar(20), friend varchar(20), year INTEGER ) CREATE TABLE Person ( name varchar(20), age INTEGER, city TEXT, gender TEXT, job TEXT ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How old is each gender, on ...
SELECT gender, AVG(age) FROM Person GROUP BY gender ORDER BY gender DESC
nvbench
CREATE TABLE voting_record ( stuid number, registration_date text, election_cycle text, president_vote number, vice_president_vote number, secretary_vote number, treasurer_vote number, class_president_vote number, class_senator_vote number ) CREATE TABLE student ( stuid number, ...
SELECT advisor FROM student GROUP BY advisor HAVING COUNT(*) > 2
spider
CREATE TABLE table_62327 ( "Month" text, "15th- 20th century" text, "U.S. (1912)" text, "U.S. (2013)" text, "Britain (2013)" text, "Hindu" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was Britain's (2013) birthstone when the U.S (2013) bi...
SELECT "Britain (2013)" FROM table_62327 WHERE "U.S. (2013)" = 'ruby'
wikisql
CREATE TABLE table_54847 ( "Team" text, "Nation" text, "From" text, "Matches" real, "Drawn" real, "Lost" real, "Win %" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the average lost for matches of 6
SELECT AVG("Lost") FROM table_54847 WHERE "Matches" = '6'
wikisql
CREATE TABLE table_12032 ( "Race" text, "Length" text, "Class" text, "Circuit" text, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which date was a GTS class on the Mosport International Raceway?
SELECT "Date" FROM table_12032 WHERE "Class" = 'gts' AND "Circuit" = 'mosport international raceway'
wikisql
CREATE TABLE table_10456 ( "Swedish title" text, "Norwegian title" text, "Translated title" text, "Published" text, "Pages" real, "ISBN" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Norwegian title has 218 pages and Translated Title of Br...
SELECT "Norwegian title" FROM table_10456 WHERE "Pages" = '218' AND "Translated title" = 'breaking dawn'
wikisql
CREATE TABLE table_53722 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Decision" text, "Attendance" real, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the score of the game on October 20 when the home team is...
SELECT "Score" FROM table_53722 WHERE "Home" = 'ny islanders' AND "Date" = 'october 20'
wikisql
CREATE TABLE table_name_87 ( rank VARCHAR, nation VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Denmark's rank?
SELECT rank FROM table_name_87 WHERE nation = "denmark"
sql_create_context
CREATE TABLE table_13636_1 ( computing_mechanism VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what's the computing mechanbeingm with name being atanasoff berry computer (us)
SELECT computing_mechanism FROM table_13636_1 WHERE name = "Atanasoff–Berry Computer (US)"
sql_create_context
CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) 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 varch...
SELECT DISTINCT name, number FROM course WHERE department = 'WOMENSTD' AND credits = 12
advising
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 * FROM t_kc22 WHERE MED_CLINIC_ID = '25464397708' AND MED_ORG_DEPT_NM LIKE '%超声%'
css
CREATE TABLE table_72246 ( "#" real, "Date" text, "Visitor" text, "Score" text, "Home" text, "Leading scorer" text, "Attendance" text, "Record" text, "Streak" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the total number of...
SELECT COUNT("Date") FROM table_72246 WHERE "Visitor" = 'New Jersey Nets'
wikisql
CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE job_history ( EMPLO...
SELECT JOB_ID, SUM(EMPLOYEE_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID ORDER BY JOB_ID
nvbench
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 MIN(t_kc24.MED_AMOUT), MAX(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT gwyjzb.MED_CLINIC_ID FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '7367933' AND gwyjzb.OUT_DIAG_DIS_NM = '复发性阿弗他溃疡' UNION SELECT fgwyjzb.MED_CLINIC_ID FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '7367933' AND fgwyjzb.OUT_...
css
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) C...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dod_year <= "2179.0" AND prescriptions.formulary_drug_cd = "METH10SY"
mimicsql_data
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE diagnosis ( diagnosisid number, ...
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 = '031-4987')) AND STRFTIME('%y-%m', microlab.culturetakentime) >= '...
eicu
CREATE TABLE table_16246 ( "DVD Name" text, "# of Ep" real, "Region 1" text, "Region 2" text, "Region 4" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What date did the DVD for season six come out in region 2?
SELECT "Region 2" FROM table_16246 WHERE "DVD Name" = 'Season Six'
wikisql
CREATE TABLE table_8661 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Record" text, "Game site" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the opponent on april 26, 2003?
SELECT "Opponent" FROM table_8661 WHERE "Date" = 'april 26, 2003'
wikisql
CREATE TABLE table_name_22 ( date VARCHAR, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what date has the record of 77-62?
SELECT date FROM table_name_22 WHERE record = "77-62"
sql_create_context
CREATE TABLE table_54807 ( "Frequency" text, "Call sign" text, "Name" text, "Format" text, "Owner" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the call sign for Thunder 106.1?
SELECT "Call sign" FROM table_54807 WHERE "Name" = 'thunder 106.1'
wikisql
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(*) FROM t_kc21 JOIN t_kc24 JOIN t_kc21_t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc24.MED_CLINIC_ID AND t_kc21_t_kc24.MED_SAFE_PAY_ID = t_kc24.MED_SAFE_PAY_ID WHERE t_kc21.PERSON_NM = '李勇锐' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2006-04-06' AND '2018-05-21' AND t_kc24.MED_AMOUT <= 10
css
CREATE TABLE table_dev_52 ( "id" int, "anemia" bool, "gender" string, "prediabetes" bool, "systolic_blood_pressure_sbp" int, "metabolic_syndrome" bool, "hemoglobin_a1c_hba1c" float, "dyslipidemia" bool, "dsp" int, "renal_disease" bool, "hepatic_disease" bool, "elevated_tr...
SELECT * FROM table_dev_52 WHERE prediabetes = 1 OR (fasting_glucose > 100 AND fasting_glucose < 126)
criteria2sql
CREATE TABLE table_name_92 ( date VARCHAR, winning_driver VARCHAR, location VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On what date did Ayrton Senna win at Imola?
SELECT date FROM table_name_92 WHERE winning_driver = "ayrton senna" AND location = "imola"
sql_create_context
CREATE TABLE table_name_76 ( score VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Score, when Date is December 23?
SELECT score FROM table_name_76 WHERE date = "december 23"
sql_create_context
CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean...
SELECT DISTINCT Tags.Id, Tags.Count, Tags.TagName, 'site://tags/' + Tags.TagName + '/info|Url' AS Url FROM Tags LEFT JOIN Posts ON Posts.Id = Tags.WikiPostId OR Posts.Id = Tags.ExcerptPostId WHERE (LOWER(Posts.Body) LIKE '%http://%.stackexchange.com%' OR LOWER(Posts.Body) LIKE '%http://stackexchange.com%' OR LOWER(Post...
sede
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CRE...
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 = '031-1337')) AND treatment.treatmentname = 'parenteral feeds - tpn' AND DATET...
eicu
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.religion = "PROTESTANT QUAKER" AND lab.itemid = "51447"
mimicsql_data
CREATE TABLE table_40187 ( "Name" text, "Date of Birth" text, "Height" real, "Weight" real, "Spike" real, "Block" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest block that has a height less than 202, 19.06.1980 as the date of ...
SELECT MIN("Block") FROM table_40187 WHERE "Height" < '202' AND "Date of Birth" = '19.06.1980' AND "Weight" > '76'
wikisql
CREATE TABLE table_name_18 ( round__number INTEGER, pick__number VARCHAR, position VARCHAR, college VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average round number with wide receiver as position and Clark University as the college and...
SELECT AVG(round__number) FROM table_name_18 WHERE position = "wide receiver" AND college = "clark university" AND pick__number > 166
sql_create_context
CREATE TABLE table_204_273 ( id number, "date" text, "opponent" text, "venue" text, "result" text, "scorers" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many different players scored for the san jose earthquakes during their 1979 home ope...
SELECT "scorers" FROM table_204_273 WHERE id = 1
squall
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 demographic (...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "AMERICAN INDIAN/ALASKA NATIVE" AND prescriptions.drug = "Magnesium Oxide"
mimicsql_data
CREATE TABLE fare_basis ( fare_basis_code text, booking_class text, class_type text, premium text, economy text, discounted text, night text, season text, basis_days text ) CREATE TABLE flight ( aircraft_code_sequence text, airline_code varchar, airline_flight text, ...
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 = 'CHICAGO')) AND to_airport IN (SELECT AIRPORT_...
atis
CREATE TABLE table_1341598_36 ( candidates VARCHAR, district VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who were the candidates for district ohio 6?
SELECT candidates FROM table_1341598_36 WHERE district = "Ohio 6"
sql_create_context
CREATE TABLE table_35625 ( "Triple" real, "Game" real, "Date" text, "Inning" text, "Location" text, "Opposing Pitcher" text, "Team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is was Date that where Triple was smaller than 26, and Ga...
SELECT "Date" FROM table_35625 WHERE "Triple" < '26' AND "Game" = '25'
wikisql
CREATE TABLE table_38979 ( "Game" real, "December" real, "Opponent" text, "Score" text, "Record" text, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which December has Points of 38, and a Record of 18 6 2?
SELECT AVG("December") FROM table_38979 WHERE "Points" = '38' AND "Record" = '18–6–2'
wikisql
CREATE TABLE table_name_90 ( position VARCHAR, year VARCHAR, notes VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the position in 2010 with team notes?
SELECT position FROM table_name_90 WHERE year = 2010 AND notes = "team"
sql_create_context