instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE SuggestedEdits ( ...
SELECT Users.Id AS "user_link", Users.DisplayName, Users.Reputation, SUM(CASE WHEN Posts.PostTypeId = 1 THEN 1 ELSE 0 END) AS Questions, SUM(CASE WHEN Posts.PostTypeId = 2 THEN 1 ELSE 0 END) AS Answers, Users.UpVotes, Users.DownVotes FROM Users INNER JOIN Posts ON Users.Id = Posts.OwnerUserId AND (Posts.PostTypeId = 1 ...
sede
CREATE TABLE table_64464 ( "Rank" real, "Lane" real, "Name" text, "Nationality" text, "Time" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Rank of the swimmer with a Time of 49 in Lane 7 or larger?
SELECT COUNT("Rank") FROM table_64464 WHERE "Time" = '49' AND "Lane" > '7'
wikisql
CREATE TABLE table_54290 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What team was the home team when the away team s...
SELECT "Home team" FROM table_54290 WHERE "Away team score" = '12.11 (83)'
wikisql
CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, outtime time ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dis...
SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT t3.itemid FROM (SELECT t2.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime, admissions.hadm_id FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id W...
mimic_iii
CREATE TABLE table_26537 ( "Edition" text, "Round" text, "Date" text, "Against" text, "Surface" text, "Opponent" text, "Win/Lose" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is every surface against Sweden?
SELECT "Surface" FROM table_26537 WHERE "Against" = 'Sweden'
wikisql
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtim...
SELECT COUNT(*) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-142451')) AND intakeoutput.cellpath LIKE '%intake%' AND intakeoutput.c...
eicu
CREATE TABLE table_name_9 ( khmer INTEGER, ala_lc VARCHAR, value VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is smallest Khmer valued less than 90 have a kau sip ALA-LC?
SELECT MIN(khmer) FROM table_name_9 WHERE ala_lc = "kau sip" AND value < 90
sql_create_context
CREATE TABLE table_204_479 ( id number, "defendant" text, "arrested" text, "charge" text, "result" text, "sentence" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which is the only defendant who was tried and found not guilty ?
SELECT "defendant" FROM table_204_479 WHERE "result" = 'tried, found not guilty'
squall
CREATE TABLE table_name_48 ( winner VARCHAR, points_classification VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the winner in the stage that Damiano Cunego led the points classification?
SELECT winner FROM table_name_48 WHERE points_classification = "damiano cunego"
sql_create_context
CREATE TABLE table_name_80 ( score VARCHAR, location VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the score at Olympia fields, illinois?
SELECT score FROM table_name_80 WHERE location = "olympia fields, illinois"
sql_create_context
CREATE TABLE table_24881 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which series number has th...
SELECT COUNT("No. in series") FROM table_24881 WHERE "Production code" = '7.07'
wikisql
CREATE TABLE table_70890 ( "Auckland" text, "Gold Coast" text, "Sydney" text, "Melbourne" text, "Adelaide" text, "Perth" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Perth has Auckland yes and Gold Coast yes?
SELECT "Perth" FROM table_70890 WHERE "Auckland" = 'yes' AND "Gold Coast" = 'yes'
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 SUM(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.PERSON_ID = '61183552' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2003-06-24' AND '2008-06-14'
css
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id t...
SELECT demographic.days_stay FROM demographic WHERE demographic.name = "Jerry Deberry"
mimicsql_data
CREATE TABLE table_name_10 ( release_date VARCHAR, title VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the release date of Forward March Hare?
SELECT release_date FROM table_name_10 WHERE title = "forward march hare"
sql_create_context
CREATE TABLE table_58204 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On what Date was the Home Team Score 9.13 (67)?
SELECT "Date" FROM table_58204 WHERE "Home team score" = '9.13 (67)'
wikisql
CREATE TABLE table_58498 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the away team score when the home team i...
SELECT "Away team score" FROM table_58498 WHERE "Home team" = 'essendon'
wikisql
CREATE TABLE table_57264 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the home team score that played away tea...
SELECT "Home team score" FROM table_57264 WHERE "Away team" = 'carlton'
wikisql
CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE admissions ( row_id num...
SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime, admissions.hadm_id FROM procedures_icd JOIN admissions ON procedures_i...
mimic_iii
CREATE TABLE table_14146 ( "Manufacturer" text, "Transmission" text, "Engine Capacity" real, "Fuel Type" text, "L/100km Urban (Cold)" real, "L/100km Extra-Urban" real, "L/100km Combined" real, "mpg-UK Urban (Cold)" real, "mpg-UK Extra-Urban" real, "mpg-UK Combined" real, "mpg...
SELECT "Green Rating" FROM table_14146 WHERE "L/100km Urban (Cold)" > '10.9' AND "mpg-US Urban" > '14.1' AND "Manufacturer" = 'volkswagen' AND "Engine Capacity" < '3189'
wikisql
CREATE TABLE table_6357 ( "Games" real, "Drawn" real, "Lost" real, "Points difference" text, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest drawn that has games less than 7?
SELECT MIN("Drawn") FROM table_6357 WHERE "Games" < '7'
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 demographic (...
SELECT demographic.days_stay FROM demographic WHERE demographic.name = "Steven Sepulveda"
mimicsql_data
CREATE TABLE table_55481 ( "Tournament" text, "2007" text, "2008" text, "2009" text, "2010" text, "2011" text, "2012" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the categorization in 2010 when it was A in 2008 and 20011 while bei...
SELECT "2010" FROM table_55481 WHERE "2008" = 'a' AND "2011" = 'a' AND "2012" = 'qf'
wikisql
CREATE TABLE table_49983 ( "Name" text, "Built" text, "Listed" text, "Location" text, "County" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the date Listed of the Bridge Built CA.1876?
SELECT "Listed" FROM table_49983 WHERE "Built" = 'ca.1876'
wikisql
CREATE TABLE table_42839 ( "Name" text, "Seat" text, "Population (2011)" real, "Area (km 2 )" real, "Density (inhabitants/km 2 )" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest population for the area that has a density of 36.7?
SELECT MIN("Population (2011)") FROM table_42839 WHERE "Density (inhabitants/km 2 )" = '36.7'
wikisql
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 text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, ...
SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_ID = '15522613' AND t_kc22.STA_DATE BETWEEN '2007-12-20' AND '2016-09-01' AND t_kc22.MED_INV_ITEM_TYPE = '西药费'
css
CREATE TABLE table_name_4 ( player VARCHAR, lifespan VARCHAR, rank VARCHAR, country VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Player has a Rank of t12, and a Country of taiwan, and a Lifespan of 1963 ?
SELECT player FROM table_name_4 WHERE rank = "t12" AND country = "taiwan" AND lifespan = "1963–"
sql_create_context
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 Sex
nvbench
CREATE TABLE ref_service_types ( service_type_code text, parent_service_type_code text, service_type_description text ) CREATE TABLE drama_workshop_groups ( workshop_group_id number, address_id number, currency_code text, marketing_region_code text, store_name text, store_phone text...
SELECT status_code FROM bookings GROUP BY status_code ORDER BY COUNT(*) DESC LIMIT 1
spider
CREATE TABLE table_name_44 ( team VARCHAR, school VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the team for school of milford
SELECT team FROM table_name_44 WHERE school = "milford"
sql_create_context
CREATE TABLE employees ( employee_id VARCHAR, job_id VARCHAR, salary INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- display the employee number and job id for all employees whose salary is smaller than any salary of those employees whose job title is MK_...
SELECT employee_id, job_id FROM employees WHERE salary < (SELECT MIN(salary) FROM employees WHERE job_id = 'MK_MAN')
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 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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.age < "82" AND procedures.short_title = "Endosc destruc esoph les"
mimicsql_data
CREATE TABLE journal ( journal_id number, date text, theme text, sales number ) CREATE TABLE journal_committee ( editor_id number, journal_id number, work_type text ) CREATE TABLE editor ( editor_id number, name text, age number ) -- Using valid SQLite, answer the following q...
SELECT name, age FROM editor
spider
CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE PostTags ( PostId num...
SELECT * FROM Votes WHERE PostId = 12505377
sede
CREATE TABLE table_name_48 ( division_record VARCHAR, team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Panthers' Division Record?
SELECT division_record FROM table_name_48 WHERE team = "panthers"
sql_create_context
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "M" AND demographic.days_stay > "6"
mimicsql_data
CREATE TABLE Ref_Address_Types ( address_type_code VARCHAR(15), address_type_description VARCHAR(80) ) CREATE TABLE Student_Addresses ( student_id INTEGER, address_id INTEGER, date_address_from DATETIME, date_address_to DATETIME, monthly_rental DECIMAL(19,4), other_details VARCHAR(255) ...
SELECT date_incident_start, COUNT(date_incident_start) FROM Behavior_Incident WHERE incident_type_code = "NOISE" ORDER BY COUNT(date_incident_start)
nvbench
CREATE TABLE table_203_573 ( id number, "name" text, "rank - 2000" number, "number" number, "country of origin" text, "england - 2001" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which are they only two names that have spain as their country ...
SELECT "name" FROM table_203_573 WHERE "country of origin" = 'spain'
squall
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 * FROM jyjgzbb WHERE JCZBMC = (SELECT JCZBMC FROM jyjgzbb WHERE JYZBLSH = '12267094021') AND JCZBJGDW = (SELECT JCZBJGDW FROM jyjgzbb WHERE JYZBLSH = '12267094021') AND JCZBJGDL >= (SELECT JCZBJGDL FROM jyjgzbb WHERE JYZBLSH = '12267094021')
css
CREATE TABLE table_69732 ( "Outcome" text, "Date" text, "Surface" text, "Partner" text, "Opponents" text, "Score" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the Outcome for the Date of July 16, 2011?
SELECT "Outcome" FROM table_69732 WHERE "Date" = 'july 16, 2011'
wikisql
CREATE TABLE architect ( id VARCHAR, name VARCHAR ) CREATE TABLE bridge ( architect_id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the ids and names of the architects who built at least 3 bridges ?
SELECT T1.id, T1.name FROM architect AS T1 JOIN bridge AS T2 ON T1.id = T2.architect_id GROUP BY T1.id HAVING COUNT(*) >= 3
sql_create_context
CREATE TABLE table_name_1 ( driver VARCHAR, chassis VARCHAR, rounds VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who drove the car with the n175 chassis in round 13?
SELECT driver FROM table_name_1 WHERE chassis = "n175" AND rounds = "13"
sql_create_context
CREATE TABLE table_train_206 ( "id" int, "gender" string, "pregnancy_or_lactation" bool, "systolic_blood_pressure_sbp" int, "hematocrit_hct" float, "diabetic" string, "contraception" bool, "diastolic_blood_pressure_dbp" int, "serum_creatinine" float, "NOUSE" float ) -- Using va...
SELECT * FROM table_train_206 WHERE diabetic = 'i'
criteria2sql
CREATE TABLE table_26267607_2 ( pole_position VARCHAR, winning_driver VARCHAR, circuit VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In the circuit Showevent Olympiastadion M nchen, where the winning driver is Bruno Spengler, what is the pole position?
SELECT pole_position FROM table_26267607_2 WHERE winning_driver = "Bruno Spengler" AND circuit = "Showevent Olympiastadion München"
sql_create_context
CREATE TABLE table_45029 ( "Driver" text, "Points" real, "Wins" real, "Top 5" real, "Top 10" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Frank Kimmel's lowest top 5 with more than 0 wins and fewer than 14 top 10s?
SELECT MIN("Top 5") FROM table_45029 WHERE "Wins" > '0' AND "Driver" = 'frank kimmel' AND "Top 10" < '14'
wikisql
CREATE TABLE table_name_61 ( outcome VARCHAR, championship VARCHAR, score_in_the_final VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Outcome has a Championship of us championships, and a Score in the final of 5 7, 6 1, 6 3, 6 3?
SELECT outcome FROM table_name_61 WHERE championship = "us championships" AND score_in_the_final = "5–7, 6–1, 6–3, 6–3"
sql_create_context
CREATE TABLE table_48668 ( "Cat. #" text, "Artist" text, "Title" text, "Release date" text, "Format" text, "Other information" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the title released on 24 July 2005?
SELECT "Title" FROM table_48668 WHERE "Release date" = '24 july 2005'
wikisql
CREATE TABLE table_name_70 ( coding VARCHAR, variant_id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which 5'utr splice's coding is 1a 2, when the Variant id is abd'1a 2?
SELECT 5 AS ’utr_splice FROM table_name_70 WHERE coding = "1a 2" AND variant_id = "abd'1a 2"
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 MIN(demographic.age) FROM demographic WHERE demographic.gender = "F" AND demographic.age >= "89"
mimicsql_data
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 patient.hospitaldischargetime FROM patient WHERE patient.uniquepid = '029-27704' ORDER BY patient.hospitaldischargetime DESC LIMIT 1
eicu
CREATE TABLE table_10257 ( "Team" text, "Stadium" text, "Capacity" real, "Highest" real, "Lowest" real, "Average" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the sum of the lowest in attendance when the average is 1,166 and most in at...
SELECT SUM("Lowest") FROM table_10257 WHERE "Average" = '1,166' AND "Highest" < '2,215'
wikisql
CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment tex...
SELECT DisplayName AS "user", COUNT(Posts.Id) AS Questions FROM Posts INNER JOIN Users ON Users.Id = OwnerUserId WHERE PostTypeId = 2 GROUP BY Users.Id, DisplayName ORDER BY 'questions' DESC LIMIT 10
sede
CREATE TABLE table_52612 ( "Block A" text, "Akira" text, "Atsushi Aoki" text, "Black Tiger V" text, "Jado" text, "Milano Collection A.T." text, "Prince Devitt" text, "Tiger Mask IV" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is ...
SELECT "Akira" FROM table_52612 WHERE "Tiger Mask IV" = 'akira (10:05)'
wikisql
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2105" AND diagnoses.long_title = "Personal history of other malignant neoplasm of skin"
mimicsql_data
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 jyjgzbb ( BGDH text, BGRQ tim...
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 >= '2019-07-16')
css
CREATE TABLE table_11947 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the lowest Crowd Size for the Home Team...
SELECT MIN("Crowd") FROM table_11947 WHERE "Home team" = 'north melbourne'
wikisql
CREATE TABLE table_54839 ( "Block A" text, "Antonio Thomas" text, "Hikaru Sato" text, "Hiroshi Yamato" text, "Kaz Hayashi" text, "Minoru" text, "Super Crazy" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Tell me the block A for antonio thom...
SELECT "Block A" FROM table_54839 WHERE "Antonio Thomas" = 'kondo (13:24)'
wikisql
CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) -- 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 ORDER BY T1.Code DESC
nvbench
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, COUNT(All_Home) FROM basketball_match GROUP BY All_Home ORDER BY COUNT(All_Home)
nvbench
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 AVG(MED_AMOUT) FROM t_kc24 WHERE MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc21 WHERE PERSON_AGE <= 3)
css
CREATE TABLE table_895 ( "Model Number" text, "Stepping" text, "Frequency" text, "L2 Cache" text, "HT" text, "Multi 1" text, "V Core" text, "TDP" text, "Socket" text, "Release Date" text, "Part Number(s)" text ) -- Using valid SQLite, answer the following questions for the ...
SELECT "Frequency" FROM table_895 WHERE "Part Number(s)" = 'ADO520BIAA5DO'
wikisql
CREATE TABLE table_20530 ( "Institution" text, "Location" text, "Founded" real, "Affiliation" text, "Enrollment" real, "Team Nickname" text, "Primary conference" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What year was the university tha...
SELECT MIN("Founded") FROM table_20530 WHERE "Location" = 'Ellensburg, Washington'
wikisql
CREATE TABLE table_26002 ( "Province" text, "Mahmoud Ahmadinejad" real, "Mehdi Karroubi" real, "Mir-Hossein Mousavi" real, "Mohsen Rezaee" real, "Spoiled ballots" real, "Total votes" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was th...
SELECT MAX("Mir-Hossein Mousavi") FROM table_26002 WHERE "Spoiled ballots" = '5683'
wikisql
CREATE TABLE flight ( aircraft_code_sequence text, airline_code varchar, airline_flight text, arrival_time int, connections int, departure_time int, dual_carrier text, flight_days text, flight_id int, flight_number int, from_airport varchar, meal_code text, stops 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 = 'HOUSTON' AND flight.arrival_time = 1100 AND flight.to_airport = AIRPORT_SERVICE_1.airpor...
atis
CREATE TABLE table_name_20 ( date VARCHAR, distance VARCHAR, course VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the date with the distance of km (mi) at the course of roccaraso to san giorgio del sannio?
SELECT date FROM table_name_20 WHERE distance = "km (mi)" AND course = "roccaraso to san giorgio del sannio"
sql_create_context
CREATE TABLE table_name_66 ( club VARCHAR, league_goals VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Club has a League goals of 21?
SELECT club FROM table_name_66 WHERE league_goals = "21"
sql_create_context
CREATE TABLE table_22788 ( "Match no." real, "Match Type" text, "Team Europe" text, "Score" text, "Team USA" text, "Progressive Total" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many different scores did Team Europe get when Mika Koivuni...
SELECT COUNT("Score") FROM table_22788 WHERE "Team Europe" = 'Mika Koivuniemi'
wikisql
CREATE TABLE Transactions_Lots ( transaction_id INTEGER, lot_id INTEGER ) CREATE TABLE Investors ( investor_id INTEGER, Investor_details VARCHAR(255) ) CREATE TABLE Purchases ( purchase_transaction_id INTEGER, purchase_details VARCHAR(255) ) CREATE TABLE Sales ( sales_transaction_id INTEG...
SELECT T2.date_of_transaction, COUNT(T2.date_of_transaction) FROM Ref_Transaction_Types AS T1 JOIN Transactions AS T2 ON T1.transaction_type_code = T2.transaction_type_code WHERE T2.share_count < 10 GROUP BY transaction_type_description ORDER BY date_of_transaction DESC
nvbench
CREATE TABLE table_name_17 ( episodes INTEGER, tv_station VARCHAR, japanese_title VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Episodes have a TV Station of ntv, and a Japanese Title of ?
SELECT AVG(episodes) FROM table_name_17 WHERE tv_station = "ntv" AND japanese_title = "あいのうた"
sql_create_context
CREATE TABLE table_name_60 ( year VARCHAR, original_title VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the year of Meg ll az Id ?
SELECT year FROM table_name_60 WHERE original_title = "megáll az idö"
sql_create_context
CREATE TABLE table_70475 ( "Year" real, "Chassis" text, "Engine" text, "Tyres" text, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the least Points with Chassis of forti fg01b forti fg03, and a year less than 1996?
SELECT MIN("Points") FROM table_70475 WHERE "Chassis" = 'forti fg01b forti fg03' AND "Year" < '1996'
wikisql
CREATE TABLE table_203_631 ( id number, "year" number, "name of show" text, "episodes" text, "other guests" text, "winner(s)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many episodes was charmaine sheh on in the variety show super trio 2...
SELECT "episodes" FROM table_203_631 WHERE "name of show" = 'super trio series 2: movie buff championship'
squall
CREATE TABLE table_name_60 ( segment_d VARCHAR, segment_a VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the segment D for umbrellas
SELECT segment_d FROM table_name_60 WHERE segment_a = "umbrellas"
sql_create_context
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 flight ( aircraft_code_sequence text, airline_code varchar, airline_flight text, ...
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 = 'DENVER' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PHILADE...
atis
CREATE TABLE table_204_394 ( id number, "year" number, "album" text, "label" text, "peak chart\npositions\nus" number, "peak chart\npositions\nus r&b" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- in what year was the only album on the fontan...
SELECT "year" FROM table_204_394 WHERE "label" = 'fontana'
squall
CREATE TABLE mzjybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH number, BGJGDM text, BGJGMC text, BGRGH text, BGRQ time, BGRXM text, BGSJ time, CJRQ time, JSBBRQSJ time, JSBBSJ time, JYBBH text, JYJGMC text, JYJSGH text, JYJSQM text, ...
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN mzjzjlb JOIN zyjybgb 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 = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZ...
css
CREATE TABLE table_45450 ( "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 for gary player?
SELECT "Place" FROM table_45450 WHERE "Player" = 'gary player'
wikisql
CREATE TABLE table_34470 ( "Party" text, "Votes" real, "Share" text, "Change" text, "Seats" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the change for english democrats
SELECT "Change" FROM table_34470 WHERE "Party" = 'english democrats'
wikisql
CREATE TABLE table_name_72 ( score VARCHAR, game VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the score of game 37?
SELECT score FROM table_name_72 WHERE game = 37
sql_create_context
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Alzheimer's disease" AND prescriptions.route = "PO/NG"
mimicsql_data
CREATE TABLE table_57281 ( "Last" text, "First" text, "Year" real, "Sport" text, "Country" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the last for softball before 2000
SELECT "Last" FROM table_57281 WHERE "Year" < '2000' AND "Sport" = 'softball'
wikisql
CREATE TABLE table_1413 ( "Country" text, "Freedom in the World 2013" text, "2013 Index of Economic Freedom" text, "2013 Press Freedom Index" text, "2012 Democracy Index" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What type of government does Ky...
SELECT "2012 Democracy Index" FROM table_1413 WHERE "Country" = 'Kyrgyzstan'
wikisql
CREATE TABLE table_224672_2 ( term_began VARCHAR, term_ended VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When did the term begin that ended January 3, 1995?
SELECT term_began FROM table_224672_2 WHERE term_ended = "January 3, 1995"
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 OUT_DIAG_DIS_CD, OUT_DIAG_DIS_NM FROM t_kc21 WHERE PERSON_NM = '章恺乐' AND MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc24 WHERE MED_AMOUT > 3006.5)
css
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 t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM, t_kc22.QTY, t_kc22.UNIVALENT, t_kc22.AMOUNT FROM gwyjzb JOIN t_kc22 ON gwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gwyjzb.PERSON_NM = '马静慧' AND gwyjzb.IN_HOSP_DATE BETWEEN '2006-08-11' AND '2020-03-21' UNION SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_...
css
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.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN mzjzjlb_jybgb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb...
css
CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) 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 in...
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, flight, flight_fare WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BALTIMORE' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.ci...
atis
CREATE TABLE documents_mailed ( document_id number, mailed_to_address_id number, mailing_date time ) CREATE TABLE ref_document_status ( document_status_code text, document_status_description text ) CREATE TABLE document_drafts ( document_id number, draft_number number, draft_details te...
SELECT document_id FROM documents WHERE document_status_code = "done" AND document_type_code = "Paper"
spider
CREATE TABLE table_name_64 ( year INTEGER, album VARCHAR, us_hot_100 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Year has an Album of airwaves, and a US Hot 100 of ?
SELECT MAX(year) FROM table_name_64 WHERE album = "airwaves" AND us_hot_100 = "–"
sql_create_context
CREATE TABLE table_58075 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Away team score for mcg?
SELECT "Away team score" FROM table_58075 WHERE "Venue" = 'mcg'
wikisql
CREATE TABLE table_27478 ( "Rank" real, "Rank w/o Hydropower" real, "State" text, "% Renewable" text, "% Renewable w/o Hydro" text, "Renewable electricity (GW\u00b7h)" real, "Renewable electricity w/o Hydro (GW\u00b7h)" real, "Total electricity (GW\u00b7h)" real ) -- Using valid SQLite...
SELECT MAX("Rank") FROM table_27478 WHERE "% Renewable w/o Hydro" = '2.17%'
wikisql
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic (...
SELECT MIN(demographic.age) FROM demographic WHERE demographic.marital_status = "SINGLE" AND demographic.diagnosis = "LEFT COLON CANCER"
mimicsql_data
CREATE TABLE Courses ( course_id INTEGER, author_id INTEGER, subject_id INTEGER, course_name VARCHAR(120), course_description VARCHAR(255) ) CREATE TABLE Student_Tests_Taken ( registration_id INTEGER, date_test_taken DATETIME, test_result VARCHAR(255) ) CREATE TABLE Students ( stud...
SELECT course_name, COUNT(*) FROM Courses AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.course_id = T2.course_id GROUP BY T1.course_name ORDER BY COUNT(*) DESC
nvbench
CREATE TABLE table_1820752_1 ( signal_power___kw__ VARCHAR, arrival_date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- If the arrival date is January 2059, what is the total amount of signal power?
SELECT COUNT(signal_power___kw__) FROM table_1820752_1 WHERE arrival_date = "January 2059"
sql_create_context
CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW text, JCZBJGDX text, JCZBMC text, JLDW text, JYRQ time, JYZBLSH text, ...
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN jybgb_jyjgzbb ON 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 = jybgb_jyjgzbb.Y...
css
CREATE TABLE table_name_10 ( score VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the score for 1911?
SELECT score FROM table_name_10 WHERE year = 1911
sql_create_context
CREATE TABLE table_17598822_11 ( league VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the total number of league cup for mark roberts
SELECT COUNT(league) AS Cup FROM table_17598822_11 WHERE player = "Mark Roberts"
sql_create_context
CREATE TABLE table_name_30 ( zone INTEGER, champion VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Zone has a Champion of surozh sudak?
SELECT SUM(zone) FROM table_name_30 WHERE champion = "surozh sudak"
sql_create_context
CREATE TABLE table_203_5 ( id number, "season" text, "competition" text, "round" text, "opponent" text, "home" text, "away" text, "aggregate" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many home games did st. gallen win ?
SELECT COUNT(*) FROM table_203_5 WHERE "home" > "home"
squall
CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE T...
SELECT T.TagName, COUNT(*) AS "total", SUM(CASE WHEN NOT P.AcceptedAnswerId IS NULL THEN 1 ELSE 0 END) AS "answered", SUM(CASE WHEN NOT p.ClosedDate IS NULL THEN 1 ELSE 0 END) AS "closed", AVG(CAST(p.Score AS FLOAT)) AS "average_score", STDEV(CAST(p.Score AS FLOAT)) AS "std._dev" FROM Posts AS P INNER JOIN PostTags AS ...
sede