instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_204_38 ( id number, "date" text, "opponent#" text, "rank#" text, "site" text, "result" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- were the results of the game of november 14 above or below the results of the october 17 gam...
SELECT (SELECT "result" FROM table_204_38 WHERE "date" = 'november 14') > (SELECT "result" FROM table_204_38 WHERE "date" = 'october 17')
squall
CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDisplayName text...
SELECT * FROM Posts
sede
CREATE TABLE table_17648 ( "#" real, "Athlete" text, "Shooting" text, "Fencing" text, "Swimming" text, "Riding" text, "Running" text, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the numberof running wiht pamela zapata?...
SELECT COUNT("Running") FROM table_17648 WHERE "Athlete" = 'Pamela Zapata'
wikisql
CREATE TABLE table_17596418_4 ( country VARCHAR, p VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What country has a P of GK?
SELECT country FROM table_17596418_4 WHERE p = "GK"
sql_create_context
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age te...
SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'septic shock' AND STRFTIME('%y', diagnosis.diagnos...
eicu
CREATE TABLE table_name_2 ( date INTEGER, label VARCHAR, catalog VARCHAR, format VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the earliest date for the album that had a catalog number of 3645, was formatted as a cd and was under the luaka b...
SELECT MIN(date) FROM table_name_2 WHERE catalog = "3645" AND format = "cd" AND label = "luaka bop"
sql_create_context
CREATE TABLE table_52682 ( "Division" text, "League Apps (Sub)" real, "League Goals" real, "FA Cup Apps (Sub)" text, "FA Cup Goals" real, "FL Cup Apps (Sub)" real, "FL Cup Goals" real, "Other Apps" real, "Other Goals" real, "Total Apps (Sub)" text, "Total Goals" real ) -- U...
SELECT AVG("Other Apps") FROM table_52682 WHERE "Division" = 'one' AND "League Goals" < '1'
wikisql
CREATE TABLE table_name_96 ( runner_up VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the runner-up in 2004?
SELECT runner_up FROM table_name_96 WHERE year = "2004"
sql_create_context
CREATE TABLE mzb ( CLINIC_ID text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, INSU_TYPE text, IN...
SELECT COUNT(*) FROM qtb JOIN t_kc22 ON qtb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE qtb.PERSON_ID = '90955811' AND t_kc22.STA_DATE BETWEEN '2001-02-02' AND '2007-03-01' AND t_kc22.SELF_PAY_AMO > 1737.24 UNION SELECT COUNT(*) FROM gyb JOIN t_kc22 ON gyb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gyb.PERSON_ID = '9095...
css
CREATE TABLE mzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH text, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZZMC ...
SELECT * FROM hz_info JOIN zyjzjlb ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE hz_info.person_info_XM = '魏丽文' AND hz_info.YLJGDM = '6694678' AND zyjzjlb.JZKSMC LIKE '%传染科%'
css
CREATE TABLE table_204_237 ( id number, "season" text, "average" number, "high" number, "low" number, "season tickets" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many seasons at the stadio ennio tardini had 11,000 or more season ticket...
SELECT COUNT("season") FROM table_204_237 WHERE "season tickets" >= 11000
squall
CREATE TABLE table_42237 ( "AIRLINE" text, "AIRLINE (in Arabic)" text, "ICAO" text, "CALLSIGN" text, "COMMENCED OPERATIONS" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What callsign has commenced operations in 2011?
SELECT "CALLSIGN" FROM table_42237 WHERE "COMMENCED OPERATIONS" = '2011'
wikisql
CREATE TABLE table_name_80 ( prr_class VARCHAR, wheel_arrangement VARCHAR, total_produced VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the PRR class for wheel arrangement c-c and total less than 15?
SELECT prr_class FROM table_name_80 WHERE wheel_arrangement = "c-c" AND total_produced < 15
sql_create_context
CREATE TABLE table_name_2 ( date_of_polling VARCHAR, liberal VARCHAR, polling_firm VARCHAR, green VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On what date of polling was the Polling Firm forum research with 7 green and less than 30 liberals?
SELECT date_of_polling FROM table_name_2 WHERE polling_firm = "forum research" AND green = 7 AND liberal < 30
sql_create_context
CREATE TABLE table_name_82 ( weekly_rank VARCHAR, official_ratings__millions_ VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Weekly Rank has an Official ratings (millions) of 11.58?
SELECT weekly_rank FROM table_name_82 WHERE official_ratings__millions_ = 11.58
sql_create_context
CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) CREATE TABLE patient ( uniquep...
SELECT allergy.drugname FROM allergy WHERE allergy.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '022-187132' AND patient.hospitaldischargetime IS NULL))
eicu
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospita...
SELECT MIN(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 = '007-7646')) AND intakeoutput.celllabel = 'nephro...
eicu
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 int, weight int, capacity int, pay_load int, cruising_speed int, range_...
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 = 'ATLANTA' AND flight.arrival_time = (SELECT MIN(FLIGHTalias1.arrival_time) FROM airport_s...
atis
CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE TagSynonyms ( Id number...
SELECT p.CreationDate, p.Id AS "post_link", p.Body FROM Posts AS p WHERE (p.PostTypeId = 1 AND p.Score < 3 AND COALESCE(p.AnswerCount, 0) = 0 AND ClosedDate IS NULL AND p.Body LIKE '<p>##Keyword##%') ORDER BY p.Id DESC
sede
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_kc22.AMOUNT) FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_ID = '41547321' AND t_kc22.t_kc21_CLINIC_TYPE = '门诊' AND t_kc22.STA_DATE BETWEEN '2014-11-21' AND '2016-07-07' AND t_kc22.MED_INV_ITEM_TYPE = '手术费'
css
CREATE TABLE table_22460 ( "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 MIN("GEO ID") FROM table_22460
wikisql
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) 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 T...
SELECT HIRE_DATE, COMMISSION_PCT FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%'
nvbench
CREATE TABLE gwyjzb ( 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 gwyjzb.MED_ORG_DEPT_CD, AVG(t_kc24.OVE_PAY) FROM gwyjzb JOIN t_kc24 ON gwyjzb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE gwyjzb.MED_SER_ORG_NO = '7336183' GROUP BY gwyjzb.MED_ORG_DEPT_CD UNION SELECT fgwyjzb.MED_ORG_DEPT_CD, AVG(t_kc24.OVE_PAY) FROM fgwyjzb JOIN t_kc24 ON fgwyjzb.MED_CLINIC_ID = t_kc24.MED_CLINI...
css
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsysto...
SELECT COUNT(*) FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '025-28600')) AND microlab.culturesite = 'abscess' AND STRFTIME('%y', microlab.cult...
eicu
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREA...
SELECT DISTINCT patient.gender FROM patient WHERE patient.uniquepid = '017-49538'
eicu
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.age < "31" AND procedures.icd9_code = "8852"
mimicsql_data
CREATE TABLE table_name_43 ( station VARCHAR, number VARCHAR, stop VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which station has a number less than 5 and an l stop?
SELECT station FROM table_name_43 WHERE number < 5 AND stop = "l"
sql_create_context
CREATE TABLE table_255188_1 ( institution VARCHAR, joined VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What institution joined in 1988?
SELECT institution FROM table_255188_1 WHERE joined = 1988
sql_create_context
CREATE TABLE cite ( citingpaperid int, citedpaperid int ) CREATE TABLE paper ( paperid int, title varchar, venueid int, year int, numciting int, numcitedby int, journalid int ) CREATE TABLE journal ( journalid int, journalname varchar ) CREATE TABLE dataset ( datasetid...
SELECT DISTINCT keyphrase.keyphraseid FROM author, keyphrase, paper, paperkeyphrase, writes WHERE author.authorname = 'jeffrey heer' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid AND writes.authorid = author.authorid AND writes.paperid = paper.paperid
scholar
CREATE TABLE table_10203 ( "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 venue where the away team scored 16...
SELECT "Venue" FROM table_10203 WHERE "Away team score" = '16.11 (107)'
wikisql
CREATE TABLE table_name_68 ( memory VARCHAR, clock VARCHAR, number VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Memory for a Number 32 with a Clock of 2.26ghz?
SELECT memory FROM table_name_68 WHERE clock = "2.26ghz" AND number = 32
sql_create_context
CREATE TABLE Rooms ( RoomId TEXT, roomName TEXT, beds INTEGER, bedType TEXT, maxOccupancy INTEGER, basePrice INTEGER, decor TEXT ) CREATE TABLE Reservations ( Code INTEGER, Room TEXT, CheckIn TEXT, CheckOut TEXT, Rate REAL, LastName TEXT, FirstName TEXT, Adul...
SELECT decor, MIN(basePrice) FROM Rooms GROUP BY decor ORDER BY MIN(basePrice)
nvbench
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.marital_status = "DIVORCED" AND lab.charttime = "2182-12-31 17:20:00"
mimicsql_data
CREATE TABLE customer ( customer_id SMALLINT UNSIGNED, store_id TINYINT UNSIGNED, first_name VARCHAR(45), last_name VARCHAR(45), email VARCHAR(50), address_id SMALLINT UNSIGNED, active BOOLEAN, create_date DATETIME, last_update TIMESTAMP ) CREATE TABLE rental ( rental_id INT, ...
SELECT name, COUNT(*) FROM film_category AS T1 JOIN category AS T2 ON T1.category_id = T2.category_id GROUP BY T1.category_id ORDER BY COUNT(*)
nvbench
CREATE TABLE table_name_99 ( april INTEGER, record VARCHAR, points VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest value in April with a record of 35 37 11 and more than 81 points?
SELECT MAX(april) FROM table_name_99 WHERE record = "35–37–11" AND points > 81
sql_create_context
CREATE TABLE student ( stuid number, lname text, fname text, age number, sex text, major number, advisor number, city_code text ) CREATE TABLE voting_record ( stuid number, registration_date text, election_cycle text, president_vote number, vice_president_vote number...
SELECT MAX(age), MIN(age) FROM student WHERE major = 600
spider
CREATE TABLE table_45799 ( "Game" real, "Date" text, "Team" text, "Score" text, "Record" text, "Streak" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Record has a Score of 111 101?
SELECT "Record" FROM table_45799 WHERE "Score" = '111–101'
wikisql
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) 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...
SELECT mzjzjlb.JZLSH FROM person_info JOIN hz_info JOIN mzjzjlb 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 WHERE person_info.XM = '喻鸿达' AND NOT mzjzjlb.JZLSH IN (SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ >= '2013-08-27')
css
CREATE TABLE table_20398823_1 ( podiums INTEGER, points VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the least podiums for 49 points
SELECT MIN(podiums) FROM table_20398823_1 WHERE points = "49"
sql_create_context
CREATE TABLE table_name_87 ( lost INTEGER, goals_scored VARCHAR, place VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What the lost in place less than 3 and having more than 63 goals scored?
SELECT SUM(lost) FROM table_name_87 WHERE goals_scored > 63 AND place < 3
sql_create_context
CREATE TABLE table_name_43 ( gain INTEGER, avg_g VARCHAR, loss VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the gains for the player with average of 26.8 and lost yard fewer than 13?
SELECT SUM(gain) FROM table_name_43 WHERE avg_g = "26.8" AND loss < 13
sql_create_context
CREATE TABLE table_22815265_1 ( record VARCHAR, opponents VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many records were there when opponents were 9?
SELECT COUNT(record) FROM table_22815265_1 WHERE opponents = 9
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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.insurance = "Self Pay" AND lab.label = "Platelet Count"
mimicsql_data
CREATE TABLE table_11861 ( "Rank" real, "Player" text, "Country" text, "Earnings( $ )" real, "Wins" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How much has dave stockton earned?
SELECT MAX("Earnings( $ )") FROM table_11861 WHERE "Player" = 'dave stockton'
wikisql
CREATE TABLE table_24355 ( "Type of Record" text, "Attendance" real, "Date/Year" text, "Stadium" text, "Result/Games" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what is the highest attendance for a total attendance-regular season record
SELECT MAX("Attendance") FROM table_24355 WHERE "Type of Record" = 'Total Attendance-Regular season'
wikisql
CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, country varchar, zip int ) CREATE TABLE instructor ( instructor_id int, name varchar, uniqname varchar ) CREATE TABLE course ( course_id int, na...
SELECT DISTINCT course.name, course.number, program_course.workload FROM course, program_course WHERE course.department = 'EECS' AND program_course.course_id = course.course_id AND program_course.workload = (SELECT MAX(PROGRAM_COURSEalias1.workload) FROM course AS COURSEalias1, program_course AS PROGRAM_COURSEalias1 WH...
advising
CREATE TABLE table_name_43 ( number_of_households INTEGER, median_household_income VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the sum of households that makes a median household income of $44,718?
SELECT SUM(number_of_households) FROM table_name_43 WHERE median_household_income = "$44,718"
sql_create_context
CREATE TABLE table_name_39 ( astc_member VARCHAR, aam_accredited VARCHAR, state VARCHAR, aam_member VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is ASTC Member, when State is Arkansas, when AAM Member is No, and when AAM Accredited is Yes?
SELECT astc_member FROM table_name_39 WHERE state = "arkansas" AND aam_member = "no" AND aam_accredited = "yes"
sql_create_context
CREATE TABLE table_name_72 ( place VARCHAR, artist VARCHAR, points VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the total number of places for vicky gordon and points more than 23
SELECT COUNT(place) FROM table_name_72 WHERE artist = "vicky gordon" AND points > 23
sql_create_context
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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Hamartoses NEC" AND prescriptions.drug_type = "ADDITIVE"
mimicsql_data
CREATE TABLE table_name_30 ( attendance INTEGER, arena VARCHAR, points VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How much Attendance has an Arena of arrowhead pond of anaheim, and Points of 5?
SELECT SUM(attendance) FROM table_name_30 WHERE arena = "arrowhead pond of anaheim" AND points = 5
sql_create_context
CREATE TABLE table_204_448 ( id number, "team" text, "winners" number, "runners-up" number, "years won" text, "years runner-up" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which teams has the least wins ?
SELECT "team" FROM table_204_448 WHERE "winners" = (SELECT MIN("winners") FROM table_204_448)
squall
CREATE TABLE Courses ( course_id INTEGER, author_id INTEGER, subject_id INTEGER, course_name VARCHAR(120), course_description VARCHAR(255) ) CREATE TABLE Students ( student_id INTEGER, date_of_registration DATETIME, date_of_latest_logon DATETIME, login_name VARCHAR(40), password...
SELECT T2.middle_name, T1.student_id FROM Student_Course_Enrolment AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id ORDER BY T1.student_id DESC
nvbench
CREATE TABLE table_name_65 ( leading_scorer VARCHAR, attendance VARCHAR, record VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Leading Scorer, when Attendance is Gund Arena 20,562, and when Record is 20-10?
SELECT leading_scorer FROM table_name_65 WHERE attendance = "gund arena 20,562" AND record = "20-10"
sql_create_context
CREATE TABLE table_10038 ( "Team" text, "Match" real, "Points" real, "Draw" real, "Lost" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the number of points when the match is smaller than 14?
SELECT COUNT("Points") FROM table_10038 WHERE "Match" < '14'
wikisql
CREATE TABLE election ( Election_ID int, Counties_Represented text, District int, Delegate text, Party int, First_Elected real, Committee text ) CREATE TABLE county ( County_Id int, County_name text, Population real, Zip_code text ) CREATE TABLE party ( Party_ID int, ...
SELECT County_name, COUNT(*) FROM county AS T1 JOIN election AS T2 ON T1.County_Id = T2.District GROUP BY T1.County_Id ORDER BY COUNT(*)
nvbench
CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number...
SELECT * FROM Posts WHERE Id = '5312400'
sede
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 WHERE demographic.insurance = "Medicaid" AND demographic.diagnosis = "MORBID OBESITY/SDA"
mimicsql_data
CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDa...
SELECT u.Id AS "user_link", u.Reputation, COUNT(*) AS "total_number_of_posts", COUNT(*) / u.Reputation AS Ratio FROM Users AS u JOIN Posts AS p ON p.OwnerUserId = u.Id WHERE p.PostTypeId IN (1, 2) GROUP BY u.Id, u.DisplayName, u.Reputation ORDER BY Ratio DESC LIMIT 100
sede
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2110" AND diagnoses.icd9_code = "7885"
mimicsql_data
CREATE TABLE table_29471472_1 ( season INTEGER, team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What season was the team autosport academy?
SELECT MAX(season) FROM table_29471472_1 WHERE team = "Autosport Academy"
sql_create_context
CREATE TABLE table_36446 ( "Year" text, "Flagship Station" text, "Play-by-play" text, "Color commentator(s)" text, "Studio host" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the flagship station for cedric maxwell and year of 1995-96
SELECT "Flagship Station" FROM table_36446 WHERE "Color commentator(s)" = 'cedric maxwell' AND "Year" = '1995-96'
wikisql
CREATE TABLE table_13741576_4 ( try_bonus VARCHAR, tries_against VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the try bonus for tries against is 70
SELECT try_bonus FROM table_13741576_4 WHERE tries_against = "70"
sql_create_context
CREATE TABLE table_8235 ( "ISLAND" text, "CITY / TOWN" text, "ICAO" text, "IATA" text, "AIRPORTNAME" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the name of the airport in S o Filipe that has an IATA of sfl?
SELECT "AIRPORTNAME" FROM table_8235 WHERE "CITY / TOWN" = 'são filipe' AND "IATA" = 'sfl'
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 demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.short_title = "Human immuno virus dis" AND lab.flag = "abnormal"
mimicsql_data
CREATE TABLE table_18662026_10 ( gymnast VARCHAR, parallel_bars VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- If the parallel bars is 14.025, what is the total number of gymnasts?
SELECT COUNT(gymnast) FROM table_18662026_10 WHERE parallel_bars = "14.025"
sql_create_context
CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, ...
SELECT TOP(100) AS DisplayName, Reputation, AnswerCount, CommentCount FROM Users, Posts ORDER BY Reputation DESC
sede
CREATE TABLE party ( Party_Theme VARCHAR, Number_of_hosts VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- List the themes of parties in ascending order of number of hosts.
SELECT Party_Theme FROM party ORDER BY Number_of_hosts
sql_create_context
CREATE TABLE table_12599 ( "State" text, "Status" text, "Association Agreement" text, "Membership Application" text, "Candidate status" text, "Negotiations start" text, "Screening completed" text, "Acquis Chapters open/closed" text ) -- Using valid SQLite, answer the following question...
SELECT "Candidate status" FROM table_12599 WHERE "State" = 'macedonia'
wikisql
CREATE TABLE table_44766 ( "Round" real, "Pick" real, "Overall" real, "Name" text, "Position" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Name, when Overall is greater than 132, and when Round is 12?
SELECT "Name" FROM table_44766 WHERE "Overall" > '132' AND "Round" = '12'
wikisql
CREATE TABLE table_43814 ( "Club" text, "League goals" text, "FA Cup goals" text, "League Cup goals" text, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which League Cup goals have a Total larger than 14, and a League goals of 14, and a FA ...
SELECT "League Cup goals" FROM table_43814 WHERE "Total" > '14' AND "League goals" = '14' AND "FA Cup goals" = '0'
wikisql
CREATE TABLE table_name_58 ( lost VARCHAR, points VARCHAR, points_against VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- when points were 36 and points against 489 what is the lost?
SELECT lost FROM table_name_58 WHERE points = "36" AND points_against = "489"
sql_create_context
CREATE TABLE table_11216 ( "Pick" real, "Round" text, "Player" text, "Position" text, "School" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What position did the school of alabama draft?
SELECT "Position" FROM table_11216 WHERE "School" = 'alabama'
wikisql
CREATE TABLE table_77897 ( "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 for victoria park?
SELECT "Home team" FROM table_77897 WHERE "Venue" = 'victoria park'
wikisql
CREATE TABLE table_name_60 ( tournament VARCHAR, opponent VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which tournament did the opponent Guillermo Carry play?
SELECT tournament FROM table_name_60 WHERE opponent = "guillermo carry"
sql_create_context
CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, ...
SELECT A.ParentId AS "Question ID", Q.Id AS "post_link", Q.Tags AS "Tags", Q.ViewCount AS "Views" FROM Posts AS A INNER JOIN Posts AS Q ON Q.Id = A.ParentId WHERE A.PostTypeId = 2 AND A.OwnerUserId = @UserId ORDER BY Q.ViewCount DESC
sede
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 PER_SOL FROM t_kc24 WHERE MED_CLINIC_ID = '42021266388'
css
CREATE TABLE table_name_56 ( crowd INTEGER, venue VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who has the smallest crowd in the Venue of Arden Street Oval?
SELECT MIN(crowd) FROM table_name_56 WHERE venue = "arden street oval"
sql_create_context
CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, ...
SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT procedures_icd.icd9_code FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 15257) AND STRFTIME('%y', procedures_icd.charttime) <= '2104' ORDER ...
mimic_iii
CREATE TABLE table_name_99 ( player VARCHAR, to_par VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Name the Player which has a To par of 6?
SELECT player FROM table_name_99 WHERE to_par = "–6"
sql_create_context
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) 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 microbiologyevents.spec_type_desc FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 5878 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1) ORDER BY microbiologyevents.charttime DESC LIMIT 1
mimic_iii
CREATE TABLE table_name_13 ( silver VARCHAR, total VARCHAR, gold VARCHAR, bronze VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total number of silver medals of the team with less than 2 gold, 1 bronze, and more than 2 total medals?
SELECT COUNT(silver) FROM table_name_13 WHERE gold < 2 AND bronze = 1 AND total > 2
sql_create_context
CREATE TABLE table_train_233 ( "id" int, "serum_bicarbonate" int, "language" string, "hemoglobin_a1c_hba1c" float, "creatinine_clearance_cl" float, "admission_blood_glucose" int, "urine_albumin" int, "ketoacidosis" bool, "age" float, "NOUSE" float ) -- Using valid SQLite, answe...
SELECT * FROM table_train_233 WHERE admission_blood_glucose > 140 AND admission_blood_glucose < 400 AND (ketoacidosis = 0 OR serum_bicarbonate > 18)
criteria2sql
CREATE TABLE table_name_98 ( opponent VARCHAR, points VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which opponent has 63 points?
SELECT opponent FROM table_name_98 WHERE points = 63
sql_create_context
CREATE TABLE settlements ( settlement_id number, claim_id number, date_claim_made time, date_claim_settled time, amount_claimed number, amount_settled number, customer_policy_id number ) CREATE TABLE payments ( payment_id number, settlement_id number, payment_method_code text, ...
SELECT date_claim_made FROM claims ORDER BY date_claim_made LIMIT 1
spider
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, SUM(Team_ID) FROM basketball_match GROUP BY All_Home ORDER BY All_Home DESC
nvbench
CREATE TABLE table_name_84 ( wins VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is listed for the Wins with a Year of 1989?
SELECT wins FROM table_name_84 WHERE year = 1989
sql_create_context
CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ...
SELECT ROW_NUMBER() OVER (ORDER BY u.Reputation DESC) AS "#", u.Id AS "user_link", u.Reputation FROM Users AS u INNER JOIN Posts AS p ON p.OwnerUserId = u.Id INNER JOIN PostTags AS pt ON pt.PostId = p.Id INNER JOIN Tags AS t ON t.Id = pt.TagId WHERE LOWER(u.Location) LIKE '%singapore%' OR UPPER(u.Location) LIKE '%SG' A...
sede
CREATE TABLE Transactions ( transaction_id INTEGER, investor_id INTEGER, transaction_type_code VARCHAR(10), date_of_transaction DATETIME, amount_of_transaction DECIMAL(19,4), share_count VARCHAR(40), other_details VARCHAR(255) ) CREATE TABLE Ref_Transaction_Types ( transaction_type_code...
SELECT investor_id, AVG(amount_of_transaction) FROM Transactions GROUP BY investor_id
nvbench
CREATE TABLE table_name_96 ( city VARCHAR, club VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which city has a club called the Huntsville Stars?
SELECT city FROM table_name_96 WHERE club = "huntsville stars"
sql_create_context
CREATE TABLE table_4556 ( "Actor/actress" text, "Character" text, "Rank" text, "Tenure" text, "Episodes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What rank did actor Aaron Pedersen's character have?
SELECT "Rank" FROM table_4556 WHERE "Actor/actress" = 'aaron pedersen'
wikisql
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREA...
SELECT MAX(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 = '025-51980')) AND intakeoutput.celllabel = 'urine...
eicu
CREATE TABLE table_23846 ( "Parish" text, "Obama%" text, "Obama#" real, "McCain%" text, "McCain#" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was McCain's percentage when Obama had 64.39% of the vote?
SELECT "McCain%" FROM table_23846 WHERE "Obama%" = '64.39%'
wikisql
CREATE TABLE t_kc21_t_kc22 ( MED_CLINIC_ID text, MED_EXP_DET_ID number ) 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, C...
SELECT t_kc21.IN_DIAG_DIS_CD, t_kc21.IN_DIAG_DIS_NM FROM t_kc21 WHERE t_kc21.PERSON_NM = '郎曼吟'
css
CREATE TABLE table_204_809 ( id number, "draw" number, "country" text, "language" text, "artist" text, "song" text, "english translation" text, "national final" text, "place" number, "points" number ) -- Using valid SQLite, answer the following questions for the tables provided...
SELECT COUNT("country") FROM table_204_809 WHERE "country" <> 'spain' AND "national final" = 2
squall
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime...
SELECT MIN(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 = '016-13544')) AND intakeoutput.celllabel = 'outpu...
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 prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.drug = "NIFEdipine CR"
mimicsql_data
CREATE TABLE table_57852 ( "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 on 27 june 1981, at ...
SELECT "Home team" FROM table_57852 WHERE "Date" = '27 june 1981' AND "Venue" = 'vfl park'
wikisql
CREATE TABLE table_29289 ( "Season" text, "Coach" text, "Conf. Record" text, "Overall" text, "Standings" text, "Postseason" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was the coach of the Pandas when their overall record was 20-6-2?
SELECT "Coach" FROM table_29289 WHERE "Overall" = '20-6-2'
wikisql
CREATE TABLE table_31291 ( "Season" text, "Level" text, "Division" text, "Section" text, "Position" text, "Movements" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- in what year the position was the 9th
SELECT "Season" FROM table_31291 WHERE "Position" = '9th'
wikisql