instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_23404 ( "No. overall" text, "No. in series" real, "Family/families" text, "Location(s)" text, "Original air date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many original air date where family/families is the ryder family ...
SELECT COUNT("Original air date") FROM table_23404 WHERE "Family/families" = 'The Ryder Family and The Schwartz Family'
wikisql
CREATE TABLE table_10753917_1 ( season VARCHAR, driver VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many seasons was clay regazzoni the driver?
SELECT COUNT(season) FROM table_10753917_1 WHERE driver = "Clay Regazzoni"
sql_create_context
CREATE TABLE table_243664_1 ( real_life_eventual_outcome VARCHAR, currently¹_part_of VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the real life for eventual outcome is amtrak
SELECT real_life_eventual_outcome FROM table_243664_1 WHERE currently¹_part_of = "Amtrak"
sql_create_context
CREATE TABLE table_9893 ( "Game" real, "Date" text, "Opponent" text, "Score" text, "Location" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the score for game 38?
SELECT "Score" FROM table_9893 WHERE "Game" = '38'
wikisql
CREATE TABLE table_22747 ( "Player" text, "Original Season" text, "Gender" text, "Eliminated" text, "Placing" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the gender of the contestant on RR: South Pacific season?
SELECT "Gender" FROM table_22747 WHERE "Original Season" = 'RR: South Pacific'
wikisql
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 course.department, course.name, course.number FROM course, course_offering, program_course, semester WHERE course_offering.start_time > '12:30' AND course.course_id = course_offering.course_id AND program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id AND semester.semester...
advising
CREATE TABLE table_9927 ( "Rank" real, "Title" text, "Studio" text, "Director(s)" text, "Worldwide Gross" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who has the title and rank 14, and a worldwide gross of $202,292,902?
SELECT "Title" FROM table_9927 WHERE "Rank" > '14' AND "Worldwide Gross" = '$202,292,902'
wikisql
CREATE TABLE CLASS ( CLASS_CODE varchar(5), CRS_CODE varchar(10), CLASS_SECTION varchar(2), CLASS_TIME varchar(20), CLASS_ROOM varchar(8), PROF_NUM int ) CREATE TABLE COURSE ( CRS_CODE varchar(10), DEPT_CODE varchar(10), CRS_DESCRIPTION varchar(35), CRS_CREDIT float(8) ) CREATE...
SELECT CLASS_ROOM, COUNT(*) FROM CLASS GROUP BY CLASS_ROOM ORDER BY COUNT(*) DESC
nvbench
CREATE TABLE table_25131572_2 ( fox_int_channels_air_date VARCHAR, series__number VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many times was episode 5 in the series aired on Fox int.?
SELECT COUNT(fox_int_channels_air_date) FROM table_25131572_2 WHERE series__number = 5
sql_create_context
CREATE TABLE table_name_93 ( country VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where is Fred Haas from?
SELECT country FROM table_name_93 WHERE player = "fred haas"
sql_create_context
CREATE TABLE table_55499 ( "Round" real, "Overall" real, "Player" text, "Nationality" text, "Club team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What round does Bryan Berard do?
SELECT "Round" FROM table_55499 WHERE "Player" = 'bryan berard'
wikisql
CREATE TABLE table_name_95 ( pick INTEGER, nba_club VARCHAR, year VARCHAR, round VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the sum for the pick of the year 2009, and a round smaller than 2 and an NBA Club Denver Nuggets?
SELECT SUM(pick) FROM table_name_95 WHERE year = 2009 AND round < 2 AND nba_club = "denver nuggets"
sql_create_context
CREATE TABLE table_27683516_3 ( date_of_appointment VARCHAR, date_of_vacancy VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the date of appointment when the date of vacancy is 24 november 2010?
SELECT date_of_appointment FROM table_27683516_3 WHERE date_of_vacancy = "24 November 2010"
sql_create_context
CREATE TABLE table_name_78 ( date VARCHAR, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Date has a Record of 58 10?
SELECT date FROM table_name_78 WHERE record = "58–10"
sql_create_context
CREATE TABLE table_57676 ( "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. -- Tell me the venue for 8 june 1931 for st kilda a...
SELECT "Venue" FROM table_57676 WHERE "Date" = '8 june 1931' AND "Away team" = 'st kilda'
wikisql
CREATE TABLE table_20026849_1 ( season INTEGER, winner VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What season was won by Ashutosh Kaushik?
SELECT MIN(season) FROM table_20026849_1 WHERE winner = "Ashutosh Kaushik"
sql_create_context
CREATE TABLE table_41773 ( "Built" real, "Number" real, "Type" text, "SLM Number" real, "Wheel arrangement" text, "Location" text, "Notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What locomotive built after 1895 has the highest SLM nu...
SELECT MAX("SLM Number") FROM table_41773 WHERE "Built" > '1895'
wikisql
CREATE TABLE table_name_31 ( player VARCHAR, place VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Player has a Place of t2?
SELECT player FROM table_name_31 WHERE place = "t2"
sql_create_context
CREATE TABLE table_name_28 ( vertices INTEGER, dual_archimedean_solid VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Vertices have a Dual Archimedean solid of truncated dodecahedron?
SELECT MAX(vertices) FROM table_name_28 WHERE dual_archimedean_solid = "truncated dodecahedron"
sql_create_context
CREATE TABLE table_12141 ( "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 "Club" FROM table_12141 WHERE "Points" = '77'
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.discharge_location = "HOME" AND procedures.short_title = "Arterial catheterization"
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 prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, ...
SELECT AVG(demographic.age) FROM demographic WHERE demographic.admission_type = "EMERGENCY" AND demographic.diagnosis = "ST-SEGMENT ELEVATION MYOCARDIAL INFARCTION\CARDIAC CATH"
mimicsql_data
CREATE TABLE table_71328 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Game site" text, "Record" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the record for the result w 33-3?
SELECT "Record" FROM table_71328 WHERE "Result" = 'w 33-3'
wikisql
CREATE TABLE table_23677 ( "No." real, "#" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" real, "Television order" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many episodes d...
SELECT COUNT("No.") FROM table_23677 WHERE "Directed by" = 'Ben Jones' AND "Written by" = 'Paul Dini'
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 * FROM t_kc21 WHERE MED_SER_ORG_NO = '1303547' AND IN_HOSP_DATE BETWEEN '2003-02-21' AND '2005-09-08') EXCEPT (SELECT * FROM t_kc21 WHERE MED_SER_ORG_NO = '1303547' AND IN_HOSP_DATE BETWEEN '2003-02-21' AND '2005-09-08' AND MED_ORG_DEPT_NM = '乳腺外科')
css
CREATE TABLE ROLES ( role_description VARCHAR, role_code VARCHAR ) CREATE TABLE Employees ( role_code VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many employees does each role have? List role description, id and number of employees.
SELECT T1.role_description, T2.role_code, COUNT(*) FROM ROLES AS T1 JOIN Employees AS T2 ON T1.role_code = T2.role_code GROUP BY T2.role_code
sql_create_context
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE d_items ( ...
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT icustays.hadm_id FROM icustays WHERE icustays.icustay_id IN (SELECT inputevents_cv.icustay_id FROM inputevents_cv WHERE inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'impact w/fiber 2/3'...
mimic_iii
CREATE TABLE table_75282 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Record has a Score of 2 4, and a Home of quebec nordiques?
SELECT "Record" FROM table_75282 WHERE "Score" = '2–4' AND "Home" = 'quebec nordiques'
wikisql
CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city...
SELECT DISTINCT instructor.name FROM instructor INNER JOIN offering_instructor ON offering_instructor.instructor_id = instructor.instructor_id INNER JOIN student_record ON student_record.offering_id = offering_instructor.offering_id INNER JOIN student ON student.student_id = student_record.student_id INNER JOIN course_...
advising
CREATE TABLE table_name_75 ( team VARCHAR, played VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What team played between the years of 2008-2010?
SELECT team FROM table_name_75 WHERE played = "2008-2010"
sql_create_context
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 MED_CLINIC_ID FROM t_kc21 WHERE PERSON_ID = '31359834' AND MED_SER_ORG_NO = '7783640' AND IN_DIAG_DIS_NM LIKE '%龈乳头炎%'
css
CREATE TABLE table_37663 ( "Name" text, "Period" text, "Starts" real, "Wins" real, "Losses" real, "Ties" real, "Win %" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Losses have a Name of jimmy clausen?
SELECT AVG("Losses") FROM table_37663 WHERE "Name" = 'jimmy clausen'
wikisql
CREATE TABLE table_train_109 ( "id" int, "serum_potassium" float, "systolic_blood_pressure_sbp" int, "body_mass_index_bmi" float, "hypertension" bool, "NOUSE" float ) -- Using valid SQLite, answer the following questions for the tables provided above. -- body mass index ( bmi ) of >= 18 kg / ...
SELECT * FROM table_train_109 WHERE body_mass_index_bmi >= 18 AND body_mass_index_bmi <= 32
criteria2sql
CREATE TABLE table_27541 ( "Season" text, "Series" text, "Team" text, "Races" real, "Wins" real, "Poles" real, "F/Laps" real, "Podiums" real, "Points" text, "Position" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What team has ...
SELECT "Team" FROM table_27541 WHERE "Points" = '137'
wikisql
CREATE TABLE table_name_22 ( moving_from VARCHAR, type VARCHAR, nat VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the moving from with a transfer and the nationality of Bra?
SELECT moving_from FROM table_name_22 WHERE type = "transfer" AND nat = "bra"
sql_create_context
CREATE TABLE table_45670 ( "Macedonian population in Vojvodina" text, "1961" real, "Number 1971" real, "1981" real, "1991" real, "2002" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the 1961 total of the Macedonian population with a 197...
SELECT COUNT("1961") FROM table_45670 WHERE "Number 1971" = '3325' AND "1991" > '3177'
wikisql
CREATE TABLE table_11452830_2 ( attendance VARCHAR, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many crowds watched the game where the record was 1-3?
SELECT COUNT(attendance) FROM table_11452830_2 WHERE record = "1-3"
sql_create_context
CREATE TABLE table_1974632_1 ( type VARCHAR, institution VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what type of institution is alvernia university
SELECT type FROM table_1974632_1 WHERE institution = "Alvernia University"
sql_create_context
CREATE TABLE address ( address_id number, address text, address2 text, district text, city_id number, postal_code text, phone text, last_update time ) CREATE TABLE country ( country_id number, country text, last_update time ) CREATE TABLE city ( city_id number, city...
SELECT store_id FROM customer GROUP BY store_id ORDER BY COUNT(*) DESC LIMIT 1
spider
CREATE TABLE table_10824 ( "Year" real, "Artist" text, "Mintage (Proof)" text, "Issue Price (Proof)" text, "Mintage (BU)[ clarification needed ]" text, "Issue Price (BU)[ clarification needed ]" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Wha...
SELECT AVG("Year") FROM table_10824 WHERE "Issue Price (Proof)" = '$49.95' AND "Artist" = 'w.h.j. blakemore'
wikisql
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id n...
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', transfers.intime)) FROM transfers WHERE transfers.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 72909 AND admissions.dischtime IS NULL)) AND transfers....
mimic_iii
CREATE TABLE table_name_66 ( score VARCHAR, attendance VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which score was associated with an attendance of 275?
SELECT score FROM table_name_66 WHERE attendance = 275
sql_create_context
CREATE TABLE table_74789 ( "Place" real, "Rider" text, "Country" text, "Machine" text, "Speed" text, "Time" text, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which place has points larger than 1, a bmw machine, and a time of 1:18...
SELECT MIN("Place") FROM table_74789 WHERE "Points" > '1' AND "Machine" = 'bmw' AND "Time" = '1:18.47.6'
wikisql
CREATE TABLE table_69806 ( "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 of the 3-0 Win result?
SELECT "Score" FROM table_69806 WHERE "Result" = '3-0 win'
wikisql
CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC text, RYBH text, XBDM number, XBMC text, XLDM text, XLMC text, XM text, ZYLBDM text, ZYMC text ) CREATE TABLE hz_info ( KH text, KLX number...
SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN jybgb_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 = jybgb_jyjgzbb.YLJGDM ...
css
CREATE TABLE Ref_Incident_Type ( incident_type_code VARCHAR(10), incident_type_description VARCHAR(80) ) CREATE TABLE Ref_Detention_Type ( detention_type_code VARCHAR(10), detention_type_description VARCHAR(80) ) CREATE TABLE Students_in_Detention ( student_id INTEGER, detention_id INTEGER, ...
SELECT date_address_to, COUNT(date_address_to) FROM Student_Addresses GROUP BY date_address_to ORDER BY monthly_rental DESC
nvbench
CREATE TABLE table_2865020_5 ( average VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What 2003-2004 values are associated with an average of 1.377?
SELECT 2003 AS _04 FROM table_2865020_5 WHERE average = "1.377"
sql_create_context
CREATE TABLE table_57032 ( "Team" text, "Location" text, "Venue" text, "League and position in 1991" text, "Coach" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where is Shakhtar-2 located?
SELECT "Location" FROM table_57032 WHERE "Team" = 'shakhtar-2'
wikisql
CREATE TABLE table_69285 ( "Year" real, "Entrant" text, "Chassis" text, "Engine" text, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the highest number of points with an Entrant of warsteiner brewery?
SELECT MAX("Points") FROM table_69285 WHERE "Entrant" = 'warsteiner brewery'
wikisql
CREATE TABLE table_17265535_7 ( equation VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- If the equation is 8 9 + 8 9 + 8, what is the 2nd throw?
SELECT MIN(2 AS nd_throw) FROM table_17265535_7 WHERE equation = "8 × 9² + 8 × 9 + 8"
sql_create_context
CREATE TABLE table_name_12 ( power__kw_ VARCHAR, coverage__transmitter_site_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Power (kW), when Coverage (Transmitter Site) is 'Lucena'?
SELECT power__kw_ FROM table_name_12 WHERE coverage__transmitter_site_ = "lucena"
sql_create_context
CREATE TABLE table_46987 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name of the away team with a Tie no of 7?
SELECT "Away team" FROM table_46987 WHERE "Tie no" = '7'
wikisql
CREATE TABLE zyb ( CLINIC_ID text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, INSU_TYPE text, IN...
SELECT MIN(t_kc24.MED_AMOUT), MAX(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 = '7367933' AND qtb.OUT_DIAG_DIS_NM = '复发性阿弗他溃疡' UNION SELECT gyb.MED_CLINIC_ID FROM gyb WHERE gyb.MED_SER_ORG_NO = '7367933' AND gyb.OUT_DIAG_DIS_NM = '复发性阿弗他溃疡' UNI...
css
CREATE TABLE Student_Course_Enrolment ( registration_id INTEGER, student_id INTEGER, course_id INTEGER, date_of_enrolment DATETIME, date_of_completion DATETIME ) CREATE TABLE Student_Tests_Taken ( registration_id INTEGER, date_test_taken DATETIME, test_result VARCHAR(255) ) CREATE TABL...
SELECT personal_name, gender_mf FROM Course_Authors_and_Tutors ORDER BY personal_name
nvbench
CREATE TABLE table_79095 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text, "Money ( \u00a3 )" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Score, when Money ( ) is greater than 35,000, and when Country is 'Uni...
SELECT "Score" FROM table_79095 WHERE "Money ( \u00a3 )" > '35,000' AND "Country" = 'united states'
wikisql
CREATE TABLE table_name_32 ( tournament VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What tournament shows 2013 as 2r, and a 2010 as 1r?
SELECT tournament FROM table_name_32 WHERE 2013 = "2r" AND 2010 = "1r"
sql_create_context
CREATE TABLE hz_info ( KH text, KLX number, YLJGDM text, RYBH text ) CREATE TABLE jybgb ( YLJGDM text, YLJGDM_MZJZJLB text, YLJGDM_ZYJZJLB text, BGDH text, BGRQ time, JYLX number, JZLSH text, JZLSH_MZJZJLB text, JZLSH_ZYJZJLB text, JZLX number, KSBM text, ...
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb 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 = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB ...
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, SUM(Team_ID) FROM basketball_match GROUP BY All_Home
nvbench
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE vitalperiodic ( ...
SELECT t1.diagnosisname FROM (SELECT diagnosis.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age BETWEEN 30 AND 39) AND DATETIME(diagnosis.diagnosistime) <= DATETIME(CURRENT_TIME(), '-1 yea...
eicu
CREATE TABLE aircraft ( aircraft_code varchar, aircraft_description varchar, manufacturer varchar, basic_type varchar, engines int, propulsion varchar, wide_body varchar, wing_span int, length int, weight int, capacity int, pay_load int, cruising_speed int, range_...
SELECT DISTINCT advance_purchase, application, maximum_stay, minimum_stay, no_discounts, restriction_code, saturday_stay_required, stopovers FROM restriction WHERE restriction_code = 'AP/80'
atis
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 number FROM course WHERE (description LIKE '%Creative Writing-Poetry%' OR name LIKE '%Creative Writing-Poetry%') AND department = 'EECS'
advising
CREATE TABLE exhibition ( Exhibition_ID int, Year int, Theme text, Artist_ID int, Ticket_Price real ) CREATE TABLE artist ( Artist_ID int, Name text, Country text, Year_Join int, Age int ) CREATE TABLE exhibition_record ( Exhibition_ID int, Date text, Attendance int...
SELECT Year, COUNT(Year) FROM exhibition GROUP BY Theme ORDER BY COUNT(Year) DESC
nvbench
CREATE TABLE table_name_67 ( producer_director VARCHAR, film VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the Producer/Director of Political Engagement?
SELECT producer_director FROM table_name_67 WHERE film = "political engagement"
sql_create_context
CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE ReviewTaskSt...
SELECT COUNT(*) FROM Users AS u LEFT OUTER JOIN Posts AS p ON u.Id = p.OwnerUserId WHERE LastAccessDate < CURRENT_TIMESTAMP() - 365 AND UpVotes = 0 AND DownVotes = 0 AND p.Id IS NULL AND Reputation = 1
sede
CREATE TABLE table_1251878_1 ( width VARCHAR, frame_size VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what's the width with frame size being 4.5k
SELECT width FROM table_1251878_1 WHERE frame_size = "4.5K"
sql_create_context
CREATE TABLE table_15308 ( "Club" text, "Played" text, "Drawn" text, "Lost" text, "Points for" text, "Points against" text, "Tries for" text, "Tries against" text, "Try bonus" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many g...
SELECT "Played" FROM table_15308 WHERE "Points for" = '369'
wikisql
CREATE TABLE Faculty ( FacID INTEGER, Lname VARCHAR(15), Fname VARCHAR(15), Rank VARCHAR(15), Sex VARCHAR(1), Phone INTEGER, Room VARCHAR(5), Building VARCHAR(13) ) CREATE TABLE Faculty_Participates_in ( FacID INTEGER, actid INTEGER ) CREATE TABLE Participates_in ( stuid IN...
SELECT activity_name, COUNT(*) FROM Activity AS T1 JOIN Faculty_Participates_in AS T2 ON T1.actid = T2.actid GROUP BY T1.actid
nvbench
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 BGDH FROM jybgb WHERE JZLSH = '13021515758' AND NOT KSMC LIKE '%手术%'
css
CREATE TABLE film ( Film_ID int, Title text, Studio text, Director text, Gross_in_dollar int ) CREATE TABLE film_market_estimation ( Estimation_ID int, Low_Estimate real, High_Estimate real, Film_ID int, Type text, Market_ID int, Year int ) CREATE TABLE market ( Mar...
SELECT Type, COUNT(Type) FROM film AS T1 JOIN film_market_estimation AS T2 ON T1.Film_ID = T2.Film_ID GROUP BY Type ORDER BY Type
nvbench
CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, ...
SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.patientunitstayid IN (SELECT treatment.patientunitstayid FROM treatment WHERE treatment.treatmentname = 'surgery consultation' AND DATETIME(treatment.treatmenttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year'))
eicu
CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, LastAutoRename time, Score number, ApprovedByUserId number, ApprovalDate ti...
SELECT v.CreationDate, COUNT(CASE WHEN v.VoteTypeId = 2 THEN 1 END) AS UpVotes, COUNT(CASE WHEN v.VoteTypeId = 3 THEN 1 END) AS DownVotes, SUM(CASE WHEN v.VoteTypeId = 2 THEN 1 WHEN v.VoteTypeId = 3 THEN -1 END) AS NetVotes FROM Votes AS v INNER JOIN Posts ON v.PostId = Posts.Id AND (v.VoteTypeId = 2 OR v.VoteTypeId = ...
sede
CREATE TABLE table_1379 ( "No. in series" real, "Title" text, "Directed by" text, "Written by" text, "U.S. viewers (million)" text, "Original air date" text, "Production code" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many episodes ...
SELECT COUNT("Original air date") FROM table_1379 WHERE "U.S. viewers (million)" = '5.1'
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 COUNT(*) FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_NM = '俞虹影' AND t_kc22.STA_DATE BETWEEN '2014-05-05' AND '2019-01-16' AND t_kc22.MED_INV_ITEM_TYPE = '检查费'
css
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) 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 t...
SELECT demographic.days_stay, demographic.expire_flag FROM demographic WHERE demographic.name = "Glen Tanner"
mimicsql_data
CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Percent text, ACC_Home text, ACC_Road text, All_Games text, All_Games_Percent int, All_Home text, All_Road text, All_Neutral text ) CREATE TABLE university ( Scho...
SELECT All_Home, COUNT(All_Home) FROM basketball_match GROUP BY All_Home ORDER BY All_Home
nvbench
CREATE TABLE table_38824 ( "Make/ Model" text, "Length" text, "Year" real, "Numbers (Quantity Ordered)" text, "Fuel Propulsion" text, "Year Retired" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- For the year 1975, what is Propulsion, with a Num...
SELECT "Fuel Propulsion" FROM table_38824 WHERE "Year" = '1975' AND "Numbers (Quantity Ordered)" = '4756-4788 (33 buses)'
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 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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_type = "NEWBORN" AND prescriptions.drug = "Metronidazole"
mimicsql_data
CREATE TABLE table_name_50 ( venue VARCHAR, score VARCHAR, city VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where in Buxton has 3 runs?
SELECT venue FROM table_name_50 WHERE score = "3 runs" AND city = "buxton"
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 diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "31" AND lab.itemid = "50820"
mimicsql_data
CREATE TABLE grants ( grant_id number, organisation_id number, grant_amount number, grant_start_date time, grant_end_date time, other_details text ) CREATE TABLE project_outcomes ( project_id number, outcome_code text, outcome_details text ) CREATE TABLE projects ( project_id n...
SELECT T1.response_received_date FROM documents AS T1 JOIN document_types AS T2 ON T1.document_type_code = T2.document_type_code JOIN grants AS T3 ON T1.grant_id = T3.grant_id WHERE T2.document_description = 'Regular' OR T3.grant_amount > 100
spider
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 qtb.IN_DIAG_DIS_CD, qtb.IN_DIAG_DIS_NM FROM qtb WHERE qtb.PERSON_ID = '55178621' AND qtb.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT > 9322.98) UNION SELECT gyb.IN_DIAG_DIS_CD, gyb.IN_DIAG_DIS_NM FROM gyb WHERE gyb.PERSON_ID = '55178621' AND gyb.MED_CLINIC_ID IN (SELECT t_kc2...
css
CREATE TABLE table_name_86 ( date VARCHAR, record VARCHAR, game VARCHAR, team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When Date has a Game larger than 4 and a Team of san antonio, and a Record of 4-3?
SELECT date FROM table_name_86 WHERE game > 4 AND team = "san antonio" AND record = "4-3"
sql_create_context
CREATE TABLE table_74672 ( "Institution" text, "Nickname" text, "Location" text, "Founded" real, "Type" text, "Enrollment" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which public college has a nickname of The Grenadiers?
SELECT "Institution" FROM table_74672 WHERE "Type" = 'public' AND "Nickname" = 'grenadiers'
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 demographic.admittime FROM demographic WHERE demographic.subject_id = "94762"
mimicsql_data
CREATE TABLE table_1231316_4 ( country VARCHAR, athlete VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where is Tamunosiki Atorudibo from
SELECT country FROM table_1231316_4 WHERE athlete = "Tamunosiki Atorudibo"
sql_create_context
CREATE TABLE Ref_Document_Types ( Document_Type_Code CHAR(15), Document_Type_Name VARCHAR(255), Document_Type_Description VARCHAR(255) ) CREATE TABLE All_Documents ( Document_ID INTEGER, Date_Stored DATETIME, Document_Type_Code CHAR(15), Document_Name CHAR(255), Document_Description CHA...
SELECT Location_Code, COUNT(*) FROM Document_Locations GROUP BY Location_Code ORDER BY Location_Code
nvbench
CREATE TABLE table_35344 ( "Designation" text, "Bore" text, "Weight" text, "Service Charge" text, "Range (yards)" text, "Number Made" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the bore of the boat howitzers with a 12-pdr heavy desig...
SELECT "Bore" FROM table_35344 WHERE "Designation" = '12-pdr heavy'
wikisql
CREATE TABLE table_name_5 ( draws INTEGER, goal_difference VARCHAR, played VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Can you tell me the highest Draws that has the Goal Difference smaller than 64, and the Played larger than 30?
SELECT MAX(draws) FROM table_name_5 WHERE goal_difference < 64 AND played > 30
sql_create_context
CREATE TABLE table_name_67 ( home_town VARCHAR, weight VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Home Town had the weight of 201?
SELECT home_town FROM table_name_67 WHERE weight = 201
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 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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND lab.fluid = "Joint Fluid"
mimicsql_data
CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE Suggeste...
SELECT COUNT(p.Id) AS "question_count", p.OwnerUserId AS "user_link" FROM Posts AS p WHERE p.PostTypeId = 1 AND NOT p.OwnerUserId IS NULL GROUP BY p.OwnerUserId ORDER BY 1 DESC LIMIT 100
sede
CREATE TABLE table_name_43 ( rank VARCHAR, publication VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What rank is the publication the observer music monthly?
SELECT rank FROM table_name_43 WHERE publication = "the observer music monthly"
sql_create_context
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREA...
SELECT vitalperiodic.observationtime FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '022-78423')) AND vitalperiodic.sao2 > 93.0 AND NOT ...
eicu
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number,...
SELECT COUNT(DISTINCT t2.uniquepid) FROM (SELECT t1.uniquepid, t1.diagnosistime, t1.patienthealthsystemstayid FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = ...
eicu
CREATE TABLE STUDENT ( STU_NUM int, STU_LNAME varchar(15), STU_FNAME varchar(15), STU_INIT varchar(1), STU_DOB datetime, STU_HRS int, STU_CLASS varchar(2), STU_GPA float(8), STU_TRANSFER numeric, DEPT_CODE varchar(18), STU_PHONE varchar(4), PROF_NUM int ) CREATE TABLE PR...
SELECT STU_FNAME, SUM(STU_GPA) FROM STUDENT WHERE STU_GPA < (SELECT AVG(STU_GPA) FROM STUDENT) GROUP BY STU_FNAME ORDER BY STU_FNAME
nvbench
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE medication ( medicationid n...
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', treatment.treatmenttime)) FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '035-2205'...
eicu
CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) CREATE TABLE medication ( medi...
SELECT t3.culturesite FROM (SELECT t2.culturesite, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'bacteremi...
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 t_kc24.ILL_PAY FROM t_kc24 JOIN t_kc21_t_kc24 JOIN t_kc21 ON t_kc21_t_kc24.MED_SAFE_PAY_ID = t_kc24.MED_SAFE_PAY_ID AND t_kc21_t_kc24.MED_CLINIC_ID = t_kc21.MED_CLINIC_ID WHERE t_kc21.MED_CLINIC_ID = '22142381204'
css
CREATE TABLE COURSE ( CRS_CODE varchar(10), DEPT_CODE varchar(10), CRS_DESCRIPTION varchar(35), CRS_CREDIT float(8) ) CREATE TABLE EMPLOYEE ( EMP_NUM int, EMP_LNAME varchar(15), EMP_FNAME varchar(12), EMP_INITIAL varchar(1), EMP_JOBCODE varchar(5), EMP_HIREDATE datetime, EMP...
SELECT EMP_HIREDATE, COUNT(EMP_HIREDATE) FROM EMPLOYEE AS T1 JOIN PROFESSOR AS T2 ON T1.EMP_NUM = T2.EMP_NUM WHERE T2.PROF_OFFICE = 'DRE 102' ORDER BY COUNT(EMP_HIREDATE)
nvbench
CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, UpVotes number, DownVotes number, ProfileImageUrl text, EmailHash text, AccountId number ) CRE...
SELECT COUNT(q.Id) FROM Posts AS q WHERE q.PostTypeId = 1 AND YEAR(q.CreationDate) = 2019
sede