instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
SELECT MIN(demographic.age) FROM demographic WHERE demographic.days_stay = "20" AND demographic.dod_year < "2164.0"
mimicsql_data
CREATE TABLE table_19708 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Record" text, "Game Site" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total number of values for attendance for the date ...
SELECT COUNT("Attendance") FROM table_19708 WHERE "Date" = 'October 1, 1978'
wikisql
CREATE TABLE table_name_64 ( attendance VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was November 4, 1973 attendance?
SELECT attendance FROM table_name_64 WHERE date = "november 4, 1973"
sql_create_context
CREATE TABLE Theme_Parks ( Theme_Park_ID INTEGER, Theme_Park_Details VARCHAR(255) ) CREATE TABLE Features ( Feature_ID INTEGER, Feature_Details VARCHAR(255) ) CREATE TABLE Ref_Hotel_Star_Ratings ( star_rating_code CHAR(15), star_rating_description VARCHAR(80) ) CREATE TABLE Tourist_Attraction...
SELECT Name, COUNT(*) FROM Tourist_Attractions AS T1 JOIN Visits AS T2 ON T1.Tourist_Attraction_ID = T2.Tourist_Attraction_ID GROUP BY T2.Tourist_Attraction_ID ORDER BY Name
nvbench
CREATE TABLE table_name_47 ( tournament VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the 1999 Tournament at the US Open?
SELECT 1999 FROM table_name_47 WHERE tournament = "us open"
sql_create_context
CREATE TABLE party ( minister VARCHAR, party_name VARCHAR, took_office VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Show all ministers and parties they belong to in descending order of the time they took office.
SELECT minister, party_name FROM party ORDER BY took_office DESC
sql_create_context
CREATE TABLE table_name_22 ( gloss VARCHAR, virtue VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Diligence Virtues Gloss?
SELECT gloss FROM table_name_22 WHERE virtue = "diligence"
sql_create_context
CREATE TABLE table_1213511_7 ( nhl_team VARCHAR, college_junior_club_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which nhl team has a college/junior/club team named university of notre dame (ncaa)
SELECT nhl_team FROM table_1213511_7 WHERE college_junior_club_team = "University of Notre Dame (NCAA)"
sql_create_context
CREATE TABLE t_kc22 ( MED_EXP_DET_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, MED_EXP_BILL_ID text, SOC_SRT_DIRE_CD text, SOC_SRT_DIRE_NM text, DIRE_TYPE number, CHA_ITEM_LEV number, MED_INV_ITEM_TYPE text, MED_DIRE_CD text, MED_DIRE_NM text,...
SELECT PRESCRIPTION_CODE, PRESCRIPTION_ID FROM t_kc22 WHERE MED_EXP_DET_ID = '36901690999'
css
CREATE TABLE table_60972 ( "Opposing Teams" text, "Against" real, "Date" text, "Venue" text, "Status" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where did Wales play?
SELECT "Venue" FROM table_60972 WHERE "Opposing Teams" = 'wales'
wikisql
CREATE TABLE table_name_66 ( pick__number VARCHAR, position VARCHAR, round VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the total number of picks for a guard with fewer than 6 rounds?
SELECT COUNT(pick__number) FROM table_name_66 WHERE position = "guard" AND round < 6
sql_create_context
CREATE TABLE table_name_31 ( gold INTEGER, total VARCHAR, nation VARCHAR, rank VARCHAR, silver VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the least number of Gold for a Rank smaller than 5, and 1 silver medal for Poland with more than...
SELECT MIN(gold) FROM table_name_31 WHERE rank < 5 AND silver = 1 AND nation = "poland" AND total > 1
sql_create_context
CREATE TABLE table_204_706 ( id number, "year" number, "competition" text, "venue" text, "position" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how long was huang le 's longest jump in 2002 ?
SELECT "notes" FROM table_204_706 WHERE "year" = 2002 ORDER BY "notes" DESC LIMIT 1
squall
CREATE TABLE voting_record ( stuid number, registration_date text, election_cycle text, president_vote number, vice_president_vote number, secretary_vote number, treasurer_vote number, class_president_vote number, class_senator_vote number ) CREATE TABLE student ( stuid number, ...
SELECT COUNT(*) FROM voting_record
spider
CREATE TABLE table_name_97 ( runner_s__up VARCHAR, tournament VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who were the runners-up at the Alfred Dunhill Links Championship?
SELECT runner_s__up FROM table_name_97 WHERE tournament = "alfred dunhill links championship"
sql_create_context
CREATE TABLE table_name_52 ( top_10 VARCHAR, tournament VARCHAR, events VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total for a top-10 in a masters tournament in an event smaller than 4?
SELECT COUNT(top_10) FROM table_name_52 WHERE tournament = "masters tournament" AND events < 4
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 MED_CLINIC_ID FROM t_kc21 WHERE PERSON_NM = '卫博裕' AND NOT MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc22 WHERE AMOUNT > 8489.49)
css
CREATE TABLE table_47576 ( "Year (Ceremony)" text, "Film title used in nomination" text, "Original title" text, "Primary Language(s)" text, "Director" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Director, when Primary L...
SELECT "Director" FROM table_47576 WHERE "Primary Language(s)" = 'azerbaijani' AND "Original title" = 'buta'
wikisql
CREATE TABLE table_42714 ( "State" text, "Type" text, "Name" text, "Title" text, "Royal house" text, "From" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the title for YI?
SELECT "Title" FROM table_42714 WHERE "Name" = 'yi'
wikisql
CREATE TABLE table_21782 ( "Level" real, "Shuttles" real, "Cumulative Shuttles" real, "Speed (km/h)" text, "Shuttle Time (seconds)" text, "Total level time (s)" text, "Distance (m)" real, "Cumulative Distance (m)" real, "Cumulative Time (min and seconds)" text ) -- Using valid SQLi...
SELECT "Shuttle Time (seconds)" FROM table_21782 WHERE "Speed (km/h)" = '15.5'
wikisql
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 qtb.MED_CLINIC_ID FROM qtb WHERE qtb.PERSON_NM = '戚阳曜' AND qtb.MED_SER_ORG_NO = '8055901' AND NOT qtb.IN_DIAG_DIS_NM LIKE '%胃溃疡%' UNION SELECT gyb.MED_CLINIC_ID FROM gyb WHERE gyb.PERSON_NM = '戚阳曜' AND gyb.MED_SER_ORG_NO = '8055901' AND NOT gyb.IN_DIAG_DIS_NM LIKE '%胃溃疡%' UNION SELECT zyb.MED_CLINIC_ID FROM zyb ...
css
CREATE TABLE table_201_25 ( id number, "party" text, "leader" text, "from" text, "to" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which party has had the most group leaders ?
SELECT "party" FROM table_201_25 GROUP BY "party" ORDER BY COUNT("leader") DESC LIMIT 1
squall
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsysto...
SELECT t1.drugname FROM (SELECT medication.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age BETWEEN 40 AND 49) AND DATETIME(medication.drugstarttime) <= DATETIME(CURRENT_TIME(), '-3 year') GR...
eicu
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, last_wardid number...
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', transfers.intime)) FROM transfers WHERE transfers.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 31854 AND admissions.dischtime IS NULL) AND transfers.careunit = 'ccu' ORDER BY transfers.intime DESC LIMIT 1
mimic_iii
CREATE TABLE table_61706 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In what place did Tom Lehman finish?
SELECT "Place" FROM table_61706 WHERE "Player" = 'tom lehman'
wikisql
CREATE TABLE betfront ( year number, datetime time, country text, competion text, match text, home_opening number, draw_opening number, away_opening number, home_closing number, draw_closing number, away_closing number ) CREATE TABLE football_data ( season text, date...
SELECT MAX(b365a) FROM football_data
worldsoccerdatabase
CREATE TABLE table_9013 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High assists" text, "Location Attendance" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is High Assists, when Team i...
SELECT "High assists" FROM table_9013 WHERE "Team" = 'oklahoma city'
wikisql
CREATE TABLE table_1480455_1 ( human_development_index__2000_ VARCHAR, inegi_code VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the human development index for the year 2000 where the ingei code is 10?
SELECT human_development_index__2000_ FROM table_1480455_1 WHERE inegi_code = 10
sql_create_context
CREATE TABLE table_38082 ( "Rank" real, "Club" text, "Seasons" real, "Played" real, "Drew" real, "Lost" real, "Points" real, "Avg. Points" real, "Goals for" real, "Goals against" real, "Goal diff" real ) -- Using valid SQLite, answer the following questions for the tables p...
SELECT MAX("Rank") FROM table_38082 WHERE "Lost" < '12' AND "Played" > '20' AND "Avg. Points" > '1.73'
wikisql
CREATE TABLE table_name_37 ( top_10 INTEGER, wins INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average Top-10, when Wins is less than 0?
SELECT AVG(top_10) FROM table_name_37 WHERE wins < 0
sql_create_context
CREATE TABLE table_4865 ( "Date" text, "Result" text, "Score" text, "Stadium" text, "City" text, "Crowd" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What stadium is in penrith?
SELECT "Stadium" FROM table_4865 WHERE "City" = 'penrith'
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 demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.short_title = "Benign neo skin face NEC" AND lab.flag = "delta"
mimicsql_data
CREATE TABLE table_name_88 ( name VARCHAR, nationality VARCHAR, lane VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who has less than 3 lanes for France?
SELECT name FROM table_name_88 WHERE nationality = "france" AND lane < 3
sql_create_context
CREATE TABLE table_204_750 ( id number, "team" text, "stadium" text, "capacity" number, "seated" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which other team 's stadium has the same capacity as didcot town 's stadium ?
SELECT "stadium" FROM table_204_750 WHERE "team" <> 'didcot town' AND "capacity" = (SELECT "capacity" FROM table_204_750 WHERE "team" = 'didcot town')
squall
CREATE TABLE table_25851971_1 ( directed_by VARCHAR, production_code VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who directed the episode that had a production code of 2j5457?
SELECT directed_by FROM table_25851971_1 WHERE production_code = "2J5457"
sql_create_context
CREATE TABLE table_80209 ( "Year" real, "Entrant" text, "Chassis" text, "Engine" text, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which engine did dr ing f porsche kg use with the porsche rsk (f2) chassis?
SELECT "Engine" FROM table_80209 WHERE "Entrant" = 'dr ing f porsche kg' AND "Chassis" = 'porsche rsk (f2)'
wikisql
CREATE TABLE table_name_51 ( score INTEGER, player VARCHAR, country VARCHAR, to_par VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was Adam Scott's total score when playing in Australia with a to par of e?
SELECT SUM(score) FROM table_name_51 WHERE country = "australia" AND to_par = "e" AND player = "adam scott"
sql_create_context
CREATE TABLE table_57824 ( "Name" text, "Country" text, "Status" text, "Moving to" text, "Transfer window" text, "Transfer fee" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the transfer period for habarugira?
SELECT "Transfer window" FROM table_57824 WHERE "Name" = 'habarugira'
wikisql
CREATE TABLE category ( id int, business_id varchar, category_name varchar ) CREATE TABLE review ( rid int, business_id varchar, user_id varchar, rating float, text longtext, year int, month varchar ) CREATE TABLE business ( bid int, business_id varchar, name varcha...
SELECT COUNT(DISTINCT (user.name)) FROM business, review, user WHERE business.city = 'Pittsburgh' AND business.name = 'Sushi Too' AND review.business_id = business.business_id AND user.user_id = review.user_id
yelp
CREATE TABLE table_64360 ( "Pick" real, "Team" text, "Player" text, "Position" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What college has a pick smaller than 87 for the position of tackle?
SELECT "College" FROM table_64360 WHERE "Position" = 'tackle' AND "Pick" < '87'
wikisql
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 lab.flag = "abnormal" AND lab.label = "RBC, Joint Fluid"
mimicsql_data
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospit...
SELECT (SELECT vitalperiodic.systemicdiastolic FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '033-22108') AND patient.unitdischargetime...
eicu
CREATE TABLE table_name_51 ( part_4 VARCHAR, part_2 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Part 4, when Part 2 is 'batt'?
SELECT part_4 FROM table_name_51 WHERE part_2 = "batt"
sql_create_context
CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, Rejectio...
SELECT PATINDEX('%//stackoverflow.com/%', Text), RIGHT(Text, LENGTH(Text) - PATINDEX('%//stackoverflow.com/%', Text) + 1), CASE WHEN NULLIF(STR_POSITION(RIGHT(Text, LENGTH(Text) - PATINDEX('%//stackoverflow.com/%', Text) + 1), ' '), 0) < NULLIF(STR_POSITION(RIGHT(Text, LENGTH(Text) - PATINDEX('%//stackoverflow.com/%', ...
sede
CREATE TABLE zyjybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH number, 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, ...
SELECT jyjgzbb.JCZBMC, jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM zyjybgb JOIN jyjgzbb ON zyjybgb.YLJGDM = jyjgzbb.YLJGDM AND zyjybgb.BGDH = jyjgzbb.BGDH WHERE zyjybgb.JZLSH = '37659837066' AND jyjgzbb.JCRXM LIKE '沈%' UNION SELECT jyjgzbb.JCZBMC, jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM mzjybgb JOIN jyjgzbb ON mzjybgb.YLJG...
css
CREATE TABLE table_name_28 ( source_language VARCHAR, meaning VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What language did the word that means mahjong first come from?
SELECT source_language FROM table_name_28 WHERE meaning = "mahjong"
sql_create_context
CREATE TABLE table_name_19 ( party VARCHAR, net_gain_loss VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which party has a net gain/loss of -2?
SELECT party FROM table_name_19 WHERE net_gain_loss = "-2"
sql_create_context
CREATE TABLE table_68255 ( "Player" text, "Country" text, "Year(s) won" text, "Total" real, "To par" text, "Finish" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the average total for years won of 1975
SELECT AVG("Total") FROM table_68255 WHERE "Year(s) won" = '1975'
wikisql
CREATE TABLE txmzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH number, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZ...
SELECT txmzjzjlb.JZZTDM, txmzjzjlb.JZZTMC FROM txmzjzjlb WHERE txmzjzjlb.JZLSH = '48598074227' UNION SELECT ftxmzjzjlb.JZZTDM, ftxmzjzjlb.JZZTMC FROM ftxmzjzjlb WHERE ftxmzjzjlb.JZLSH = '48598074227'
css
CREATE TABLE table_name_86 ( silver VARCHAR, notes VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Silver, when Notes is '6.24km, 23controls'?
SELECT silver FROM table_name_86 WHERE notes = "6.24km, 23controls"
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, T1.Manufacturer 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_65777 ( "Rank" real, "Gold" real, "Silver" real, "Bronze" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How much Silver has a Bronze larger than 1, and a Gold of 0, and a Rank smaller than 4?
SELECT COUNT("Silver") FROM table_65777 WHERE "Bronze" > '1' AND "Gold" = '0' AND "Rank" < '4'
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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.dod_year <= "2164.0" AND diagnoses.icd9_code = "99592"
mimicsql_data
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 MAX(demographic.age) FROM demographic WHERE demographic.gender = "M" AND demographic.days_stay = "69"
mimicsql_data
CREATE TABLE table_42830 ( "Spoofed Title" text, "Actual Title" text, "Writer" text, "Artist" text, "Issue" real, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name of the Artist for the Spoofed Title of the moron downer jr. ...
SELECT "Artist" FROM table_42830 WHERE "Spoofed Title" = 'the moron downer jr. show'
wikisql
CREATE TABLE table_name_49 ( location VARCHAR, event VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the location of the match with an event of ecc 8: comeback?
SELECT location FROM table_name_49 WHERE event = "ecc 8: comeback"
sql_create_context
CREATE TABLE table_name_56 ( spectators INTEGER, date VARCHAR, time_cet_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tell me the average spectators for 2006-06-21 and time more than 21
SELECT AVG(spectators) FROM table_name_56 WHERE date = "2006-06-21" AND time_cet_ > 21
sql_create_context
CREATE TABLE table_43086 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many laps were there for a grid of 13?
SELECT COUNT("Laps") FROM table_43086 WHERE "Grid" = '13'
wikisql
CREATE TABLE table_11647327_2 ( married_filing_separately VARCHAR, head_of_household VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is ithe range for married filing separately where head of household is $117,451 $190,200?
SELECT married_filing_separately FROM table_11647327_2 WHERE head_of_household = "$117,451–$190,200"
sql_create_context
CREATE TABLE table_name_93 ( university_of_dublin INTEGER, administrative_panel VARCHAR, cultural_and_educational_panel VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest number for the University of Dublin, having and administrative panel...
SELECT MIN(university_of_dublin) FROM table_name_93 WHERE administrative_panel = 3 AND cultural_and_educational_panel < 2
sql_create_context
CREATE TABLE table_24173 ( "Series #" real, "Season #" real, "Title" text, "Director" text, "Writer(s)" text, "Original Airdate" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the title when the writer(s) is jack turley?
SELECT "Title" FROM table_24173 WHERE "Writer(s)" = 'Jack Turley'
wikisql
CREATE TABLE table_name_82 ( team VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Team has a Score of 108-107?
SELECT team FROM table_name_82 WHERE score = "108-107"
sql_create_context
CREATE TABLE station ( id int, network_name text, services text, local_authority text ) CREATE TABLE train ( id int, train_number int, name text, origin text, destination text, time text, interval text ) CREATE TABLE route ( train_id int, station_id int ) CREATE TA...
SELECT services, COUNT(services) FROM station GROUP BY services ORDER BY COUNT(services)
nvbench
CREATE TABLE table_1664 ( "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. -- What wa...
SELECT "Record" FROM table_1664 WHERE "Team" = 'Boston'
wikisql
CREATE TABLE table_32341 ( "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. -- On what date did Collingwood play at home?
SELECT "Date" FROM table_32341 WHERE "Home team" = 'collingwood'
wikisql
CREATE TABLE table_name_91 ( class VARCHAR, verb_meaning VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which class has the verb meaning of to run?
SELECT class FROM table_name_91 WHERE verb_meaning = "to run"
sql_create_context
CREATE TABLE has_allergy ( stuid number, allergy text ) CREATE TABLE student ( stuid number, lname text, fname text, age number, sex text, major number, advisor number, city_code text ) CREATE TABLE allergy_type ( allergy text, allergytype text ) -- Using valid SQLite...
SELECT AVG(age) FROM student WHERE stuid IN (SELECT T1.stuid FROM has_allergy AS T1 JOIN allergy_type AS T2 ON T1.allergy = T2.allergy WHERE T2.allergytype = "food" INTERSECT SELECT T1.stuid FROM has_allergy AS T1 JOIN allergy_type AS T2 ON T1.allergy = T2.allergy WHERE T2.allergytype = "animal")
spider
CREATE TABLE table_8760 ( "Player" text, "Nationality" text, "Jersey Number(s)" text, "Position" text, "Years" text, "From" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is From, when Nationality is United States, and when Jersey Number (s...
SELECT "From" FROM table_8760 WHERE "Nationality" = 'united states' AND "Jersey Number(s)" = '2'
wikisql
CREATE TABLE table_3168 ( "Week" real, "Date" text, "Kickoff" text, "Opponent" text, "Final score" text, "Team record" text, "Game site" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who are the opponents for games on...
SELECT "Opponent" FROM table_3168 WHERE "Date" = 'Sunday, June 9'
wikisql
CREATE TABLE table_name_21 ( outcome VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Outcome of the match on 12 september 2004?
SELECT outcome FROM table_name_21 WHERE date = "12 september 2004"
sql_create_context
CREATE TABLE table_38661 ( "District" text, "Incumbent" text, "Party" text, "Elected" real, "Status" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which party has the 6th district?
SELECT "Party" FROM table_38661 WHERE "District" = '6th'
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 procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.icd9_code = "6826"
mimicsql_data
CREATE TABLE hz_info_mzjzjlb ( JZLSH number, YLJGDM number, mzjzjlb_id number ) CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC text, RYBH text, XBDM number, XBMC text, XLDM text, XLMC text, ...
SELECT * FROM person_info JOIN hz_info JOIN zyjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE person_info.XM = '水兴平' AND hz_info.YLJGDM = '5237390' AND NOT zyjzjlb.JZKSMC LIKE '%免疫%'
css
CREATE TABLE table_56663 ( "Driver" text, "Constructor" text, "Laps" text, "Time/Retired" text, "Grid" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the value of time/retired for Jean Alesi?
SELECT "Time/Retired" FROM table_56663 WHERE "Driver" = 'jean alesi'
wikisql
CREATE TABLE table_25380472_2 ( date VARCHAR, final_score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On what dates was the final score of the game L 14 24?
SELECT date FROM table_25380472_2 WHERE final_score = "L 14–24"
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 demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_location = "TRANSFER FROM HOSP/EXTRAM" AND procedures.long_title = "Endoscopic excision or destruction of lesion or tissue of esophagus"
mimicsql_data
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE d_icd_diagnoses ( row_id number...
SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t1.icd9_code FROM (SELECT procedures_icd.icd9_code, COUNT(procedures_icd.charttime) AS c1 FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 318...
mimic_iii
CREATE TABLE table_name_71 ( date VARCHAR, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What date was the record 38-22?
SELECT date FROM table_name_71 WHERE record = "38-22"
sql_create_context
CREATE TABLE table_name_54 ( laps INTEGER, rider VARCHAR, grid VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Laps have a Rider of russell holland, and a Grid smaller than 10?
SELECT MAX(laps) FROM table_name_54 WHERE rider = "russell holland" AND grid < 10
sql_create_context
CREATE TABLE t_kc21_t_kc22 ( MED_CLINIC_ID text, MED_EXP_DET_ID number ) 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, H...
SELECT t_kc21.IN_DIAG_DIS_CD, t_kc21.IN_DIAG_DIS_NM FROM t_kc21 WHERE t_kc21.PERSON_NM = '冯沛文' AND t_kc21.IN_HOSP_DATE BETWEEN '2006-01-04' AND '2010-07-16' GROUP BY t_kc21.IN_DIAG_DIS_CD ORDER BY COUNT(*) DESC LIMIT 1
css
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 procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime t...
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 = 16066)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial ...
mimic_iii
CREATE TABLE party_host ( Party_ID int, Host_ID int, Is_Main_in_Charge bool ) CREATE TABLE host ( Host_ID int, Name text, Nationality text, Age text ) CREATE TABLE party ( Party_ID int, Party_Theme text, Location text, First_year text, Last_year text, Number_of_host...
SELECT Nationality, COUNT(*) FROM host GROUP BY Nationality
nvbench
CREATE TABLE jybgb ( YLJGDM text, YLJGDM_MZJZJLB text, YLJGDM_ZYJZJLB text, BGDH text, BGRQ time, JYLX number, JZLSH text, JZLSH_MZJZJLB text, JZLSH_ZYJZJLB text, JZLX number, KSBM text, KSMC text, SQRGH text, SQRXM text, BGRGH text, BGRXM text, SHRGH ...
SELECT SHRGH, SHRXM FROM jybgb WHERE JZLSH = '04812473443'
css
CREATE TABLE table_name_99 ( wins INTEGER, against VARCHAR, byes VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the most wins with byes more than 0 and 1637 against?
SELECT MAX(wins) FROM table_name_99 WHERE against = 1637 AND byes > 0
sql_create_context
CREATE TABLE table_204_849 ( id number, "rank" number, "name" text, "nationality" text, "time" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what was the nationality of the first ranked competitor ?
SELECT "nationality" FROM table_204_849 WHERE id = 1
squall
CREATE TABLE table_46269 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High assists" text, "Location Attendance" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What record has January 27 for t...
SELECT "Record" FROM table_46269 WHERE "Date" = 'january 27'
wikisql
CREATE TABLE table_27610775_1 ( prod_code INTEGER, directed_by VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the maximum production code of the episode directed by Sean McNamara?
SELECT MAX(prod_code) FROM table_27610775_1 WHERE directed_by = "Sean McNamara"
sql_create_context
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 icustays.icustay_id) FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 89673)
mimic_iii
CREATE TABLE reservations ( code number, room text, checkin text, checkout text, rate number, lastname text, firstname text, adults number, kids number ) CREATE TABLE rooms ( roomid text, roomname text, beds number, bedtype text, maxoccupancy number, basepric...
SELECT roomname, decor FROM rooms WHERE bedtype = 'King' ORDER BY baseprice
spider
CREATE TABLE jybgb ( YLJGDM text, YLJGDM_MZJZJLB text, YLJGDM_ZYJZJLB text, BGDH text, BGRQ time, JYLX number, JZLSH text, JZLSH_MZJZJLB text, JZLSH_ZYJZJLB text, JZLX number, KSBM text, KSMC text, SQRGH text, SQRXM text, BGRGH text, BGRXM text, SHRGH ...
SELECT person_info.JGDM, person_info.JGMC, COUNT(person_info.RYBH) 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 mzjzjlb.JZZDBM = 'T31.744' GROUP BY person_info.JGDM
css
CREATE TABLE table_62427 ( "Player" text, "Country" text, "Year(s) won" text, "Total" real, "To par" text, "Finish" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Player had a To Par of +2?
SELECT "Player" FROM table_62427 WHERE "To par" = '+2'
wikisql
CREATE TABLE table_69477 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Partner" text, "Opponents" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the tournament for may 18, 1997
SELECT "Tournament" FROM table_69477 WHERE "Date" = 'may 18, 1997'
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 procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescription...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "F" AND demographic.age < "64"
mimicsql_data
CREATE TABLE Allergy_Type ( Allergy VARCHAR(20), AllergyType VARCHAR(20) ) 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 Has_Allergy ( StuID INTEGE...
SELECT T1.Allergy, COUNT(T1.Allergy) FROM Allergy_Type AS T1 JOIN Has_Allergy AS T2 ON T1.Allergy = T2.Allergy JOIN Student AS T3 ON T3.StuID = T2.StuID WHERE T3.Fname = "Lisa" GROUP BY T1.Allergy ORDER BY T1.Allergy DESC
nvbench
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, last_wardid number, ...
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', prescriptions.startdate)) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 31482 AND admissions.dischtime IS NULL) AND prescriptions.drug = 'oseltamivir' ORDER BY prescriptions.startdate...
mimic_iii
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 qtb.MED_CLINIC_ID FROM qtb WHERE qtb.PERSON_ID = '56236131' AND qtb.MED_SER_ORG_NO = '6811873' AND NOT qtb.OUT_DIAG_DIS_NM LIKE '%孤独症%' UNION SELECT gyb.MED_CLINIC_ID FROM gyb WHERE gyb.PERSON_ID = '56236131' AND gyb.MED_SER_ORG_NO = '6811873' AND NOT gyb.OUT_DIAG_DIS_NM LIKE '%孤独症%' UNION SELECT zyb.MED_CLINIC_...
css
CREATE TABLE Video_games ( gtype VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many video game types exist?
SELECT COUNT(DISTINCT gtype) FROM Video_games
sql_create_context
CREATE TABLE table_70996 ( "Condition" text, "Prothrombin time" text, "Partial thromboplastin time" text, "Bleeding time" text, "Platelet count" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the condition with partial thromboplastin time of pr...
SELECT "Condition" FROM table_70996 WHERE "Partial thromboplastin time" = 'prolonged or unaffected'
wikisql
CREATE TABLE table_45730 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Partner" text, "Opponents in the final" text, "Score in the final" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Tournament has a Score in the...
SELECT "Tournament" FROM table_45730 WHERE "Score in the final" = '7–5, 6–4'
wikisql
CREATE TABLE table_13789248_2 ( song_title VARCHAR, artist VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many song title with artbeingt being chubby checker
SELECT COUNT(song_title) FROM table_13789248_2 WHERE artist = "Chubby Checker"
sql_create_context