instruction
stringlengths
151
7.46k
output
stringlengths
2
4.44k
source
stringclasses
26 values
CREATE TABLE table_4792 ( "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 Melbourne's home venue?
SELECT "Venue" FROM table_4792 WHERE "Home team" = 'melbourne'
wikisql
CREATE TABLE table_name_26 ( home_team VARCHAR, away_team VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who was North Melbourne's home opponent?
SELECT home_team FROM table_name_26 WHERE away_team = "north melbourne"
sql_create_context
CREATE TABLE jyjgzbb ( JYZBLSH text, YLJGDM text, BGDH text, BGRQ time, JYRQ time, JCRGH text, JCRXM text, SHRGH text, SHRXM text, JCXMMC text, JCZBDM text, JCFF text, JCZBMC text, JCZBJGDX text, JCZBJGDL number, JCZBJGDW text, SBBM text, YQBH text...
(SELECT jyjgzbb.JYZBLSH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM =...
css
CREATE TABLE table_name_79 ( player VARCHAR, first_team_appearances VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who is the player who has had 7 first team appearances?
SELECT player FROM table_name_79 WHERE first_team_appearances = "7"
sql_create_context
CREATE TABLE table_name_98 ( match_report VARCHAR, result_score VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which match report has l 7-30 as the result/score?
SELECT match_report FROM table_name_98 WHERE result_score = "l 7-30"
sql_create_context
CREATE TABLE table_name_40 ( winning_score VARCHAR, tournament VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the winning score for the B.C. Open 1 tournament?
SELECT winning_score FROM table_name_40 WHERE tournament = "b.c. open 1"
sql_create_context
CREATE TABLE table_204_29 ( id number, "rank" number, "lane" number, "name" text, "nationality" text, "time" text, "notes" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- was marco loughran 's time more or less than ashley delaney 's time ?
SELECT (SELECT "time" FROM table_204_29 WHERE "name" = 'marco loughran') > (SELECT "time" FROM table_204_29 WHERE "name" = 'ashley delaney')
squall
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_kc24.PER_SOL FROM t_kc24 JOIN t_kc21_t_kc24 JOIN t_kc21 ON t_kc21_t_kc24.MED_SAFE_PAY_ID = t_kc24.MED_SAFE_PAY_ID AND t_kc21_t_kc24.MED_CLINIC_ID = t_kc21.MED_CLINIC_ID WHERE t_kc21.MED_CLINIC_ID = '79030741932'
css
CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TAB...
SELECT COUNT(U.Id) AS "Total Users" FROM Users AS U WHERE U.Reputation > '##MinimumReputation:int##' AND U.Reputation < '##MaximumReputation:int##'
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 SOC_SRT_DIRE_CD, SOC_SRT_DIRE_NM FROM t_kc22 WHERE MED_CLINIC_ID = '99717700753' GROUP BY SOC_SRT_DIRE_CD ORDER BY SUM(SELF_PAY_AMO) DESC LIMIT 1
css
CREATE TABLE Transactions_Lots ( transaction_id INTEGER, lot_id INTEGER ) 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_det...
SELECT lot_details, COUNT(lot_details) FROM Lots GROUP BY lot_details
nvbench
CREATE TABLE table_12338595_1 ( interview VARCHAR, evening_gown VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which interview score corresponds with the evening gown score of 8.977?
SELECT interview FROM table_12338595_1 WHERE evening_gown = "8.977"
sql_create_context
CREATE TABLE table_name_27 ( country VARCHAR, money___$__ VARCHAR, player VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which country has a prize smaller than $250 and the player Henry Picard?
SELECT country FROM table_name_27 WHERE money___$__ < 250 AND player = "henry picard"
sql_create_context
CREATE TABLE table_30533 ( "No." real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" text, "U.S. viewers (million)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Who wrote the episode with ...
SELECT "Written by" FROM table_30533 WHERE "Production code" = '2J5568'
wikisql
CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE student ( student_id int, lastname varchar, firstname varchar, program_id int, declare_major varchar, total_credit int, total...
SELECT DISTINCT semester.year FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'NRE' AND course.number = 589 AND semester.semester_id = course_offering.semester ORDER BY semester.year LIMIT 1
advising
CREATE TABLE table_train_42 ( "id" int, "taking_vitamin_c" bool, "do_not_resuscitate_dnr" bool, "allergy_to_thiamine" bool, "taking_thiamine" bool, "receiving_vasopressor" bool, "sepsis" bool, "hypotension" bool, "allergy_to_vitamin_c" bool, "glucose_6_phosphate_dehydrogenase_def...
SELECT * FROM table_train_42 WHERE taking_vitamin_c = 1 OR taking_thiamine = 1
criteria2sql
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 diagnoses ( ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dod_year <= "2179.0" AND lab.label = "Eosinophils"
mimicsql_data
CREATE TABLE table_53440 ( "Race Name" text, "Circuit" text, "Date" text, "Winning driver" text, "Constructor" text, "Report" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What dates did Ferrari win races?
SELECT "Date" FROM table_53440 WHERE "Constructor" = 'ferrari'
wikisql
CREATE TABLE table_68527 ( "Compound name" text, "Colour" text, "Tread" text, "Driving conditions" text, "Dry Type*" text, "Grip" text, "Durability" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What compound is yellow?
SELECT "Compound name" FROM table_68527 WHERE "Colour" = 'yellow'
wikisql
CREATE TABLE table_26546 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the production cod...
SELECT MAX("Production code") FROM table_26546 WHERE "Original air date" = 'January 8, 1993'
wikisql
CREATE TABLE Medication ( Code INTEGER, Name VARCHAR(30), Brand VARCHAR(30), Description VARCHAR(30) ) CREATE TABLE Patient ( SSN INTEGER, Name VARCHAR(30), Address VARCHAR(30), Phone VARCHAR(30), InsuranceID INTEGER, PCP INTEGER ) CREATE TABLE Nurse ( EmployeeID INTEGER, ...
SELECT T1.Name, COUNT(*) FROM Physician AS T1 JOIN Patient AS T2 ON T1.EmployeeID = T2.PCP GROUP BY T1.EmployeeID
nvbench
CREATE TABLE table_35267 ( "Name" text, "Term start" real, "Term end" text, "Date of Birth" text, "Date of Death" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which leader born on December 17, 1874 started their term before 1984?
SELECT "Name" FROM table_35267 WHERE "Term start" < '1984' AND "Date of Birth" = 'december 17, 1874'
wikisql
CREATE TABLE table_train_223 ( "id" int, "anemia" bool, "diabetic" string, "eye_disease" bool, "hgb" int, "retinal_pigmentation_abnormalities" bool, "glucose_6_phosphate_dehydrogenase_deficiency_g6pd" int, "age" float, "NOUSE" float ) -- Using valid SQLite, answer the following que...
SELECT * FROM table_train_223 WHERE glucose_6_phosphate_dehydrogenase_deficiency_g6pd = 1
criteria2sql
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( 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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2172" AND lab.label = "Fibrin Degradation Products"
mimicsql_data
CREATE TABLE table_203_399 ( id number, "pos." text, "driver" text, "co-driver" text, "car" text, "time" text, "difference" text, "points" number ) -- Using valid SQLite, answer the following questions for the tables provided above. -- what was the time for the driver who came in last...
SELECT MAX("time") FROM table_203_399
squall
CREATE TABLE injury_accident ( game_id int, id int, Player text, Injury text, Number_of_matches text, Source text ) CREATE TABLE game ( stadium_id int, id int, Season int, Date text, Home_team text, Away_team text, Score text, Competition text ) CREATE TABLE sta...
SELECT Away_team, COUNT(Away_team) FROM game GROUP BY Away_team ORDER BY COUNT(Away_team)
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 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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Impair ren funct dis NEC" AND prescriptions.drug_type = "MAIN"
mimicsql_data
CREATE TABLE table_56364 ( "Class" text, "Ships in class" text, "Pennant Number" real, "Unit" text, "Builder" text, "Commissioned" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the highest pennant number with ships in pori class?
SELECT MAX("Pennant Number") FROM table_56364 WHERE "Ships in class" = 'pori'
wikisql
CREATE TABLE table_43892 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Ground" text, "Date" text, "Time" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Time, when Ground is Waverley Park, and ...
SELECT "Time" FROM table_43892 WHERE "Ground" = 'waverley park' AND "Away team" = 'footscray'
wikisql
CREATE TABLE table_46290 ( "Rider" text, "Manufacturer" text, "Laps" real, "Time" text, "Grid" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total of laps with grid of 2
SELECT SUM("Laps") FROM table_46290 WHERE "Grid" = '2'
wikisql
CREATE TABLE table_name_8 ( format VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What format is dated October 29, 2004?
SELECT format FROM table_name_8 WHERE date = "october 29, 2004"
sql_create_context
CREATE TABLE table_name_84 ( result VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the Result on 11/02/1946?
SELECT result FROM table_name_84 WHERE date = "11/02/1946"
sql_create_context
CREATE TABLE schedule ( Cinema_ID int, Film_ID int, Date text, Show_times_per_day int, Price float ) CREATE TABLE film ( Film_ID int, Rank_in_series int, Number_in_season int, Title text, Directed_by text, Original_air_date text, Production_code text ) CREATE TABLE cine...
SELECT Name, Price FROM schedule AS T1 JOIN film AS T2 ON T1.Film_ID = T2.Film_ID JOIN cinema AS T3 ON T1.Cinema_ID = T3.Cinema_ID GROUP BY Title, Name ORDER BY Name
nvbench
CREATE TABLE table_name_97 ( staffel_b VARCHAR, staffel_c VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Staffel B that has Hallescher Fc Chemie as Staffel C?
SELECT staffel_b FROM table_name_97 WHERE staffel_c = "hallescher fc chemie"
sql_create_context
CREATE TABLE table_74322 ( "No. in series" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" text, "U.S. viewers (million)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many director...
SELECT COUNT("Directed by") FROM table_74322 WHERE "U.S. viewers (million)" = '6.79'
wikisql
CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE PostHistory ( Id num...
SELECT MIN(DTags.TagName) AS TagName, COUNT(*) AS Count FROM Tags AS STags, PostTags AS S, PostTags AS D, Tags AS DTags WHERE LOWER(STags.TagName) = LOWER('##TagName:string##') AND S.TagId = STags.Id AND S.PostId = D.PostId AND DTags.Id = D.TagId AND DTags.Id != S.TagId GROUP BY DTags.Id ORDER BY Count DESC, DTags.Id L...
sede
CREATE TABLE table_34632 ( "Spacecraft" text, "Destination" text, "Launched" text, "Closest approach" text, "Time elapsed" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- With a Launched of 3 July 1998 what is the Closest approach?
SELECT "Closest approach" FROM table_34632 WHERE "Launched" = '3 july 1998'
wikisql
CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), HIRE_DATE date, JOB_ID varchar(10), SALARY decimal(8,2), COMMISSION_PCT decimal(2,2), MANAGER_ID decimal(6,0), DEPARTMENT_ID decimal(...
SELECT LAST_NAME, COMMISSION_PCT FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY LAST_NAME DESC
nvbench
CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE compartment_class ( compartment varchar, class_type varchar ) CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TABLE fare ( fare_id int, from_...
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 = 'DENVER' AND flight.departure_time > 500 AND flight.to_airport = AIRPORT_SERVICE_1.airpor...
atis
CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TAB...
SELECT P.Id AS "post_link", P.PostTypeId, P.Title, P.Body, P.Tags, P.AnswerCount, P.CommentCount, C.Text, C.Score, C.Id, P.CreationDate, P.Score, P.ViewCount, P.OwnerUserId, P.LastEditDate, P.LastActivityDate FROM Posts AS P INNER JOIN Comments AS C ON P.Id = C.PostId WHERE P.PostTypeId = 1 AND (P.Tags LIKE '%##tag1##%...
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 prescription...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE prescriptions.formulary_drug_cd = "TERAZ5" AND lab.fluid = "Urine"
mimicsql_data
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) 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, ...
SELECT * FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE hz_info.RYBH = '...
css
CREATE TABLE news_report ( journalist_ID int, Event_ID int, Work_Type text ) CREATE TABLE event ( Event_ID int, Date text, Venue text, Name text, Event_Attendance int ) CREATE TABLE journalist ( journalist_ID int, Name text, Nationality text, Age text, Years_working...
SELECT Nationality, COUNT(Nationality) FROM journalist GROUP BY Nationality
nvbench
CREATE TABLE table_71491 ( "Name" text, "Years" text, "Gender" text, "Area" text, "Authority" text, "Decile" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What authority is the coed school in pinehaven?
SELECT "Authority" FROM table_71491 WHERE "Gender" = 'coed' AND "Area" = 'pinehaven'
wikisql
CREATE TABLE table_14346 ( "Round" real, "Race Title" text, "Grand Prix" text, "Circuit" text, "Date" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which date has a Race Title of dhl turkish grand prix?
SELECT "Date" FROM table_14346 WHERE "Race Title" = 'dhl turkish grand prix'
wikisql
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 advisor FROM student WHERE city_code = "BAL"
spider
CREATE TABLE table_24861 ( "No. in series" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the original air date for the production cod...
SELECT "Original air date" FROM table_24861 WHERE "Production code" = '1.12'
wikisql
CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text,...
WITH RankedUsers AS (SELECT RANK() OVER (ORDER BY COUNT(*) DESC) AS Rank, p.OwnerUserId AS UserId, COUNT(*) AS QuestionCount FROM Posts AS p WHERE PostTypeId = 1 AND p.Score > 0 GROUP BY p.OwnerUserId) SELECT Rank, UserID AS "user_link", QuestionCount FROM RankedUsers WHERE Rank < 100 OR UserID = '##UserId##' ORDER BY ...
sede
CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, ...
SELECT Posts.OwnerUserId AS "user_link", COUNT(*) AS BountiesWon, SUM(Votes.BountyAmount) AS Booty FROM Votes INNER JOIN Posts ON Votes.PostId = Posts.Id WHERE VoteTypeId = 9 GROUP BY Posts.OwnerUserId ORDER BY Booty DESC LIMIT 300
sede
CREATE TABLE area ( course_id int, area varchar ) CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE p...
SELECT DISTINCT course_offering.end_time, course_offering.friday, course_offering.monday, course_offering.saturday, course_offering.start_time, course_offering.sunday, course_offering.thursday, course_offering.tuesday, course_offering.wednesday FROM course, course_offering, semester WHERE course.course_id = course_offe...
advising
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE cost ( c...
SELECT DISTINCT medication.routeadmin FROM medication WHERE medication.drugname = 'diphenhydramine'
eicu
CREATE TABLE zyjzjlb ( YLJGDM text, JZLSH text, MZJZLSH text, KH text, KLX number, HZXM text, WDBZ number, RYDJSJ time, RYTJDM number, RYTJMC text, JZKSDM text, JZKSMC text, RZBQDM text, RZBQMC text, RYCWH text, CYKSDM text, CYKSMC text, CYBQDM tex...
SELECT * FROM jyjgzbb WHERE JCZBMC = (SELECT JCZBMC FROM jyjgzbb WHERE JYZBLSH = '65019471454') AND JCZBJGDW = (SELECT JCZBJGDW FROM jyjgzbb WHERE JYZBLSH = '65019471454') AND JCZBJGDL > (SELECT JCZBJGDL FROM jyjgzbb WHERE JYZBLSH = '65019471454')
css
CREATE TABLE college ( cname text, state text, enr number ) CREATE TABLE player ( pid number, pname text, ycard text, hs number ) CREATE TABLE tryout ( pid number, cname text, ppos text, decision text ) -- Using valid SQLite, answer the following questions for the tables ...
SELECT DISTINCT cname FROM college WHERE enr > (SELECT MIN(enr) FROM college WHERE state = 'FL')
spider
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost numbe...
SELECT MAX(lab.labresult) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '013-11660')) AND lab.labname = 'phosphate' AND DATETIME(lab.labresulttime) >= DATE...
eicu
CREATE TABLE table_204_195 ( id number, "team" text, "home city" text, "stadium" text, "capacity" number, "last season" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- which stadium holds more people , yeshurun or holon city .
SELECT "stadium" FROM table_204_195 WHERE "stadium" IN ('yeshurun', 'holon city arena') ORDER BY "capacity" DESC LIMIT 1
squall
CREATE TABLE table_27700375_8 ( game VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many games were held on January 5?
SELECT COUNT(game) FROM table_27700375_8 WHERE date = "January 5"
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 HIRE_DATE, SUM(SALARY) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY SUM(SALARY) DESC
nvbench
CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) CREATE TABLE SuggestedEdits ( Id number, ...
SELECT PostId AS "post_link", CreationDate, Text FROM Comments WHERE UserId = '##UserId:int##' AND Text COLLATE SQL_Latin1_General_CP1_CI_AS LIKE '%' + '##query:string##' + '%' ORDER BY CreationDate
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 COUNT(*) FROM t_kc21 WHERE MED_SER_ORG_NO = '5083520' AND IN_HOSP_DATE BETWEEN '2011-06-06' AND '2020-04-21' AND IN_DIAG_DIS_CD <> OUT_DIAG_DIS_CD
css
CREATE TABLE table_17104539_12 ( score VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the scores for games played on september 9?
SELECT score FROM table_17104539_12 WHERE date = "September 9"
sql_create_context
CREATE TABLE Course_Authors_and_Tutors ( author_id INTEGER, author_tutor_ATB VARCHAR(3), login_name VARCHAR(40), password VARCHAR(40), personal_name VARCHAR(80), middle_name VARCHAR(80), family_name VARCHAR(80), gender_mf VARCHAR(1), address_line_1 VARCHAR(80) ) CREATE TABLE Student...
SELECT middle_name, gender_mf FROM Course_Authors_and_Tutors ORDER BY personal_name
nvbench
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 t_kc21.MED_SER_ORG_NO FROM t_kc21 WHERE t_kc21.PERSON_NM = '尤修远' AND t_kc21.MED_CLINIC_ID IN (SELECT t_kc21_t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.SOC_SRT_DIRE_NM = '拉莫三嗪片')
css
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE icust...
SELECT (SELECT SUM(inputevents_cv.amount) FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 30044)) AND DATETIME(inputevents_cv.charttime) <= DATETIME(CURRENT_TIME(), '-86 da...
mimic_iii
CREATE TABLE table_13456202_1 ( location VARCHAR, mascot VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What are the locations with an eagles macot?
SELECT location FROM table_13456202_1 WHERE mascot = "Eagles"
sql_create_context
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 COUNT(*) > 0 FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 10539) AND STRFTIME('%y', microbiologyevents.charttime) <= '2103'
mimic_iii
CREATE TABLE table_39960 ( "Country" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Gold has a Total of 2998, and a Bronze smaller than 1191?
SELECT AVG("Gold") FROM table_39960 WHERE "Total" = '2998' AND "Bronze" < '1191'
wikisql
CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, ...
SELECT 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 = '035-24054')) AND NOT vitalperiodic.systemicsystolic...
eicu
CREATE TABLE hz_info ( KH text, KLX number, YLJGDM text, RYBH text ) CREATE TABLE jyjgzbb ( JYZBLSH text, YLJGDM text, BGDH text, BGRQ time, JYRQ time, JCRGH text, JCRXM text, SHRGH text, SHRXM text, JCXMMC text, JCZBDM text, JCFF text, JCZBMC text, ...
(SELECT mzjzjlb.YLJGDM FROM hz_info JOIN mzjzjlb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE hz_info.RYBH = '52382275') UNION (SELECT zyjzjlb.YLJGDM FROM hz_info JOIN zyjzjlb ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.K...
css
CREATE TABLE table_name_61 ( lost VARCHAR, highest_ranking VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the total number of Lost for the Highest Ranking of ?
SELECT COUNT(lost) FROM table_name_61 WHERE highest_ranking = "– –"
sql_create_context
CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) -- Using valid SQLite, answer the following questions for the...
SELECT T1.Code, T1.Manufacturer FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code
nvbench
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 d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admi...
mimic_iii
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE intakeoutput ( intakeou...
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', treatment.treatmenttime)) FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-85328...
eicu
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW text, ...
SELECT mzjzjlb.SG, mzjzjlb.TZ FROM person_info JOIN hz_info JOIN mzjzjlb JOIN hz_info_mzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.YLJGDM = hz_info_mzjzjlb.YL...
css
CREATE TABLE table_name_89 ( tamil VARCHAR, hindi VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- WHAT IS THE TAMIL WITH A SUKRAVAR ?
SELECT tamil FROM table_name_89 WHERE hindi = "sukravar"
sql_create_context
CREATE TABLE table_name_45 ( score VARCHAR, date VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the Score on October 7, 2000?
SELECT score FROM table_name_45 WHERE date = "october 7, 2000"
sql_create_context
CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) 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 ...
SELECT JOB_ID, SALARY FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY JOB_ID
nvbench
CREATE TABLE table_57883 ( "Player" text, "Height" text, "School" text, "Hometown" text, "College" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the player that is from seattle prep?
SELECT "Player" FROM table_57883 WHERE "School" = 'seattle prep'
wikisql
CREATE TABLE table_name_26 ( republican VARCHAR, district VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which Republican has a District of 10?
SELECT republican FROM table_name_26 WHERE district = 10
sql_create_context
CREATE TABLE actor ( aid int, gender text, name text, nationality text, birth_city text, birth_year int ) CREATE TABLE movie ( mid int, title text, release_year int, title_aka text, budget text ) CREATE TABLE written_by ( id int, msid int, wid int ) CREATE TABL...
SELECT movie.title FROM classification, genre, movie WHERE genre.genre = 'Sci-Fi' AND genre.gid = classification.gid AND movie.mid = classification.msid AND movie.release_year = 2010
imdb
CREATE TABLE table_203_67 ( id number, "place" number, "team" text, "played" number, "won" number, "draw" number, "lost" number, "goals\nscored" number, "goals\nconceded" number, "+/-" number, "points" number ) -- Using valid SQLite, answer the following questions for the t...
SELECT "team" FROM table_203_67 ORDER BY "points" DESC LIMIT 1
squall
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE labevents ( row_id number,...
SELECT d_items.label FROM d_items WHERE d_items.itemid IN (SELECT t1.itemid FROM (SELECT inputevents_cv.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM inputevents_cv WHERE STRFTIME('%y', inputevents_cv.charttime) = '2103' GROUP BY inputevents_cv.itemid) AS t1 WHERE t1.c1 <= 5)
mimic_iii
CREATE TABLE table_name_64 ( laps INTEGER, driver VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which is least lap is mika salo in?
SELECT MIN(laps) FROM table_name_64 WHERE driver = "mika salo"
sql_create_context
CREATE TABLE table_34563 ( "Rank" real, "Name" text, "Nationality" text, "1st (m)" real, "2nd (m)" real, "Points" real, "Overall FHT points" text, "Overall WC points (Rank)" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How much Rank ha...
SELECT COUNT("Rank") FROM table_34563 WHERE "Name" = 'simon ammann' AND "2nd (m)" > '139'
wikisql
CREATE TABLE Student_Addresses ( student_id INTEGER, address_id INTEGER, date_address_from DATETIME, date_address_to DATETIME, monthly_rental DECIMAL(19,4), other_details VARCHAR(255) ) CREATE TABLE Behavior_Incident ( incident_id INTEGER, incident_type_code VARCHAR(10), student_id ...
SELECT date_of_notes, COUNT(date_of_notes) FROM Assessment_Notes AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id WHERE T2.first_name = "Fanny" ORDER BY COUNT(date_of_notes) DESC
nvbench
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugsto...
SELECT DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'medication' AND cost.eventid IN (SELECT medication.medicationid FROM medication WHERE medication.drugname = 'prochlorperazine maleate 10 mg po tabs')
eicu
CREATE TABLE table_203_657 ( id number, "call sign" text, "frequency" text, "city of license" text, "licensee" text, "format" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- how many stations have the same format as the station klfv ?
SELECT COUNT(*) FROM table_203_657 WHERE "call sign" <> 'klfv' AND "format" = (SELECT "format" FROM table_203_657 WHERE "call sign" = 'klfv')
squall
CREATE TABLE table_72321 ( "Episode title" text, "Air date" text, "Reward" text, "Immunity" text, "Eliminated" text, "Vote" text, "Finish" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What was the vote tally on the episode aired May 5, 200...
SELECT "Vote" FROM table_72321 WHERE "Air date" = 'May 5, 2005'
wikisql
CREATE TABLE person_info_hz_info ( RYBH text, KH number, KLX number, YLJGDM number ) CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, J...
SELECT * FROM hz_info JOIN mzjzjlb JOIN person_info_hz_info JOIN person_info ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND person_info_hz_info.KH = hz_info.KH AND person_info_hz_info.KLX = hz_info.KLX AND person_info_hz_info.YLJGDM = hz_info.YLJGDM AND person_info_hz_i...
css
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE...
SELECT SUM(outputevents.value) FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 25523)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'ult...
mimic_iii
CREATE TABLE table_name_53 ( team_sites VARCHAR, public VARCHAR, developer VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is the team sites entry that has a public entry of No and a developer entry of Yes?
SELECT team_sites FROM table_name_53 WHERE public = "no" AND developer = "yes"
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 job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), ...
SELECT EMAIL, DEPARTMENT_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY EMAIL
nvbench
CREATE TABLE table_name_62 ( away_team VARCHAR, tie_no VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Which away team has a tie number of 14?
SELECT away_team FROM table_name_62 WHERE tie_no = "14"
sql_create_context
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE patients ( ...
SELECT COUNT(*) > 0 FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 28443) AND microbiologyevents.spec_type_desc = 'urine' AND STRFTIME('%y-%m', microbiologyevents.charttime) >= '2104-10'
mimic_iii
CREATE TABLE track ( Track_ID int, Name text, Location text, Seating real, Year_Opened real ) CREATE TABLE race ( Race_ID int, Name text, Class text, Date text, Track_ID text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- Draw a bar ...
SELECT Class, COUNT(*) FROM race GROUP BY Class ORDER BY Class DESC
nvbench
CREATE TABLE table_5303 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- How many people attended the game on May 31?
SELECT SUM("Attendance") FROM table_5303 WHERE "Date" = 'may 31'
wikisql
CREATE TABLE table_13713206_1 ( club__city_town_ VARCHAR, w_l_d VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- On what position number is the club with a w-l-d of 5-7-4?
SELECT COUNT(club__city_town_) FROM table_13713206_1 WHERE w_l_d = "5-7-4"
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 procedures.short_title FROM procedures WHERE procedures.icd9_code = "4341"
mimicsql_data
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) 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, ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2111" AND lab.fluid = "Other Body Fluid"
mimicsql_data
CREATE TABLE table_12698 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" real, "Time" text, "Location" text ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What is Res., when Time is '1:09'?
SELECT "Res." FROM table_12698 WHERE "Time" = '1:09'
wikisql
CREATE TABLE table_name_95 ( entrant VARCHAR, points VARCHAR, chassis VARCHAR, engine VARCHAR, year VARCHAR ) -- Using valid SQLite, answer the following questions for the tables provided above. -- What kind of Entrant has a Maserati Straight-6 Engine, built in the year 1958 or early, and has a M...
SELECT entrant FROM table_name_95 WHERE engine = "maserati straight-6" AND year < 1958 AND chassis = "maserati 250f" AND points < 4
sql_create_context