instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE customers (
id number,
first_name text,
last_name text,
company text,
address text,
city text,
state text,
country text,
postal_code text,
phone text,
fax text,
email text,
support_rep_id number
)
CREATE TABLE media_types (
id number,
name text
)... | SELECT milliseconds FROM tracks WHERE name = "Fast As a Shark" | spider |
CREATE TABLE table_12299 (
"Constituency number" real,
"Name" text,
"Reserved for ( SC / ST /None)" text,
"District" text,
"Number of electorates (2009)" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Number of electorates (2009) has a Distric... | SELECT COUNT("Number of electorates (2009)") FROM table_12299 WHERE "District" = 'jhajjar' AND "Reserved for ( SC / ST /None)" = 'sc' AND "Constituency number" < '66' | wikisql |
CREATE TABLE table_61136 (
"Opposing Teams" text,
"Against" real,
"Date" text,
"Venue" text,
"Status" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the opposing team when the status is second test?
| SELECT "Opposing Teams" FROM table_61136 WHERE "Status" = 'second test' | wikisql |
CREATE TABLE table_9084 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Event" text,
"Round" text,
"Location" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was Diego Saraiva's record when he fought for 3 rounds against d... | SELECT "Record" FROM table_9084 WHERE "Round" = '3' AND "Opponent" = 'danny suarez' | wikisql |
CREATE TABLE table_70609 (
"Year" text,
"Start" text,
"Qual" text,
"Rank" text,
"Finish" text,
"Laps" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was Jack McGrath's rank in 1955 when he started at 3 and finished at 26?
| SELECT "Rank" FROM table_70609 WHERE "Start" = '3' AND "Finish" = '26' AND "Year" = '1955' | wikisql |
CREATE TABLE table_name_45 (
grid INTEGER,
constructor VARCHAR,
laps VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the high grid for ferrari's with 2 laps?
| SELECT MAX(grid) FROM table_name_45 WHERE constructor = "ferrari" AND laps = 2 | sql_create_context |
CREATE TABLE table_14345690_4 (
entered VARCHAR,
famous_for VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the entered for famous for page 3 model
| SELECT entered FROM table_14345690_4 WHERE famous_for = "Page 3 Model" | sql_create_context |
CREATE TABLE table_60518 (
"Season" real,
"Series" text,
"Team" text,
"Races" text,
"Wins" text,
"Poles" text,
"Podiums" text,
"Points" text,
"Position" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Season has Podiums of 0, an... | SELECT MAX("Season") FROM table_60518 WHERE "Podiums" = '0' AND "Races" = '16' | wikisql |
CREATE TABLE Project_Outcomes (
project_id INTEGER,
outcome_code VARCHAR(10),
outcome_details VARCHAR(255)
)
CREATE TABLE Staff_Roles (
role_code VARCHAR(10),
role_description VARCHAR(255)
)
CREATE TABLE Projects (
project_id INTEGER,
organisation_id INTEGER,
project_details VARCHAR(25... | SELECT T2.organisation_details, T1.organisation_id FROM Grants AS T1 JOIN Organisations AS T2 ON T1.organisation_id = T2.organisation_id GROUP BY T2.organisation_details ORDER BY T2.organisation_details DESC | nvbench |
CREATE TABLE table_5663 (
"Surname" text,
"First" text,
"D.O.B." text,
"Bats" text,
"Throws" text,
"Position" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Surname has Throws of r, and a Position of p, and a DOB of 26 april 1989?
| SELECT "Surname" FROM table_5663 WHERE "Throws" = 'r' AND "Position" = 'p' AND "D.O.B." = '26 april 1989' | wikisql |
CREATE TABLE table_18812411_3 (
country VARCHAR,
r3 VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What country had a r3 at 72, by Larry Mize?
| SELECT country FROM table_18812411_3 WHERE r3 = 72 AND player = "Larry Mize" | sql_create_context |
CREATE TABLE table_name_77 (
opponent VARCHAR,
game VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was their opponent in game 4?
| SELECT opponent FROM table_name_77 WHERE game = "4" | sql_create_context |
CREATE TABLE table_54131 (
"Player" text,
"Rec." real,
"Yards" real,
"Avg." real,
"TD's" real,
"Long" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the average for the player that scored 116 yards and had TD's less than 1?
| SELECT COUNT("Avg.") FROM table_54131 WHERE "Yards" = '116' AND "TD's" < '1' | wikisql |
CREATE TABLE table_name_92 (
engine VARCHAR,
year VARCHAR,
chassis VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which engine from 1973 has a Brabham bt37 chassis?
| SELECT engine FROM table_name_92 WHERE year = 1973 AND chassis = "brabham bt37" | sql_create_context |
CREATE TABLE DEPARTMENT (
DEPT_CODE varchar(10),
DEPT_NAME varchar(30),
SCHOOL_CODE varchar(8),
EMP_NUM int,
DEPT_ADDRESS varchar(20),
DEPT_EXTENSION varchar(4)
)
CREATE TABLE ENROLL (
CLASS_CODE varchar(5),
STU_NUM int,
ENROLL_GRADE varchar(50)
)
CREATE TABLE PROFESSOR (
EMP_N... | SELECT EMP_FNAME, COUNT(EMP_FNAME) FROM CLASS AS T1 JOIN EMPLOYEE AS T2 ON T1.PROF_NUM = T2.EMP_NUM JOIN COURSE AS T3 ON T1.CRS_CODE = T3.CRS_CODE GROUP BY EMP_FNAME ORDER BY COUNT(EMP_FNAME) | nvbench |
CREATE TABLE table_name_42 (
attendance VARCHAR,
rank__number VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the attendance when they had a ranking of #4?
| SELECT attendance FROM table_name_42 WHERE rank__number = "4" | sql_create_context |
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
AboutMe text,
Views number,
UpVotes number,
DownVotes number,
ProfileImageUrl text,
EmailHash text,
AccountId number
)
CRE... | SELECT V.PostId AS "post_link", V.VoteTypeId, COUNT(V.VoteTypeId) AS "Votes" FROM Votes AS V WHERE V.VoteTypeId IN (6, 7) GROUP BY V.PostId, V.VoteTypeId HAVING COUNT(V.VoteTypeId) > 0 AND COUNT(V.VoteTypeId) < 5 LIMIT 200 | sede |
CREATE TABLE table_204_39 (
id number,
"number" number,
"symbol" text,
"name" text,
"21st" number,
"22nd" number,
"23rd" number,
"24th" number,
"25th" number,
"26th" number,
"27th" number,
"28th" number,
"29th" number,
"30th" number
)
-- Using valid SQLite, answ... | SELECT "name" FROM table_204_39 WHERE "name" IN ('titanium', 'iron') AND "symbol" = 'fe' | squall |
CREATE TABLE table_203_424 (
id number,
"year" number,
"starts" number,
"wins" number,
"top 5" number,
"top 10" number,
"poles" number,
"avg. start" number,
"avg. finish" number,
"winnings" text,
"position" text,
"team(s)" text
)
-- Using valid SQLite, answer the follow... | SELECT MIN("year") FROM table_203_424 WHERE "top 5" > 0 | squall |
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 jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN mzjzjlb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJZJLB WHERE mzjzjlb.JZZDSM = '龈乳头炎' AND hz_info.RYBH =... | css |
CREATE TABLE table_name_46 (
english VARCHAR,
icelandic VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the ENglish word for the Icelandic word hlaupa?
| SELECT english FROM table_name_46 WHERE icelandic = "hlaupa" | sql_create_context |
CREATE TABLE table_17641206_4 (
original_title VARCHAR,
viewership VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the title of the episode with 5.04 million viewers?
| SELECT original_title FROM table_17641206_4 WHERE viewership = "5.04 million" | sql_create_context |
CREATE TABLE table_23014476_1 (
others__percentage VARCHAR,
bush__number VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the others % for bush number 1372
| SELECT others__percentage FROM table_23014476_1 WHERE bush__number = 1372 | sql_create_context |
CREATE TABLE table_name_5 (
bronze INTEGER,
nation VARCHAR,
rank VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Bronze has a Nation of canada, and a Rank smaller than 6?
| SELECT AVG(bronze) FROM table_name_5 WHERE nation = "canada" AND rank < 6 | sql_create_context |
CREATE TABLE flight_stop (
flight_id int,
stop_number int,
stop_days text,
stop_airport text,
arrival_time int,
arrival_airline text,
arrival_flight_number int,
departure_time int,
departure_airline text,
departure_flight_number int,
stop_time int
)
CREATE TABLE aircraft (
... | 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 = 'BALTIMORE' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'ATLA... | atis |
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 (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(... | SELECT HIRE_DATE, SUM(DEPARTMENT_ID) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) | nvbench |
CREATE TABLE table_3513 (
"Season" real,
"Series" text,
"Team" text,
"Races" real,
"Wins" real,
"Poles" real,
"F/Laps" real,
"Podiums" real,
"Points" text,
"Position" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many champi... | SELECT "Series" FROM table_3513 WHERE "Points" = '6' | 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 mzjzjlb (
YLJGDM text,
JZLSH ... | SELECT JYKSBM, JYKSMC FROM jybgb WHERE BGDH = '95422285600' | css |
CREATE TABLE table_34512 (
"Rank" text,
"Player" text,
"Position" text,
"Career" text,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the highest points that Emmitt Smith had?
| SELECT MAX("Points") FROM table_34512 WHERE "Player" = 'emmitt smith' | wikisql |
CREATE TABLE table_45664 (
"Rank" real,
"Title" text,
"Studio" text,
"Director(s)" text,
"Worldwide Gross" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What director(s) have the intouchables as the title?
| SELECT "Director(s)" FROM table_45664 WHERE "Title" = 'the intouchables' | wikisql |
CREATE TABLE table_name_80 (
inns VARCHAR,
runs VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Inns of 435 Runs?
| SELECT inns FROM table_name_80 WHERE runs = 435 | sql_create_context |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "HISPANIC/LATINO - PUERTO RICAN" AND prescriptions.drug = "Vial" | mimicsql_data |
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 labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
cha... | SELECT microbiologyevents.spec_type_desc FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 6170) AND DATETIME(microbiologyevents.charttime, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-0 month') ORDER BY microbiologye... | mimic_iii |
CREATE TABLE table_21761882_4 (
location VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What location was the game on October 6?
| SELECT location FROM table_21761882_4 WHERE date = "October 6" | sql_create_context |
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 Team_ID, All_Games_Percent FROM basketball_match GROUP BY All_Games | nvbench |
CREATE TABLE table_77988 (
"Date" text,
"Ship" text,
"Type" text,
"Nationality" text,
"Tonnage GRT" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the tonnage grt of the ship author?
| SELECT "Tonnage GRT" FROM table_77988 WHERE "Ship" = 'author' | wikisql |
CREATE TABLE table_name_21 (
player VARCHAR,
total VARCHAR,
year_s__won VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who won in 1988 with a total less than 287?
| SELECT player FROM table_name_21 WHERE total < 287 AND year_s__won = "1988" | sql_create_context |
CREATE TABLE code_description (
code varchar,
description 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 int,
weight i... | 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 = 'DALLAS' AND date_day.day_number = 26 AND date_day.month_number = 7 AND da... | atis |
CREATE TABLE table_name_73 (
crowd INTEGER,
venue VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest crowd number at the venue MCG?
| SELECT MIN(crowd) FROM table_name_73 WHERE venue = "mcg" | sql_create_context |
CREATE TABLE table_16182 (
"Institution" text,
"Location" text,
"Men\u2019s Nickname" text,
"Women\u2019s Nickname" text,
"Founded" real,
"Type" text,
"Enrollment" real,
"Joined" text,
"Left" text,
"Current Conference" text,
"Classification" text
)
-- Using valid SQLite, an... | SELECT "Current Conference" FROM table_16182 WHERE "Location" = 'Jackson, Mississippi' | wikisql |
CREATE TABLE table_1682026_3 (
profits__billion_$_ VARCHAR,
company VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the profits of Wells Fargo (in billions)?
| SELECT profits__billion_$_ FROM table_1682026_3 WHERE company = "Wells Fargo" | sql_create_context |
CREATE TABLE table_19701 (
"Year" text,
"General Election" text,
"Seats Won" real,
"Change in Seat" real,
"% of votes" text,
"votes swing" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the vote swing for the general election of the 12t... | SELECT "votes swing" FROM table_19701 WHERE "General Election" = '12th Lok Sabha' | wikisql |
CREATE TABLE table_43304 (
"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 language is telemarket for you with a content of televendita... | SELECT "Language" FROM table_43304 WHERE "Content" = 'televendita' AND "Television service" = 'telemarket for you' | wikisql |
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 ZYBMLX, ZYZDBM, ZYZDMC FROM zyjzjlb WHERE JZLSH = '86797160083' | css |
CREATE TABLE table_79435 (
"Country" text,
"Contestant" text,
"Height (cm)" real,
"Height (ft)" text,
"Hometown" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the hometown of the player from Indonesia?
| SELECT "Hometown" FROM table_79435 WHERE "Country" = 'indonesia' | wikisql |
CREATE TABLE diagnoses (
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
)
C... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dob_year < "2090" AND procedures.long_title = "Radical cystectomy" | mimicsql_data |
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescription text,
CreationDate time,
CreationModeratorId number,
ApprovalDa... | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%philippines%' ORDER BY Reputation DESC LIMIT 200 | sede |
CREATE TABLE table_46586 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To Par" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Country, when Player is 'Dow Finsterwald'?
| SELECT "Country" FROM table_46586 WHERE "Player" = 'dow finsterwald' | wikisql |
CREATE TABLE table_53779 (
"Season" real,
"Premier" text,
"Runner Up" text,
"Score" text,
"Venue" text,
"Attendance" real,
"Margin" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average attendnace for seasons before 1986, a marg... | SELECT AVG("Attendance") FROM table_53779 WHERE "Season" < '1986' AND "Margin" = '6' AND "Score" = '13.16 (94) – 13.10 (88)' | wikisql |
CREATE TABLE table_50645 (
"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 was the score in the 1st leg when 2nd leg was 1 4?
| SELECT "1st leg" FROM table_50645 WHERE "2nd leg" = '1–4' | wikisql |
CREATE TABLE table_50224 (
"Department" text,
"Micro (10ha)" real,
"Small (100ha)" real,
"Medium (500ha)" real,
"Big (>500ha)" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Small (100ha) has a Big (>500ha) of 5,710, and a To... | SELECT MIN("Small (100ha)") FROM table_50224 WHERE "Big (>500ha)" = '5,710' AND "Total" < '36,351' | wikisql |
CREATE TABLE table_name_21 (
round VARCHAR,
pick VARCHAR,
position VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total number of rounds of the end player with a pick number greater than 303?
| SELECT COUNT(round) FROM table_name_21 WHERE pick > 303 AND position = "end" | sql_create_context |
CREATE TABLE table_name_40 (
to_par INTEGER,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average To Par, when Score is '72-67-71-72=282'?
| SELECT AVG(to_par) FROM table_name_40 WHERE score = 72 - 67 - 71 - 72 = 282 | sql_create_context |
CREATE TABLE table_12570759_2 (
written_by VARCHAR,
us_viewers__millions_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many episodes were watched by 12.72 million U.S. viewers?
| SELECT COUNT(written_by) FROM table_12570759_2 WHERE us_viewers__millions_ = "12.72" | sql_create_context |
CREATE TABLE table_43406 (
"Nation" text,
"Skip" text,
"Third" text,
"Second" text,
"Lead" text,
"Alternate" text,
"Club" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Lead has Hans Frauenlob as a Third?
| SELECT "Lead" FROM table_43406 WHERE "Third" = 'hans frauenlob' | wikisql |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescription... | 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.long_title = "Acute pancreatitis" AND prescriptions.drug_type = "ADDITIVE" | mimicsql_data |
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDispl... | SELECT Users.DisplayName, COUNT(*) AS UpVotes FROM Tags INNER JOIN PostTags ON PostTags.TagId = Tags.Id INNER JOIN Posts ON Posts.ParentId = PostTags.PostId INNER JOIN Votes ON Votes.PostId = Posts.Id AND VoteTypeId = 2 INNER JOIN Users ON Users.Id = Posts.OwnerUserId WHERE Tags.Id = 34113 AND Posts.CreationDate >= '20... | sede |
CREATE TABLE table_4381 (
"Medal" text,
"Name" text,
"Games" text,
"Sport" text,
"Event" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Tell me the event for 2012 london games
| SELECT "Event" FROM table_4381 WHERE "Games" = '2012 london' | wikisql |
CREATE TABLE table_51377 (
"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.
-- Who played as the home team when Footscray was t... | SELECT "Home team" FROM table_51377 WHERE "Away team" = 'footscray' | wikisql |
CREATE TABLE staff (
staff_id number,
staff_address_id number,
nickname text,
first_name text,
middle_name text,
last_name text,
date_of_birth time,
date_joined_staff time,
date_left_staff time
)
CREATE TABLE vehicles (
vehicle_id number,
vehicle_details text
)
CREATE TABLE... | SELECT date_became_customer FROM customers WHERE first_name = "Carole" AND last_name = "Bernhard" | spider |
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 Allergy_Type (
Allergy VARCHAR(20),
AllergyType VARCHAR(20)
)
CREATE TABLE Has_Allergy (
StuID INTEGE... | SELECT AllergyType, COUNT(*) FROM Allergy_Type GROUP BY AllergyType ORDER BY AllergyType DESC | nvbench |
CREATE TABLE table_42100 (
"Ecozone" text,
"Area (km\u00b2) Territorial waters" real,
"Area (km\u00b2) Exclusive Economic Zone" real,
"Percentage of total area (forEEZ)" real,
"Percentage of marine area (forEEZ)" real
)
-- Using valid SQLite, answer the following questions for the tables provided ... | SELECT COUNT("Percentage of marine area (forEEZ)") FROM table_42100 WHERE "Ecozone" = 'atlantic marine' AND "Area (km\u00b2) Exclusive Economic Zone" < '996,439' | wikisql |
CREATE TABLE checking (
custid number,
balance number
)
CREATE TABLE savings (
custid number,
balance number
)
CREATE TABLE accounts (
custid number,
name text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Find the checking balance and saving bala... | SELECT T2.balance, T3.balance FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid JOIN savings AS T3 ON T1.custid = T3.custid WHERE T1.name = 'Brown' | spider |
CREATE TABLE table_name_77 (
tournament VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which 2008-12 has a 2013 of A, and a Tournament of wimbledon?
| SELECT 2008 AS _12 FROM table_name_77 WHERE 2013 = "a" AND tournament = "wimbledon" | sql_create_context |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE l... | SELECT COUNT(*) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-28154')) AND lab.labname = 'calcium' AND DATETIME(lab.labresulttime) <= DATETIME(CURRENT... | eicu |
CREATE TABLE table_name_85 (
laps INTEGER,
rank VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest lap with a rank of 30?
| SELECT MIN(laps) FROM table_name_85 WHERE rank = "30" | sql_create_context |
CREATE TABLE table_name_94 (
opponent VARCHAR,
event VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Opponent has the Event of Sengoku 1?
| SELECT opponent FROM table_name_94 WHERE event = "sengoku 1" | sql_create_context |
CREATE TABLE mzjzjlb (
YLJGDM text,
JZLSH text,
KH text,
KLX number,
MJZH text,
HZXM text,
NLS number,
NLY number,
ZSEBZ number,
JZZTDM number,
JZZTMC text,
JZJSSJ time,
TXBZ number,
ZZBZ number,
WDBZ number,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
... | SELECT JZKSBM, JZKSMC FROM mzjzjlb WHERE JZLSH = '06908223301' | css |
CREATE TABLE table_name_19 (
country VARCHAR,
finish VARCHAR,
year_s__won VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Country has a Finish of t32, and a Year(s) won of 1996?
| SELECT country FROM table_name_19 WHERE finish = "t32" AND year_s__won = "1996" | sql_create_context |
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 * FROM qtb WHERE qtb.MED_SER_ORG_NO = '6196587' AND qtb.IN_HOSP_DATE BETWEEN '2006-08-31' AND '2016-04-05' UNION SELECT * FROM gyb WHERE gyb.MED_SER_ORG_NO = '6196587' AND gyb.IN_HOSP_DATE BETWEEN '2006-08-31' AND '2016-04-05' UNION SELECT * FROM zyb WHERE zyb.MED_SER_ORG_NO = '6196587' AND zyb.IN_HOSP_DATE BETW... | css |
CREATE TABLE table_name_12 (
land_area__km²_ INTEGER,
name VARCHAR,
population_density__per_km²_ VARCHAR,
population__2006_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Land area (km ) has a Population density (per km ) larger than 112.6, and... | SELECT MAX(land_area__km²_) FROM table_name_12 WHERE population_density__per_km²_ > 112.6 AND population__2006_ > 785 AND name = "pinehouse" | sql_create_context |
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 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 = 'ATLANT... | atis |
CREATE TABLE table_60382 (
"Tournament" text,
"2008" text,
"2009" text,
"2010" text,
"2011" text,
"2012" text,
"2013" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Can you tell me the Tournament that has the 2009 of 1r, and the 2012 of w?
| SELECT "Tournament" FROM table_60382 WHERE "2009" = '1r' AND "2012" = 'w' | wikisql |
CREATE TABLE table_name_61 (
method VARCHAR,
record VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which method led to a record of 9-4?
| SELECT method FROM table_name_61 WHERE record = "9-4" | sql_create_context |
CREATE TABLE table_40861 (
"Record" text,
"Athlete" text,
"Nation" text,
"Venue" text,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Date when Russia was the nation and the venue was madrid , spain?
| SELECT "Date" FROM table_40861 WHERE "Nation" = 'russia' AND "Venue" = 'madrid , spain' | wikisql |
CREATE TABLE table_17252 (
"Station Number" text,
"District" text,
"Location" text,
"Type" text,
"Appliances" text,
"Registrations" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what are all the type where station number is c08
| SELECT "Type" FROM table_17252 WHERE "Station Number" = 'C08' | wikisql |
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE locations (
LOCATIO... | SELECT JOB_ID, SUM(EMPLOYEE_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' GROUP BY JOB_ID ORDER BY JOB_ID DESC | nvbench |
CREATE TABLE table_name_37 (
recipient VARCHAR,
date VARCHAR,
award VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who won an award of 3,000 on 4/9/02?
| SELECT recipient FROM table_name_37 WHERE date = "4/9/02" AND award = "£3,000" | sql_create_context |
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
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... | SELECT HIRE_DATE, SUM(MANAGER_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY SUM(MANAGER_ID) DESC | nvbench |
CREATE TABLE table_name_28 (
affiliation VARCHAR,
mls_team VARCHAR,
pick__number VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Tell me the affiliation for mls team of metrostars and pick number of 26
| SELECT affiliation FROM table_name_28 WHERE mls_team = "metrostars" AND pick__number = 26 | sql_create_context |
CREATE TABLE table_61404 (
"Shooter" text,
"Event" text,
"Rank points" text,
"Score points" text,
"Total" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the Rank points which have an Event of wc beijing, and Score points of 13, and a Total of 1... | SELECT "Rank points" FROM table_61404 WHERE "Event" = 'wc beijing' AND "Score points" = '13' AND "Total" = '18' | wikisql |
CREATE TABLE table_18304058_2 (
team_name VARCHAR,
sports VARCHAR,
schools VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the name of the team from the Elverado Trico school in football?
| SELECT team_name FROM table_18304058_2 WHERE sports = "Football" AND schools = "Elverado Trico" | sql_create_context |
CREATE TABLE hz_info (
KH text,
KLX number,
YLJGDM text,
RYBH text
)
CREATE TABLE mzjzjlb (
YLJGDM text,
JZLSH text,
KH text,
KLX number,
MJZH text,
HZXM text,
NLS number,
NLY number,
ZSEBZ number,
JZZTDM number,
JZZTMC text,
JZJSSJ time,
TXBZ number,... | SELECT JCRGH, JCRXM FROM jyjgzbb WHERE JYZBLSH = '95814994943' | css |
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABLE restriction (
restriction_code text,
advance_purchase int,
stopovers text,
saturday_stay_required text,
minimum_... | 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 ((date_day.day_number = 23 AND date_day.month_number = 4 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.departure_time... | atis |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellv... | SELECT t3.treatmentname FROM (SELECT t2.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'pleur... | eicu |
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE c... | SELECT DISTINCT t1.c1 FROM (SELECT labevents.valuenum, PERCENT_RANK() OVER (ORDER BY labevents.valuenum) AS c1 FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'hemoglobin') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.ag... | mimic_iii |
CREATE TABLE table_15512 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Event" text,
"Round" real,
"Time" text,
"Location" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the location of the match with the record 1... | SELECT "Location" FROM table_15512 WHERE "Record" = '10-8-1' | wikisql |
CREATE TABLE table_53473 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Geelong's home team score?
| SELECT "Home team score" FROM table_53473 WHERE "Home team" = 'geelong' | wikisql |
CREATE TABLE table_1341640_43 (
district VARCHAR,
incumbent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Where was Al Gore elected
| SELECT district FROM table_1341640_43 WHERE incumbent = "Al Gore" | sql_create_context |
CREATE TABLE table_name_10 (
venue VARCHAR,
event VARCHAR,
competition VARCHAR,
year VARCHAR,
time VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Venue has a Year smaller than 1991, Time larger than 10.29, Competition of mediterranean games,... | SELECT venue FROM table_name_10 WHERE year < 1991 AND time > 10.29 AND competition = "mediterranean games" AND event = "4x100 m relay" | sql_create_context |
CREATE TABLE table_35543 (
"Year" real,
"Division" real,
"League" text,
"Reg. Season" text,
"Playoffs" text,
"Open Cup" text,
"Avg. Attendance" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Playoffs had an Open Cup of 3rd round?
| SELECT "Playoffs" FROM table_35543 WHERE "Open Cup" = '3rd round' | wikisql |
CREATE TABLE table_22960 (
"Year" text,
"Location" text,
"Class 1" text,
"Best UK team" text,
"Class 1-200" text,
"Class 3" text,
"Class 1a" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the total location for dynamic events winner
| SELECT COUNT("Location") FROM table_22960 WHERE "Class 1-200" = 'Dynamic Events Winner' | wikisql |
CREATE TABLE table_38151 (
"Round" real,
"Pick #" real,
"Overall" real,
"Name" text,
"Position" text,
"College" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Name has an Overall of 235?
| SELECT "Name" FROM table_38151 WHERE "Overall" = '235' | wikisql |
CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
CreationDate time,
OwnerUserId number,
AutoRenameCount number,
LastAutoRename time,
Score number,
ApprovedByUserId number,
ApprovalDate time
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId ... | SELECT CASE WHEN Score = 0 AND LAG(Score) OVER (PARTITION BY OwnerUserId ORDER BY Id) = 0 THEN 1 ELSE 0 END AS N, OwnerUserId AS UserId, Id AS PostId FROM Posts WHERE PostTypeId = 2 AND OwnerUserId > 0 | sede |
CREATE TABLE table_name_50 (
voting_order INTEGER,
commentator VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the voting order when bunny carr was the commentator?
| SELECT SUM(voting_order) FROM table_name_50 WHERE commentator = "bunny carr" | sql_create_context |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time... | SELECT (SELECT patient.admissionweight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-106613') AND NOT patient.admissionweight IS NULL AND patient.unitadmittime = '2103-11-19 21:44:14') - (SELECT patient.admissionweight FROM ... | eicu |
CREATE TABLE table_name_21 (
sport VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What sport was played on February 25, 2011?
| SELECT sport FROM table_name_21 WHERE date = "february 25, 2011" | sql_create_context |
CREATE TABLE table_name_80 (
Suited VARCHAR,
non_suited_match VARCHAR,
house_edge VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the Suited & Non-Suited Match with a 2.99% for House Edge.
| SELECT Suited + non_suited_match FROM table_name_80 WHERE house_edge = "2.99%" | sql_create_context |
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE offering_instructor (
... | SELECT COUNT(*) > 0 FROM course, program_course WHERE course.department = 'MEDCHEM' AND course.number = 532 AND program_course.category LIKE '%Core%' AND program_course.course_id = course.course_id | advising |
CREATE TABLE table_name_96 (
game INTEGER,
record VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the earliest game with a record of 16 4 3?
| SELECT MIN(game) FROM table_name_96 WHERE record = "16–4–3" | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.