instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_203_283 ( id number, "#" number, "name" text, "strike tone\n(st-1/16)" text, "weight\n(kg)" number, "diameter\n(mm)" number, "inscription" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the name of the bell with th...
SELECT "name" FROM table_203_283 WHERE "weight\n(kg)" = 425
squall
CREATE TABLE table_65439 ( "Position" text, "Drivers" text, "Entrant" text, "Class" text, "Laps" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- The driver in class A with 125 laps is in what position?
SELECT "Position" FROM table_65439 WHERE "Class" = 'a' AND "Laps" = '125'
wikisql
CREATE TABLE table_22014 ( "Club" text, "Played" text, "Won" text, "Drawn" text, "Lost" text, "Points for" text, "Points against" text, "Tries for" text, "Tries against" text, "Try bonus" text, "Losing bonus" text, "Points" text ) -- Using valid SQLite, answer the follo...
SELECT "Lost" FROM table_22014 WHERE "Tries for" = '22'
wikisql
CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId n...
SELECT num.TagName AS Tag, ROW_NUMBER() OVER (ORDER BY rate.Rate DESC) AS YearRank, ROW_NUMBER() OVER (ORDER BY num.Num DESC) AS TotalRank, rate.Rate AS QuestionsIn2013, num.Num AS QuestionsTotal FROM (SELECT COUNT(PostId) AS Rate, TagName FROM Tags, PostTags, Posts WHERE Tags.Id = PostTags.TagId AND Posts.Id = PostId ...
sede
CREATE TABLE table_38632 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the player from Japan's To Par?
SELECT "To par" FROM table_38632 WHERE "Country" = 'japan'
wikisql
CREATE TABLE table_56951 ( "Entrant" text, "Constructor" text, "Chassis" text, "Tyre" text, "Driver" text, "Rounds" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who drove the Marlboro Mclaren Peugeot?
SELECT "Driver" FROM table_56951 WHERE "Entrant" = 'marlboro mclaren peugeot'
wikisql
CREATE TABLE table_name_56 ( west_ham_wins VARCHAR, drawn VARCHAR, millwall_wins VARCHAR, millwall_goals VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many wins did West Ham get when Millwall had more than 23 goal and 5 wins, and they tied 8 tim...
SELECT west_ham_wins FROM table_name_56 WHERE millwall_wins > 5 AND millwall_goals > 23 AND drawn = 8
sql_create_context
CREATE TABLE table_7400 ( "Model number" text, "Frequency" text, "L2 cache" text, "Multi 1" text, "Voltage" text, "Socket" text, "Release date" text, "Order part number" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Multi 1 has a ...
SELECT "Multi 1" FROM table_7400 WHERE "Frequency" = '2300mhz' AND "Release date" = 'q3 2008' AND "Model number" = 'turion x2 ultra zm-84'
wikisql
CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ...
WITH USER_BY_TAG AS (SELECT ROW_NUMBER() OVER (ORDER BY COUNT(*) DESC) AS Rank, u.Id AS "user_link", COUNT(*) AS UpVotes FROM Tags AS t INNER JOIN PostTags AS pt ON pt.TagId = t.Id INNER JOIN Posts AS p ON p.ParentId = pt.PostId INNER JOIN Votes AS v ON v.PostId = p.Id AND VoteTypeId = 2 INNER JOIN Users AS u ON u.Id =...
sede
CREATE TABLE table_name_72 ( crowd INTEGER, away_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many people in the crowd with north melbourne as an away team?
SELECT SUM(crowd) FROM table_name_72 WHERE away_team = "north melbourne"
sql_create_context
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
SELECT prescriptions.icustay_id FROM prescriptions WHERE prescriptions.subject_id = "2560"
mimicsql_data
CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE VoteTypes ( Id number, Name text ) CREATE...
SELECT TagName, AVG(Posts.Score * 1.0) FROM Tags INNER JOIN PostTags ON Tags.Id = PostTags.TagId INNER JOIN Posts ON Posts.Id = PostTags.PostId GROUP BY TagName, Tags.Count ORDER BY 2 DESC
sede
CREATE TABLE aircraft ( aircraft_code varchar, aircraft_description varchar, manufacturer varchar, basic_type varchar, engines int, propulsion varchar, wide_body varchar, wing_span int, length int, weight int, capacity int, pay_load int, cruising_speed int, range_...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'MILWAUKEE' AND date_day.day_number = 26 AND date_day.month_number = 5 AN...
atis
CREATE TABLE table_41901 ( "Ballarat FL" text, "Wins" real, "Byes" real, "Losses" real, "Draws" real, "Against" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the smallest byes when the wins are 3?
SELECT MIN("Byes") FROM table_41901 WHERE "Wins" = '3'
wikisql
CREATE TABLE store ( store_name VARCHAR, store_id VARCHAR ) CREATE TABLE store_district ( store_id VARCHAR, district_id VARCHAR ) CREATE TABLE district ( district_id VARCHAR, district_name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Find...
SELECT t1.store_name FROM store AS t1 JOIN store_district AS t2 ON t1.store_id = t2.store_id JOIN district AS t3 ON t2.district_id = t3.district_id WHERE t3.district_name = "Khanewal District"
sql_create_context
CREATE TABLE flight ( flno number, origin text, destination text, distance number, departure_date time, arrival_date time, price number, aid number ) CREATE TABLE certificate ( eid number, aid number ) CREATE TABLE aircraft ( aid number, name text, distance number )...
SELECT origin FROM flight WHERE destination = "Honolulu"
spider
CREATE TABLE table_name_98 ( release_price___usd__ VARCHAR, part_number_s_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the release price (USD) for part number hh80557pg0491m?
SELECT release_price___usd__ FROM table_name_98 WHERE part_number_s_ = "hh80557pg0491m"
sql_create_context
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 JZLX FROM jybgb WHERE BGDH = '90694892427'
css
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, a...
SELECT MIN(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 = '013-36766')) AND NOT vitalperiodic.systemicd...
eicu
CREATE TABLE table_69503 ( "Year" text, "Start" text, "Qual" text, "Rank" text, "Finish" text, "Laps" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the qual for rank 20?
SELECT "Qual" FROM table_69503 WHERE "Rank" = '20'
wikisql
CREATE TABLE table_name_92 ( game_3 VARCHAR, game_2 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Wjat game 3 has ian french as a game of 2?
SELECT game_3 FROM table_name_92 WHERE game_2 = "ian french"
sql_create_context
CREATE TABLE t_kc21_t_kc24 ( MED_CLINIC_ID text, MED_SAFE_PAY_ID number ) 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...
SELECT MIN(t_kc24.MED_AMOUT), MAX(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc21_t_kc24.MED_CLINIC_ID IN (SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '5713275' AND t_kc21.OUT_DIAG_DIS_CD = 'Y71.248')
css
CREATE TABLE days ( days_code varchar, day_name varchar ) CREATE TABLE fare_basis ( fare_basis_code text, booking_class text, class_type text, premium text, economy text, discounted text, night text, season text, basis_days text ) CREATE TABLE equipment_sequence ( aircr...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE (((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'TACOMA' AND date_day.day_number = 20 AND date_day.month_number = 1 AND ...
atis
CREATE TABLE table_45047 ( "Year" real, "Top Fuel" text, "Funny Car" text, "Pro Stock" text, "Pro Stock Motorcycle" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who won Funny Car when Jim Yates won Pro Stock, in years after 1996?
SELECT "Funny Car" FROM table_45047 WHERE "Pro Stock" = 'jim yates' AND "Year" > '1996'
wikisql
CREATE TABLE table_204_805 ( id number, "name" text, "club" text, "date of departure" text, "replacement" text, "date of appointment" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- next manager of ttm samut sakhon after prajuk viengsong
SELECT "name" FROM table_204_805 WHERE "club" = 'ttm samut sakhon' AND "date of departure" > (SELECT "date of departure" FROM table_204_805 WHERE "name" = 'prajuk viengsong') ORDER BY "date of departure" LIMIT 1
squall
CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE aircraft ( aircraft_code varchar, aircraft_description varchar, manufacturer varchar, basic_type varchar, engines int, propulsion varchar, wide_body varchar, wing_span int, length int,...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'ST. LOUIS' AND flight.departure_time < 1000 AND flight.to_airport = AIRPORT_SERVICE_1.air...
atis
CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate ...
SELECT Posts.OwnerUserId AS UserLink, COUNT(*) AS BountiesWon FROM Votes INNER JOIN Posts ON Votes.PostId = Posts.Id WHERE VoteTypeId = 9 GROUP BY Posts.OwnerUserId ORDER BY BountiesWon DESC LIMIT 50
sede
CREATE TABLE table_name_30 ( loses INTEGER, draws VARCHAR, goals_scored VARCHAR, goals_conceded VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest number of loses of the club with more than 42 goals scored, more than 20 goals conceded,...
SELECT MIN(loses) FROM table_name_30 WHERE goals_scored > 42 AND goals_conceded > 20 AND draws < 3
sql_create_context
CREATE TABLE table_32723 ( "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. -- Who was the home team when the away team had a s...
SELECT "Home team" FROM table_32723 WHERE "Away team score" = '11.18 (84)'
wikisql
CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) CREATE TABLE student_record ( student_id int, course_id int, semester int, grade varchar, how varchar, transfer_source varchar, earn_credit varchar, repeat_term varchar, test...
SELECT DISTINCT COURSE_0.department, COURSE_0.name, COURSE_0.number FROM course AS COURSE_0 INNER JOIN course_prerequisite ON COURSE_0.course_id = course_prerequisite.course_id INNER JOIN course AS COURSE_1 ON COURSE_1.course_id = course_prerequisite.pre_course_id WHERE COURSE_1.department = 'AUTO' AND COURSE_1.number ...
advising
CREATE TABLE table_16636 ( "Rd." real, "Grand Prix" text, "Pole Position" text, "Fastest Lap" text, "Winning Driver" text, "Constructor" text, "Report" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is in the pole position for the French...
SELECT "Pole Position" FROM table_16636 WHERE "Grand Prix" = 'French Grand Prix'
wikisql
CREATE TABLE mzjzjlb ( YLJGDM text, JZLSH text, KH text, KLX number, MJZH text, HZXM text, NLS number, NLY number, ZSEBZ number, JZZTDM number, JZZTMC text, JZJSSJ time, TXBZ number, ZZBZ number, WDBZ number, JZKSBM text, JZKSMC text, JZKSRQ time, ...
(SELECT jybgb.BGDH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE person_info.XM = '郑欣嘉' AND NOT...
css
CREATE TABLE table_45271 ( "Year" real, "Tournaments played" real, "Cuts made" real, "Wins" real, "Best finish" text, "Earnings ( $ )" real, "Money list rank" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the best finish when money ...
SELECT "Best finish" FROM table_45271 WHERE "Money list rank" = 'n/a' AND "Earnings ( $ )" > '0' AND "Cuts made" > '1'
wikisql
CREATE TABLE table_15621965_10 ( player VARCHAR, school_club_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the number of players from arizona
SELECT COUNT(player) FROM table_15621965_10 WHERE school_club_team = "Arizona"
sql_create_context
CREATE TABLE table_15717093_1 ( season__number INTEGER, series__number VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What season number corresponds to series number 102?
SELECT MAX(season__number) FROM table_15717093_1 WHERE series__number = 102
sql_create_context
CREATE TABLE table_24231638_3 ( replaced_by VARCHAR, date_of_appointment VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who replaced on the date of appointment 2 november 2010?
SELECT replaced_by FROM table_24231638_3 WHERE date_of_appointment = "2 November 2010"
sql_create_context
CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location text, insurance text, language text, marital_status text, ethnicity text, age number ) CREATE ...
SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT labevents.itemid FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 18517 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1) ORDER BY labevents.chartti...
mimic_iii
CREATE TABLE table_1342379_20 ( result VARCHAR, candidates VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the result of the election featuring james a. gallivan (d) unopposed?
SELECT result FROM table_1342379_20 WHERE candidates = "James A. Gallivan (D) Unopposed"
sql_create_context
CREATE TABLE table_name_91 ( win__percentage INTEGER, span VARCHAR, lost VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Win % in the Span of 2011 2013 with a Lost of less than 1?
SELECT AVG(win__percentage) FROM table_name_91 WHERE span = "2011–2013" AND lost < 1
sql_create_context
CREATE TABLE table_51812 ( "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. -- What's the total number of rounds with a win result...
SELECT COUNT("Round") FROM table_51812 WHERE "Res." = 'win' AND "Event" = 'sf 5: stadium'
wikisql
CREATE TABLE table_dev_27 ( "id" int, "gender" string, "pregnancy_or_lactation" bool, "hemoglobin_a1c_hba1c" float, "creatinine_clearance_cl" float, "estimated_glomerular_filtration_rate_egfr" int, "serum_creatinine" float, "NOUSE" float ) -- Using valid SQLite, answer the following qu...
SELECT * FROM table_dev_27 WHERE (serum_creatinine >= 1.5 AND gender = 'male') OR (serum_creatinine >= 1.4 AND gender = 'female') OR estimated_glomerular_filtration_rate_egfr < 60
criteria2sql
CREATE TABLE table_26562 ( "DVD Name" text, "Ep #" text, "Region 1 (US)" text, "Region 1 (CAN)" text, "Region 2 (UK)" text, "Region 2 (Germany)" text, "Region 4 (Australia)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the region 1...
SELECT "Region 1 (CAN)" FROM table_26562 WHERE "Region 1 (US)" = 'January 16, 2007'
wikisql
CREATE TABLE table_28623 ( "Year" real, "Under-11" text, "Under-13" text, "Under-15" text, "Under-17" text, "Under-19" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is every Under-15 if Under-11 is Reeham Sedky?
SELECT "Under-15" FROM table_28623 WHERE "Under-11" = 'Reeham Sedky'
wikisql
CREATE TABLE table_12142298_2 ( rightfielder VARCHAR, starting_pitcher VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the RF when the SP was vicente padilla?
SELECT rightfielder FROM table_12142298_2 WHERE starting_pitcher = "Vicente Padilla"
sql_create_context
CREATE TABLE table_name_2 ( class VARCHAR, rank VARCHAR, entrant VARCHAR, points VARCHAR, chassis VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the class when adt champion racing ranked 1st with an audi r8 chassis, and less than 206 poi...
SELECT class FROM table_name_2 WHERE points < 206 AND chassis = "audi r8" AND entrant = "adt champion racing" AND rank = "1st"
sql_create_context
CREATE TABLE table_23346303_5 ( minutes INTEGER, rebounds VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- If the amount of rebounds is 0, what is the maximum minutes?
SELECT MAX(minutes) FROM table_23346303_5 WHERE rebounds = 0
sql_create_context
CREATE TABLE airport_aircraft ( id number, airport_id number, aircraft_id number ) CREATE TABLE pilot ( pilot_id number, name text, age number ) CREATE TABLE match ( round number, location text, country text, date text, fastest_qualifying text, winning_pilot text, w...
SELECT t1.name, t1.age FROM pilot AS t1 JOIN match AS t2 ON t1.pilot_id = t2.winning_pilot ORDER BY t1.age LIMIT 1
spider
CREATE TABLE table_name_32 ( grid INTEGER, driver VARCHAR, laps VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In less than 58 laps, what is the highest grid for Alexander Wurz?
SELECT MAX(grid) FROM table_name_32 WHERE driver = "alexander wurz" AND laps < 58
sql_create_context
CREATE TABLE table_name_51 ( perth VARCHAR, auckland VARCHAR, gold_coast VARCHAR, adelaide VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Perth's gold coast and Adelaide were yes when Auckland was no?
SELECT perth FROM table_name_51 WHERE gold_coast = "yes" AND adelaide = "yes" AND auckland = "no"
sql_create_context
CREATE TABLE table_name_61 ( player VARCHAR, school VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the player that went to st. benedict's prep?
SELECT player FROM table_name_61 WHERE school = "st. benedict's prep"
sql_create_context
CREATE TABLE table_73196 ( "LMS No." real, "WD No." real, "Builder" text, "Serial No." real, "Date built" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the lms number for serial number being 372
SELECT "LMS No." FROM table_73196 WHERE "Serial No." = '372'
wikisql
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 zyjzjlb.JZLSH FROM hz_info JOIN zyjzjlb JOIN hz_info_zyjzjlb ON hz_info.YLJGDM = hz_info_zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX AND hz_info_zyjzjlb.JZLSH = zyjzjlb.JZLSH AND hz_info_zyjzjlb.YLJGDM = hz_info_zyjzjlb.YLJGDM AND hz_info_zyjzjlb.JZLSH = zyjzjlb.JZLSH AND hz_info_zyj...
css
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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.long_title = "Long-term (current) use of insulin"
mimicsql_data
CREATE TABLE table_37450 ( "School" text, "Mascot" text, "Location" text, "Enrollment" real, "IHSAA Class" text, "IHSAA Football Class" text, "County" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the IHSAA class for Crown Point?
SELECT "IHSAA Class" FROM table_37450 WHERE "School" = 'crown point'
wikisql
CREATE TABLE table_64641 ( "Name" text, "Nickname" text, "Location" text, "Home ground(s)" text, "Coach" text, "Captain" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Name has the Captain Aaron Heal?
SELECT "Name" FROM table_64641 WHERE "Captain" = 'aaron heal'
wikisql
CREATE TABLE table_name_84 ( away_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When Hawthorn is the away team, what is their score?
SELECT away_team AS score FROM table_name_84 WHERE away_team = "hawthorn"
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 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 INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.short_title = "Abn react-anastom/graft" AND lab.flag = "abnormal"
mimicsql_data
CREATE TABLE table_10548224_1 ( winning_team VARCHAR, losing_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which winning team beat the New York Yankees?
SELECT winning_team FROM table_10548224_1 WHERE losing_team = "New York Yankees"
sql_create_context
CREATE TABLE table_name_24 ( race_title VARCHAR, drivers VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What race is on aug 4 with ron fellows?
SELECT race_title FROM table_name_24 WHERE drivers = "ron fellows" AND date = "aug 4"
sql_create_context
CREATE TABLE table_name_62 ( onitoolsfiltering VARCHAR, fhfreepressreport VARCHAR, onisocialfiltering VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- With a FHFreepressreport of 54, and ne as ONIsocialfiltering, what is the ONItoolsfiltering?
SELECT onitoolsfiltering FROM table_name_62 WHERE fhfreepressreport = "54" AND onisocialfiltering = "ne"
sql_create_context
CREATE TABLE table_33936 ( "Rank" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest bronze number when silver shows 2, and the total is 8?
SELECT MIN("Bronze") FROM table_33936 WHERE "Silver" = '2' AND "Total" = '8'
wikisql
CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId number, Par...
SELECT COUNT(Q.Id) FROM Posts AS Q, Posts AS A, Posts AS OA WHERE Q.AnswerCount > 1 AND A.ParentId = Q.Id AND OA.ParentId = Q.Id AND A.Id = Q.AcceptedAnswerId AND OA.Id != Q.AcceptedAnswerId AND A.Score < OA.Score
sede
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text, person_info_CSD text, person_info_CSRQ time, person_info_GJDM text, person_info_GJMC text, person_info_JGDM text, person_info_JGMC text, person_info_MZDM text, person_info_MZMC text, person_info_XBDM ...
SELECT mzjzjlb.JZLSH FROM hz_info JOIN mzjzjlb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE hz_info.person_info_XM = '陈淑兰' AND NOT mzjzjlb.JZLSH IN (SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ >= '2010-02-19')
css
CREATE TABLE table_5952 ( "Title" text, "Year" real, "Director" text, "Budget" text, "Gross (worldwide)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the most recent year featuring the director Christopher Kulikowski?
SELECT MAX("Year") FROM table_5952 WHERE "Director" = 'christopher kulikowski'
wikisql
CREATE TABLE table_34931 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Opponent" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Opponent had a Score of 6-3, 6-2?
SELECT "Opponent" FROM table_34931 WHERE "Score" = '6-3, 6-2'
wikisql
CREATE TABLE table_name_49 ( year INTEGER, title VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Title of the angry brigade involves which lowest year?
SELECT MIN(year) FROM table_name_49 WHERE title = "the angry brigade"
sql_create_context
CREATE TABLE table_name_60 ( residence VARCHAR, name VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Show the Residence whose Name is rich gordon?
SELECT residence FROM table_name_60 WHERE name = "rich gordon"
sql_create_context
CREATE TABLE table_24538140_2 ( match2 INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest score of all games for match 2?
SELECT MIN(match2) FROM table_24538140_2
sql_create_context
CREATE TABLE table_2431 ( "Date" text, "Tournament" text, "Location" text, "Purse ( $ )" real, "Winner" text, "Score" text, "1st Prize ( $ )" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many times could you earn $470,000 as the grand ...
SELECT COUNT("Score") FROM table_2431 WHERE "1st Prize ( $ )" = '470,000'
wikisql
CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) CREATE TABLE intakeoutput ( in...
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', patient.hospitaladmittime)) FROM patient WHERE patient.uniquepid = '006-172277' AND patient.hospitaldischargetime IS NULL
eicu
CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location text, insurance text, language text, marital_status text, ethnicity text, age number ) CREATE ...
SELECT COUNT(*) > 0 FROM diagnoses_icd WHERE diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 83038) AND STRFTIME('%y', diagnoses_icd.charttime) = '2105'
mimic_iii
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 MIN(demographic.age) FROM demographic WHERE demographic.marital_status = "DIVORCED" AND demographic.admission_type = "ELECTIVE"
mimicsql_data
CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), HIRE_DATE date, JOB_ID varchar(10), SALARY decimal(8,2), CO...
SELECT HIRE_DATE, SUM(MANAGER_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40
nvbench
CREATE TABLE table_261222_1 ( date_of_creation VARCHAR, city___municipality VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What day was kibawe created?
SELECT date_of_creation FROM table_261222_1 WHERE city___municipality = "Kibawe"
sql_create_context
CREATE TABLE table_6417 ( "Position" real, "Team" text, "Points" real, "Played" real, "Drawn" real, "Lost" real, "Against" real, "Difference" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Points is the highest one that has a Posit...
SELECT MAX("Points") FROM table_6417 WHERE "Position" = '5' AND "Played" < '18'
wikisql
CREATE TABLE table_name_94 ( home VARCHAR, visitor VARCHAR, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the home team when the visiting team was Chicago Black Hawks, a game with a record of 0-2?
SELECT home FROM table_name_94 WHERE visitor = "chicago black hawks" AND record = "0-2"
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 SUM(QTY), SUM(AMOUNT) FROM t_kc22 WHERE SOC_SRT_DIRE_NM = '盐酸舍曲林胶囊' AND STA_DATE BETWEEN '2014-05-08' AND '2017-06-06'
css
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 MIN(MED_AMOUT), MAX(MED_AMOUT) FROM t_kc24 WHERE MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc21 WHERE MED_SER_ORG_NO = '6694892' AND OUT_DIAG_DIS_NM = '腔隙性脑梗死')
css
CREATE TABLE Properties ( property_id INTEGER, property_type_code CHAR(15), property_address VARCHAR(255), other_details VARCHAR(255) ) CREATE TABLE Timed_Status_of_Things ( thing_id INTEGER, Date_and_Date DATETIME, Status_of_Thing_Code CHAR(15) ) CREATE TABLE Residents_Services ( resi...
SELECT date_moved_in, COUNT(date_moved_in) FROM Residents
nvbench
CREATE TABLE table_4484 ( "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 the away team play when they scored 15....
SELECT "Venue" FROM table_4484 WHERE "Away team score" = '15.10 (100)'
wikisql
CREATE TABLE table_50354 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Place of the Player with a To par of +3 and Score of 73-70-73=216?
SELECT "Place" FROM table_50354 WHERE "To par" = '+3' AND "Score" = '73-70-73=216'
wikisql
CREATE TABLE table_name_71 ( district VARCHAR, former_local_authority VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What district is the parish who had the South Cambridgeshire rural district as the former local authority?
SELECT district FROM table_name_71 WHERE former_local_authority = "south cambridgeshire rural district"
sql_create_context
CREATE TABLE table_name_94 ( tournament VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is 2001, when 1989 is 'A', and when Tournament is 'U.S. Open'?
SELECT 2001 FROM table_name_94 WHERE 1989 = "a" AND tournament = "u.s. open"
sql_create_context
CREATE TABLE table_40453 ( "Constituency" text, "Michael D. Higgins" text, "Se\u00e1n Gallagher" text, "Martin McGuinness" text, "Gay Mitchell" text, "David Norris" text, "Dana Rosemary Scallon" text, "Mary Davis" text ) -- Using valid SQLite, answer the following questions for the tab...
SELECT "Mary Davis" FROM table_40453 WHERE "Gay Mitchell" = '4.6%'
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 procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.short_title = "Do not resusctate status"
mimicsql_data
CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate time, ApprovalDate time, RejectionDate time, OwnerUserId number, Comment text, Text text, Title text, Tags text, Revision...
SELECT t.TagName, SUM(a.Score) AS Score FROM Posts AS q INNER JOIN Posts AS a ON a.ParentId = q.Id INNER JOIN PostTags AS pt ON q.Id = pt.PostId INNER JOIN Tags AS t ON t.Id = pt.TagId WHERE a.OwnerUserId = '##UserId:int##' AND a.CommunityOwnedDate IS NULL GROUP BY t.TagName ORDER BY SUM(a.Score) DESC
sede
CREATE TABLE table_60840 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On what date was the away team West Ham United?
SELECT "Date" FROM table_60840 WHERE "Away team" = 'west ham united'
wikisql
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location text, insurance text, lan...
SELECT STRFTIME('%j', admissions.dischtime) - STRFTIME('%j', admissions.admittime) FROM admissions WHERE admissions.subject_id = 59049 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1
mimic_iii
CREATE TABLE mzjzjlb ( YLJGDM text, JZLSH text, KH text, KLX number, MJZH text, HZXM text, NLS number, NLY number, ZSEBZ number, JZZTDM number, JZZTMC text, JZJSSJ time, TXBZ number, ZZBZ number, WDBZ number, JZKSBM text, JZKSMC text, JZKSRQ time, ...
SELECT JYLX FROM jybgb WHERE BGDH = '35125613493'
css
CREATE TABLE table_16897 ( "Name" text, "Number" text, "Builder" text, "Date built" text, "Wheel arrangement" text, "Driving wheels" text, "Cylinders" text, "Boiler pressure" text, "Notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. ...
SELECT "Date built" FROM table_16897 WHERE "Wheel arrangement" = '0-6-0 ST' AND "Builder" = 'Hudswell Clarke'
wikisql
CREATE TABLE table_11677100_18 ( school VARCHAR, hometown VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the school for the player who's hometown was Irvine, CA?
SELECT school FROM table_11677100_18 WHERE hometown = "Irvine, CA"
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 procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
SELECT AVG(demographic.age) FROM demographic WHERE demographic.marital_status = "MARRIED" AND demographic.diagnosis = "BRAIN MASS;INTRACRANIAL HEMORRHAGE"
mimicsql_data
CREATE TABLE table_204_334 ( id number, "opposition" text, "matches" number, "won" number, "drawn" number, "lost" number, "for" number, "against" number, "win%" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many teams won less t...
SELECT COUNT("opposition") FROM table_204_334 WHERE "won" < (SELECT "won" FROM table_204_334 WHERE "opposition" = 'pune strykers')
squall
CREATE TABLE table_1213511_7 ( college_junior_club_team VARCHAR, nationality VARCHAR, nhl_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which college/junior/club teams nationality is canada and nhl team is minnesota north stars
SELECT college_junior_club_team FROM table_1213511_7 WHERE nationality = "Canada" AND nhl_team = "Minnesota North Stars"
sql_create_context
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 hz_info ( KH text, KLX number...
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB ...
css
CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABL...
WITH periodcomments AS (SELECT CAST(TIME_TO_STR(c.CreationDate, '%Y%m%d') AS TEXT(6)) AS period, c.Id, CASE WHEN c.Text LIKE '%http://%' THEN 1 ELSE 0 END AS link FROM Comments AS c), bands AS (SELECT p.*, DENSE_RANK() OVER (ORDER BY p.period) AS banding FROM periodcomments AS p), rollups AS (SELECT b.period, b.banding...
sede
CREATE TABLE table_19998428_3 ( san_julián_municipality___percentage_ VARCHAR, san_antonio_de_lomerío_municipality___percentage_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- If the San Antonio de Lomerio municipality percentage is 5.480, what is the total ...
SELECT COUNT(san_julián_municipality___percentage_) FROM table_19998428_3 WHERE san_antonio_de_lomerío_municipality___percentage_ = "5.480"
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 * FROM hz_info JOIN zzmzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX AND zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE hz_i...
css
CREATE TABLE table_36159 ( "Round" real, "Player" text, "Position" text, "Nationality" text, "College/Junior/Club Team (League)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest round in which a player was picked for the Center pos...
SELECT MAX("Round") FROM table_36159 WHERE "Position" = 'center'
wikisql
CREATE TABLE captain ( Captain_ID int, Name text, Ship_ID int, age text, Class text, Rank text ) CREATE TABLE Ship ( Ship_ID int, Name text, Type text, Built_Year real, Class text, Flag text ) -- Using valid SQLite, answer the following questions for the tables provide...
SELECT Class, AVG(age) FROM captain GROUP BY Class ORDER BY AVG(age) DESC
nvbench