instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_CLINIC_ID text, MED_DIRE_CD tex...
SELECT t_kc24.t_kc21_IN_DIAG_DIS_CD, t_kc24.t_kc21_IN_DIAG_DIS_NM FROM t_kc24 WHERE t_kc24.t_kc21_PERSON_ID = '73506592' AND t_kc24.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT > 2109.01)
css
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 T1.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name, T1.Name ORDER BY T1.Code DESC
nvbench
CREATE TABLE branch ( branch_id number, name text, open_year text, address_road text, city text, membership_amount text ) CREATE TABLE purchase ( member_id number, branch_id text, year text, total_pounds number ) CREATE TABLE membership_register_branch ( member_id number, ...
SELECT card_number, name, hometown FROM member ORDER BY level DESC
spider
CREATE TABLE hz_info ( KH text, KLX number, 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, MZBMLX num...
SELECT jybgb.BGDH FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN person_info_hz_info JOIN person_info 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 person_info_hz_info.KH = hz_info.KH AND pers...
css
CREATE TABLE table_27361255_1 ( team_nickname VARCHAR, location VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the nickname of the Adrian, Michigan team?
SELECT team_nickname FROM table_27361255_1 WHERE location = "Adrian, Michigan"
sql_create_context
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE intakeoutput ( ...
SELECT t1.treatmentname FROM (SELECT treatment.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM treatment WHERE STRFTIME('%y', treatment.treatmenttime) = '2102' GROUP BY treatment.treatmentname) AS t1 WHERE t1.c1 <= 4
eicu
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TAB...
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 = '006-50099')) AND medication.drugname = 'furosemide 80 mg po tabs' AND DATE...
eicu
CREATE TABLE table_16864968_8 ( score VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the score on March 21, 2009?
SELECT score FROM table_16864968_8 WHERE date = "March 21, 2009"
sql_create_context
CREATE TABLE table_name_68 ( home_ground VARCHAR, coach VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is home ground for coach Andrej Lemanis?
SELECT home_ground FROM table_name_68 WHERE coach = "andrej lemanis"
sql_create_context
CREATE TABLE table_23491 ( "Season" real, "Network" text, "Host" text, "Contestants" real, "Winner" text, "Destination" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who won the season with Africa as its destination?
SELECT "Winner" FROM table_23491 WHERE "Destination" = 'Africa'
wikisql
CREATE TABLE table_1857216_1 ( acceleration_0_100km_h__0_62mph_ VARCHAR, production VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the acceleration 0-100km/h that was produced in 2002-2006?
SELECT acceleration_0_100km_h__0_62mph_ FROM table_1857216_1 WHERE production = "2002-2006"
sql_create_context
CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment tex...
SELECT UserId AS "user_link", CreationDate, Name AS VoteType FROM Votes JOIN VoteTypes ON Votes.VoteTypeId = VoteTypes.Id WHERE PostId = @PostId ORDER BY CreationDate
sede
CREATE TABLE table_name_92 ( game INTEGER, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the first game played against the Chicago Black Hawks?
SELECT MIN(game) FROM table_name_92 WHERE opponent = "chicago black hawks"
sql_create_context
CREATE TABLE swimmer ( ID int, name text, Nationality text, meter_100 real, meter_200 text, meter_300 text, meter_400 text, meter_500 text, meter_600 text, meter_700 text, Time text ) CREATE TABLE stadium ( ID int, name text, Capacity int, City text, Coun...
SELECT Nationality, SUM(ID) FROM swimmer GROUP BY Nationality ORDER BY Nationality
nvbench
CREATE TABLE table_204_73 ( id number, "date" text, "opponent" text, "score" text, "result" text, "record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the least the starzzs have scored at a home game ?
SELECT MIN("score") FROM table_204_73 WHERE "opponent" = 'home'
squall
CREATE TABLE journal ( homepage varchar, jid int, name varchar ) CREATE TABLE domain_author ( aid int, did int ) CREATE TABLE domain_publication ( did int, pid int ) CREATE TABLE publication ( abstract varchar, cid int, citation_num int, jid int, pid int, reference...
SELECT COUNT(DISTINCT (publication.title)) FROM author, journal, organization, publication, writes WHERE journal.name = 'PVLDB' AND organization.name = 'University of Michigan' AND organization.oid = author.oid AND publication.jid = journal.jid AND writes.aid = author.aid AND writes.pid = publication.pid
academic
CREATE TABLE table_66981 ( "Name" text, "Years" text, "Gender" text, "Area" text, "Authority" text, "Decile" real, "Roll" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the least decile for state authority and area of eketahuna with rol...
SELECT MIN("Decile") FROM table_66981 WHERE "Authority" = 'state' AND "Area" = 'eketahuna' AND "Roll" > '44'
wikisql
CREATE TABLE table_name_52 ( telugu_తెలుగు VARCHAR, tamil_தமிழ் VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Telugu has a Tamil of p sam ?
SELECT telugu_తెలుగు FROM table_name_52 WHERE tamil_தமிழ் = "pūsam பூசம்"
sql_create_context
CREATE TABLE table_name_84 ( position VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Position does the Player Vince Carter hold?
SELECT position FROM table_name_84 WHERE player = "vince carter"
sql_create_context
CREATE TABLE table_name_78 ( year VARCHAR, award VARCHAR, category VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In what year was there an award for TV Adicto Golden Awards and the category Female Revelation?
SELECT year FROM table_name_78 WHERE award = "tv adicto golden awards" AND category = "female revelation"
sql_create_context
CREATE TABLE table_20799587_1 ( mccain_percentage VARCHAR, county VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What percentage of the votes in Copiah did McCain get?
SELECT mccain_percentage FROM table_20799587_1 WHERE county = "Copiah"
sql_create_context
CREATE TABLE t_kc24 ( MED_SAFE_PAY_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, REF_SLT_FLG number, CLINIC_SLT_DATE time, COMP_ID text, PERSON_ID text, FLX_MED_ORG_ID text, INSU_TYPE text, MED_AMOUT number, PER_ACC_PAY number, OVE_PAY numb...
SELECT 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 = '67040899' AND t_kc22.MED_INV_ITEM_TYPE = '治疗费'
css
CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, P...
SELECT COUNT(*) AS N, TagName, 1 - COUNT(CASE WHEN Score = 0 THEN 1 END) * 1.0 / COUNT(*) AS voting_ratio FROM Posts AS p JOIN PostTags ON p.Id = PostId JOIN Tags AS t ON t.Id = TagId WHERE Score >= 0 GROUP BY TagName HAVING COUNT(*) > 75000 ORDER BY COUNT(CASE WHEN Score = 0 THEN 1 END) * 1.0 / COUNT(*)
sede
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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.icd9_code = "99662" AND prescriptions.route = "NG"
mimicsql_data
CREATE TABLE table_name_31 ( heat_semifinal_final VARCHAR, time VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What heat, semifinal or final has a time of 25.00?
SELECT heat_semifinal_final FROM table_name_31 WHERE time = "25.00"
sql_create_context
CREATE TABLE table_name_67 ( base VARCHAR, play VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the base when the play is thesmophoriazusae?
SELECT base FROM table_name_67 WHERE play = "thesmophoriazusae"
sql_create_context
CREATE TABLE table_203_154 ( id number, "type" text, "manufacturer" text, "numbers" text, "year built" number, "quantity built" number, "power (horsepower)" number, "max speed (km/h)" number, "note" text ) -- Using valid SQLite, answer the following questions for the tables provide...
SELECT "type" FROM table_203_154 ORDER BY "max speed (km/h)" LIMIT 1
squall
CREATE TABLE table_15647838_3 ( _number INTEGER, location VARCHAR, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest # in Atlanta, GA with the Georgia Bulldogs as an opponent?
SELECT MIN(_number) FROM table_15647838_3 WHERE location = "Atlanta, GA" AND opponent = "Georgia Bulldogs"
sql_create_context
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, ...
SELECT t3.spec_type_desc FROM (SELECT t2.spec_type_desc, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime, admissions.hadm_id FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnos...
mimic_iii
CREATE TABLE table_49915 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text, "Money ( $ )" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which player had a to par score of +2?
SELECT "Player" FROM table_49915 WHERE "To par" = '+2'
wikisql
CREATE TABLE table_38196 ( "Team" text, "Driver" text, "Laps" real, "Time" text, "Grid" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many Laps have a Driver of satrio hermanto?
SELECT SUM("Laps") FROM table_38196 WHERE "Driver" = 'satrio hermanto'
wikisql
CREATE TABLE table_28182 ( "Institution" text, "Seniors" text, "Juniors" text, "Women" text, "Status" text, "Founded" real, "Affiliation (Population)" text, "Color" text, "Location" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What...
SELECT "Status" FROM table_28182 WHERE "Institution" = 'Informatics International College'
wikisql
CREATE TABLE table_269920_17 ( l3_cache__mb_ INTEGER, model VARCHAR, qpi_speed__gt_s_ VARCHAR, speed__ghz_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the maximum L3 cache of the processor whose speed is 2.00 GHZ, has a QPI speed of 4.8 gt...
SELECT MAX(l3_cache__mb_) FROM table_269920_17 WHERE qpi_speed__gt_s_ = "4.8" AND speed__ghz_ = "2.00" AND model = "E5504"
sql_create_context
CREATE TABLE table_24195232_1 ( location VARCHAR, team_name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the location for the team name of eagles?
SELECT location FROM table_24195232_1 WHERE team_name = "Eagles"
sql_create_context
CREATE TABLE table_22397 ( "Episode" text, "Garfield Episode 1" text, "U.S. Acres Episode" text, "Garfield Episode 2" text, "Original Airdate" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Garfield episode 2 has Garfield episode 1 as the firs...
SELECT "Garfield Episode 2" FROM table_22397 WHERE "Garfield Episode 1" = 'The First Annual Garfield Watchers Test'
wikisql
CREATE TABLE Department_Stores ( dept_store_id INTEGER, dept_store_chain_id INTEGER, store_name VARCHAR(80), store_address VARCHAR(255), store_phone VARCHAR(80), store_email VARCHAR(80) ) CREATE TABLE Customers ( customer_id INTEGER, payment_method_code VARCHAR(10), customer_code VA...
SELECT payment_method_code, COUNT(*) FROM Customers GROUP BY payment_method_code ORDER BY payment_method_code DESC
nvbench
CREATE TABLE table_name_32 ( losses INTEGER, goals_against VARCHAR, position VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many losses has more than 59 goals against and more than 17 position?
SELECT MIN(losses) FROM table_name_32 WHERE goals_against > 59 AND position > 17
sql_create_context
CREATE TABLE table_name_62 ( points VARCHAR, club VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the points when the club blaengarw rfc?
SELECT points FROM table_name_62 WHERE club = "blaengarw rfc"
sql_create_context
CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), HIRE_DATE date, JOB_ID varchar(10), SALARY decimal(8,2), COMMISSION_PCT decimal(2,2), MANAGER_ID decimal(6,0), DEPARTMENT_ID decimal(...
SELECT HIRE_DATE, AVG(SALARY) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY AVG(SALARY) DESC
nvbench
CREATE TABLE table_32890 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the largest crowd at arden street oval?
SELECT MAX("Crowd") FROM table_32890 WHERE "Venue" = 'arden street oval'
wikisql
CREATE TABLE table_79205 ( "Country" text, "Event" text, "Time" text, "Date" text, "Place" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Country of the 10,000m Event?
SELECT "Country" FROM table_79205 WHERE "Event" = '10,000m'
wikisql
CREATE TABLE gwyjzb ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, ...
SELECT AVG(gwyjzb.MED_AMOUT) FROM gwyjzb WHERE gwyjzb.MED_ORG_DEPT_CD = '81867' AND gwyjzb.IN_HOSP_DATE BETWEEN '2011-12-31' AND '2015-05-22' AND gwyjzb.IN_DIAG_DIS_NM = '煤尘肺(炭末肺)' AND gwyjzb.CLINIC_TYPE = '住院' UNION SELECT AVG(fgwyjzb.MED_AMOUT) FROM fgwyjzb WHERE fgwyjzb.MED_ORG_DEPT_CD = '81867' AND fgwyjzb.IN_HOSP_...
css
CREATE TABLE table_66391 ( "Year" real, "Title" text, "Type" text, "Label" text, "Label-Nr" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the earliest year with a label-Nr of st-43?
SELECT MIN("Year") FROM table_66391 WHERE "Label-Nr" = 'st-43'
wikisql
CREATE TABLE table_2610582_3 ( branding VARCHAR, callsign VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the branding of the callsign DWBA-TV?
SELECT branding FROM table_2610582_3 WHERE callsign = "DWBA-TV"
sql_create_context
CREATE TABLE table_38674 ( "Make" text, "Year placed in service" text, "Quantity" real, "Number of seats" real, "Wheelchair accessible? ()" text, "Current status" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the current status for GM A...
SELECT "Current status" FROM table_38674 WHERE "Make" = 'gm advanced design' AND "Number of seats" > '41'
wikisql
CREATE TABLE table_49139 ( "Place" text, "Player" text, "Country" text, "Score" real, "To par" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What country has player Scott Verplank?
SELECT "Country" FROM table_49139 WHERE "Player" = 'scott verplank'
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 flight_stop ( flight_id int, stop_number int, stop_days text, stop_...
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.arrival_time < flight.departure_time) AND date_day.day_number = 23 AND date_day.month_number = 4 AND date_day.year = 1991 AND days.da...
atis
CREATE TABLE table_204_658 ( id number, "week" number, "date" text, "kickoff" text, "opponent" text, "results\nfinal score" text, "results\nteam record" text, "game site" text, "attendance" number ) -- Using valid SQLite, answer the following questions for the tables provided above...
SELECT "date" FROM table_204_658 WHERE "date" > (SELECT "date" FROM table_204_658 WHERE "date" = 'saturday, april 14') AND "results\nfinal score" = 'w'
squall
CREATE TABLE table_79172 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What country did Raymond Floyd play for?
SELECT "Country" FROM table_79172 WHERE "Player" = 'raymond floyd'
wikisql
CREATE TABLE table_204_42 ( id number, "season" number, "level" text, "division" text, "section" text, "position" text, "movements" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how long have they been playing ?
SELECT MAX("season") - MIN("season") FROM table_204_42
squall
CREATE TABLE table_16101 ( "No. in series" real, "No. in season" real, "Title" text, "Setting" text, "Directed by" text, "Written by" text, "U.S. viewers (million)" text, "Original air date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. --...
SELECT "Written by" FROM table_16101 WHERE "Setting" = 'Winter 1541/February 13, 1542'
wikisql
CREATE TABLE table_9413 ( "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 Kirk Triplett's Place?
SELECT "Place" FROM table_9413 WHERE "Player" = 'kirk triplett'
wikisql
CREATE TABLE table_name_93 ( result VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the result of the match played on 13 October 1993?
SELECT result FROM table_name_93 WHERE date = "13 october 1993"
sql_create_context
CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) 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, ...
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 = 'DETROIT' AND date_day.day_number = 21 AND date_day.month_number = 2 AND d...
atis
CREATE TABLE table_28901 ( "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. -- when was the first elected when the candidates is thomas lawyer (dr) 54....
SELECT "First elected" FROM table_28901 WHERE "Candidates" = 'Thomas Lawyer (DR) 54.9% William Beekman (F) 45.1%'
wikisql
CREATE TABLE table_25469 ( "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. -- What's...
SELECT "Record" FROM table_25469 WHERE "High points" = 'Carlos Delfino (17)'
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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.drug = "Methadone"
mimicsql_data
CREATE TABLE table_243664_1 ( real_life_years_of_operation VARCHAR, currently¹_part_of VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the real life years of operation for amtrak
SELECT real_life_years_of_operation FROM table_243664_1 WHERE currently¹_part_of = "Amtrak"
sql_create_context
CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, ...
SELECT Month, '209103' AS "puf", '4625829', '5637321', '5996134' AS "kendi", '807126' AS "doug", '2207583' AS "tburner" FROM (SELECT DATEADD(MONTH, DATEDIFF(MONTH, 0, CreationDate), 0) AS "month", PostHistory.UserId, COUNT(*) AS Count FROM Posts INNER JOIN PostHistory ON PostHistory.PostId = Posts.Id WHERE PostHistory....
sede
CREATE TABLE projects ( code text, name text, hours number ) CREATE TABLE scientists ( ssn number, name text ) CREATE TABLE assignedto ( scientist number, project text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many scientists do not ha...
SELECT COUNT(*) FROM scientists WHERE NOT ssn IN (SELECT scientist FROM assignedto)
spider
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 int, flight_number int, from_airport varchar, meal_code text, stops int,...
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 ((date_day.day_number = 23 AND date_day.month_number = 4 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.departure_time...
atis
CREATE TABLE table_57146 ( "Number & Name" text, "Description" text, "Livery" text, "Owner(s)" text, "Date" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which owner has a description of Mark 1 CK and is dated 1953?
SELECT "Owner(s)" FROM table_57146 WHERE "Date" = '1953' AND "Description" = 'mark 1 ck'
wikisql
CREATE TABLE table_11893 ( "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 Away team score was 13.20 (98), what was ...
SELECT "Home team" FROM table_11893 WHERE "Away team score" = '13.20 (98)'
wikisql
CREATE TABLE table_43652 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the result when 58,516 were in attendance?
SELECT "Result" FROM table_43652 WHERE "Attendance" = '58,516'
wikisql
CREATE TABLE table_63911 ( "Year" text, "Total Support and Revenue" text, "Total Expenses" text, "Increase in Net Assets" text, "Net Assets at End of Year" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- With an increase in net assets of $211,418, wh...
SELECT "Net Assets at End of Year" FROM table_63911 WHERE "Increase in Net Assets" = '$211,418'
wikisql
CREATE TABLE table_name_68 ( event VARCHAR, medal VARCHAR, olympics VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the event in the 2000 summer olympics with a bronze medal?
SELECT event FROM table_name_68 WHERE medal = "bronze" AND olympics = "2000 summer olympics"
sql_create_context
CREATE TABLE table_204_881 ( id number, "round" number, "date" text, "score" text, "opponent" text, "opponent's score" text, "result" text, "venue" text, "attendance" number, "best on ground" text, "team" text ) -- Using valid SQLite, answer the following questions for the ...
SELECT "date" FROM table_204_881 WHERE "score" > "opponent's score" ORDER BY "date" DESC LIMIT 1
squall
CREATE TABLE procedures ( 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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.diagnosis = "LEFT FEMUR FRACTURE" AND lab.flag = "delta"
mimicsql_data
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE intakeoutput ( i...
SELECT vitalperiodic.observationtime FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-18150') AND NOT patient.unitdischargetime IS NU...
eicu
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.gender FROM demographic WHERE demographic.subject_id = "6983"
mimicsql_data
CREATE TABLE hz_info ( KH text, KLX number, YLJGDM text, RYBH text ) 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 t...
SELECT COUNT(DISTINCT mzjzjlb.ZZYSGH) FROM person_info JOIN hz_info JOIN mzjzjlb 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 WHERE person_info.XM = '柏梦竹' AND mzjzjlb.JZKSRQ BETWEEN '2004-08-14' AND '2017-05-20'
css
CREATE TABLE table_70040 ( "Season" text, "Competition" text, "Round" text, "Club" text, "Home" text, "Away" text, "Aggregate" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In what season did the Sporting CP Club have a 1. round?
SELECT "Season" FROM table_70040 WHERE "Round" = '1. round' AND "Club" = 'sporting cp'
wikisql
CREATE TABLE person_info ( RYBH text, XBDM number, XBMC text, XM text, CSRQ time, CSD text, MZDM text, MZMC text, GJDM text, GJMC text, JGDM text, JGMC text, XLDM text, XLMC text, ZYLBDM text, ZYMC text ) CREATE TABLE hz_info ( KH text, KLX number...
SELECT mzjzjlb.JZLSH FROM person_info JOIN hz_info JOIN mzjzjlb 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 WHERE person_info.XM = '韩向彤' AND hz_info.YLJGDM = '9745753' AND NOT mzjzjlb.JZKSMC LIKE '%科室%'
css
CREATE TABLE table_29728787_1 ( la_roche VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When 1971 is the year what is the la roche?
SELECT la_roche FROM table_29728787_1 WHERE year = "1971"
sql_create_context
CREATE TABLE table_name_32 ( attendance INTEGER, opponent VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Attendance has an Opponent of pittsburgh pirates, and a Date of may 5?
SELECT AVG(attendance) FROM table_name_32 WHERE opponent = "pittsburgh pirates" AND date = "may 5"
sql_create_context
CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, ...
SELECT COUNT(*) > 0 FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'packed cell transfusion') AND procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 32168) AND DATETIME(pro...
mimic_iii
CREATE TABLE table_train_261 ( "id" int, "allergy_to_biological_products" bool, "renal_disease" bool, "bursing_mothers" bool, "metabolic_bone_disease" bool, "liver_disease" bool, "allergy_to_drug" bool, "alcohol_abuse" bool, "drug_abuse" bool, "NOUSE" float ) -- Using valid SQL...
SELECT * FROM table_train_261 WHERE drug_abuse = 1 OR alcohol_abuse = 1
criteria2sql
CREATE TABLE table_16803 ( "House Name" text, "Composition" text, "Named after" text, "Founded" real, "Colours" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the benue house made of?
SELECT "Composition" FROM table_16803 WHERE "House Name" = 'Benue'
wikisql
CREATE TABLE table_33128 ( "Conference" text, "# of Bids" real, "Record" text, "Win %" real, "Round of 32" real, "Sweet Sixteen" text, "Elite Eight" text, "Final Four" text, "Championship Game" text ) -- Using valid SQLite, answer the following questions for the tables provided abo...
SELECT "Championship Game" FROM table_33128 WHERE "Conference" = 'southwest'
wikisql
CREATE TABLE cite ( citingpaperid int, citedpaperid int ) CREATE TABLE venue ( venueid int, venuename varchar ) CREATE TABLE dataset ( datasetid int, datasetname varchar ) CREATE TABLE journal ( journalid int, journalname varchar ) CREATE TABLE paperfield ( fieldid int, paper...
SELECT DISTINCT author.authorid, paper.paperid FROM author, keyphrase, paper, paperkeyphrase, writes WHERE author.authorname = 'saurabh gupta' AND keyphrase.keyphrasename = 'instance segmentation' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid AND writes.authorid = aut...
scholar
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 AVG(demographic.days_stay) FROM demographic WHERE demographic.admission_location = "TRSF WITHIN THIS FACILITY"
mimicsql_data
CREATE TABLE table_18958648_1 ( overweight__incl_obese__adults VARCHAR, obesity_rank VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are all percentages of overweight or obese adults for obesity rank of 21?
SELECT overweight__incl_obese__adults FROM table_18958648_1 WHERE obesity_rank = 21
sql_create_context
CREATE TABLE table_14624447_39 ( hometown VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the hometown for ventrell jenkins
SELECT hometown FROM table_14624447_39 WHERE name = "Ventrell Jenkins"
sql_create_context
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, ...
SELECT MAX(patient.admissionweight) FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '012-35670') AND NOT patient.admissionweight IS NULL AND DATETIME(patient.unitadmittime) <= DATETIME(CURRENT_TIME(), '-2 year') GROUP BY STRFTIME('...
eicu
CREATE TABLE city ( City_ID int, City text, Hanzi text, Hanyu_Pinyin text, Regional_Population int, GDP real ) CREATE TABLE match ( Match_ID int, Date text, Venue text, Score text, Result text, Competition text ) CREATE TABLE hosting_city ( Year int, Match_ID in...
SELECT Competition, COUNT(*) FROM match GROUP BY Competition
nvbench
CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayNa...
SELECT Id AS "post_link", Score, Body, CreationDate FROM Posts WHERE PostTypeId = 1 AND LENGTH(Body) < 150 AND ClosedDate IS NULL AND Score < 0
sede
CREATE TABLE addresses ( address_id number, line_1 text, line_2 text, city text, zip_postcode text, state_province_county text, country text ) CREATE TABLE candidate_assessments ( candidate_id number, qualification text, assessment_date time, asessment_outcome_code text ) C...
SELECT student_id FROM student_course_registrations UNION SELECT student_id FROM student_course_attendance
spider
CREATE TABLE table_41210 ( "Year" real, "Film" text, "Director" text, "Producer" text, "Writer" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- With yes under writer and in 2014, what is the director?
SELECT "Director" FROM table_41210 WHERE "Year" = '2014' AND "Writer" = 'yes'
wikisql
CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description varchar ) CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varc...
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 = 'PITTSBURGH' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'OAK...
atis
CREATE TABLE table_53445 ( "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 home team when Carlton was the away...
SELECT "Home team" FROM table_53445 WHERE "Away team" = 'carlton'
wikisql
CREATE TABLE table_name_83 ( to_par VARCHAR, money___$__ VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the to par for $242,813 with score 68-72-74-66=280
SELECT to_par FROM table_name_83 WHERE money___$__ = "242,813" AND score = 68 - 72 - 74 - 66 = 280
sql_create_context
CREATE TABLE table_71014 ( "From" text, "Until" text, "Name" text, "Party" text, "Function" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Until date that has a party of VLD and a beginning from date of December 17, 2007?
SELECT "Until" FROM table_71014 WHERE "Party" = 'vld' AND "From" = 'december 17, 2007'
wikisql
CREATE TABLE swimmer ( ID int, name text, Nationality text, meter_100 real, meter_200 text, meter_300 text, meter_400 text, meter_500 text, meter_600 text, meter_700 text, Time text ) CREATE TABLE event ( ID int, Name text, Stadium_ID int, Year text ) CREATE...
SELECT name, ID FROM swimmer ORDER BY name DESC
nvbench
CREATE TABLE table_name_36 ( date VARCHAR, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On which date was the game played against the Milwaukee Bucks?
SELECT date FROM table_name_36 WHERE opponent = "milwaukee bucks"
sql_create_context
CREATE TABLE table_23690 ( "Club" text, "Played" text, "Won" text, "Drawn" text, "Lost" text, "Points for" text, "Points against" text, "Points difference" text, "Bonus Points" text, "Points" text ) -- Using valid SQLite, answer the following questions for the tables provided a...
SELECT "Club" FROM table_23690 WHERE "Bonus Points" = 'Bonus Points'
wikisql
CREATE TABLE table_65710 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Week number on December 18, 1960?
SELECT COUNT("Week") FROM table_65710 WHERE "Date" = 'december 18, 1960'
wikisql
CREATE TABLE table_27756014_1 ( team VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the team played on october 5?
SELECT team FROM table_27756014_1 WHERE date = "October 5"
sql_create_context
CREATE TABLE table_32095 ( "2nd component" text, "b.p. 2nd comp. (\u02daC)" real, "3rd component" text, "b.p. 3rd comp. (\u02daC)" text, "b.p. azeo. (\u02daC)" text, "% wt 1st" text, "% wt 2nd" text, "% wt 3rd" text ) -- Using valid SQLite, answer the following questions for the tables...
SELECT "% wt 2nd" FROM table_32095 WHERE "b.p. 3rd comp. (\u02daC)" = '98.4'
wikisql
CREATE TABLE table_43685 ( "Class" text, "Team" text, "Driver" text, "Chassis \u2013 Engine" text, "Laps" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the highest amount of laps for class c1 and driver Derek Bell?
SELECT MAX("Laps") FROM table_43685 WHERE "Class" = 'c1' AND "Driver" = 'derek bell'
wikisql
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtim...
SELECT MAX(patient.admissionweight) FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '028-45581') AND NOT patient.admissionweight IS NULL AND STRFTIME('%y', patient.unitadmittime) <= '2102' GROUP BY STRFTIME('%y-%m', patient.unitadm...
eicu