instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) C...
SELECT * FROM Users, Tags WHERE TagName LIKE '%##Tag##%' AND Reputation >= '##minimumReputation##' ORDER BY Reputation DESC
sede
CREATE TABLE table_39789 ( "Year" real, "Award" text, "Category" text, "Nominated Work" text, "Result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name of the award given for the category Mercury Prize?
SELECT "Award" FROM table_39789 WHERE "Category" = 'mercury prize'
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 gwyjzb.MED_ORG_DEPT_CD, gwyjzb.IN_DIAG_DIS_CD, MIN(t_kc24.ILL_PAY) FROM gwyjzb JOIN t_kc24 ON gwyjzb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE gwyjzb.MED_SER_ORG_NO = '7149327' GROUP BY gwyjzb.MED_ORG_DEPT_CD, gwyjzb.IN_DIAG_DIS_CD UNION SELECT fgwyjzb.MED_ORG_DEPT_CD, fgwyjzb.IN_DIAG_DIS_CD, MIN(t_kc24.ILL_PAY...
css
CREATE TABLE table_203_166 ( id number, "pos" text, "no" number, "rider" text, "manufacturer" text, "laps" number, "time" text, "grid" number, "points" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many riders used a motorcycl...
SELECT COUNT("rider") FROM table_203_166 WHERE "manufacturer" = 'honda'
squall
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, h...
SELECT patient.hospitaladmittime FROM patient WHERE patient.uniquepid = '022-30957' AND patient.hospitaladmitsource = 'operating room' AND DATETIME(patient.hospitaladmittime) <= DATETIME(CURRENT_TIME(), '-3 year') ORDER BY patient.hospitaladmittime DESC LIMIT 1
eicu
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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_location = "TRSF WITHIN THIS FACILITY" AND lab.fluid = "Ascites"
mimicsql_data
CREATE TABLE movie ( director VARCHAR, YEAR VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Show all director names who have a movie in the year 1999 or 2000.
SELECT director FROM movie WHERE YEAR = 1999 OR YEAR = 2000
sql_create_context
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 COUNT(*) FROM zyjzjlb JOIN hz_info_zyjzjlb JOIN hz_info ON hz_info_zyjzjlb.JZLSH = zyjzjlb.JZLSH AND hz_info_zyjzjlb.YLJGDM = hz_info_zyjzjlb.YLJGDM AND hz_info_zyjzjlb.JZLSH = zyjzjlb.JZLSH AND hz_info_zyjzjlb.zyjzjlb_id = zyjzjlb.zyjzjlb_id AND hz_info_zyjzjlb.YLJGDM = hz_info.YLJGDM WHERE hz_info.YLJGDM = '27...
css
CREATE TABLE table_2050 ( "Province" text, "Latin Americans 2001" real, "% 2001" text, "Latin Americans 2011" real, "% 2011" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many Latin Americans lived in 2011 in Saskatchewan?
SELECT MIN("Latin Americans 2011") FROM table_2050 WHERE "Province" = 'Saskatchewan'
wikisql
CREATE TABLE Ref_Locations ( Location_Code CHAR(15), Location_Name VARCHAR(255), Location_Description VARCHAR(255) ) CREATE TABLE Documents_to_be_Destroyed ( Document_ID INTEGER, Destruction_Authorised_by_Employee_ID INTEGER, Destroyed_by_Employee_ID INTEGER, Planned_Destruction_Date DATETI...
SELECT Date_in_Locaton_To, COUNT(Date_in_Locaton_To) FROM Document_Locations GROUP BY Location_Code, Date_in_Locaton_To ORDER BY Date_in_Locaton_To DESC
nvbench
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_kc21.MED_ORG_DEPT_CD, t_kc21.MED_ORG_DEPT_NM FROM t_kc21 JOIN t_kc24 JOIN t_kc21_t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc24.MED_CLINIC_ID AND t_kc21_t_kc24.MED_SAFE_PAY_ID = t_kc24.MED_SAFE_PAY_ID WHERE t_kc21.MED_SER_ORG_NO = '3153321' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2009-02-17' AND '2015-11-04' GROUP...
css
CREATE TABLE table_22478 ( "Township" text, "County" text, "Pop. (2010)" real, "Land ( sqmi )" text, "Water (sqmi)" text, "Latitude" text, "Longitude" text, "GEO ID" real, "ANSI code" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Wh...
SELECT "Land ( sqmi )" FROM table_22478 WHERE "Township" = 'Reed'
wikisql
CREATE TABLE table_name_40 ( age_groups VARCHAR, sport VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the age group for figure skating?
SELECT age_groups FROM table_name_40 WHERE sport = "figure skating"
sql_create_context
CREATE TABLE table_18539834_2 ( romaji_title VARCHAR, average_ratings VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many titles had an average rating of 8.9%?
SELECT COUNT(romaji_title) FROM table_18539834_2 WHERE average_ratings = "8.9%"
sql_create_context
CREATE TABLE table_20301 ( "#" real, "Advocate # 1" text, "Advocate # 2" text, "Root of All Evil" text, "Poll winner" text, "Original air date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- When steroids won the poll, who was advocate #1?
SELECT "Advocate # 1" FROM table_20301 WHERE "Poll winner" = 'Steroids'
wikisql
CREATE TABLE table_48987 ( "Position" real, "Team" text, "Played" real, "Drawn" real, "Lost" real, "Goals For" real, "Goals Against" real, "Goal Difference" text, "Points 1" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the ...
SELECT MAX("Goals For") FROM table_48987 WHERE "Drawn" < '11' AND "Played" < '42'
wikisql
CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE student ( student_id int, lastname varchar, firstname varchar, program_id int, declare_major varchar, total_credit int, total_gpa float, entered_as varchar, admit_term int, predicted_gradu...
SELECT DISTINCT course_offering.start_time FROM course INNER JOIN program_course ON program_course.course_id = course.course_id INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester WHERE course.department = 'ORALSURG' AND cours...
advising
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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.insurance = "Private" AND diagnoses.long_title = "Streptococcus infection in conditions classified elsewhere and of unspecified site, streptococcus, group D [Enterococcus]"
mimicsql_data
CREATE TABLE table_59195 ( "Code" real, "Municipality" text, "County" text, "Population" real, "Total area" text, "Density (per km 2 land)" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total area for a code less than 1862 and a den...
SELECT "Total area" FROM table_59195 WHERE "Code" < '1862' AND "Density (per km 2 land)" = '21.6'
wikisql
CREATE TABLE table_name_39 ( title VARCHAR, first_issue VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the title that was first published in August 2010?
SELECT title FROM table_name_39 WHERE first_issue = "august 2010"
sql_create_context
CREATE TABLE table_69719 ( "Name" text, "Years" text, "Gender" text, "Area" text, "Authority" text, "Decile" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which gender has a Decile of 8, an Area of taradale, and Years of 1 13?
SELECT "Gender" FROM table_69719 WHERE "Decile" = '8' AND "Area" = 'taradale' AND "Years" = '1–13'
wikisql
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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.diagnosis = "RASH" AND procedures.short_title = "Other heart/pericard ops"
mimicsql_data
CREATE TABLE table_name_90 ( date INTEGER, works_number VARCHAR, type VARCHAR, number VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What date have highest 0-4-4 forney locomotive with number larger than 20 and works number larger than 23754?
SELECT MAX(date) FROM table_name_90 WHERE type = "0-4-4 forney locomotive" AND number > 20 AND works_number > 23754
sql_create_context
CREATE TABLE table_name_55 ( against INTEGER, peel VARCHAR, byes VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Against has a Peel of waroona, and a Byes larger than 0?
SELECT MAX(against) FROM table_name_55 WHERE peel = "waroona" AND byes > 0
sql_create_context
CREATE TABLE table_64890 ( "Rank" real, "Name" text, "Height" text, "Highest floor" real, "City" text, "Primary use" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Rank of the building that has a Highest floor larger than 50?
SELECT "Rank" FROM table_64890 WHERE "Highest floor" > '50'
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 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 INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.days_stay > "9" AND procedures.short_title = "Allo hem stem ct w/o pur"
mimicsql_data
CREATE TABLE table_721 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- who are the candidates where the incumbent is sam m. gibbons?
SELECT "Candidates" FROM table_721 WHERE "Incumbent" = 'Sam M. Gibbons'
wikisql
CREATE TABLE table_68708 ( "Date" text, "Visiting team" text, "Final score" text, "Host team" text, "Stadium" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the host team with the stadium Lincoln Financial Field?
SELECT "Host team" FROM table_68708 WHERE "Stadium" = 'lincoln financial field'
wikisql
CREATE TABLE table_9420 ( "Team" text, "All Games" text, "All Games %" real, "Nonconference Games" text, "Nonconference Games %" real, "Ranked AP Nonconference" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which All Games have a Nonconference ...
SELECT "All Games" FROM table_9420 WHERE "Nonconference Games" = '1–10'
wikisql
CREATE TABLE people ( people_id number, sex text, name text, date_of_birth text, height number, weight number ) CREATE TABLE candidate ( candidate_id number, people_id number, poll_source text, date text, support_rate number, consider_rate number, oppose_rate number,...
SELECT COUNT(*) FROM candidate
spider
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text ) ...
SELECT microbiologyevents.spec_type_desc FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 83466) AND STRFTIME('%y-%m', microbiologyevents.charttime) >= '2101-05' ORDER BY microbiologyevents.charttime LIMIT 1
mimic_iii
CREATE TABLE hz_info_mzjzjlb ( JZLSH number, YLJGDM number, mzjzjlb_id number ) CREATE TABLE mzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH text, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, ...
SELECT jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN hz_info_mzjzjlb ON hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.YLJGDM ...
css
CREATE TABLE employees ( employee_id number, first_name text, last_name text, email text, phone_number text, hire_date time, job_id text, salary number, commission_pct number, manager_id number, department_id number ) CREATE TABLE countries ( country_id text, country...
SELECT * FROM employees WHERE hire_date > '1987-09-07'
spider
CREATE TABLE course_tags_count ( course_id int, clear_grading int, pop_quiz int, group_projects int, inspirational int, long_lectures int, extra_credit int, few_tests int, good_feedback int, tough_tests int, heavy_papers int, cares_for_students int, heavy_assignments ...
SELECT DISTINCT instructor.name FROM instructor INNER JOIN offering_instructor ON offering_instructor.instructor_id = instructor.instructor_id INNER JOIN course_offering ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN course ON course.course_id = course_offering.course_id INNER JOIN semester...
advising
CREATE TABLE entrepreneur ( entrepreneur_id number, people_id number, company text, money_requested number, investor text ) CREATE TABLE people ( people_id number, name text, height number, weight number, date_of_birth text ) -- Using valid SQLite, answer the following questio...
SELECT T2.date_of_birth FROM entrepreneur AS T1 JOIN people AS T2 ON T1.people_id = T2.people_id WHERE T1.investor = "Simon Woodroffe" OR T1.investor = "Peter Jones"
spider
CREATE TABLE table_21502 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who wa...
SELECT "Team" FROM table_21502 WHERE "Date" = 'January 23'
wikisql
CREATE TABLE Bookings ( booking_id INTEGER, customer_id INTEGER, booking_status_code VARCHAR(10), returned_damaged_yn VARCHAR(40), booking_start_date DATETIME, booking_end_date DATETIME, count_hired VARCHAR(40), amount_payable DECIMAL(19,4), amount_of_discount DECIMAL(19,4), amou...
SELECT payment_date, COUNT(payment_date) FROM Payments WHERE amount_paid > 300 OR payment_type_code = 'Check' GROUP BY payment_date ORDER BY payment_date DESC
nvbench
CREATE TABLE table_2139023_2 ( outcome VARCHAR, championship VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the result of the Australian Championships?
SELECT outcome FROM table_2139023_2 WHERE championship = "Australian championships"
sql_create_context
CREATE TABLE table_74218 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What d...
SELECT "Date" FROM table_74218 WHERE "Location Attendance" = 'Seattle Center Coliseum 12,126'
wikisql
CREATE TABLE table_name_54 ( laps INTEGER, driver VARCHAR, points VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many average laps for Alex Tagliani with more than 17 points?
SELECT AVG(laps) FROM table_name_54 WHERE driver = "alex tagliani" AND points > 17
sql_create_context
CREATE TABLE table_67598 ( "Rank" real, "Lane" real, "Name" text, "Nationality" text, "Time" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the smallest rank of noriko inada?
SELECT MIN("Rank") FROM table_67598 WHERE "Name" = 'noriko inada'
wikisql
CREATE TABLE bookings ( booking_start_date VARCHAR, booking_end_date VARCHAR, booking_id VARCHAR ) CREATE TABLE products_booked ( product_id VARCHAR, booking_id VARCHAR ) CREATE TABLE Products_for_hire ( product_id VARCHAR, product_name VARCHAR ) -- Using valid SQLite, answer the followi...
SELECT T3.booking_start_date, T3.booking_end_date FROM Products_for_hire AS T1 JOIN products_booked AS T2 ON T1.product_id = T2.product_id JOIN bookings AS T3 ON T2.booking_id = T3.booking_id WHERE T1.product_name = 'Book collection A'
sql_create_context
CREATE TABLE table_name_7 ( time VARCHAR, ground VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Time with a Ground that is humber college north?
SELECT time FROM table_name_7 WHERE ground = "humber college north"
sql_create_context
CREATE TABLE table_55238 ( "Player" text, "Rec." real, "Yards" real, "Avg." real, "Long" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the total number of yards for avg of 9 and rec of 1
SELECT COUNT("Yards") FROM table_55238 WHERE "Avg." = '9' AND "Rec." = '1'
wikisql
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugst...
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 = '006-122712')) AND NOT vitalperiodic.sao2 IS NULL AN...
eicu
CREATE TABLE table_61466 ( "Draw" real, "Artist" text, "Song" text, "Lyrics (l) / Music (m)" text, "Results" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Lyrics (l) / Music (m) when the results show out, and the song shows 'left/right'...
SELECT "Lyrics (l) / Music (m)" FROM table_61466 WHERE "Results" = 'out' AND "Song" = 'left/right'
wikisql
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 Name, Height FROM people
nvbench
CREATE TABLE table_48588 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Series" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What w...
SELECT "Team" FROM table_48588 WHERE "Series" = '2-1'
wikisql
CREATE TABLE customers ( id number, first_name text, last_name text, company text, address text, city text, state text, country text, postal_code text, phone text, fax text, email text, support_rep_id number ) CREATE TABLE invoices ( id number, customer_id nu...
SELECT billing_country, COUNT(*) FROM invoices GROUP BY billing_country ORDER BY COUNT(*) DESC LIMIT 5
spider
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, item...
SELECT (SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 13622) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'creatinine') AND labevents.charttime = '2104-08-23 11:40:00') - (SELECT ...
mimic_iii
CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE restriction ( restriction_code text, advance_purc...
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, fare, fare_basis, flight, flight_fare WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND fare_basis.class_type = 'FIRST' AND far...
atis
CREATE TABLE table_43332 ( "Tournament" text, "Wins" real, "Top-5" real, "Top-10" real, "Top-25" real, "Events" real, "Cuts made" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the sum of cuts made when the top-5 is 2, and there are ...
SELECT COUNT("Cuts made") FROM table_43332 WHERE "Top-5" = '2' AND "Events" = '12'
wikisql
CREATE TABLE table_name_47 ( result VARCHAR, goals VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which result has a Goal of deacon 2/5?
SELECT result FROM table_name_47 WHERE goals = "deacon 2/5"
sql_create_context
CREATE TABLE table_9366 ( "Date" text, "Series" text, "Circuit" text, "City / State" text, "Winner" text, "Team" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is City / State, when Winner is Mal Rose, and when Date is 20 Jul?
SELECT "City / State" FROM table_9366 WHERE "Winner" = 'mal rose' AND "Date" = '20 jul'
wikisql
CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDispl...
SELECT Id AS "post_link", OwnerUserId AS "user_link", LENGTH(Body) - LENGTH(REPLACE(Body, ' ', '')) - 2 * (LENGTH(Body) - LENGTH(REPLACE(Body, ' ', ''))) AS ApproxWords, LastActivityDate AS "last_activity_date" FROM Posts WHERE PostTypeId = 2 AND OwnerUserId = '##UserID##' ORDER BY ApproxWords DESC LIMIT 1000
sede
CREATE TABLE Faculty ( FacID VARCHAR, advisor VARCHAR ) CREATE TABLE Student ( FacID VARCHAR, advisor VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Show ids for the faculty members who don't advise any student.
SELECT FacID FROM Faculty EXCEPT SELECT advisor FROM Student
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 INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2129" AND lab.label = "RBC, Pleural"
mimicsql_data
CREATE TABLE procedures ( 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 diagnoses ( ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.insurance = "Private" AND diagnoses.short_title = "Ac DVT/emb prox low ext"
mimicsql_data
CREATE TABLE Apartments ( apt_id INTEGER, building_id INTEGER, apt_type_code CHAR(15), apt_number CHAR(10), bathroom_count INTEGER, bedroom_count INTEGER, room_count CHAR(5) ) CREATE TABLE Apartment_Bookings ( apt_booking_id INTEGER, apt_id INTEGER, guest_id INTEGER, booking...
SELECT facility_code, COUNT(facility_code) FROM Apartment_Facilities AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T2.bedroom_count > 4 GROUP BY facility_code ORDER BY COUNT(facility_code) DESC
nvbench
CREATE TABLE Services ( Service_ID INTEGER, Service_name VARCHAR(40) ) CREATE TABLE Customers ( Customer_ID INTEGER, Customer_name VARCHAR(40) ) CREATE TABLE Claims ( Claim_ID INTEGER, FNOL_ID INTEGER, Effective_Date DATE ) CREATE TABLE First_Notification_of_Loss ( FNOL_ID INTEGER, ...
SELECT Date_Opened, COUNT(Date_Opened) FROM Customers AS t1 JOIN Customers_Policies AS t2 ON t1.Customer_ID = t2.Customer_ID WHERE t1.Customer_name LIKE "%Diana%" ORDER BY COUNT(Date_Opened)
nvbench
CREATE TABLE event ( ID int, Name text, Stadium_ID int, Year text ) CREATE TABLE record ( ID int, Result text, Swimmer_ID int, Event_ID int ) CREATE TABLE stadium ( ID int, name text, Capacity int, City text, Country text, Opening_year int ) CREATE TABLE swimme...
SELECT Nationality, AVG(ID) FROM swimmer GROUP BY Nationality ORDER BY Nationality DESC
nvbench
CREATE TABLE table_18358 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are all the results where Robert Bauman is the incumbent politician...
SELECT "Result" FROM table_18358 WHERE "Incumbent" = 'Robert Bauman'
wikisql
CREATE TABLE table_203_150 ( id number, "season" number, "series" text, "team" text, "races" number, "wins" number, "poles" number, "f/laps" number, "podiums" number, "points" number, "position" text ) -- Using valid SQLite, answer the following questions for the tables pro...
SELECT "season" FROM table_203_150 WHERE id = 1
squall
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE medication ( medicationid ...
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 = 'hypocalcemia' AND DATETIME(diagnosis.diagnosistime, 'start of year') = DA...
eicu
CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text ) CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, ...
SELECT (SELECT chartevents.valuenum FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 594 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1)) AND charteven...
mimic_iii
CREATE TABLE table_name_48 ( Id VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the 1980 value with a 1r in 1984 and a 1r in 1981?
SELECT 1980 FROM table_name_48 WHERE 1984 = "1r" AND 1981 = "1r"
sql_create_context
CREATE TABLE Album ( AlbumId integer, Title varchar(160), ArtistId integer ) CREATE TABLE Employee ( EmployeeId integer, LastName varchar(20), FirstName varchar(20), Title varchar(30), ReportsTo integer, BirthDate datetime, HireDate datetime, Address varchar(70), City va...
SELECT T1.AlbumId, COUNT(*) FROM Album AS T1 JOIN Track AS T2 ON T1.AlbumId = T2.AlbumId GROUP BY T2.AlbumId
nvbench
CREATE TABLE table_48871 ( "Model" text, "Length Over All" text, "Beam" text, "Sail Area" text, "Crew" text, "Comments" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Comments has a Length Over All of 4.5m?
SELECT "Comments" FROM table_48871 WHERE "Length Over All" = '4.5m'
wikisql
CREATE TABLE department ( dept_code text, dept_name text, school_code text, emp_num number, dept_address text, dept_extension text ) CREATE TABLE student ( stu_num number, stu_lname text, stu_fname text, stu_init text, stu_dob time, stu_hrs number, stu_class text, ...
SELECT COUNT(*) FROM employee
spider
CREATE TABLE table_67975 ( "7:00" text, "7:30" text, "8:00" text, "8:30" text, "9:00" text, "9:30" text, "10:00" text, "10:30" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which 9:00 has an 8:00 behind the movies?
SELECT "9:00" FROM table_67975 WHERE "8:00" = 'behind the movies'
wikisql
CREATE TABLE table_name_30 ( location VARCHAR, event VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What location did the event kotc: mortal sins take place?
SELECT location FROM table_name_30 WHERE event = "kotc: mortal sins"
sql_create_context
CREATE TABLE table_203_741 ( 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. -- did they have more or less than 1 home win in ...
SELECT (SELECT COUNT(*) FROM table_203_741 WHERE "home" > "home" AND "season" = '2010-11') > 1
squall
CREATE TABLE table_64226 ( "Rank" real, "Lane" real, "Athlete" text, "Nationality" text, "Time" real, "React" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the lowest lane with a 0.216 react?
SELECT MIN("Lane") FROM table_64226 WHERE "React" = '0.216'
wikisql
CREATE TABLE table_52886 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What constructor has a 12 grid?
SELECT "Constructor" FROM table_52886 WHERE "Grid" = '12'
wikisql
CREATE TABLE stadium ( ID int, name text, Capacity int, City text, Country text, Opening_year 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, ...
SELECT meter_200, AVG(ID) FROM swimmer GROUP BY meter_200
nvbench
CREATE TABLE market ( Market_ID int, District text, Num_of_employees int, Num_of_shops real, Ranking int ) CREATE TABLE phone_market ( Market_ID int, Phone_ID text, Num_of_stock int ) CREATE TABLE phone ( Name text, Phone_ID int, Memory_in_G int, Carrier text, Price...
SELECT Name, SUM(T1.Num_of_stock) FROM phone_market AS T1 JOIN phone AS T2 ON T1.Phone_ID = T2.Phone_ID GROUP BY T2.Name
nvbench
CREATE TABLE match ( Round real, Location text, Country text, Date text, Fastest_Qualifying text, Winning_Pilot text, Winning_Aircraft text ) CREATE TABLE airport_aircraft ( ID int, Airport_ID int, Aircraft_ID int ) CREATE TABLE airport ( Airport_ID int, Airport_Name te...
SELECT Aircraft, COUNT(Aircraft) FROM aircraft AS T1 JOIN match AS T2 ON T1.Aircraft_ID = T2.Winning_Aircraft GROUP BY Aircraft
nvbench
CREATE TABLE table_name_90 ( west_germanic VARCHAR, german VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What's the West Germanic when the German is /s/ or /ts/?
SELECT west_germanic FROM table_name_90 WHERE german = "/s/ or /ts/"
sql_create_context
CREATE TABLE campuses ( id number, campus text, location text, county text, year number ) CREATE TABLE csu_fees ( campus number, year number, campusfee number ) CREATE TABLE faculty ( campus number, year number, faculty number ) CREATE TABLE enrollments ( campus number...
SELECT campus FROM campuses WHERE location = "Chico"
spider
CREATE TABLE ref_address_types ( address_type_code text, address_type_description text ) CREATE TABLE addresses ( address_id number, line_1 text, line_2 text, line_3 text, city text, zip_postcode text, state_province_county text, country text, other_address_details text ) C...
SELECT T1.detention_type_code, T2.detention_type_description FROM detention AS T1 JOIN ref_detention_type AS T2 ON T1.detention_type_code = T2.detention_type_code GROUP BY T1.detention_type_code ORDER BY COUNT(*) LIMIT 1
spider
CREATE TABLE exhibition ( Exhibition_ID int, Year int, Theme text, Artist_ID int, Ticket_Price real ) CREATE TABLE exhibition_record ( Exhibition_ID int, Date text, Attendance int ) CREATE TABLE artist ( Artist_ID int, Name text, Country text, Year_Join int, Age int...
SELECT Year, COUNT(Year) FROM exhibition GROUP BY Year
nvbench
CREATE TABLE table_30121082_1 ( area__acres__ INTEGER, poor_law_union VARCHAR, civil_parish VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the greatest area when the Poor Law Union is Skibbereen and the Civil Parish is Tullagh?
SELECT MAX(area__acres__) FROM table_30121082_1 WHERE poor_law_union = "Skibbereen" AND civil_parish = "Tullagh"
sql_create_context
CREATE TABLE table_22184 ( "Year" real, "Car number" real, "Start" real, "Qual. speed" text, "Speed rank" real, "Finish" real, "Laps completed" real, "Laps led" real, "Race status" text, "Chassis" text ) -- Using valid SQLite, answer the following questions for the tables provi...
SELECT COUNT("Year") FROM table_22184 WHERE "Chassis" = 'Lotus-Ford 38/7'
wikisql
CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE restriction ( restriction_code text, advance_purchase int, stopovers text, saturday_stay_required text, minimum_stay int, maximum_stay int, application text, no_discounts text ) CREATE TAB...
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 = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_...
atis
CREATE TABLE table_13619053_9 ( team VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which team played on April 1?
SELECT team FROM table_13619053_9 WHERE date = "April 1"
sql_create_context
CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE fare ( fare_id int, from_airport varchar, to_airport varchar, fare_basis_code text, fare_airline text, restr...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'INDIANAPOLIS' AND date_day.day_number = 27 AND date_day.month_number = 8 ...
atis
CREATE TABLE table_45672 ( "City" text, "Country" text, "IATA" text, "ICAO" text, "Airport" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What country is Bandar Abbas in?
SELECT "Country" FROM table_45672 WHERE "City" = 'bandar abbas'
wikisql
CREATE TABLE zzmzjzjlb ( 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, MZZYZDZ...
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN zzmzjzjlb JOIN jybgb JOIN jyjgzbb 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 AND zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZ...
css
CREATE TABLE table_203_387 ( id number, "parish est" number, "church" text, "city" text, "current bldg begun" number, "weekly collections" text, "notes" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how long has sacred heart basilica been...
SELECT present_ref - "parish est" FROM table_203_387 WHERE "church" = 'sacred heart basilica'
squall
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) 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 cost ( row_id nu...
SELECT admissions.age FROM admissions WHERE admissions.subject_id = 58649 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1
mimic_iii
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE patient ( ...
SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'acute respirato...
eicu
CREATE TABLE table_78188 ( "Club" text, "Wins" real, "Last final won" text, "Runners-up" real, "Last final lost" text, "Total final appearances" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What club has over 1 runners-up and last won the fina...
SELECT "Club" FROM table_78188 WHERE "Runners-up" > '1' AND "Last final won" = '2010'
wikisql
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9cod...
SELECT STRFTIME('%j', patient.unitdischargetime) - STRFTIME('%j', patient.unitadmittime) FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '015-67291') AND NOT patient.unitadmittime IS NULL ORDER BY patient.unitadmittime DESC LIMIT 1
eicu
CREATE TABLE table_name_6 ( place VARCHAR, money___$__ VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the ranking when Archie Compston is the player and the money is $73?
SELECT place FROM table_name_6 WHERE money___$__ = "73" AND player = "archie compston"
sql_create_context
CREATE TABLE table_24746 ( "Date" text, "Event #" text, "Event" text, "Winner" text, "Prize" text, "Entries" text, "Prize Pool" text, "Elapsed Time" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the prize pool for the event num...
SELECT "Prize Pool" FROM table_24746 WHERE "Event #" = '27H'
wikisql
CREATE TABLE table_49759 ( "Team 1" text, "Score" text, "Team 2" text, "1st round" text, "2nd round" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the 2nd round opponent when Team 2 is Red Star (D1)?
SELECT "2nd round" FROM table_49759 WHERE "Team 2" = 'red star (d1)'
wikisql
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, last_wardid number, ...
SELECT COUNT(*) > 0 FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 7241)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial bp mean' ...
mimic_iii
CREATE TABLE table_16194 ( "Rank" real, "Member Association" text, "Points" text, "Group stage" real, "Play-off" real, "AFC Cup" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many games had a score value of 813.5 in post-season play?
SELECT COUNT("Play-off") FROM table_16194 WHERE "Points" = '813.5'
wikisql
CREATE TABLE table_75994 ( "Source" text, "Date" text, "Goberman" text, "Loera" text, "Merkley" text, "Neville" text, "Novick" text, "Obrist" text, "Other/ Undecided" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Date has a No...
SELECT "Date" FROM table_75994 WHERE "Novick" = '26%'
wikisql
CREATE TABLE table_name_26 ( place VARCHAR, country VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was United States place when the player was Fred Couples?
SELECT place FROM table_name_26 WHERE country = "united states" AND player = "fred couples"
sql_create_context