instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE t_kc22 ( MED_EXP_DET_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, MED_EXP_BILL_ID text, SOC_SRT_DIRE_CD text, SOC_SRT_DIRE_NM text, DIRE_TYPE number, CHA_ITEM_LEV number, MED_INV_ITEM_TYPE text, MED_DIRE_CD text, MED_DIRE_NM text,...
SELECT SUM(QTY), SUM(AMOUNT) FROM t_kc22 WHERE SOC_SRT_DIRE_NM = '酸枣仁颗粒' AND STA_DATE BETWEEN '2007-07-02' AND '2011-05-12'
css
CREATE TABLE table_52532 ( "Round" real, "Overall" real, "Player" text, "Nationality" text, "Club team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name of the player with an Overall larger than 227?
SELECT "Player" FROM table_52532 WHERE "Overall" > '227'
wikisql
CREATE TABLE apartment_buildings ( building_id number, building_short_name text, building_full_name text, building_description text, building_address text, building_manager text, building_phone text ) CREATE TABLE apartments ( apt_id number, building_id number, apt_type_code tex...
SELECT T2.guest_first_name, T2.guest_last_name FROM apartment_bookings AS T1 JOIN guests AS T2 ON T1.guest_id = T2.guest_id WHERE T1.booking_status_code = "Confirmed"
spider
CREATE TABLE table_71364 ( "Rank" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many bronze medals did the country with 7 medals and over 5 silver medals receive?
SELECT SUM("Bronze") FROM table_71364 WHERE "Total" = '7' AND "Silver" > '5'
wikisql
CREATE TABLE Customers_Cards ( card_id INTEGER, customer_id INTEGER, card_type_code VARCHAR(15), card_number VARCHAR(80), date_valid_from DATETIME, date_valid_to DATETIME, other_card_details VARCHAR(255) ) CREATE TABLE Accounts ( account_id INTEGER, customer_id INTEGER, account_...
SELECT card_type_code, SUM(card_number) FROM Customers_Cards GROUP BY card_type_code ORDER BY SUM(card_number) DESC
nvbench
CREATE TABLE table_68632 ( "Year" text, "Record" text, "Finish" text, "Manager" text, "Playoffs" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the record for 1997
SELECT "Record" FROM table_68632 WHERE "Year" = '1997'
wikisql
CREATE TABLE table_2331549_1 ( second_place VARCHAR, champion VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who came in second place when the champion was south dakota school of mines & technology?
SELECT second_place FROM table_2331549_1 WHERE champion = "South Dakota School of Mines & Technology"
sql_create_context
CREATE TABLE qtb ( 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 AVG(zyb.MED_CLINIC_ID) FROM zyb WHERE zyb.MED_ORG_DEPT_NM = '31515' AND zyb.IN_HOSP_DAYS BETWEEN '2008-06-11' AND '2013-03-29' AND zyb.IN_DIAG_DIS_NM = 'W23.015'
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 IN_DIAG_DIS_CD, IN_DIAG_DIS_NM FROM t_kc21 WHERE MED_CLINIC_ID = '16196458812'
css
CREATE TABLE table_1886270_1 ( built VARCHAR, withdrawn VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When 2/1939 is the withdrawn when was it built?
SELECT built FROM table_1886270_1 WHERE withdrawn = "2/1939"
sql_create_context
CREATE TABLE table_name_74 ( husband VARCHAR, image VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the husband of marie of baden-sponheim?
SELECT husband FROM table_name_74 WHERE image = "marie of baden-sponheim"
sql_create_context
CREATE TABLE affected_region ( Region_id int, Storm_ID int, Number_city_affected real ) CREATE TABLE region ( Region_id int, Region_code text, Region_name text ) CREATE TABLE storm ( Storm_ID int, Name text, Dates_active text, Max_speed int, Damage_millions_USD real, Nu...
SELECT Name, COUNT(*) FROM storm AS T1 JOIN affected_region AS T2 ON T1.Storm_ID = T2.Storm_ID GROUP BY T1.Storm_ID ORDER BY COUNT(*) DESC
nvbench
CREATE TABLE table_59479 ( "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. -- Who was the away team at the game attended by 81?
SELECT "Away team" FROM table_59479 WHERE "Attendance" = '81'
wikisql
CREATE TABLE table_name_25 ( winners VARCHAR, venue VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who won at Kr ko?
SELECT winners FROM table_name_25 WHERE venue = "krško"
sql_create_context
CREATE TABLE table_37036 ( "Player" text, "Country" text, "Year(s) won" text, "Total" real, "To par" real, "Finish" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Total larger than 285, and a Finish of t30 belongs to what player?
SELECT "Player" FROM table_37036 WHERE "Total" > '285' AND "Finish" = 't30'
wikisql
CREATE TABLE accounts ( account_id number, customer_id number, account_name text, other_account_details text ) CREATE TABLE financial_transactions ( transaction_id number, previous_transaction_id number, account_id number, card_id number, transaction_type text, transaction_date ...
SELECT date_valid_from, date_valid_to FROM customers_cards WHERE card_number = "4560596484842"
spider
CREATE TABLE table_204_743 ( id number, "pos" text, "no" number, "driver" text, "constructor" text, "laps" number, "time/retired" text, "grid" number, "points" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what was jenson button '...
SELECT "time/retired" FROM table_204_743 WHERE "driver" = 'jenson button'
squall
CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ) CREATE TABLE Course ( CID VARCHAR(7), CName VARCHAR(40), Credits INTEGER, Instructor INTEGER, Days VARCHAR(...
SELECT LName, COUNT(LName) FROM Student WHERE Sex = "F" GROUP BY LName ORDER BY Age 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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.age < "61" AND diagnoses.short_title = "Hypothyroidism NOS"
mimicsql_data
CREATE TABLE restriction ( restriction_code text, advance_purchase int, stopovers text, saturday_stay_required text, minimum_stay int, maximum_stay int, application text, no_discounts text ) CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE T...
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, date_day AS DATE_DAY_0, date_day AS DATE_DAY_1, days AS DAYS_0, days AS DAYS_1, fare, fare_basis, flight, flight_fare WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND C...
atis
CREATE TABLE table_name_44 ( chassis VARCHAR, engine VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What chassis did the porsche flat-4 use before 1958?
SELECT chassis FROM table_name_44 WHERE engine = "porsche flat-4" AND year < 1958
sql_create_context
CREATE TABLE table_256286_61 ( _percentage_yes VARCHAR, yes_votes VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the percentage of yes when there were 218846 yes votes
SELECT _percentage_yes FROM table_256286_61 WHERE yes_votes = 218846
sql_create_context
CREATE TABLE table_77965 ( "Rank" real, "Rmax Rpeak ( Pflops )" text, "Name" text, "Vendor" text, "Operating system" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the rank of Rmax Rpeak ( Pflops ) of 17.173 20.133?
SELECT AVG("Rank") FROM table_77965 WHERE "Rmax Rpeak ( Pflops )" = '17.173 20.133'
wikisql
CREATE TABLE table_name_65 ( location VARCHAR, school VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- WHere is the friends' school?
SELECT location FROM table_name_65 WHERE school = "the friends' school"
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 INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.icd9_code = "53081" AND lab."CATEGORY" = "Hematology"
mimicsql_data
CREATE TABLE table_76715 ( "Week" text, "Theme" text, "Artist" text, "Order sung" text, "Status" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What order was the performance of a Richard Marx song?
SELECT "Order sung" FROM table_76715 WHERE "Artist" = 'richard marx'
wikisql
CREATE TABLE table_63261 ( "HR Number" real, "Name" text, "LMS Number" real, "BR number" text, "Withdrawn" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which BR number has an LMS number over 14768?
SELECT "BR number" FROM table_63261 WHERE "LMS Number" > '14768'
wikisql
CREATE TABLE journal_committee ( Editor_ID int, Journal_ID int, Work_Type text ) CREATE TABLE editor ( Editor_ID int, Name text, Age real ) CREATE TABLE journal ( Journal_ID int, Date text, Theme text, Sales int ) -- Using valid SQLite, answer the following questions for the ...
SELECT Name, Age FROM editor ORDER BY Name
nvbench
CREATE TABLE diagnoses ( 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.expire_flag = "0" AND procedures.short_title = "Regional lymph node exc"
mimicsql_data
CREATE TABLE table_51537 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the score on August 8?
SELECT "Score" FROM table_51537 WHERE "Date" = 'august 8'
wikisql
CREATE TABLE table_name_47 ( icb_sector VARCHAR, ticker_symbol VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which ICB Sector had a ticker symbol of pp?
SELECT icb_sector FROM table_name_47 WHERE ticker_symbol = "pp"
sql_create_context
CREATE TABLE table_name_62 ( rank VARCHAR, time VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What rank did the time of 7:31.90 receive?
SELECT COUNT(rank) FROM table_name_62 WHERE time = "7:31.90"
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 diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime ti...
SELECT admissions.marital_status FROM admissions WHERE admissions.subject_id = 25461 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1
mimic_iii
CREATE TABLE table_name_72 ( director VARCHAR, title VARCHAR, platform_s_ VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the director of Battalion Wars 2 which was released on GCN after 2004?
SELECT director FROM table_name_72 WHERE platform_s_ = "gcn" AND year > 2004 AND title = "battalion wars 2"
sql_create_context
CREATE TABLE table_17143 ( "Player" text, "No.(s)" text, "Height in Ft." text, "Position" text, "Years for Rockets" text, "School/Club Team/Country" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the position for the player that played i...
SELECT "Position" FROM table_17143 WHERE "Years for Rockets" = '2006'
wikisql
CREATE TABLE table_27700530_15 ( location_attendance VARCHAR, game VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the location and attendance for game 2?
SELECT location_attendance FROM table_27700530_15 WHERE game = 2
sql_create_context
CREATE TABLE table_28298589_4 ( result VARCHAR, home_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the final score of Washington's home game?
SELECT result FROM table_28298589_4 WHERE home_team = "Washington"
sql_create_context
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age te...
SELECT COUNT(*) FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '032-9230' AND patient.hospitaldischargetime IS NULL))
eicu
CREATE TABLE table_name_22 ( record VARCHAR, attendance VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the team's record at the game attended by 30,452?
SELECT record FROM table_name_22 WHERE attendance = "30,452"
sql_create_context
CREATE TABLE personfriend ( name text, friend text, year number ) CREATE TABLE person ( name text, age number, city text, gender text, job text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the different names and ages of every fri...
SELECT DISTINCT T1.name, T1.age FROM person AS T1 JOIN personfriend AS T2 ON T1.name = T2.name WHERE T2.friend = 'Dan' OR T2.friend = 'Alice'
spider
CREATE TABLE table_name_55 ( winner VARCHAR, trofeo_fast_team VARCHAR, stage VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who is the winner when the trofeo fast team is carrera jeans-vagabond in stage 5?
SELECT winner FROM table_name_55 WHERE trofeo_fast_team = "carrera jeans-vagabond" AND stage = "5"
sql_create_context
CREATE TABLE table_26434 ( "No. by series" real, "No. by season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production number" real, "U.S. viewers (in millions)" text ) -- Using valid SQLite, answer the following questions for the tables provi...
SELECT MIN("No. by season") FROM table_26434 WHERE "U.S. viewers (in millions)" = '10.81'
wikisql
CREATE TABLE table_name_53 ( date VARCHAR, result VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the date of the game with a result of W 13-10?
SELECT date FROM table_name_53 WHERE result = "w 13-10"
sql_create_context
CREATE TABLE table_name_89 ( stolen_ends INTEGER, ends_lost INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the average Stolen Ends which has an Ends Lost smaller than 35?
SELECT AVG(stolen_ends) FROM table_name_89 WHERE ends_lost < 35
sql_create_context
CREATE TABLE table_11589522_3 ( title VARCHAR, original_air_date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what's the title where original air date is january18,2009
SELECT title FROM table_11589522_3 WHERE original_air_date = "January18,2009"
sql_create_context
CREATE TABLE table_name_91 ( country VARCHAR, to_par VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- For the player finishing at +8, what is his nationality?
SELECT country FROM table_name_91 WHERE to_par = "+8"
sql_create_context
CREATE TABLE table_27277284_28 ( model_number VARCHAR, order_part_number VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the model number for the order part numbered tmrm75dam22gg?
SELECT model_number FROM table_27277284_28 WHERE order_part_number = "TMRM75DAM22GG"
sql_create_context
CREATE TABLE table_68201 ( "Team" text, "City" text, "Stadium" text, "Manager" text, "Past season" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what city has a past season of n/a?
SELECT "City" FROM table_68201 WHERE "Past season" = 'n/a'
wikisql
CREATE TABLE table_name_11 ( performer_3 VARCHAR, performer_4 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the 3rd performer when Rory Bremner was the 4th performer?
SELECT performer_3 FROM table_name_11 WHERE performer_4 = "rory bremner"
sql_create_context
CREATE TABLE table_name_76 ( company VARCHAR, release_date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the company that released the album on 2008-09-18 18 September 2008?
SELECT company FROM table_name_76 WHERE release_date = "2008-09-18 18 september 2008"
sql_create_context
CREATE TABLE table_204_13 ( id number, "finished" text, "post" number, "horse" text, "jockey" text, "trainer" text, "owner" text, "time / behind" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- name of horse that finished first in the 199...
SELECT "horse" FROM table_204_13 WHERE "finished" = 1
squall
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, ...
SELECT MAX(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 = 19428)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arte...
mimic_iii
CREATE TABLE table_name_39 ( mecha VARCHAR, japanese_voice_actor VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Mecha of the Japanese voice actor Shingo Kanemoto?
SELECT mecha FROM table_name_39 WHERE japanese_voice_actor = "shingo kanemoto"
sql_create_context
CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH text, KH text, KLX number, MZBMLX number, MZJZLSH text, MZZDBM text, MZZDMC text, MZZYZDZZBM...
SELECT jyjgzbb.YQBH, jyjgzbb.YQMC 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_MZJZJLB WHE...
css
CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) 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...
SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT t1.itemid FROM (SELECT labevents.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM labevents WHERE DATETIME(labevents.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') GROUP BY labevents.itemid) AS t1...
mimic_iii
CREATE TABLE table_51901 ( "Player" text, "Height" text, "School" text, "Hometown" text, "College" text, "NBA Draft" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which school has a Player of donte greene?
SELECT "School" FROM table_51901 WHERE "Player" = 'donte greene'
wikisql
CREATE TABLE table_204_73 ( id number, "date" text, "opponent" text, "score" text, "result" text, "record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- number of games in which the starzz scored at most 59 points
SELECT COUNT(*) FROM table_204_73 WHERE "score" <= 59
squall
CREATE TABLE table_16304 ( "Year (Ceremony)" text, "Film title used in nomination" text, "Original title" text, "Director" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who directed El Nido?
SELECT "Director" FROM table_16304 WHERE "Original title" = 'El nido'
wikisql
CREATE TABLE table_name_41 ( year_born__age_ VARCHAR, current_club VARCHAR, position VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Year born (Age) has a Current Club of sporting al riyadi beirut, and a Position of pf?
SELECT year_born__age_ FROM table_name_41 WHERE current_club = "sporting al riyadi beirut" AND position = "pf"
sql_create_context
CREATE TABLE stadium ( id int, name text, Home_Games int, Average_Attendance real, Total_Attendance real, Capacity_Percentage real ) CREATE TABLE injury_accident ( game_id int, id int, Player text, Injury text, Number_of_matches text, Source text ) CREATE TABLE game ( ...
SELECT T1.id, COUNT(*) FROM stadium AS T1 JOIN game AS T2 ON T1.id = T2.stadium_id GROUP BY T1.id
nvbench
CREATE TABLE fzzmzjzjlb ( 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, MZZYZD...
SELECT zzmzjzjlb.JZLSH FROM person_info JOIN hz_info JOIN zzmzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX WHERE person_info.XM = '曹斌蔚' AND NOT zzmzjzjlb.JZLSH IN (SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ >= '2013-12-2...
css
CREATE TABLE flight_stop ( flight_id int, stop_number int, stop_days text, stop_airport text, arrival_time int, arrival_airline text, arrival_flight_number int, departure_time int, departure_airline text, departure_flight_number int, stop_time int ) CREATE TABLE month ( ...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'PITTSBURGH' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN...
atis
CREATE TABLE table_28268 ( "Model" text, "Launch" text, "Code name" text, "Transistors (million)" real, "Die size (mm 2 )" real, "Bus interface" text, "Memory ( MB )" text, "SM count" real, "Core config 1,3" text, "Core ( MHz )" real, "Shader ( MHz )" real, "Memory ( MHz ...
SELECT COUNT("Die size (mm 2 )") FROM table_28268 WHERE "Texture ( GT /s)" = '34'
wikisql
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 (SELECT jybgb.KSBM FROM txmzjzjlb JOIN jybgb ON txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE txmzjzjlb.YLJGDM = '0889574' AND jybgb.BGRQ BETWEEN '2000-11-03' AND '2012-11-14' GROUP BY jybgb.KSBM HAVING COUNT(*) >= 15 UNION SELECT jybgb.KSBM FROM ftxmzjzjlb...
css
CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Percent text, ACC_Home text, ACC_Road text, All_Games text, All_Games_Percent int, All_Home text, All_Road text, All_Neutral text ) CREATE TABLE university ( Scho...
SELECT All_Home, Team_ID FROM basketball_match GROUP BY ACC_Road, All_Home ORDER BY All_Home DESC
nvbench
CREATE TABLE table_46935 ( "Driver" text, "Team" text, "Laps" real, "Time/Retired" text, "Grid" real, "Points" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the Team which has a Time/Retired of contact, and a Grid smaller than 17?
SELECT "Team" FROM table_46935 WHERE "Time/Retired" = 'contact' AND "Grid" < '17'
wikisql
CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId nu...
SELECT a.OwnerUserId, COUNT(*) AS "total" FROM Posts AS a JOIN Posts AS q ON q.Id = a.ParentId WHERE NOT q.ClosedDate IS NULL GROUP BY a.OwnerUserId ORDER BY total DESC
sede
CREATE TABLE editor ( Editor_ID int, Name text, Age real ) CREATE TABLE journal ( Journal_ID int, Date text, Theme text, Sales int ) CREATE TABLE journal_committee ( Editor_ID int, Journal_ID int, Work_Type text ) -- Using valid SQLite, answer the following questions for the ...
SELECT Name, COUNT(Name) FROM journal_committee AS T1 JOIN editor AS T2 ON T1.Editor_ID = T2.Editor_ID JOIN journal AS T3 ON T1.Journal_ID = T3.Journal_ID WHERE T3.Sales > 3000 GROUP BY Name ORDER BY Name DESC
nvbench
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 mzjzjlb ( HXPLC number, HZXM ...
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 = '50...
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_CLINIC_ID text, MED_DIRE_CD tex...
SELECT SUM(t_kc24.MED_AMOUT), SUM(t_kc24.OVE_PAY) FROM t_kc21 JOIN t_kc24 JOIN t_kc21_t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc24.MED_CLINIC_ID AND t_kc21_t_kc24.MED_SAFE_PAY_ID = t_kc24.MED_SAFE_PAY_ID WHERE t_kc21.MED_SER_ORG_NO = '0036659' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2006-05-11' AND '2014-02-03'
css
CREATE TABLE table_name_93 ( points INTEGER, engine VARCHAR, chassis VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average number of points for an Offenhauser L4 engine with a Trevis chassis?
SELECT AVG(points) FROM table_name_93 WHERE engine = "offenhauser l4" AND chassis = "trevis"
sql_create_context
CREATE TABLE table_54123 ( "Player" text, "Car." real, "Yards" real, "Avg." real, "TD's" real, "Long" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many TDs for the player with a long of less than 4 and under 8 yards?
SELECT SUM("TD's") FROM table_54123 WHERE "Long" < '4' AND "Yards" < '8'
wikisql
CREATE TABLE table_20141 ( "Ecozone" text, "Area (km\u00b2)" real, "Percentage of total area" text, "Percentage of land area" text, "Percentage protected" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the percentage of land area in the ecoz...
SELECT "Percentage of land area" FROM table_20141 WHERE "Percentage protected" = '15.28'
wikisql
CREATE TABLE services ( service_id number, service_type_code text, workshop_group_id number, product_description text, product_name text, product_price number, other_product_service_details text ) CREATE TABLE marketing_regions ( marketing_region_code text, marketing_region_name tex...
SELECT T1.service_type_description FROM ref_service_types AS T1 JOIN services AS T2 ON T1.service_type_code = T2.service_type_code WHERE T2.product_name = 'photo' INTERSECT SELECT T1.service_type_description FROM ref_service_types AS T1 JOIN services AS T2 ON T1.service_type_code = T2.service_type_code WHERE T2.product...
spider
CREATE TABLE Reviewer ( rID int, name text ) CREATE TABLE Movie ( mID int, title text, year int, director text ) CREATE TABLE Rating ( rID int, mID int, stars int, ratingDate date ) -- Using valid SQLite, answer the following questions for the tables provided above. -- For e...
SELECT director, stars FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID WHERE director <> "null" ORDER BY director DESC
nvbench
CREATE TABLE table_11400 ( "Year" real, "Chassis" text, "Engine(s)" text, "Tyres" text, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What engines have the year 1992?
SELECT "Engine(s)" FROM table_11400 WHERE "Year" = '1992'
wikisql
CREATE TABLE furniture_manufacte ( Manufacturer_ID int, Furniture_ID int, Price_in_Dollar real ) CREATE TABLE manufacturer ( Manufacturer_ID int, Open_Year real, Name text, Num_of_Factories int, Num_of_Shops int ) CREATE TABLE furniture ( Furniture_ID int, Name text, Num_of...
SELECT Name, Price_in_Dollar FROM furniture AS t1 JOIN furniture_manufacte AS t2 ON t1.Furniture_ID = t2.Furniture_ID ORDER BY Price_in_Dollar
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 = 594 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1)) AND char...
mimic_iii
CREATE TABLE table_75694 ( "Rank" text, "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 number of totals that have silvers under 2, bronzes over 0, and golds over 1?
SELECT COUNT("Total") FROM table_75694 WHERE "Silver" < '2' AND "Bronze" > '0' AND "Gold" > '1'
wikisql
CREATE TABLE table_593 ( "No" real, "Player" text, "Height" text, "Position" text, "Year born" real, "Current Club" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's Yotam Halperin's position?
SELECT "Position" FROM table_593 WHERE "Player" = 'Yotam Halperin'
wikisql
CREATE TABLE table_53594 ( "Date" text, "Tournament" text, "Round" text, "Ground" text, "Opponent" text, "Score 1" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which date's opponent was Dender when the tournament was in the Jupiler League and ...
SELECT "Date" FROM table_53594 WHERE "Opponent" = 'dender' AND "Tournament" = 'jupiler league' AND "Ground" = 'a'
wikisql
CREATE TABLE table_38000 ( "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 position did the team finish in with a Dif...
SELECT COUNT("Position") FROM table_38000 WHERE "Difference" = '- 6' AND "Lost" = '3' AND "Drawn" > '4'
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 COUNT(*) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-4486')) AND intakeoutput.cellpath LIKE '%intake%' AND intakeoutput.cel...
eicu
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 text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) C...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admityear < "2158" AND procedures.short_title = "Inject ca chemother NEC"
mimicsql_data
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE d_labitems ( row_id number, itemid...
SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'desipramine hcl' AND STRFTIME('%y', prescriptions.startdate) = '2...
mimic_iii
CREATE TABLE diagnoses ( 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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.age < "50" AND diagnoses.long_title = "Coronary atherosclerosis of native coronary artery"
mimicsql_data
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREAT...
SELECT MIN(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-80884' AND patient.hospitaldischargetime IS ...
eicu
CREATE TABLE table_203_89 ( id number, "#" number, "name\n(birth-death)" text, "took office" text, "left office" text, "monarch" text, "prime minister" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many governors did the union of south ...
SELECT COUNT("name\n(birth-death)") FROM table_203_89 WHERE "monarch" = 'george v'
squall
CREATE TABLE table_74328 ( "Team" text, "Stadium" text, "Home Games" real, "Average Attendance" real, "Total Attendance" real, "Capacity Percentage" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name of the team when the stadium is ...
SELECT "Team" FROM table_74328 WHERE "Stadium" = 'Edward Jones Dome'
wikisql
CREATE TABLE table_name_91 ( winning_score VARCHAR, runner_s__up VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the winning score of the tournament with Charles Coody as the runner-up?
SELECT winning_score FROM table_name_91 WHERE runner_s__up = "charles coody"
sql_create_context
CREATE TABLE table_name_62 ( skip VARCHAR, third VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- WHAT IS THE SKIP WITH A THIRD OF DEANNA DOIG?
SELECT skip FROM table_name_62 WHERE third = "deanna doig"
sql_create_context
CREATE TABLE table_47951 ( "Date" text, "Region" text, "Label" text, "Catalogue" text, "Format" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Label, when Date is 1987?
SELECT "Label" FROM table_47951 WHERE "Date" = '1987'
wikisql
CREATE TABLE table_57107 ( "NGC number" real, "Object type" text, "Constellation" text, "Right ascension ( J2000 )" text, "Declination ( J2000 )" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What constellation has a Declination ( J2000 ) of 32 39 ...
SELECT "Constellation" FROM table_57107 WHERE "Declination ( J2000 )" = '°32′39″'
wikisql
CREATE TABLE entrepreneur ( Investor VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the investors that have invested in at least two entrepreneurs?
SELECT Investor FROM entrepreneur GROUP BY Investor HAVING COUNT(*) >= 2
sql_create_context
CREATE TABLE table_19131921_1 ( branding VARCHAR, format VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which branding has the format of southern country?
SELECT branding FROM table_19131921_1 WHERE format = "Southern Country"
sql_create_context
CREATE TABLE table_25294 ( "Station" text, "Extension" text, "City/Neighborhood" text, "Projected opening" real, "Transit Connections" text, "Park and ride?" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the least projected opening
SELECT MIN("Projected opening") FROM table_25294
wikisql
CREATE TABLE table_1708050_1 ( poles VARCHAR, position VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the poles for 25th position
SELECT poles FROM table_1708050_1 WHERE position = "25th"
sql_create_context
CREATE TABLE table_58510 ( "Round" text, "Date" text, "Home Team" text, "Score" text, "Away Team" text, "Crowd" real, "Stadium" text, "Match Details" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the score of the match that too...
SELECT "Score" FROM table_58510 WHERE "Round" = 'playoff'
wikisql
CREATE TABLE table_6194 ( "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 is the 1st leg of cs sfaxien?
SELECT "1st leg" FROM table_6194 WHERE "Team 2" = 'cs sfaxien'
wikisql
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose...
SELECT COUNT(*) > 0 FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 26777) AND DATETIME(procedures_icd.charttime) >= DATETIME(CURRENT_TIME(), '-6 year')
mimic_iii