instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_21269143_1 ( opponent VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the total number of opponets for 05/09/2009
SELECT COUNT(opponent) FROM table_21269143_1 WHERE date = "05/09/2009"
sql_create_context
CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, P...
SELECT COUNT(DISTINCT answers.OwnerUserId) FROM Posts, PostTags, Tags, Posts AS answers WHERE Posts.Id = PostTags.PostId AND PostTags.TagId = Tags.Id AND Tags.TagName = 'neo4j' AND answers.PostTypeId = 2 AND answers.ParentId = Posts.Id AND answers.CommunityOwnedDate IS NULL AND Posts.CommunityOwnedDate IS NULL
sede
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid num...
SELECT t3.labname FROM (SELECT t2.labname, 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 = 'hypomagnesemia' A...
eicu
CREATE TABLE Customers ( customer_id INTEGER, customer_first_name VARCHAR(20), customer_last_name VARCHAR(20), customer_address VARCHAR(255), customer_phone VARCHAR(255), customer_email VARCHAR(255), other_customer_details VARCHAR(255) ) CREATE TABLE Financial_Transactions ( transaction...
SELECT customer_id, account_name FROM Accounts
nvbench
CREATE TABLE table_name_72 ( rank INTEGER, nationality VARCHAR, lane VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total national rank of Canada with lanes larger than 3?
SELECT SUM(rank) FROM table_name_72 WHERE nationality = "canada" AND lane > 3
sql_create_context
CREATE TABLE Subjects ( subject_id INTEGER, subject_name VARCHAR(120) ) CREATE TABLE Student_Tests_Taken ( registration_id INTEGER, date_test_taken DATETIME, test_result VARCHAR(255) ) CREATE TABLE Students ( student_id INTEGER, date_of_registration DATETIME, date_of_latest_logon DATET...
SELECT middle_name, author_id FROM Course_Authors_and_Tutors ORDER BY personal_name
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 demographic.dischtime FROM demographic WHERE demographic.subject_id = "6983"
mimicsql_data
CREATE TABLE table_17311797_8 ( high_points VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who had the high points on February 6?
SELECT high_points FROM table_17311797_8 WHERE date = "February 6"
sql_create_context
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE d_icd_diag...
SELECT DISTINCT cost.cost FROM cost WHERE cost.event_type = 'diagnoses_icd' AND cost.event_id IN (SELECT diagnoses_icd.row_id FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'atrophic vaginitis'))
mimic_iii
CREATE TABLE table_947 ( "No." text, "Name" text, "Livery" text, "Arrival" real, "Type" text, "Configuration" text, "Builder" text, "Built" real, "Status" text, "Location" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is th...
SELECT MAX("Arrival") FROM table_947 WHERE "Name" = 'Greenbat'
wikisql
CREATE TABLE table_19130829_4 ( team__number2 VARCHAR, team__number1 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the team #2 in the round where team #1 is Iraklis?
SELECT team__number2 FROM table_19130829_4 WHERE team__number1 = "Iraklis"
sql_create_context
CREATE TABLE table_name_26 ( set_3 VARCHAR, total VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Set 3 when the total was 53 75?
SELECT set_3 FROM table_name_26 WHERE total = "53–75"
sql_create_context
CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, ...
SELECT DISTINCT t1.c1 FROM (SELECT lab.labresult, PERCENT_RANK() OVER (ORDER BY lab.labresult) AS c1 FROM lab WHERE lab.labname = 'alt (sgpt)' AND lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age = (SELECT patient.age FROM patient WHERE patient.uniquepid = '015-21757' AND NOT pa...
eicu
CREATE TABLE table_name_31 ( team__b_ VARCHAR, match_date VARCHAR, s_no VARCHAR, margin VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Team (B), when S No is less than 18, when Margin is 8 Wickets, and when Match Date is Oct 30, 1989?
SELECT team__b_ FROM table_name_31 WHERE s_no < 18 AND margin = "8 wickets" AND match_date = "oct 30, 1989"
sql_create_context
CREATE TABLE table_name_34 ( area__km²_ INTEGER, county VARCHAR, population VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the area (km ) of Nairnshire county, which has a population less than 11,050?
SELECT SUM(area__km²_) FROM table_name_34 WHERE county = "nairnshire" AND population < 11 OFFSET 050
sql_create_context
CREATE TABLE table_name_21 ( losses INTEGER, points VARCHAR, goals_against VARCHAR, goal_difference VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many losses when goals against are more than 17, goal difference is more than 2 and points are more...
SELECT AVG(losses) FROM table_name_21 WHERE goals_against > 17 AND goal_difference < 2 AND points > 5
sql_create_context
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id numbe...
SELECT t1.drug FROM (SELECT prescriptions.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM prescriptions WHERE DATETIME(prescriptions.startdate) <= DATETIME(CURRENT_TIME(), '-4 year') GROUP BY prescriptions.drug) AS t1 WHERE t1.c1 <= 4
mimic_iii
CREATE TABLE table_18654 ( "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. -- How many winners were there in the Georgia 1 district?
SELECT COUNT("First elected") FROM table_18654 WHERE "District" = 'Georgia 1'
wikisql
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE l...
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 table_8603 ( "Rank" text, "Runs" text, "Player" text, "Opponent" text, "Venue" text, "Season" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who has Runs of 124?
SELECT "Player" FROM table_8603 WHERE "Runs" = '124'
wikisql
CREATE TABLE artist ( Artist_ID int, Artist text, Age int, Famous_Title text, Famous_Release_date text ) CREATE TABLE volume ( Volume_ID int, Volume_Issue text, Issue_Date text, Weeks_on_Top real, Song text, Artist_ID int ) CREATE TABLE music_festival ( ID int, Musi...
SELECT Category, COUNT(*) FROM music_festival GROUP BY Category ORDER BY Category
nvbench
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 COUNT(DISTINCT patient.patienthealthsystemstayid) FROM patient WHERE patient.uniquepid = '002-67875' AND STRFTIME('%y', patient.hospitaladmittime) >= '2105'
eicu
CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE VoteTypes ( Id number, Name text ) CREATE...
SELECT Title FROM Posts WHERE Title = UPPER(Title)
sede
CREATE TABLE table_255205_1 ( joined VARCHAR, location VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many inputs joined this institution located in Franklin, Indiana?
SELECT COUNT(joined) FROM table_255205_1 WHERE location = "Franklin, Indiana"
sql_create_context
CREATE TABLE All_Documents ( Document_ID INTEGER, Date_Stored DATETIME, Document_Type_Code CHAR(15), Document_Name CHAR(255), Document_Description CHAR(255), Other_Details VARCHAR(255) ) CREATE TABLE Document_Locations ( Document_ID INTEGER, Location_Code CHAR(15), Date_in_Location_...
SELECT Calendar_Date, Day_Number FROM Ref_Calendar ORDER BY Calendar_Date
nvbench
CREATE TABLE table_53573 ( "Player" text, "Height" text, "School" text, "Hometown" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the heigh of nolan smith?
SELECT "Height" FROM table_53573 WHERE "Player" = 'nolan smith'
wikisql
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 t1.treatmentname FROM (SELECT treatment.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM treatment WHERE STRFTIME('%y', treatment.treatmenttime) >= '2103' GROUP BY treatment.treatmentname) AS t1 WHERE t1.c1 <= 5
eicu
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 lab ( subject_id text, hadm_id text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "NEWBORN" AND demographic.insurance = "Medicare"
mimicsql_data
CREATE TABLE musical ( Musical_ID int, Name text, Year int, Award text, Category text, Nominee text, Result text ) CREATE TABLE actor ( Actor_ID int, Name text, Musical_ID int, Character text, Duration text, age int ) -- Using valid SQLite, answer the following que...
SELECT T2.Name, COUNT(*) FROM actor AS T1 JOIN musical AS T2 ON T1.Musical_ID = T2.Musical_ID GROUP BY T1.Musical_ID
nvbench
CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE flight_stop ( flight_id int, stop_number int, stop_days text, stop_airport text, arrival_time int, arrival_airline text, arrival_flight_number int, departure_time int, departure_airlin...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'DENVER' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRA...
atis
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 Team_ID, School_ID FROM basketball_match GROUP BY All_Games
nvbench
CREATE TABLE table_2897457_3 ( college_junior_club_team VARCHAR, pick__number VARCHAR, position VARCHAR, nationality VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which college/junior/team has defence as the position with canada as the nationality a...
SELECT college_junior_club_team FROM table_2897457_3 WHERE position = "Defence" AND nationality = "Canada" AND pick__number < 61.0
sql_create_context
CREATE TABLE classroom ( building varchar(15), room_number varchar(7), capacity numeric(4,0) ) CREATE TABLE prereq ( course_id varchar(8), prereq_id varchar(8) ) CREATE TABLE takes ( ID varchar(5), course_id varchar(8), sec_id varchar(8), semester varchar(6), year numeric(4,0),...
SELECT year, COUNT(year) FROM course AS T1 JOIN section AS T2 ON T1.course_id = T2.course_id WHERE T1.dept_name = 'Psychology' GROUP BY year
nvbench
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 demographic (...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.religion = "CATHOLIC" AND diagnoses.long_title = "Rheumatoid arthritis"
mimicsql_data
CREATE TABLE table_name_42 ( phonemic VARCHAR, phonetic VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the phonemic when the phonetic is [p a ]?
SELECT phonemic FROM table_name_42 WHERE phonetic = "[pʰaː˥˥]"
sql_create_context
CREATE TABLE lives_in ( stuid number, dormid number, room_number number ) CREATE TABLE dorm ( dormid number, dorm_name text, student_capacity number, gender text ) CREATE TABLE student ( stuid number, lname text, fname text, age number, sex text, major number, a...
SELECT COUNT(*), major FROM student GROUP BY major
spider
CREATE TABLE table_55090 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What driver has under 53 laps, a grid smaller than 14, and a time/retired of differential?
SELECT "Driver" FROM table_55090 WHERE "Laps" < '53' AND "Grid" < '14' AND "Time/Retired" = 'differential'
wikisql
CREATE TABLE table_9025 ( "Game" real, "December" real, "Opponent" text, "Score" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which opponent has a game larger than 23, December larger than 8, and record of 8-10-7?
SELECT "Opponent" FROM table_9025 WHERE "Game" > '23' AND "December" > '8' AND "Record" = '8-10-7'
wikisql
CREATE TABLE table_202_115 ( id number, "station" text, "distance from wellington" text, "height above sea level (m)" text, "opened" text, "closed" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how much higher is the takapu ro...
SELECT (SELECT "height above sea level (m)" FROM table_202_115 WHERE "station" = 'takapu road') - (SELECT "height above sea level (m)" FROM table_202_115 WHERE "station" = 'wellington')
squall
CREATE TABLE table_name_33 ( season VARCHAR, runs VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In what season was 577 runs scored?
SELECT season FROM table_name_33 WHERE runs = "577"
sql_create_context
CREATE TABLE table_10707 ( "Player" text, "Date of Birth" text, "Batting Style" text, "Bowling Style" text, "First Class Team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What batting style does player Shahid Afridi have?
SELECT "Batting Style" FROM table_10707 WHERE "Player" = 'shahid afridi'
wikisql
CREATE TABLE table_79694 ( "Tournament" text, "Wins" real, "Top-10" real, "Top-25" real, "Events" real, "Cuts made" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total number of top-25s for events with 0 wins?
SELECT COUNT("Top-25") FROM table_79694 WHERE "Wins" < '0'
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 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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.marital_status = "WIDOWED" AND procedures.icd9_code = "4610"
mimicsql_data
CREATE TABLE Engineer_Visits ( engineer_visit_id INTEGER, contact_staff_id INTEGER, engineer_id INTEGER, fault_log_entry_id INTEGER, fault_status VARCHAR(10), visit_start_datetime DATETIME, visit_end_datetime DATETIME, other_visit_details VARCHAR(255) ) CREATE TABLE Fault_Log_Parts ( ...
SELECT last_name, COUNT(last_name) FROM Staff AS T1 JOIN Engineer_Visits AS T2 ON T1.staff_id = T2.contact_staff_id JOIN Maintenance_Engineers AS T3 ON T2.engineer_id = T3.engineer_id GROUP BY last_name ORDER BY last_name DESC
nvbench
CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) -- Using valid SQLite, answer the following questions for the...
SELECT Name, Manufacturer FROM Products WHERE Price BETWEEN 60 AND 120 ORDER BY Manufacturer
nvbench
CREATE TABLE table_name_86 ( overall INTEGER, position VARCHAR, college VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How much Overall has a Position of wr, and a College of alberta?
SELECT SUM(overall) FROM table_name_86 WHERE position = "wr" AND college = "alberta"
sql_create_context
CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int ) CREATE TABLE code_des...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DENVER...
atis
CREATE TABLE problem_log ( problem_log_id VARCHAR, problem_id VARCHAR, log_entry_date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the oldest log id and its corresponding problem id?
SELECT problem_log_id, problem_id FROM problem_log ORDER BY log_entry_date LIMIT 1
sql_create_context
CREATE TABLE table_name_90 ( played INTEGER, goals_against VARCHAR, position VARCHAR, draws VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Can you tell me the lowest Played that has the Position larger than 2, and the Draws smaller than 2, and the Go...
SELECT MIN(played) FROM table_name_90 WHERE position > 2 AND draws < 2 AND goals_against < 18
sql_create_context
CREATE TABLE table_45686 ( "Opposing Team" text, "Against" real, "Date" text, "Venue" text, "Status" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What opposing team has 20 against?
SELECT "Opposing Team" FROM table_45686 WHERE "Against" = '20'
wikisql
CREATE TABLE t_kc21 ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, ...
SELECT SUM(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '9763546' AND t_kc21.MED_ORG_DEPT_CD = '8589') AND t_kc24.CLINIC_SLT_DATE BETWEEN '2004-01-18' AND '2018-09-14'
css
CREATE TABLE customers_cards ( card_id number, customer_id number, card_type_code text, card_number text, date_valid_from time, date_valid_to time, other_card_details text ) CREATE TABLE financial_transactions ( transaction_id number, previous_transaction_id number, account_id n...
SELECT T2.customer_first_name, T2.customer_last_name, T2.customer_phone FROM accounts AS T1 JOIN customers AS T2 ON T1.customer_id = T2.customer_id WHERE T1.account_name = "162"
spider
CREATE TABLE table_76582 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the player with a t6 place and a 72-68-72=212 score?
SELECT "Player" FROM table_76582 WHERE "Place" = 't6' AND "Score" = '72-68-72=212'
wikisql
CREATE TABLE table_56770 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the highest crowd turnout when the away...
SELECT MAX("Crowd") FROM table_56770 WHERE "Away team score" = '12.13 (85)'
wikisql
CREATE TABLE zyjzjlb_jybgb ( YLJGDM_ZYJZJLB text, BGDH number, YLJGDM 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 jybgb.SQRGH, jybgb.SQRXM FROM jybgb WHERE jybgb.BGDH = '21129933460'
css
CREATE TABLE table_name_86 ( result VARCHAR, venue VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Result has a Venue of kinnarps arena, and a Date of thursday, february 19?
SELECT result FROM table_name_86 WHERE venue = "kinnarps arena" AND date = "thursday, february 19"
sql_create_context
CREATE TABLE table_11694832_1 ( original_air_date VARCHAR, us_viewers__millions_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When was the show first aired that was viewed by 3.57 million U.S. viewers?
SELECT original_air_date FROM table_11694832_1 WHERE us_viewers__millions_ = "3.57"
sql_create_context
CREATE TABLE table_12962773_15 ( player VARCHAR, no VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What player is number 6?
SELECT player FROM table_12962773_15 WHERE no = 6
sql_create_context
CREATE TABLE table_67900 ( "Tournament" text, "2006" text, "2007" text, "2008" text, "2009" text, "2010" text, "2011" text, "2012" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the result for 2006 of a tournament that is 107 in ...
SELECT "2006" FROM table_67900 WHERE "2010" = '107'
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 jybgb.BGDH FROM hz_info JOIN txmzjzjlb JOIN jybgb ON hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX AND txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE hz_info.RYBH = '54118858' AND NOT jybgb.BGDH IN (SELECT jyjgzbb.BGDH FRO...
css
CREATE TABLE table_name_47 ( lost INTEGER, points VARCHAR, drawn VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Lost has Points of 28 and a Drawn smaller than 8?
SELECT AVG(lost) FROM table_name_47 WHERE points = 28 AND drawn < 8
sql_create_context
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TA...
SELECT COUNT(*) > 0 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '022-89058' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient....
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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "62" AND prescriptions.route = "SC"
mimicsql_data
CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location text, insurance text, language text, marital_status text, ethnicity text, age number ) CREATE ...
SELECT COUNT(*) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 59220) AND DATETIME(prescriptions.startdate, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-0 month')
mimic_iii
CREATE TABLE t_kc21 ( MED_CLINIC_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, COMP_ID text, PERSON_ID text, PERSON_NM text, IDENTITY_CARD text, SOC_SRT_CARD text, PERSON_SEX number, PERSON_AGE number, IN_HOSP_DATE time, OUT_HOSP_DATE time, DIFF_PLACE_FLG numb...
SELECT SOC_SRT_DIRE_CD, SOC_SRT_DIRE_NM FROM t_kc22 WHERE MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc21 WHERE PERSON_ID = '52950661' AND MED_SER_ORG_NO = '7572010' AND IN_HOSP_DATE BETWEEN '2004-10-25' AND '2018-02-18')
css
CREATE TABLE table_15431 ( "Rider" text, "Manufacturer" text, "Laps" real, "Time/Retired" text, "Grid" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- with a Time/Retired of +47.376 what is the lap sum?
SELECT SUM("Laps") FROM table_15431 WHERE "Time/Retired" = '+47.376'
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 demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "AMERICAN INDIAN/ALASKA NATIVE" AND demographic.age < "63"
mimicsql_data
CREATE TABLE table_name_89 ( events INTEGER, top_5 VARCHAR, top_25 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the average number of events when the top-5 is less than 1 and top 25 more than 1
SELECT AVG(events) FROM table_name_89 WHERE top_5 < 1 AND top_25 > 1
sql_create_context
CREATE TABLE table_24764 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "U.S. viewers (millions)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the series ...
SELECT MAX("No. in series") FROM table_24764 WHERE "Written by" = 'David North'
wikisql
CREATE TABLE table_25561560_2 ( position VARCHAR, skipper VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In what position did skipper Mark Richards place?
SELECT position FROM table_25561560_2 WHERE skipper = "Mark Richards"
sql_create_context
CREATE TABLE labevents ( row_id number, subject_id number, hadm_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, charttime time, itemid number...
SELECT SUM(prescriptions.dose_val_rx) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 60180) AND prescriptions.drug = 'ipratropium bromide' AND STRFTIME('%y-%m', prescriptions.startdate) >= '2104-05'
mimic_iii
CREATE TABLE table_79187 ( "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 was the final score for the tie where Leeds United was the home team?
SELECT "Score" FROM table_79187 WHERE "Home team" = 'leeds united'
wikisql
CREATE TABLE table_40261 ( "Season" real, "Date" text, "Venue" text, "City" text, "Visitor" text, "Score" text, "Home" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Before 1957, what was the largest in Attendance at V...
SELECT MAX("Attendance") FROM table_40261 WHERE "Season" < '1957' AND "Venue" = 'varsity stadium'
wikisql
CREATE TABLE table_1965650_4 ( nhl_team VARCHAR, college_junior_club_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the NHL team that drafted the player from Sudbury Wolves (OHA)?
SELECT nhl_team FROM table_1965650_4 WHERE college_junior_club_team = "Sudbury Wolves (OHA)"
sql_create_context
CREATE TABLE table_46187 ( "Fin. Pos" text, "Car No." text, "Driver" text, "Team" text, "Laps" text, "Time/Retired" text, "Grid" text, "Laps Led" text, "Points" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What car number had a rac...
SELECT "Car No." FROM table_46187 WHERE "Time/Retired" = '+0.3844'
wikisql
CREATE TABLE table_name_48 ( country VARCHAR, react VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In what country did fadwa al bouza have larger than 0.257 react score?
SELECT country FROM table_name_48 WHERE react > 0.257 AND name = "fadwa al bouza"
sql_create_context
CREATE TABLE Apartments ( bedroom_count INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average number of bedrooms of all apartments?
SELECT AVG(bedroom_count) FROM Apartments
sql_create_context
CREATE TABLE table_name_35 ( opponent VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the opponent from April 19?
SELECT opponent FROM table_name_35 WHERE date = "april 19"
sql_create_context
CREATE TABLE home_game ( year INTEGER, league_id TEXT, team_id TEXT, park_id TEXT, span_first TEXT, span_last TEXT, games INTEGER, openings INTEGER, attendance INTEGER ) CREATE TABLE salary ( year INTEGER, team_id TEXT, league_id TEXT, player_id TEXT, salary INTE...
SELECT year, COUNT(*) FROM postseason AS T1 JOIN team AS T2 ON T1.team_id_winner = T2.team_id_br WHERE T2.name = 'Boston Red Stockings' GROUP BY T1.year ORDER BY year DESC
nvbench
CREATE TABLE table_4408 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Partner" text, "Opponents" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Tournament has a winner Outcome with a Score of 6 3, 7 5...
SELECT "Tournament" FROM table_4408 WHERE "Outcome" = 'winner' AND "Score" = '6–3, 7–5' AND "Partner" = 'kimberly po-messerli'
wikisql
CREATE TABLE table_26864 ( "Season" real, "Series" text, "Team" text, "Races" real, "Wins" real, "Poles" real, "FLaps" real, "Podiums" real, "Points" text, "Position" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the team f...
SELECT "Team" FROM table_26864 WHERE "Season" = '2010'
wikisql
CREATE TABLE affected_region ( Region_id int, Storm_ID int, Number_city_affected real ) CREATE TABLE region ( Region_id int, Region_code text, Region_name text ) CREATE TABLE storm ( Storm_ID int, Name text, Dates_active text, Max_speed int, Damage_millions_USD real, Nu...
SELECT Name, Number_Deaths FROM storm WHERE Number_Deaths >= 1 ORDER BY Number_Deaths
nvbench
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_tests int, heavy_papers int, cares_for_students int, heavy_assignments ...
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.number = 398 OR course.number = 498 OR course.number = 598) AND course.department = 'E...
advising
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Government" AND procedures.short_title = "Open reduc-int fix femur"
mimicsql_data
CREATE TABLE table_54214 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the home team score when the venue is Pr...
SELECT "Home team score" FROM table_54214 WHERE "Venue" = 'princes park'
wikisql
CREATE TABLE table_36664 ( "Couple" text, "Score" text, "Style" text, "Music" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the score when the couple was shannon & derek?
SELECT "Score" FROM table_36664 WHERE "Couple" = 'shannon & derek'
wikisql
CREATE TABLE table_31345 ( "Season" text, "Division" text, "League Apps" real, "League Goals" real, "FA Cup Apps" real, "FA Cup Goals" real, "Other Apps" real, "Other Goals" real, "Total Apps" real, "Total Goals" real ) -- Using valid SQLite, answer the following questions for ...
SELECT MAX("FA Cup Apps") FROM table_31345 WHERE "League Apps" = '27'
wikisql
CREATE TABLE table_27744844_7 ( high_assists VARCHAR, game VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who had the most assists and how many did they have in game 35?
SELECT high_assists FROM table_27744844_7 WHERE game = 35
sql_create_context
CREATE TABLE table_23575917_7 ( first_broadcast VARCHAR, lees_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- If the lees team is Clare Balding and Miranda Hart, what is the first broadcast total number?
SELECT COUNT(first_broadcast) FROM table_23575917_7 WHERE lees_team = "Clare Balding and Miranda Hart"
sql_create_context
CREATE TABLE table_203_136 ( id number, "year" number, "ibm model number" text, "name" text, "processor" text, "bus" text, "hd interface" text, "case" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many processors h...
SELECT COUNT("processor") FROM table_203_136 WHERE "case" = 'desktop with integrated monochrome display'
squall
CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, last_wardid number, intime time, outtime time ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, sh...
SELECT inputevents_cv.charttime FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 5142)) AND DATETIME(inputevents_cv.charttime, 'start of month') = DATETIME(CURRENT_TIME(), '...
mimic_iii
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 zyjzjlb.JZLSH FROM person_info JOIN hz_info JOIN zyjzjlb JOIN hz_info_zyjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = hz_info_zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX AND hz_info_zyjzjlb.JZLSH = zyjzjlb.JZLSH AND hz_info_zyjzjlb.YLJGDM = hz_info_zyjzjlb.YLJGDM AND ...
css
CREATE TABLE artists ( id number, name text ) CREATE TABLE employees ( id number, last_name text, first_name text, title text, reports_to number, birth_date time, hire_date time, address text, city text, state text, country text, postal_code text, phone text,...
SELECT billing_state, COUNT(*), SUM(total) FROM invoices WHERE billing_state = "CA"
spider
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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.short_title = "Candidal vulvovaginitis"
mimicsql_data
CREATE TABLE table_name_15 ( joined VARCHAR, conference_championships VARCHAR, nickname VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the year joined with a Conference championships of 5, and a Nickname of wolfpack?
SELECT joined FROM table_name_15 WHERE conference_championships = 5 AND nickname = "wolfpack"
sql_create_context
CREATE TABLE table_33906 ( "Tournament" text, "2002" text, "2004" text, "2005" text, "2006" text, "2007" text, "2008" text, "2009" text, "2010" text, "2011" text, "2012" text, "2013" text ) -- Using valid SQLite, answer the following questions for the tables provided ab...
SELECT "2012" FROM table_33906 WHERE "2007" = '1r'
wikisql
CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location text, insurance text, language text, marital_status text, ethnicity text, age number ) CREATE ...
SELECT prescriptions.drug FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 27172) AND prescriptions.route = 'iv drip' AND DATETIME(prescriptions.startdate) <= DATETIME(CURRENT_TIME(), '-28 month') ORDER BY prescriptions.startdate LIMIT 1
mimic_iii
CREATE TABLE table_38888 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the score on December 1 when Philadelphia visited?
SELECT "Score" FROM table_38888 WHERE "Visitor" = 'philadelphia' AND "Date" = 'december 1'
wikisql
CREATE TABLE table_203_485 ( id number, "year" text, "show" text, "role" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many shows were there in 2005 ?
SELECT COUNT("show") FROM table_203_485 WHERE "year" = 2005
squall
CREATE TABLE store_district ( Store_ID int, District_ID int ) CREATE TABLE district ( District_ID int, District_name text, Headquartered_City text, City_Population real, City_Area real ) CREATE TABLE product ( product_id int, product text, dimensions text, dpi real, pag...
SELECT Type, COUNT(*) FROM store GROUP BY Type
nvbench