instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_name_39 ( bronze VARCHAR, rank VARCHAR, silver VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the total number of bronze with rank of 5 and silver more than 1
SELECT COUNT(bronze) FROM table_name_39 WHERE rank = "5" AND silver > 1
sql_create_context
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_kc24 ON t_kc21.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc21.PERSON_NM = '潘和正' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2006-11-28' AND '2019-10-22' AND t_kc24.MED_AMOUT <= 10
css
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime t...
SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'acute renal failure - due to sepsis' AND STRFTIME('%y', diagnosis.diagnos...
eicu
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 prescriptions...
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.icd9_code = "5589" AND lab.fluid = "Blood"
mimicsql_data
CREATE TABLE table_train_227 ( "id" int, "gender" string, "diabetic" string, "allergic_to_study_products" bool, "hba1c" float, "a1c" float, "age" float, "NOUSE" float ) -- Using valid SQLite, answer the following questions for the tables provided above. -- a diagnosis of type i diabet...
SELECT * FROM table_train_227 WHERE diabetic = 'i'
criteria2sql
CREATE TABLE table_name_53 ( grid VARCHAR, time_retired VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total grid of the team with a time/retired of +7.346?
SELECT COUNT(grid) FROM table_name_53 WHERE time_retired = "+7.346"
sql_create_context
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admityear < "2145" AND prescriptions.route = "IVPCA"
mimicsql_data
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number,...
SELECT vitalperiodic.observationtime FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '022-89058') AND NOT patient.unitdischargetime IS NU...
eicu
CREATE TABLE photos ( id int, camera_lens_id int, mountain_id int, color text, name text ) CREATE TABLE camera_lens ( id int, brand text, name text, focal_length_mm real, max_aperture real ) CREATE TABLE mountain ( id int, name text, Height real, Prominence real...
SELECT brand, COUNT(brand) FROM camera_lens GROUP BY brand ORDER BY COUNT(brand) DESC
nvbench
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 demographic.days_stay, demographic.admittime FROM demographic WHERE demographic.name = "Paul Edwards"
mimicsql_data
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(Weight) FROM people GROUP BY Sex ORDER BY Sex DESC
nvbench
CREATE TABLE table_name_65 ( penanced VARCHAR, executions_in_effigie VARCHAR, total VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many were penanced with 0 executions in effigie for a total of 21?
SELECT penanced FROM table_name_65 WHERE executions_in_effigie = "0" AND total = "21"
sql_create_context
CREATE TABLE table_17846 ( "Club" text, "Played" text, "Won" text, "Drawn" text, "Lost" text, "Points for" text, "Points against" text, "Tries for" text, "Tries against" text, "Try bonus" text, "Losing bonus" text, "Points" text ) -- Using valid SQLite, answer the follo...
SELECT "Points" FROM table_17846 WHERE "Club" = 'Croesyceiliog RFC'
wikisql
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 hz_info ( KH text, KLX number...
SELECT zzmzjzjlb.JZLSH FROM person_info JOIN hz_info JOIN zzmzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX WHERE person_info.XM = '鲁俊健' AND hz_info.YLJGDM = '5241360' AND zzmzjzjlb.JZKSMC LIKE '%肾内%' UNION SELECT fzzmzjzjlb....
css
CREATE TABLE table_170958_2 ( population INTEGER, area_km_2 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the maximum population of the land with an area of 276.84 km2?
SELECT MAX(population) FROM table_170958_2 WHERE area_km_2 = "276.84"
sql_create_context
CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDat...
WITH cte AS (SELECT DISTINCT q.Id AS "post_link", COUNT(p.Id) OVER (PARTITION BY q.Id) AS "upvotedanswercount", COUNT(a.Id) OVER (PARTITION BY q.Id) AS totalAnswers, q.Score FROM Posts AS q LEFT JOIN Posts AS p ON q.Id = p.ParentId AND p.Score >= 0 INNER JOIN Posts AS a ON a.ParentId = q.Id WHERE q.Score >= 1) SELECT *...
sede
CREATE TABLE domain ( did int, name varchar ) CREATE TABLE cite ( cited int, citing int ) CREATE TABLE keyword ( keyword varchar, kid int ) CREATE TABLE journal ( homepage varchar, jid int, name varchar ) CREATE TABLE writes ( aid int, pid int ) CREATE TABLE domain_publi...
SELECT keyword FROM keyword
academic
CREATE TABLE table_21945 ( "Actor in original production" text, "Actor required" text, "GamePlan" text, "FlatSpin" text, "RolePlay" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many RolePlay actors played the role requiring a 'male, younger' a...
SELECT COUNT("RolePlay") FROM table_21945 WHERE "Actor required" = 'Male, younger'
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 T2.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T1.Code
nvbench
CREATE TABLE table_name_33 ( seats_2006 INTEGER, parties_and_voter_communities VARCHAR, _percentage_2006 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the total number of seats 2006 that has parties and voter turnout in % and whose %2006 is grea...
SELECT SUM(seats_2006) FROM table_name_33 WHERE parties_and_voter_communities = "voter turnout in %" AND _percentage_2006 > 51.5
sql_create_context
CREATE TABLE table_23242933_2 ( title VARCHAR, us_viewers__millions_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many different titles are there of episodes that have been seen by 7.84 million people in the US/
SELECT COUNT(title) FROM table_23242933_2 WHERE us_viewers__millions_ = "7.84"
sql_create_context
CREATE TABLE table_59227 ( "Date" text, "Round" text, "Opponents" text, "H / A" text, "Result F\u2013A" text, "Attendance" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the H/A of the game on 24 january 2009?
SELECT "H / A" FROM table_59227 WHERE "Date" = '24 january 2009'
wikisql
CREATE TABLE table_name_77 ( year INTEGER, co_drivers VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the earliest year that had a co-driver of Roger Enever?
SELECT MIN(year) FROM table_name_77 WHERE co_drivers = "roger enever"
sql_create_context
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid num...
SELECT SUM(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '015-23047')) AND intakeoutput.cellpath LIKE '%ou...
eicu
CREATE TABLE table_name_74 ( trailing_party VARCHAR, party_won VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Trailing Party, when Party Won is 'Janata Dal', and when Year is '1996'?
SELECT trailing_party FROM table_name_74 WHERE party_won = "janata dal" AND year = 1996
sql_create_context
CREATE TABLE table_name_45 ( time_retired VARCHAR, grid VARCHAR, driver VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the time/retired for jo siffert with a grid under 11?
SELECT time_retired FROM table_name_45 WHERE grid < 11 AND driver = "jo siffert"
sql_create_context
CREATE TABLE table_name_48 ( team_2 VARCHAR, team_1 VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Team 2 faced Team 1 from Barcelona?
SELECT team_2 FROM table_name_48 WHERE team_1 = "barcelona"
sql_create_context
CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), ...
SELECT HIRE_DATE, SUM(MANAGER_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40
nvbench
CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE instructor ( instructor_id int, name varchar, uniqname var...
SELECT DISTINCT department, name, number FROM course WHERE (description LIKE '%Graduate REEES%' OR name LIKE '%Graduate REEES%') AND department = 'EECS'
advising
CREATE TABLE table_27711 ( "Software" text, "Description" text, "Platform" text, "License" text, "Developer" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the description of the intact software?
SELECT "Description" FROM table_27711 WHERE "Software" = 'IntAct'
wikisql
CREATE TABLE table_13555999_1 ( university_students_and_adults__18yrs VARCHAR, _ VARCHAR, senior_high_school__15_18_yrs_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What amount of the university students and adults ehre the the senior high school is 2...
SELECT university_students_and_adults__18yrs + _ FROM table_13555999_1 WHERE senior_high_school__15_18_yrs_ = "26mm"
sql_create_context
CREATE TABLE table_40291 ( "Week #" text, "Theme" text, "Song choice" text, "Original artist" text, "Order #" real, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which week had safe as the result and Dolly Parton as the theme?
SELECT "Week #" FROM table_40291 WHERE "Result" = 'safe' AND "Theme" = 'dolly parton'
wikisql
CREATE TABLE student_record ( student_id int, course_id int, semester int, grade varchar, how varchar, transfer_source varchar, earn_credit varchar, repeat_term varchar, test_id varchar ) CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE instructor ( ...
SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, instructor, offering_instructor, semester WHERE course.course_id = course_offering.course_id AND instructor.name LIKE '%Lindsey Lepley%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.of...
advising
CREATE TABLE table_name_10 ( silver INTEGER, total VARCHAR, gold VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Silver has a Total of 7, and a Gold larger than 1?
SELECT AVG(silver) FROM table_name_10 WHERE total = 7 AND gold > 1
sql_create_context
CREATE TABLE table_54513 ( "Year" real, "Winner" text, "Jockey" text, "Trainer" text, "Owner" text, "Distance (Miles)" text, "Time" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the trainer with Robert Courtney was owner?
SELECT "Trainer" FROM table_54513 WHERE "Owner" = 'robert courtney'
wikisql
CREATE TABLE table_60505 ( "Date" text, "Opponent" text, "Score" text, "Site/Stadium" text, "Loss" text, "Save" text, "Attendance" real, "Overall Record" text, "NCAAT Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the...
SELECT "Save" FROM table_60505 WHERE "Loss" = 'moran (1-2)'
wikisql
CREATE TABLE table_name_64 ( date VARCHAR, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When was the record 27-25?
SELECT date FROM table_name_64 WHERE record = "27-25"
sql_create_context
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.language = "CAPE" AND demographic.age < "68"
mimicsql_data
CREATE TABLE table_name_46 ( year__ceremony_ VARCHAR, film_title_used_in_nomination VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- In what Year was Labyrinth nominated?
SELECT year__ceremony_ FROM table_name_46 WHERE film_title_used_in_nomination = "labyrinth"
sql_create_context
CREATE TABLE musical ( Musical_ID int, Name text, Year int, Award text, Category text, Nominee text, Result text ) CREATE TABLE actor ( Actor_ID int, Name text, Musical_ID int, Character text, Duration text, age int ) -- Using valid SQLite, answer the following que...
SELECT Nominee, COUNT(*) FROM musical GROUP BY Nominee ORDER BY Nominee
nvbench
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 t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc22 JOIN t_kc21_t_kc22 JOIN t_kc21 ON t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID AND t_kc21_t_kc22.MED_CLINIC_ID = t_kc21.MED_CLINIC_ID WHERE t_kc21.MED_CLINIC_ID = '43314043666' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY SUM(t_kc22.SELF_PAY_AMO) DES...
css
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE vitalperiodic ( vitalperio...
SELECT COUNT(*) > 0 FROM allergy WHERE allergy.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-165214')) AND DATETIME(allergy.allergytime, 'start of year') = DATETIME(CURR...
eicu
CREATE TABLE table_49621 ( "Region (year)" text, "No. 1" text, "No. 2" text, "No. 3" text, "No. 4" text, "No. 5" text, "No. 6" text, "No. 7" text, "No. 8" text, "No. 9" text, "No. 10" text ) -- Using valid SQLite, answer the following questions for the tables provided above...
SELECT "No. 6" FROM table_49621 WHERE "No. 10" = 'joshua' AND "No. 8" = 'andrew'
wikisql
CREATE TABLE table_name_66 ( record VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Score of 2 1 has what record?
SELECT record FROM table_name_66 WHERE score = "2–1"
sql_create_context
CREATE TABLE table_train_119 ( "id" int, "systolic_blood_pressure_sbp" int, "hemoglobin_a1c_hba1c" float, "diastolic_blood_pressure_dbp" int, "hypotension" bool, "allergy_to_milk" bool, "allergy_to_soy" bool, "body_mass_index_bmi" float, "plasma_creatinine" float, "NOUSE" float )...
SELECT * FROM table_train_119 WHERE hemoglobin_a1c_hba1c < 10
criteria2sql
CREATE TABLE table_24126 ( "Game" real, "Date" text, "Opponent" text, "Result" text, "Black Knights points" real, "Opponents" real, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the opponents stanford
SELECT "Opponents" FROM table_24126 WHERE "Opponent" = 'Stanford'
wikisql
CREATE TABLE table_name_70 ( year INTEGER, english_title VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Year of submission of the Film The Art of Crying?
SELECT MIN(year) FROM table_name_70 WHERE english_title = "the art of crying"
sql_create_context
CREATE TABLE member_attendance ( Member_ID int, Performance_ID int, Num_of_Pieces int ) CREATE TABLE member ( Member_ID text, Name text, Nationality text, Role text ) CREATE TABLE performance ( Performance_ID real, Date text, Host text, Location text, Attendance int ) ...
SELECT Location, COUNT(*) FROM performance GROUP BY Location
nvbench
CREATE TABLE table_204_987 ( id number, "city/municipality" text, "no. of\nbarangays" number, "area\n(km2)" number, "population\n(2010 census)" number, "pop. density\n(per km2)" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which municipality...
SELECT "city/municipality" FROM table_204_987 ORDER BY "area\n(km2)" DESC LIMIT 1
squall
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 t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_ID = '23981403' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY COUNT(*) DESC
css
CREATE TABLE table_name_47 ( million_czk VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What 2007 number when the million CZK shows operating revenues?
SELECT COUNT(2007) FROM table_name_47 WHERE million_czk = "operating revenues"
sql_create_context
CREATE TABLE table_name_20 ( position VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which position does Robert Nkemdiche play?
SELECT position FROM table_name_20 WHERE player = "robert nkemdiche"
sql_create_context
CREATE TABLE table_name_23 ( to_par VARCHAR, score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who has the par score of 70-76-68-214?
SELECT to_par FROM table_name_23 WHERE score = "70-76-68-214"
sql_create_context
CREATE TABLE professor ( emp_num number, dept_code text, prof_office text, prof_extension text, prof_high_degree text ) CREATE TABLE employee ( emp_num number, emp_lname text, emp_fname text, emp_initial text, emp_jobcode text, emp_hiredate time, emp_dob time ) CREATE T...
SELECT COUNT(*), class_room FROM class GROUP BY class_room HAVING COUNT(*) >= 2
spider
CREATE TABLE table_name_2 ( date VARCHAR, away_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Date, when Away Team is 'Gillingham'?
SELECT date FROM table_name_2 WHERE away_team = "gillingham"
sql_create_context
CREATE TABLE Dorm ( dormid INTEGER, dorm_name VARCHAR(20), student_capacity INTEGER, gender VARCHAR(1) ) CREATE TABLE Lives_in ( stuid INTEGER, dormid INTEGER, room_number INTEGER ) CREATE TABLE Has_amenity ( dormid INTEGER, amenid INTEGER ) CREATE TABLE Dorm_amenity ( amenid ...
SELECT city_code, AVG(Age) FROM Student GROUP BY city_code ORDER BY city_code DESC
nvbench
CREATE TABLE table_name_77 ( date VARCHAR, circuit VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On what Date is there a race on the Circuit of brands hatch?
SELECT date FROM table_name_77 WHERE circuit = "brands hatch"
sql_create_context
CREATE TABLE table_30047613_12 ( streak VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- in april 13 what was the streak
SELECT streak FROM table_30047613_12 WHERE date = "April 13"
sql_create_context
CREATE TABLE table_21091145_1 ( black_knights_points VARCHAR, game VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the number of black knights points for 3 game
SELECT COUNT(black_knights_points) FROM table_21091145_1 WHERE game = 3
sql_create_context
CREATE TABLE table_78573 ( "Place" text, "Player" text, "Country" text, "Score" real, "To par" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which To par has a Place of t4, and wayne grady is in?
SELECT "To par" FROM table_78573 WHERE "Place" = 't4' AND "Player" = 'wayne grady'
wikisql
CREATE TABLE Products ( product_id INTEGER, color_code VARCHAR(15), product_category_code VARCHAR(15), product_name VARCHAR(80), typical_buying_price VARCHAR(20), typical_selling_price VARCHAR(20), product_description VARCHAR(255), other_product_details VARCHAR(255) ) CREATE TABLE Ref_P...
SELECT product_category_description, COUNT(product_category_description) FROM Ref_Product_Categories AS T1 JOIN Products AS T2 ON T1.product_category_code = T2.product_category_code WHERE T2.product_description LIKE '%t%' GROUP BY product_category_description
nvbench
CREATE TABLE table_name_44 ( matches INTEGER, points VARCHAR, results VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Points larger than 6, and a Results of 522:443 had what lowest matches?
SELECT MIN(matches) FROM table_name_44 WHERE points > 6 AND results = "522:443"
sql_create_context
CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, ...
SELECT DISTINCT name, number FROM course WHERE credits = 16 AND department = 'EECS'
advising
CREATE TABLE students ( student_id number, date_of_registration time, date_of_latest_logon time, login_name text, password text, personal_name text, middle_name text, family_name text ) CREATE TABLE course_authors_and_tutors ( author_id number, author_tutor_atb text, login_n...
SELECT login_name FROM course_authors_and_tutors INTERSECT SELECT login_name FROM students
spider
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, a...
SELECT t1.diagnosisname FROM (SELECT diagnosis.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age BETWEEN 40 AND 49) AND DATETIME(diagnosis.diagnosistime) >= DATETIME(CURRENT_TIME(), '-4 yea...
eicu
CREATE TABLE table_name_75 ( player VARCHAR, hometown VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What Player comes from the Hometown of Wichita, KS?
SELECT player FROM table_name_75 WHERE hometown = "wichita, ks"
sql_create_context
CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25), COUNTRY_ID varchar(2) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL v...
SELECT SALARY, DEPARTMENT_ID FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history)
nvbench
CREATE TABLE table_204_33 ( id number, "number" number, "name" text, "year built" number, "boat builder" text, "current status" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what boat builder created the hie after the hirondelle ?
SELECT "boat builder" FROM table_204_33 WHERE "name" = 'hie'
squall
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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "BLACK/CAPE VERDEAN" AND prescriptions.drug = "Posaconazole Suspension"
mimicsql_data
CREATE TABLE table_45249 ( "Name" text, "Pinnacle height" text, "Structure type" text, "Main use" text, "Country" text, "Town" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the name of the structure at Egypt, Arkansas?
SELECT "Name" FROM table_45249 WHERE "Town" = 'egypt, arkansas'
wikisql
CREATE TABLE table_name_65 ( romaji_title VARCHAR, tv_station VARCHAR, average_ratings VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Romaji Title has a TV Station of fuji tv, and Average Ratings of 12.41%?
SELECT romaji_title FROM table_name_65 WHERE tv_station = "fuji tv" AND average_ratings = "12.41%"
sql_create_context
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE prescriptio...
SELECT SUM(CASE WHEN patients.dod IS NULL THEN 1 WHEN STRFTIME('%j', patients.dod) - STRFTIME('%j', t4.charttime) > 3 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t2.subject_id, t2.charttime FROM (SELECT t1.subject_id, t1.charttime FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd...
mimic_iii
CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, UpVotes number, DownVotes number, ProfileImageUrl text, EmailHash text, AccountId number ) CRE...
SELECT Id AS "comment_link", Score, CreationDate, PostId AS "post_link" FROM Comments WHERE UserId = '##userid:int?2756409##' AND Score > 5 ORDER BY Score DESC
sede
CREATE TABLE table_25012 ( "English name" text, "Georgian name" text, "Transliteration" text, "Date" text, "Author" text, "Period covered" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the date for when the georgian name is ?
SELECT "Date" FROM table_25012 WHERE "Georgian name" = 'ცხოვრება და უწყება ბაგრატონიანთა'
wikisql
CREATE TABLE table_name_61 ( order VARCHAR, elector VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the Order with an Elector of Marino Bulcani?
SELECT order FROM table_name_61 WHERE elector = "marino bulcani"
sql_create_context
CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25), COUNTRY_ID varchar(2) ) CREATE TABLE job_history ( EMPLOYEE...
SELECT FIRST_NAME, DEPARTMENT_ID FROM employees ORDER BY FIRST_NAME DESC
nvbench
CREATE TABLE table_34101 ( "Round" real, "Track" text, "Date" text, "Pole Position" text, "Fastest Race Lap" text, "Winner" text, "Team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the pole position of Round 9
SELECT "Pole Position" FROM table_34101 WHERE "Round" = '9'
wikisql
CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comme...
SELECT c.Id AS "Comment ID", c.CreationDate AS "Comment Date", u.Id AS "User ID", u.DisplayName AS "User Name", a.Id AS "Answer ID", q.Id AS "Question ID", q.Title AS "Question Title" FROM Posts AS a JOIN Posts AS q ON q.Id = a.ParentId JOIN Comments AS c ON c.PostId = a.Id JOIN Users AS u ON u.Id = a.OwnerUserId WHERE...
sede
CREATE TABLE table_58457 ( "Driver" text, "Constructor" text, "Laps" text, "Time/Retired" text, "Grid" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the time/retired when the grid is 19?
SELECT "Time/Retired" FROM table_58457 WHERE "Grid" = '19'
wikisql
CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location text, insurance text, language text, marital_status text, ethnicity text, age number ) CREATE ...
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', diagnoses_icd.charttime)) FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'senile dementia uncomp') AND diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admi...
mimic_iii
CREATE TABLE table_64098 ( "Driver" text, "Team" text, "Laps" real, "Time/Retired" text, "Grid" real, "Points" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the average amount of points larger than 154 laps?
SELECT AVG("Points") FROM table_64098 WHERE "Laps" > '154'
wikisql
CREATE TABLE table_name_41 ( event VARCHAR, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What event was Donald Ouimet involved?
SELECT event FROM table_name_41 WHERE opponent = "donald ouimet"
sql_create_context
CREATE TABLE table_4678 ( "Team" text, "Constructor" text, "Motorcycle" text, "Rider" text, "Rounds" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which round has the mv agusta f4 1000 mt?
SELECT "Rounds" FROM table_4678 WHERE "Motorcycle" = 'mv agusta f4 1000 mt'
wikisql
CREATE TABLE table_22560 ( "Date" real, "Single" text, "Backed with" text, "Record label" text, "Format" text, "Other details" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What year was 'moped girls' released?
SELECT "Date" FROM table_22560 WHERE "Single" = 'Moped Girls'
wikisql
CREATE TABLE table_7705 ( "Year" real, "Date" text, "Home" text, "Score" text, "Away" text, "Venue" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was at Home at the Bucharest Venue with a Score of 9-9?
SELECT "Home" FROM table_7705 WHERE "Venue" = 'bucharest' AND "Score" = '9-9'
wikisql
CREATE TABLE table_12648 ( "Perpetrator" text, "Year" text, "Location" text, "Country" text, "Killed" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the location for Egypt in 2013?
SELECT "Location" FROM table_12648 WHERE "Year" = '2013' AND "Country" = 'egypt'
wikisql
CREATE TABLE table_name_87 ( time VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the time of the game on April 5?
SELECT time FROM table_name_87 WHERE date = "april 5"
sql_create_context
CREATE TABLE AssignedTo ( Scientist int, Project char(4) ) CREATE TABLE Projects ( Code Char(4), Name Char(50), Hours int ) CREATE TABLE Scientists ( SSN int, Name Char(30) ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Find the number of the n...
SELECT T2.Name, COUNT(T2.Name) FROM AssignedTo AS T1 JOIN Projects AS T2 ON T1.Project = T2.Code JOIN Scientists AS T3 ON T1.Scientist = T3.SSN WHERE T3.Name LIKE '%Smith%' GROUP BY T2.Name ORDER BY COUNT(T2.Name) DESC
nvbench
CREATE TABLE table_name_79 ( ε__m__1_cm__1__ VARCHAR, mass__g_mol_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which (M -1 cm -1) has a molar mass of 1008 g/mol?
SELECT ε__m__1_cm__1__ FROM table_name_79 WHERE mass__g_mol_ = "1008"
sql_create_context
CREATE TABLE table_16706 ( "Rnd" real, "Race" text, "Date" text, "Location" text, "Pole Position" text, "Fastest Lap" text, "Race Winner" text, "Constructor" text, "Report" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the ...
SELECT "Date" FROM table_16706 WHERE "Race" = 'Monaco Grand Prix'
wikisql
CREATE TABLE table_name_63 ( prog_cons VARCHAR, dates VARCHAR, polling_firm VARCHAR, liberal VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- According to the February 2009 poll by the Corporate Research Associates that reported 31% Liberal., what perc...
SELECT prog_cons FROM table_name_63 WHERE polling_firm = "corporate research associates" AND liberal = "31%" AND dates = "february 2009"
sql_create_context
CREATE TABLE ftxmzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH number, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZD...
SELECT txmzjzjlb.SG, txmzjzjlb.TZ, txmzjzjlb.TW, txmzjzjlb.SSY, txmzjzjlb.SZY, txmzjzjlb.XL, txmzjzjlb.HXPLC, txmzjzjlb.ML FROM txmzjzjlb WHERE txmzjzjlb.JZLSH = '59680222876' UNION SELECT ftxmzjzjlb.SG, ftxmzjzjlb.TZ, ftxmzjzjlb.TW, ftxmzjzjlb.SSY, ftxmzjzjlb.SZY, ftxmzjzjlb.XL, ftxmzjzjlb.HXPLC, ftxmzjzjlb.ML FROM ft...
css
CREATE TABLE table_79003 ( "Position" real, "Team" text, "Played" real, "Drawn" real, "Lost" real, "Goals For" real, "Goals Against" real, "Goal Difference" text, "Points 1" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- WHAT IS THE ...
SELECT SUM("Position") FROM table_79003 WHERE "Lost" = '6' AND "Team" = 'caernarfon town'
wikisql
CREATE TABLE broadcast_share ( channel_id number, program_id number, date text, share_in_percent number ) CREATE TABLE broadcast ( channel_id number, program_id number, time_of_day text ) CREATE TABLE channel ( channel_id number, name text, owner text, share_in_percent numb...
SELECT name FROM program WHERE origin <> 'Beijing'
spider
CREATE TABLE table_name_98 ( competition VARCHAR, goal INTEGER ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which competition has goals less than 2?
SELECT competition FROM table_name_98 WHERE goal < 2
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 diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic (...
SELECT MAX(demographic.age) FROM demographic WHERE demographic.marital_status = "SINGLE" AND demographic.gender = "M"
mimicsql_data
CREATE TABLE table_72009 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Decision" text, "Attendance" real, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the score on April 8?
SELECT "Score" FROM table_72009 WHERE "Date" = 'april 8'
wikisql
CREATE TABLE table_name_26 ( type VARCHAR, locomotive_number VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What type is locomotive number CTN 46?
SELECT type FROM table_name_26 WHERE locomotive_number = "ctn 46"
sql_create_context
CREATE TABLE record ( ID int, Result text, Swimmer_ID int, Event_ID int ) CREATE TABLE swimmer ( ID int, name text, Nationality text, meter_100 real, meter_200 text, meter_300 text, meter_400 text, meter_500 text, meter_600 text, meter_700 text, Time text ) ...
SELECT Nationality, AVG(meter_100) FROM swimmer GROUP BY Nationality
nvbench
CREATE TABLE table_name_28 ( attendance VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total attendance on April 25?
SELECT COUNT(attendance) FROM table_name_28 WHERE date = "april 25"
sql_create_context