instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE t_kc22 ( MED_EXP_DET_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, MED_EXP_BILL_ID text, SOC_SRT_DIRE_CD text, SOC_SRT_DIRE_NM text, DIRE_TYPE number, CHA_ITEM_LEV number, MED_INV_ITEM_TYPE text, MED_DIRE_CD text, MED_DIRE_NM text,...
SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_ID = '80675111' AND t_kc22.MED_INV_ITEM_TYPE = '治疗费'
css
CREATE TABLE table_69559 ( "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 Qual listed on the Year of 1954?
SELECT "Qual" FROM table_69559 WHERE "Year" = '1954'
wikisql
CREATE TABLE member ( member_id number, member_name text, party_id text, in_office text ) CREATE TABLE party_events ( event_id number, event_name text, party_id number, member_in_charge_id number ) CREATE TABLE region ( region_id number, region_name text, date text, lab...
SELECT T2.party_name, COUNT(*) FROM party_events AS T1 JOIN party AS T2 ON T1.party_id = T2.party_id GROUP BY T1.party_id
spider
CREATE TABLE table_8224 ( "Position" real, "Name" text, "Played" real, "Drawn" real, "Lost" real, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the most elevated Played that has a Lost smaller than 12, and a Name of ec amberg (...
SELECT MAX("Played") FROM table_8224 WHERE "Lost" < '12' AND "Name" = 'ec amberg (n)' AND "Position" < '4'
wikisql
CREATE TABLE table_48609 ( "Round" real, "Pick" text, "Player" text, "Position" text, "School/Club Team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Position, when School/Club Team is McMaster?
SELECT "Position" FROM table_48609 WHERE "School/Club Team" = 'mcmaster'
wikisql
CREATE TABLE table_68137 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the score for april 28
SELECT "Score" FROM table_68137 WHERE "Date" = 'april 28'
wikisql
CREATE TABLE table_75801 ( "Name" text, "Novelty" text, "Status" text, "Authors" text, "Location" text, "Notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Name of the dinosaur, whose notes are, 'n ornithischia of uncertain placem...
SELECT "Name" FROM table_75801 WHERE "Notes" = 'n ornithischia of uncertain placement'
wikisql
CREATE TABLE table_203_359 ( id number, "outcome" text, "year" number, "championship" text, "surface" text, "opponent" text, "score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- was roddick a runner up or winner more ?
SELECT "outcome" FROM table_203_359 GROUP BY "outcome" ORDER BY COUNT(*) DESC LIMIT 1
squall
CREATE TABLE zyb ( CLINIC_ID text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, INSU_TYPE text, IN...
SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM qtb JOIN t_kc22 ON qtb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE qtb.PERSON_NM = '周锐利' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY COUNT(*) DESC UNION SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM gyb JOIN t_kc22 ON gyb.MED_CLINIC_ID = t_kc22.MED_CLI...
css
CREATE TABLE table_name_20 ( date VARCHAR, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When was the score 5-31?
SELECT date FROM table_name_20 WHERE record = "5-31"
sql_create_context
CREATE TABLE semester ( semester_id int, semester varchar, year int ) 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_...
SELECT DISTINCT course.department, course.name, course.number FROM course, program, program_course WHERE course.department LIKE '%PERIODON%' AND program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id AND program.name LIKE '%CS-LSA%' AND program.program_id = program_course.program_id
advising
CREATE TABLE mzjzjlb_jybgb ( YLJGDM_MZJZJLB text, BGDH number, YLJGDM number ) 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 te...
SELECT jybgb.SHRGH, jybgb.SHRXM FROM jybgb WHERE jybgb.BGDH = '16846879997'
css
CREATE TABLE table_name_63 ( bush_number INTEGER, bush_percentage VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest Bush#, when Bush% is '65.4%'?
SELECT MIN(bush_number) FROM table_name_63 WHERE bush_percentage = "65.4%"
sql_create_context
CREATE TABLE zyjzjlb_jybgb ( YLJGDM_ZYJZJLB text, BGDH number, YLJGDM 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 n...
SELECT COUNT(*) FROM zyjzjlb WHERE zyjzjlb.YLJGDM = '6366703' AND zyjzjlb.RYDJSJ BETWEEN '2012-11-27' AND '2015-06-06' AND zyjzjlb.WDBZ > 0
css
CREATE TABLE table_49163 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Jerry Barber's To par?
SELECT "To par" FROM table_49163 WHERE "Player" = 'jerry barber'
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 t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_ID = '39270764' AND t_kc22.MED_INV_ITEM_TYPE = '治疗费'
css
CREATE TABLE table_1425 ( "#" real, "Series Sorted" text, "Title" text, "Author" text, "Doctor" text, "Featuring" text, "Released" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What series was sorted at number 3?
SELECT "Series Sorted" FROM table_1425 WHERE "#" = '3'
wikisql
CREATE TABLE table_name_2 ( event VARCHAR, snatch VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What event has a 122.5 snatch rate?
SELECT event FROM table_name_2 WHERE snatch = 122.5
sql_create_context
CREATE TABLE table_name_41 ( date VARCHAR, surface VARCHAR, opponent_in_the_final VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the date for the grass surface final against Nathan Healey?
SELECT date FROM table_name_41 WHERE surface = "grass" AND opponent_in_the_final = "nathan healey"
sql_create_context
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 COUNT(*) FROM t_kc22 WHERE MED_ORG_DEPT_CD = '544' AND STA_DATE BETWEEN '2005-01-30' AND '2005-07-23' AND SOC_SRT_DIRE_NM = '苯妥英钠片'
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 demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "68" AND prescriptions.formulary_drug_cd = "D5W100"
mimicsql_data
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 School_ID, ACC_Percent FROM basketball_match GROUP BY All_Neutral
nvbench
CREATE TABLE table_54512 ( "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 attendance when Fitzroy played as t...
SELECT AVG("Crowd") FROM table_54512 WHERE "Away team" = 'fitzroy'
wikisql
CREATE TABLE restriction ( restriction_code text, advance_purchase int, stopovers text, saturday_stay_required text, minimum_stay int, maximum_stay int, application text, no_discounts text ) CREATE TABLE aircraft ( aircraft_code varchar, aircraft_description varchar, manufac...
SELECT DISTINCT airline.airline_code FROM airline, airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE ((flight.airline_code = 'AA') AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PITTSBURGH' AND flight.to_airport = AIRPORT...
atis
CREATE TABLE table_26282750_1 ( participants_recipients VARCHAR, category VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the participant or recipient for the Best Female Actor?
SELECT participants_recipients FROM table_26282750_1 WHERE category = "Best Female Actor"
sql_create_context
CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDa...
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE (LOWER(AboutMe) LIKE '%ios%' OR LOWER(AboutMe) LIKE '%iphone%') AND (LOWER(Location) LIKE '%berlin%') ORDER BY Reputation DESC LIMIT 20
sede
CREATE TABLE book ( Book_ID int, Title text, Issues real, Writer text ) CREATE TABLE publication ( Publication_ID int, Book_ID int, Publisher text, Publication_Date text, Price real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Show dif...
SELECT Publisher, COUNT(*) FROM publication GROUP BY Publisher
nvbench
CREATE TABLE hz_info_zyjzjlb ( JZLSH number, YLJGDM number, zyjzjlb_id number ) 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, ...
SELECT COUNT(*) FROM zyjzjlb WHERE zyjzjlb.JZKSMC = '疼痛科' AND zyjzjlb.RYDJSJ BETWEEN '2003-01-12' AND '2005-09-05'
css
CREATE TABLE table_22331 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- If Di Drew is the director, what was the original air ...
SELECT "Original air date" FROM table_22331 WHERE "Directed by" = 'Di Drew'
wikisql
CREATE TABLE table_61441 ( "Goalkeeper" text, "Goals" real, "Matches" real, "Average" real, "Team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest match for goals larger than 36?
SELECT MIN("Matches") FROM table_61441 WHERE "Goals" > '36'
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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.short_title = "Arthropathy NOS-unspec" AND lab.fluid = "Blood"
mimicsql_data
CREATE TABLE table_23717 ( "County" text, "Obama%" text, "Obama#" real, "McCain%" text, "McCain#" real, "Others%" text, "Others" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the county where McCain got 60.6% and Ob...
SELECT "County" FROM table_23717 WHERE "McCain%" = '60.6%' AND "Obama%" = '37.3%'
wikisql
CREATE TABLE table_name_49 ( home_team VARCHAR, date VARCHAR, tie_no VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Home Team, when Date is '6 December 1986', and when Tie No is '4'?
SELECT home_team FROM table_name_49 WHERE date = "6 december 1986" AND tie_no = "4"
sql_create_context
CREATE TABLE table_68347 ( "Round" text, "Kick Off" text, "Opponents" text, "H / A" text, "Result" text, "Attendance" real, "Report" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the result for an H/A of H and a round value of R6 re...
SELECT "Result" FROM table_68347 WHERE "H / A" = 'h' AND "Round" = 'r6 replay'
wikisql
CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varc...
SELECT HIRE_DATE, COUNT(HIRE_DATE) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY COUNT(HIRE_DATE)
nvbench
CREATE TABLE table_name_33 ( opponent VARCHAR, game VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Opponent has a Game of 63?
SELECT opponent FROM table_name_33 WHERE game = 63
sql_create_context
CREATE TABLE Department ( DepartmentID INTEGER, Name VARCHAR(30), Head INTEGER ) CREATE TABLE Block ( BlockFloor INTEGER, BlockCode INTEGER ) CREATE TABLE Room ( RoomNumber INTEGER, RoomType VARCHAR(30), BlockFloor INTEGER, BlockCode INTEGER, Unavailable BOOLEAN ) CREATE TABLE...
SELECT Name, COUNT(*) FROM Medication AS T1 JOIN Prescribes AS T2 ON T1.Code = T2.Medication GROUP BY T1.Brand ORDER BY COUNT(*) DESC
nvbench
CREATE TABLE table_57920 ( "Race Name" text, "Circuit" text, "Date" text, "Winning driver" text, "Constructor" text, "Report" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What driver won in the xv grand prix de l'albigeois in a vehicle by ferr...
SELECT "Winning driver" FROM table_57920 WHERE "Constructor" = 'ferrari' AND "Race Name" = 'xv grand prix de l''albigeois'
wikisql
CREATE TABLE table_78021 ( "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 had footscray play at it?
SELECT "Venue" FROM table_78021 WHERE "Away team" = 'footscray'
wikisql
CREATE TABLE grapes ( ID INTEGER, Grape TEXT, Color TEXT ) CREATE TABLE appellations ( No INTEGER, Appelation TEXT, County TEXT, State TEXT, Area TEXT, isAVA TEXT ) CREATE TABLE wine ( No INTEGER, Grape TEXT, Winery TEXT, Appelation TEXT, State TEXT, Name TE...
SELECT Year, AVG(Price) FROM wine GROUP BY Year ORDER BY Year
nvbench
CREATE TABLE table_29196086_4 ( no_in_series VARCHAR, original_air_date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many episodes originally aired january19,2013
SELECT COUNT(no_in_series) FROM table_29196086_4 WHERE original_air_date = "January19,2013"
sql_create_context
CREATE TABLE table_58269 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Series" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the series score of the game on April 16?
SELECT "Series" FROM table_58269 WHERE "Date" = 'april 16'
wikisql
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 (SELECT jybgb.KSBM FROM mzjzjlb JOIN jybgb ON mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE mzjzjlb.YLJGDM = '2003934' AND jybgb.BGRQ BETWEEN '2012-08-24' AND '2015-07-31' GROUP BY jybgb.KSBM HAVING COUNT(*) <= 12) AS T
css
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugst...
SELECT COUNT(*) > 0 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '012-31116'))
eicu
CREATE TABLE table_22867 ( "Position" real, "Club" text, "Played" real, "Won" real, "Drawn" real, "Lost" real, "Pts For" real, "Pts Agst" real, "Pts Diff" real, "B.P." real, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above....
SELECT COUNT("Played") FROM table_22867 WHERE "Club" = 'Featherstone Rovers'
wikisql
CREATE TABLE table_name_98 ( home_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What did fitzroy score at their home game?
SELECT home_team AS score FROM table_name_98 WHERE home_team = "fitzroy"
sql_create_context
CREATE TABLE area ( course_id int, area varchar ) CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, country varchar, zip int ) CREATE TABLE ta ( campus_job_id int, student_id int, location varch...
SELECT DISTINCT department FROM course WHERE name LIKE '%Media Chinese%'
advising
CREATE TABLE table_39991 ( "Gill" text, "Latitude" text, "Longitude" text, "Diameter (km)" text, "Diameter (mi)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Diameter (mi) when the Longitude is 79.8 e?
SELECT "Diameter (mi)" FROM table_39991 WHERE "Longitude" = '79.8° e'
wikisql
CREATE TABLE table_63205 ( "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 score when york city was the home team?
SELECT "Score" FROM table_63205 WHERE "Home team" = 'york city'
wikisql
CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25), COUNTRY_ID varchar(2) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decima...
SELECT HIRE_DATE, SUM(SALARY) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY SUM(SALARY) DESC
nvbench
CREATE TABLE buildings ( id number, name text, city text, height number, stories number, status text ) CREATE TABLE office_locations ( building_id number, company_id number, move_in_year number ) CREATE TABLE companies ( id number, name text, headquarters text, indu...
SELECT name FROM companies ORDER BY market_value_billion DESC
spider
CREATE TABLE table_name_33 ( Id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is 1995 Grand Slam Tournament if 1996 is also grand slam tournaments?
SELECT 1990 FROM table_name_33 WHERE 1996 = "grand slam tournaments"
sql_create_context
CREATE TABLE table_18237 ( "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. -- Who was the candidate in the Virginia 3 district election?
SELECT "Candidates" FROM table_18237 WHERE "District" = 'Virginia 3'
wikisql
CREATE TABLE table_203_407 ( id number, "name" text, "party" text, "province" text, "term expires" number, "years in office" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the number of people in the liberal party ?
SELECT COUNT("name") FROM table_203_407 WHERE "party" = 'liberal'
squall
CREATE TABLE table_3198 ( "District" text, "Incumbent" text, "Party" text, "First elected" text, "Result" text, "Candidates" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the candidates for first elected being 1976
SELECT "Candidates" FROM table_3198 WHERE "First elected" = '1976'
wikisql
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE medication ( medication...
SELECT COUNT(*) FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '029-6419')) AND medication.drugname = '0.4 ml syringe : enoxaparin sodium 40 m...
eicu
CREATE TABLE table_name_24 ( year__ceremony_ VARCHAR, result VARCHAR, film_title_used_in_nomination VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the year when not nominated was the result, and In the Navel of the Sea was the film title used in ...
SELECT year__ceremony_ FROM table_name_24 WHERE result = "not nominated" AND film_title_used_in_nomination = "in the navel of the sea"
sql_create_context
CREATE TABLE table_72252 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Series" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name t...
SELECT "Series" FROM table_72252 WHERE "Date" = 'June 5'
wikisql
CREATE TABLE table_72552 ( "Rank" real, "Place" text, "County" text, "Per Capita Income" text, "Median House- hold Income" text, "Population" real, "Number of Households" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which place has a rank ...
SELECT "Place" FROM table_72552 WHERE "Rank" = '71'
wikisql
CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID ...
SELECT HIRE_DATE, SUM(EMPLOYEE_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY SUM(EMPLOYEE_ID) DESC
nvbench
CREATE TABLE instructor ( id text, name text, dept_name text, salary number ) CREATE TABLE section ( course_id text, sec_id text, semester text, year number, building text, room_number text, time_slot_id text ) CREATE TABLE classroom ( building text, room_number tex...
SELECT dept_name FROM instructor GROUP BY dept_name ORDER BY AVG(salary) DESC LIMIT 1
spider
CREATE TABLE student ( stuid number, lname text, fname text, age number, sex text, major number, advisor number, city_code text ) CREATE TABLE club ( clubid number, clubname text, clubdesc text, clublocation text ) CREATE TABLE member_of_club ( stuid number, clu...
SELECT clubname FROM club WHERE clublocation = "AKW"
spider
CREATE TABLE table_name_93 ( year INTEGER, competition VARCHAR, category VARCHAR, beer_name VARCHAR, prize VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What year did maggs magnificent mild win a gold medal in the mild and porter category at the...
SELECT AVG(year) FROM table_name_93 WHERE beer_name = "maggs magnificent mild" AND prize = "gold medal" AND category = "mild and porter" AND competition = "siba south east region beer competition"
sql_create_context
CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), ...
SELECT JOB_ID, SUM(EMPLOYEE_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' GROUP BY JOB_ID ORDER BY SUM(EMPLOYEE_ID)
nvbench
CREATE TABLE table_name_93 ( year INTEGER, title VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average year that has far cry vengeance as the title?
SELECT AVG(year) FROM table_name_93 WHERE title = "far cry vengeance"
sql_create_context
CREATE TABLE table_name_33 ( wins INTEGER, losses VARCHAR, against VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the wins when there are 5 losses, and against is more than 1205?
SELECT MAX(wins) FROM table_name_33 WHERE losses = 5 AND against > 1205
sql_create_context
CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolea...
SELECT Title, ViewCount, CreationDate FROM Posts WHERE PostTypeId = '1' AND CreationDate BETWEEN '2019-02-01 00:00:00' AND '2019-02-28 23:59:59' ORDER BY ViewCount DESC LIMIT 200
sede
CREATE TABLE table_7349 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Opponent in the final" text, "Score in the final" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which final score had a surface of hard (i) on October 22...
SELECT "Score in the final" FROM table_7349 WHERE "Surface" = 'hard (i)' AND "Date" = 'october 22, 2000'
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 patient ( uniquep...
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 = '022-78464')) AND medication.routeadmin = 'iv' AND STRFTIME('%y...
eicu
CREATE TABLE table_27137 ( "Round" text, "Circuit" text, "Date" text, "Class A Winner" text, "Class B Winner" text, "Class C Winner" text, "Class D Winner" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the circuit in round 2?
SELECT "Circuit" FROM table_27137 WHERE "Round" = '2'
wikisql
CREATE TABLE representative ( Representative_ID int, Name text, State text, Party text, Lifespan text ) CREATE TABLE election ( Election_ID int, Representative_ID int, Date text, Votes real, Vote_Percent real, Seats real, Place real ) -- Using valid SQLite, answer the ...
SELECT Date, Vote_Percent FROM election ORDER BY Vote_Percent DESC
nvbench
CREATE TABLE table_name_67 ( driver_s VARCHAR, race_title VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who won the III Coppa Acerbo title?
SELECT driver_s FROM table_name_67 WHERE race_title = "iii coppa acerbo"
sql_create_context
CREATE TABLE table_62072 ( "Tournament" text, "2000" text, "2001" text, "2002" text, "2003" text, "2004" text, "2005" text, "2006" text, "2007" text, "2008" text, "2009" text, "2010" text, "2011" text ) -- Using valid SQLite, answer the following questions for the t...
SELECT "2008" FROM table_62072 WHERE "2003" = '325'
wikisql
CREATE TABLE table_55296 ( "Grid" real, "Driver" text, "Constructor" text, "Qual" real, "Rank" real, "Laps" real, "Time/Retired" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- I want the total number of rank for Grid less than 20 and dick ra...
SELECT COUNT("Rank") FROM table_55296 WHERE "Grid" < '20' AND "Driver" = 'dick rathmann' AND "Qual" > '130.92'
wikisql
CREATE TABLE table_16168849_1 ( enrollment INTEGER, institution VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the maximum enrollment for st. andrews university
SELECT MAX(enrollment) FROM table_16168849_1 WHERE institution = "St. Andrews University"
sql_create_context
CREATE TABLE table_name_71 ( host_team VARCHAR, visiting_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Host team that has indianapolis colts as a Visiting team?
SELECT host_team FROM table_name_71 WHERE visiting_team = "indianapolis colts"
sql_create_context
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescription...
SELECT AVG(demographic.age) FROM demographic WHERE demographic.admission_type = "EMERGENCY" AND demographic.diagnosis = "T5 FRACTURE"
mimicsql_data
CREATE TABLE Customers ( customer_id INTEGER, payment_method VARCHAR(15), customer_name VARCHAR(80), customer_phone VARCHAR(80), customer_email VARCHAR(80), customer_address VARCHAR(255), customer_login VARCHAR(80), customer_password VARCHAR(10) ) CREATE TABLE Mailshot_Campaigns ( m...
SELECT premises_type, COUNT(premises_type) FROM Customer_Addresses AS T1 JOIN Premises AS T2 ON T1.premise_id = T2.premise_id GROUP BY address_type_code, premises_type ORDER BY premises_type DESC
nvbench
CREATE TABLE table_name_90 ( country VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What country has todd hamilton as the player?
SELECT country FROM table_name_90 WHERE player = "todd hamilton"
sql_create_context
CREATE TABLE table_24638867_6 ( score VARCHAR, outcome VARCHAR, opponents VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the score for winner and julie halard-decugis ai sugiyama
SELECT score FROM table_24638867_6 WHERE outcome = "Winner" AND opponents = "Julie Halard-Decugis Ai Sugiyama"
sql_create_context
CREATE TABLE table_name_3 ( death VARCHAR, birth VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When did the person die who was born on 18 november 1630?
SELECT death FROM table_name_3 WHERE birth = "18 november 1630"
sql_create_context
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, sy...
SELECT COUNT(*) > 0 FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '004-49903')) AND vitalperiodic.sao2 BETWEEN sao2_lower AND sao2_uppe...
eicu
CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE flight ( aircraft_code_sequence text, airline_code v...
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 (((flight.departure_time BETWEEN 1800 AND 2200) AND date_day.day_number = 23 AND date_day.month_number = 4 AND date_day.year = 1991 AND days.day_...
atis
CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number...
SELECT COUNT(a.Id) AS "accepted_answers", SUM(CASE WHEN a.Score = 0 THEN 0 ELSE 1 END) AS "scored_answers", SUM(CASE WHEN a.Score = 0 THEN 1 ELSE 0 END) AS "unscored_answers", SUM(CASE WHEN a.Score = 0 THEN 1 ELSE 0 END) * 1000 / COUNT(a.Id) / 10.0 AS "percentage_unscored" FROM Posts AS q INNER JOIN Posts AS a ON a.Id ...
sede
CREATE TABLE table_12159115_2 ( title VARCHAR, production_code VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the total number of episodes with production code 2T6705?
SELECT COUNT(title) FROM table_12159115_2 WHERE production_code = "2T6705"
sql_create_context
CREATE TABLE table_name_83 ( d_41_√ VARCHAR, d_47_√ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the D 41 when the D 47 is d 34?
SELECT d_41_√ FROM table_name_83 WHERE d_47_√ = "d 34"
sql_create_context
CREATE TABLE table_27743641_2 ( lmp2_winning_driver VARCHAR, lmp1_winning_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the LMP2 winner when the LMP1 winning team was No. 20 Oryx Dyson Racing?
SELECT lmp2_winning_driver FROM table_27743641_2 WHERE lmp1_winning_team = "No. 20 Oryx Dyson Racing"
sql_create_context
CREATE TABLE table_9153 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the To par of the T5 Place Player with a Score of 71-68-76=215?
SELECT "To par" FROM table_9153 WHERE "Place" = 't5' AND "Score" = '71-68-76=215'
wikisql
CREATE TABLE table_67410 ( "Date" text, "Opponent" text, "Result" text, "Game Site" text, "Attendance" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where does CF Pachuca play?
SELECT "Game Site" FROM table_67410 WHERE "Opponent" = 'cf pachuca'
wikisql
CREATE TABLE table_17980 ( "Member countries" text, "Population" real, "Area (km\u00b2)" real, "GDP (billion US$)" text, "GDP per capita (US$)" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the gdp of the country with an area of 83871 (km2)...
SELECT "GDP (billion US$)" FROM table_17980 WHERE "Area (km\u00b2)" = '83871'
wikisql
CREATE TABLE table_725 ( "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. -- What is Phil Crane, democrat or republican
SELECT "Party" FROM table_725 WHERE "Incumbent" = 'Phil Crane'
wikisql
CREATE TABLE table_2626564_2 ( starts VARCHAR, winnings VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many starts did Pearson have when his winnings were $101,438?
SELECT starts FROM table_2626564_2 WHERE winnings = "$101,438"
sql_create_context
CREATE TABLE table_204_886 ( id number, "rank" number, "swimmer" text, "country" text, "time" text, "note" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many swimmers are from mexico ?
SELECT COUNT("swimmer") FROM table_204_886 WHERE "country" = 'mexico'
squall
CREATE TABLE table_40772 ( "Rank" real, "Goalkeeper" text, "Club" text, "MINS" real, "SHTS" real, "W\u2013L\u2013T" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Goalkeeper has MINS less than 2160
SELECT "Goalkeeper" FROM table_40772 WHERE "MINS" < '2160'
wikisql
CREATE TABLE table_name_80 ( against INTEGER, draws INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average entry in the against column with draws smaller than 0?
SELECT AVG(against) FROM table_name_80 WHERE draws < 0
sql_create_context
CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, COM_PAY number, DATA_ID text, ENT_ACC_PAY number, ENT_PAY number, F...
SELECT COUNT(t_kc21.IN_DIAG_DIS_CD) FROM t_kc21 WHERE t_kc21.PERSON_NM = '赵嘉怡' AND t_kc21.IN_HOSP_DATE BETWEEN '2011-09-05' AND '2018-01-10'
css
CREATE TABLE table_4720 ( "Player" text, "Nationality" text, "Position" text, "From" real, "School/Country" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which player played center, is from the United States, and entered before 2012?
SELECT "Player" FROM table_4720 WHERE "From" < '2012' AND "Position" = 'center' AND "Nationality" = 'united states'
wikisql
CREATE TABLE table_73029 ( "Engine" text, "Production" text, "Transmission" text, "Power" text, "Torque" text, "Acceleration 0\u2013100km/h (0\u201362mph)" text, "Top Speed" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the top spee...
SELECT "Top Speed" FROM table_73029 WHERE "Transmission" = '4-speed automatic' AND "Production" = '2002-2005'
wikisql
CREATE TABLE table_name_51 ( round VARCHAR, clubs_involved VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which round has 4 clubs involved?
SELECT round FROM table_name_51 WHERE clubs_involved = 4
sql_create_context
CREATE TABLE t_kc22 ( MED_EXP_DET_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, MED_EXP_BILL_ID text, SOC_SRT_DIRE_CD text, SOC_SRT_DIRE_NM text, DIRE_TYPE number, CHA_ITEM_LEV number, MED_INV_ITEM_TYPE text, MED_DIRE_CD text, MED_DIRE_NM text,...
SELECT OUT_DIAG_DOC_CD, OUT_DIAG_DOC_NM FROM t_kc21 WHERE PERSON_NM = '潘烨烁' GROUP BY OUT_DIAG_DOC_CD ORDER BY COUNT(*) DESC
css