instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE player ( player_id number, name text, position text, club_id number, apps number, tries number, goals text, points number ) CREATE TABLE club_rank ( rank number, club_id number, gold number, silver number, bronze number, total number ) CREATE TABLE ...
SELECT name FROM player WHERE points > (SELECT AVG(points) FROM player)
spider
CREATE TABLE table_name_77 ( laps INTEGER, driver VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the average laps for jackie stewart?
SELECT AVG(laps) FROM table_name_77 WHERE driver = "jackie stewart"
sql_create_context
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND procedures.icd9_code = "3611"
mimicsql_data
CREATE TABLE table_203_815 ( id number, "pick #" number, "nfl team" text, "player" text, "position" text, "college" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who was the last player selected in round nine ?
SELECT "player" FROM table_203_815 ORDER BY "pick #" DESC LIMIT 1
squall
CREATE TABLE table_name_94 ( surface VARCHAR, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the surface for the opponent Roger Federer?
SELECT surface FROM table_name_94 WHERE opponent = "roger federer"
sql_create_context
CREATE TABLE table_78883 ( "Year" real, "Title" text, "Director" text, "Survey" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the title for the Murex D'or survey, after 2005, Said Elmarouk as director, and was nominated?
SELECT "Title" FROM table_78883 WHERE "Survey" = 'murex d''or' AND "Year" > '2005' AND "Director" = 'said elmarouk' AND "Result" = 'nominated'
wikisql
CREATE TABLE table_name_16 ( mascot VARCHAR, location VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the mascot for Mishawaka?
SELECT mascot FROM table_name_16 WHERE location = "mishawaka"
sql_create_context
CREATE TABLE zyb ( CLINIC_ID text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, INSU_TYPE text, IN...
SELECT MIN(t_kc24.MED_AMOUT), MAX(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT qtb.MED_CLINIC_ID FROM qtb WHERE qtb.MED_SER_ORG_NO = '0652199' AND qtb.OUT_DIAG_DIS_CD = 'H88.444' UNION SELECT gyb.MED_CLINIC_ID FROM gyb WHERE gyb.MED_SER_ORG_NO = '0652199' AND gyb.OUT_DIAG_DIS_CD = 'H88.444' UNION...
css
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.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name, T1.Name
nvbench
CREATE TABLE table_1342149_13 ( incumbent VARCHAR, first_elected VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the incumbent for 1932?
SELECT incumbent FROM table_1342149_13 WHERE first_elected = 1932
sql_create_context
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) ...
SELECT MAX(demographic.age) FROM demographic WHERE demographic.gender = "M" AND demographic.diagnosis = "LEFT FEMUR FRACTURE"
mimicsql_data
CREATE TABLE table_79056 ( "Name or route" text, "type" text, "elevation groundstation" real, "elevation mountainstation" real, "slope length" real, "capacity in persons/hour" real, "construction year(s)" text ) -- Using valid SQLite, answer the following questions for the tables provided ...
SELECT "slope length" FROM table_79056 WHERE "type" = 'surface lift' AND "elevation groundstation" < '1974' AND "construction year(s)" = '1971' AND "Name or route" = 'alpmatten 1'
wikisql
CREATE TABLE table_18821196_1 ( weekly_schedule VARCHAR, tv_network_s_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is every weekly schedule of TV network Viasat 4?
SELECT weekly_schedule FROM table_18821196_1 WHERE tv_network_s_ = "Viasat 4"
sql_create_context
CREATE TABLE Student_Course_Enrolment ( student_id VARCHAR ) CREATE TABLE Students ( login_name VARCHAR, student_id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Find the student ID and login name of the student with the most course enrollments
SELECT T1.student_id, T2.login_name FROM Student_Course_Enrolment AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id ORDER BY COUNT(*) DESC LIMIT 1
sql_create_context
CREATE TABLE table_28348757_3 ( production_code VARCHAR, _number VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the production code for number 8
SELECT production_code FROM table_28348757_3 WHERE _number = 8
sql_create_context
CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, ...
SELECT COUNT(*) FROM medication WHERE medication.drugname = '50 ml flex cont: magnesium sulfate 40 mg/ml ij soln' AND STRFTIME('%y', medication.drugstarttime) >= '2105'
eicu
CREATE TABLE table_34943 ( "Date" text, "Opponent#" text, "Site" text, "Result" text, "Attendance" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Site when the Result was w52-0?
SELECT "Site" FROM table_34943 WHERE "Result" = 'w52-0'
wikisql
CREATE TABLE table_51203 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the home team score when the away team scored 6.13 (49)?
SELECT "Home team score" FROM table_51203 WHERE "Away team score" = '6.13 (49)'
wikisql
CREATE TABLE jyjgzbb ( JYZBLSH text, YLJGDM text, BGDH text, BGRQ time, JYRQ time, JCRGH text, JCRXM text, SHRGH text, SHRXM text, JCXMMC text, JCZBDM text, JCFF text, JCZBMC text, JCZBJGDX text, JCZBJGDL number, JCZBJGDW text, SBBM text, YQBH text...
SELECT jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM mzjzjlb JOIN jybgb JOIN jyjgzbb ON mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE mzjzjlb.JZZDSM = '过敏性皮炎' AND jyjgzbb.JCZBDM = '675208'
css
CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE student_record ( student_id int, course_id int, semester i...
SELECT COUNT(*) > 0 FROM course AS COURSE_0, course AS COURSE_1, course_offering AS COURSE_OFFERING_0, course_offering AS COURSE_OFFERING_1, course_prerequisite WHERE COURSE_OFFERING_1.semester = COURSE_OFFERING_0.semester AND COURSE_0.course_id = COURSE_OFFERING_0.course_id AND COURSE_0.department = 'ES' AND COURSE_0....
advising
CREATE TABLE table_name_92 ( record VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the record for the game on January 19?
SELECT record FROM table_name_92 WHERE date = "january 19"
sql_create_context
CREATE TABLE table_test_6 ( "id" int, "scr" int, "anemia" bool, "blood_hemoglobin" int, "bleeding" int, "hemorrhagic_diseases" bool, "stroke" bool, "blood_platelet_counts" int, "trauma" bool, "renal_disease" bool, "hematocrit_hct" float, "hepatic_disease" bool, "polyg...
SELECT * FROM table_test_6 WHERE polyglobulia = 1
criteria2sql
CREATE TABLE table_name_62 ( ofsted_number INTEGER, dcsf_number VARCHAR, intake VARCHAR, type VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the junior type with an intake of 60 and a DCSF number less than 3386 with the smallest Ofsted number...
SELECT MIN(ofsted_number) FROM table_name_62 WHERE intake = 60 AND type = "junior" AND dcsf_number < 3386
sql_create_context
CREATE TABLE Ship ( Ship_ID int, Name text, Type text, Built_Year real, Class text, Flag text ) CREATE TABLE captain ( Captain_ID int, Name text, Ship_ID int, age text, Class text, Rank text ) -- Using valid SQLite, answer the following questions for the tables provide...
SELECT Rank, COUNT(*) FROM captain GROUP BY Rank
nvbench
CREATE TABLE table_19744915_15 ( rank VARCHAR, couple VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Michael and Melanie's rank?
SELECT rank FROM table_19744915_15 WHERE couple = "Michael and Melanie"
sql_create_context
CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, ...
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', patient.unitadmittime)) FROM patient WHERE patient.uniquepid = '027-85328' AND patient.wardid = 996 AND patient.hospitaldischargetime IS NULL ORDER BY patient.unitadmittime DESC LIMIT 1
eicu
CREATE TABLE table_name_10 ( nationality VARCHAR, college VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the nationality of Louisiana Tech?
SELECT nationality FROM table_name_10 WHERE college = "louisiana tech"
sql_create_context
CREATE TABLE people ( People_ID int, Sex text, Name text, Date_of_Birth text, Height real, Weight real ) CREATE TABLE candidate ( Candidate_ID int, People_ID int, Poll_Source text, Date text, Support_rate real, Consider_rate real, Oppose_rate real, Unsure_rate re...
SELECT Sex, SUM(Weight) FROM people GROUP BY Sex ORDER BY Sex
nvbench
CREATE TABLE table_32549 ( "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. -- How many were in the crowd at the Junction Oval ...
SELECT "Crowd" FROM table_32549 WHERE "Venue" = 'junction oval'
wikisql
CREATE TABLE player ( Player_ID int, Player text, Team text, Age int, Position text, School_ID int ) CREATE TABLE school_details ( School_ID int, Nickname text, Colors text, League text, Class text, Division text ) CREATE TABLE school_performance ( School_Id int, ...
SELECT Denomination, COUNT(*) FROM school GROUP BY Denomination ORDER BY Denomination DESC
nvbench
CREATE TABLE film_market_estimation ( Estimation_ID int, Low_Estimate real, High_Estimate real, Film_ID int, Type text, Market_ID int, Year int ) CREATE TABLE film ( Film_ID int, Title text, Studio text, Director text, Gross_in_dollar int ) CREATE TABLE market ( Mar...
SELECT Studio, COUNT(*) FROM film GROUP BY Studio
nvbench
CREATE TABLE courses ( course_id VARCHAR, course_name VARCHAR ) CREATE TABLE student_course_attendance ( course_id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many students attend course English?
SELECT COUNT(*) FROM courses AS T1 JOIN student_course_attendance AS T2 ON T1.course_id = T2.course_id WHERE T1.course_name = "English"
sql_create_context
CREATE TABLE table_204_801 ( id number, "year" number, "derby\nwinner" text, "galaxy" number, "draw" number, "chivas" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many matches has chivas won in the derby ?
SELECT COUNT(*) FROM table_204_801 WHERE "derby\nwinner" = 'chivas'
squall
CREATE TABLE table_44407 ( "Date" text, "Opponent#" text, "Site" text, "Result" text, "Attendance" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the attendance when the result was w61-7?
SELECT "Attendance" FROM table_44407 WHERE "Result" = 'w61-7'
wikisql
CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH text, KH text, KLX number, MZBMLX number, MZJZLSH text, MZZDBM text, MZZDMC text, MZZYZDZZBM...
SELECT jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM mzjzjlb JOIN jyjgzbb ON mzjzjlb.YLJGDM = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJZJLB WHERE mzjzjlb.JZZDBM = 'Y85.622' AND jyjgzbb.JCZBMC = '低密度脂蛋白胆固醇'
css
CREATE TABLE table_name_5 ( arena VARCHAR, founded VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which arena was founded in 2000?
SELECT arena FROM table_name_5 WHERE founded = 2000
sql_create_context
CREATE TABLE table_name_77 ( venue VARCHAR, position_in_2005 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Can you tell me the Venue that has the Position in 2005 of 8?
SELECT venue FROM table_name_77 WHERE position_in_2005 = "8"
sql_create_context
CREATE TABLE table_61284 ( "Player" text, "Team" text, "Matches" real, "Inns" real, "Runs" real, "Balls" real, "S/Rate" real, "100s" real, "Average" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many Matches have an Average larg...
SELECT COUNT("Matches") FROM table_61284 WHERE "Average" > '26.53' AND "S/Rate" = '165.4' AND "100s" < '1'
wikisql
CREATE TABLE table_name_60 ( province VARCHAR, icao VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the Province with ICAO of zbcf?
SELECT province FROM table_name_60 WHERE icao = "zbcf"
sql_create_context
CREATE TABLE category ( id int, business_id varchar, category_name varchar ) CREATE TABLE user ( uid int, user_id varchar, name varchar ) CREATE TABLE business ( bid int, business_id varchar, name varchar, full_address varchar, city varchar, latitude varchar, longit...
SELECT user.name FROM review, user WHERE user.user_id = review.user_id GROUP BY user.name HAVING AVG(review.rating) < 3
yelp
CREATE TABLE table_203_442 ( id number, "#" number, "date" text, "venue" text, "opponent" text, "score" text, "result" text, "competition" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many friendly competitions occurred before sept...
SELECT COUNT(*) FROM table_203_442 WHERE "date" < 9 AND "competition" = 'friendly'
squall
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 Allergy_Type ( Allergy VARCHAR(20), AllergyType VARCHAR(20) ) CREATE TABLE Has_Allergy ( StuID INTEGE...
SELECT city_code, COUNT(*) FROM Student GROUP BY city_code ORDER BY city_code
nvbench
CREATE TABLE table_204_517 ( id number, "name" text, "date of birth" text, "club" text, "division" text, "appointed" text, "time as manager" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what club is listed next to june 4 , 1972 ?
SELECT "club" FROM table_204_517 WHERE "date of birth" = '4 june 1972'
squall
CREATE TABLE Customers_Cards ( card_id INTEGER, customer_id INTEGER, card_type_code VARCHAR(15), card_number VARCHAR(80), date_valid_from DATETIME, date_valid_to DATETIME, other_card_details VARCHAR(255) ) CREATE TABLE Customers ( customer_id INTEGER, customer_first_name VARCHAR(20)...
SELECT card_type_code, SUM(card_number) FROM Customers_Cards GROUP BY card_type_code ORDER BY SUM(card_number)
nvbench
CREATE TABLE table_29960 ( "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. -- How many times did the Centurions...
SELECT COUNT("Game site") FROM table_29960 WHERE "Opponent" = 'Rhein Fire'
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 diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions...
SELECT MAX(demographic.age) FROM demographic WHERE demographic.marital_status = "DIVORCED" AND demographic.diagnosis = "SIGMOID DIVERTICULITIS, COLOVESTICAL FISTULA/SDA"
mimicsql_data
CREATE TABLE jyjgzbb ( JYZBLSH text, YLJGDM text, BGDH text, BGRQ time, JYRQ time, JCRGH text, JCRXM text, SHRGH text, SHRXM text, JCXMMC text, JCZBDM text, JCFF text, JCZBMC text, JCZBJGDX text, JCZBJGDL number, JCZBJGDW text, SBBM text, YQBH text...
SELECT KH, KLX FROM zyjzjlb WHERE JZLSH = '66325036704'
css
CREATE TABLE table_27946889_2 ( represent_province VARCHAR, hometown VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the represent province for the contestant whose hometown is Woerden?
SELECT represent_province FROM table_27946889_2 WHERE hometown = "Woerden"
sql_create_context
CREATE TABLE table_12886178_4 ( points_for VARCHAR, tries_for VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the points for count for the club with tries for count of 29?
SELECT points_for FROM table_12886178_4 WHERE tries_for = "29"
sql_create_context
CREATE TABLE candidate ( Candidate_ID int, People_ID int, Poll_Source text, Date text, Support_rate real, Consider_rate real, Oppose_rate real, Unsure_rate real ) CREATE TABLE people ( People_ID int, Sex text, Name text, Date_of_Birth text, Height real, Weight re...
SELECT Sex, AVG(Height) FROM people GROUP BY Sex ORDER BY Sex DESC
nvbench
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 ( BBCJBW text, BBDM tex...
SELECT jyjgzbb.JYZBLSH FROM hz_info JOIN txmzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX AND txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.B...
css
CREATE TABLE table_19855 ( "Stage" real, "Winner" text, "General classification" text, "Points classification" text, "Mountains classification" text, "Combination classification" text, "Team classification" text ) -- Using valid SQLite, answer the following questions for the tables provide...
SELECT "Team classification" FROM table_19855 WHERE "Combination classification" = 'Mederic Clain'
wikisql
CREATE TABLE table_14242 ( "Round" real, "Pick #" real, "Player" text, "Position" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which round was the defensive tackle picked after 187?
SELECT AVG("Round") FROM table_14242 WHERE "Position" = 'defensive tackle' AND "Pick #" > '187'
wikisql
CREATE TABLE table_53670 ( "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 number of bronze that silver is smaller than 1 and gold bigger than 0?
SELECT AVG("Bronze") FROM table_53670 WHERE "Silver" < '1' AND "Gold" > '0'
wikisql
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 qtb.MED_ORG_DEPT_NM, qtb.IN_DIAG_DIS_NM, AVG(qtb.PERSON_AGE) FROM qtb WHERE qtb.MED_SER_ORG_NO = '3385540' GROUP BY qtb.MED_ORG_DEPT_NM, qtb.IN_DIAG_DIS_NM HAVING AVG(qtb.PERSON_AGE) < 14 UNION SELECT gyb.MED_ORG_DEPT_NM, gyb.IN_DIAG_DIS_NM, AVG(gyb.PERSON_AGE) FROM gyb WHERE gyb.MED_SER_ORG_NO = '3385540' GROUP...
css
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) C...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.short_title = "Metabolic encephalopathy"
mimicsql_data
CREATE TABLE table_31527 ( "Economy" text, "1980" real, "Gap from Thailand as of 1980 (times)" text, "1985" real, "1990" real, "1995" real, "2000" real, "2005" real, "2010" real, "2012" real, "Gap from Thailand as of 2012 (times)" text, "GDP as of 2012 after purchasing po...
SELECT MAX("2010") FROM table_31527 WHERE "Gap from Thailand as of 1980 (times)" = '2.43'
wikisql
CREATE TABLE ref_transaction_types ( transaction_type_code text, transaction_type_description text ) CREATE TABLE sales ( sales_transaction_id number, sales_details text ) CREATE TABLE purchases ( purchase_transaction_id number, purchase_details text ) CREATE TABLE investors ( investor_id...
SELECT date_of_transaction FROM transactions WHERE share_count > 100 OR amount_of_transaction > 1000
spider
CREATE TABLE table_name_28 ( mobile VARCHAR, chrome VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What percentage of users were using mobile browsers during the period in which 9.00% were using Chrome?
SELECT mobile FROM table_name_28 WHERE chrome = "9.00%"
sql_create_context
CREATE TABLE table_name_65 ( grid INTEGER, time VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Grid has a Time of +13.999?
SELECT MIN(grid) FROM table_name_65 WHERE time = "+13.999"
sql_create_context
CREATE TABLE table_name_40 ( date VARCHAR, venue VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When did a Venue of Antigua Recreation Ground happen?
SELECT date FROM table_name_40 WHERE venue = "antigua recreation ground"
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 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 WHERE demographic.age < "27" AND demographic.admityear < "2123"
mimicsql_data
CREATE TABLE table_202_54 ( id number, "song" text, "chinese" text, "hito radio\ntop 10" number, "9+2 music\ntop 15" number, "global asia\ntop 15" number, "ufo radio\ntop 15" number, "channel [v]\ntop 20" number, "mtv taiwan\ntop 20" number, "yes 93.3\ntop 20" number ) -- Using...
SELECT COUNT("song") FROM table_202_54 WHERE NOT "mtv taiwan\ntop 20" IS NULL
squall
CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE chartevents...
SELECT COUNT(*) > 0 FROM admissions WHERE admissions.subject_id = 18159 AND DATETIME(admissions.admittime) >= DATETIME(CURRENT_TIME(), '-3 year')
mimic_iii
CREATE TABLE table_44665 ( "Rider" text, "Manufacturer" text, "Laps" text, "Time/Retired" text, "Grid" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many laps has a grid of 5?
SELECT "Laps" FROM table_44665 WHERE "Grid" = '5'
wikisql
CREATE TABLE table_name_84 ( name_of_tournament VARCHAR, champions VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In What Tournament did Boris Becker have a Score of 7 6, 6 4?
SELECT name_of_tournament FROM table_name_84 WHERE champions = "boris becker" AND score = "7–6, 6–4"
sql_create_context
CREATE TABLE table_name_70 ( away_team VARCHAR, home_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was South Melbourne's away team opponents?
SELECT away_team FROM table_name_70 WHERE home_team = "south melbourne"
sql_create_context
CREATE TABLE table_32120 ( "Year" real, "Team" text, "Make" text, "Engine" text, "Class" text, "Rank" text, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tell me the most year for 3 points
SELECT MAX("Year") FROM table_32120 WHERE "Points" = '3'
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 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 NOT zyjzjlb.JZLSH IN (SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ >= '2004-09-08')
css
CREATE TABLE table_204_859 ( id number, "year" number, "seniors (trood award & rodda medal)" text, "reserves (rex hartley medal)" text, "under 18's (bruce wilkinson medal)" text, "under 16's (shaw/carter medal)" text ) -- Using valid SQLite, answer the following questions for the tables provid...
SELECT "under 18's (bruce wilkinson medal)" FROM table_204_859 WHERE NOT "under 18's (bruce wilkinson medal)" IS NULL ORDER BY "year" LIMIT 1
squall
CREATE TABLE table_name_22 ( round VARCHAR, method VARCHAR, time VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the total number of rounds when method is tko (punches) and time is 0:40?
SELECT COUNT(round) FROM table_name_22 WHERE method = "tko (punches)" AND time = "0:40"
sql_create_context
CREATE TABLE manager ( Manager_ID int, Name text, Country text, Working_year_starts text, Age int, Level int ) CREATE TABLE railway ( Railway_ID int, Railway text, Builder text, Built text, Wheels text, Location text, ObjectNumber text ) CREATE TABLE railway_manage ...
SELECT Working_year_starts, COUNT(Working_year_starts) FROM manager ORDER BY Level DESC
nvbench
CREATE TABLE table_17435 ( "#" real, "President" text, "Date of birth" text, "Date of inauguration" text, "Age at inauguration" text, "End of term" text, "Length of retirement" text, "Date of death" text, "Lifespan" text ) -- Using valid SQLite, answer the following questions for t...
SELECT "President" FROM table_17435 WHERE "Date of inauguration" = '4June1979'
wikisql
CREATE TABLE table_1341663_33 ( candidates VARCHAR, incumbent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who were the candidates when Shirley Chisholm was the incumbent?
SELECT candidates FROM table_1341663_33 WHERE incumbent = "Shirley Chisholm"
sql_create_context
CREATE TABLE table_name_83 ( birth_place VARCHAR, monarchs_served VARCHAR, entered_office VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the birth place of the prime minister who served George V and entered office on 23 October 1922?
SELECT birth_place FROM table_name_83 WHERE monarchs_served = "george v" AND entered_office = "23 october 1922"
sql_create_context
CREATE TABLE table_name_38 ( rank INTEGER, name VARCHAR, points VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Rank has a Name of thomas morgenstern, and Points larger than 368.9?
SELECT AVG(rank) FROM table_name_38 WHERE name = "thomas morgenstern" AND points > 368.9
sql_create_context
CREATE TABLE table_204_854 ( id number, "#" number, "wrestlers" text, "reign" number, "date" text, "days\nheld" number, "location" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which wrestler is previous from vacant
SELECT "wrestlers" FROM table_204_854 WHERE id = (SELECT id FROM table_204_854 WHERE "wrestlers" = 'vacant') - 1
squall
CREATE TABLE table_name_16 ( opponent VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the opponent on August 30?
SELECT opponent FROM table_name_16 WHERE date = "august 30"
sql_create_context
CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Per...
SELECT All_Home, Team_ID FROM basketball_match GROUP BY ACC_Road, All_Home
nvbench
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 zyjzjlb ( CYBQDM text, CYBQMC...
SELECT COUNT(*) FROM person_info JOIN hz_info JOIN wdmzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX WHERE person_info.XM = '邹浩慨' AND wdmzjzjlb.JZKSRQ BETWEEN '2001-06-20' AND '2018-02-12' AND wdmzjzjlb.YLJGDM = '6233907' UNI...
css
CREATE TABLE hz_info ( KH text, KLX number, YLJGDM text, RYBH text ) 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...
(SELECT * 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 AND jybgb.YLJGDM = jyjgzbb.YLJGD...
css
CREATE TABLE jybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH text, BGJGDM text, BGJGMC text, BGRGH text, BGRQ time, BGRXM text, BGSJ time, CJRQ time, JSBBRQSJ time, JSBBSJ time, JYBBH text, JYJGMC text, JYJSGH text, JYJSQM text, JY...
SELECT * FROM person_info JOIN hz_info JOIN mzjzjlb JOIN person_info_hz_info ON person_info.RYBH = person_info_hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND person_info_hz_info.KH = hz_info.KH AND person_info_hz_info.KLX = hz_info.KLX AND person_info_hz_i...
css
CREATE TABLE table_name_34 ( gold VARCHAR, silver VARCHAR, total VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total number of Gold, when Silver is 2, and when Total is less than 7?
SELECT COUNT(gold) FROM table_name_34 WHERE silver = 2 AND total < 7
sql_create_context
CREATE TABLE table_18037 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Game site" text, "Record" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Where did they play the San Diego Chargers?
SELECT "Game site" FROM table_18037 WHERE "Opponent" = 'San Diego Chargers'
wikisql
CREATE TABLE table_203_664 ( id number, "club" text, "town" text, "founded" number, "nickname" text, "colours" text, "home ground" text, "titles" number, "website" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many teams have th...
SELECT COUNT("club") FROM table_203_664 WHERE "colours" = 'red'
squall
CREATE TABLE table_46323 ( "Club" text, "Played" text, "Drawn" text, "Lost" text, "Points for" text, "Points against" text, "Points difference" text, "Bonus Points" text, "Points" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What i...
SELECT "Drawn" FROM table_46323 WHERE "Club" = 'newport rfc'
wikisql
CREATE TABLE table_35977 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Score of 6 4, and a Opponent of @ marlins had what record?
SELECT "Record" FROM table_35977 WHERE "Score" = '6–4' AND "Opponent" = '@ marlins'
wikisql
CREATE TABLE table_47935 ( "Hangul" text, "\u2019Phagspa" text, "Tibetan" text, "Phoenician" text, "Greek" text, "Latin" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- to the Latin of f, y, u/v/w?
SELECT "Greek" FROM table_47935 WHERE "Latin" = 'f, y, u/v/w'
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 lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
SELECT prescriptions.drug_type, prescriptions.drug_dose FROM prescriptions WHERE prescriptions.drug = "Oxacillin"
mimicsql_data
CREATE TABLE club ( Club_ID int, name text, Region text, Start_year text ) CREATE TABLE club_rank ( Rank real, Club_ID int, Gold real, Silver real, Bronze real, Total real ) CREATE TABLE competition_result ( Competition_ID int, Club_ID_1 int, Club_ID_2 int, Scor...
SELECT Position, COUNT(Position) FROM player GROUP BY Position HAVING AVG(Points) >= 20 ORDER BY COUNT(Position) DESC
nvbench
CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH text, KH text, KLX number, MZBMLX number, MZJZLSH text, MZZDBM text, MZZDMC text, MZZYZDZZBM...
SELECT zyjzjlb.ZYZDBM, zyjzjlb.ZYZDMC 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 = '尤慧捷'
css
CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime tim...
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', labevents.charttime)) FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'white blood cells') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 31088 AND a...
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 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 INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.short_title = "Angioneurotic edema" AND lab.flag = "abnormal"
mimicsql_data
CREATE TABLE table_204_782 ( id number, "state" text, "title" text, "name" text, "entered office" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many people entered office in 1970 ?
SELECT COUNT(*) FROM table_204_782 WHERE "entered office" = 1970
squall
CREATE TABLE table_423 ( "Year" real, "Product" text, "Production" text, "Consumption" text, "Import" text, "Export" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- The earliest year is 1996.
SELECT MIN("Year") FROM table_423
wikisql
CREATE TABLE table_31822 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Venue" text, "Attendance" real, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tell me the venue for record of 2-7
SELECT "Venue" FROM table_31822 WHERE "Record" = '2-7'
wikisql
CREATE TABLE status ( statusid number, status text ) CREATE TABLE results ( resultid number, raceid number, driverid number, constructorid number, number number, grid number, position number, positiontext text, positionorder number, points number, laps number, ti...
SELECT DISTINCT driverid, stop FROM pitstops WHERE duration < (SELECT MAX(duration) FROM pitstops WHERE raceid = 841)
spider
CREATE TABLE table_name_57 ( away_team VARCHAR, home_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the score for the away team when they played collingwood?
SELECT away_team AS score FROM table_name_57 WHERE home_team = "collingwood"
sql_create_context
CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE Posts ( ...
SELECT Id AS "user_link", DATEDIFF(day, LastAccessDate, GETDATE()) AS DaysSinceLastVisit FROM Users WHERE Reputation >= 2000 AND DATEDIFF(day, LastAccessDate, GETDATE()) < 30 ORDER BY DaysSinceLastVisit
sede
CREATE TABLE table_name_87 ( loss VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which loss happened april 18?
SELECT loss FROM table_name_87 WHERE date = "april 18"
sql_create_context