instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_58759 ( "Name" text, "Pos." text, "Height" text, "Weight" text, "Date of Birth" text, "Club" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who has a Date of Birth 1980-07-29?
SELECT "Name" FROM table_58759 WHERE "Date of Birth" = '1980-07-29'
wikisql
CREATE TABLE table_name_27 ( goals_for INTEGER, goal_difference VARCHAR, position VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the number of goals when the goal difference was less than 43, and the position less than 3?
SELECT SUM(goals_for) FROM table_name_27 WHERE goal_difference < 43 AND position < 3
sql_create_context
CREATE TABLE table_name_32 ( home VARCHAR, visitor VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who did team phoenix visit in their home?
SELECT home FROM table_name_32 WHERE visitor = "phoenix"
sql_create_context
CREATE TABLE table_name_58 ( grand_prix VARCHAR, round VARCHAR, winning_driver VARCHAR, pole_position VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Grand Prix did David Coulthard win with Michael Schumacher in the pole position before round 9?...
SELECT grand_prix FROM table_name_58 WHERE winning_driver = "david coulthard" AND pole_position = "michael schumacher" AND round < 9
sql_create_context
CREATE TABLE table_name_18 ( date VARCHAR, works_number VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On what Date was the Works Number 7?
SELECT date FROM table_name_18 WHERE works_number = "7"
sql_create_context
CREATE TABLE fare ( fare_id int, from_airport varchar, to_airport varchar, fare_basis_code text, fare_airline text, restriction_code text, one_direction_cost int, round_trip_cost int, round_trip_required varchar ) CREATE TABLE class_of_service ( booking_class varchar, rank i...
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_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BOSTON' AND flight.departure_time < 1200 AND flight.to_airport = AIRPORT_SERVICE_1.airpo...
atis
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 jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJ...
css
CREATE TABLE employees ( id INTEGER, last_name VARCHAR(20), first_name VARCHAR(20), title VARCHAR(30), reports_to INTEGER, birth_date TIMESTAMP, hire_date TIMESTAMP, address VARCHAR(70), city VARCHAR(40), state VARCHAR(40), country VARCHAR(40), postal_code VARCHAR(10), ...
SELECT billing_state, COUNT(*) FROM invoices WHERE billing_country = "USA" GROUP BY billing_state ORDER BY COUNT(*) DESC
nvbench
CREATE TABLE table_name_84 ( year INTEGER, entrant VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the most recent year for a ligier gitanes blondes
SELECT MAX(year) FROM table_name_84 WHERE entrant = "ligier gitanes blondes"
sql_create_context
CREATE TABLE table_59659 ( "Name" text, "Residence" text, "Party" text, "Years in Assembly" text, "Years in Senate" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Party has a Residence of san diego?
SELECT "Party" FROM table_59659 WHERE "Residence" = 'san diego'
wikisql
CREATE TABLE table_27003223_4 ( no_party_preference VARCHAR, democratic VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the percentage of 'no party preference' where the democratic percentage is 24.8%?
SELECT no_party_preference FROM table_27003223_4 WHERE democratic = "24.8%"
sql_create_context
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE txmzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH number, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, K...
SELECT jybgb.BGDH FROM hz_info JOIN txmzjzjlb JOIN jybgb ON hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX AND txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE hz_info.RYBH = '40049431' AND NOT jybgb.BGDH IN (SELECT jyjgzbb.BGDH FRO...
css
CREATE TABLE table_name_6 ( races VARCHAR, podiums VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which races have #2 podiums?
SELECT races FROM table_name_6 WHERE podiums = "2"
sql_create_context
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 COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "HISPANIC OR LATINO" AND demographic.days_stay > "17"
mimicsql_data
CREATE TABLE writes ( paperid int, authorid int ) CREATE TABLE dataset ( datasetid int, datasetname varchar ) CREATE TABLE journal ( journalid int, journalname varchar ) CREATE TABLE paper ( paperid int, title varchar, venueid int, year int, numciting int, numcitedby i...
SELECT DISTINCT paper.paperid FROM keyphrase, paper, paperkeyphrase WHERE keyphrase.keyphrasename = 'sensor fusion' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid
scholar
CREATE TABLE table_23222 ( "Institution" text, "Location" text, "Nickname" text, "Founded" real, "Type" text, "Enrollment" real, "Joined" real, "Left" real, "Current Conference" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When was...
SELECT "Founded" FROM table_23222 WHERE "Institution" = 'Daniel Webster College'
wikisql
CREATE TABLE table_22058547_1 ( wiaa_classification VARCHAR, high_school VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many wiaa classifications does fort vancouver high school have?
SELECT COUNT(wiaa_classification) FROM table_22058547_1 WHERE high_school = "Fort Vancouver"
sql_create_context
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Hypertension NOS" AND prescriptions.route = "PO/NG"
mimicsql_data
CREATE TABLE table_70988 ( "Year" text, "Venue" text, "Winners" text, "2nd place" text, "3rd place" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In what year did Rafa Kurma ski come in 2nd place?
SELECT "Year" FROM table_70988 WHERE "2nd place" = 'rafał kurmański'
wikisql
CREATE TABLE departments ( department_id VARCHAR, location_id VARCHAR ) CREATE TABLE locations ( location_id VARCHAR, city VARCHAR ) CREATE TABLE employees ( department_id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- display the full name (fi...
SELECT first_name, last_name, salary FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id JOIN locations AS T3 ON T2.location_id = T3.location_id WHERE T3.city = 'London'
sql_create_context
CREATE TABLE Faculty_Participates_in ( FacID INTEGER, actid INTEGER ) CREATE TABLE Faculty ( FacID INTEGER, Lname VARCHAR(15), Fname VARCHAR(15), Rank VARCHAR(15), Sex VARCHAR(1), Phone INTEGER, Room VARCHAR(5), Building VARCHAR(13) ) CREATE TABLE Participates_in ( stuid IN...
SELECT Sex, COUNT(*) FROM Faculty WHERE Rank = "AsstProf" GROUP BY Sex ORDER BY Sex DESC
nvbench
CREATE TABLE course_offering ( offering_id int, course_id int, semester int, section_number int, start_time time, end_time time, monday varchar, tuesday varchar, wednesday varchar, thursday varchar, friday varchar, saturday varchar, sunday varchar, has_final_proje...
SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'EECS' AND semester.semester = 'WN' AND semester.semester_id = course_offering.semester AND semester.year = 2016 ORDER BY course.department
advising
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime...
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', patient.hospitaladmittime)) FROM patient WHERE patient.uniquepid = '013-38992' AND patient.hospitaldischargetime IS NULL
eicu
CREATE TABLE products ( product_price VARCHAR, product_id VARCHAR ) CREATE TABLE complaints ( product_price VARCHAR, product_id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Find the prices of products which has never received a single complaint.
SELECT product_price FROM products WHERE NOT product_id IN (SELECT product_id FROM complaints)
sql_create_context
CREATE TABLE table_name_18 ( round INTEGER, player VARCHAR, pick VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the earliest round that Donald Mason had a pick larger than 114?
SELECT MIN(round) FROM table_name_18 WHERE player = "donald mason" AND pick > 114
sql_create_context
CREATE TABLE table_36003 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Attendance" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Tie #has an Attendance of 54,591?
SELECT "Tie no" FROM table_36003 WHERE "Attendance" = '54,591'
wikisql
CREATE TABLE customers ( customer_name VARCHAR, customer_id VARCHAR ) CREATE TABLE orders ( customer_id VARCHAR, date_order_placed VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Give me the names of customers who have placed orders between 2009-01-0...
SELECT T1.customer_name FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.date_order_placed >= "2009-01-01" AND T2.date_order_placed <= "2010-01-01"
sql_create_context
CREATE TABLE table_name_23 ( attendance VARCHAR, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many attended the game with a Record of 21 22 2?
SELECT COUNT(attendance) FROM table_name_23 WHERE record = "21–22–2"
sql_create_context
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 text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) ...
SELECT demographic.gender, demographic.dischtime FROM demographic WHERE demographic.subject_id = "55094"
mimicsql_data
CREATE TABLE table_name_15 ( rank VARCHAR, country VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Italy's rank?
SELECT rank FROM table_name_15 WHERE country = "italy"
sql_create_context
CREATE TABLE song ( song_name varchar2(50), artist_name varchar2(50), country varchar2(20), f_id number(10), genre_is varchar2(20), rating number(10), languages varchar2(20), releasedate Date, resolution number(10) ) CREATE TABLE genre ( g_name varchar2(20), rating varchar2(...
SELECT languages, AVG(rating) FROM song GROUP BY languages
nvbench
CREATE TABLE table_name_55 ( pick__number VARCHAR, college VARCHAR, round VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total number of Pick #, when College is Oklahoma, and when Round is less than 4?
SELECT COUNT(pick__number) FROM table_name_55 WHERE college = "oklahoma" AND round < 4
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 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.dob_year < "2104" AND prescriptions.drug_type = "ADDITIVE"
mimicsql_data
CREATE TABLE table_name_33 ( year INTEGER, rank VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the average year for 4 rank
SELECT AVG(year) FROM table_name_33 WHERE rank = 4
sql_create_context
CREATE TABLE status ( station_id INTEGER, bikes_available INTEGER, docks_available INTEGER, time TEXT ) CREATE TABLE weather ( date TEXT, max_temperature_f INTEGER, mean_temperature_f INTEGER, min_temperature_f INTEGER, max_dew_point_f INTEGER, mean_dew_point_f INTEGER, min_...
SELECT date, COUNT(date) FROM weather WHERE mean_sea_level_pressure_inches BETWEEN 30.3 AND 31 GROUP BY date ORDER BY date
nvbench
CREATE TABLE table_49412 ( "Outcome" text, "Date" real, "Championship" 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 Opponent in the final has an Outcome of winner, ...
SELECT "Opponent in the final" FROM table_49412 WHERE "Outcome" = 'winner' AND "Date" > '1992' AND "Surface" = 'clay' AND "Score in the final" = '3–6, 6–2, 6–1'
wikisql
CREATE TABLE table_150343_3 ( total VARCHAR, country_territory VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Iceland's total?
SELECT COUNT(total) FROM table_150343_3 WHERE country_territory = "Iceland"
sql_create_context
CREATE TABLE table_73598 ( "Name" text, "Location" text, "Act. Units" real, "Stacks" text, "In Service Dates" text, "Unit Capacity (2009)" text, "Nameplate Capacity (2009 MW )" text, "Owner Type" text, "Owner(s) (2009)" text ) -- Using valid SQLite, answer the following questions f...
SELECT "Owner(s) (2009)" FROM table_73598 WHERE "Location" = 'South Side Indianapolis'
wikisql
CREATE TABLE table_25800134_4 ( writer_s_ VARCHAR, season__number VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the writer of episode 15?
SELECT writer_s_ FROM table_25800134_4 WHERE season__number = 15
sql_create_context
CREATE TABLE table_28893 ( "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 party for hutchins g. burton
SELECT "Party" FROM table_28893 WHERE "Incumbent" = 'Hutchins G. Burton'
wikisql
CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW text, JCZBJGDX text, JCZBMC text, JLDW text, JYRQ time, JYZBLSH text, ...
SELECT COUNT(person_info.RYBH) FROM hz_info JOIN zyjzjlb JOIN person_info_hz_info JOIN person_info ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX AND person_info_hz_info.KH = hz_info.KH AND person_info_hz_info.KLX = hz_info.KLX AND person_info_hz_info.YLJGDM = hz_info.YLJGD...
css
CREATE TABLE table_61184 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Opponent in Final" text, "Score in Final" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the outcome on 2 December 2012?
SELECT "Outcome" FROM table_61184 WHERE "Date" = '2 december 2012'
wikisql
CREATE TABLE table_name_71 ( january VARCHAR, april VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is in January where April is chris cranston?
SELECT january FROM table_name_71 WHERE april = "chris cranston"
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 JOB_ID, EMPLOYEE_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY JOB_ID
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 * FROM hz_info JOIN zyjzjlb JOIN hz_info_zyjzjlb ON hz_info.YLJGDM = hz_info_zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX AND hz_info_zyjzjlb.JZLSH = zyjzjlb.JZLSH AND hz_info_zyjzjlb.YLJGDM = hz_info_zyjzjlb.YLJGDM AND hz_info_zyjzjlb.JZLSH = zyjzjlb.JZLSH AND hz_info_zyjzjlb.zyjzjlb...
css
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic (...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.diagnosis = "CHEST PAIN" AND procedures.short_title = "Opn mitral valvuloplasty"
mimicsql_data
CREATE TABLE table_204_344 ( id number, "player" text, "games played" number, "field goals" number, "free throws" number, "points" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- _____ and _______ both played 16 games .
SELECT "player" FROM table_204_344 WHERE "games played" = 16
squall
CREATE TABLE table_name_95 ( team VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What team is Jim Garcia category:Articles with Hcards on?
SELECT team FROM table_name_95 WHERE player = "jim garcia category:articles with hcards"
sql_create_context
CREATE TABLE table_55754 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name of the constructor who has more than 50 laps and a grid of 7?
SELECT "Constructor" FROM table_55754 WHERE "Laps" > '50' AND "Grid" = '7'
wikisql
CREATE TABLE fare_basis ( fare_basis_code text, booking_class text, class_type text, premium text, economy text, discounted text, night text, season text, basis_days text ) CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, ...
SELECT DISTINCT flight_id FROM flight WHERE (((flight_days IN (SELECT DAYSalias0.days_code FROM days AS DAYSalias0 WHERE DAYSalias0.day_name IN (SELECT DATE_DAYalias0.day_name FROM date_day AS DATE_DAYalias0 WHERE DATE_DAYalias0.day_number = 21 AND DATE_DAYalias0.month_number = 2 AND DATE_DAYalias0.year = 1991)) AND to...
atis
CREATE TABLE table_69240 ( "Team 1" text, "Agg." text, "Team 2" text, "1st leg" text, "2nd leg" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What team 2 had a 1st leg of 1-1, and agg of 3-1?
SELECT "Team 2" FROM table_69240 WHERE "1st leg" = '1-1' AND "Agg." = '3-1'
wikisql
CREATE TABLE table_1491 ( "No. in series" text, "Title" text, "Directed by" text, "Written by" text, "Original airdate" text, "Production code" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the number in series for the episode titled 'K...
SELECT "No. in series" FROM table_1491 WHERE "Title" = 'Kevin''s Big Score'
wikisql
CREATE TABLE table_1392 ( "Television Station" text, "Frequency" text, "Site" text, "Transmitted" text, "Network" text, "Status" text, "Country of Region" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many stations have a 35 uhf frequen...
SELECT COUNT("Television Station") FROM table_1392 WHERE "Frequency" = '35 UHF'
wikisql
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Private" AND procedures.long_title = "Percutaneous [endoscopic] gastrostomy [PEG]"
mimicsql_data
CREATE TABLE table_46380 ( "Institution" text, "Wins" real, "Loss" real, "Home Wins" real, "Home Losses" real, "Away Wins" real, "Away Losses" real, "Neutral Wins" real, "Neutral Losses" real ) -- Using valid SQLite, answer the following questions for the tables provided above. --...
SELECT COUNT("Away Losses") FROM table_46380 WHERE "Home Losses" > '3' AND "Wins" < '5'
wikisql
CREATE TABLE job_history ( employee_id number, start_date time, end_date time, job_id text, department_id number ) CREATE TABLE countries ( country_id text, country_name text, region_id number ) CREATE TABLE departments ( department_id number, department_name text, manager_...
SELECT first_name, last_name FROM employees WHERE department_id = 70 OR department_id = 90
spider
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dob_year < "2049" AND procedures.long_title = "Insertion of drug-eluting coronary artery stent(s)"
mimicsql_data
CREATE TABLE table_73547 ( "Average Ranking" real, "Competitive Finish" real, "Couple" text, "Number Of Dances" real, "Total Score" real, "Average" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total score when 7 is the average rank...
SELECT MAX("Total Score") FROM table_73547 WHERE "Average Ranking" = '7'
wikisql
CREATE TABLE table_203_679 ( id number, "part" text, "number" text, "first public release date (first edition)" number, "latest public release date (edition)" number, "latest amendment" text, "title" text, "description" text ) -- Using valid SQLite, answer the following questions for t...
SELECT "number" FROM table_203_679 WHERE "first public release date (first edition)" = 2008
squall
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 txmzjzjlb.MZZYZDZZBM, txmzjzjlb.MZZYZDZZMC FROM txmzjzjlb WHERE txmzjzjlb.JZLSH = '13253905900' UNION SELECT ftxmzjzjlb.MZZYZDZZBM, ftxmzjzjlb.MZZYZDZZMC FROM ftxmzjzjlb WHERE ftxmzjzjlb.JZLSH = '13253905900'
css
CREATE TABLE fgwyjzb ( 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 gwyjzb.IN_DIAG_DIS_CD, gwyjzb.IN_DIAG_DIS_NM FROM gwyjzb WHERE gwyjzb.MED_CLINIC_ID = '30242405141' UNION SELECT fgwyjzb.IN_DIAG_DIS_CD, fgwyjzb.IN_DIAG_DIS_NM FROM fgwyjzb WHERE fgwyjzb.MED_CLINIC_ID = '30242405141'
css
CREATE TABLE table_name_96 ( leading_scorer VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the leading scorer on February 9?
SELECT leading_scorer FROM table_name_96 WHERE date = "february 9"
sql_create_context
CREATE TABLE table_40964 ( "Average population (x 1000)" real, "Live births" real, "Deaths" real, "Natural change" real, "Crude birth rate (per 1000)" real, "Crude death rate (per 1000)" real, "Natural change (per 1000)" real ) -- Using valid SQLite, answer the following questions for the ...
SELECT MAX("Crude death rate (per 1000)") FROM table_40964 WHERE "Natural change (per 1000)" > '16.1' AND "Natural change" = '5,049' AND "Crude birth rate (per 1000)" < '27.1'
wikisql
CREATE TABLE table_72472 ( "Country" real, "Rank" text, "Aid" text, "Trade" text, "Investment" text, "Migration" text, "Environment" text, "Security" text, "Technology" text, "Overall (Average)" text ) -- Using valid SQLite, answer the following questions for the tables provide...
SELECT "Environment" FROM table_72472 WHERE "Overall (Average)" = '4.7'
wikisql
CREATE TABLE table_name_70 ( country VARCHAR, total INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the country of the player who has a total larger than 300?
SELECT country FROM table_name_70 WHERE total > 300
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_DIS_CD, OUT_DIAG_DIS_NM FROM t_kc21 WHERE MED_CLINIC_ID = '86947036895'
css
CREATE TABLE table_54213 ( "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. -- Who is the away team when the crowd is larger th...
SELECT "Away team" FROM table_54213 WHERE "Crowd" > '21,122' AND "Home team score" = '13.7 (85)'
wikisql
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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dob_year < "2197" AND procedures.icd9_code = "3142"
mimicsql_data
CREATE TABLE table_63679 ( "School" text, "Location" text, "Mascot" text, "County" text, "Year Joined" real, "Year Left" text, "Conference Joined" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Can you tell me the Location that has the Masco...
SELECT "Location" FROM table_63679 WHERE "Mascot" = 'lakers'
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 lab ( subject_id text, hadm_id text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.gender = "M" AND procedures.icd9_code = "93"
mimicsql_data
CREATE TABLE phone_market ( Market_ID int, Phone_ID text, Num_of_stock int ) CREATE TABLE phone ( Name text, Phone_ID int, Memory_in_G int, Carrier text, Price real ) CREATE TABLE market ( Market_ID int, District text, Num_of_employees int, Num_of_shops real, Rankin...
SELECT District, COUNT(District) FROM phone_market AS T1 JOIN market AS T2 ON T1.Market_ID = T2.Market_ID JOIN phone AS T3 ON T1.Phone_ID = T3.Phone_ID GROUP BY District ORDER BY COUNT(District)
nvbench
CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location text, insurance text, language text, marital_status text, ethnicity text, age number ) CREATE ...
SELECT (SELECT chartevents.valuenum FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 23070) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime DESC LIMIT 1) AND chartevents...
mimic_iii
CREATE TABLE table_29785324_4 ( reservation_for_sc_st VARCHAR, constituency_no VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many reservations for sc/st are there in constituency 191?
SELECT COUNT(reservation_for_sc_st) FROM table_29785324_4 WHERE constituency_no = 191
sql_create_context
CREATE TABLE table_name_38 ( winner VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who won on 28 May?
SELECT winner FROM table_name_38 WHERE date = "28 may"
sql_create_context
CREATE TABLE table_17469 ( "#" real, "Episode" text, "Director" text, "Writer" text, "Original airdate" text, "Viewers" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who is the writer where viewers is 5.16m
SELECT "Writer" FROM table_17469 WHERE "Viewers" = '5.16m'
wikisql
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 TEXT, Year INTEGER, Price INTEGER, Score INTEGER, Cases IN...
SELECT Name, COUNT(Name) FROM appellations AS T1 JOIN wine AS T2 ON T1.Appelation = T2.Appelation WHERE T1.County = "Monterey" AND T2.Price < 50 GROUP BY Name ORDER BY Name DESC
nvbench
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.admittime FROM demographic WHERE demographic.subject_id = "15061"
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 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.short_title = "Hypoxemia" AND prescriptions.drug_type = "BASE"
mimicsql_data
CREATE TABLE program ( program_id number, name text, origin text, launch number, owner text ) CREATE TABLE broadcast ( channel_id number, program_id number, time_of_day text ) CREATE TABLE broadcast_share ( channel_id number, program_id number, date text, share_in_perce...
SELECT name FROM channel ORDER BY rating_in_percent DESC
spider
CREATE TABLE products ( product_id number, product_details text ) CREATE TABLE customer_orders ( order_id number, customer_id number, order_status text, order_date time, order_details text ) CREATE TABLE customer_addresses ( customer_id number, address_id number, date_address_f...
SELECT AVG(order_quantity) FROM order_items
spider
CREATE TABLE table_54339 ( "Driver" text, "Team" text, "Laps" real, "Time/Retired" text, "Grid" text, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the top lap that had 6 grids and more than 19 points?
SELECT MAX("Laps") FROM table_54339 WHERE "Grid" = '6' AND "Points" > '19'
wikisql
CREATE TABLE txmzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH number, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZ...
SELECT txmzjzjlb.JZLSH FROM hz_info JOIN txmzjzjlb ON hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX WHERE hz_info.RYBH = '87197835' AND NOT txmzjzjlb.JZLSH IN (SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ >= '2013-01-25') UNION SELECT ftxmzjzjlb.JZLSH FROM hz_info JOI...
css
CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25...
SELECT JOB_ID, SUM(SALARY) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID ORDER BY JOB_ID DESC
nvbench
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 gwyjzb.OUT_DIAG_DOC_CD, gwyjzb.OUT_DIAG_DOC_NM FROM gwyjzb WHERE gwyjzb.PERSON_NM = '曹子平' GROUP BY gwyjzb.OUT_DIAG_DOC_CD ORDER BY COUNT(*) DESC UNION SELECT fgwyjzb.OUT_DIAG_DOC_CD, fgwyjzb.OUT_DIAG_DOC_NM FROM fgwyjzb WHERE fgwyjzb.PERSON_NM = '曹子平' GROUP BY fgwyjzb.OUT_DIAG_DOC_CD ORDER BY COUNT(*) DESC
css
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 (SELECT PER_ACC_PAY FROM t_kc24 WHERE MED_CLINIC_ID = '15406659514') / (SELECT MED_AMOUT FROM t_kc24 WHERE MED_CLINIC_ID = '15406659514')
css
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE d_labitems ( row_id numbe...
SELECT t1.drug FROM (SELECT prescriptions.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age BETWEEN 50 AND 59) AND DATETIME(prescriptions.startdate, 'start of year') = DATETIME(CURRENT_TIME(), 'start o...
mimic_iii
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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.expire_flag = "0" AND lab.label = "Vancomycin"
mimicsql_data
CREATE TABLE match_result ( Rank int, Club_ID int, Gold int, Big_Silver int, Small_Silver int, Bronze int, Points int ) CREATE TABLE player ( Player_ID int, Sponsor_name text, Player_name text, Gender text, Residence text, Occupation text, Votes int, Rank tex...
SELECT Gender, COUNT(Gender) FROM player GROUP BY Gender ORDER BY COUNT(Gender)
nvbench
CREATE TABLE table_77356 ( "Name" text, "Birth" text, "Marriage" text, "Became Dauphine" text, "Ceased to be Dauphine" text, "Death" text, "Husband" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- when was the death when the birth was 8 decem...
SELECT "Death" FROM table_77356 WHERE "Birth" = '8 december 1542'
wikisql
CREATE TABLE table_name_53 ( song_title VARCHAR, track VARCHAR, release_date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the title of the song with a track less than 8 released on 3/22/57?
SELECT song_title FROM table_name_53 WHERE track < 8 AND release_date = "3/22/57"
sql_create_context
CREATE TABLE table_204_352 ( id number, "pos" text, "no" number, "rider" text, "manufacturer" text, "laps" number, "time" text, "grid" number, "points" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the total number of laps...
SELECT "laps" FROM table_204_352 WHERE "rider" = 'imre toth'
squall
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2115" AND lab.itemid = "51025"
mimicsql_data
CREATE TABLE table_5884 ( "Season" text, "Champion" text, "Runner Up" text, "1st leg" text, "2nd leg" text, "Host City" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what team was the 1st leg champion of sakalai
SELECT "1st leg" FROM table_5884 WHERE "Champion" = 'sakalai'
wikisql
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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "43" AND lab.fluid = "Ascites"
mimicsql_data
CREATE TABLE table_74083 ( "Club" text, "Played" text, "Won" text, "Drawn" text, "Lost" text, "Points for" text, "Points against" text, "Tries for" text, "Points" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many matches were w...
SELECT "Won" FROM table_74083 WHERE "Tries for" = '61'
wikisql
CREATE TABLE jyjgzbb ( JYZBLSH text, YLJGDM text, BGDH text, BGRQ time, JYRQ time, JCRGH text, JCRXM text, SHRGH text, SHRXM text, JCXMMC text, JCZBDM text, JCFF text, JCZBMC text, JCZBJGDX text, JCZBJGDL number, JCZBJGDW text, SBBM text, YQBH text...
SELECT COUNT(*) FROM mzjzjlb WHERE YLJGDM = '7835150' AND JZKSRQ BETWEEN '2011-04-06' AND '2019-11-23' AND ZZBZ > 0
css
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_DIRE_CD text, MED_DIRE_NM text,...
SELECT COUNT(t_kc21.PERSON_ID) FROM t_kc21 WHERE t_kc21.IN_DIAG_DIS_CD = 'L35.977'
css
CREATE TABLE table_73870 ( "Locale" text, "Skip" text, "W" real, "L" real, "PF" real, "PA" real, "Ends Won" real, "Ends Lost" real, "Blank Ends" real, "Stolen Ends" real, "Shot Pct." real ) -- Using valid SQLite, answer the following questions for the tables provided above....
SELECT MIN("W") FROM table_73870 WHERE "Locale" = 'Ontario'
wikisql
CREATE TABLE artist ( Artist_ID int, Artist text, Age int, Famous_Title text, Famous_Release_date text ) CREATE TABLE music_festival ( ID int, Music_Festival text, Date_of_ceremony text, Category text, Volume int, Result text ) CREATE TABLE volume ( Volume_ID int, V...
SELECT Category, COUNT(Category) FROM music_festival WHERE Result = "Awarded" GROUP BY Category ORDER BY Category DESC
nvbench
CREATE TABLE Financial_Transactions ( transaction_id INTEGER, account_id INTEGER, invoice_number INTEGER, transaction_type VARCHAR(15), transaction_date DATETIME, transaction_amount DECIMAL(19,4), transaction_comment VARCHAR(255), other_transaction_details VARCHAR(255) ) CREATE TABLE In...
SELECT order_id, COUNT(*) FROM Order_Items GROUP BY order_id
nvbench