instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE PostFeedback ( Id nu...
SELECT q.Id AS "post_link", p.Score AS "your_score", a.Score AS "accepted_answer_score" FROM Posts AS p JOIN Posts AS q ON p.ParentId = q.Id JOIN Posts AS a ON q.AcceptedAnswerId = a.Id WHERE p.OwnerUserId = '##UserId##' AND p.PostTypeId = 2 AND p.Score > a.Score ORDER BY p.Score DESC
sede
CREATE TABLE table_31343 ( "Rank 2012" real, "Country" text, "UNWTO Region" text, "International tourism expenditure 2011" text, "International tourism expenditure 2012" text, "% change" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which count...
SELECT "Country" FROM table_31343 WHERE "% change" = '5.7'
wikisql
CREATE TABLE table_10374 ( "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 home team that played Hull City?
SELECT "Home team" FROM table_10374 WHERE "Away team" = 'hull city'
wikisql
CREATE TABLE table_36421 ( "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 Round is the lowest one that has a Position of wide receiver, and an Overall sma...
SELECT MIN("Round") FROM table_36421 WHERE "Position" = 'wide receiver' AND "Overall" < '222'
wikisql
CREATE TABLE table_7653 ( "Club" text, "League" text, "Sport" text, "Venue" text, "Established" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total number of Established for soccer plated in kuntz stadium?
SELECT COUNT("Established") FROM table_7653 WHERE "Sport" = 'soccer' AND "Venue" = 'kuntz stadium'
wikisql
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 ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%sri lanka%' ORDER BY Reputation DESC
sede
CREATE TABLE table_4831 ( "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. -- How many people watch at Western Oval venue?
SELECT COUNT("Crowd") FROM table_4831 WHERE "Venue" = 'western oval'
wikisql
CREATE TABLE table_204_889 ( id number, "date" text, "week (stage)" text, "song choice" text, "original artist" text, "theme" text, "result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what was the last free choice song babou performed on...
SELECT "song choice" FROM table_204_889 WHERE "theme" = 'free choice' ORDER BY "date" DESC LIMIT 1
squall
CREATE TABLE table_32912 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When Fitzroy are the away team, what is the aver...
SELECT AVG("Crowd") FROM table_32912 WHERE "Away team" = 'fitzroy'
wikisql
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_CLINIC_ID text, MED_DIRE_CD tex...
SELECT COUNT(*) FROM (SELECT qtb.MED_ORG_DEPT_CD FROM qtb JOIN t_kc24 ON qtb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE qtb.MED_SER_ORG_NO = '7452450' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2006-09-03' AND '2007-05-05' GROUP BY qtb.MED_ORG_DEPT_CD HAVING SUM(t_kc24.MED_AMOUT) > 5876.89 UNION SELECT gyb.MED_ORG_DEPT_CD FRO...
css
CREATE TABLE table_name_32 ( rank VARCHAR, total VARCHAR, silver VARCHAR, bronze VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the rank when silver is 0, bronze is more than 1 and the total is more than 3?
SELECT rank FROM table_name_32 WHERE silver = 0 AND bronze > 1 AND total > 3
sql_create_context
CREATE TABLE table_name_80 ( score VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What score has 2000 as the year?
SELECT score FROM table_name_80 WHERE year = 2000
sql_create_context
CREATE TABLE table_63972 ( "Year" real, "Category" text, "Recipients and nominees" text, "Role/Episode" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- For which Category was Outstanding Main Title Design a Recipient and nominee?
SELECT "Category" FROM table_63972 WHERE "Recipients and nominees" = 'outstanding main title design'
wikisql
CREATE TABLE table_14952 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the visitor of the game on March 7?
SELECT "Visitor" FROM table_14952 WHERE "Date" = 'march 7'
wikisql
CREATE TABLE table_name_62 ( heat VARCHAR, time VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the heat for the time 57.97?
SELECT heat FROM table_name_62 WHERE time = "57.97"
sql_create_context
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TAB...
SELECT medication.drugstarttime FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-75705')) AND medication.routeadmin = 'iv' AND DATETIME(med...
eicu
CREATE TABLE grapes ( ID INTEGER, Grape TEXT, Color TEXT ) CREATE TABLE wine ( No INTEGER, Grape TEXT, Winery TEXT, Appelation TEXT, State TEXT, Name TEXT, Year INTEGER, Price INTEGER, Score INTEGER, Cases INTEGER, Drink TEXT ) CREATE TABLE appellations ( No...
SELECT Winery, COUNT(Winery) FROM wine WHERE Price > 100 GROUP BY Grape, Winery ORDER BY Winery
nvbench
CREATE TABLE table_name_25 ( score VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Score has a Date of 11 september 2010?
SELECT score FROM table_name_25 WHERE date = "11 september 2010"
sql_create_context
CREATE TABLE table_70676 ( "Year" text, "Start" text, "Qual" text, "Rank" text, "Finish" text, "Laps" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- For the car with a qual of 134.288, what was the rank?
SELECT "Rank" FROM table_70676 WHERE "Qual" = '134.288'
wikisql
CREATE TABLE table_54394 ( "Entrant" text, "Constructor" text, "Chassis" text, "Engine" text, "Tyres" text, "Driver" text, "Rounds" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- I want the constructor for divina galica rounds of 1-2
SELECT "Constructor" FROM table_54394 WHERE "Rounds" = '1-2' AND "Driver" = 'divina galica'
wikisql
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime t...
SELECT transfers.wardid FROM transfers WHERE transfers.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 51663) AND NOT transfers.wardid IS NULL AND DATETIME(transfers.intime) <= DATETIME(CURRENT_TIME(), '-3 year') ORDER BY transfers.intime LIMIT 1
mimic_iii
CREATE TABLE table_66375 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the week for November 28, 1982?
SELECT MIN("Week") FROM table_66375 WHERE "Date" = 'november 28, 1982'
wikisql
CREATE TABLE table_train_112 ( "id" int, "systolic_blood_pressure_sbp" int, "modified_geriatric_depression_scale_gds" int, "diastolic_blood_pressure_dbp" int, "rosen_modified_hachinski_ischemic_score" int, "body_mass_index_bmi" float, "hypertension" bool, "NOUSE" float ) -- Using valid...
SELECT * FROM table_train_112 WHERE modified_geriatric_depression_scale_gds >= 15
criteria2sql
CREATE TABLE table_name_34 ( laps INTEGER, qual VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest laps with a 142.744 qual?
SELECT MIN(laps) FROM table_name_34 WHERE qual = "142.744"
sql_create_context
CREATE TABLE table_204_887 ( id number, "district" number, "representative" text, "party" text, "residence" text, "counties represented" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which representative represented the most counties ?
SELECT "representative" FROM table_204_887 ORDER BY "counties represented" DESC LIMIT 1
squall
CREATE TABLE table_643 ( "Episode #" real, "Title" text, "Part 1" text, "Part 2" text, "Part 3" text, "Part 4" text, "Part 5" text, "Part 6" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the episode number of 'Anxiety'?
SELECT "Episode #" FROM table_643 WHERE "Title" = 'Anxiety'
wikisql
CREATE TABLE table_5754 ( "Season" real, "Level" text, "Division" text, "Administration" text, "Position" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Position has a Level of tier 3 and a Season smaller than 1999?
SELECT "Position" FROM table_5754 WHERE "Level" = 'tier 3' AND "Season" < '1999'
wikisql
CREATE TABLE table_name_59 ( winner VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the winner on 28 December 2007?
SELECT winner FROM table_name_59 WHERE date = "28 december 2007"
sql_create_context
CREATE TABLE table_name_87 ( prime_mover VARCHAR, model VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Prime Mover of Model FM CFA-16-4?
SELECT prime_mover FROM table_name_87 WHERE model = "fm cfa-16-4"
sql_create_context
CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE course_offering ( offering_id int, course_id int, semes...
SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN area ON course.course_id = area.course_id INNER JOIN program_course ON program_course.course_id = course.course_id WHERE (area.area LIKE '%Conscious Sedation%' OR course.description LIKE '%Conscious Sedation%' OR course.name LIKE '%Con...
advising
CREATE TABLE student_record ( student_id int, course_id int, semester int, grade varchar, how varchar, transfer_source varchar, earn_credit varchar, repeat_term varchar, test_id varchar ) CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TAB...
SELECT DISTINCT total_credit FROM student WHERE student_id = 1
advising
CREATE TABLE table_60818 ( "Player" text, "Position" text, "Ekstraklasa" real, "Polish Cup" real, "Puchat Ligi" real, "UEFA Cup" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Polish Cup has a Puchat Ligi larger than 0?
SELECT AVG("Polish Cup") FROM table_60818 WHERE "Puchat Ligi" > '0'
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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.icd9_code = "2764" AND lab.flag = "delta"
mimicsql_data
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 INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.discharge_location = "DEAD/EXPIRED" AND lab.label = "Reticulocyte Count, Manual"
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 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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.days_stay > "3" AND prescriptions.drug_type = "MAIN"
mimicsql_data
CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConce...
SELECT p.Id AS "post_link" FROM Posts AS p INNER JOIN Votes AS v ON p.Id = v.PostId AND v.VoteTypeId = 1 INNER JOIN Users AS u ON p.OwnerUserId = u.Id AND u.Reputation < 100 WHERE p.Score = 4
sede
CREATE TABLE table_181 ( "Information" text, "Dysart" text, "Shadow Ridge" text, "Valley Vista" text, "Willow Canyon" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is williow canyon of Roberta Lockhart?
SELECT "Willow Canyon" FROM table_181 WHERE "Dysart" = 'Roberta Lockhart'
wikisql
CREATE TABLE table_11494 ( "Date" text, "Opponent" text, "Home/Away" text, "Field" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the home/away of the game at Nickerson Field at July 10?
SELECT "Home/Away" FROM table_11494 WHERE "Field" = 'nickerson field' AND "Date" = 'july 10'
wikisql
CREATE TABLE table_name_85 ( lost INTEGER, points VARCHAR, position VARCHAR, drawn VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the smallest lost when position is larger than 6, drawn is 7, and the points stat is less than 15?
SELECT MIN(lost) FROM table_name_85 WHERE position > 6 AND drawn = 7 AND points < 15
sql_create_context
CREATE TABLE company ( Headquarters VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Show the most common headquarter for companies.
SELECT Headquarters FROM company GROUP BY Headquarters ORDER BY COUNT(*) DESC LIMIT 1
sql_create_context
CREATE TABLE table_name_50 ( home_team VARCHAR, venue VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the home teams score at Arden Street Oval?
SELECT home_team AS score FROM table_name_50 WHERE venue = "arden street oval"
sql_create_context
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 * FROM person_info JOIN hz_info JOIN zyjzjlb 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 WHERE person_info.XM = '郑波涛' AND hz_info.YLJGDM = '8549699' AND zyjzjlb.CYKSMC LIKE '%关节病%'
css
CREATE TABLE table_name_42 ( date VARCHAR, actual_title VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Date for the actual title archie bunker's place?
SELECT date FROM table_name_42 WHERE actual_title = "archie bunker's place"
sql_create_context
CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate time, ApprovalDate time, RejectionDate time, OwnerUserId number, Comment text, Text text, Title text, Tags text, RevisionGUID other ) CREATE TABLE PendingFlags ( Id number, FlagTypeId number, Po...
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%pakistan%' OR UPPER(Location) LIKE '%PK%' ORDER BY Reputation DESC LIMIT 1000
sede
CREATE TABLE table_name_12 ( round VARCHAR, res VARCHAR, method VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many total rounds have the results of win, and n/a as the method?
SELECT COUNT(round) FROM table_name_12 WHERE res = "win" AND method = "n/a"
sql_create_context
CREATE TABLE table_name_73 ( home VARCHAR, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which home had a record of 2-4?
SELECT home FROM table_name_73 WHERE record = "2-4"
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 demographic.marital_status, demographic.admittime FROM demographic WHERE demographic.subject_id = "29767"
mimicsql_data
CREATE TABLE PersonFriend ( name varchar(20), friend varchar(20), year INTEGER ) CREATE TABLE Person ( name varchar(20), age INTEGER, city TEXT, gender TEXT, job TEXT ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is average age of male...
SELECT job, AVG(age) FROM Person WHERE gender = 'male' GROUP BY job ORDER BY AVG(age) DESC
nvbench
CREATE TABLE table_47387 ( "Poll Source" text, "Dates administered" text, "Democrat: Brian Schweitzer" text, "Republican: Roy Brown" text, "Libertarian: Stan Jones" text, "Lead Margin" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the l...
SELECT MAX("Lead Margin") FROM table_47387 WHERE "Democrat: Brian Schweitzer" = '55%' AND "Libertarian: Stan Jones" = 'not an option'
wikisql
CREATE TABLE table_name_38 ( constellation VARCHAR, designation VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where is Hip 4872?
SELECT constellation FROM table_name_38 WHERE designation = "hip 4872"
sql_create_context
CREATE TABLE table_name_62 ( pick INTEGER, hometown_school VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the pick # of the player who has a hometown/school of Atlanta, GA?
SELECT AVG(pick) FROM table_name_62 WHERE hometown_school = "atlanta, ga"
sql_create_context
CREATE TABLE train ( Train_ID int, Train_Num text, Name text, From text, Arrival text, Railway_ID int ) CREATE TABLE railway_manage ( Railway_ID int, Manager_ID int, From_Year text ) CREATE TABLE railway ( Railway_ID int, Railway text, Builder text, Built text, ...
SELECT Country, COUNT(Country) FROM manager WHERE Age > 50 OR Age < 46 GROUP BY Country ORDER BY COUNT(Country)
nvbench
CREATE TABLE table_dev_49 ( "id" int, "gender" string, "systolic_blood_pressure_sbp" int, "renal_disease" bool, "diastolic_blood_pressure_dbp" int, "high_density_lipoprotein_cholesterol_hdl_c" int, "serum_creatinine" float, "waist_circumference" int, "triglyceride_tg" float, "hyp...
SELECT * FROM table_dev_49 WHERE (CASE WHEN (waist_circumference > 40 AND gender = 'male') OR (waist_circumference > 35 AND gender = 'female') THEN 1 ELSE 0 END + CASE WHEN triglyceride_tg > 150 THEN 1 ELSE 0 END + CASE WHEN (high_density_lipoprotein_cholesterol_hdl_c < 40 AND gender = 'male') OR (high_density_lipoprot...
criteria2sql
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 EM...
SELECT SCHOOL_CODE, COUNT(*) FROM DEPARTMENT AS T1 JOIN PROFESSOR AS T2 ON T1.DEPT_CODE = T2.DEPT_CODE GROUP BY T1.SCHOOL_CODE ORDER BY COUNT(*)
nvbench
CREATE TABLE table_name_17 ( occupation VARCHAR, hometown VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the occupation of the person with a hometown of Hampshire?
SELECT occupation FROM table_name_17 WHERE hometown = "hampshire"
sql_create_context
CREATE TABLE table_204_232 ( id number, "rank" number, "nation" text, "gold" number, "silver" number, "bronze" number, "total" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which countries won the least amount of medals ?
SELECT "nation" FROM table_204_232 WHERE "total" = (SELECT MIN("total") FROM table_204_232)
squall
CREATE TABLE player ( Player_ID int, Player text, Years_Played text, Total_WL text, Singles_WL text, Doubles_WL text, Team int ) CREATE TABLE team ( Team_id int, Name text ) CREATE TABLE match_season ( Season real, Player text, Position text, Country int, Team i...
SELECT Position, COUNT(*) FROM match_season GROUP BY Position
nvbench
CREATE TABLE table_17964087_2 ( govt_salary VARCHAR, chinese_name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- For the chinese name how many in total is the govt salary?
SELECT COUNT(govt_salary) FROM table_17964087_2 WHERE chinese_name = "盧奕基"
sql_create_context
CREATE TABLE table_13526 ( "Frequency" text, "Call sign" text, "Branding" text, "Format" text, "Owner" text, "Language/Rebroadcast" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the branding when the call sign is ckua-fm-3?
SELECT "Branding" FROM table_13526 WHERE "Call sign" = 'ckua-fm-3'
wikisql
CREATE TABLE table_name_85 ( no_7 VARCHAR, region__year_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is No. 7, when Region (Year) is Arizona (2010)?
SELECT no_7 FROM table_name_85 WHERE region__year_ = "arizona (2010)"
sql_create_context
CREATE TABLE table_29050 ( "District" real, "Region" text, "Communes" text, "Population (2002 census)" real, "% of total population" text, "VAP" real, "Enrolled" real, "Total votes" real, "Valid votes" real, "Turnout" text, "E/VAP" text, "T/VAP" text, "V/VAP" text ) ...
SELECT "Enrolled" FROM table_29050 WHERE "T/VAP" = '52.9%'
wikisql
CREATE TABLE member ( Member_ID int, Member_Name text, Party_ID text, In_office text ) CREATE TABLE region ( Region_ID int, Region_name text, Date text, Label text, Format text, Catalogue text ) CREATE TABLE party_events ( Event_ID int, Event_Name text, Party_ID int...
SELECT Party_name, COUNT(*) FROM party_events AS T1 JOIN party AS T2 ON T1.Party_ID = T2.Party_ID GROUP BY T1.Party_ID
nvbench
CREATE TABLE table_32426 ( "Team" text, "Chassis" text, "Engine" text, "Tires" text, "Drivers" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the engine for the team of Alex Morales Motorsports?
SELECT "Engine" FROM table_32426 WHERE "Team" = 'alex morales motorsports'
wikisql
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_CLINIC_ID text, MED_DIRE_CD tex...
SELECT MIN(t_kc24.MED_AMOUT), MAX(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc21_t_kc24.MED_CLINIC_ID IN (SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '4821131' AND t_kc21.OUT_DIAG_DIS_CD = 'T22.309')
css
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 treatment ( treat...
SELECT t2.drugname FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-74856') AND diagnosis.diagnos...
eicu
CREATE TABLE fzzmzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH number, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZD...
SELECT zzmzjzjlb.ZZYSGH, zzmzjzjlb.QTJZYSGH FROM zzmzjzjlb WHERE zzmzjzjlb.JZLSH = '68219114345' UNION SELECT fzzmzjzjlb.ZZYSGH, fzzmzjzjlb.QTJZYSGH FROM fzzmzjzjlb WHERE fzzmzjzjlb.JZLSH = '68219114345'
css
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 ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.flag = "abnormal" AND lab.label = "Uric Acid"
mimicsql_data
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 text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
SELECT demographic.admission_location FROM demographic WHERE demographic.name = "Stephanie Suchan"
mimicsql_data
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 Headquarter, SUM(Revenue) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter ORDER BY SUM(Revenue) DESC
nvbench
CREATE TABLE table_70150 ( "Year" real, "Entrant" text, "Chassis" text, "Engine" text, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which engine did Marlboro Team Alfa Romeo used with a chassis of alfa romeo 179?
SELECT "Engine" FROM table_70150 WHERE "Entrant" = 'marlboro team alfa romeo' AND "Chassis" = 'alfa romeo 179'
wikisql
CREATE TABLE table_25527255_2 ( manager VARCHAR, team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the manager of FK Andijan?
SELECT manager FROM table_25527255_2 WHERE team = "FK Andijan"
sql_create_context
CREATE TABLE Document_Types ( document_type_code VARCHAR, document_description VARCHAR ) CREATE TABLE Grants ( grant_start_date VARCHAR, grant_id VARCHAR ) CREATE TABLE Documents ( grant_id VARCHAR, document_type_code VARCHAR ) -- Using valid SQLite, answer the following questions for the ta...
SELECT T1.grant_start_date FROM Grants AS T1 JOIN Documents AS T2 ON T1.grant_id = T2.grant_id JOIN Document_Types AS T3 ON T2.document_type_code = T3.document_type_code WHERE T3.document_description = 'Regular' INTERSECT SELECT T1.grant_start_date FROM Grants AS T1 JOIN Documents AS T2 ON T1.grant_id = T2.grant_id JOI...
sql_create_context
CREATE TABLE table_1704 ( "Episode #" real, "Title" text, "Director" text, "Screenwriter" text, "Original airdate" text, "English airdate" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which is the number of the episode 'rook gave' 'r ku d o' (...
SELECT MIN("Episode #") FROM table_1704 WHERE "Original airdate" = 'July 14, 2003'
wikisql
CREATE TABLE table_2512935_8 ( original_language VARCHAR, book_series VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is every original language for book series Little House on the Prairie?
SELECT original_language FROM table_2512935_8 WHERE book_series = "Little House on the Prairie"
sql_create_context
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH text, KH text, KLX number,...
SELECT COUNT(*) FROM mzjzjlb WHERE mzjzjlb.YLJGDM = '5701953' AND mzjzjlb.JZKSRQ BETWEEN '2003-04-08' AND '2014-07-28' AND mzjzjlb.TXBZ > 0
css
CREATE TABLE table_57424 ( "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 Venue has an Away team score of 11.13 (79)?...
SELECT "Venue" FROM table_57424 WHERE "Away team score" = '11.13 (79)'
wikisql
CREATE TABLE table_16751596_6 ( republican VARCHAR, poll_source VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many times did Public Policy Polling under Republican: Jack Hoogendyk?
SELECT COUNT(republican) AS :_jack_hoogendyk FROM table_16751596_6 WHERE poll_source = "Public Policy Polling"
sql_create_context
CREATE TABLE wedding ( Church_ID int, Male_ID int, Female_ID int, Year int ) CREATE TABLE church ( Church_ID int, Name text, Organized_by text, Open_Date int, Continuation_of text ) CREATE TABLE people ( People_ID int, Name text, Country text, Is_Male text, Age ...
SELECT Name, Age FROM people WHERE Is_Male = 'T' AND NOT People_ID IN (SELECT Male_ID FROM wedding) ORDER BY Age
nvbench
CREATE TABLE table_name_26 ( speed VARCHAR, rank VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the speed for rank 1?
SELECT speed FROM table_name_26 WHERE rank = "1"
sql_create_context
CREATE TABLE table_30120761_1 ( barony VARCHAR, townland VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many baronies is Maulnagrough a part of?
SELECT COUNT(barony) FROM table_30120761_1 WHERE townland = "Maulnagrough"
sql_create_context
CREATE TABLE table_38867 ( "Model" text, "Years" text, "Engine" text, "Displ." text, "Power" text, "Torque" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What years show Model of 2.0 tdi (cr) dpf?
SELECT "Years" FROM table_38867 WHERE "Model" = '2.0 tdi (cr) dpf'
wikisql
CREATE TABLE table_204_195 ( id number, "team" text, "home city" text, "stadium" text, "capacity" number, "last season" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which stadium can seat the most people ?
SELECT "stadium" FROM table_204_195 ORDER BY "capacity" DESC LIMIT 1
squall
CREATE TABLE table_69507 ( "Year" real, "Candidate" text, "State(s) on the Ballot" text, "Popular Votes" real, "Percentage" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the staes on the ballot for jack herer
SELECT "State(s) on the Ballot" FROM table_69507 WHERE "Candidate" = 'jack herer'
wikisql
CREATE TABLE Ref_Calendar ( Calendar_Date DATETIME, Day_Number INTEGER ) CREATE TABLE Ref_Document_Types ( Document_Type_Code CHAR(15), Document_Type_Name VARCHAR(255), Document_Type_Description VARCHAR(255) ) CREATE TABLE Roles ( Role_Code CHAR(15), Role_Name VARCHAR(255), Role_Descri...
SELECT Date_in_Locaton_To, COUNT(Date_in_Locaton_To) FROM Document_Locations
nvbench
CREATE TABLE table_name_9 ( record VARCHAR, opponent VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which record has an Opponent of orioles and a Date of april 14?
SELECT record FROM table_name_9 WHERE opponent = "orioles" AND date = "april 14"
sql_create_context
CREATE TABLE table_66298 ( "School" text, "Location" text, "Mascot" text, "Size" real, "IHSAA Class" text, "County" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Size has an IHSAA Class of aa, and a Location of milan?
SELECT SUM("Size") FROM table_66298 WHERE "IHSAA Class" = 'aa' AND "Location" = 'milan'
wikisql
CREATE TABLE table_19753079_36 ( party VARCHAR, district VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the total party for north carolina 7
SELECT COUNT(party) FROM table_19753079_36 WHERE district = "North Carolina 7"
sql_create_context
CREATE TABLE table_name_11 ( result VARCHAR, year__ceremony_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Result of the 2010 (83rd) Ceremony?
SELECT result FROM table_name_11 WHERE year__ceremony_ = "2010 (83rd)"
sql_create_context
CREATE TABLE table_66399 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Result of the game against Philadelphia Eagles?
SELECT "Result" FROM table_66399 WHERE "Opponent" = 'philadelphia eagles'
wikisql
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_CLINIC_ID text, MED_DIRE_CD tex...
SELECT * FROM qtb WHERE qtb.MED_SER_ORG_NO = '9209968' AND qtb.IN_HOSP_DATE BETWEEN '2008-09-08' AND '2010-01-16' UNION SELECT * FROM gyb WHERE gyb.MED_SER_ORG_NO = '9209968' AND gyb.IN_HOSP_DATE BETWEEN '2008-09-08' AND '2010-01-16' UNION SELECT * FROM zyb WHERE zyb.MED_SER_ORG_NO = '9209968' AND zyb.IN_HOSP_DATE BETW...
css
CREATE TABLE table_train_138 ( "id" int, "mini_mental_state_examination_mmse" int, "stroke" bool, "body_weight" float, "cranial_neurosurgery" bool, "first_degree_relative" bool, "seizure_disorder" bool, "alcohol_abuse" bool, "body_mass_index_bmi" float, "aneurysm" bool, "NOUS...
SELECT * FROM table_train_138 WHERE mini_mental_state_examination_mmse >= 16 AND mini_mental_state_examination_mmse <= 28
criteria2sql
CREATE TABLE table_56422 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the team's record on August 4?
SELECT "Record" FROM table_56422 WHERE "Date" = 'august 4'
wikisql
CREATE TABLE table_1157 ( "Draw" real, "Artist" text, "Song" text, "Televote" real, "Points" real, "Professional Jury" real, "TRM Committee" real, "Total" real, "Place" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the place of...
SELECT "Place" FROM table_1157 WHERE "Professional Jury" = '5'
wikisql
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 allergy ( allergy...
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 = '030-28944')) AND DATETIME(medication.drugstarttime, 'start of month') = DA...
eicu
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 ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.discharge_location = "HOME HEALTH CARE" AND procedures.long_title = "Insertion of non-drug-eluting coronary artery stent(s)"
mimicsql_data
CREATE TABLE table_name_98 ( motor VARCHAR, apogee VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What kind of Motor has a Apogee of 713 km?
SELECT motor FROM table_name_98 WHERE apogee = "713 km"
sql_create_context
CREATE TABLE table_name_14 ( position VARCHAR, height VARCHAR, shirt_no VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the position of the player with a height of 205 and shirt no 8?
SELECT position FROM table_name_14 WHERE height = 205 AND shirt_no = 8
sql_create_context
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 mzjzjlb.JZLSH FROM person_info JOIN hz_info JOIN mzjzjlb 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.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.YLJGDM = hz_info_mzjzjlb.YLJGDM AND ...
css
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, KSMC text, SQRGH text, SQRXM text, BGRGH text, BGRXM text, SHRGH ...
SELECT JCXMMC, JCZBDM, JCZBMC, JCFF FROM jyjgzbb WHERE JYZBLSH = '48574522587'
css
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 COUNT(*) FROM zyjzjlb WHERE YLJGDM = '5574257' AND RYDJSJ BETWEEN '2004-04-17' AND '2011-10-31' AND WDBZ > 0
css