instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE Orders (
order_id INTEGER,
customer_id INTEGER,
order_status VARCHAR(10),
date_order_placed DATETIME,
order_details VARCHAR(255)
)
CREATE TABLE Shipments (
shipment_id INTEGER,
order_id INTEGER,
invoice_number INTEGER,
shipment_tracking_number VARCHAR(80),
shipment_... | SELECT date_order_placed, COUNT(date_order_placed) FROM Orders AS T1 JOIN Shipments AS T2 ON T1.order_id = T2.order_id WHERE T2.invoice_number = 10 | nvbench |
CREATE TABLE table_80226 (
"Name" text,
"Gender" text,
"Area" text,
"Authority" text,
"Decile" real,
"Roll" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What integrated school had a decile of 2 and a roll larger than 55?
| SELECT "Name" FROM table_80226 WHERE "Decile" = '2' AND "Authority" = 'integrated' AND "Roll" > '55' | wikisql |
CREATE TABLE fare (
fare_id int,
from_airport varchar,
to_airport varchar,
fare_basis_code text,
fare_airline text,
restriction_code text,
one_direction_cost int,
round_trip_cost int,
round_trip_required varchar
)
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_... | SELECT DISTINCT ground_service.transport_type FROM city, ground_service WHERE city.city_name = 'LAS VEGAS' AND ground_service.city_code = city.city_code | atis |
CREATE TABLE table_17845 (
"Club" text,
"Played" text,
"Won" text,
"Drawn" text,
"Lost" text,
"Points for" text,
"Points against" text,
"Tries for" text,
"Tries against" text,
"Try bonus" text,
"Losing bonus" text,
"Points" text
)
-- Using valid SQLite, answer the follo... | SELECT "Tries against" FROM table_17845 WHERE "Tries for" = '29' | wikisql |
CREATE TABLE geographic (
city_name varchar,
county varchar,
region varchar
)
CREATE TABLE restaurant (
id int,
name varchar,
food_type varchar,
city_name varchar,
rating "decimal
)
CREATE TABLE location (
restaurant_id int,
house_number int,
street_name varchar,
city_n... | SELECT location.house_number, restaurant.name FROM geographic, location, restaurant WHERE geographic.region = 'yosemite and mono lake area' AND restaurant.city_name = geographic.city_name AND restaurant.food_type = 'french' AND restaurant.id = location.restaurant_id AND restaurant.rating > 2.5 | restaurants |
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text varchar
)
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE cours... | SELECT DISTINCT course.department, course.name, course.number FROM course, program, program_course WHERE program_course.category LIKE '%MDE%' AND program_course.course_id = course.course_id AND program.name LIKE '%CS-LSA%' AND program.program_id = program_course.program_id | advising |
CREATE TABLE table_17015_2 (
no VARCHAR,
population__2010_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the number where population 2010 is 171906
| SELECT no FROM table_17015_2 WHERE population__2010_ = 171906 | sql_create_context |
CREATE TABLE table_name_34 (
currency VARCHAR,
code VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What type of currency has a code of SEK?
| SELECT currency FROM table_name_34 WHERE code = "sek" | 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 allergy (
allergy... | SELECT (SELECT patient.admissionweight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '021-49416' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitaladmittime DESC LIMIT 1) AND NOT patient.admissionweight IS NU... | eicu |
CREATE TABLE table_21092427_1 (
opponents INTEGER,
record VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the most opponents for 8-1 record
| SELECT MAX(opponents) FROM table_21092427_1 WHERE record = "8-1" | sql_create_context |
CREATE TABLE table_19554 (
"Pick #" real,
"Player" text,
"Position" text,
"Nationality" text,
"NHL team" text,
"College/junior/club team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what's the position with player being ray boutin
| SELECT "Position" FROM table_19554 WHERE "Player" = 'Ray Boutin' | wikisql |
CREATE TABLE table_61410 (
"Letter" text,
"American" text,
"British" text,
"Australian" text,
"Examples" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which letter has the British a ?
| SELECT "Letter" FROM table_61410 WHERE "British" = 'aɪ' | 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 gsi (
course_offering_id int,
student_id int
)
CREATE TABLE program (
progr... | SELECT DISTINCT course.department, course.name, course.number, semester.semester FROM course INNER JOIN area ON course.course_id = area.course_id INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester WHERE area.area LIKE '%hardw... | advising |
CREATE TABLE table_78215 (
"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 Home team score for the team that p... | SELECT "Home team score" FROM table_78215 WHERE "Away team" = 'south melbourne' | wikisql |
CREATE TABLE table_1745843_7 (
verb_meaning VARCHAR,
part_4 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many different meanings does the verb with part 4 gegeven have?
| SELECT COUNT(verb_meaning) FROM table_1745843_7 WHERE part_4 = "gegeven" | sql_create_context |
CREATE TABLE table_26582 (
"Processor" text,
"Brand Name" text,
"Model (list)" text,
"Cores" real,
"L2 Cache" text,
"Socket" text,
"TDP" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the model where the processor is yorkfield and th... | SELECT "Model (list)" FROM table_26582 WHERE "Processor" = 'Yorkfield' AND "Brand Name" = 'Xeon' | wikisql |
CREATE TABLE table_53073 (
"Stadium" text,
"Team" text,
"Location" text,
"Capacity" text,
"Opening" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the team at vikings stadium?
| SELECT "Team" FROM table_53073 WHERE "Stadium" = 'vikings stadium' | wikisql |
CREATE TABLE table_name_85 (
year VARCHAR,
result VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What year did anna thompson have a 7th place result?
| SELECT year FROM table_name_85 WHERE result = "7th" | sql_create_context |
CREATE TABLE table_name_27 (
moving_from VARCHAR,
type VARCHAR,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Moving, when Type is 'Transfer', and when Name is 'Andy Webster'?
| SELECT moving_from FROM table_name_27 WHERE type = "transfer" AND name = "andy webster" | sql_create_context |
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 WHERE demographic.marital_status = "SINGLE" AND demographic.admityear < "2180" | mimicsql_data |
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_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_ID = '94878508' AND t_kc21.MED_SER_ORG_NO = '4527027' AND t_kc21.IN_DIAG_DIS_NM LIKE '%2%' | css |
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number... | SELECT UserId, U.DisplayName, TagName, PostCount, RANK() OVER (PARTITION BY TagName ORDER BY PostCount DESC) AS PostCountRank FROM (SELECT COUNT(C.PostId) AS PostCount, C.UserId, C.UserDisplayName, T.TagName FROM Comments AS C INNER JOIN Posts AS P ON C.Id = P.AcceptedAnswerId INNER JOIN PostTags AS PT ON P.Id = PT.Pos... | sede |
CREATE TABLE table_63196 (
"Artist" text,
"Album" text,
"Track(s)" text,
"Date" text,
"Label" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Artist has a Track(s) of ' evilmainya '?
| SELECT "Artist" FROM table_63196 WHERE "Track(s)" = ' evilmainya ' | wikisql |
CREATE TABLE table_5856 (
"District" real,
"Incumbent" text,
"Party" text,
"Elected" real,
"Status" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the year elected in District 17?
| SELECT MIN("Elected") FROM table_5856 WHERE "District" = '17' | wikisql |
CREATE TABLE table_204_0 (
id number,
"poll source" text,
"date(s)\nadministered" text,
"sample\nsize" number,
"margin of\nerror" text,
"ed burke" text,
"roland burris" text,
"gery chico" text,
"bill daley" text,
"tom dart" text,
"danny k. davis" text,
"miguel del valle" ... | SELECT "poll source" FROM table_204_0 WHERE "poll source" IN ('chicago sun-times', 'chicago tribune') ORDER BY "sample\nsize" DESC LIMIT 1 | squall |
CREATE TABLE student_record (
student_id int,
course_id int,
semester int,
grade varchar,
how varchar,
transfer_source varchar,
earn_credit varchar,
repeat_term varchar,
test_id varchar
)
CREATE TABLE course_tags_count (
course_id int,
clear_grading int,
pop_quiz int,
... | SELECT DISTINCT course.department, course.name, course.number FROM program_course INNER JOIN course ON program_course.course_id = course.course_id WHERE course.department = 'PHRMACOL' | advising |
CREATE TABLE table_204_173 (
id number,
"rank" number,
"group" text,
"name" text,
"nationality" text,
"2.05" text,
"2.15" text,
"2.19" text,
"2.23" text,
"2.26" text,
"result" text,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables prov... | SELECT COUNT("name") FROM table_204_173 WHERE "rank" = '2.19' | squall |
CREATE TABLE table_26592 (
"#" real,
"Player" text,
"Country" text,
"Points" real,
"Reset points" real,
"Events" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the most number for steve stricker
| SELECT MAX("#") FROM table_26592 WHERE "Player" = 'Steve Stricker' | wikisql |
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 DATEADD(DAY, DATEDIFF(DAY, 0, CreationDate), 0) AS "date", COUNT(p.PostTypeId) AS "posts_per_day" FROM Posts AS p GROUP BY DATEADD(DAY, DATEDIFF(DAY, 0, CreationDate), 0) ORDER BY DATEADD(DAY, DATEDIFF(DAY, 0, CreationDate), 0) | sede |
CREATE TABLE table_40112 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which week had the highest attendance with 58,701?
| SELECT MAX("Week") FROM table_40112 WHERE "Attendance" = '58,701' | wikisql |
CREATE TABLE table_42542 (
"Position" real,
"Team" text,
"Points" real,
"Played" real,
"Drawn" real,
"Lost" real,
"Against" real,
"Difference" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many positions have a played greater than 1... | SELECT COUNT("Position") FROM table_42542 WHERE "Played" > '12' | wikisql |
CREATE TABLE table_name_87 (
state VARCHAR,
royal_house VARCHAR,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What state is Ding and has a royal house of Ji?
| SELECT state FROM table_name_87 WHERE royal_house = "ji" AND name = "ding" | sql_create_context |
CREATE TABLE table_80367 (
"Election" text,
"1st Member" text,
"1st Party" text,
"2nd Member" text,
"2nd Party" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which party's 1st member is John Ivatt Briscoe in an election in 1857?
| SELECT "1st Party" FROM table_80367 WHERE "1st Member" = 'john ivatt briscoe' AND "Election" = '1857' | wikisql |
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 RYTJDM, RYTJMC FROM zyjzjlb WHERE JZLSH = '43708137938' | css |
CREATE TABLE table_name_87 (
date VARCHAR,
format VARCHAR,
catalog VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the release date of a CD with the catalog number ALCA-9206?
| SELECT date FROM table_name_87 WHERE format = "cd" AND catalog = "alca-9206" | sql_create_context |
CREATE TABLE table_58908 (
"Name" text,
"Pos." text,
"Height" text,
"Weight" text,
"Date of Birth" text,
"Club" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Weight of the Player with a Date of Birth of 1979-09-26?
| SELECT "Weight" FROM table_58908 WHERE "Date of Birth" = '1979-09-26' | wikisql |
CREATE TABLE SportsInfo (
StuID INTEGER,
SportName VARCHAR(32),
HoursPerWeek INTEGER,
GamesPlayed INTEGER,
OnScholarship VARCHAR(1)
)
CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHAR(12),
Age INTEGER,
Sex VARCHAR(1),
Major INTEGER,
Advisor INTEGER,
... | SELECT SportName, COUNT(*) FROM SportsInfo GROUP BY SportName ORDER BY COUNT(*) DESC | nvbench |
CREATE TABLE table_204_217 (
id number,
"camp" text,
"div sec\ndivision" text,
"admin\ndistrict" text,
"9 feb" number,
"11 feb" number,
"16 feb" number,
"25 feb" number,
"27 feb" number,
"2 mar" number,
"4 mar" number,
"6 mar" number,
"11 mar" number,
"13 mar" num... | SELECT "div sec\ndivision" FROM table_204_217 WHERE id = (SELECT id FROM table_204_217 WHERE "div sec\ndivision" = 'jaffna') + 1 | squall |
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt int
)
CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description varchar
)
CREATE TABLE ground_service (
... | 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 = 'TORONTO' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SALT L... | atis |
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 Founder, AVG(Price) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder ORDER BY AVG(Price) DESC | nvbench |
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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.drug = "Hydrocortisone Oint 0.5%" | mimicsql_data |
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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.expire_flag = "1" AND diagnoses.icd9_code = "V5883" | mimicsql_data |
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 prescription... | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', admissions.admittime)) FROM admissions WHERE admissions.subject_id = 14467 AND admissions.dischtime IS NULL | mimic_iii |
CREATE TABLE restriction (
restriction_code text,
advance_purchase int,
stopovers text,
saturday_stay_required text,
minimum_stay int,
maximum_stay int,
application text,
no_discounts text
)
CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
CREATE TABLE date_day (
mon... | SELECT DISTINCT flight_id FROM flight WHERE ((departure_time > 1800 AND to_airport IN (SELECT AIRPORT_SERVICEalias1.airport_code FROM airport_service AS AIRPORT_SERVICEalias1 WHERE AIRPORT_SERVICEalias1.city_code IN (SELECT CITYalias1.city_code FROM city AS CITYalias1 WHERE (CITYalias1.city_name = 'SAN JOSE' AND CITYal... | atis |
CREATE TABLE table_25831483_1 (
actor_actress VARCHAR,
character VARCHAR,
last_appearance VARCHAR,
total VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the actor/actress with a last appearance of 1 january 2010 and total is 20 and character i... | SELECT actor_actress FROM table_25831483_1 WHERE last_appearance = "1 January 2010" AND total = 20 AND character = "Vanessa 'Nessa' Jenkins" | sql_create_context |
CREATE TABLE table_29535 (
"Country" text,
"Series Programmes" text,
"Series Seasons Programmes" text,
"Television channel" text,
"Television network" text,
"Series premiere" text,
"Series end" text,
"Status" text,
"Available" text
)
-- Using valid SQLite, answer the following ques... | SELECT "Status" FROM table_29535 WHERE "Television channel" = 'MediaCorp TV12 Suria' | wikisql |
CREATE TABLE item (
title VARCHAR,
i_id VARCHAR
)
CREATE TABLE review (
i_id VARCHAR,
rating VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Find the names of goods that receive a rating of 10.
| SELECT T1.title FROM item AS T1 JOIN review AS T2 ON T1.i_id = T2.i_id WHERE T2.rating = 10 | sql_create_context |
CREATE TABLE t_kc21 (
CLINIC_ID text,
CLINIC_TYPE text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
... | SELECT t_kc21.MED_SER_ORG_NO FROM t_kc21 WHERE t_kc21.PERSON_ID = '89574743' AND t_kc21.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.SOC_SRT_DIRE_CD = '697815093') | css |
CREATE TABLE table_45854 (
"Player" text,
"Country" text,
"Year(s) won" text,
"Total" real,
"To par" real,
"Finish" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest To Par, when Year(s) Won is '1962 , 1967'?
| SELECT MAX("To par") FROM table_45854 WHERE "Year(s) won" = '1962 , 1967' | wikisql |
CREATE TABLE table_51684 (
"Debut year" real,
"Player" text,
"Date of birth" text,
"Games" real,
"Goals" real,
"Years at club" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the birthday of the player who has Years at Club of 1951?
| SELECT "Date of birth" FROM table_51684 WHERE "Years at club" = '1951' | wikisql |
CREATE TABLE table_name_85 (
Id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the 2010 value with a 2r in 200r and a 3r in 2011?
| SELECT 2010 FROM table_name_85 WHERE 2004 = "2r" AND 2011 = "3r" | sql_create_context |
CREATE TABLE table_27021001_1 (
district VARCHAR,
incumbent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the district with the incumbent Charlie Norwood?
| SELECT district FROM table_27021001_1 WHERE incumbent = "Charlie Norwood" | sql_create_context |
CREATE TABLE table_11081 (
"Episode Air Date" text,
"Audition City" text,
"Date" text,
"First Audition Venue" text,
"Callback Date" text,
"Callback Venue" text,
"Golden Tickets" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which audition c... | SELECT "Audition City" FROM table_11081 WHERE "Callback Venue" = 'amelia island plantation' | wikisql |
CREATE TABLE table_name_32 (
date VARCHAR,
team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What day did Phoenix play?
| SELECT date FROM table_name_32 WHERE team = "phoenix" | sql_create_context |
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABLE time_interval (
period text,
begin_time int,
end_time... | 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 = 'PHILADELPHIA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = ... | atis |
CREATE TABLE table_548 (
"Championship" text,
"Champion(s)" text,
"Previous champion(s)" text,
"Date Won" text,
"Location" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What tourmament has Genesis won previously?
| SELECT "Championship" FROM table_548 WHERE "Previous champion(s)" = 'Genesis' | wikisql |
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, date_day, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'WASHINGTON' AND date_day.day_number = 11 AND date_day.month_number = 11 A... | atis |
CREATE TABLE table_28665 (
"Week" real,
"Date" text,
"Kickoff" text,
"Opponent" text,
"Final score" text,
"Team record" text,
"Game site" text,
"Attendance" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the most attendance
| SELECT MIN("Attendance") FROM table_28665 | wikisql |
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_code varchar
)
CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
CREATE TABLE food_service (
mea... | SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day AS DATE_DAY_0, date_day AS DATE_DAY_1, days AS DAYS_0, days AS DAYS_1, fare, fare_basis, flight, flight_fare WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND C... | atis |
CREATE TABLE table_38919 (
"Position" text,
"Name" text,
"School" text,
"Unanimous" text,
"College Hall of Fame" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the school of the player who plays ends?
| SELECT "School" FROM table_38919 WHERE "Position" = 'ends' | wikisql |
CREATE TABLE zyjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
HZXM text,
JZKSDM text,
JZKSMC text,
JZLSH text,
KH text,
KLX number,
MZBMLX number,
MZJZLSH text,
MZZDBM text,
MZZDMC text,
MZZYZDZZBM... | SELECT * FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb 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 mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.... | css |
CREATE TABLE table_51442 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Decision" text,
"Attendance" real,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the decision of the game when Montreal was the home team?... | SELECT "Decision" FROM table_51442 WHERE "Home" = 'montreal' | wikisql |
CREATE TABLE table_79906 (
"D 41 \u221a" text,
"D 42 \u221a" text,
"D 43 \u221a" text,
"D 44 O" text,
"D 45 O" text,
"D 46 O" text,
"D 47 O" text,
"D 48 O" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the D 45 O with D 44 O majori... | SELECT "D 45 O" FROM table_79906 WHERE "D 44 O" = 'majority →' | wikisql |
CREATE TABLE table_28019 (
"Agency" text,
"Route Number" text,
"North/East Terminal" text,
"South/West Terminal" text,
"More Information" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the agency for santa rosa avenue
| SELECT "Agency" FROM table_28019 WHERE "South/West Terminal" = 'Santa Rosa Avenue' | wikisql |
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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dob_year < "2138" AND procedures.icd9_code = "17" | mimicsql_data |
CREATE TABLE person_info (
RYBH text,
XBDM number,
XBMC text,
XM text,
CSRQ time,
CSD text,
MZDM text,
MZMC text,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
XLDM text,
XLMC text,
ZYLBDM text,
ZYMC text
)
CREATE TABLE hz_info (
KH text,
KLX number... | SELECT (SELECT COUNT(*) 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 mzjzjlb.JZKSRQ BETWEEN '2005-01-09' AND '2013-08-02') + (SELECT COUNT(*) FROM person_info J... | css |
CREATE TABLE table_name_31 (
format VARCHAR,
frequency VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Say the frequency of 1290 khz
| SELECT format FROM table_name_31 WHERE frequency = "1290 khz" | sql_create_context |
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
... | SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, procedures_icd.charttime, admissions.hadm_id FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_... | mimic_iii |
CREATE TABLE Customers (
first_name VARCHAR,
last_name VARCHAR,
customer_address_id VARCHAR
)
CREATE TABLE Addresses (
address_id VARCHAR,
city VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- List first name and last name of customers lived in ci... | SELECT T1.first_name, T1.last_name FROM Customers AS T1 JOIN Addresses AS T2 ON T1.customer_address_id = T2.address_id WHERE T2.city = "Lockmanfurt" | sql_create_context |
CREATE TABLE table_204_804 (
id number,
"version" text,
"length" text,
"album" text,
"remixed by" text,
"year" number,
"comment" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how long is the song remixed by y front ?
| SELECT "length" FROM table_204_804 WHERE "remixed by" = 'y-front' | squall |
CREATE TABLE table_6304 (
"Match" real,
"Date" text,
"Opponent" text,
"Venue" text,
"Result" text,
"Attendance" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many Attendance has a Opponent of west bromwich albion, and a Result of 3 3, and a... | SELECT SUM("Attendance") FROM table_6304 WHERE "Opponent" = 'west bromwich albion' AND "Result" = '3 – 3' AND "Match" > '20' | wikisql |
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_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_ID = '27439695' AND NOT t_kc22.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT >= 8781.25) | css |
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 MIN(demographic.age) FROM demographic WHERE demographic.admission_type = "EMERGENCY" AND demographic.diagnosis = "ST ELEVATED MYOCARDIAL INFARCTION\CARDIAC CATH" | mimicsql_data |
CREATE TABLE table_44359 (
"Tournament" text,
"1992" text,
"1993" text,
"1994" text,
"1995" text,
"1996" text,
"1997" text,
"1998" text,
"1999" text,
"2000" text,
"2001" text,
"2002" text,
"2003" text,
"Career SR" text,
"Career win-loss" text
)
-- Using vali... | SELECT "2001" FROM table_44359 WHERE "1994" = 'a' AND "Tournament" = 'monte carlo masters' | wikisql |
CREATE TABLE discipline_enrollments (
graduate INTEGER,
campus VARCHAR,
year VARCHAR
)
CREATE TABLE campuses (
id VARCHAR,
campus VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the number of graduates in 'San Francisco State University' ... | SELECT SUM(t1.graduate) FROM discipline_enrollments AS t1 JOIN campuses AS t2 ON t1.campus = t2.id WHERE t1.year = 2004 AND t2.campus = "San Francisco State University" | sql_create_context |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
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
)
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "80" AND lab.fluid = "Other Body Fluid" | mimicsql_data |
CREATE TABLE table_23614702_1 (
warship VARCHAR,
horse__power VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What warship has horse-power of 1500?
| SELECT warship FROM table_23614702_1 WHERE horse__power = 1500 | sql_create_context |
CREATE TABLE field (
fieldid int
)
CREATE TABLE writes (
paperid int,
authorid int
)
CREATE TABLE paperdataset (
paperid int,
datasetid int
)
CREATE TABLE journal (
journalid int,
journalname varchar
)
CREATE TABLE paper (
paperid int,
title varchar,
venueid int,
year int... | SELECT DISTINCT COUNT(paper.paperid) FROM author, paper, venue, writes WHERE author.authorname = 'dan klein' AND venue.venueid = paper.venueid AND venue.venuename = 'emnlp' AND writes.authorid = author.authorid AND writes.paperid = paper.paperid | scholar |
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 COUNT(*) FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '0641182' AND gwyjzb.IN_HOSP_DATE BETWEEN '2000-01-18' AND '2003-06-12' | css |
CREATE TABLE table_78920 (
"Player" text,
"Country" text,
"Year(s) won" text,
"Total" real,
"To par" text,
"Finish" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What country had a finish of t49?
| SELECT "Country" FROM table_78920 WHERE "Finish" = 't49' | wikisql |
CREATE TABLE table_41094 (
"Ship" text,
"13.5-inch/1400lb" real,
"13.5-inch/1250lb" real,
"12-inch" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest 12-inch when the 13.5-inch/1250lb was 0, and the ship is seydlitz?
| SELECT MIN("12-inch") FROM table_41094 WHERE "13.5-inch/1250lb" = '0' AND "Ship" = 'seydlitz' | wikisql |
CREATE TABLE table_11998 (
"Date" text,
"Round" text,
"Attendance" text,
"Opposition" text,
"Stadium" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What round was adelaide united the opposition with an attendance of 18,345?
| SELECT "Round" FROM table_11998 WHERE "Opposition" = 'adelaide united' AND "Attendance" = '18,345' | wikisql |
CREATE TABLE table_name_38 (
apparatus VARCHAR,
score_final INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which apparatus had a final score that was more than 17.75?
| SELECT apparatus FROM table_name_38 WHERE score_final > 17.75 | sql_create_context |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures (
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "LEFT INTERNAL JUGULAR VEIN THROMBOSIS;LEFT ARM EDEMA" AND demographic.admityear < "2148" | mimicsql_data |
CREATE TABLE player (
pid number,
pname text,
ycard text,
hs number
)
CREATE TABLE college (
cname text,
state text,
enr number
)
CREATE TABLE tryout (
pid number,
cname text,
ppos text,
decision text
)
-- Using valid SQLite, answer the following questions for the tables ... | SELECT DISTINCT pname FROM player WHERE pname LIKE '%a%' | spider |
CREATE TABLE book (
book_id number,
title text,
issues number,
writer text
)
CREATE TABLE publication (
publication_id number,
book_id number,
publisher text,
publication_date text,
price number
)
-- Using valid SQLite, answer the following questions for the tables provided above.... | SELECT writer FROM book GROUP BY writer HAVING COUNT(*) > 1 | spider |
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 = "Backache NOS" AND prescriptions.drug_type = "MAIN" | mimicsql_data |
CREATE TABLE table_17282875_2 (
team__number2 VARCHAR,
team__number1 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who played against team 1 Vit ria?
| SELECT team__number2 FROM table_17282875_2 WHERE team__number1 = "Vitória" | sql_create_context |
CREATE TABLE table_204_120 (
id number,
"rank" number,
"athlete" text,
"country" text,
"time" text,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what number of countries placed ahead of the united states ?
| SELECT COUNT(DISTINCT ("country")) FROM table_204_120 WHERE id < (SELECT id FROM table_204_120 WHERE "country" = 'united states') | squall |
CREATE TABLE table_204_625 (
id number,
"model" text,
"availability" text,
"introduced" text,
"length of use" text,
"last of whiteness" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- tell me the number of products that give you 12 months of whit... | SELECT COUNT("model") FROM table_204_625 WHERE "last of whiteness" = 12 | squall |
CREATE TABLE table_76126 (
"Television service" text,
"Country" text,
"Language" text,
"Content" text,
"HDTV" text,
"Package/Option" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the HDTV for the Rai Nettuno Sat Uno Television service?
| SELECT "HDTV" FROM table_76126 WHERE "Television service" = 'rai nettuno sat uno' | wikisql |
CREATE TABLE table_name_76 (
winningteam VARCHAR,
losingteam VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which team beat the Newcastle Breakers?
| SELECT winningteam FROM table_name_76 WHERE losingteam = "newcastle breakers" | sql_create_context |
CREATE TABLE Player (
pID numeric(5,0),
pName varchar(20),
yCard varchar(3),
HS numeric(5,0)
)
CREATE TABLE Tryout (
pID numeric(5,0),
cName varchar(20),
pPos varchar(8),
decision varchar(3)
)
CREATE TABLE College (
cName varchar(20),
state varchar(2),
enr numeric(5,0)
)
... | SELECT pName, COUNT(pName) FROM Player AS T1 JOIN Tryout AS T2 ON T1.pID = T2.pID GROUP BY pName ORDER BY T1.pName | nvbench |
CREATE TABLE ground_service (
city_code text,
airport_code text,
transport_type text,
ground_fare int
)
CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
CREATE TABLE aircraft (
aircraft_code varchar,
aircraft_description varchar,
manufacturer varchar,
basic_type varchar,... | SELECT DISTINCT fare_basis_code FROM fare_basis WHERE fare_basis_code = 'YN' | atis |
CREATE TABLE table_name_89 (
part_6 VARCHAR,
part_4 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When is Part 6, when Part 4 is on March 2, 2008?
| SELECT part_6 FROM table_name_89 WHERE part_4 = "march 2, 2008" | sql_create_context |
CREATE TABLE table_name_42 (
winner VARCHAR,
circuit VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the winner for the circuit Eastern Creek Raceway?
| SELECT winner FROM table_name_42 WHERE circuit = "eastern creek raceway" | sql_create_context |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.formulary_drug_cd = "GCSF480I" | mimicsql_data |
CREATE TABLE table_203_276 (
id number,
"album#" text,
"english title" text,
"chinese (traditional)" text,
"chinese (simplified)" text,
"release date" text,
"label" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- was the album beautiful relea... | SELECT (SELECT "release date" FROM table_203_276 WHERE "english title" = 'beautiful') < (SELECT "release date" FROM table_203_276 WHERE "english title" = 'love in heart') | squall |
CREATE TABLE table_name_38 (
position VARCHAR,
mls_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the position of the Colorado Rapids team?
| SELECT position FROM table_name_38 WHERE mls_team = "colorado rapids" | sql_create_context |
CREATE TABLE customer_orders (
order_id number,
customer_id number,
order_status_code text,
order_date time
)
CREATE TABLE order_items (
order_item_id number,
order_id number,
product_id number
)
CREATE TABLE customer_addresses (
customer_id number,
address_id number,
date_from... | SELECT T1.staff_id, T1.staff_name FROM staff AS T1 JOIN staff_department_assignments AS T2 ON T1.staff_id = T2.staff_id ORDER BY date_assigned_to - date_assigned_from LIMIT 1 | spider |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.