instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
CREATE TABLE hz_info_zyjzjlb (
JZLSH number,
YLJGDM number,
zyjzjlb_id number
)
CREATE TABLE zyjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
... | SELECT person_info.XM FROM person_info JOIN hz_info JOIN zyjzjlb JOIN jybgb JOIN hz_info_zyjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = hz_info_zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX AND hz_info_zyjzjlb.YLJGDM = jybgb.YLJGDM_ZYJZJLB AND zyjzjlb.JZLSH = jybgb.JZLSH_ZYJZ... | css |
CREATE TABLE table_25352318_1 (
poles INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest overall amount of poles?
| SELECT MIN(poles) FROM table_25352318_1 | sql_create_context |
CREATE TABLE table_71187 (
"Event" text,
"Time" text,
"Venue" text,
"Date" text,
"Notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which event had the time 45.74?
| SELECT "Event" FROM table_71187 WHERE "Time" = '45.74' | wikisql |
CREATE TABLE table_name_53 (
away_team VARCHAR,
tie_no VARCHAR,
home_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the away team that played Northampton Town at home with a tie number of replay?
| SELECT away_team FROM table_name_53 WHERE tie_no = "replay" AND home_team = "northampton town" | sql_create_context |
CREATE TABLE Detention (
detention_id INTEGER,
detention_type_code VARCHAR(10),
teacher_id INTEGER,
datetime_detention_start DATETIME,
datetime_detention_end DATETIME,
detention_summary VARCHAR(255),
other_details VARCHAR(255)
)
CREATE TABLE Ref_Detention_Type (
detention_type_code VARC... | SELECT date_address_from, SUM(monthly_rental) FROM Student_Addresses ORDER BY monthly_rental DESC | nvbench |
CREATE TABLE table_name_32 (
points INTEGER,
nationality VARCHAR,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Points is the highest one that has a Nationality of aut, and a Name of thomas morgenstern?
| SELECT MAX(points) FROM table_name_32 WHERE nationality = "aut" AND name = "thomas morgenstern" | sql_create_context |
CREATE TABLE table_18429 (
"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 district featured an election between james a. byrne (d) 59.3% jose... | SELECT "District" FROM table_18429 WHERE "Candidates" = 'James A. Byrne (D) 59.3% Joseph R. Burns (R) 40.7%' | wikisql |
CREATE TABLE table_14956 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Game site" text,
"Record" text,
"Attendance" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the game site for october 4, 1992
| SELECT "Game site" FROM table_14956 WHERE "Date" = 'october 4, 1992' | wikisql |
CREATE TABLE table_204_978 (
id number,
"position" number,
"nation" number,
"number" number,
"name" text,
"soproni liga" number,
"uefa cup" number,
"hungarian cup" number,
"league cup" number,
"total" number
)
-- Using valid SQLite, answer the following questions for the tables... | SELECT (SELECT "total" FROM table_204_978 WHERE "name" = 'leandro de almeida') - (SELECT "total" FROM table_204_978 WHERE "name" = 'zsombor kerekes') | squall |
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_code varchar
)
CREATE TABLE flight (
aircraft_code_sequence text,
airline_code varchar,
airline_flight text,
arrival_time int,
connections int,
departure_time int,
... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE (CITY_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_name = 'DENVER... | atis |
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 d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE admis... | SELECT d_items.label FROM d_items WHERE d_items.itemid IN (SELECT inputevents_cv.itemid 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 = 366)) AND DATETIME(inputevents_cv.ch... | mimic_iii |
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.diagnosis = "S/P FALL" AND lab.fluid = "Ascites" | mimicsql_data |
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 lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.age < "74" AND procedures.short_title = "Arterial catheterization" | mimicsql_data |
CREATE TABLE person_info (
CSD text,
CSRQ time,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
MZDM text,
MZMC text,
RYBH text,
XBDM number,
XBMC text,
XLDM text,
XLMC text,
XM text,
ZYLBDM text,
ZYMC text
)
CREATE TABLE zzmzjzjlb (
HXPLC number,
HZX... | SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM 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.JZLSH_MZ... | css |
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 diagnoses.icd9_code, diagnoses.short_title FROM diagnoses WHERE diagnoses.subject_id = "28588" | mimicsql_data |
CREATE TABLE table_72435 (
"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 is the candidate in district south carolina 2?
| SELECT "Candidates" FROM table_72435 WHERE "District" = 'South Carolina 2' | wikisql |
CREATE TABLE table_name_38 (
average INTEGER,
rank_by_average VARCHAR,
total VARCHAR,
number_of_dances VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Average is the lowest one that has a Total smaller than 134, and a Number of dances smaller th... | SELECT MIN(average) FROM table_name_38 WHERE total < 134 AND number_of_dances < 3 AND rank_by_average < 12 | sql_create_context |
CREATE TABLE table_name_37 (
points INTEGER,
games VARCHAR,
losses VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average number of points for a team that played 17 games and had more than 15 losses?
| SELECT AVG(points) FROM table_name_37 WHERE games = 17 AND losses > 15 | sql_create_context |
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate t... | SELECT DISTINCT a.UserId, a.QuestionId AS PostId, COUNT(a.QuestionId) AS Aggregate FROM (SELECT Posts.OwnerUserId AS UserId, COALESCE(Posts.ParentId, Posts.Id) AS QuestionId FROM Posts WHERE NOT Posts.OwnerUserId IS NULL AND Posts.OwnerUserId > 0 UNION ALL SELECT b.UserId AS UserId, COALESCE(b.ParentId, b.PostId) AS Qu... | sede |
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 COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'hyperlipidemia' AND STRFTIME('%y', diagnosis.diagnosistime) >= '2104') AS t1 JOIN (SELECT patient.uniquepid,... | eicu |
CREATE TABLE table_29063233_1 (
directed_by VARCHAR,
uk_viewers__million_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who directed the episode with UK viewership of 6.09 million?
| SELECT directed_by FROM table_29063233_1 WHERE uk_viewers__million_ = "6.09" | sql_create_context |
CREATE TABLE customer (
cust_ID varchar(3),
cust_name varchar(20),
acc_type char(1),
acc_bal int,
no_of_loans int,
credit_score int,
branch_ID int,
state varchar(20)
)
CREATE TABLE bank (
branch_ID int,
bname varchar(20),
no_of_customers int,
city varchar(10),
state ... | SELECT cust_name, acc_bal FROM customer WHERE cust_name LIKE '%a%' | nvbench |
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY... | SELECT HIRE_DATE, COUNT(HIRE_DATE) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY COUNT(HIRE_DATE) | nvbench |
CREATE TABLE table_name_18 (
team VARCHAR,
make VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the team when the make is dodge and the year is after 2008?
| SELECT team FROM table_name_18 WHERE make = "dodge" AND year > 2008 | sql_create_context |
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE locations (
LOCAT... | SELECT HIRE_DATE, AVG(SALARY) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) | nvbench |
CREATE TABLE table_299 (
"Player" text,
"Position" text,
"School" text,
"Hometown" text,
"MLB Draft" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- WHAT TOWN IS WEST BROOK SENIOR HIGH SCHOOL FROM?
| SELECT "Hometown" FROM table_299 WHERE "School" = 'West Brook Senior High School' | wikisql |
CREATE TABLE t_kc21_t_kc22 (
MED_CLINIC_ID text,
MED_EXP_DET_ID number
)
CREATE TABLE t_kc21 (
CLINIC_ID text,
CLINIC_TYPE text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD ... | SELECT COUNT(*) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '3892472' AND t_kc21.IN_HOSP_DATE BETWEEN '2010-05-27' AND '2021-02-21' AND t_kc21.SERVANT_FLG = '公务员' | css |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patie... | SELECT COUNT(*) > 0 FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-3355')) AND STRFTIME('%y-%m', microlab.culturetakentime) = '2105-12' | eicu |
CREATE TABLE table_48667 (
"Cat. #" text,
"Artist" text,
"Title" text,
"Release date" text,
"Format" text,
"Other information" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the release date with par116 as the cat. #?
| SELECT "Release date" FROM table_48667 WHERE "Cat. #" = 'par116' | wikisql |
CREATE TABLE table_11944282_1 (
allied_unrelated VARCHAR,
component VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total amount of allied-unrelated where the component is human capital?
| SELECT COUNT(allied_unrelated) FROM table_11944282_1 WHERE component = "Human Capital" | sql_create_context |
CREATE TABLE table_19845 (
"No." real,
"Date" text,
"Tournament" text,
"Winning score" text,
"To par" text,
"Margin of victory" text,
"Runner-up" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are all values for 'to par' for the winning... | SELECT "To par" FROM table_19845 WHERE "Winning score" = '67-67-69-69=272' | wikisql |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE cost (
costid number,
uniquepi... | SELECT MAX(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.patientunitstayid IN (SELECT medication.patientunitstayid FROM medication WHERE medication.drugname = 'amiodarone 200 mg tab')) AND DATETIME(cost.cha... | eicu |
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 date_of_enrolment, COUNT(date_of_enrolment) FROM Student_Course_Enrolment AS T1 JOIN Student_Tests_Taken AS T2 ON T1.registration_id = T2.registration_id WHERE T2.test_result = "Pass" ORDER BY COUNT(date_of_enrolment) DESC | nvbench |
CREATE TABLE table_name_39 (
tujunga VARCHAR,
pasadena VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the figure for Tujunga when Pasadena is 134,941?
| SELECT tujunga FROM table_name_39 WHERE pasadena = "134,941" | sql_create_context |
CREATE TABLE table_28348 (
"Road race" text,
"Distance" text,
"Location" text,
"Country" text,
"Month held" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What month is the Paris 20k Road Race held?
| SELECT "Month held" FROM table_28348 WHERE "Location" = 'Paris' | wikisql |
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text varchar
)
CREATE TABLE student_record (
student_id int,
course_id int,
semester int,
grade varc... | SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN area ON course.course_id = area.course_id INNER JOIN program_course ON program_course.course_id = course.course_id WHERE (area.area LIKE '%Italian Romanticism%' OR course.description LIKE '%Italian Romanticism%' OR course.name LIKE '%I... | advising |
CREATE TABLE captain (
Captain_ID int,
Name text,
Ship_ID int,
age text,
Class text,
Rank text
)
CREATE TABLE Ship (
Ship_ID int,
Name text,
Type text,
Built_Year real,
Class text,
Flag text
)
-- Using valid SQLite, answer the following questions for the tables provide... | SELECT Rank, COUNT(*) FROM captain GROUP BY Rank | nvbench |
CREATE TABLE journal (
journalid int,
journalname varchar
)
CREATE TABLE author (
authorid int,
authorname varchar
)
CREATE TABLE paperdataset (
paperid int,
datasetid int
)
CREATE TABLE paperkeyphrase (
paperid int,
keyphraseid int
)
CREATE TABLE field (
fieldid int
)
CREATE TA... | SELECT DISTINCT paper.paperid FROM keyphrase, paper, paperkeyphrase, venue WHERE keyphrase.keyphrasename = 'TAIL' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid AND venue.venueid = paper.venueid AND venue.venuename = 'NIPS' | scholar |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admityear < "2131" AND procedures.icd9_code = "3895" | mimicsql_data |
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 JOB_ID, SUM(SALARY) FROM employees WHERE HIRE_DATE < '2002-06-21' GROUP BY JOB_ID ORDER BY JOB_ID DESC | nvbench |
CREATE TABLE jybgb (
YLJGDM text,
YLJGDM_MZJZJLB text,
YLJGDM_ZYJZJLB text,
BGDH text,
BGRQ time,
JYLX number,
JZLSH text,
JZLSH_MZJZJLB text,
JZLSH_ZYJZJLB text,
JZLX number,
KSBM text,
KSMC text,
SQRGH text,
SQRXM text,
BGRGH text,
BGRXM text,
SHRGH ... | SELECT SHRGH, SHRXM FROM jybgb WHERE JZLSH = '75568480479' GROUP BY SHRGH HAVING COUNT(*) > 29 | css |
CREATE TABLE table_27155990_1 (
total_usd INTEGER,
creator VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the maximum total USD collected by Pebble Technology?
| SELECT MAX(total_usd) FROM table_27155990_1 WHERE creator = "Pebble Technology" | sql_create_context |
CREATE TABLE table_57325 (
"Week" real,
"Date" text,
"Opponent" text,
"Home/Away Game" text,
"Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the result where the opponent is Columbus Destroyers?
| SELECT "Result" FROM table_57325 WHERE "Opponent" = 'columbus destroyers' | wikisql |
CREATE TABLE election (
Election_ID int,
Representative_ID int,
Date text,
Votes real,
Vote_Percent real,
Seats real,
Place real
)
CREATE TABLE representative (
Representative_ID int,
Name text,
State text,
Party text,
Lifespan text
)
-- Using valid SQLite, answer the ... | SELECT Party, COUNT(*) FROM representative GROUP BY Party ORDER BY COUNT(*) DESC | nvbench |
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.Name, T1.Price FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY T1.Name DESC | nvbench |
CREATE TABLE Order_Items (
order_item_id INTEGER,
order_id INTEGER,
product_id INTEGER
)
CREATE TABLE Customers (
customer_id INTEGER,
payment_method_code VARCHAR(10),
customer_code VARCHAR(20),
customer_name VARCHAR(80),
customer_address VARCHAR(255),
customer_phone VARCHAR(80),
... | SELECT product_type_code, SUM(product_price) FROM Product_Suppliers AS T1 JOIN Products AS T2 ON T1.product_id = T2.product_id WHERE T1.supplier_id = 3 GROUP BY product_type_code ORDER BY product_type_code DESC | nvbench |
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABL... | SELECT UserId AS "user_link", COUNT(*) AS Badges FROM Badges WHERE Badges.Name = 'Necromancer' OR Badges.Name = 'Revival' GROUP BY UserId ORDER BY Badges DESC LIMIT 100 | sede |
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
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,
JO... | SELECT T1.MANAGER_ID, T1.DEPARTMENT_ID FROM employees AS T1 JOIN departments AS T2 ON T1.DEPARTMENT_ID = T2.DEPARTMENT_ID WHERE T1.EMPLOYEE_ID = T2.MANAGER_ID | nvbench |
CREATE TABLE table_27893892_2 (
opponent VARCHAR,
game_site VARCHAR,
week VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what was the opposition where the field is waldstadion during time 6
| SELECT opponent FROM table_27893892_2 WHERE game_site = "Waldstadion" AND week = 6 | sql_create_context |
CREATE TABLE table_1474 (
"Player" text,
"VFL Games" real,
"VFL Club(s)" text,
"Rank held at time of death" text,
"Date of death" text,
"Location" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What locations did sid o'neill play football?
| SELECT "Location" FROM table_1474 WHERE "Player" = 'Sid O''Neill' | wikisql |
CREATE TABLE farm (
farm_id number,
year number,
total_horses number,
working_horses number,
total_cattle number,
oxen number,
bulls number,
cows number,
pigs number,
sheep_and_goats number
)
CREATE TABLE city (
city_id number,
official_name text,
status text,
ar... | SELECT status FROM city GROUP BY status ORDER BY COUNT(*) DESC LIMIT 1 | spider |
CREATE TABLE table_13547 (
"Team" text,
"Outgoing manager" text,
"Manner of departure" text,
"Date of vacancy" text,
"Replaced by" text,
"Date of appointment" text,
"Position in table" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is t... | SELECT "Manner of departure" FROM table_13547 WHERE "Date of vacancy" = '15 september 2008' | wikisql |
CREATE TABLE table_58617 (
"Rank 2014" real,
"Rank 2013" real,
"Mvmt" text,
"Club" text,
"Country" text,
"2009\u201310" real,
"2010\u201311" real,
"2011\u201312" real,
"2012\u201313" real,
"2013\u201314" real,
"Coeff." real
)
-- Using valid SQLite, answer the following ques... | SELECT AVG("2013\u201314") FROM table_58617 WHERE "Rank 2014" < '23' AND "2011\u201312" > '19.1' AND "Rank 2013" = '14' | wikisql |
CREATE TABLE Addresses (
zip_postcode VARCHAR,
address_id VARCHAR
)
CREATE TABLE Staff (
staff_address_id VARCHAR,
first_name VARCHAR,
last_name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the zip code of staff with first name as Jane... | SELECT T1.zip_postcode FROM Addresses AS T1 JOIN Staff AS T2 ON T1.address_id = T2.staff_address_id WHERE T2.first_name = "Janessa" AND T2.last_name = "Sawayn" | sql_create_context |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
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 te... | SELECT jybgb.BGDH FROM hz_info JOIN mzjzjlb JOIN jybgb 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 WHERE hz_info.RYBH = '20499920' AND jybgb.BGRQ BETWEEN '2010-05-11' AND '2020-04-09' UNION... | css |
CREATE TABLE table_22278 (
"Departure" text,
"Going to" text,
"Calling at" text,
"Arrival" text,
"Operator" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- when does the train arriving at stamford east at 11.45 departure
| SELECT "Departure" FROM table_22278 WHERE "Arrival" = '11.45' AND "Going to" = 'Stamford East' | wikisql |
CREATE TABLE table_173103_1 (
bullet_weight VARCHAR,
max_pressure VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the bullet weight when the max pressure is 12,000 cup?
| SELECT bullet_weight FROM table_173103_1 WHERE max_pressure = "12,000 CUP" | sql_create_context |
CREATE TABLE table_68833 (
"City" text,
"Country" text,
"IATA" text,
"ICAO" text,
"Airport" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the IATA for the city of Amsterdam?
| SELECT "IATA" FROM table_68833 WHERE "City" = 'amsterdam' | wikisql |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TAB... | 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 = 'copd' AND DATETIME(diagnosis.diagnosistime) <= DAT... | eicu |
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwner... | SELECT c.Id AS "comment_link", c.Text, c.UserId AS "user_link", c.CreationDate FROM Comments AS c INNER JOIN Posts AS p ON c.PostId = p.Id WHERE (p.OwnerUserId = '##UserId?8297##') ORDER BY c.CreationDate DESC LIMIT 100 | sede |
CREATE TABLE table_name_34 (
course VARCHAR,
jockey VARCHAR,
odds VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What course did Fergal Lynch end up with 5/1 odds?
| SELECT course FROM table_name_34 WHERE jockey = "fergal lynch" AND odds = "5/1" | sql_create_context |
CREATE TABLE table_43383 (
"Name" text,
"Processor" text,
"Hard Drive" text,
"Ethernet Ports" text,
"Dimensions" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the ethernet ports of the u10 appliance?
| SELECT "Ethernet Ports" FROM table_43383 WHERE "Name" = 'u10' | wikisql |
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 COUNT(DISTINCT icustays.icustay_id) FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 27242) AND DATETIME(icustays.intime) >= DATETIME(CURRENT_TIME(), '-3 year') | mimic_iii |
CREATE TABLE table_20683381_2 (
date_of_opinion_poll VARCHAR,
conductor VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When was Quantum Research's poll conducted?
| SELECT date_of_opinion_poll FROM table_20683381_2 WHERE conductor = "Quantum Research" | sql_create_context |
CREATE TABLE branch (
branch_id number,
name text,
open_year text,
address_road text,
city text,
membership_amount text
)
CREATE TABLE purchase (
member_id number,
branch_id text,
year text,
total_pounds number
)
CREATE TABLE membership_register_branch (
member_id number,
... | SELECT name, address_road, city FROM branch ORDER BY open_year | spider |
CREATE TABLE table_12159115_2 (
written_by VARCHAR,
us_viewers__millions_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who's the writer of the episode see by 12.13 million US viewers?
| SELECT written_by FROM table_12159115_2 WHERE us_viewers__millions_ = "12.13" | sql_create_context |
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId numb... | SELECT YEAR(p.CreationDate), 100.0 * SUM(CASE WHEN t.Id IN (5, 21, 382, 75151, 3988, 57799, 106940, 114990, 8945, 8279, 14642, 984, 1581, 92312, 1661, 3437, 104777, 60676, 105840, 7528, 112569, 120888, 357, 78546, 26762, 3262, 63960, 98900, 99724, 2290, 66821, 1380, 81001, 5505, 107832, 85709, 2857, 72364, 44230, 38663... | sede |
CREATE TABLE table_65512 (
"Rank" real,
"Rowers" text,
"Country" text,
"Time" text,
"Notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total number of rank for the country of greece?
| SELECT COUNT("Rank") FROM table_65512 WHERE "Country" = 'greece' | wikisql |
CREATE TABLE table_name_84 (
regulations VARCHAR,
winning_constructor VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What regulations have hudson as the winning constructor?
| SELECT regulations FROM table_name_84 WHERE winning_constructor = "hudson" | sql_create_context |
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
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
)
CR... | SELECT t2.drug FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE admissions.subject_id = 60180 AND procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = ... | mimic_iii |
CREATE TABLE table_11236195_2 (
gf_attendance VARCHAR,
location VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the GF attendance at the location of Sydney Football Stadium, Sydney (6)?
| SELECT COUNT(gf_attendance) FROM table_11236195_2 WHERE location = "Sydney Football Stadium, Sydney (6)" | sql_create_context |
CREATE TABLE table_name_60 (
avg_g INTEGER,
name VARCHAR,
gain VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Avg/G has a Name of david allen, and a Gain larger than 371?
| SELECT AVG(avg_g) FROM table_name_60 WHERE name = "david allen" AND gain > 371 | sql_create_context |
CREATE TABLE table_59901 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What country has the t7 place, and player Peter Oosterhuis?
| SELECT "Country" FROM table_59901 WHERE "Place" = 't7' AND "Player" = 'peter oosterhuis' | wikisql |
CREATE TABLE table_76697 (
"Position" text,
"Team #1" text,
"Agg." text,
"Team #2" text,
"1st leg" text,
"2nd leg" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What position has a 2-6 agg.?
| SELECT "Position" FROM table_76697 WHERE "Agg." = '2-6' | wikisql |
CREATE TABLE table_name_46 (
size VARCHAR,
metal VARCHAR,
denomination VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the size that has nickel as the metal, and one rupee as the denomination?
| SELECT size FROM table_name_46 WHERE metal = "nickel" AND denomination = "one rupee" | sql_create_context |
CREATE TABLE table_27547668_3 (
_number INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the smallest numbered episode in the series listed?
| SELECT MIN(_number) FROM table_27547668_3 | sql_create_context |
CREATE TABLE Vehicles (
vehicle_id INTEGER,
vehicle_details VARCHAR(255)
)
CREATE TABLE Customers (
customer_id INTEGER,
customer_address_id INTEGER,
customer_status_code VARCHAR(15),
date_became_customer DATETIME,
date_of_birth DATETIME,
first_name VARCHAR(80),
last_name VARCHAR(80... | SELECT customer_status_code, COUNT(*) FROM Customers GROUP BY customer_status_code ORDER BY COUNT(*) DESC | nvbench |
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 CYKSDM, CYKSMC FROM zyjzjlb WHERE JZLSH = '69572598363' | css |
CREATE TABLE table_name_83 (
games_played INTEGER,
points VARCHAR,
goals_scored VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Games played has a Points of 6, and Goals scored larger than 12?
| SELECT MAX(games_played) FROM table_name_83 WHERE points = 6 AND goals_scored > 12 | sql_create_context |
CREATE TABLE table_name_83 (
distance VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the distance on 24 May?
| SELECT distance FROM table_name_83 WHERE date = "24 may" | sql_create_context |
CREATE TABLE table_name_56 (
method VARCHAR,
event VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which method did pride bushido 10 have ?
| SELECT method FROM table_name_56 WHERE event = "pride bushido 10" | sql_create_context |
CREATE TABLE table_name_84 (
george_h_w_bush VARCHAR,
result VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What percent of respondents had no opinion on George H.W. Bush?
| SELECT george_h_w_bush FROM table_name_84 WHERE result = "no opinion" | sql_create_context |
CREATE TABLE table_13258972_2 (
week INTEGER,
record VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In what week was the record 5-9?
| SELECT MAX(week) FROM table_13258972_2 WHERE record = "5-9" | sql_create_context |
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE procedures_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 n... | SELECT admissions.subject_id FROM admissions WHERE admissions.hadm_id IN (SELECT diagnoses_icd.hadm_id FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'hy kid nos w cr kid i-iv') AND DATETIME(diagnoses_icd.charttime) <= DATETI... | mimic_iii |
CREATE TABLE table_name_56 (
game VARCHAR,
opponent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the fame number when the Montreal Canadiens were the opponent?
| SELECT COUNT(game) FROM table_name_56 WHERE opponent = "montreal canadiens" | sql_create_context |
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 COUNT(*) FROM t_kc22 WHERE t_kc22.t_kc21_MED_SER_ORG_NO = '2027203' AND t_kc22.SOC_SRT_DIRE_CD = '1591' | css |
CREATE TABLE table_name_59 (
away_team VARCHAR,
venue VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the score of the away team in the match at Princes Park?
| SELECT away_team AS score FROM table_name_59 WHERE venue = "princes park" | sql_create_context |
CREATE TABLE program_course (
program_id int,
course_id int,
workload int,
category varchar
)
CREATE TABLE course_offering (
offering_id int,
course_id int,
semester int,
section_number int,
start_time time,
end_time time,
monday varchar,
tuesday varchar,
wednesday v... | SELECT DISTINCT student.firstname, student.lastname FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN gsi ON gsi.course_offering_id = course_offering.offering_id INNER JOIN student ON student.student_id = gsi.student_id INNER JOIN semester ON semester.semester_id = course... | advising |
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswer... | SELECT DATEADD(month, DATEDIFF(month, 0, CreationDate), 0) AS Mnth, (SUM(CASE WHEN Tags LIKE '%dnd%' OR Tags LIKE '%dungeons-and-dragons%' OR Tags LIKE '%pathfinder%' THEN 1 ELSE 0 END) * 100.00) / COUNT(*) AS PercentDND FROM Posts WHERE PostTypeId = 1 GROUP BY DATEADD(month, DATEDIFF(month, 0, CreationDate), 0) ORDER ... | sede |
CREATE TABLE investors (
investor_id number,
investor_details text
)
CREATE TABLE purchases (
purchase_transaction_id number,
purchase_details text
)
CREATE TABLE transactions (
transaction_id number,
investor_id number,
transaction_type_code text,
date_of_transaction time,
amount_... | SELECT date_of_transaction, share_count FROM transactions | spider |
CREATE TABLE table_67644 (
"Year" real,
"Literature" text,
"Music" text,
"Film" text,
"Performing arts" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the average year for janaprakal chandruang
| SELECT AVG("Year") FROM table_67644 WHERE "Performing arts" = 'janaprakal chandruang' | wikisql |
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid... | SELECT DISTINCT cost.cost FROM cost WHERE cost.event_type = 'labevents' AND cost.event_id IN (SELECT labevents.row_id FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'creatinine clearance')) | mimic_iii |
CREATE TABLE table_name_88 (
name VARCHAR,
champion VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the name when Henrik Sundstr m was champion?
| SELECT name FROM table_name_88 WHERE champion = "henrik sundström" | sql_create_context |
CREATE TABLE writes (
aid int,
pid int
)
CREATE TABLE organization (
continent varchar,
homepage varchar,
name varchar,
oid int
)
CREATE TABLE author (
aid int,
homepage varchar,
name varchar,
oid int
)
CREATE TABLE domain_journal (
did int,
jid int
)
CREATE TABLE pub... | SELECT COUNT(DISTINCT (publication.title)) FROM journal, keyword, publication, publication_keyword WHERE journal.name = 'PVLDB' AND keyword.keyword = 'Keyword search' AND publication_keyword.kid = keyword.kid AND publication.jid = journal.jid AND publication.pid = publication_keyword.pid | academic |
CREATE TABLE products (
price INTEGER,
Manufacturer VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Compute the average price of all products with manufacturer code equal to 2.
| SELECT AVG(price) FROM products WHERE Manufacturer = 2 | sql_create_context |
CREATE TABLE table_name_66 (
player VARCHAR,
country VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the player from the United States with a score of 70-70-71=211?
| SELECT player FROM table_name_66 WHERE country = "united states" AND score = 70 - 70 - 71 = 211 | sql_create_context |
CREATE TABLE program_course (
program_id int,
course_id int,
workload int,
category varchar
)
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE com... | SELECT DISTINCT program.name FROM course INNER JOIN program_course ON program_course.course_id = course.course_id INNER JOIN program ON program.program_id = program_course.program_id WHERE course.department = 'ASTRO' AND course.number = 160 | advising |
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_Neutral, Team_ID FROM basketball_match | nvbench |
CREATE TABLE table_name_64 (
second VARCHAR,
first VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is SECOND, when FIRST is Western Australia?
| SELECT second FROM table_name_64 WHERE first = "western australia" | sql_create_context |
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_code varchar
)
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
C... | SELECT DISTINCT airline.airline_code FROM airline, airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_na... | atis |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.