instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_53971 (
"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.
-- How long is the ko (punch) fight against scott smit... | SELECT "Time" FROM table_53971 WHERE "Method" = 'ko (punch)' AND "Opponent" = 'scott smith' | wikisql |
CREATE TABLE table_43316 (
"Rank" real,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total number of bronze medals, and 4 silver medals, and 2 gold medals?
| SELECT COUNT("Bronze") FROM table_43316 WHERE "Silver" = '4' AND "Gold" > '2' | wikisql |
CREATE TABLE table_name_71 (
attendance VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Score of 4 0 had what attendance number?
| SELECT COUNT(attendance) FROM table_name_71 WHERE score = "4–0" | sql_create_context |
CREATE TABLE table_name_2 (
games INTEGER,
lost VARCHAR,
standing VARCHAR,
goals_against VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the most games for standing of 5th, lebel and goals against larger than 220 with lost more than 52
| SELECT MAX(games) FROM table_name_2 WHERE standing = "5th, lebel" AND goals_against > 220 AND lost > 52 | sql_create_context |
CREATE TABLE table_name_53 (
website VARCHAR,
ages VARCHAR,
locality VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Website of the Cheadle School for Ages 8-16?
| SELECT website FROM table_name_53 WHERE ages = "8-16" AND locality = "cheadle" | sql_create_context |
CREATE TABLE table_45859 (
"Number" real,
"Artist" text,
"Album" text,
"Average score" real,
"Number of reviews" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest score for Black Milk?
| SELECT MAX("Average score") FROM table_45859 WHERE "Artist" = 'black milk' | wikisql |
CREATE TABLE table_name_61 (
venue VARCHAR,
away_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the venue of the game where Geelong was the away team?
| SELECT venue FROM table_name_61 WHERE away_team = "geelong" | sql_create_context |
CREATE TABLE table_203_770 (
id number,
"ages attained (years)" text,
"catholic" text,
"protestant and other christian" text,
"other religion" text,
"none or not stated" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many age ranges are repr... | SELECT COUNT(DISTINCT "ages attained (years)") FROM table_203_770 | squall |
CREATE TABLE table_name_2 (
name VARCHAR,
qual_1 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the name of the person with a qual 1 time of 1:16.850?
| SELECT name FROM table_name_2 WHERE qual_1 = "1:16.850" | sql_create_context |
CREATE TABLE table_name_14 (
pieces INTEGER,
start VARCHAR,
release VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average number of pieces for boards that started in 1941 and were released after 2001?
| SELECT AVG(pieces) FROM table_name_14 WHERE start = "1941" AND release > 2001 | sql_create_context |
CREATE TABLE movie (
movie_id int,
Title text,
Year int,
Director text,
Budget_million real,
Gross_worldwide int
)
CREATE TABLE culture_company (
Company_name text,
Type text,
Incorporated_in text,
Group_Equity_Shareholding real,
book_club_id text,
movie_id text
)
CREAT... | SELECT Director, COUNT(Director) FROM movie WHERE Year = 1999 OR Year = 2000 GROUP BY Director | nvbench |
CREATE TABLE t_kc22 (
AMOUNT number,
CHA_ITEM_LEV number,
DATA_ID text,
DIRE_TYPE number,
DOSE_FORM text,
DOSE_UNIT text,
EACH_DOSAGE text,
EXP_OCC_DATE time,
FLX_MED_ORG_ID text,
FXBZ number,
HOSP_DOC_CD text,
HOSP_DOC_NM text,
MED_DIRE_CD text,
MED_DIRE_NM text,... | SELECT COUNT(*) FROM (SELECT t_kc21.MED_ORG_DEPT_CD FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '8130525' GROUP BY t_kc21.MED_ORG_DEPT_CD HAVING AVG(t_kc21.IN_HOSP_DAYS) > 9) AS T | css |
CREATE TABLE table_37537 (
"Year of Marriage" real,
"Name" text,
"Her Age" real,
"His Age" real,
"# of Children" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total number of her age figures where his age is less than 33, the bride was ... | SELECT SUM("Her Age") FROM table_37537 WHERE "His Age" < '33' AND "Name" = 'diontha walker' AND "# of Children" < '0' | wikisql |
CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHAR(12),
Age INTEGER,
Sex VARCHAR(1),
Major INTEGER,
Advisor INTEGER,
city_code VARCHAR(3)
)
CREATE TABLE Participates_in (
stuid INTEGER,
actid INTEGER
)
CREATE TABLE Faculty (
FacID INTEGER,
Lname VARC... | SELECT Rank, COUNT(*) FROM Faculty GROUP BY Sex, Rank ORDER BY COUNT(*) | nvbench |
CREATE TABLE table_13036 (
"Team 1" text,
"Score" text,
"Team 2" text,
"1st round" text,
"2nd round" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which is team 2 when team 1 is ECAC Chaumont (d2)?
| SELECT "Team 2" FROM table_13036 WHERE "Team 1" = 'ecac chaumont (d2)' | wikisql |
CREATE TABLE book (
Book_ID int,
Title text,
Issues real,
Writer text
)
CREATE TABLE publication (
Publication_ID int,
Book_ID int,
Publisher text,
Publication_Date text,
Price real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- A bar ch... | SELECT Publication_Date, COUNT(Publication_Date) FROM publication GROUP BY Publication_Date ORDER BY COUNT(Publication_Date) | nvbench |
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 MIN(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.hadm_id IN (SELECT prescriptions.hadm_id FROM prescriptions WHERE prescriptions.drug = 'methylprednisolone') AND DATETIME(cost.chargetime) <= DATETIME(CURRENT_TIME(), '-2 year') GROUP BY cost.hadm_id) AS t1 | mimic_iii |
CREATE TABLE table_name_19 (
year INTEGER,
moves VARCHAR,
opening VARCHAR,
result VARCHAR,
black VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What year had a black of Kramnik, opening of E05 Catalan Opening, moves greater than 38, and a result ... | SELECT MAX(year) FROM table_name_19 WHERE result = "½–½" AND black = "kramnik" AND opening = "e05 catalan opening" AND moves > 38 | sql_create_context |
CREATE TABLE table_name_83 (
title VARCHAR,
written_by VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the title of the episode written by Robert Haywood?
| SELECT title FROM table_name_83 WHERE written_by = "robert haywood" | sql_create_context |
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 medication (... | SELECT COUNT(*) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '005-4471') AND patient.unitdischargetime IS NULL) AND intakeoutput.cellpat... | eicu |
CREATE TABLE table_72559 (
"Rank" text,
"Common" text,
"Population" real,
"Area (km 2 )" text,
"Density (inhabitants/km 2 )" text,
"Altitude (mslm)" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the minimum altitude (mslm) in all the co... | SELECT MIN("Altitude (mslm)") FROM table_72559 | wikisql |
CREATE TABLE table_name_55 (
circuit VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Circuit has a Date of 25 july?
| SELECT circuit FROM table_name_55 WHERE date = "25 july" | sql_create_context |
CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
CreationDate time,
UserId number,
UserDisplayName text,
Comment text,
Text text,
ContentLicense text
)... | SELECT question.Id AS "post_link", question.CreationDate, COUNT(selfAnswer.Id) AS "count" FROM Posts AS question INNER JOIN Posts AS selfAnswer ON selfAnswer.OwnerUserId = question.OwnerUserId AND selfAnswer.ParentId = question.Id INNER JOIN Users AS users ON Users.Id = question.OwnerUserId WHERE question.PostTypeId = ... | sede |
CREATE TABLE table_name_53 (
total INTEGER,
rd_7 INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the sum of total values for Rd 7 less than 8?
| SELECT SUM(total) FROM table_name_53 WHERE rd_7 < 8 | sql_create_context |
CREATE TABLE table_65871 (
"Rank" text,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is number of silver for the country with more than 0 gold, rank of 14, and more than 4 ... | SELECT COUNT("Silver") FROM table_65871 WHERE "Gold" > '0' AND "Rank" = '14' AND "Bronze" > '4' | wikisql |
CREATE TABLE table_53775 (
"Number & name" text,
"Description" text,
"Current status" text,
"Livery" text,
"Date" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the Description for Scottish Tar Distillers No. 78, that's Livery is black, and a... | SELECT "Description" FROM table_53775 WHERE "Livery" = 'black' AND "Date" < '1897' AND "Number & name" = 'scottish tar distillers no. 78' | wikisql |
CREATE TABLE table_name_97 (
winner VARCHAR,
tournament VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Tell me the winner of the comfort classic
| SELECT winner FROM table_name_97 WHERE tournament = "comfort classic" | sql_create_context |
CREATE TABLE table_25447 (
"#" real,
"Date" text,
"Team" text,
"Score" text,
"Location Attendance" text,
"High Points" text,
"High Rebounds" text,
"High Assists" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is t... | SELECT "#" FROM table_25447 WHERE "Date" = 'November 27' | wikisql |
CREATE TABLE table_42141 (
"Office" text,
"Republican ticket" text,
"Democratic ticket" text,
"Conservative ticket" text,
"Liberal ticket" text,
"Socialist Labor ticket" text,
"Socialist Workers ticket" text
)
-- Using valid SQLite, answer the following questions for the tables provided ab... | SELECT "Office" FROM table_42141 WHERE "Socialist Labor ticket" = '(none)' AND "Liberal ticket" = 'stanley h. fuld' | wikisql |
CREATE TABLE table_name_69 (
pick__number VARCHAR,
overall VARCHAR,
round VARCHAR,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many Picks have a Round larger than 2, and a Name of lawrence sidbury, and an Overall smaller than 125?
| SELECT COUNT(pick__number) FROM table_name_69 WHERE round > 2 AND name = "lawrence sidbury" AND overall < 125 | sql_create_context |
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
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 in... | 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 table_name_62 (
away_team VARCHAR,
home_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What did the away team score when playing against fitzroy?
| SELECT away_team AS score FROM table_name_62 WHERE home_team = "fitzroy" | 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 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 WHERE demographic.expire_flag = "1" AND diagnoses.long_title = "Asthma, unspecified type, unspecified" | mimicsql_data |
CREATE TABLE table_55666 (
"Tournament" text,
"2001" text,
"2002" text,
"2003" text,
"2004" text,
"2005" text,
"2006" text,
"2007" text,
"2008" text,
"2009" text,
"2010" text,
"2011" text,
"2012" text,
"2013" text
)
-- Using valid SQLite, answer the following qu... | SELECT "2007" FROM table_55666 WHERE "2010" = 'olympic games' | wikisql |
CREATE TABLE table_name_66 (
rating VARCHAR,
share INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total ratings on share less than 4?
| SELECT COUNT(rating) FROM table_name_66 WHERE share < 4 | sql_create_context |
CREATE TABLE t_kc21_t_kc22 (
MED_CLINIC_ID text,
MED_EXP_DET_ID number
)
CREATE TABLE t_kc24 (
ACCOUNT_DASH_DATE time,
ACCOUNT_DASH_FLG number,
CASH_PAY number,
CIVIL_SUBSIDY number,
CKC102 number,
CLINIC_ID text,
CLINIC_SLT_DATE time,
COMP_ID text,
COM_ACC_PAY number,
C... | SELECT COUNT(t_kc21.MED_SER_ORG_NO) FROM t_kc21 WHERE t_kc21.PERSON_ID = '77976334' AND t_kc21.IN_HOSP_DATE BETWEEN '2004-07-08' AND '2007-06-09' | css |
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 admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
d... | SELECT chartevents.charttime FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 31088)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'respirat... | mimic_iii |
CREATE TABLE table_name_28 (
rank INTEGER,
population VARCHAR,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest rank of Qaanaaq, which has a population greater than 231?
| SELECT MIN(rank) FROM table_name_28 WHERE population > 231 AND name = "qaanaaq" | sql_create_context |
CREATE TABLE mzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH text,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZDZZMC ... | SELECT * FROM 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 = jyjgzbb.YLJGDM... | css |
CREATE TABLE table_name_44 (
rider VARCHAR,
rank VARCHAR,
team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is Team Suzuki's rider and ranks higher than 6?
| SELECT rider FROM table_name_44 WHERE rank > 6 AND team = "suzuki" | sql_create_context |
CREATE TABLE advisor (
s_ID varchar(5),
i_ID varchar(5)
)
CREATE TABLE section (
course_id varchar(8),
sec_id varchar(8),
semester varchar(6),
year numeric(4,0),
building varchar(15),
room_number varchar(7),
time_slot_id varchar(4)
)
CREATE TABLE student (
ID varchar(5),
na... | SELECT dept_name, COUNT(*) FROM student GROUP BY dept_name | nvbench |
CREATE TABLE month (
month_number int,
month_name text
)
CREATE TABLE flight (
aircraft_code_sequence text,
airline_code varchar,
airline_flight text,
arrival_time int,
connections int,
departure_time int,
dual_carrier text,
flight_days text,
flight_id int,
flight_number... | SELECT DISTINCT fare_basis_code FROM fare_basis WHERE fare_basis_code = 'C' | atis |
CREATE TABLE table_48365 (
"Name" text,
"Latitude" text,
"Longitude" text,
"Diameter (km)" real,
"Year named" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many years correspond to longitude of 36.8e and diameter greater than 697?
| SELECT COUNT("Year named") FROM table_48365 WHERE "Longitude" = '36.8e' AND "Diameter (km)" > '697' | wikisql |
CREATE TABLE table_name_99 (
score VARCHAR,
home VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Score of the Toronto Maple Leafs home game on February 1?
| SELECT score FROM table_name_99 WHERE home = "toronto maple leafs" AND date = "february 1" | sql_create_context |
CREATE TABLE table_62321 (
"Country" text,
"Builder" text,
"Location" text,
"Ship" text,
"Class / type" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Builder, when Ship is 'Arizona'?
| SELECT "Builder" FROM table_62321 WHERE "Ship" = 'arizona' | wikisql |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.age < "41" AND diagnoses.long_title = "Vascular hamartomas" | mimicsql_data |
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Percent text,
ACC_Home text,
ACC_Road text,
All_Games text,
All_Games_Percent int,
All_Home text,
All_Road text,
All_Neutral text
)
CREATE TABLE university (
Scho... | SELECT All_Neutral, All_Games_Percent FROM basketball_match | nvbench |
CREATE TABLE table_name_71 (
opponent VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the Opponent on October 31, 1993?
| SELECT opponent FROM table_name_71 WHERE date = "october 31, 1993" | sql_create_context |
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 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', prescriptions.startdate)) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 40707 AND admissions.dischtime IS NULL) AND prescriptions.drug = 'd10w' ORDER BY prescriptions.startdate LIMIT ... | mimic_iii |
CREATE TABLE table_7304 (
"Place" real,
"Team" text,
"Played" real,
"Draw" real,
"Lost" real,
"Goals Scored" real,
"Goals Conceded" real,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Highest Points for Team Adet wh... | SELECT MAX("Points") FROM table_7304 WHERE "Team" = 'adet' AND "Draw" < '6' | wikisql |
CREATE TABLE table_35114 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" real,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Opponent has a Loss of b ez (5-5)?
| SELECT "Opponent" FROM table_35114 WHERE "Loss" = 'báez (5-5)' | wikisql |
CREATE TABLE table_68048 (
"Rank" real,
"Population" real,
"Name" text,
"Former Name" text,
"Municipality" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the former name for 49 rank
| SELECT "Former Name" FROM table_68048 WHERE "Rank" = '49' | wikisql |
CREATE TABLE table_28897 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" text,
"Result" text,
"Candidates" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who are the candidates for district virginia 12?
| SELECT "Candidates" FROM table_28897 WHERE "District" = 'Virginia 12' | wikisql |
CREATE TABLE table_name_32 (
issue_date_s_ VARCHAR,
artist VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Issue Date(s) has an Artist of men at work?
| SELECT issue_date_s_ FROM table_name_32 WHERE artist = "men at work" | sql_create_context |
CREATE TABLE table_72596 (
"Tournament" text,
"Country" text,
"Location" text,
"Current Venue" text,
"Began" real,
"Court surface" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many tournaments have their current venue as the Lindner Family... | SELECT COUNT("Tournament") FROM table_72596 WHERE "Current Venue" = 'Lindner Family Tennis Center' | wikisql |
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
... | SELECT Score, ViewCount AS "views", CommentCount AS "comments", Id AS "post_link", Tags FROM Posts WHERE ClosedDate IS NULL AND AnswerCount = 0 AND Tags LIKE '%django%' AND OwnerUserId IN (SELECT Id FROM Users WHERE Reputation > 200) ORDER BY LastEditDate DESC LIMIT 30 | sede |
CREATE TABLE customer_addresses (
address_type_code VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the distinct address type codes for all customer addresses?
| SELECT DISTINCT address_type_code FROM customer_addresses | sql_create_context |
CREATE TABLE table_name_1 (
days_held VARCHAR,
reign VARCHAR,
defenses VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the days held the champion with a reign larger than 3 and less than 1 defense has?
| SELECT days_held FROM table_name_1 WHERE reign > 3 AND defenses < 1 | sql_create_context |
CREATE TABLE PostTypes (
Id number,
Name text
)
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,
Predefin... | SELECT reinvented.TagName AS reinvented, 'with' AS presence, '##Invented:string##' AS invented, answerer.Id AS answerer_userid, answers.Id AS answer_id, answers.Score, answerer.Reputation AS answerer_reputation FROM Tags AS reinvented, Users AS answerer, Posts AS questions, Posts AS answers, PostTags AS ptri WHERE ques... | sede |
CREATE TABLE table_27700375_6 (
team VARCHAR,
high_points VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- If the high points were by Anthony Morrow (24), what was the team?
| SELECT team FROM table_27700375_6 WHERE high_points = "Anthony Morrow (24)" | sql_create_context |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE treatment (
trea... | 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 = 'hyponatremia' AND DATETIME(diagnosis.diagnosistime... | eicu |
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress text
)
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
... | SELECT * FROM Users WHERE Reputation >= 10000 | sede |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
d... | SELECT patients.gender FROM patients WHERE patients.subject_id = 61749 | mimic_iii |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREAT... | SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'diagnostic ultrasound of heart - transesophageal echocardiography' AND DATETIME(treatment.treatmenttime) >= ... | eicu |
CREATE TABLE table_62174 (
"Season" real,
"Timeslot (EDT)" text,
"Season premiere" text,
"Season finale" text,
"TV season" text,
"Rank" text,
"Viewers (in millions)" real,
"18\u201349 average" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
... | SELECT "Viewers (in millions)" FROM table_62174 WHERE "Season premiere" = 'september 26, 2010' | wikisql |
CREATE TABLE table_name_46 (
nhl_team VARCHAR,
position VARCHAR,
pick__number VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What NHL team has a centre and pick number of 105?
| SELECT nhl_team FROM table_name_46 WHERE position = "centre" AND pick__number = "105" | sql_create_context |
CREATE TABLE table_43828 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"Location Attendance" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who had the high rebounds for g... | SELECT "High rebounds" FROM table_43828 WHERE "Game" = '12' | wikisql |
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 jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decima... | SELECT EMAIL, COMMISSION_PCT FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY COMMISSION_PCT DESC | nvbench |
CREATE TABLE train (
id int,
train_number int,
name text,
origin text,
destination text,
time text,
interval text
)
CREATE TABLE weekly_weather (
station_id int,
day_of_week text,
high_temperature int,
low_temperature int,
precipitation real,
wind_speed_mph int
)
CR... | SELECT name, COUNT(name) FROM train GROUP BY name ORDER BY COUNT(name) | nvbench |
CREATE TABLE table_name_26 (
crowd VARCHAR,
away_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the crowd when the away team is footscray?
| SELECT crowd FROM table_name_26 WHERE away_team = "footscray" | sql_create_context |
CREATE TABLE table_37444 (
"School Year" text,
"Class A" text,
"Class AA" text,
"Class AAA" text,
"Class AAAA" text,
"Class AAAAA" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the class A with school year of 2004-05
| SELECT "Class A" FROM table_37444 WHERE "School Year" = '2004-05' | wikisql |
CREATE TABLE table_13865 (
"Township" text,
"County" text,
"Pop. (2010)" real,
"Land ( sqmi )" real,
"Water (sqmi)" real,
"Latitude" real,
"Longitude" real,
"GEO ID" real,
"ANSI code" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Wh... | SELECT SUM("Latitude") FROM table_13865 WHERE "Longitude" > '-101.819319' AND "Township" = 'martin' AND "GEO ID" = '3809951140' | wikisql |
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 * FROM jybgb WHERE JZLSH = '25823611070' | css |
CREATE TABLE table_23294081_11 (
performer_1 VARCHAR,
performer_2 VARCHAR,
_number VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was performer 1 in the episode number 7 where Heather Anne Campbell was performer 2?
| SELECT performer_1 FROM table_23294081_11 WHERE performer_2 = "Heather Anne Campbell" AND _number = 7 | sql_create_context |
CREATE TABLE table_name_35 (
pos VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the position in 1997?
| SELECT pos FROM table_name_35 WHERE year = 1997 | sql_create_context |
CREATE TABLE table_63968 (
"Date" text,
"Round" text,
"Opponents" text,
"H / A" text,
"Result F \u2013 A" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what game ended f-a with a round of round 1 replay
| SELECT "Result F \u2013 A" FROM table_63968 WHERE "Round" = 'round 1 replay' | wikisql |
CREATE TABLE region (
Region_ID int,
Region_name text,
Date text,
Label text,
Format text,
Catalogue text
)
CREATE TABLE party (
Party_ID int,
Minister text,
Took_office text,
Left_office text,
Region_ID int,
Party_name text
)
CREATE TABLE party_events (
Event_ID in... | SELECT Minister, COUNT(Minister) FROM party GROUP BY Minister ORDER BY Minister | nvbench |
CREATE TABLE table_1013129_10 (
player VARCHAR,
position VARCHAR,
nhl_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- NHL players are all centre in Florida panthers.
| SELECT player FROM table_1013129_10 WHERE position = "Centre" AND nhl_team = "Florida Panthers" | sql_create_context |
CREATE TABLE aircraft (
aid number,
name text,
distance number
)
CREATE TABLE flight (
flno number,
origin text,
destination text,
distance number,
departure_date time,
arrival_date time,
price number,
aid number
)
CREATE TABLE certificate (
eid number,
aid number
)... | SELECT COUNT(*) FROM flight | spider |
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
UserId number,
ContentLicense text
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
... | SELECT Comments.Score, Comments.Id AS "comment_link", Posts.Id AS "post_link" FROM Comments INNER JOIN Posts ON Posts.Id = Comments.PostId WHERE UserId = @UserId ORDER BY Score DESC | sede |
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime tim... | SELECT admissions.admission_type FROM admissions WHERE admissions.subject_id = 70709 AND STRFTIME('%y', admissions.admittime) = '2103' ORDER BY admissions.admittime DESC LIMIT 1 | mimic_iii |
CREATE TABLE table_24924576_2 (
titles VARCHAR,
result VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the titles for tko 11/12
| SELECT titles FROM table_24924576_2 WHERE result = "TKO 11/12" | sql_create_context |
CREATE TABLE table_23887 (
"Club" text,
"Played" text,
"Won" text,
"Drawn" text,
"Lost" text,
"Points for" text,
"Points against" text,
"Points difference" text,
"Bonus Points" text,
"Points" text
)
-- Using valid SQLite, answer the following questions for the tables provided a... | SELECT "Points difference" FROM table_23887 WHERE "Lost" = '10' | wikisql |
CREATE TABLE table_43251 (
"Tournament" text,
"2000" text,
"2001" text,
"2002" text,
"2003" text,
"2004" text,
"2005" text,
"2006" text,
"2007" text,
"2008" text,
"2009" text,
"2010" text,
"2011" text,
"2012" text
)
-- Using valid SQLite, answer the following qu... | SELECT "2001" FROM table_43251 WHERE "2005" = '4r' | wikisql |
CREATE TABLE table_75645 (
"County" text,
"Per capita income" text,
"Median household income" text,
"Median family income" text,
"Population" real,
"Number of households" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How much is per capita inco... | SELECT "Per capita income" FROM table_75645 WHERE "Median household income" = '$42,845' | wikisql |
CREATE TABLE table_60628 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What week was the result l 14 9?
| SELECT "Week" FROM table_60628 WHERE "Result" = 'l 14–9' | wikisql |
CREATE TABLE table_name_78 (
tournament VARCHAR,
surface VARCHAR,
opponent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what tournament was on a hard surface and saw jacob adaktusson as the opponent?
| SELECT tournament FROM table_name_78 WHERE surface = "hard" AND opponent = "jacob adaktusson" | sql_create_context |
CREATE TABLE driver (
party VARCHAR,
home_city VARCHAR,
age VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Show the party with drivers from Hartford and drivers older than 40.
| SELECT party FROM driver WHERE home_city = 'Hartford' AND age > 40 | sql_create_context |
CREATE TABLE table_204_862 (
id number,
"rank" number,
"bib" number,
"athlete" text,
"country" text,
"run 1" text,
"run 2" text,
"total" text,
"behind" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which one is previous to viktor ... | SELECT "athlete" FROM table_204_862 WHERE id = (SELECT id FROM table_204_862 WHERE "athlete" = 'viktor kneyb') - 1 | squall |
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 demographic.diagnosis = "HYPERGLYCEMIA;HYPONATREMIA" AND prescriptions.route = "TD" | mimicsql_data |
CREATE TABLE hz_info (
KH text,
KLX number,
YLJGDM text
)
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 num... | 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 VoteTypes (
Id number,
Name text
)
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,... | SELECT Id FROM Users | sede |
CREATE TABLE Person (
name varchar(20),
age INTEGER,
city TEXT,
gender TEXT,
job TEXT
)
CREATE TABLE PersonFriend (
name varchar(20),
friend varchar(20),
year INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Find the number of people w... | SELECT gender, COUNT(*) FROM Person WHERE age < 40 GROUP BY gender ORDER BY COUNT(*) DESC | nvbench |
CREATE TABLE table_name_87 (
transmitter_location VARCHAR,
station VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Where is the transmitter located for the station voice of vietnam
| SELECT transmitter_location FROM table_name_87 WHERE station = "voice of vietnam" | sql_create_context |
CREATE TABLE table_name_55 (
std_saps VARCHAR,
opt_saps VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total number of Std SAPs with 0-11 Opt SAPS?
| SELECT COUNT(std_saps) FROM table_name_55 WHERE opt_saps = "0-11" | sql_create_context |
CREATE TABLE table_name_80 (
ihsaa_class VARCHAR,
_number___county VARCHAR,
mascot VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What IHSAA clas is the school with a county number of 12 clinton and the hornets as their mascot?
| SELECT ihsaa_class FROM table_name_80 WHERE _number___county = "12 clinton" AND mascot = "hornets" | sql_create_context |
CREATE TABLE table_203_355 (
id number,
"year" number,
"total" number,
"romanians" text,
"hungarians" text,
"roma" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what percent of the population were romanians according to the last year on this ch... | SELECT "romanians" FROM table_203_355 ORDER BY "year" DESC LIMIT 1 | squall |
CREATE TABLE publication (
abstract varchar,
cid int,
citation_num int,
jid int,
pid int,
reference_num int,
title varchar,
year int
)
CREATE TABLE domain_keyword (
did int,
kid int
)
CREATE TABLE domain_conference (
cid int,
did int
)
CREATE TABLE domain (
did int... | SELECT keyword.keyword FROM journal, keyword, publication, publication_keyword WHERE journal.name = 'PVLDB' AND publication_keyword.kid = keyword.kid AND publication.jid = journal.jid AND publication.pid = publication_keyword.pid GROUP BY keyword.keyword ORDER BY COUNT(DISTINCT (publication.title)) DESC LIMIT 1 | academic |
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 procedures (
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "ACIDOSIS" AND demographic.admityear < "2139" | mimicsql_data |
CREATE TABLE mission (
Mission_ID int,
Ship_ID int,
Code text,
Launched_Year int,
Location text,
Speed_knots int,
Fate text
)
CREATE TABLE ship (
Ship_ID int,
Name text,
Type text,
Nationality text,
Tonnage int
)
-- Using valid SQLite, answer the following questions fo... | SELECT Type, COUNT(Type) FROM ship GROUP BY Nationality, Type ORDER BY Type | nvbench |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.