instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE T...
SELECT patients.gender FROM patients WHERE patients.subject_id = 27038
mimic_iii
CREATE TABLE table_63431 ( "Contestant Name" text, "Episode #" text, "Date Premiered (2009)" text, "Winning Amount" text, "Eliminated Contestant" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What date premiered (2009) has kareena kapoor as the con...
SELECT "Date Premiered (2009)" FROM table_63431 WHERE "Contestant Name" = 'kareena kapoor'
wikisql
CREATE TABLE table_name_66 ( run_time VARCHAR, podcast_date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the run time of the episode that aired on September 4, 2005?
SELECT run_time FROM table_name_66 WHERE podcast_date = "september 4, 2005"
sql_create_context
CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) CREATE TABLE fare ( fare_id int, from_airport varchar, to_airport varchar, fare_basis_code text, fare_airline text, restriction_code text, one_direction_cost int, round_trip_cost int, r...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'ATLANT...
atis
CREATE TABLE table_76911 ( "Rank" text, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average Bronze, when Total is 7, and when Silver is greater than 1?
SELECT AVG("Bronze") FROM table_76911 WHERE "Total" = '7' AND "Silver" > '1'
wikisql
CREATE TABLE table_name_64 ( team VARCHAR, average VARCHAR, goalkeeper VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What team has Carlos S nchez as a goalkeeper and an average below 1.12?
SELECT team FROM table_name_64 WHERE average < 1.12 AND goalkeeper = "carlos sánchez"
sql_create_context
CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC text, RYBH text, XBDM number, XBMC text, XLDM text, XLMC text, XM text, ZYLBDM text, ZYMC text ) CREATE TABLE jybgb_jyjgzbb ( JYZBLSH number, ...
SELECT COUNT(*) FROM (SELECT jybgb.KSBM FROM mzjzjlb JOIN jybgb ON mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE mzjzjlb.YLJGDM = '9831232' AND jybgb.BGRQ BETWEEN '2012-08-01' AND '2019-02-12' GROUP BY jybgb.KSBM HAVING COUNT(*) < 6) AS T
css
CREATE TABLE student ( sex VARCHAR, age INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Find the average and oldest age for students with different sex.
SELECT AVG(age), MAX(age), sex FROM student GROUP BY sex
sql_create_context
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.dob_year < "1837" AND diagnoses.short_title = "Episodic mood disord NOS"
mimicsql_data
CREATE TABLE Ref_Document_Types ( Document_Type_Code CHAR(15), Document_Type_Name VARCHAR(255), Document_Type_Description VARCHAR(255) ) CREATE TABLE Documents ( Document_ID INTEGER, Document_Type_Code CHAR(15), Project_ID INTEGER, Document_Date DATETIME, Document_Name VARCHAR(255), ...
SELECT Document_Type_Description, COUNT(Document_Type_Description) FROM Ref_Document_Types GROUP BY Document_Type_Description ORDER BY COUNT(Document_Type_Description) DESC
nvbench
CREATE TABLE table_6399 ( "Game" real, "Date" text, "Opponent" text, "Score" text, "Series" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the standing in the series after game 1?
SELECT "Series" FROM table_6399 WHERE "Game" = '1'
wikisql
CREATE TABLE table_name_95 ( away_team VARCHAR, home_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the away team at collingwood?
SELECT away_team AS score FROM table_name_95 WHERE home_team = "collingwood"
sql_create_context
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, intime time, outtime time ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, ...
SELECT procedures_icd.charttime FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'oth periton adhesiolysis') AND procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 17435) AND...
mimic_iii
CREATE TABLE table_name_50 ( lap_length VARCHAR, category VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Lap Length of the race with a Grand Prix Fia Category?
SELECT lap_length FROM table_name_50 WHERE category = "grand prix fia"
sql_create_context
CREATE TABLE aircraft ( Aircraft_ID int(11), Aircraft varchar(50), Description varchar(50), Max_Gross_Weight varchar(50), Total_disk_area varchar(50), Max_disk_Loading varchar(50) ) CREATE TABLE match ( Round real, Location text, Country text, Date text, Fastest_Qualifying t...
SELECT Aircraft, COUNT(*) FROM aircraft AS T1 JOIN match AS T2 ON T1.Aircraft_ID = T2.Winning_Aircraft GROUP BY T2.Winning_Aircraft
nvbench
CREATE TABLE table_name_58 ( score VARCHAR, club VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the final score of the competition that features the club of fk Austria wien?
SELECT score FROM table_name_58 WHERE club = "fk austria wien"
sql_create_context
CREATE TABLE table_2425 ( "Name" text, "Nationality" text, "Position" text, "Matches for NQF" text, "Appearances" real, "Goals" real, "Yellow Cards" real, "Red Cards" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- If the matches for NQF ...
SELECT "Position" FROM table_2425 WHERE "Matches for NQF" = '2009'
wikisql
CREATE TABLE table_name_35 ( game INTEGER, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest Game, when Opponent is 'Boston Bruins'?
SELECT MIN(game) FROM table_name_35 WHERE opponent = "boston bruins"
sql_create_context
CREATE TABLE table_name_55 ( date VARCHAR, week VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What day did the team play on week 8?
SELECT date FROM table_name_55 WHERE week = 8
sql_create_context
CREATE TABLE table_70970 ( "Year" text, "Venue" text, "Winners" text, "Runner-up" text, "3rd place" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who took the winning slot at the Vojens venue?
SELECT "Winners" FROM table_70970 WHERE "Venue" = 'vojens'
wikisql
CREATE TABLE table_48284 ( "Athlete" text, "Event" text, "Swim (1.5km)" text, "Trans 1" text, "Bike (40km)" text, "Trans 2" text, "Run (10km)" text, "Total Time" text, "Rank" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- For the tri...
SELECT "Total Time" FROM table_48284 WHERE "Bike (40km)" = '58:20'
wikisql
CREATE TABLE table_16799784_13 ( diameter__km_ VARCHAR, longitude VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the diameter of the feature with longitude 8.0e?
SELECT diameter__km_ FROM table_16799784_13 WHERE longitude = "8.0E"
sql_create_context
CREATE TABLE table_name_9 ( venue VARCHAR, away_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where did Essendon play as the away team?
SELECT venue FROM table_name_9 WHERE away_team = "essendon"
sql_create_context
CREATE TABLE Ref_Incident_Type ( incident_type_code VARCHAR(10), incident_type_description VARCHAR(80) ) CREATE TABLE Detention ( detention_id INTEGER, detention_type_code VARCHAR(10), teacher_id INTEGER, datetime_detention_start DATETIME, datetime_detention_end DATETIME, detention_summ...
SELECT student_id, address_id FROM Student_Addresses GROUP BY other_details ORDER BY monthly_rental DESC
nvbench
CREATE TABLE table_26429771_1 ( title VARCHAR, no_in_season VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name of chapter 8 of season 4?
SELECT title FROM table_26429771_1 WHERE no_in_season = 8
sql_create_context
CREATE TABLE table_name_15 ( home VARCHAR, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the home team when the record was 27 14 6?
SELECT home FROM table_name_15 WHERE record = "27–14–6"
sql_create_context
CREATE TABLE table_74050 ( "English" text, "Proto-Semitic" text, "Akkadian" text, "Arabic" text, "Aramaic" text, "Hebrew" text, "Geez" text, "Mehri" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- If the proto-semitic is *bayt-, what are ...
SELECT "Geez" FROM table_74050 WHERE "Proto-Semitic" = '*bayt-'
wikisql
CREATE TABLE table_1147705_1 ( model VARCHAR, engine_type VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many engine b5234 t3?
SELECT COUNT(model) FROM table_1147705_1 WHERE engine_type = "B5234 T3"
sql_create_context
CREATE TABLE table_name_3 ( first_criticality VARCHAR, electric_power VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the first citicality for electric power of 1,380 mw
SELECT first_criticality FROM table_name_3 WHERE electric_power = "1,380 mw"
sql_create_context
CREATE TABLE table_33408 ( "Year" real, "Chassis" text, "Engine" text, "Start" text, "Finish" text, "Team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the starting position in the year before 1986?
SELECT "Start" FROM table_33408 WHERE "Year" < '1986'
wikisql
CREATE TABLE area ( course_id int, area varchar ) CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE course ( course_id int, name varchar, dep...
SELECT DISTINCT instructor.name FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester INNER JOIN program_course ON program_course.course_id = course_offering.course_id INNER JOIN offering_instructor ON offering_instr...
advising
CREATE TABLE table_55504 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the opponent on November 12, 1972?
SELECT "Opponent" FROM table_55504 WHERE "Date" = 'november 12, 1972'
wikisql
CREATE TABLE table_name_9 ( category VARCHAR, year VARCHAR, nominated_work VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which category was the berlin file up to win in 2013?
SELECT category FROM table_name_9 WHERE year = 2013 AND nominated_work = "the berlin file"
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 Founder, AVG(Revenue) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder ORDER BY Founder DESC
nvbench
CREATE TABLE table_39917 ( "Club" text, "Played" text, "Drawn" text, "Lost" text, "Points for" text, "Points against" text, "Points difference" text, "Tries For" text, "Tries Against" text, "Try Bonus" text, "Losing Bonus" text, "Points" text ) -- Using valid SQLite, an...
SELECT "Lost" FROM table_39917 WHERE "Try Bonus" = 'try bonus'
wikisql
CREATE TABLE table_44380 ( "Number" text, "Builder" text, "Type" text, "Date" text, "Works number" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Date, when Type is DS4-4-750, and when Works Number is 74409?
SELECT "Date" FROM table_44380 WHERE "Type" = 'ds4-4-750' AND "Works number" = '74409'
wikisql
CREATE TABLE table_52558 ( "Week" text, "Date" text, "Opponent" text, "Result" text, "Kickoff [a ]" text, "Game site" text, "Attendance" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What time was the kickoff on week 5?
SELECT "Kickoff [a ]" FROM table_52558 WHERE "Week" = '5'
wikisql
CREATE TABLE people ( person_id number, first_name text, middle_name text, last_name text, cell_mobile_number text, email_address text, login_name text, password text ) CREATE TABLE students ( student_id number, student_details text ) CREATE TABLE addresses ( address_id num...
SELECT student_id FROM students WHERE NOT student_id IN (SELECT student_id FROM student_course_attendance)
spider
CREATE TABLE mzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH text, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZZMC ...
SELECT jybgb.SQKS, jybgb.SQKSMC FROM jybgb WHERE jybgb.BGDH = '35605162695'
css
CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number...
SELECT COUNT(*) AS Total, DAY(CreationDate) AS Day, MONTH(CreationDate) AS Month, YEAR(CreationDate) AS Year FROM PostLinks WHERE LinkTypeId = 3 GROUP BY DAY(CreationDate), MONTH(CreationDate), YEAR(CreationDate) ORDER BY Year, Month, day
sede
CREATE TABLE table_3795 ( "Branding" text, "Callsign" text, "Frequency" text, "Power (kW)" text, "Location" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How much power does dwzf have?
SELECT "Power (kW)" FROM table_3795 WHERE "Callsign" = 'DWZF'
wikisql
CREATE TABLE table_27712451_6 ( high_points VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are December 10's high points?
SELECT high_points FROM table_27712451_6 WHERE date = "December 10"
sql_create_context
CREATE TABLE users ( user_id number, role_code text, user_name text, user_login text, password text ) CREATE TABLE document_sections_images ( section_id number, image_id number ) CREATE TABLE functional_areas ( functional_area_code text, parent_functional_area_code text, functi...
SELECT COUNT(*), role_code FROM users GROUP BY role_code
spider
CREATE TABLE table_name_25 ( rec VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Rec has Jerel Myers as the Player?
SELECT rec FROM table_name_25 WHERE player = "jerel myers"
sql_create_context
CREATE TABLE table_name_5 ( opponent VARCHAR, week VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the opponent in week 10?
SELECT opponent FROM table_name_5 WHERE week = 10
sql_create_context
CREATE TABLE table_name_64 ( date VARCHAR, away VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When did the High Park Demons play Away?
SELECT date FROM table_name_64 WHERE away = "high park demons"
sql_create_context
CREATE TABLE table_22269839_1 ( directed_by VARCHAR, written_by VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who directed the episode written by patrick meighan?
SELECT directed_by FROM table_22269839_1 WHERE written_by = "Patrick Meighan"
sql_create_context
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, h...
SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, medication.drugstarttime FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE medication.drugname = 'lisinopril 10 mg po tabs' AND DATETIME(medication.d...
eicu
CREATE TABLE table_name_44 ( encoding VARCHAR, tracks__side VARCHAR, sectors__track VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the encoding when the tracks/side is 80 and sectors/track is 11?
SELECT encoding FROM table_name_44 WHERE tracks__side = "80" AND sectors__track = "11"
sql_create_context
CREATE TABLE table_name_80 ( source VARCHAR, terry_mcauliffe VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Source has Terry McAuliffe of 36%
SELECT source FROM table_name_80 WHERE terry_mcauliffe = "36%"
sql_create_context
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 SOC_SRT_DIRE_CD, SOC_SRT_DIRE_NM FROM t_kc22 WHERE MED_CLINIC_ID = '16771614711' AND OVE_SELF_AMO > 5485.87
css
CREATE TABLE Movie ( mID int, title text, year int, director text ) CREATE TABLE Rating ( rID int, mID int, stars int, ratingDate date ) CREATE TABLE Reviewer ( rID int, name text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Show ...
SELECT title, MIN(T1.stars) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID GROUP BY title ORDER BY title
nvbench
CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, COM_PAY number, DATA_ID text, ENT_ACC_PAY number, ENT_PAY number, F...
SELECT COUNT(*) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '0952187' AND t_kc21.IN_HOSP_DATE BETWEEN '2002-07-26' AND '2015-08-16' AND t_kc21.INSURED_STS = '未就业' AND t_kc21.MED_AMOUT >= 7027.62
css
CREATE TABLE climber ( Climber_ID int, Name text, Country text, Time text, Points real, Mountain_ID int ) CREATE TABLE mountain ( Mountain_ID int, Name text, Height real, Prominence real, Range text, Country text ) -- Using valid SQLite, answer the following questions ...
SELECT T1.Name, T2.Height FROM climber AS T1 JOIN mountain AS T2 ON T1.Mountain_ID = T2.Mountain_ID ORDER BY T2.Height DESC
nvbench
CREATE TABLE table_3757 ( "Institution" text, "City" text, "Nickname" text, "Founded" real, "Affiliation" text, "Enrollment" real, "Tenure" text, "Current womens lacrosse conference" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name th...
SELECT "City" FROM table_3757 WHERE "Enrollment" = '19900'
wikisql
CREATE TABLE table_275023_1 ( formed_date VARCHAR, province VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many provinces are named Wellington?
SELECT COUNT(formed_date) FROM table_275023_1 WHERE province = "Wellington"
sql_create_context
CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense text ) CREATE TABLE Tags ( Id number, TagName text, Count number, Ex...
WITH tagaskers AS (SELECT DISTINCT OwnerUserId AS "user_id", OwnerUserId AS "user_link", COUNT(OwnerUserId) AS "qcount" FROM Posts INNER JOIN PostTags ON Posts.Id = PostTags.PostId WHERE PostTypeId = 1 AND CommunityOwnedDate IS NULL AND ClosedDate IS NULL AND PostTags.TagId = @tagid GROUP BY OwnerUserId HAVING COUNT(Ow...
sede
CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTy...
SELECT COUNT(*) FROM Users WHERE Reputation >= 3000
sede
CREATE TABLE table_15306 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Record" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What record has November 15 as the date?
SELECT "Record" FROM table_15306 WHERE "Date" = 'november 15'
wikisql
CREATE TABLE station ( id INTEGER, name TEXT, lat NUMERIC, long NUMERIC, dock_count INTEGER, city TEXT, installation_date TEXT ) CREATE TABLE status ( station_id INTEGER, bikes_available INTEGER, docks_available INTEGER, time TEXT ) CREATE TABLE weather ( date TEXT, ...
SELECT date, COUNT(date) FROM weather WHERE max_temperature_f >= 80 GROUP BY date ORDER BY date DESC
nvbench
CREATE TABLE table_73626 ( "Year" real, "Tournament" text, "Winner" text, "Margin of victory" text, "Winners share ( $ )" real, "Par" real, "Course length" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When hale irwin is the winner what is ...
SELECT "Margin of victory" FROM table_73626 WHERE "Winner" = 'Hale Irwin'
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 COUNT(*) FROM (SELECT gwyjzb.MED_ORG_DEPT_CD FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '2837438' GROUP BY gwyjzb.MED_ORG_DEPT_CD HAVING MAX(gwyjzb.IN_HOSP_DAYS) < 25 UNION SELECT fgwyjzb.MED_ORG_DEPT_CD FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '2837438' GROUP BY fgwyjzb.MED_ORG_DEPT_CD HAVING MAX(fgwyjzb.IN_H...
css
CREATE TABLE table_name_98 ( ave__no INTEGER, name VARCHAR, height__m_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which sum of AVE-No has a Name of albula alps, and a Height (m) larger than 3418?
SELECT SUM(ave__no) FROM table_name_98 WHERE name = "albula alps" AND height__m_ > 3418
sql_create_context
CREATE TABLE status ( station_id number, bikes_available number, docks_available number, time text ) CREATE TABLE station ( id number, name text, lat number, long number, dock_count number, city text, installation_date text ) CREATE TABLE trip ( id number, duration ...
SELECT id FROM station WHERE lat > 37.4 EXCEPT SELECT station_id FROM status GROUP BY station_id HAVING MIN(bikes_available) < 7
spider
CREATE TABLE fare ( fare_id int, from_airport varchar, to_airport varchar, fare_basis_code text, fare_airline text, restriction_code text, one_direction_cost int, round_trip_cost int, round_trip_required varchar ) CREATE TABLE food_service ( meal_code text, meal_number int, ...
SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, fare_basis, flight, flight_fare WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND...
atis
CREATE TABLE table_1342270_3 ( first_elected INTEGER, district VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the maximum first elected with district being alabama 5
SELECT MAX(first_elected) FROM table_1342270_3 WHERE district = "Alabama 5"
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(t_kc24.OVE_PAY) FROM t_kc21 JOIN t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc21.PERSON_NM = '云昂雄' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2010-08-10' AND '2011-12-12'
css
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) 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 t...
SELECT person_info.JGDM, person_info.JGMC, COUNT(person_info.RYBH) FROM person_info JOIN hz_info JOIN mzjzjlb JOIN hz_info_mzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_inf...
css
CREATE TABLE staff_department_assignments ( staff_id number, department_id number, date_assigned_from time, job_title_code text, date_assigned_to time ) CREATE TABLE department_stores ( dept_store_id number, dept_store_chain_id number, store_name text, store_address text, store_...
SELECT product_type_code FROM products GROUP BY product_type_code HAVING AVG(product_price) > (SELECT AVG(product_price) FROM products)
spider
CREATE TABLE table_26799 ( "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. -- Where was the game played that st...
SELECT "Game site" FROM table_26799 WHERE "Kickoff" = '7:00 p.m.'
wikisql
CREATE TABLE table_43331 ( "Tournament" text, "Wins" real, "Top-5" real, "Top-10" real, "Top-25" real, "Events" real, "Cuts made" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the least number of wins when the top 10 is more than 8?...
SELECT MIN("Wins") FROM table_43331 WHERE "Top-10" > '8'
wikisql
CREATE TABLE table_21093 ( "Name" text, "Latitude" text, "Longitude" text, "Diameter (km)" text, "Year named" real, "Name origin" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where is longitude 202.9e?
SELECT "Name" FROM table_21093 WHERE "Longitude" = '202.9E'
wikisql
CREATE TABLE gyb ( 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 = '58596815' AND qtb.MED_SER_ORG_NO = '1792451' AND NOT qtb.OUT_DIAG_DIS_NM LIKE '%阻塞性%' UNION SELECT gyb.MED_CLINIC_ID FROM gyb WHERE gyb.PERSON_ID = '58596815' AND gyb.MED_SER_ORG_NO = '1792451' AND NOT gyb.OUT_DIAG_DIS_NM LIKE '%阻塞性%' UNION SELECT zyb.MED_CLINIC_...
css
CREATE TABLE table_5852 ( "Designation" text, "Car numbers" text, "Manufacturer" text, "Model No." text, "First used" text, "Quantity" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Designation has a Quantity of 52?
SELECT "Designation" FROM table_5852 WHERE "Quantity" = '52'
wikisql
CREATE TABLE table_78712 ( "Ending" text, "American" text, "British" text, "Australian" text, "Examples" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Ending has British of iz, and Examples of achilles, appendices, f ces?
SELECT "Ending" FROM table_78712 WHERE "British" = 'iz' AND "Examples" = 'achilles, appendices, fæces'
wikisql
CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Percent text, ACC_Home text, ACC_Road text, All_Games text, All_Games_Percent int, All_Home text, All_Road text, All_Neutral text ) CREATE TABLE university ( Scho...
SELECT ACC_Regular_Season, Team_ID FROM basketball_match
nvbench
CREATE TABLE table_name_90 ( leftfielder VARCHAR, year VARCHAR, shortstop VARCHAR, second_baseman VARCHAR, first_baseman VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name of the Leftfielder when Davey Lopes was the Second Baseman an...
SELECT leftfielder FROM table_name_90 WHERE second_baseman = "davey lopes" AND first_baseman = "steve garvey" AND shortstop = "bill russell" AND year > 1977
sql_create_context
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_CLINIC_ID text, MED_DIRE_CD tex...
SELECT SUM(t_kc24.PER_ACC_PAY) FROM t_kc24 WHERE t_kc24.t_kc21_PERSON_NM = '柏良骏' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2014-09-29' AND '2015-12-20'
css
CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE comment_instructor ( instructor_id int, student_id int, sc...
SELECT DISTINCT COURSE_0.department, COURSE_0.name, COURSE_0.number FROM course AS COURSE_0, course AS COURSE_1, course_prerequisite WHERE COURSE_0.course_id = course_prerequisite.pre_course_id AND NOT COURSE_0.course_id IN (SELECT STUDENT_RECORDalias0.course_id FROM student_record AS STUDENT_RECORDalias0 WHERE STUDENT...
advising
CREATE TABLE Participates_in ( stuid INTEGER, actid INTEGER ) CREATE TABLE Faculty ( FacID INTEGER, Lname VARCHAR(15), Fname VARCHAR(15), Rank VARCHAR(15), Sex VARCHAR(1), Phone INTEGER, Room VARCHAR(5), Building VARCHAR(13) ) CREATE TABLE Activity ( actid INTEGER, acti...
SELECT Rank, COUNT(*) FROM Faculty AS T1 JOIN Student AS T2 ON T1.FacID = T2.Advisor GROUP BY T1.Rank
nvbench
CREATE TABLE table_name_43 ( week INTEGER, result VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the latest week with a game with a result of l 12 7?
SELECT MAX(week) FROM table_name_43 WHERE result = "l 12–7"
sql_create_context
CREATE TABLE table_46550 ( "Round" real, "Overall Pick" 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 was the overall pick number of the player s...
SELECT COUNT("Overall Pick") FROM table_46550 WHERE "Round" < '3'
wikisql
CREATE TABLE table_78995 ( "Time" text, "Show Name" text, "Local/Networked" text, "Ad Freq" text, "News Freq" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What News Freq has a Time of 1:00pm 4:00pm?
SELECT "News Freq" FROM table_78995 WHERE "Time" = '1:00pm–4:00pm'
wikisql
CREATE TABLE table_20404 ( "Country" text, "Total Freshwater Withdrawal (km 3 /yr)" text, "Per Capita Withdrawal (m 3 /p/yr)" real, "Domestic Use (m 3 /p/yr)(in %)" text, "Industrial Use (m 3 /p/yr)(in %)" text, "Agricultural Use (m 3 /p/yr)(in %)" text ) -- Using valid SQLite, answer the foll...
SELECT COUNT("Country") FROM table_20404 WHERE "Per Capita Withdrawal (m 3 /p/yr)" = '372'
wikisql
CREATE TABLE table_204_106 ( id number, "year" number, "title" text, "image" text, "dimensions" text, "collection" text, "comments" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what was the last piece completed ?
SELECT "title" FROM table_204_106 ORDER BY id DESC LIMIT 1
squall
CREATE TABLE Has_amenity ( dormid INTEGER, amenid INTEGER ) CREATE TABLE Dorm ( dormid INTEGER, dorm_name VARCHAR(20), student_capacity INTEGER, gender VARCHAR(1) ) CREATE TABLE Dorm_amenity ( amenid INTEGER, amenity_name VARCHAR(25) ) CREATE TABLE Lives_in ( stuid INTEGER, do...
SELECT Fname, COUNT(Fname) FROM Student AS T1 JOIN Lives_in AS T2 ON T1.stuid = T2.stuid WHERE T2.dormid IN (SELECT T3.dormid FROM Has_amenity AS T3 JOIN Dorm_amenity AS T4 ON T3.amenid = T4.amenid WHERE T4.amenity_name = 'TV Lounge') GROUP BY Fname
nvbench
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
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 = "Pressure ulcer, hip" AND lab."CATEGORY" = "Hematology"
mimicsql_data
CREATE TABLE table_58712 ( "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 Place, when Player is 'Phil Mickelson'?
SELECT "Place" FROM table_58712 WHERE "Player" = 'phil mickelson'
wikisql
CREATE TABLE medicine_enzyme_interaction ( enzyme_id number, medicine_id number, interaction_type text ) CREATE TABLE enzyme ( id number, name text, location text, product text, chromosome text, omim number, porphyria text ) CREATE TABLE medicine ( id number, name text,...
SELECT trade_name, COUNT(*) FROM medicine GROUP BY trade_name
spider
CREATE TABLE table_name_83 ( profits__billion_ INTEGER, company VARCHAR, market_value__billion_$_ VARCHAR, headquarters VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest Profits (billion $), when Market Value (billion $) is less than ...
SELECT MIN(profits__billion_) AS $_ FROM table_name_83 WHERE market_value__billion_$_ < 201.3 AND headquarters = "united states" AND company = "jpmorgan chase"
sql_create_context
CREATE TABLE table_22726 ( "Name" text, "Population (2011)" real, "Population (2006)" real, "Change (%)" text, "Land area (km\u00b2)" text, "Population density (per km\u00b2)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When 6.00 is the land ...
SELECT MAX("Population (2011)") FROM table_22726 WHERE "Land area (km\u00b2)" = '6.00'
wikisql
CREATE TABLE mzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH text, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZZMC ...
SELECT zyjzjlb.JZLSH FROM hz_info JOIN zyjzjlb ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE hz_info.RYBH = '58560026' AND NOT zyjzjlb.JZLSH IN (SELECT zyjybgb.JZLSH FROM zyjybgb WHERE zyjybgb.BGRQ >= '2003-02-05' UNION SELECT mzjybgb.JZLSH FROM mzjybgb WHERE mzjybgb...
css
CREATE TABLE table_204_62 ( id number, "year" number, "winner" text, "second" text, "third" text, "starters" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what was the number of starters in 1995 ?
SELECT "starters" FROM table_204_62 WHERE "year" = 1995
squall
CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, T...
SELECT TagName, COUNT(*) AS UpVotes FROM Tags INNER JOIN PostTags ON PostTags.TagId = Tags.Id INNER JOIN Posts ON Posts.ParentId = PostTags.PostId INNER JOIN Votes ON Votes.PostId = Posts.Id AND VoteTypeId = 2 WHERE Posts.OwnerUserId = @UserId GROUP BY TagName ORDER BY UpVotes DESC
sede
CREATE TABLE Has_Allergy ( StuID INTEGER, Allergy VARCHAR(20) ) 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...
SELECT Sex, AVG(Age) FROM Student GROUP BY Sex ORDER BY AVG(Age)
nvbench
CREATE TABLE table_train_172 ( "id" int, "systolic_blood_pressure_sbp" int, "c_peptide_level" float, "hemoglobin_a1c_hba1c" float, "peak_stimulated_c_peptide" float, "diastolic_blood_pressure_dbp" int, "mixed_meal_tolerance_test_mmtt" bool, "vitamin_d" int, "NOUSE" float ) -- Using...
SELECT * FROM table_train_172 WHERE systolic_blood_pressure_sbp > 160 AND diastolic_blood_pressure_dbp > 100
criteria2sql
CREATE TABLE table_54002 ( "Player" text, "Pos." text, "From" real, "School/Country" text, "Rebs" real, "Asts" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average rebounds for the player who started in 1986 and who plays SG?
SELECT AVG("Rebs") FROM table_54002 WHERE "From" = '1986' AND "Pos." = 'sg'
wikisql
CREATE TABLE table_1602858_1 ( winning_score VARCHAR, runner_s__up VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the winning score for the tournament with runner-up Rory Sabbatini?
SELECT winning_score FROM table_1602858_1 WHERE runner_s__up = "Rory Sabbatini"
sql_create_context
CREATE TABLE table_64127 ( "Rank" real, "Gold" real, "Silver" real, "Bronze" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the number of silver when bronze is 0, and rank is less than 2?
SELECT SUM("Silver") FROM table_64127 WHERE "Bronze" = '0' AND "Rank" < '2'
wikisql
CREATE TABLE table_69646 ( "Tournament" text, "Date" text, "Surface" text, "Round" text, "Opponent" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the surface for united airlines tournament of champions final round
SELECT "Surface" FROM table_69646 WHERE "Tournament" = 'united airlines tournament of champions' AND "Round" = 'final'
wikisql