instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE media_types ( id INTEGER, name VARCHAR(120) ) CREATE TABLE invoice_lines ( id INTEGER, invoice_id INTEGER, track_id INTEGER, unit_price NUMERIC(10,2), quantity INTEGER ) CREATE TABLE sqlite_sequence ( name any, seq any ) CREATE TABLE artists ( id INTEGER, name...
SELECT billing_country, COUNT(*) FROM invoices GROUP BY billing_country ORDER BY COUNT(*) DESC LIMIT 5
nvbench
CREATE TABLE table_43403 ( "Nation" text, "Skip" text, "Third" text, "Second" text, "Lead" text, "Alternate" text, "Club" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the club for Great Britain?
SELECT "Club" FROM table_43403 WHERE "Nation" = 'great britain'
wikisql
CREATE TABLE table_name_12 ( tie_no VARCHAR, home_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the tie number when the home team was gillingham?
SELECT tie_no FROM table_name_12 WHERE home_team = "gillingham"
sql_create_context
CREATE TABLE table_2402 ( "Game" real, "Date" text, "Opponent" text, "Result" text, "Sun Devils points" real, "Opponents" real, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the record for the Sun Devils when they scored 4...
SELECT "Record" FROM table_2402 WHERE "Sun Devils points" = '44'
wikisql
CREATE TABLE table_45076 ( "Number notation" real, "Power notation" text, "Short scale" text, "Long scale" text, "Indian (or South Asian) English" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- For the number notion more than 1,000,000 with a power ...
SELECT "Short scale" FROM table_45076 WHERE "Number notation" > '1,000,000' AND "Power notation" = '10 12'
wikisql
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 SOC_SRT_DIRE_NM, EACH_DOSAGE, USE_FRE FROM t_kc22 WHERE MED_CLINIC_ID = '15153729405'
css
CREATE TABLE submission ( submission_id number, scores number, author text, college text ) CREATE TABLE acceptance ( submission_id number, workshop_id number, result text ) CREATE TABLE workshop ( workshop_id number, date text, venue text, name text ) -- Using valid SQLit...
SELECT COUNT(*) FROM submission
spider
CREATE TABLE table_64339 ( "play" text, "author" text, "company" text, "base" text, "country" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which play had a base of Aosta?
SELECT "play" FROM table_64339 WHERE "base" = 'aosta'
wikisql
CREATE TABLE table_name_35 ( date VARCHAR, home_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What day is south melbourne at home?
SELECT date FROM table_name_35 WHERE home_team = "south melbourne"
sql_create_context
CREATE TABLE phone_market ( Market_ID int, Phone_ID text, Num_of_stock int ) CREATE TABLE market ( Market_ID int, District text, Num_of_employees int, Num_of_shops real, Ranking int ) CREATE TABLE phone ( Name text, Phone_ID int, Memory_in_G int, Carrier text, Price...
SELECT Carrier, AVG(Memory_in_G) FROM phone GROUP BY Carrier ORDER BY Carrier DESC
nvbench
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 regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE employees ( EMPLOYEE_I...
SELECT JOB_ID, SUM(DEPARTMENT_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID
nvbench
CREATE TABLE school_bus ( school_id number, driver_id number, years_working number, if_full_time others ) CREATE TABLE school ( school_id number, grade text, school text, location text, type text ) CREATE TABLE driver ( driver_id number, name text, party text, home_...
SELECT home_city FROM driver EXCEPT SELECT home_city FROM driver WHERE age > 40
spider
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE mzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH text, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH te...
SELECT COUNT(*) FROM jybgb WHERE jybgb.JZLSH = '58163756741'
css
CREATE TABLE table_name_67 ( opponent VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Opponent had a Score of 6-3, 6-2?
SELECT opponent FROM table_name_67 WHERE score = "6-3, 6-2"
sql_create_context
CREATE TABLE table_35514 ( "Manufacturer" text, "Model" text, "Quantity" real, "Introduced" real, "Retired" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many in the introduced segment retired later than 1994 and had Fokker as a manufacturer?
SELECT COUNT("Introduced") FROM table_35514 WHERE "Retired" > '1994' AND "Manufacturer" = 'fokker'
wikisql
CREATE TABLE table_name_10 ( result VARCHAR, field VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the result of games played at frontier field
SELECT result FROM table_name_10 WHERE field = "frontier field"
sql_create_context
CREATE TABLE table_66281 ( "Elector" text, "Nationality" text, "Cardinalatial order and title" text, "Elevated" text, "Elevator" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the cardinalatial order and title of bosone?
SELECT "Cardinalatial order and title" FROM table_66281 WHERE "Elector" = 'bosone'
wikisql
CREATE TABLE table_52439 ( "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. -- In the game where the home team scored 19.21 (13...
SELECT "Away team" FROM table_52439 WHERE "Home team score" = '19.21 (135)'
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 MED_CLINIC_ID FROM t_kc21 WHERE PERSON_ID = '75571942' AND MED_SER_ORG_NO = '2706257' AND OUT_DIAG_DIS_NM LIKE '%病%'
css
CREATE TABLE table_26130295_3 ( first_team VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who is first team when dimitris diamantidis play.
SELECT COUNT(first_team) FROM table_26130295_3 WHERE player = "Dimitris Diamantidis"
sql_create_context
CREATE TABLE table_name_23 ( cat_no VARCHAR, label_s_ VARCHAR, release_format VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the cat no for the label mute and the standard cd format?
SELECT cat_no FROM table_name_23 WHERE label_s_ = "mute" AND release_format = "standard cd"
sql_create_context
CREATE TABLE table_1217448_1 ( publisher VARCHAR, first_appearance VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the total number of publisher where first appearance is daredevil #1
SELECT COUNT(publisher) FROM table_1217448_1 WHERE first_appearance = "Daredevil #1"
sql_create_context
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) 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 t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.age < "64" AND procedures.short_title = "Open reduc-int fix femur"
mimicsql_data
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE intakeoutput ( intakeoutpu...
SELECT COUNT(*) > 0 FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '012-31116')) AND STRFTIME('%y', diagnosis.diagnosistime) = '2105'
eicu
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 WHERE demographic.ethnicity = "BLACK/AFRICAN AMERICAN" AND demographic.dob_year < "2123"
mimicsql_data
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 lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND procedures.icd9_code = "6549"
mimicsql_data
CREATE TABLE table_name_20 ( area__km_2__ VARCHAR, population INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the sum of the Area (KM 2) that's got a Population that's smaller than 90?
SELECT COUNT(area__km_2__) FROM table_name_20 WHERE population < 90
sql_create_context
CREATE TABLE table_10015132_7 ( position VARCHAR, school_club_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what position did the player from connecticut play
SELECT position FROM table_10015132_7 WHERE school_club_team = "Connecticut"
sql_create_context
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND procedures.icd9_code = "9744"
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. -- How old is the youngest per...
SELECT job, MIN(age) FROM Person GROUP BY job ORDER BY MIN(age)
nvbench
CREATE TABLE table_44631 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text, "Money ( $ )" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Player, when Country is United States, and when Score is 73-76-72-66=287?
SELECT "Player" FROM table_44631 WHERE "Country" = 'united states' AND "Score" = '73-76-72-66=287'
wikisql
CREATE TABLE CHARACTERISTICS ( characteristic_id VARCHAR, characteristic_name VARCHAR ) CREATE TABLE products ( product_name VARCHAR, product_id VARCHAR ) CREATE TABLE product_characteristics ( product_id VARCHAR, characteristic_id VARCHAR ) -- Using valid SQLite, answer the following questi...
SELECT DISTINCT t1.product_name FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id WHERE t3.characteristic_name = "warm"
sql_create_context
CREATE TABLE table_14016 ( "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 t6 as the place, with sean o'hair as the player?
SELECT "Country" FROM table_14016 WHERE "Place" = 't6' AND "Player" = 'sean o''hair'
wikisql
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, ...
SELECT COUNT(DISTINCT t1.subject_id) 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_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title =...
mimic_iii
CREATE TABLE table_35364 ( "Year" real, "Wins" real, "Earnings ($)" text, "Rank" real, "Scoring average" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the scoring average where the wins are 0?
SELECT COUNT("Scoring average") FROM table_35364 WHERE "Wins" < '0'
wikisql
CREATE TABLE table_52818 ( "Player" text, "Position" text, "School" text, "Hometown" text, "MLB Draft" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Player attended George Washington High School?
SELECT "Player" FROM table_52818 WHERE "School" = 'george washington high school'
wikisql
CREATE TABLE table_30121046_1 ( area__acres__ INTEGER, townland VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the maximum area (in acres) of the Knockacullen townland?
SELECT MAX(area__acres__) FROM table_30121046_1 WHERE townland = "Knockacullen"
sql_create_context
CREATE TABLE table_23248940_10 ( high_rebounds VARCHAR, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many people had high rebounds during the game with a record of 34-32?
SELECT COUNT(high_rebounds) FROM table_23248940_10 WHERE record = "34-32"
sql_create_context
CREATE TABLE Documents_to_be_Destroyed ( Document_ID INTEGER, Destruction_Authorised_by_Employee_ID INTEGER, Destroyed_by_Employee_ID INTEGER, Planned_Destruction_Date DATETIME, Actual_Destruction_Date DATETIME, Other_Details VARCHAR(255) ) CREATE TABLE All_Documents ( Document_ID INTEGER, ...
SELECT Location_Code, COUNT(Location_Code) FROM Document_Locations GROUP BY Location_Code ORDER BY COUNT(Location_Code)
nvbench
CREATE TABLE table_name_8 ( majority VARCHAR, clone_independence VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the majority when the clone independence is no?
SELECT majority FROM table_name_8 WHERE clone_independence = "no"
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 AVG(MED_AMOUT) FROM t_kc21 WHERE MED_ORG_DEPT_NM = '白内障科' AND IN_HOSP_DATE BETWEEN '2006-10-25' AND '2012-06-23' AND IN_DIAG_DIS_NM = '结膜炎' AND CLINIC_TYPE = '住院'
css
CREATE TABLE table_21239 ( "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 w...
SELECT "Score" FROM table_21239 WHERE "Game" = '38'
wikisql
CREATE TABLE table_77750 ( "Driver" text, "Team" text, "Laps" real, "Time/Retired" text, "Grid" real, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the grid for the Minardi Team USA with laps smaller than 90?
SELECT "Grid" FROM table_77750 WHERE "Laps" < '90' AND "Team" = 'minardi team usa'
wikisql
CREATE TABLE table_name_58 ( year INTEGER, runner_s__up VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In which year is the highest for runner-up Steve Stricker?
SELECT MAX(year) FROM table_name_58 WHERE runner_s__up = "steve stricker"
sql_create_context
CREATE TABLE table_name_36 ( score VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the score of the game on 16 december 1987?
SELECT score FROM table_name_36 WHERE date = "16 december 1987"
sql_create_context
CREATE TABLE table_name_13 ( result VARCHAR, location VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the result of the London 2012 Women's Olympic Football Tournament?
SELECT result FROM table_name_13 WHERE location = "london 2012 women's olympic football tournament"
sql_create_context
CREATE TABLE table_5239 ( "Date" text, "Label" text, "Region" text, "Format" text, "Catalog" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What label has 887 448-2 as the catalog?
SELECT "Label" FROM table_5239 WHERE "Catalog" = '887 448-2'
wikisql
CREATE TABLE table_name_35 ( category VARCHAR, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What category is Matthew Barton?
SELECT category FROM table_name_35 WHERE opponent = "matthew barton"
sql_create_context
CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE TABLE student ( student_id int, lastname varchar, firstname varchar, program_id int, declare_major varchar, total_credit int, total_gpa float, entered_as varchar...
SELECT DISTINCT course.department, course.name, course.number, instructor.name FROM course, course_offering, instructor, offering_instructor WHERE course.course_id = course_offering.course_id AND course.name LIKE '%Professional Communication Strategies%' AND NOT instructor.name LIKE '%Figuero%' AND offering_instructor....
advising
CREATE TABLE table_64793 ( "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 of the game against the Minnesota Vikings?
SELECT MIN("Week") FROM table_64793 WHERE "Opponent" = 'minnesota vikings'
wikisql
CREATE TABLE user_profiles ( uid int(11), name varchar(255), email varchar(255), partitionid int(11), followers int(11) ) CREATE TABLE follows ( f1 int(11), f2 int(11) ) CREATE TABLE tweets ( id bigint(20), uid int(11), text char(140), createdate datetime ) -- Using valid...
SELECT name, COUNT(*) FROM user_profiles AS T1 JOIN tweets AS T2 ON T1.uid = T2.uid GROUP BY T2.uid ORDER BY name
nvbench
CREATE TABLE table_24017 ( "Player" text, "Played" real, "Legs Won" real, "Legs Lost" real, "LWAT" real, "100+" real, "140+" real, "180s" real, "High Checkout" real, "3-dart Average" text ) -- Using valid SQLite, answer the following questions for the tables provided above. --...
SELECT MIN("High Checkout") FROM table_24017 WHERE "Played" = '2' AND "100+" = '36'
wikisql
CREATE TABLE table_name_52 ( points_for VARCHAR, points_against VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What were the points for a team that 414 points against?
SELECT points_for FROM table_name_52 WHERE points_against = "414"
sql_create_context
CREATE TABLE table_name_25 ( round VARCHAR, status VARCHAR, song VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which round status is in with this song: - ?
SELECT round FROM table_name_25 WHERE status = "in" AND song = "叶良俊 - 爱你不是爱给别人看"
sql_create_context
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 diagnoses ( ...
SELECT demographic.dob, demographic.admittime FROM demographic WHERE demographic.name = "John Gartman"
mimicsql_data
CREATE TABLE table_30994 ( "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. -- how many episodes originally aired january19,2013
SELECT COUNT("No. in series") FROM table_30994 WHERE "Original Air date" = 'January19,2013'
wikisql
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABL...
SELECT d_items.label FROM d_items WHERE d_items.itemid IN (SELECT t1.itemid FROM (SELECT inputevents_cv.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM inputevents_cv WHERE DATETIME(inputevents_cv.charttime) <= DATETIME(CURRENT_TIME(), '-3 year') GROUP BY inputevents_cv.itemid) AS t1 WHERE t1.c1 <= 3)
mimic_iii
CREATE TABLE table_71786 ( "Round" real, "Pick #" real, "Overall" real, "Name" text, "Position" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the pick number for bill atessis
SELECT "Pick #" FROM table_71786 WHERE "Name" = 'bill atessis'
wikisql
CREATE TABLE table_name_65 ( year VARCHAR, funny_car VARCHAR, top_fuel VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In which year did John Force win Funny Car and Mike Dunn win in Top Fuel?
SELECT year FROM table_name_65 WHERE funny_car = "john force" AND top_fuel = "mike dunn"
sql_create_context
CREATE TABLE table_name_96 ( constructor VARCHAR, driver VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who built giancarlo fisichella's car?
SELECT constructor FROM table_name_96 WHERE driver = "giancarlo fisichella"
sql_create_context
CREATE TABLE table_1140105_6 ( winning_driver VARCHAR, circuit VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name of the winning driver where the circuit name is posillipo?
SELECT winning_driver FROM table_1140105_6 WHERE circuit = "Posillipo"
sql_create_context
CREATE TABLE table_name_88 ( date VARCHAR, attendance VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- I want to know the date with attendance of 35,763
SELECT date FROM table_name_88 WHERE attendance = "35,763"
sql_create_context
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 qtb.MED_CLINIC_ID FROM qtb WHERE qtb.PERSON_ID = '72363456' AND qtb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT >= 7610.85) UNION SELECT gyb.MED_CLINIC_ID FROM gyb WHERE gyb.PERSON_ID = '72363456' AND gyb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMO...
css
CREATE TABLE table_name_15 ( rarotongan VARCHAR, tahitian VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What kind of Rarotongan has a Tahitian of /metua/?
SELECT rarotongan FROM table_name_15 WHERE tahitian = "/metua/"
sql_create_context
CREATE TABLE paperfield ( fieldid int, paperid int ) CREATE TABLE writes ( paperid int, authorid int ) CREATE TABLE paperkeyphrase ( paperid int, keyphraseid int ) CREATE TABLE journal ( journalid int, journalname varchar ) CREATE TABLE dataset ( datasetid int, datasetname va...
SELECT DISTINCT keyphrase.keyphraseid FROM author, keyphrase, paper, paperkeyphrase, writes WHERE author.authorname = 'shwetak patel' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid AND writes.authorid = author.authorid AND writes.paperid = paper.paperid
scholar
CREATE TABLE table_14285 ( "Wimmera FL" text, "Wins" real, "Byes" real, "Losses" real, "Draws" real, "Against" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the sum of Against values for teams with 5 losses and 0 draws?
SELECT SUM("Against") FROM table_14285 WHERE "Losses" = '5' AND "Draws" < '0'
wikisql
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id...
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 = "Open biopsy of liver"
mimicsql_data
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.admission_type FROM demographic WHERE demographic.name = "Paul Edwards"
mimicsql_data
CREATE TABLE table_name_28 ( score VARCHAR, record VARCHAR, december VARCHAR, game VARCHAR, points VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Score has a Game larger than 32, and Points smaller than 42, and a December larger than 19, an...
SELECT score FROM table_name_28 WHERE game > 32 AND points < 42 AND december > 19 AND record = "18–12–5"
sql_create_context
CREATE TABLE table_name_42 ( lineup VARCHAR, assist_pass VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the lineup when the assist/pass was Unassisted?
SELECT lineup FROM table_name_42 WHERE assist_pass = "unassisted"
sql_create_context
CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) CREATE TABLE fare ( fare_id int, from_airport va...
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 CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'DENVER' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_na...
atis
CREATE TABLE table_204_105 ( id number, "#" number, "name" text, "height" text, "weight (lbs.)" number, "position" text, "class" text, "hometown" text, "previous team(s)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which player pr...
SELECT "name" FROM table_204_105 WHERE "previous team(s)" = 'sacred heart'
squall
CREATE TABLE table_name_16 ( election_date VARCHAR, electorate VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the election date for the city of auckland category:articles with hcards?
SELECT election_date FROM table_name_16 WHERE electorate = "city of auckland category:articles with hcards"
sql_create_context
CREATE TABLE table_name_76 ( score VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the score of the match on June 4, 2008?
SELECT score FROM table_name_76 WHERE date = "june 4, 2008"
sql_create_context
CREATE TABLE table_name_25 ( attendance INTEGER, opponent VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Attendance has an Opponent of @ oilers, and a Date of may 25?
SELECT MAX(attendance) FROM table_name_25 WHERE opponent = "@ oilers" AND date = "may 25"
sql_create_context
CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime ...
SELECT COUNT(*) > 0 FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 75658) AND microbiologyevents.spec_type_desc = 'sputum' AND DATETIME(microbiologyevents.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 yea...
mimic_iii
CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description varchar ) CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE T...
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 = 'ATLANTA' AND date_day.day_number = 5 AND date_day.month_number = 7 AND d...
atis
CREATE TABLE table_36776 ( "Rank" real, "Name" text, "Nationality" text, "1st (m)" real, "2nd (m)" real, "Points" real, "Overall FHT points" text, "Overall WC points (Rank)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the tota...
SELECT COUNT("1st (m)") FROM table_36776 WHERE "Name" = 'martin schmitt' AND "Points" < '235.7'
wikisql
CREATE TABLE table_14068 ( "Rank" real, "Athlete" text, "Country" text, "Time" text, "Notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who has less than 5 rank and notes of fb?
SELECT "Athlete" FROM table_14068 WHERE "Notes" = 'fb' AND "Rank" < '5'
wikisql
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TA...
SELECT SUM(cost.cost) FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-83902')
eicu
CREATE TABLE table_19805 ( "#" real, "Episode" text, "Writer" text, "Director" text, "Original air date" text, "Viewing figure" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who wrote the episode that David Tucker directed?
SELECT COUNT("Writer") FROM table_19805 WHERE "Director" = 'David Tucker'
wikisql
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), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), ...
SELECT EMAIL, EMPLOYEE_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY EMPLOYEE_ID
nvbench
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.discharge_location = "HOME" AND procedures.long_title = "Other diagnostic procedures on nasal sinuses"
mimicsql_data
CREATE TABLE table_23613 ( "Year" real, "Author(s) or Editor(s)" text, "Book Title" text, "Publisher" text, "Category" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the title of the book when the publisher is black car pu...
SELECT "Book Title" FROM table_23613 WHERE "Publisher" = 'Black Car Publishing'
wikisql
CREATE TABLE table_69304 ( "Outcome" text, "Tournament" text, "Surface" text, "Partner" text, "Opponent in the final" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the score of the final in which Melanie South played with...
SELECT "Score" FROM table_69304 WHERE "Surface" = 'clay' AND "Partner" = 'remi tezuka'
wikisql
CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org...
SELECT SUM(inputevents_cv.amount) FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 17667)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.lab...
mimic_iii
CREATE TABLE table_name_32 ( year INTEGER, chassis VARCHAR, points VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total of the year with a point larger than 0 or the Chassis of Minardi m190?
SELECT SUM(year) FROM table_name_32 WHERE chassis = "minardi m190" AND points > 0
sql_create_context
CREATE TABLE table_23670057_1 ( height__m_ VARCHAR, no VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the height for number 7
SELECT height__m_ FROM table_23670057_1 WHERE no = 7
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 t_kc21.IN_DIAG_DIS_CD, t_kc21.IN_DIAG_DIS_NM FROM t_kc21 WHERE t_kc21.PERSON_NM = '金秀筠' AND t_kc21.MED_CLINIC_ID IN (SELECT t_kc21_t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT >= 8263.6)
css
CREATE TABLE table_1439096_1 ( original_air_date__atv_ VARCHAR, episode_no VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the original air date (atv) of episode 1?
SELECT original_air_date__atv_ FROM table_1439096_1 WHERE episode_no = 1
sql_create_context
CREATE TABLE table_52414 ( "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 Crowd number for the Away team of Ri...
SELECT SUM("Crowd") FROM table_52414 WHERE "Away team" = 'richmond'
wikisql
CREATE TABLE table_name_91 ( stadium VARCHAR, opposition VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which stadium had the opposition of 79,122?
SELECT stadium FROM table_name_91 WHERE opposition = "79,122"
sql_create_context
CREATE TABLE table_77832 ( "Name" text, "Date of Birth" text, "Date of Death" text, "Age at Time of Disaster" text, "Age at Time of Death" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How old was the person born 24 September 1851 at the time of di...
SELECT "Age at Time of Disaster" FROM table_77832 WHERE "Date of Birth" = '24 september 1851'
wikisql
CREATE TABLE table_13254 ( "Rank" text, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many bronzes had a rank of 10 and 0 gold?
SELECT SUM("Bronze") FROM table_13254 WHERE "Rank" = '10' AND "Gold" < '0'
wikisql
CREATE TABLE company ( headquarters VARCHAR, main_industry VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Show all headquarters with both a company in banking industry and a company in Oil and gas.
SELECT headquarters FROM company WHERE main_industry = 'Banking' INTERSECT SELECT headquarters FROM company WHERE main_industry = 'Oil and gas'
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 event ( ID int, Name text, Stadium_ID int, Year text ) CREATE...
SELECT Time, ID FROM swimmer
nvbench
CREATE TABLE table_43802 ( "Event" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the most silver when the event is 2008 summer paralympics and bronze is less than 1?
SELECT MAX("Silver") FROM table_43802 WHERE "Event" = '2008 summer paralympics' AND "Bronze" < '1'
wikisql
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(*) FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '018-20179')) AND treatment.treatmentname = 'vasopressors - norepinephrine <= 0.1...
eicu
CREATE TABLE table_68636 ( "Year" real, "Entrant" text, "Chassis" text, "Engine" text, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was marlboro brm's lowest points by using brm p160b?
SELECT MIN("Points") FROM table_68636 WHERE "Entrant" = 'marlboro brm' AND "Chassis" = 'brm p160b'
wikisql
CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) CREATE TABLE food_service ( meal_code text, meal_number int, ...
SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, flight, flight_fare WHERE (((flight.airline_code = 'UA') AND flight.flight_number = 281) AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DENVER' ...
atis