instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_name_99 ( date VARCHAR, location_attendance VARCHAR, high_rebounds VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Date has a Location Attendance of madison square garden 19,763, and a High rebounds of david lee (12)?
SELECT date FROM table_name_99 WHERE location_attendance = "madison square garden 19,763" AND high_rebounds = "david lee (12)"
sql_create_context
CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDat...
SELECT * FROM Users WHERE Id = 416354 OR DisplayName LIKE 'TaylorOtwell'
sede
CREATE TABLE table_name_86 ( pick__number INTEGER, name VARCHAR, round VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Pick # is the highest one that has a Name of lawrence sidbury, and a Round smaller than 4?
SELECT MAX(pick__number) FROM table_name_86 WHERE name = "lawrence sidbury" AND round < 4
sql_create_context
CREATE TABLE table_14660 ( "Year" text, "Start" text, "Qual" text, "Rank" text, "Finish" text, "Laps" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the fewest number of laps completed by a rank 32?
SELECT MIN("Laps") FROM table_14660 WHERE "Rank" = '32'
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 SUM(CASE WHEN patient.hospitaldischargestatus = 'alive' THEN 1 WHEN STRFTIME('%j', patient.hospitaldischargetime) - STRFTIME('%j', t2.diagnosistime) > 5 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t1.uniquepid, t1.diagnosistime FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOI...
eicu
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 jybgb ( BBCJBW text, BBDM tex...
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN txmzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND 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.JZ...
css
CREATE TABLE table_53207 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On what date was the record 59 59?
SELECT "Date" FROM table_53207 WHERE "Record" = '59–59'
wikisql
CREATE TABLE table_204_55 ( id number, "date" text, "time" text, "opponent#" text, "rank#" text, "site" text, "tv" text, "result" text, "attendance" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the only game stadium to re...
SELECT "site" FROM table_204_55 WHERE "attendance" > 100000
squall
CREATE TABLE table_name_85 ( record VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Record of the game with a Score of 107 108?
SELECT record FROM table_name_85 WHERE score = "107–108"
sql_create_context
CREATE TABLE table_64450 ( "Peak" text, "Country" text, "Elevation (m)" real, "Prominence (m)" real, "Col (m)" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Elevation (m) has a Prominence (m) larger than 2,120, and a Peak of mount karisimbi, ...
SELECT MIN("Elevation (m)") FROM table_64450 WHERE "Prominence (m)" > '2,120' AND "Peak" = 'mount karisimbi' AND "Col (m)" > '1195'
wikisql
CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW text, JCZBJGDX text, JCZBMC text, JLDW text, JYRQ time, JYZBLSH text, ...
SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN jybgb_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.J...
css
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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND prescriptions.drug_type = "MAIN"
mimicsql_data
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 MAX(t1.c1) FROM (SELECT COUNT(DISTINCT diagnosis.patientunitstayid) AS c1 FROM diagnosis WHERE diagnosis.diagnosisname = 'renal cell ca' AND DATETIME(diagnosis.diagnosistime) <= DATETIME(CURRENT_TIME(), '-4 year') GROUP BY STRFTIME('%y-%m-%d', diagnosis.diagnosistime)) AS t1
eicu
CREATE TABLE table_name_89 ( opponent VARCHAR, location VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the opposing team during a game in the Pontiac Silverdome?
SELECT opponent FROM table_name_89 WHERE location = "pontiac silverdome"
sql_create_context
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 name, number FROM course WHERE department = 'EECS' AND has_lab = 'N'
advising
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_airline text, departure_flight_number int, stop_time int ) CREATE TABLE month ( ...
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 = 'WASHINGTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BOS...
atis
CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text )...
SELECT microbiologyevents.charttime FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 26313 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1) AND microbiologyevents.spec_type_desc = 'catheter tip-iv' ORDER ...
mimic_iii
CREATE TABLE table_name_67 ( round INTEGER, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Roy Hall's highest round?
SELECT MAX(round) FROM table_name_67 WHERE name = "roy hall"
sql_create_context
CREATE TABLE party ( Party_ID int, Year real, Party text, Governor text, Lieutenant_Governor text, Comptroller text, Attorney_General text, US_Senate text ) CREATE TABLE election ( Election_ID int, Counties_Represented text, District int, Delegate text, Party int, ...
SELECT T2.Party, SUM(COUNT(*)) FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID GROUP BY T2.Party ORDER BY T2.Party DESC
nvbench
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.admission_type = "ELECTIVE" AND procedures.long_title = "Catheter based invasive electrophysiologic testing"
mimicsql_data
CREATE TABLE table_27987623_1 ( series_episode INTEGER, us_viewers__in_million_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the episode number veiwed by 7.43 million viewers?
SELECT MAX(series_episode) FROM table_27987623_1 WHERE us_viewers__in_million_ = "7.43"
sql_create_context
CREATE TABLE table_25725 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who ha...
SELECT "High points" FROM table_25725 WHERE "Team" = 'New York'
wikisql
CREATE TABLE course_offering ( offering_id int, course_id int, semester int, section_number int, start_time time, end_time time, monday varchar, tuesday varchar, wednesday varchar, thursday varchar, friday varchar, saturday varchar, sunday varchar, has_final_proje...
SELECT DISTINCT course_offering.has_final_exam FROM course_offering INNER JOIN course ON course.course_id = course_offering.course_id INNER JOIN offering_instructor ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN instructor ON offering_instructor.instructor_id = instructor.instructor_id WHER...
advising
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, d...
SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'copd' AND STRFTIME('%y', diagnosis.diagnosistime) >= '2101') AS t1 JOIN (SELECT patient.uniquepid, treatment...
eicu
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 IN_HOSP_DAYS FROM t_kc21 WHERE MED_CLINIC_ID = '23675184652'
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 demographic (...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "58" AND prescriptions.formulary_drug_cd = "MAAL30L"
mimicsql_data
CREATE TABLE table_30575 ( "School" text, "Gender" text, "Age Range" text, "Religious Affiliation" text, "Location" text, "School website" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the affiliation of the school with website http://w...
SELECT "Religious Affiliation" FROM table_30575 WHERE "School website" = 'http://www.townsend.herts.sch.uk/'
wikisql
CREATE TABLE table_name_68 ( record VARCHAR, visitor VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Atlanta was a visitor on December 8, what was their record?
SELECT record FROM table_name_68 WHERE visitor = "atlanta"
sql_create_context
CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREA...
SELECT c.PostId AS "post_link", c.Text, p.Tags FROM Comments AS c INNER JOIN Posts AS p ON p.Id = c.PostId WHERE c.Score = 0 AND UPPER(c.Text) LIKE '%HTTP://%' AND YEAR(c.CreationDate) >= 2015 AND p.PostTypeId = 2 LIMIT 5
sede
CREATE TABLE table_5329 ( "Season" text, "Level" real, "Position" text, "Nationality" text, "Apps" real, "Goals" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Goals with a Level of 5 or greater is the lowest?
SELECT MIN("Goals") FROM table_5329 WHERE "Level" > '5'
wikisql
CREATE TABLE table_62761 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which week was on october 30, 1983?
SELECT SUM("Week") FROM table_62761 WHERE "Date" = 'october 30, 1983'
wikisql
CREATE TABLE mzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH text, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZZMC ...
SELECT * FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE hz_info.person_i...
css
CREATE TABLE table_55976 ( "School" text, "Location" text, "Enrolment" real, "Founded" real, "Denomination" text, "Boys/Girls" text, "Day/Boarding" text, "School Colors" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What school colors f...
SELECT "School Colors" FROM table_55976 WHERE "Enrolment" > '1000' AND "School" = 'the friends'' school'
wikisql
CREATE TABLE table_name_13 ( record VARCHAR, visitor VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the record from the Golden State Warriors on 11/18?
SELECT record FROM table_name_13 WHERE visitor = "golden state warriors" AND date = "11/18"
sql_create_context
CREATE TABLE table_name_72 ( time_retired VARCHAR, driver VARCHAR, laps VARCHAR, grid VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the time or retired time for timo glock with under 70 laps and a grid number greater than 15?
SELECT time_retired FROM table_name_72 WHERE laps < 70 AND grid > 15 AND driver = "timo glock"
sql_create_context
CREATE TABLE table_8898 ( "Game" real, "November" real, "Opponent" text, "Score" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Record, when November is less than 10, and when Game is less than 13?
SELECT "Record" FROM table_8898 WHERE "November" < '10' AND "Game" < '13'
wikisql
CREATE TABLE people ( People_ID int, District text, Name text, Party text, Age int ) CREATE TABLE debate_people ( Debate_ID int, Affirmative int, Negative int, If_Affirmative_Win bool ) CREATE TABLE debate ( Debate_ID int, Date text, Venue text, Num_of_Audience int ...
SELECT Party, COUNT(*) FROM people GROUP BY Party ORDER BY COUNT(*)
nvbench
CREATE TABLE table_name_69 ( color_commentator_s_ VARCHAR, play_by_play VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was Al Michaels' color commentator in 2003?
SELECT color_commentator_s_ FROM table_name_69 WHERE play_by_play = "al michaels" AND year > 2003
sql_create_context
CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense text ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous...
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Reputation, DisplayName, Location, CONCAT(DATEDIFF(YEAR, CreationDate, GETDATE()), 'year(s) ', DATEDIFF(MONTH, CreationDate, GETDATE()) % 12, 'month(s)') AS MemberFor, LastAccessDate, CONCAT('https://stackoverflow.com/users/', Id, '/') AS VisitProfile, Views F...
sede
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate ti...
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions
mimic_iii
CREATE TABLE table_52708 ( "Rank" real, "Mountain Peak" text, "State" text, "Mountain Range" text, "Location" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest rank Mount Elbert has?
SELECT MAX("Rank") FROM table_52708 WHERE "Mountain Peak" = 'mount elbert'
wikisql
CREATE TABLE table_61874 ( "Colliery" text, "Location" text, "Date" text, "Year" real, "Death toll" real, "cause" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When has a cause of gas explosion, a Death toll smaller than 63, and a Location of p...
SELECT "Date" FROM table_61874 WHERE "cause" = 'gas explosion' AND "Death toll" < '63' AND "Location" = 'penygraig'
wikisql
CREATE TABLE table_name_13 ( score VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On November 19, 2008 what was the score?
SELECT score FROM table_name_13 WHERE date = "november 19, 2008"
sql_create_context
CREATE TABLE table_name_37 ( purpose VARCHAR, yield VARCHAR, location VARCHAR, elevation_ VARCHAR, _height VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Purpose has an Elevation + Height of 0 + metres (ft), a Location of bikini, namu (char...
SELECT purpose FROM table_name_37 WHERE elevation_ + _height = "0 + metres (ft)" AND location = "bikini, namu (charlie)" AND yield = "220 kt"
sql_create_context
CREATE TABLE table_name_87 ( team VARCHAR, rank VARCHAR, rider VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Rank larger than 8, and a Rider of chris barrett is what team?
SELECT team FROM table_name_87 WHERE rank > 8 AND rider = "chris barrett"
sql_create_context
CREATE TABLE Orders ( order_id INTEGER, customer_id INTEGER, date_order_placed DATETIME, order_details VARCHAR(255) ) CREATE TABLE Invoices ( invoice_number INTEGER, order_id INTEGER, invoice_date DATETIME ) CREATE TABLE Invoice_Line_Items ( order_item_id INTEGER, invoice_number IN...
SELECT other_account_details, COUNT(other_account_details) FROM Accounts GROUP BY other_account_details ORDER BY other_account_details
nvbench
CREATE TABLE hz_info_mzjzjlb ( JZLSH number, YLJGDM number, mzjzjlb_id number ) CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH text, KH text, KLX ...
SELECT person_info.XM FROM person_info JOIN hz_info JOIN zyjzjlb JOIN jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX AND zyjzjlb.YLJGDM = jybgb.YLJGDM_ZYJZJLB AND zyjzjlb.JZLSH = jybgb.JZLSH_ZYJZJLB WHERE jybgb.BGDH = '59958686158'
css
CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, De...
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation, Location FROM Users WHERE (LOWER(Location) LIKE ('%china%') OR Location LIKE '%CN') AND NOT (Location LIKE '%BCN%') AND LENGTH(Location) > 1 ORDER BY Location LIMIT 100
sede
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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.language = "HAIT" AND lab.label = "Protein"
mimicsql_data
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admityear < "2203" AND procedures.long_title = "Insertion of drug-eluting coronary artery stent(s)"
mimicsql_data
CREATE TABLE table_57823 ( "Name" text, "Country" text, "Status" text, "Moving to" text, "Transfer window" text, "Transfer fee" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the transfer window for bel?
SELECT "Transfer window" FROM table_57823 WHERE "Country" = 'bel'
wikisql
CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) -- Using valid SQLite, answer the following questions for the...
SELECT Founder, SUM(Manufacturer) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder ORDER BY Founder
nvbench
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_NM = '袁修雅' AND qtb.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT >= 1137.71) UNION SELECT gyb.IN_DIAG_DIS_CD, gyb.IN_DIAG_DIS_NM FROM gyb WHERE gyb.PERSON_NM = '袁修雅' AND gyb.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLI...
css
CREATE TABLE table_204_330 ( id number, "finished" text, "horse" text, "jockey" text, "trainer" text, "owner" text, "time / behind" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the name of the horse after outbound ?
SELECT "horse" FROM table_204_330 WHERE id = (SELECT id FROM table_204_330 WHERE "horse" = 'outbound') + 1
squall
CREATE TABLE table_45408 ( "1st LBSC No." real, "LBSC Name" text, "Built" text, "2nd LBSC No." text, "1st SR No." text, "2ns SR No." text, "Withdrawn" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the largest 1st LBSC number with a ...
SELECT MAX("1st LBSC No.") FROM table_45408 WHERE "LBSC Name" = 'northcote'
wikisql
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "SYNCOPE;TELEMETRY" AND demographic.age < "31"
mimicsql_data
CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate time, ApprovalDate time, RejectionDate time, OwnerUserId number, Comment text, Text text, Tit...
SELECT TIME_TO_STR(p.CreationDate, '%Y') AS YEAR, p.OwnerUserId AS "user_link", que.TagName, SUM(p.Score) AS Score FROM Posts AS p INNER JOIN (SELECT Posts.Id, Tags.TagName FROM Tags INNER JOIN PostTags ON PostTags.TagId = Tags.Id INNER JOIN Posts ON Posts.Id = PostTags.PostId INNER JOIN PostTypes ON PostTypes.Id = Pos...
sede
CREATE TABLE part_faults ( part_fault_id number, part_id number, fault_short_name text, fault_description text, other_fault_details text ) CREATE TABLE skills ( skill_id number, skill_code text, skill_description text ) CREATE TABLE parts ( part_id number, part_name text, c...
SELECT T1.fault_log_entry_id, T1.fault_description, T1.fault_log_entry_datetime FROM fault_log AS T1 JOIN fault_log_parts AS T2 ON T1.fault_log_entry_id = T2.fault_log_entry_id GROUP BY T1.fault_log_entry_id ORDER BY COUNT(*) DESC LIMIT 1
spider
CREATE TABLE table_name_39 ( december INTEGER, game VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average December, when Game is '36'?
SELECT AVG(december) FROM table_name_39 WHERE game = 36
sql_create_context
CREATE TABLE table_48342 ( "Year" real, "MLB Club" text, "Record" text, "Finish" text, "Manager" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the record when the year is 2011?
SELECT "Record" FROM table_48342 WHERE "Year" = '2011'
wikisql
CREATE TABLE workshop ( workshop_id number, date text, venue text, name text ) CREATE TABLE acceptance ( submission_id number, workshop_id number, result text ) CREATE TABLE submission ( submission_id number, scores number, author text, college text ) -- Using valid SQLit...
SELECT AVG(scores) FROM submission
spider
CREATE TABLE table_44716 ( "Team" text, "Average" real, "Points" real, "Played" real, "2006" text, "2007" text, "2008" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is 2006, when Team is 'Tacuary'?
SELECT "2006" FROM table_44716 WHERE "Team" = 'tacuary'
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 REF_SLT_FLG FROM t_kc24 WHERE MED_CLINIC_ID = '76943948515'
css
CREATE TABLE table_name_42 ( round INTEGER, pick VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest round of pick 3?
SELECT MAX(round) FROM table_name_42 WHERE pick = 3
sql_create_context
CREATE TABLE table_name_9 ( score VARCHAR, home VARCHAR, visitor VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In the game where the Hornets were the home team and Clippers the visiting team, what is the score?
SELECT score FROM table_name_9 WHERE home = "hornets" AND visitor = "clippers"
sql_create_context
CREATE TABLE table_44056 ( "Season" real, "Home Team" text, "Score" text, "Away Team" text, "Venue" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Can you tell me the Season that has the Score of 1-0?
SELECT "Season" FROM table_44056 WHERE "Score" = '1-0'
wikisql
CREATE TABLE table_name_57 ( date VARCHAR, week VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the date of week 4?
SELECT date FROM table_name_57 WHERE week = 4
sql_create_context
CREATE TABLE table_name_13 ( league VARCHAR, years VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the League Cup value for 1991 present?
SELECT league AS Cup FROM table_name_13 WHERE years = "1991–present"
sql_create_context
CREATE TABLE table_204_550 ( id number, "event" text, "record" text, "athlete" text, "date" text, "meet" text, "place" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which date comes before 12 march 1983 ?
SELECT "date" FROM table_204_550 WHERE id = (SELECT id FROM table_204_550 WHERE "date" = '12 march 1983') - 1
squall
CREATE TABLE table_72693 ( "Date" text, "Cover model" text, "Centerfold model" text, "Interview subject" text, "20 Questions" text, "Pictorials" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When was Kalin Olson listed as the centerfold model?
SELECT "Date" FROM table_72693 WHERE "Centerfold model" = 'Kalin Olson'
wikisql
CREATE TABLE zyjzjlb_jybgb ( YLJGDM_ZYJZJLB text, BGDH number, YLJGDM number ) 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...
SELECT jybgb.BBDM, jybgb.BBMC, jybgb.BBZT FROM jybgb WHERE jybgb.BGDH = '73475612049'
css
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) 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 te...
SELECT jybgb.SHSJ FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN hz_info_mzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB ...
css
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 zzmzjzjlb.SG, zzmzjzjlb.TZ, zzmzjzjlb.TW, zzmzjzjlb.SSY, zzmzjzjlb.SZY, zzmzjzjlb.XL, zzmzjzjlb.HXPLC, zzmzjzjlb.ML FROM zzmzjzjlb WHERE zzmzjzjlb.JZLSH = '50197380603' UNION SELECT fzzmzjzjlb.SG, fzzmzjzjlb.TZ, fzzmzjzjlb.TW, fzzmzjzjlb.SSY, fzzmzjzjlb.SZY, fzzmzjzjlb.XL, fzzmzjzjlb.HXPLC, fzzmzjzjlb.ML FROM fz...
css
CREATE TABLE table_name_89 ( father VARCHAR, spouse VARCHAR, birth VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name of the father who was born in 1204 and married ottokar ii?
SELECT father FROM table_name_89 WHERE spouse = "ottokar ii" AND birth = "1204"
sql_create_context
CREATE TABLE table_203_559 ( id number, "no." number, "name" text, "took office" text, "left office" text, "president served under" text, "notable for" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who was in office for the least amount of ...
SELECT "name" FROM table_203_559 ORDER BY "left office" - "took office" LIMIT 1
squall
CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGui...
SELECT q.Id AS "post_link", q.ClosedDate, a.CreationDate AS "answer_date" FROM Posts AS a LEFT JOIN Posts AS q ON a.ParentId = q.Id WHERE a.OwnerUserId = '##UserId:int##' AND NOT q.ClosedDate IS NULL AND a.PostTypeId = 2 AND q.PostTypeId = 1 GROUP BY q.Id, q.ClosedDate, a.CreationDate ORDER BY q.ClosedDate DESC
sede
CREATE TABLE table_24112 ( "Game" real, "Date" text, "Opponent" text, "Result" text, "Black Knights points" real, "Opponents" real, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the game for record 1-0
SELECT "Game" FROM table_24112 WHERE "Record" = '1-0'
wikisql
CREATE TABLE table_54403 ( "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. -- If the Home team score was 19.15 (129), what was...
SELECT "Away team score" FROM table_54403 WHERE "Home team score" = '19.15 (129)'
wikisql
CREATE TABLE table_46509 ( "Round" real, "Pick" real, "Overall" real, "Name" text, "Position" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Overall has a Position of te, and a Round larger than 5?
SELECT AVG("Overall") FROM table_46509 WHERE "Position" = 'te' AND "Round" > '5'
wikisql
CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId num...
SELECT u.Id AS "user_link", u.Reputation, u.Reputation - me.Reputation AS Difference FROM Users AS u CROSS JOIN Users AS me WHERE me.Id = @UserId AND u.CreationDate > me.CreationDate AND u.Reputation > me.Reputation ORDER BY Difference DESC, u.CreationDate DESC
sede
CREATE TABLE Project_Staff ( staff_id DOUBLE, project_id INTEGER, role_code VARCHAR(10), date_from DATETIME, date_to DATETIME, other_details VARCHAR(255) ) CREATE TABLE Document_Types ( document_type_code VARCHAR(10), document_description VARCHAR(255) ) CREATE TABLE Research_Staff ( ...
SELECT date_to, COUNT(date_to) FROM Project_Staff ORDER BY date_to DESC
nvbench
CREATE TABLE station ( id INTEGER, name TEXT, lat NUMERIC, long NUMERIC, dock_count INTEGER, city TEXT, installation_date TEXT ) CREATE TABLE status ( station_id INTEGER, bikes_available INTEGER, docks_available INTEGER, time TEXT ) CREATE TABLE weather ( date TEXT, ...
SELECT date, COUNT(date) FROM weather ORDER BY max_gust_speed_mph DESC LIMIT 3
nvbench
CREATE TABLE table_79641 ( "School" text, "Location" text, "Mascot" text, "County" text, "Enrollment" real, "IHSAA Class / Football / Soccer" text, "Year Joined" real, "Previous Conference" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- ...
SELECT "Previous Conference" FROM table_79641 WHERE "Location" = 'converse'
wikisql
CREATE TABLE technician ( technician_id real, Name text, Team text, Starting_Year real, Age int ) CREATE TABLE machine ( Machine_ID int, Making_Year int, Class text, Team text, Machine_series text, value_points real, quality_rank int ) CREATE TABLE repair ( repair_I...
SELECT Name, COUNT(Name) FROM repair_assignment AS T1 JOIN machine AS T2 ON T1.Machine_ID = T2.Machine_ID JOIN technician AS T3 ON T1.technician_id = T3.technician_id GROUP BY Name
nvbench
CREATE TABLE table_204_15 ( id number, "year" number, "date" text, "venue" text, "city" text, "country" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- previous to 2000 , what city was listed the most ?
SELECT "city" FROM table_204_15 WHERE "year" < 2000 GROUP BY "city" ORDER BY COUNT(*) DESC LIMIT 1
squall
CREATE TABLE table_name_75 ( losses INTEGER, club VARCHAR, draws VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the most losses when the club is terang and draws is less than 0?
SELECT MAX(losses) FROM table_name_75 WHERE club = "terang" AND draws < 0
sql_create_context
CREATE TABLE table_name_74 ( region VARCHAR, catalog VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Region of Catalog 885 973-4?
SELECT region FROM table_name_74 WHERE catalog = "885 973-4"
sql_create_context
CREATE TABLE table_1067134_1 ( _number_of_ep INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the least amount of season epidsodes?
SELECT MIN(_number_of_ep) FROM table_1067134_1
sql_create_context
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.itemid = "51222" AND lab.flag = "abnormal"
mimicsql_data
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate n...
SELECT SUM(CASE WHEN patient.hospitaldischargestatus = 'alive' THEN 1 WHEN STRFTIME('%j', patient.hospitaldischargetime) - STRFTIME('%j', t2.diagnosistime) > 5 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t1.uniquepid, t1.diagnosistime FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOI...
eicu
CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE flight ( aircraft_code_sequence text, airline_code varchar, airline_flight text, arrival_time int, connections int, departure_time int, dual_carrier text, flight_days text, flight_id...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'HOUSTON' AND date_day.day_number = 4 AND date_day.month_number = 8 AND da...
atis
CREATE TABLE table_70846 ( "Rider" text, "Matches" real, "Rides" real, "Bonus Pts" real, "Total Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was Bob Jameson's lowest bonus where he had less than 15 rides?
SELECT MIN("Bonus Pts") FROM table_70846 WHERE "Rider" = 'bob jameson' AND "Rides" < '15'
wikisql
CREATE TABLE table_35701 ( "Track" text, "City" text, "State" text, "Opened (closing date if defunct)" text, "Surface" text, "Length" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the surface for the riverhead raceway?
SELECT "Surface" FROM table_35701 WHERE "Track" = 'riverhead raceway'
wikisql
CREATE TABLE table_59208 ( "Rider" text, "Bike" text, "Laps" real, "Time" text, "Grid" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the Rider which has Laps smaller than 11 and a Bike of kawasaki zx-10r, and a Grid of 8?
SELECT "Rider" FROM table_59208 WHERE "Laps" < '11' AND "Bike" = 'kawasaki zx-10r' AND "Grid" = '8'
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 WHERE demographic.diagnosis = "ATRIAL SEPTAL DEFECT\MITRAL VALVE REPLACEMENT;REPAIR ATRIAL-SEPTAL DEFECT/SDA" AND prescriptions.route = "NEB"
mimicsql_data
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 (SELECT lab.labresult FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-15417' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospi...
eicu
CREATE TABLE table_22601 ( "Team" text, "Outgoing manager" text, "Manner of departure" text, "Date of vacancy" text, "Replaced by" text, "Date of appointment" text, "Position in table" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What date...
SELECT "Date of appointment" FROM table_22601 WHERE "Team" = 'Milton Keynes Dons'
wikisql
CREATE TABLE table_44373 ( "Solvent" text, "Chemical Formula" text, "Boiling point" text, "Dielectric constant" text, "Density" text, "Dipole moment ( D )" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the boiling point when the density ...
SELECT "Boiling point" FROM table_44373 WHERE "Density" = '1.092 g/ml'
wikisql
CREATE TABLE table_30137 ( "Rnd" real, "Circuit" text, "GT Winning Car" text, "SS Winning Car" text, "A Winning Car" text, "B Winning Car" text, "Report" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the total number of rnd for kim bak...
SELECT COUNT("Rnd") FROM table_30137 WHERE "SS Winning Car" = 'Kim Baker, Bobby Archer, Tommy Archer'
wikisql
CREATE TABLE Department_Store_Chain ( dept_store_chain_id INTEGER, dept_store_chain_name VARCHAR(80) ) CREATE TABLE Supplier_Addresses ( supplier_id INTEGER, address_id INTEGER, date_from DATETIME, date_to DATETIME ) CREATE TABLE Departments ( department_id INTEGER, dept_store_id INTEG...
SELECT order_id, customer_id FROM Customer_Orders WHERE order_status_code = "Cancelled" ORDER BY order_date
nvbench