instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) 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, ...
SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN hz_info_mzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzj...
css
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, ...
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT transfers.hadm_id FROM transfers WHERE transfers.careunit = 'tsicu' AND STRFTIME('%y', transfers.intime) = '2104')
mimic_iii
CREATE TABLE Asset_Parts ( asset_id INTEGER, part_id INTEGER ) CREATE TABLE Maintenance_Engineers ( engineer_id INTEGER, company_id INTEGER, first_name VARCHAR(50), last_name VARCHAR(50), other_details VARCHAR(255) ) CREATE TABLE Engineer_Visits ( engineer_visit_id INTEGER, contact...
SELECT asset_make, COUNT(asset_make) FROM Assets GROUP BY asset_make ORDER BY COUNT(asset_make)
nvbench
CREATE TABLE table_10470082_8 ( us_air_date VARCHAR, writer VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When did the episode written by Jim Morris air?
SELECT us_air_date FROM table_10470082_8 WHERE writer = "Jim Morris"
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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "WHITE - RUSSIAN" AND prescriptions.route = "ID"
mimicsql_data
CREATE TABLE table_203_715 ( id number, "year" number, "competition" text, "venue" text, "position" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which country had more competitions , germany or greece ?
SELECT "venue" FROM table_203_715 WHERE "venue" IN ('germany', 'greece') GROUP BY "venue" ORDER BY COUNT("competition") DESC LIMIT 1
squall
CREATE TABLE table_name_88 ( total_passengers INTEGER, capacity_in_use VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the number of passengers when the capacity is 81.2%?
SELECT SUM(total_passengers) FROM table_name_88 WHERE capacity_in_use = "81.2%"
sql_create_context
CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE TABLE restriction ( restriction_code text, advance_purchase int, stopovers text, saturday_stay_required t...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'ONTARIO' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'MEMPHI...
atis
CREATE TABLE table_72772 ( "School" text, "Record" text, "Conference" text, "Conf. record" text, "Regular season finish" text, "Regular season second place" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which conference is Belmont in?
SELECT "Conference" FROM table_72772 WHERE "School" = 'Belmont'
wikisql
CREATE TABLE table_65668 ( "Name" text, "Gain" real, "Loss" real, "Long" real, "Avg/G" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many gains have a long greater than 8, with avg/g of 124.9?
SELECT SUM("Gain") FROM table_65668 WHERE "Long" > '8' AND "Avg/G" = '124.9'
wikisql
CREATE TABLE table_68590 ( "Year" real, "Entrant" text, "Chassis" text, "Engine" text, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average points that Centro Asegurador earned with the McLaren M23 chassis?
SELECT AVG("Points") FROM table_68590 WHERE "Chassis" = 'mclaren m23' AND "Entrant" = 'centro asegurador'
wikisql
CREATE TABLE table_47718 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Ground" text, "Crowd" real, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Home team has a score of 12.10 (82)?
SELECT "Home team" FROM table_47718 WHERE "Home team score" = '12.10 (82)'
wikisql
CREATE TABLE table_10531 ( "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. -- Where was the game played that had an away team ...
SELECT "Venue" FROM table_10531 WHERE "Away team score" = '20.17 (137)'
wikisql
CREATE TABLE table_name_83 ( away_team VARCHAR, home_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the away team score when the home team was the Brisbane Lions?
SELECT away_team AS score FROM table_name_83 WHERE home_team = "brisbane lions"
sql_create_context
CREATE TABLE table_name_61 ( location VARCHAR, team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Location when the team was seve ballesteros & manuel pi ero?
SELECT location FROM table_name_61 WHERE team = "seve ballesteros & manuel piñero"
sql_create_context
CREATE TABLE music_festival ( id number, music_festival text, date_of_ceremony text, category text, volume number, result text ) CREATE TABLE artist ( artist_id number, artist text, age number, famous_title text, famous_release_date text ) CREATE TABLE volume ( volume_i...
SELECT COUNT(DISTINCT artist_id) FROM volume
spider
CREATE TABLE table_203_554 ( id number, "year" number, "place" text, "gold" text, "silver" text, "bronze" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the first place listed in this chart ?
SELECT "place" FROM table_203_554 WHERE id = 1
squall
CREATE TABLE table_name_10 ( loss VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who lost on august 21?
SELECT loss FROM table_name_10 WHERE date = "august 21"
sql_create_context
CREATE TABLE table_72868 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On wha...
SELECT "Date" FROM table_72868 WHERE "Team" = 'Memphis'
wikisql
CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) CREATE TABLE airport ( airport_code varchar, airport_name text, airport_lo...
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 = 'ATLANTA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SEATTL...
atis
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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2172" AND diagnoses.long_title = "Other persistent mental disorders due to conditions classified elsewhere"
mimicsql_data
CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, ...
SELECT t1.diagnosisname FROM (SELECT diagnosis.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnosis WHERE STRFTIME('%y', diagnosis.diagnosistime) <= '2104' GROUP BY diagnosis.diagnosisname) AS t1 WHERE t1.c1 <= 4
eicu
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 COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'inject ca c...
mimic_iii
CREATE TABLE table_59596 ( "Rank" text, "County" text, "State" text, "Land area (km\u00b2)" text, "Land area (mi\u00b2)" text, "April 1, 2010 census" text, "April 1, 2010 density (/km\u00b2)" text, "April 1, 2010 density (/mi\u00b2)" text, "July 1, 2010 official estimate" text, "...
SELECT "Mid-2010 to mid-2011 change (%)" FROM table_59596 WHERE "July 1, 2011 density (/mi\u00b2)" = '508'
wikisql
CREATE TABLE table_64789 ( "Draw" real, "Song" text, "Artist" text, "Points" real, "Place" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which artist has 13 points?
SELECT "Artist" FROM table_64789 WHERE "Points" = '13'
wikisql
CREATE TABLE table_2581397_2 ( group VARCHAR, venue VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What group was sunline in when he was at moonee valley?
SELECT group FROM table_2581397_2 WHERE venue = "Moonee Valley"
sql_create_context
CREATE TABLE table_70002 ( "Unit" text, "Reactortype" text, "Net capacity" text, "Gross capacity" text, "Construction started" text, "Electricity Grid" text, "Commercial Operation" text, "Shutdown" text ) -- Using valid SQLite, answer the following questions for the tables provided abo...
SELECT "Unit" FROM table_70002 WHERE "Construction started" = '01.07.1967'
wikisql
CREATE TABLE table_1473672_10 ( position VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many positions did 1972 NHL Draft pick Rene Lambert play?
SELECT COUNT(position) FROM table_1473672_10 WHERE player = "Rene Lambert"
sql_create_context
CREATE TABLE table_27537518_9 ( record VARCHAR, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the record for the game where the opponent was the Carolina Hurricanes?
SELECT record FROM table_27537518_9 WHERE opponent = "Carolina Hurricanes"
sql_create_context
CREATE TABLE table_name_27 ( city VARCHAR, average VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which City has an Average of 6.85?
SELECT city FROM table_name_27 WHERE average = 6.85
sql_create_context
CREATE TABLE table_name_3 ( year VARCHAR, attempts VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When has Attempts of 282 ?
SELECT year FROM table_name_3 WHERE attempts = "282"
sql_create_context
CREATE TABLE hz_info_zyjzjlb ( JZLSH number, YLJGDM number, zyjzjlb_id number ) 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 t...
SELECT mzjzjlb.JZLSH FROM person_info JOIN hz_info JOIN mzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE person_info.XM = '朱斯伯' AND hz_info.YLJGDM = '0905366' AND NOT mzjzjlb.JZKSMC LIKE '%正骨科%'
css
CREATE TABLE table_name_20 ( call_sign VARCHAR, erp_w VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the call sign for ERP W of 4
SELECT call_sign FROM table_name_20 WHERE erp_w = 4
sql_create_context
CREATE TABLE table_name_12 ( kickoff_ VARCHAR, a_ VARCHAR, game_site VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the kickoff time for the Hubert H. Humphrey Metrodome?
SELECT kickoff_ AS "a_" FROM table_name_12 WHERE game_site = "hubert h. humphrey metrodome"
sql_create_context
CREATE TABLE paper ( paperid int, title varchar, venueid int, year int, numciting int, numcitedby int, journalid int ) CREATE TABLE keyphrase ( keyphraseid int, keyphrasename varchar ) CREATE TABLE cite ( citingpaperid int, citedpaperid int ) CREATE TABLE journal ( jou...
SELECT DISTINCT writes.paperid FROM author, paper, writes WHERE author.authorname = 'Bill Howe' AND writes.authorid = author.authorid AND writes.paperid = paper.paperid ORDER BY paper.year DESC
scholar
CREATE TABLE table_17416221_1 ( area__km_2__ INTEGER, largest_city VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is minimum area where the largest city is bloemfontein?
SELECT MIN(area__km_2__) FROM table_17416221_1 WHERE largest_city = "Bloemfontein"
sql_create_context
CREATE TABLE table_26781 ( "Railroad" text, "Game Cost" text, "Real-Life Years of Operation" text, "Real-Life Eventual Outcome" text, "Currently\u00b9 Part Of..." text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the real life years of operation f...
SELECT "Real-Life Years of Operation" FROM table_26781 WHERE "Currently\u00b9 Part Of..." = 'Amtrak'
wikisql
CREATE TABLE table_name_63 ( player INTEGER, year VARCHAR, sets VARCHAR, aces VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest number of players during 1r year with a clay set and more than 4 aces?
SELECT MAX(player) FROM table_name_63 WHERE year = "1r" AND sets = "clay" AND NOT aces > 4
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 INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "2110" AND lab.label = "Asparate Aminotransferase (AST)"
mimicsql_data
CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, ...
WITH Raw AS (SELECT YEAR(Votes.CreationDate) AS Year, Posts.OwnerUserId AS UserId, COUNT(*) AS Count FROM Posts, Votes WHERE Votes.VoteTypeId = 2 AND Votes.PostId = Posts.Id GROUP BY YEAR(Votes.CreationDate), Posts.OwnerUserId), Raw2 AS (SELECT Year, UserId, Count, DENSE_RANK() OVER (PARTITION BY Year ORDER BY Count DE...
sede
CREATE TABLE airlines ( alid number, name text, iata text, icao text, callsign text, country text, active text ) CREATE TABLE routes ( rid number, dst_apid number, dst_ap text, src_apid number, src_ap text, alid number, airline text, codeshare text ) CREATE ...
SELECT name, city, country FROM airports ORDER BY elevation DESC LIMIT 1
spider
CREATE TABLE flight_fare ( flight_id int, fare_id int ) CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int ) CREATE TABLE flight ( aircraft_code_sequence text, airline_code varchar, airline_flight te...
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 = 'DALLAS'...
atis
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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.age < "67" AND diagnoses.long_title = "Schizoaffective disorder, unspecified"
mimicsql_data
CREATE TABLE table_name_4 ( constructor VARCHAR, time_retired VARCHAR, driver VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who constructed olivier panis' car that retired after +1 lap?
SELECT constructor FROM table_name_4 WHERE time_retired = "+1 lap" AND driver = "olivier panis"
sql_create_context
CREATE TABLE table_name_35 ( height_in_ft VARCHAR, position VARCHAR, school_club_team_country VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the height in feet for the guard from north carolina-charlotte
SELECT height_in_ft FROM table_name_35 WHERE position = "guard" AND school_club_team_country = "north carolina-charlotte"
sql_create_context
CREATE TABLE table_name_58 ( chassis VARCHAR, points VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Chassis has 0 points?
SELECT chassis FROM table_name_58 WHERE points = 0
sql_create_context
CREATE TABLE table_13657749_2 ( rnd VARCHAR, gto_winning_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is GTO Winning Team Mike Keyser's RND number?
SELECT rnd FROM table_13657749_2 WHERE gto_winning_team = "Mike Keyser"
sql_create_context
CREATE TABLE t_kc21 ( 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 SUM(t_kc24.PER_ACC_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.PERSON_NM = '苗香馨' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2002-07-15' AND '2002-11-09'
css
CREATE TABLE table_33592 ( "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 date did the home team have a score of 9.18...
SELECT "Date" FROM table_33592 WHERE "Home team score" = '9.18 (72)'
wikisql
CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE Tags ( Id number, TagName text, Cou...
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%kolhapur%' OR UPPER(Location) LIKE '%KOLHAPUR' ORDER BY Reputation DESC LIMIT 10
sede
CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, ...
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE LOWER('%croatia%') ORDER BY Reputation DESC
sede
CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId number, Parent...
SELECT rate.TagName AS Tag, rate.Month AS Month, rate.Year AS Year, rate.Rate AS NumQuestions FROM (SELECT COUNT(PostId) AS Rate, TagName, YEAR(Posts.CreationDate) AS Year, MONTH(Posts.CreationDate) AS Month FROM Tags, PostTags, Posts WHERE Tags.Id = PostTags.TagId AND Posts.Id = PostId AND Posts.CreationDate > DATEADD...
sede
CREATE TABLE table_31 ( "Player" text, "Total W\u2013L" text, "Singles W\u2013L" text, "Doubles W\u2013L" text, "Ties played" real, "Debut" real, "Years played" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the total number of singl...
SELECT COUNT("Singles W\u2013L") FROM table_31 WHERE "Doubles W\u2013L" = '11–14'
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 demographic ( subject_id text, hadm_id t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE prescriptions.formulary_drug_cd = "CSA50I" AND lab.fluid = "Ascites"
mimicsql_data
CREATE TABLE table_name_49 ( res VARCHAR, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Record of 47 5 (1) involved what res?
SELECT res FROM table_name_49 WHERE record = "47–5 (1)"
sql_create_context
CREATE TABLE table_10570 ( "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. -- Where did carlton play while away?
SELECT "Venue" FROM table_10570 WHERE "Away team" = 'carlton'
wikisql
CREATE TABLE table_7935 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which L...
SELECT "Location Attendance" FROM table_7935 WHERE "Date" = 'april 15'
wikisql
CREATE TABLE Customer_Orders ( order_id INTEGER, customer_id INTEGER, order_status_code VARCHAR(10), order_date DATETIME ) CREATE TABLE Department_Stores ( dept_store_id INTEGER, dept_store_chain_id INTEGER, store_name VARCHAR(80), store_address VARCHAR(255), store_phone VARCHAR(80)...
SELECT product_type_code, MAX(product_price) FROM Products GROUP BY product_type_code ORDER BY MAX(product_price)
nvbench
CREATE TABLE table_name_63 ( loss VARCHAR, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the loss of the game with a record of 54 42?
SELECT loss FROM table_name_63 WHERE record = "54–42"
sql_create_context
CREATE TABLE table_24126518_2 ( date VARCHAR, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the number of dates for alouettes
SELECT COUNT(date) FROM table_24126518_2 WHERE opponent = "Alouettes"
sql_create_context
CREATE TABLE table_train_247 ( "id" int, "mini_mental_state_examination_mmse" int, "creatinine_consistently" float, "creatinine_clearance_cl" float, "seizure_disorder" bool, "age" float, "NOUSE" float ) -- Using valid SQLite, answer the following questions for the tables provided above. -...
SELECT * FROM table_train_247 WHERE age >= 30 AND age <= 80
criteria2sql
CREATE TABLE table_11710 ( "Airing date" text, "English Title (Chinese title)" text, "Number of episodes" real, "Theme song (T) Sub-theme song (ST)" text, "Genre" text, "Official website" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which titl...
SELECT "English Title (Chinese title)" FROM table_11710 WHERE "Airing date" = '18 dec 2006- 10 feb 2007'
wikisql
CREATE TABLE table_name_59 ( tie_no VARCHAR, away_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which tie number has Bolton Wanderers as away?
SELECT tie_no FROM table_name_59 WHERE away_team = "bolton wanderers"
sql_create_context
CREATE TABLE table_name_30 ( venue VARCHAR, result VARCHAR, extra VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the venue when the result is 2nd and extra is 4 x 100 m relay?
SELECT venue FROM table_name_30 WHERE result = "2nd" AND extra = "4 x 100 m relay"
sql_create_context
CREATE TABLE table_8225 ( "Position" real, "Name" text, "Played" real, "Drawn" real, "Lost" real, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average Lost that has a Name of ec amberg (n), and a Position smaller than 4?
SELECT AVG("Lost") FROM table_8225 WHERE "Name" = 'ec amberg (n)' AND "Position" < '4'
wikisql
CREATE TABLE table_name_96 ( total VARCHAR, finish VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total for the player with a Finish of T39?
SELECT total FROM table_name_96 WHERE finish = "t39"
sql_create_context
CREATE TABLE table_name_35 ( result VARCHAR, year INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What result has a year after 2002?
SELECT result FROM table_name_35 WHERE year > 2002
sql_create_context
CREATE TABLE table_1139835_3 ( grand_finalist VARCHAR, scores VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who is the grand finalist where scores is 11.11 (77) 10.8 (68)
SELECT grand_finalist FROM table_1139835_3 WHERE scores = "11.11 (77) – 10.8 (68)"
sql_create_context
CREATE TABLE table_204_889 ( id number, "date" text, "week (stage)" text, "song choice" text, "original artist" text, "theme" text, "result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which was the first song he performed that was origin...
SELECT "song choice" FROM table_204_889 WHERE "original artist" = 'the beatles' ORDER BY "date" LIMIT 1
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 diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic (...
SELECT MIN(demographic.age) FROM demographic WHERE demographic.discharge_location = "HOME" AND demographic.diagnosis = "POSTERIOR COMMUNICATING ANEURYSM/SDA"
mimicsql_data
CREATE TABLE table_15333005_1 ( Ends VARCHAR, l VARCHAR, stolen_ends VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the number ends won when L is 4 and stolen ends is 17
SELECT COUNT(Ends) AS won FROM table_15333005_1 WHERE l = 4 AND stolen_ends = 17
sql_create_context
CREATE TABLE table_55086 ( "Series ^" text, "Model" text, "CPU clock ( MHz )" text, "CPU cores" real, "TDP ( W )" text, "L2 cache (KiB)" text, "Radeon cores" real, "DDR3 speed" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the CPU ...
SELECT "CPU clock ( MHz )" FROM table_55086 WHERE "L2 cache (KiB)" = '2*512' AND "Series ^" = 'e-series' AND "DDR3 speed" = '1066'
wikisql
CREATE TABLE table_10413 ( "Class" text, "Type" text, "Quantity" real, "Date" text, "LNER Class" text, "1946 LNER nos." text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which type has a quantity of 11?
SELECT "Type" FROM table_10413 WHERE "Quantity" = '11'
wikisql
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob...
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT labevents.hadm_id FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'sodium, urine') AND DATETIME(labevents.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 's...
mimic_iii
CREATE TABLE table_name_97 ( total INTEGER, year_s__won VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- The golfer who won in 1993 had what total has his total?
SELECT SUM(total) FROM table_name_97 WHERE year_s__won = "1993"
sql_create_context
CREATE TABLE table_train_32 ( "id" int, "pregnancy_or_lactation" bool, "renal_disease" bool, "hemachromatosis" bool, "glucose_6_phosphate_dehydrogenase_deficiency_g6pd" int, "prisoners" bool, "NOUSE" float ) -- Using valid SQLite, answer the following questions for the tables provided abov...
SELECT * FROM table_train_32 WHERE pregnancy_or_lactation = 1 OR prisoners = 1
criteria2sql
CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, ...
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', treatment.treatmenttime)) FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '004-79017'...
eicu
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 t_kc22.DIRE_TYPE FROM t_kc22 JOIN t_kc21_t_kc22 JOIN t_kc21 ON t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID AND t_kc21_t_kc22.MED_CLINIC_ID = t_kc21.MED_CLINIC_ID WHERE t_kc21.MED_CLINIC_ID = '98602602756' AND t_kc22.SOC_SRT_DIRE_CD = '366134-y'
css
CREATE TABLE batting_postseason ( year INTEGER, round TEXT, player_id TEXT, team_id TEXT, league_id TEXT, g INTEGER, ab INTEGER, r INTEGER, h INTEGER, double INTEGER, triple INTEGER, hr INTEGER, rbi INTEGER, sb INTEGER, cs NUMERIC, bb INTEGER, so INTEG...
SELECT year, SUM(attendance) FROM home_game ORDER BY year
nvbench
CREATE TABLE table_name_15 ( call_sign VARCHAR, erp_w VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the call sign with a 222 erp w?
SELECT call_sign FROM table_name_15 WHERE erp_w = 222
sql_create_context
CREATE TABLE race ( Race_ID int, Name text, Class text, Date text, Track_ID text ) CREATE TABLE track ( Track_ID int, Name text, Location text, Seating real, Year_Opened real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are th...
SELECT Class, COUNT(*) FROM race GROUP BY Class ORDER BY Class DESC
nvbench
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND lab.label = "Uric Acid"
mimicsql_data
CREATE TABLE table_269920_3 ( l2_cache__mb_ INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the maximal L3 cache for any of the models given?
SELECT MAX(l2_cache__mb_) FROM table_269920_3
sql_create_context
CREATE TABLE table_31034 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who are the writers of the...
SELECT "Written by" FROM table_31034 WHERE "Title" = 'Mac Bangs Dennis'' Mom'
wikisql
CREATE TABLE table_name_5 ( iata VARCHAR, airport VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What kind of IATA has an Airport of hamburg airport?
SELECT iata FROM table_name_5 WHERE airport = "hamburg airport"
sql_create_context
CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDa...
SELECT Id AS "user_link", DisplayName, Reputation, Location FROM Users WHERE Location LIKE '%Sofia%' OR Location LIKE '%Bulgaria%' ORDER BY Reputation DESC LIMIT 200
sede
CREATE TABLE table_64932 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text, "Arena" text, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Attendance has an Arena of arrowhead pond o...
SELECT "Attendance" FROM table_64932 WHERE "Arena" = 'arrowhead pond of anaheim' AND "Points" < '5'
wikisql
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.KSBM, jybgb.KSMC FROM hz_info JOIN mzjzjlb JOIN jybgb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE hz_info.RYBH = '16815496' AND jybgb.BGRQ BETWEEN '2006-09-29' AND '2016-...
css
CREATE TABLE table_28418 ( "No." real, "#" real, "Title" text, "Directed by" text, "Written by" text, "U.S. viewers (million)" text, "Rank (week)" text, "Original air date" text, "Production code" text ) -- Using valid SQLite, answer the following questions for the tables provided ...
SELECT "Rank (week)" FROM table_28418 WHERE "#" = '19'
wikisql
CREATE TABLE table_name_45 ( driver VARCHAR, grid VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Driver has a Grid of 1?
SELECT driver FROM table_name_45 WHERE grid = "1"
sql_create_context
CREATE TABLE table_76507 ( "Finished" text, "Horse" text, "Jockey" text, "Trainer" text, "Odds" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Horse finished in 8?
SELECT "Horse" FROM table_76507 WHERE "Finished" = '8'
wikisql
CREATE TABLE table_name_49 ( rank VARCHAR, assets__bn$_ VARCHAR, market_value__bn$_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many ranks have assets of $70.74 billion and market value greater than $11.29 billion?
SELECT COUNT(rank) FROM table_name_49 WHERE assets__bn$_ = 70.74 AND market_value__bn$_ > 11.29
sql_create_context
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number...
SELECT STRFTIME('%j', patient.unitdischargetime) - STRFTIME('%j', patient.unitadmittime) FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-254232') AND NOT patient.unitadmittime IS NULL ORDER BY patient.unitadmittime DESC LIMIT ...
eicu
CREATE TABLE person_info ( RYBH text, XBDM number, XBMC text, XM text, CSRQ time, CSD text, MZDM text, MZMC text, GJDM text, GJMC text, JGDM text, JGMC text, XLDM text, XLMC text, ZYLBDM text, ZYMC text ) CREATE TABLE mzjzjlb ( YLJGDM text, JZLSH ...
SELECT RYTJDM, RYTJMC FROM zyjzjlb WHERE JZLSH = '47260453566'
css
CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) CREATE TABLE PostHistory ( Id number, Po...
SELECT ROW_NUMBER() OVER (ORDER BY SUM(CASE WHEN VoteTypeId = 2 THEN 1 ELSE (CASE WHEN VoteTypeId = 3 THEN -1 ELSE 0 END) END) DESC) AS "#", Users.Id AS "user_link", SUM(CASE WHEN VoteTypeId = 2 THEN 1 ELSE (CASE WHEN VoteTypeId = 3 THEN -1 ELSE 0 END) END) AS CalcRep FROM Users, Tags INNER JOIN PostTags ON PostTags.Ta...
sede
CREATE TABLE gymnast ( gymnast_id number, floor_exercise_points number, pommel_horse_points number, rings_points number, vault_points number, parallel_bars_points number, horizontal_bar_points number, total_points number ) CREATE TABLE people ( people_id number, name text, a...
SELECT T1.total_points FROM gymnast AS T1 JOIN people AS T2 ON T1.gymnast_id = T2.people_id ORDER BY T2.age LIMIT 1
spider
CREATE TABLE person_info ( RYBH text, XBDM number, XBMC text, XM text, CSRQ time, CSD text, MZDM text, MZMC text, GJDM text, GJMC text, JGDM text, JGMC text, XLDM text, XLMC text, ZYLBDM text, ZYMC text ) CREATE TABLE mzjzjlb ( YLJGDM text, JZLSH ...
(SELECT * FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE hz_info.RYBH = ...
css
CREATE TABLE table_name_49 ( melbourne VARCHAR, gold_coast VARCHAR, adelaide VARCHAR, auckland VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the melbourne for adelaide of no with auckland of yes and gold coast of yes
SELECT melbourne FROM table_name_49 WHERE adelaide = "no" AND auckland = "yes" AND gold_coast = "no"
sql_create_context
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 COUNT(*) FROM gwyjzb JOIN t_kc22 ON gwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gwyjzb.PERSON_NM = '郑丹红' AND t_kc22.STA_DATE BETWEEN '2001-08-25' AND '2014-08-03' AND t_kc22.SELF_PAY_PRO < 0.85 UNION SELECT COUNT(*) FROM fgwyjzb JOIN t_kc22 ON fgwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE fgwyjzb.PERS...
css
CREATE TABLE table_6601 ( "Game" real, "December" real, "Opponent" text, "Score" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the opponent at the game later than game 22 when the record was 17-10-4?
SELECT "Opponent" FROM table_6601 WHERE "Game" > '22' AND "Record" = '17-10-4'
wikisql