instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id nu...
SELECT chartevents.charttime 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 chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial...
mimic_iii
CREATE TABLE table_name_40 ( ungegn VARCHAR, khmer INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the UNGEGN, when the Khmer is greater than ?
SELECT ungegn FROM table_name_40 WHERE khmer > ១០០០០០០០០
sql_create_context
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.ethnicity = "AMERICAN INDIAN/ALASKA NATIVE" AND procedures.icd9_code = "7761"
mimicsql_data
CREATE TABLE table_24319661_3 ( no_in_season VARCHAR, us_viewers__million_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many episodes in the season had 3.81 million US viewers?
SELECT COUNT(no_in_season) FROM table_24319661_3 WHERE us_viewers__million_ = "3.81"
sql_create_context
CREATE TABLE table_name_55 ( years_as_tallest VARCHAR, height_ft__m_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Years as tallest of the Building with a Height ft (m) of 145 (44)?
SELECT years_as_tallest FROM table_name_55 WHERE height_ft__m_ = "145 (44)"
sql_create_context
CREATE TABLE table_41536 ( "Position" real, "Team" text, "Points" real, "Played" real, "Drawn" real, "Lost" real, "Against" real, "Difference" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest number of played of the team...
SELECT MIN("Played") FROM table_41536 WHERE "Points" = '18' AND "Position" > '5'
wikisql
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate n...
SELECT COUNT(*) FROM treatment WHERE treatment.treatmentname = 'hormonal therapy (for varices) - vasopressin' AND DATETIME(treatment.treatmenttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year')
eicu
CREATE TABLE table_name_2 ( status VARCHAR, census_ranking VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Status of the Paris with a Census Ranking of 3,474 of 5,008?
SELECT status FROM table_name_2 WHERE census_ranking = "3,474 of 5,008"
sql_create_context
CREATE TABLE table_51571 ( "Season" text, "Champion" text, "Team" text, "Chassis" text, "Engine" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What chassis was the car with the Volkswagen engine built on in 2010?
SELECT "Chassis" FROM table_51571 WHERE "Engine" = 'volkswagen' AND "Season" = '2010'
wikisql
CREATE TABLE table_72062 ( "Date" text, "Time" text, "Competition" text, "Opponent" text, "Ground" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What time was the match played with a score of 3-2?
SELECT "Time" FROM table_72062 WHERE "Score" = '3-2'
wikisql
CREATE TABLE restaurant ( id int, name varchar, food_type varchar, city_name varchar, rating "decimal ) CREATE TABLE location ( restaurant_id int, house_number int, street_name varchar, city_name varchar ) CREATE TABLE geographic ( city_name varchar, county varchar, reg...
SELECT location.house_number, restaurant.name FROM location, restaurant WHERE location.city_name = 'mountain view' AND restaurant.food_type = 'arabic' AND restaurant.id = location.restaurant_id AND restaurant.rating > 2.5
restaurants
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 text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZZMC ...
SELECT * FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN mzjzjlb_jybgb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb....
css
CREATE TABLE jybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH text, BGJGDM text, BGJGMC text, BGRGH text, BGRQ time, BGRXM text, BGSJ time, CJRQ time, JSBBRQSJ time, JSBBSJ time, JYBBH text, JYJGMC text, JYJSGH text, JYJSQM text, JY...
SELECT jybgb.SHSJ FROM person_info JOIN hz_info JOIN txmzjzjlb JOIN jybgb ON person_info.RYBH = hz_info.RYBH AND 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 person_info.XM = '陶...
css
CREATE TABLE table_33182 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the opponent in the game that had an attendance of 60,066?
SELECT "Opponent" FROM table_33182 WHERE "Attendance" = '60,066'
wikisql
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, last_wardid number, intime time, outtime ti...
SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t1.icd9_code FROM (SELECT procedures_icd.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age B...
mimic_iii
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.marital_status = "DIVORCED" AND diagnoses.icd9_code = "2764"
mimicsql_data
CREATE TABLE table_67905 ( "Tournament" text, "2007" text, "2008" text, "2009" text, "2010" text, "2011" text, "2012" text, "2013" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the 2010 value of the 2013 Grand Slam Tournaments?
SELECT "2010" FROM table_67905 WHERE "2013" = 'grand slam tournaments'
wikisql
CREATE TABLE table_203_583 ( id number, "title" text, "release" number, "6th gen" text, "handheld" text, "note" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what was the first non volume game released in 2004 ?
SELECT "title" FROM table_203_583 WHERE "release" = 2004 LIMIT 1
squall
CREATE TABLE table_37282 ( "Name" text, "Locomotive type" text, "Wheel arr." text, "Builder" text, "Year built" real, "Whistle" text, "In Traffic?" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What kind of locomotive is Winston Churchill?
SELECT "Locomotive type" FROM table_37282 WHERE "Name" = 'winston churchill'
wikisql
CREATE TABLE Courses ( course_id INTEGER, author_id INTEGER, subject_id INTEGER, course_name VARCHAR(120), course_description VARCHAR(255) ) CREATE TABLE Student_Course_Enrolment ( registration_id INTEGER, student_id INTEGER, course_id INTEGER, date_of_enrolment DATETIME, date_o...
SELECT date_of_completion, COUNT(date_of_completion) FROM Student_Course_Enrolment AS T1 JOIN Student_Tests_Taken AS T2 ON T1.registration_id = T2.registration_id WHERE T2.test_result = "Fail" ORDER BY COUNT(date_of_completion) DESC
nvbench
CREATE TABLE table_30261 ( "Pick #" real, "CFL Team" text, "Player" text, "Position" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What position did the draft pick going to saskatchewan play?
SELECT "Position" FROM table_30261 WHERE "CFL Team" = 'Saskatchewan'
wikisql
CREATE TABLE table_name_34 ( silver INTEGER, bronze INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the smallest silver that has a bronze less than 0?
SELECT MIN(silver) FROM table_name_34 WHERE bronze < 0
sql_create_context
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH text, KH text, KLX number,...
SELECT AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) FROM mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN mzjzjlb_jybgb ON mzjzjlb.YLJGDM = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH AND mzjzjlb_jybgb.YLJGDM = jybgb.YLJ...
css
CREATE TABLE table_16268026_3 ( preliminary_average VARCHAR, semifinal_average VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the preliminary average when the semifinal average is 8.834 (3) ?
SELECT preliminary_average FROM table_16268026_3 WHERE semifinal_average = "8.834 (3)"
sql_create_context
CREATE TABLE tags ( id int, msid int, kid int ) CREATE TABLE actor ( aid int, gender text, name text, nationality text, birth_city text, birth_year int ) CREATE TABLE producer ( pid int, gender text, name text, nationality text, birth_city text, birth_year i...
SELECT name FROM actor WHERE nationality = 'Canada'
imdb
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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.marital_status = "MARRIED" AND lab.label = "WBC, Joint Fluid"
mimicsql_data
CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Per...
SELECT ACC_Road, AVG(Team_ID) FROM basketball_match GROUP BY ACC_Road ORDER BY AVG(Team_ID) DESC
nvbench
CREATE TABLE table_17085981_2 ( date_of_appointment VARCHAR, replaced_by VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many appointment dates were recorded when J rgen Kohler was the replaced by?
SELECT COUNT(date_of_appointment) FROM table_17085981_2 WHERE replaced_by = "Jürgen Kohler"
sql_create_context
CREATE TABLE table_name_16 ( date VARCHAR, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the date of the game with a record of 17 25?
SELECT date FROM table_name_16 WHERE record = "17–25"
sql_create_context
CREATE TABLE table_53910 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the date when the home team was Dallas?
SELECT "Date" FROM table_53910 WHERE "Home" = 'dallas'
wikisql
CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE Votes ( Id number, ...
SELECT q.Id AS "post_link", CreationDate, ViewCount, Tags, ClosedDate FROM Posts AS q INNER JOIN PostTags AS pt ON q.Id = pt.PostId INNER JOIN Tags AS t ON t.Id = pt.TagId WHERE q.ViewCount <= '##Views:int##' AND q.CreationDate < DATEADD(month, -3, GETDATE()) AND t.TagName = '##Tag:string##' ORDER BY CreationDate DESC
sede
CREATE TABLE table_52406 ( "City" text, "Country" text, "Region" text, "IATA" text, "ICAO" text, "Airport" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- I want the IATA for ICAO of zgkl
SELECT "IATA" FROM table_52406 WHERE "ICAO" = 'zgkl'
wikisql
CREATE TABLE table_11136 ( "model" text, "max. motive power" text, "max. torque at rpm" text, "engine displacement" text, "engine type" text, "engine configuration & notes 0-100km/h" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the eng...
SELECT "engine configuration & notes 0-100km/h" FROM table_11136 WHERE "engine type" = 'b5252 fs'
wikisql
CREATE TABLE flight_fare ( flight_id int, fare_id int ) 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 ) CREA...
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 = 'TORONTO' AND flight.arrival_time <= 1200 AND flight.to_airport = AIRPORT_SERVICE_1.airpor...
atis
CREATE TABLE table_name_11 ( constructor VARCHAR, driver VARCHAR, grid VARCHAR, laps VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Constructor has a Grid less than 17, Laps under 52, and Olivier Panis as the Driver?
SELECT constructor FROM table_name_11 WHERE grid < 17 AND laps < 52 AND driver = "olivier panis"
sql_create_context
CREATE TABLE table_75103 ( "Cap Number" real, "Date" text, "Position" text, "Shirt Number" real, "Home or Away" text, "Venue" text, "Result" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the largest shirt number whe...
SELECT MAX("Shirt Number") FROM table_75103 WHERE "Cap Number" = '5'
wikisql
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) 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_diagnoses ( row_id number, icd9_code text, sh...
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT prescriptions.hadm_id FROM prescriptions WHERE prescriptions.drug = 'maalox/benadryl/lidocaine' AND DATETIME(prescriptions.startdate, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year'))
mimic_iii
CREATE TABLE compartment_class ( compartment varchar, class_type varchar ) CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) CREATE TABLE airport_service ( city_code varchar, airport_code varch...
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 = 'DENVER' AND date_day.day_number = 27 AND date_day.month_number = 8 AND d...
atis
CREATE TABLE table_203_280 ( id number, "week" number, "date" text, "opponent" text, "result" text, "record" text, "game site" text, "tv time" text, "attendance" number, "bye" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- 1996 i...
SELECT "game site" FROM table_203_280 WHERE id = 1
squall
CREATE TABLE table_name_32 ( record VARCHAR, visitor VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Record, when Visitor is 'Chicago Black Hawks', and when Date is 'April 17'?
SELECT record FROM table_name_32 WHERE visitor = "chicago black hawks" AND date = "april 17"
sql_create_context
CREATE TABLE table_4248 ( "Year" real, "Matches" real, "Innings" real, "Not out" real, "Runs" real, "High Score" text, "100" real, "50" real, "Average" text, "Strike rate" text, "Catches/Stumpings" text ) -- Using valid SQLite, answer the following questions for the tables ...
SELECT COUNT("50") FROM table_4248 WHERE "Strike rate" = '92.81'
wikisql
CREATE TABLE table_52641 ( "Date" text, "Competition" text, "Venue" text, "Result" text, "Score" text, "Goals" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- I want the date with the venue of mcalpine stadium
SELECT "Date" FROM table_52641 WHERE "Venue" = 'mcalpine stadium'
wikisql
CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE compartment_class ( compartment varchar, class_type varchar ) CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) CREATE TABLE flight_leg ( flight_id 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, flight WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DENVER...
atis
CREATE TABLE table_2560677_1 ( artist_s_ VARCHAR, start_date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the artist with a start date of 1966-10-23?
SELECT artist_s_ FROM table_2560677_1 WHERE start_date = "1966-10-23"
sql_create_context
CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDat...
SELECT Comments.Id AS "comment_link", Comments.CreationDate, Comments.PostId AS "post_link" FROM Comments, Posts AS Answer LEFT JOIN Posts AS Question ON Answer.ParentId = Question.Id WHERE Comments.PostId IN (Answer.Id, Question.Id) AND Answer.Id = Question.AcceptedAnswerId AND Answer.PostTypeId = 2 AND Answer.OwnerUs...
sede
CREATE TABLE table_65220 ( "Rank" real, "Lane" real, "Name" text, "Nationality" text, "Time" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was lane 4's time?
SELECT "Time" FROM table_65220 WHERE "Lane" = '4'
wikisql
CREATE TABLE table_77707 ( "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 home team has a team score of 8.12 (60)?
SELECT "Home team" FROM table_77707 WHERE "Home team score" = '8.12 (60)'
wikisql
CREATE TABLE table_4305 ( "Sport" text, "Years" text, "Games" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tell me the games for total less than 4 for swimming 1968
SELECT "Games" FROM table_4305 WHERE "Total" < '4' AND "Sport" = 'swimming' AND "Years" = '1968'
wikisql
CREATE TABLE table_name_36 ( player VARCHAR, to_par VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Player has a To Par smaller than 5, and a Score of 70-72=142?
SELECT player FROM table_name_36 WHERE to_par < 5 AND score = 70 - 72 = 142
sql_create_context
CREATE TABLE table_10890 ( "Rank" real, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the least number of Gold for a Rank smaller than 5, and 1 silver medal for Poland wi...
SELECT MIN("Gold") FROM table_10890 WHERE "Rank" < '5' AND "Silver" = '1' AND "Nation" = 'poland' AND "Total" > '1'
wikisql
CREATE TABLE Parts ( part_id INTEGER, part_name VARCHAR(255), chargeable_yn VARCHAR(1), chargeable_amount VARCHAR(20), other_part_details VARCHAR(255) ) CREATE TABLE Assets ( asset_id INTEGER, maintenance_contract_id INTEGER, supplier_company_id INTEGER, asset_details VARCHAR(255), ...
SELECT other_details, COUNT(other_details) FROM Maintenance_Engineers AS T1 JOIN Engineer_Skills AS T2 ON T1.engineer_id = T2.engineer_id JOIN Skills AS T3 ON T2.skill_id = T3.skill_id GROUP BY other_details ORDER BY COUNT(other_details) DESC
nvbench
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) 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, XM text...
SELECT COUNT(*) FROM zyjzjlb JOIN hz_info_zyjzjlb JOIN hz_info ON 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_id = zyjzjlb.zyjzjlb_id AND hz_info_zyjzjlb.YLJGDM = hz_info.YLJGDM WHERE hz_info.YLJGDM = '96...
css
CREATE TABLE captain ( Captain_ID int, Name text, Ship_ID int, age text, Class text, Rank text ) CREATE TABLE Ship ( Ship_ID int, Name text, Type text, Built_Year real, Class text, Flag text ) -- Using valid SQLite, answer the following questions for the tables provide...
SELECT Class, COUNT(Class) FROM Ship WHERE NOT Ship_ID IN (SELECT Ship_ID FROM captain) GROUP BY Class ORDER BY Class DESC
nvbench
CREATE TABLE payment ( payment_id SMALLINT UNSIGNED, customer_id SMALLINT UNSIGNED, staff_id TINYINT UNSIGNED, rental_id INT, amount DECIMAL(5,2), payment_date DATETIME, last_update TIMESTAMP ) CREATE TABLE rental ( rental_id INT, rental_date DATETIME, inventory_id MEDIUMINT UNS...
SELECT T2.name, T1.category_id FROM film_category AS T1 JOIN category AS T2 ON T1.category_id = T2.category_id
nvbench
CREATE TABLE table_204_338 ( id number, "location" text, "coordinates" text, "type" text, "built" text, "details" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the total number of locations ?
SELECT COUNT("location") FROM table_204_338
squall
CREATE TABLE table_71343 ( "Title" text, "English translation" text, "lyrics by" text, "music by" text, "time" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the title of the song that has a translation of Without Me?
SELECT "Title" FROM table_71343 WHERE "English translation" = 'without me'
wikisql
CREATE TABLE table_name_41 ( competition VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which competition was held on 14 November 2012?
SELECT competition FROM table_name_41 WHERE date = "14 november 2012"
sql_create_context
CREATE TABLE table_name_20 ( opponent VARCHAR, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the opponent with record of 12-18
SELECT opponent FROM table_name_20 WHERE record = "12-18"
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 patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE d...
SELECT DISTINCT t1.c1 FROM (SELECT labevents.valuenum, PERCENT_RANK() OVER (ORDER BY labevents.valuenum) AS c1 FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'po2') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age = (SE...
mimic_iii
CREATE TABLE table_name_88 ( game VARCHAR, result VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which game had a result of 126-95?
SELECT game FROM table_name_88 WHERE result = "126-95"
sql_create_context
CREATE TABLE table_19246_1 ( frequency VARCHAR, carrier VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When the carrier is idc, what are the frequencies?
SELECT frequency FROM table_19246_1 WHERE carrier = "IDC"
sql_create_context
CREATE TABLE table_42915 ( "m\u00e5cha" text, "indicative" text, "imperative" text, "subjunctive" text, "inverse subjunctive" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What imperative has m cha as 3.sg?
SELECT "imperative" FROM table_42915 WHERE "m\u00e5cha" = '3.sg'
wikisql
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE d_icd_diag...
SELECT admissions.insurance FROM admissions WHERE admissions.subject_id = 12797 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1
mimic_iii
CREATE TABLE table_35034 ( "Game" real, "December" real, "Opponent" text, "Score" text, "Record" text, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Points have an Opponent of @ atlanta thrashers, and a Game smaller than 28?
SELECT SUM("Points") FROM table_35034 WHERE "Opponent" = '@ atlanta thrashers' AND "Game" < '28'
wikisql
CREATE TABLE table_23328 ( "(Virtual)" text, "Callsign" text, "Affiliation" text, "Branding" text, "Channel" text, "Programming" text, "Owner" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many callsigns are for the branding telemundo 4...
SELECT COUNT("Callsign") FROM table_23328 WHERE "Branding" = 'Telemundo 47'
wikisql
CREATE TABLE table_dev_6 ( "id" int, "gender" string, "systolic_blood_pressure_sbp" int, "heart_disease" bool, "renal_disease" bool, "hematocrit_hct" float, "creatinine_clearance_cl" float, "diastolic_blood_pressure_dbp" int, "symptomatic_coronary_artery_disease" bool, "hypertens...
SELECT * FROM table_dev_6 WHERE heart_disease = 1
criteria2sql
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 SOC_SRT_DIRE_CD, SOC_SRT_DIRE_NM FROM t_kc22 WHERE MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc21 WHERE PERSON_NM = '蒋新蕾' AND MED_SER_ORG_NO = '0734262' AND IN_HOSP_DATE BETWEEN '2010-12-29' AND '2012-06-26')
css
CREATE TABLE table_name_7 ( round INTEGER, pick VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Round is the highest one that has a Pick smaller than 10, and a Name of tory nixon?
SELECT MAX(round) FROM table_name_7 WHERE pick < 10 AND name = "tory nixon"
sql_create_context
CREATE TABLE table_35546 ( "Team" text, "Intercontinental" text, "Recopa 1996" text, "Supercopa 1996" text, "CONMEBOL 1996" text, "Copa Libertadores 1997" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What racing club team made supercopa 1996?
SELECT "Supercopa 1996" FROM table_35546 WHERE "Team" = 'racing club'
wikisql
CREATE TABLE table_203_90 ( id number, "religious\ngroup" text, "population\n%" text, "growth\n(1991-2001)" text, "sex ratio\n(total)" number, "literacy\n(%)" text, "work participation\n(%)" text, "sex ratio\n(rural)" number, "sex ratio\n(urban)" number, "sex ratio\n(child)" numb...
SELECT "religious\ngroup" FROM table_203_90 ORDER BY "population\n%" DESC LIMIT 1
squall
CREATE TABLE table_22992 ( "Pos" real, "Member Association" text, "Points (total 500)" real, "Clubs" real, "Group stage" real, "Play-off" real, "AFC Cup" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the play-off in group stage 4 an...
SELECT "Play-off" FROM table_22992 WHERE "Group stage" = '4' AND "Clubs" = '12'
wikisql
CREATE TABLE table_name_91 ( producer_s_ VARCHAR, recipient VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who produced Laura Tunstall?
SELECT producer_s_ FROM table_name_91 WHERE recipient = "laura tunstall"
sql_create_context
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 SUM(t_kc24.OVE_PAY) FROM qtb JOIN t_kc24 ON qtb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE qtb.MED_SER_ORG_NO = '0655890' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2013-01-21' AND '2020-01-10' UNION SELECT SUM(t_kc24.OVE_PAY) FROM gyb JOIN t_kc24 ON gyb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE gyb.MED_SER_ORG_NO = '...
css
CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text ) CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, ...
SELECT t1.drug FROM (SELECT prescriptions.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM prescriptions WHERE DATETIME(prescriptions.startdate, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') GROUP BY prescriptions.drug) AS t1 WHERE t1.c1 <= 3
mimic_iii
CREATE TABLE table_name_44 ( date VARCHAR, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What date was the opponent the Boston Yanks?
SELECT date FROM table_name_44 WHERE opponent = "boston yanks"
sql_create_context
CREATE TABLE table_name_92 ( extra_points INTEGER, points VARCHAR, touchdowns VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many Extra points have Touchdowns of 1, and a Player of ross kidston, and Points smaller than 5?
SELECT SUM(extra_points) FROM table_name_92 WHERE touchdowns = 1 AND player = "ross kidston" AND points < 5
sql_create_context
CREATE TABLE table_name_9 ( driver VARCHAR, laps VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which driver had 248 laps?
SELECT driver FROM table_name_9 WHERE laps = 248
sql_create_context
CREATE TABLE table_203_267 ( id number, "no." number, "song" text, "singers" text, "length (m:ss)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- the song to run 04:20
SELECT "song" FROM table_203_267 WHERE "length (m:ss)" = '04:20'
squall
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.diagnosis = "RUQ PAIN" AND procedures.icd9_code = "5781"
mimicsql_data
CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, outtime time ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, ...
SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t4.icd9_code FROM (SELECT t3.icd9_code, DENSE_RANK() OVER (ORDER BY t3.c1 DESC) AS c2 FROM (SELECT t2.icd9_code, 100 - SUM(CASE WHEN patients.dod IS NULL THEN 1 WHEN STRFTIME('%j', patients.dod) - STRFTIME('%j', t2.chartt...
mimic_iii
CREATE TABLE table_name_99 ( tournament VARCHAR, score VARCHAR, surface VARCHAR, outcome VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the tournament for clay surface and outcome is winner with score is 6 3, 6 2
SELECT tournament FROM table_name_99 WHERE surface = "clay" AND outcome = "winner" AND score = "6–3, 6–2"
sql_create_context
CREATE TABLE table_name_25 ( year_s__won VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What years did Tom Lehman win?
SELECT year_s__won FROM table_name_25 WHERE player = "tom lehman"
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 COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "CORONARY ARTERY DISEASE\CORONARY ARTERY BYPASS GRAFT /SDA"
mimicsql_data
CREATE TABLE table_21378160_2 ( opponent VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many opponents did they play on 17/05/2009?
SELECT COUNT(opponent) FROM table_21378160_2 WHERE date = "17/05/2009"
sql_create_context
CREATE TABLE table_56222 ( "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 date of the game at Junction Oval?
SELECT "Date" FROM table_56222 WHERE "Venue" = 'junction oval'
wikisql
CREATE TABLE zyjzjlb ( YLJGDM text, JZLSH text, MZJZLSH text, KH text, KLX number, HZXM text, WDBZ number, RYDJSJ time, RYTJDM number, RYTJMC text, JZKSDM text, JZKSMC text, RZBQDM text, RZBQMC text, RYCWH text, CYKSDM text, CYKSMC text, CYBQDM tex...
(SELECT jybgb.BGDH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb 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 = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE person_info.XM = '潘德运' AND jyb...
css
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.diagnosis = "ACIDOSIS" AND demographic.age < "63"
mimicsql_data
CREATE TABLE table_204_835 ( id number, "rank" number, "lane" number, "name" text, "nationality" text, "time" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- does russia or japan have the longer time ?
SELECT "nationality" FROM table_204_835 WHERE "nationality" IN ('russia', 'japan') ORDER BY "time" DESC LIMIT 1
squall
CREATE TABLE table_name_92 ( place VARCHAR, to_par VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Place of Davis Love III with a To Par of +1?
SELECT place FROM table_name_92 WHERE to_par = "+1" AND player = "davis love iii"
sql_create_context
CREATE TABLE station_company ( Station_ID int, Company_ID int, Rank_of_the_Year int ) CREATE TABLE company ( Company_ID int, Rank int, Company text, Headquarters text, Main_Industry text, Sales_billion real, Profits_billion real, Assets_billion real, Market_Value real ) ...
SELECT Manager_Name, COUNT(Manager_Name) FROM gas_station GROUP BY Manager_Name ORDER BY Manager_Name DESC
nvbench
CREATE TABLE table_name_54 ( model VARCHAR, specification VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the model for specification of dl-066
SELECT model FROM table_name_54 WHERE specification = "dl-066"
sql_create_context
CREATE TABLE zyjzjlb ( YLJGDM text, JZLSH text, MZJZLSH text, KH text, KLX number, HZXM text, WDBZ number, RYDJSJ time, RYTJDM number, RYTJMC text, JZKSDM text, JZKSMC text, RZBQDM text, RZBQMC text, RYCWH text, CYKSDM text, CYKSMC text, CYBQDM tex...
SELECT * FROM hz_info JOIN mzjzjlb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE hz_info.RYBH = '23602060' AND hz_info.YLJGDM = '9638787' AND mzjzjlb.JZZDSM LIKE '%后遗症%'
css
CREATE TABLE table_name_90 ( loss VARCHAR, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the loss of the game when the record was 14 8?
SELECT loss FROM table_name_90 WHERE record = "14–8"
sql_create_context
CREATE TABLE table_name_42 ( city_of_license VARCHAR, frequency_mhz VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which City of license has a Frequency MHz of 91.5 fm?
SELECT city_of_license FROM table_name_42 WHERE frequency_mhz = "91.5 fm"
sql_create_context
CREATE TABLE table_name_72 ( name VARCHAR, position INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Name has a Position smaller than 2?
SELECT name FROM table_name_72 WHERE position < 2
sql_create_context
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, XM text, ZYLBDM text, ZYMC text ) CREATE TABLE hz_info_mzjzjlb ( JZLSH number, ...
SELECT * FROM hz_info JOIN mzjzjlb JOIN hz_info_mzjzjlb ON hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.mzjzjlb...
css
CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId ...
SELECT Id AS "comment_link", Score, Text FROM Comments WHERE UPPER(Text) LIKE UPPER('%##CommentText##%') AND UserId = '##UserId##' ORDER BY Score DESC
sede
CREATE TABLE photos ( id number, camera_lens_id number, mountain_id number, color text, name text ) CREATE TABLE camera_lens ( id number, brand text, name text, focal_length_mm number, max_aperture number ) CREATE TABLE mountain ( id number, name text, height number...
SELECT T3.brand FROM mountain AS T1 JOIN photos AS T2 ON T1.id = T2.mountain_id JOIN camera_lens AS T3 ON T2.camera_lens_id = T3.id WHERE T1.range = 'Toubkal Atlas' INTERSECT SELECT T3.brand FROM mountain AS T1 JOIN photos AS T2 ON T1.id = T2.mountain_id JOIN camera_lens AS T3 ON T2.camera_lens_id = T3.id WHERE T1.rang...
spider
CREATE TABLE table_name_22 ( Id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the 2012 when 2009 was 205?
SELECT 2012 FROM table_name_22 WHERE 2009 = "205"
sql_create_context
CREATE TABLE table_61974 ( "Golden Rivers" text, "Wins" real, "Byes" real, "Losses" real, "Draws" real, "Against" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the total wins of a team with more than 2 byes?
SELECT COUNT("Wins") FROM table_61974 WHERE "Byes" > '2'
wikisql