instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code tex...
SELECT MAX(lab.labresult) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '021-35326')) AND lab.labname = 'anion gap' AND STRFTIME('%y-%m', lab.labresulttime...
eicu
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemics...
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 = '030-42006')) AND intakeoutput.cellpath LIKE '%intake%' AND intakeoutput.ce...
eicu
CREATE TABLE table_name_83 ( player VARCHAR, tries VARCHAR, points VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the player with tries of 02 2 and points of 008 8
SELECT player FROM table_name_83 WHERE tries = "02 2" AND points = "008 8"
sql_create_context
CREATE TABLE table_42186 ( "Week" real, "Home Team" text, "Away Team" text, "Overall Record" text, "Divisional Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Can you tell me the Overall Record that has the Week of 3?
SELECT "Overall Record" FROM table_42186 WHERE "Week" = '3'
wikisql
CREATE TABLE table_26250151_1 ( order__number VARCHAR, original_recording_artist VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the order # or Erma Franklin?
SELECT order__number FROM table_26250151_1 WHERE original_recording_artist = "Erma Franklin"
sql_create_context
CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) -- Using valid SQLite, answer the following questions for the...
SELECT T1.Name, T2.Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY T1.Name
nvbench
CREATE TABLE table_name_60 ( pick__number INTEGER, position VARCHAR, overall VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the mean pick number for the cornerback position when the overall is less than 134?
SELECT AVG(pick__number) FROM table_name_60 WHERE position = "cornerback" AND overall < 134
sql_create_context
CREATE TABLE table_name_84 ( lost VARCHAR, tries_for VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many losses were there with 103 tries for?
SELECT lost FROM table_name_84 WHERE tries_for = "103"
sql_create_context
CREATE TABLE table_name_48 ( manager VARCHAR, club VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the manager of club fc twente?
SELECT manager FROM table_name_48 WHERE club = "fc twente"
sql_create_context
CREATE TABLE mzb ( CLINIC_ID text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, INSU_TYPE text, IN...
SELECT qtb.MED_SER_ORG_NO FROM qtb WHERE qtb.PERSON_NM = '袁秀艾' AND qtb.IN_HOSP_DATE BETWEEN '2011-08-04' AND '2014-09-24' GROUP BY qtb.MED_SER_ORG_NO ORDER BY COUNT(*) DESC LIMIT 1 UNION SELECT gyb.MED_SER_ORG_NO FROM gyb WHERE gyb.PERSON_NM = '袁秀艾' AND gyb.IN_HOSP_DATE BETWEEN '2011-08-04' AND '2014-09-24' GROUP BY gy...
css
CREATE TABLE table_1341604_19 ( incumbent VARCHAR, first_elected VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who's the incumbent in the district first elected in 1976?
SELECT incumbent FROM table_1341604_19 WHERE first_elected = 1976
sql_create_context
CREATE TABLE table_4280 ( "Season" real, "Date" text, "Location" text, "Discipline" text, "Position" real, "FIS points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the position for fis points being 3495
SELECT "Position" FROM table_4280 WHERE "FIS points" = '3495'
wikisql
CREATE TABLE table_32906 ( "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 where the home tea...
SELECT "Date" FROM table_32906 WHERE "Home team score" = '17.14 (116)'
wikisql
CREATE TABLE table_name_52 ( rank VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Rank of Qi Hui?
SELECT COUNT(rank) FROM table_name_52 WHERE name = "qi hui"
sql_create_context
CREATE TABLE book ( Id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many books are there?
SELECT COUNT(*) FROM book
sql_create_context
CREATE TABLE table_24763 ( "Event" real, "Round" real, "Circuit" text, "Date" text, "Pole Position" text, "Fastest Lap" text, "Winning driver" text, "Winning team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the winning team ...
SELECT "Winning team" FROM table_24763 WHERE "Circuit" = 'Queensland Raceway' AND "Fastest Lap" = 'Tim Macrow'
wikisql
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 AVG(demographic.age) FROM demographic WHERE demographic.language = "RUSS" AND demographic.diagnosis = "PITUITARY BLEED"
mimicsql_data
CREATE TABLE table_28138035_35 ( womens_singles VARCHAR, mens_singles VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who won the Womens Singles in the year the Jean-Michel Saive won the Mens Singles?
SELECT womens_singles FROM table_28138035_35 WHERE mens_singles = "Jean-Michel Saive"
sql_create_context
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
SELECT demographic.insurance, demographic.expire_flag FROM demographic WHERE demographic.subject_id = "8990"
mimicsql_data
CREATE TABLE table_name_11 ( february INTEGER, record VARCHAR, game VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average February that has 18-26-10 as the record, with a game less than 54?
SELECT AVG(february) FROM table_name_11 WHERE record = "18-26-10" AND game < 54
sql_create_context
CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW text, JCZBJGDX text, JCZBMC text, JLDW text, JYRQ time, JYZBLSH text, ...
SELECT jyjgzbb.JCZBDM, jyjgzbb.JCZBMC, jyjgzbb.JCZBJGDX, jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW, jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM jyjgzbb WHERE jyjgzbb.BGDH = '35505782187'
css
CREATE TABLE premises ( Id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many premises are there?
SELECT COUNT(*) FROM premises
sql_create_context
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime...
SELECT medication.drugname FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '017-12240')) AND medication.routeadmin = 'subcutan' ORDER BY medica...
eicu
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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "43" AND prescriptions.route = "DIALYS"
mimicsql_data
CREATE TABLE table_4604 ( "Conference" text, "# of Bids" real, "Record" text, "Win %" text, "Round of 32" text, "Sweet Sixteen" text, "Elite Eight" text, "Final Four" text, "Championship Game" text ) -- Using valid SQLite, answer the following questions for the tables provided abov...
SELECT "Elite Eight" FROM table_4604 WHERE "Conference" = 'atlantic 10'
wikisql
CREATE TABLE table_21446 ( "Team #1" text, "Points" text, "Team #2" text, "1st leg" text, "2nd leg" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who played San Lorenzo?
SELECT "Team #2" FROM table_21446 WHERE "Team #1" = 'San Lorenzo'
wikisql
CREATE TABLE table_name_90 ( position VARCHAR, league VARCHAR, season VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Position has a League of southern league premier division, and a Season of 2004 05?
SELECT position FROM table_name_90 WHERE league = "southern league premier division" AND season = "2004–05"
sql_create_context
CREATE TABLE table_55756 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" real, "Time" text, "Location" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the time for event of tfc 21
SELECT "Time" FROM table_55756 WHERE "Event" = 'tfc 21'
wikisql
CREATE TABLE table_name_3 ( place VARCHAR, silver VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In what Place was the Silver won by vladimir vesselov ( urs )?
SELECT place FROM table_name_3 WHERE silver = "vladimir vesselov ( urs )"
sql_create_context
CREATE TABLE table_10316 ( "Sport" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tell me the total number of total for vovinam and bronze less than 3
SELECT COUNT("Total") FROM table_10316 WHERE "Sport" = 'vovinam' AND "Bronze" < '3'
wikisql
CREATE TABLE mzjzjlb_jybgb ( YLJGDM_MZJZJLB text, BGDH number, YLJGDM number ) 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 n...
SELECT COUNT(*) FROM mzjzjlb WHERE mzjzjlb.JZKSBM = '563' AND mzjzjlb.JZKSRQ BETWEEN '2007-10-04' AND '2010-02-18'
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.admission_location = "TRSF WITHIN THIS FACILITY" AND demographic.discharge_location = "HOME"
mimicsql_data
CREATE TABLE table_27932399_1 ( artist VARCHAR, release_title VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which artist had a release title of HH?
SELECT artist FROM table_27932399_1 WHERE release_title = "HH"
sql_create_context
CREATE TABLE table_4160 ( "Province" text, "Number of Dairy Farms" real, "Number of Dairy Cows" real, "Production (hectolitres)" real, "Dairy Cows per Farm" real, "Production (hectolitres) per Farm" real ) -- Using valid SQLite, answer the following questions for the tables provided above. --...
SELECT COUNT("Province") FROM table_4160 WHERE "Number of Dairy Cows" = '13000'
wikisql
CREATE TABLE table_6463 ( "District" text, "2010 Population (000)" real, "2008 GDP (USD bn) a" real, "2008 GDP per capita (USD) a" real, "Agri culture b" real, "Mining b" real, "Manufac turing b" real, "Services & cons truction b" real, "Exports (USD mn) 2011" text, "Median mo. s...
SELECT COUNT("Agri culture b") FROM table_6463 WHERE "Income poverty f" < '13.6' AND "Mining b" = '1' AND "Structural poverty g" < '7.8'
wikisql
CREATE TABLE table_name_92 ( week VARCHAR, attendance VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In what week was the attendance 25,000?
SELECT week FROM table_name_92 WHERE attendance = "25,000"
sql_create_context
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE prescription...
SELECT demographic.dod FROM demographic WHERE demographic.subject_id = "6983"
mimicsql_data
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, char...
SELECT COUNT(*) > 0 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 = 4469 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1)) AND chartevents.itemid IN (S...
mimic_iii
CREATE TABLE table_name_18 ( directed_by VARCHAR, episode__number VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Directed By, when Episode # is 7?
SELECT directed_by FROM table_name_18 WHERE episode__number = 7
sql_create_context
CREATE TABLE table_64906 ( "School" text, "City" text, "Team Name" text, "County" text, "Year Joined" text, "Year Left" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What year did a school from Jennings County join?
SELECT "Year Joined" FROM table_64906 WHERE "School" = 'jennings county'
wikisql
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE 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.expire_flag = "0" AND procedures.long_title = "Percutaneous aspiration of gallbladder"
mimicsql_data
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "CLINIC REFERRAL/PREMATURE" AND demographic.admityear < "2115"
mimicsql_data
CREATE TABLE table_name_72 ( owner VARCHAR, call_sign VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who owns CKSB-8-FM?
SELECT owner FROM table_name_72 WHERE call_sign = "cksb-8-fm"
sql_create_context
CREATE TABLE county ( county_id number, county_name text, population number, zip_code text ) CREATE TABLE election ( election_id number, counties_represented text, district number, delegate text, party number, first_elected number, committee text ) CREATE TABLE party ( ...
SELECT T2.delegate, T1.county_name FROM county AS T1 JOIN election AS T2 ON T1.county_id = T2.district
spider
CREATE TABLE table_name_68 ( date VARCHAR, city VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Date of the Event in Punta del Este?
SELECT date FROM table_name_68 WHERE city = "punta del este"
sql_create_context
CREATE TABLE gas_station ( station_id number, open_year number, location text, manager_name text, vice_manager_name text, representative_name text ) CREATE TABLE company ( company_id number, rank number, company text, headquarters text, main_industry text, sales_billion ...
SELECT T3.location FROM station_company AS T1 JOIN company AS T2 ON T1.company_id = T2.company_id JOIN gas_station AS T3 ON T1.station_id = T3.station_id WHERE T2.market_value > 100
spider
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE 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.age < "55" AND procedures.short_title = "Aortocor bypas-1 cor art"
mimicsql_data
CREATE TABLE geographic ( city_name varchar, county varchar, region varchar ) 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_n...
SELECT location.house_number, restaurant.name FROM geographic, location, restaurant WHERE geographic.region = 'bay area' AND restaurant.city_name = geographic.city_name AND restaurant.food_type = 'american' AND restaurant.id = location.restaurant_id AND restaurant.rating = (SELECT MAX(RESTAURANTalias1.rating) FROM geog...
restaurants
CREATE TABLE table_43005 ( "Result" text, "Date" text, "Race" text, "Venue" text, "Group" text, "Distance" text, "Weight (kg)" real, "Time" text, "Jockey" text, "Winner/2nd" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name The...
SELECT "Result" FROM table_43005 WHERE "Distance" = '1200m' AND "Weight (kg)" = '55.5'
wikisql
CREATE TABLE table_27753492_2 ( womens_doubles VARCHAR, tour VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the womens doubles on the tour french super series?
SELECT womens_doubles FROM table_27753492_2 WHERE tour = "French Super Series"
sql_create_context
CREATE TABLE table_18097 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many times was the incumbent mike capuano
SELECT COUNT("Result") FROM table_18097 WHERE "Incumbent" = 'Mike Capuano'
wikisql
CREATE TABLE table_58519 ( "Race Title" text, "Circuit" text, "City / State" text, "Date" text, "Winner" text, "Team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What date is the circuit at wanneroo park?
SELECT "Date" FROM table_58519 WHERE "Circuit" = 'wanneroo park'
wikisql
CREATE TABLE table_name_72 ( right_ascension___j2000__ VARCHAR, ngc_number VARCHAR, declination___j2000__ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- I want to know the right ascension which has an NGC less than 6575 and declination of 38 00
SELECT right_ascension___j2000__ FROM table_name_72 WHERE ngc_number < 6575 AND declination___j2000__ = "°38′00″"
sql_create_context
CREATE TABLE table_name_34 ( closed INTEGER, capacity VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tell me the lowest closed for capacity of 62,439
SELECT MIN(closed) FROM table_name_34 WHERE capacity = 62 OFFSET 439
sql_create_context
CREATE TABLE table_21269143_1 ( date VARCHAR, round VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the total number of date for round 26
SELECT COUNT(date) FROM table_21269143_1 WHERE round = "26"
sql_create_context
CREATE TABLE aircraft ( Aircraft_ID int, Order_Year int, Manufacturer text, Model text, Fleet_Series text, Powertrain text, Fuel_Propulsion text ) CREATE TABLE pilot ( Pilot_ID int, Pilot_name text, Rank int, Age int, Nationality text, Position text, Join_Year in...
SELECT Position, COUNT(Position) FROM pilot GROUP BY Position ORDER BY Position DESC
nvbench
CREATE TABLE Lots ( lot_id INTEGER, investor_id INTEGER, lot_details VARCHAR(255) ) CREATE TABLE Ref_Transaction_Types ( transaction_type_code VARCHAR(10), transaction_type_description VARCHAR(80) ) CREATE TABLE Transactions_Lots ( transaction_id INTEGER, lot_id INTEGER ) CREATE TABLE Inv...
SELECT Investor_details, COUNT(Investor_details) FROM Investors GROUP BY Investor_details
nvbench
CREATE TABLE table_name_88 ( rank VARCHAR, goals VARCHAR, seasons VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the rank number with 562-506 goals before season 13?
SELECT COUNT(rank) FROM table_name_88 WHERE goals = "562-506" AND seasons < 13
sql_create_context
CREATE TABLE ref_colors ( color_code text, color_description text ) CREATE TABLE product_characteristics ( product_id number, characteristic_id number, product_characteristic_value text ) CREATE TABLE ref_product_categories ( product_category_code text, product_category_description text, ...
SELECT t2.unit_of_measure, t2.product_category_code FROM products AS t1 JOIN ref_product_categories AS t2 ON t1.product_category_code = t2.product_category_code WHERE t1.product_name = "chervil"
spider
CREATE TABLE t_kc24 ( MED_SAFE_PAY_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, REF_SLT_FLG number, CLINIC_SLT_DATE time, COMP_ID text, PERSON_ID text, FLX_MED_ORG_ID text, INSU_TYPE text, MED_AMOUT number, PER_ACC_PAY number, OVE_PAY numb...
SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_NM = '姜新蕾' AND t_kc22.STA_DATE BETWEEN '2015-04-19' AND '2016-11-01' AND t_kc21.MED_SER_ORG_NO = '5035211' AND t_kc22.MED_INV_ITEM_TYPE = '西药费'
css
CREATE TABLE Supplier_Addresses ( supplier_id INTEGER, address_id INTEGER, date_from DATETIME, date_to DATETIME ) CREATE TABLE Customers ( customer_id INTEGER, payment_method_code VARCHAR(10), customer_code VARCHAR(20), customer_name VARCHAR(80), customer_address VARCHAR(255), c...
SELECT payment_method_code, COUNT(*) FROM Customers GROUP BY payment_method_code ORDER BY payment_method_code DESC
nvbench
CREATE TABLE table_name_96 ( Id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the value in 2009 corresponding to Career Statistics in 2003?
SELECT 2009 FROM table_name_96 WHERE 2003 = "career statistics"
sql_create_context
CREATE TABLE table_name_97 ( remixed_by VARCHAR, year INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who remixed the version after 1999?
SELECT remixed_by FROM table_name_97 WHERE year > 1999
sql_create_context
CREATE TABLE table_40373 ( "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. -- When there was a tie of 16 what was the attendance?
SELECT "Attendance" FROM table_40373 WHERE "Tie no" = '16'
wikisql
CREATE TABLE table_42214 ( "Place (Posici\u00f3n)" real, "Team (Equipo)" text, "Played (PJ)" real, "Won (PG)" real, "Draw (PE)" real, "Lost (PP)" real, "Goals Scored (GF)" real, "Goals Conceded (GC)" real, "+/- (Dif.)" real, "Points (Pts.)" real ) -- Using valid SQLite, answer ...
SELECT COUNT("Place (Posici\u00f3n)") FROM table_42214 WHERE "Draw (PE)" > '2' AND "Team (Equipo)" = 'paraíso' AND "Won (PG)" > '6'
wikisql
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.diagnosis = "PITUITARY BLEED" AND prescriptions.route = "OU"
mimicsql_data
CREATE TABLE table_name_74 ( total_matches INTEGER, points__percentage VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Total matches is the highest one that has Points % of 70%?
SELECT MAX(total_matches) FROM table_name_74 WHERE points__percentage = "70%"
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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_location = "TRSF WITHIN THIS FACILITY" AND prescriptions.drug = "Doxercalciferol"
mimicsql_data
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 jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM hz_info JOIN txmzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX AND txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGD...
css
CREATE TABLE Financial_Transactions ( transaction_id INTEGER, previous_transaction_id INTEGER, account_id INTEGER, card_id INTEGER, transaction_type VARCHAR(15), transaction_date DATETIME, transaction_amount DOUBLE, transaction_comment VARCHAR(255), other_transaction_details VARCHAR(...
SELECT customer_id, COUNT(*) FROM Accounts GROUP BY customer_id
nvbench
CREATE TABLE table_25183 ( "Romanised name" text, "Chinese name" text, "age at appointment" real, "Portfolio" text, "Prior occupation" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How old was the official with Chinese name ?
SELECT "age at appointment" FROM table_25183 WHERE "Chinese name" = '孫明揚'
wikisql
CREATE TABLE table_name_45 ( player VARCHAR, place VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who placed t5 and had a score of 70-72=142?
SELECT player FROM table_name_45 WHERE place = "t5" AND score = 70 - 72 = 142
sql_create_context
CREATE TABLE table_14850 ( "Name" text, "Code" text, "Capacity" text, "Power" text, "Acceleration 0\u2013100km/h" text, "Top speed" text, "Combined consumption" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the power when the name i...
SELECT "Power" FROM table_14850 WHERE "Name" = '1.2 16v lpg'
wikisql
CREATE TABLE table_47583 ( "Game" real, "Date" text, "Opponent" text, "Score" text, "Location/Attendance" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Game 71 was played against what team?
SELECT "Opponent" FROM table_47583 WHERE "Game" = '71'
wikisql
CREATE TABLE airports ( country VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many airports are there per country? Order the countries by decreasing number of airports.
SELECT COUNT(*), country FROM airports GROUP BY country ORDER BY COUNT(*) DESC
sql_create_context
CREATE TABLE table_57234 ( "Place" real, "Name" text, "From" real, "Until" real, "Titles" real, "Seconds" text, "Thirds" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is place number of Frank Kleber who started in 2001?
SELECT COUNT("Place") FROM table_57234 WHERE "Name" = 'frank kleber' AND "From" < '2001'
wikisql
CREATE TABLE table_204_395 ( id number, "year" number, "competition" text, "venue" text, "position" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the number of titles ken harden has one
SELECT COUNT(*) FROM table_204_395
squall
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 WHERE demographic.gender = "M" AND demographic.insurance = "Medicaid"
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 Team_ID, ACC_Percent FROM basketball_match GROUP BY All_Games
nvbench
CREATE TABLE table_35674 ( "Rank" real, "Name" text, "Nationality" text, "1st (m)" real, "Points" real, "Overall WC points (Rank)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the name of a Rank 3 with a 1st (m) smaller than 199.5?
SELECT "Name" FROM table_35674 WHERE "1st (m)" < '199.5' AND "Rank" = '3'
wikisql
CREATE TABLE table_name_64 ( date VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On what Date was the match with a Score of 6-2, 6-4?
SELECT date FROM table_name_64 WHERE score = "6-2, 6-4"
sql_create_context
CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABL...
SELECT MAX(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.hadm_id IN (SELECT procedures_icd.hadm_id FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'cardiac mapping')) AND DATETIME(cost.chargetime, 'start o...
mimic_iii
CREATE TABLE table_74347 ( "Pick #" real, "Player" text, "Position" text, "Nationality" text, "NHL team" text, "College/junior/club team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many draft picks is player byron dafoe?
SELECT COUNT("Pick #") FROM table_74347 WHERE "Player" = 'Byron Dafoe'
wikisql
CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, ...
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 = 19412) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime LIMIT 1) AND chartevents.item...
mimic_iii
CREATE TABLE table_27293285_6 ( points_for VARCHAR, won VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many points for were scored by the team that won exactly 22?
SELECT points_for FROM table_27293285_6 WHERE won = "22"
sql_create_context
CREATE TABLE representative ( Party VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What parties have at least three representatives?
SELECT Party FROM representative GROUP BY Party HAVING COUNT(*) >= 3
sql_create_context
CREATE TABLE table_41849 ( "City" text, "Country" text, "IATA" text, "ICAO" text, "Airport" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which country has an IATA of gzt?
SELECT "Country" FROM table_41849 WHERE "IATA" = 'gzt'
wikisql
CREATE TABLE table_45114 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Round" real, "Time" text, "Location" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the method when the time was 5:00, and the round higher than ...
SELECT "Method" FROM table_45114 WHERE "Time" = '5:00' AND "Round" > '4'
wikisql
CREATE TABLE table_26913 ( "Pick #" real, "CFL Team" text, "Player" text, "Position" text, "School" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where was the player from se missouri state drafted?
SELECT COUNT("Pick #") FROM table_26913 WHERE "School" = 'SE Missouri State'
wikisql
CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) CREATE TABLE airport ( airport_code varchar, ...
SELECT DISTINCT flight.flight_id FROM airport, airport_service, city, flight WHERE airport.airport_code = 'DAL' AND city.city_code = airport_service.city_code AND flight.from_airport = airport_service.airport_code AND flight.to_airport = airport.airport_code
atis
CREATE TABLE table_name_89 ( catalog VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the catalog number of the May 27, 2009 release?
SELECT catalog FROM table_name_89 WHERE date = "may 27, 2009"
sql_create_context
CREATE TABLE table_name_93 ( country VARCHAR, money___$__ VARCHAR, place VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Country has a Money ($) of 0, and a Place of t10?
SELECT country FROM table_name_93 WHERE money___$__ = 0 AND place = "t10"
sql_create_context
CREATE TABLE t_kc21 ( MED_CLINIC_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, COMP_ID text, PERSON_ID text, PERSON_NM text, IDENTITY_CARD text, SOC_SRT_CARD text, PERSON_SEX number, PERSON_AGE number, IN_HOSP_DATE time, OUT_HOSP_DATE time, DIFF_PLACE_FLG numb...
SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_ID = '94188667' AND t_kc22.STA_DATE BETWEEN '2004-06-14' AND '2019-06-29' AND t_kc22.SOC_SRT_DIRE_NM = '谷维素片'
css
CREATE TABLE products ( product_category_code VARCHAR, typical_buying_price VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Find the number of products with category 'Spices' and typically sold above 1000.
SELECT COUNT(*) FROM products WHERE product_category_code = "Spices" AND typical_buying_price > 1000
sql_create_context
CREATE TABLE zyb ( CLINIC_ID text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, INSU_TYPE text, IN...
SELECT COUNT(*) FROM zyb WHERE zyb.PERSON_SEX = '朱韵诗' AND zyb.IN_HOSP_DAYS BETWEEN '2014-06-05' AND '2018-07-01'
css
CREATE TABLE injury_accident ( game_id int, id int, Player text, Injury text, Number_of_matches text, Source text ) CREATE TABLE game ( stadium_id int, id int, Season int, Date text, Home_team text, Away_team text, Score text, Competition text ) CREATE TABLE sta...
SELECT Away_team, COUNT(Away_team) FROM game GROUP BY Away_team ORDER BY COUNT(Away_team) DESC
nvbench
CREATE TABLE table_73735 ( "Pick #" real, "NFL Team" text, "Player" text, "Position" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest pick number the los angeles raiders got?
SELECT MAX("Pick #") FROM table_73735 WHERE "NFL Team" = 'Los Angeles Raiders'
wikisql
CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId num...
SELECT u.DisplayName, u.Reputation, COUNT(*) AS JavaQuestions FROM Users AS u, Posts AS p WHERE u.Id IN (SELECT Id FROM Users WHERE Location LIKE ('%Finland')) AND p.OwnerUserId = u.Id AND p.Tags LIKE ('%<java>%') GROUP BY u.DisplayName, u.Reputation ORDER BY JavaQuestions DESC
sede
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.dob_year < "2109" AND procedures.long_title = "Coronary arteriography using two catheters"
mimicsql_data
CREATE TABLE table_17120964_8 ( attendance INTEGER, man_of_the_match VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the attendance at the game where Neil Liddiard was Man of the Match?
SELECT MIN(attendance) FROM table_17120964_8 WHERE man_of_the_match = "Neil Liddiard"
sql_create_context