instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_39649 (
"Date" real,
"Opponent" text,
"Venue" text,
"Result" text,
"Attendance" text,
"Competition" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the home Competition with Attendance of 1,268?
| SELECT "Competition" FROM table_39649 WHERE "Venue" = 'home' AND "Attendance" = '1,268' | wikisql |
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE Posts (
... | SELECT Posts.Id, ViewCount, OwnerUserId, Reputation, (CAST(Reputation AS FLOAT) / CAST(ViewCount AS FLOAT)) AS Ratio FROM Posts, Users WHERE OwnerUserId = Users.Id AND ViewCount > 100000 AND CommunityOwnedDate IS NULL ORDER BY 5 | sede |
CREATE TABLE table_name_88 (
departure VARCHAR,
kilometers VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's listed for Departure that has 1676 listed for the Kilometers?
| SELECT departure FROM table_name_88 WHERE kilometers = 1676 | sql_create_context |
CREATE TABLE table_56999 (
"Episode" text,
"Air date" text,
"Rating" real,
"Share" real,
"18-49 (Rating/Share)" text,
"Viewers (m)" real,
"Rank (timeslot)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the total viewers (m) when the... | SELECT COUNT("Viewers (m)") FROM table_56999 WHERE "Rating" = '6.4' AND "Share" > '11' | wikisql |
CREATE TABLE table_name_49 (
winner VARCHAR,
team_classification VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What winner has silence-lotto as the team classification?
| SELECT winner FROM table_name_49 WHERE team_classification = "silence-lotto" | sql_create_context |
CREATE TABLE table_76465 (
"Date" text,
"H/A/N" text,
"Opponent" text,
"Score" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the Opponent when the Cavaliers had a Record of 3-9?
| SELECT "Opponent" FROM table_76465 WHERE "Record" = '3-9' | 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 departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
... | SELECT EMPLOYEE_ID, MANAGER_ID FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' | nvbench |
CREATE TABLE table_69441 (
"Engine" text,
"Displacement" text,
"Power" text,
"Torque" text,
"Year" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When is the earliest year with a Power of 90kw (121hp) @ 4000?
| SELECT MIN("Year") FROM table_69441 WHERE "Power" = '90kw (121hp) @ 4000' | wikisql |
CREATE TABLE table_77244 (
"Position" real,
"Team" text,
"Rd 6" real,
"Rd 7" real,
"Rd 8" real,
"Total" real
)
-- 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_77244 WHERE "Rd 7" < '8' | 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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.diagnosis = "ANGIOEDEMA" AND lab."CATEGORY" = "Blood Gas" | mimicsql_data |
CREATE TABLE table_55561 (
"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 the home teamscore for Richmond?
| SELECT "Home team score" FROM table_55561 WHERE "Home team" = 'richmond' | wikisql |
CREATE TABLE table_204_378 (
id number,
"no" number,
"driver" text,
"entrant" text,
"constructor" text,
"chassis" text,
"engine" text,
"tyre" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the total number of drivers on the chart... | SELECT COUNT("driver") FROM table_204_378 | squall |
CREATE TABLE table_name_14 (
location VARCHAR,
opponent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Where did the match with opponent Laverne Clark occur?
| SELECT location FROM table_name_14 WHERE opponent = "laverne clark" | sql_create_context |
CREATE TABLE t_kc24 (
ACCOUNT_DASH_DATE time,
ACCOUNT_DASH_FLG number,
CASH_PAY number,
CIVIL_SUBSIDY number,
CKC102 number,
CLINIC_ID text,
CLINIC_SLT_DATE time,
COMP_ID text,
COM_ACC_PAY number,
COM_PAY number,
DATA_ID text,
ENT_ACC_PAY number,
ENT_PAY number,
F... | SELECT * FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '7867709' AND gwyjzb.IN_HOSP_DATE BETWEEN '2000-01-02' AND '2013-01-02' AND gwyjzb.PERSON_NM LIKE '郎%' UNION SELECT * FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '7867709' AND fgwyjzb.IN_HOSP_DATE BETWEEN '2000-01-02' AND '2013-01-02' AND fgwyjzb.PERSON_NM LIKE '郎%' | css |
CREATE TABLE station (
Station_ID int,
Name text,
Annual_entry_exit real,
Annual_interchanges real,
Total_Passengers real,
Location text,
Main_Services text,
Number_of_Platforms int
)
CREATE TABLE train (
Train_ID int,
Name text,
Time text,
Service text
)
CREATE TABLE t... | SELECT Name, Total_Passengers FROM station WHERE Location <> 'London' ORDER BY Total_Passengers DESC | nvbench |
CREATE TABLE table_26685 (
"Episode number Production number" text,
"Title" text,
"Original airdate" text,
"Time of airing" text,
"Total viewers on Hallmark" real,
"Total viewers on Hallmark+1" real,
"Total viewers" real,
"Rank on channel" text
)
-- Using valid SQLite, answer the follo... | SELECT "Original airdate" FROM table_26685 WHERE "Episode number Production number" = '7 1-07' | wikisql |
CREATE TABLE table_71746 (
"Year" real,
"Opponent" text,
"Competition" text,
"Score" text,
"Venue" text,
"Attendance" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the competition in 1978?
| SELECT "Competition" FROM table_71746 WHERE "Year" = '1978' | wikisql |
CREATE TABLE table_20592988_1 (
bleeding_time VARCHAR,
condition VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the status of bleeding time for thrombocytopenia?
| SELECT bleeding_time FROM table_20592988_1 WHERE condition = "Thrombocytopenia" | sql_create_context |
CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationDate time,
ApprovalDate time,
RejectionDate time,
OwnerUserId number,
Comment text,
Text text,
Title text,
Tags text,
RevisionGUID other
)
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
... | SELECT *, CASE WHEN 'unscored_answers' > 10 AND 'percentage_unscored' >= 25 THEN 'Unsung Hero Indeed !!' ELSE 'Not just yet..' END AS "is_user_unsung_?" FROM (SELECT COUNT(a.Id) AS "accepted_answers", SUM(CASE WHEN a.Score = 0 THEN 0 ELSE 1 END) AS "scored_answers", SUM(CASE WHEN a.Score = 0 THEN 1 ELSE 0 END) AS "unsc... | sede |
CREATE TABLE table_30262 (
"Pick #" real,
"CFL Team" text,
"Player" text,
"Position" text,
"College" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest numbered draft pick?
| SELECT MAX("Pick #") FROM table_30262 | wikisql |
CREATE TABLE table_27723228_8 (
record VARCHAR,
high_points VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the record when chris paul (16) had the high points?
| SELECT record FROM table_27723228_8 WHERE high_points = "Chris Paul (16)" | sql_create_context |
CREATE TABLE table_36481 (
"Position" real,
"Sail number" text,
"Yacht" text,
"State/country" text,
"Yacht type" text,
"LOA (Metres)" real,
"Skipper" text,
"Corrected time d:hh:mm:ss" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- WHICH ... | SELECT AVG("LOA (Metres)") FROM table_36481 WHERE "Corrected time d:hh:mm:ss" = '3:12:07:43' | wikisql |
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescription text,
CreationDate time,
CreationModeratorId number,
ApprovalDa... | SELECT COUNT(*), T.TagName FROM Posts AS P INNER JOIN PostTags AS PT ON (P.Id = PT.PostId) INNER JOIN Tags AS T ON (PT.TagId = T.Id) GROUP BY T.TagName HAVING t.TagName IN ('powershell', 'bash') ORDER BY COUNT(*) DESC | sede |
CREATE TABLE table_name_86 (
host_team VARCHAR,
final_score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Host Team has Final Score of 42-23?
| SELECT host_team FROM table_name_86 WHERE final_score = "42-23" | 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 demographic.insurance, prescriptions.formulary_drug_cd FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.subject_id = "24425" | mimicsql_data |
CREATE TABLE table_name_71 (
name VARCHAR,
venue VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Name, when Venue is 'Motherwell'?
| SELECT name FROM table_name_71 WHERE venue = "motherwell" | sql_create_context |
CREATE TABLE table_80193 (
"City" text,
"Country" text,
"IATA" text,
"ICAO" text,
"Airport" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the IATA of gale o airport?
| SELECT "IATA" FROM table_80193 WHERE "Airport" = 'galeão airport' | 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 diagnoses (
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.short_title = "Gstr/ddnts NOS w/o hmrhg" AND lab.fluid = "Pleural" | mimicsql_data |
CREATE TABLE table_27638 (
"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 f/lap... | SELECT COUNT("F/Laps") FROM table_27638 WHERE "Position" = '20th' | wikisql |
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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "URGENT" AND procedures.icd9_code = "9744" | mimicsql_data |
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
HIRE_DATE date,
JOB_ID varchar(10),
SALARY decimal(8,2),
COMMISSION_PCT decimal(2,2),
MANAGER_ID decimal(6,0),
DEPARTMENT_ID decimal(... | SELECT HIRE_DATE, COUNT(HIRE_DATE) FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY COUNT(HIRE_DATE) | nvbench |
CREATE TABLE table_12164707_1 (
year VARCHAR,
mens_singles VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many years did Peter Mikkelsen win the Mens Singles?
| SELECT COUNT(year) FROM table_12164707_1 WHERE mens_singles = "Peter Mikkelsen" | sql_create_context |
CREATE TABLE Documents (
document_type_code VARCHAR,
document_id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- List the document type code for the document with the id 2.
| SELECT document_type_code FROM Documents WHERE document_id = 2 | sql_create_context |
CREATE TABLE table_204_63 (
id number,
"round" number,
"circuit" text,
"date" text,
"pole position" text,
"winning driver" text,
"winning team" text,
"trophy winner" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which winning team won t... | SELECT "winning team" FROM table_204_63 GROUP BY "winning team" ORDER BY COUNT(*) LIMIT 1 | squall |
CREATE TABLE table_name_78 (
institution VARCHAR,
location VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the institution at akron, oh?
| SELECT institution FROM table_name_78 WHERE location = "akron, oh" | sql_create_context |
CREATE TABLE table_17296 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What w... | SELECT "Score" FROM table_17296 WHERE "Location Attendance" = 'Air Canada Centre 18,067' | wikisql |
CREATE TABLE table_15472 (
"Year" real,
"Team" text,
"Chassis" text,
"Engine" text,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which year did the team receive more than 0 points?
| SELECT AVG("Year") FROM table_15472 WHERE "Points" > '0' | wikisql |
CREATE TABLE rooms (
roomid text,
roomname text,
beds number,
bedtype text,
maxoccupancy number,
baseprice number,
decor text
)
CREATE TABLE reservations (
code number,
room text,
checkin text,
checkout text,
rate number,
lastname text,
firstname text,
adults... | SELECT roomid, roomname FROM rooms ORDER BY baseprice DESC LIMIT 3 | spider |
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
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 TAB... | 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 = 'CHICAGO' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'INDIAN... | atis |
CREATE TABLE course (
course_id int,
name varchar,
department varchar,
number varchar,
credits varchar,
advisory_requirement varchar,
enforced_requirement varchar,
description varchar,
num_semesters int,
num_enrolled int,
has_discussion varchar,
has_lab varchar,
has_p... | SELECT DISTINCT advisory_requirement, enforced_requirement, name FROM course WHERE department = 'EECS' AND number = 398 | advising |
CREATE TABLE table_29895 (
"Season" real,
"LMP1 Winning Team" text,
"LMP2 Winning Driver" text,
"LMPC Winning Team" text,
"GT Winning Team" text,
"GTC Winning Team" text,
"Results" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the L... | SELECT "LMP2 Winning Driver" FROM table_29895 WHERE "LMP1 Winning Team" = 'No. 20 Oryx Dyson Racing' | wikisql |
CREATE TABLE t_kc22 (
MED_EXP_DET_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
MED_EXP_BILL_ID text,
SOC_SRT_DIRE_CD text,
SOC_SRT_DIRE_NM text,
DIRE_TYPE number,
CHA_ITEM_LEV number,
MED_INV_ITEM_TYPE text,
MED_DIRE_CD text,
MED_DIRE_NM text,... | SELECT SOC_SRT_DIRE_CD, SOC_SRT_DIRE_NM FROM t_kc22 WHERE MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc21 WHERE PERSON_ID = '75327735' AND MED_SER_ORG_NO = '3248711' AND IN_HOSP_DATE BETWEEN '2006-02-24' AND '2012-09-26') | css |
CREATE TABLE table_21107 (
"Story #" real,
"Title" text,
"Doctor" text,
"Narrator" text,
"Format" text,
"release date" text,
"Notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the release date for Destiny of the Daleks?
| SELECT "release date" FROM table_21107 WHERE "Title" = 'Destiny of the Daleks' | 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 jyjgzbb.JCZBMC, jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM jyjgzbb WHERE jyjgzbb.jybgb_JZLSH = '60506395740' AND jyjgzbb.JCRXM LIKE '陶%' | css |
CREATE TABLE table_name_5 (
result VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what game was on may 29
| SELECT result FROM table_name_5 WHERE date = "may 29" | sql_create_context |
CREATE TABLE table_14344 (
"Round" real,
"Race Title" text,
"Grand Prix" text,
"Circuit" text,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which circuit has a Race Title of japanese grand prix?
| SELECT "Circuit" FROM table_14344 WHERE "Race Title" = 'japanese grand prix' | wikisql |
CREATE TABLE Organisation_Types (
organisation_type VARCHAR(10),
organisation_type_description VARCHAR(255)
)
CREATE TABLE Project_Staff (
staff_id DOUBLE,
project_id INTEGER,
role_code VARCHAR(10),
date_from DATETIME,
date_to DATETIME,
other_details VARCHAR(255)
)
CREATE TABLE Grants ... | 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 | nvbench |
CREATE TABLE table_249512_2 (
land_area__2010_ VARCHAR,
place_name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the number of land areas that have a place name of Ballplay?
| SELECT COUNT(land_area__2010_) FROM table_249512_2 WHERE place_name = "Ballplay" | sql_create_context |
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE class_of_service (
booking_class varchar,
rank int,
class_description text
)
CREATE TABLE time_zone (
time_zone_cod... | SELECT DISTINCT ground_service.transport_type FROM airport, airport_service, city, ground_service WHERE airport.airport_code = airport_service.airport_code AND city.city_code = airport_service.city_code AND city.city_name = 'DENVER' AND ground_service.airport_code = airport.airport_code | atis |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "55" AND lab.label = "Immunoglobulin G" | mimicsql_data |
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 jybgb.JZLSH FROM jybgb WHERE jybgb.BGDH = '39027691440' | css |
CREATE TABLE representative (
Representative_ID int,
Name text,
State text,
Party text,
Lifespan text
)
CREATE TABLE election (
Election_ID int,
Representative_ID int,
Date text,
Votes real,
Vote_Percent real,
Seats real,
Place real
)
-- Using valid SQLite, answer the ... | SELECT Party, COUNT(*) FROM representative GROUP BY Party | nvbench |
CREATE TABLE table_name_92 (
game VARCHAR,
february VARCHAR,
record VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many games have a February larger than 11, and a Record of 23-7-8?
| SELECT COUNT(game) FROM table_name_92 WHERE february > 11 AND record = "23-7-8" | sql_create_context |
CREATE TABLE days (
days_code varchar,
day_name varchar
)
CREATE TABLE date_day (
month_number int,
day_number int,
year int,
day_name varchar
)
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt int
)
CREATE TABLE flight_leg (
flight_id int,
... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'WASHINGTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SA... | atis |
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 demographic.dob FROM demographic WHERE demographic.name = "Edward Schafer" | mimicsql_data |
CREATE TABLE table_73328 (
"Year" real,
"Division" real,
"League" text,
"Reg. Season" text,
"Playoffs" text,
"National Open" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the regular season name where they did not qualify for the playo... | SELECT "Reg. Season" FROM table_73328 WHERE "Playoffs" = 'Did not qualify' AND "Year" = '2009' | wikisql |
CREATE TABLE table_name_38 (
cuts_made INTEGER,
top_10 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many average cuts made when 11 is the Top-10?
| SELECT AVG(cuts_made) FROM table_name_38 WHERE top_10 = 11 | sql_create_context |
CREATE TABLE party (
Party_ID int,
Year real,
Party text,
Governor text,
Lieutenant_Governor text,
Comptroller text,
Attorney_General text,
US_Senate text
)
CREATE TABLE election (
Election_ID int,
Counties_Represented text,
District int,
Delegate text,
Party int,
... | SELECT Governor, COUNT(Governor) FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID WHERE T1.District = 1 GROUP BY Governor ORDER BY COUNT(Governor) | nvbench |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,... | SELECT t4.diagnosisname FROM (SELECT t3.diagnosisname, DENSE_RANK() OVER (ORDER BY t3.c1 DESC) AS c2 FROM (SELECT t2.diagnosisname, 100 - SUM(CASE WHEN patient.hospitaldischargestatus = 'alive' THEN 1 WHEN STRFTIME('%j', patient.hospitaldischargetime) - STRFTIME('%j', t2.diagnosistime) > 4 * 365 THEN 1 ELSE 0 END) * 10... | eicu |
CREATE TABLE table_39008 (
"Outcome" text,
"Date" text,
"Tournament" text,
"Surface" text,
"Partner" text,
"Opponents in the final" text,
"Score" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the score on 3 may 2009?
| SELECT "Score" FROM table_39008 WHERE "Date" = '3 may 2009' | wikisql |
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE VoteTypes (
Id number,
Name text... | SELECT COUNT(Title) FROM Posts WHERE Posts.CreationDate BETWEEN '2013-03-01 00:00:00' AND '2017-12-31 23:59:59' AND Posts.PostTypeId = 1 | sede |
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 SUM(t_kc24.PER_ACC_PAY) FROM t_kc21 JOIN t_kc24 JOIN t_kc21_t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc24.MED_CLINIC_ID AND t_kc21_t_kc24.MED_SAFE_PAY_ID = t_kc24.MED_SAFE_PAY_ID WHERE t_kc21.PERSON_NM = '邹学博' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2010-04-09' AND '2014-05-05' | css |
CREATE TABLE table_name_17 (
skip VARCHAR,
lead VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which skip's lead is Gordon McDougall?
| SELECT skip FROM table_name_17 WHERE lead = "gordon mcdougall" | sql_create_context |
CREATE TABLE table_14733 (
"Year" real,
"Men's singles" text,
"Women's singles" text,
"Men's doubles" text,
"Women's doubles" text,
"Mixed doubles" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the highest year for dipu ghosh raman ghosh, ... | SELECT MAX("Year") FROM table_14733 WHERE "Men's doubles" = 'dipu ghosh raman ghosh' AND "Women's doubles" = 'sarojini gogte sunila apte' | wikisql |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
CREATE TABLE jyjgzbb (
BGDH text,
BGRQ time,
CKZFWDX text,
CKZFWSX number,
CKZFWXX number,
JCFF text,
JCRGH text,
JCRXM text,
JCXMMC text,
JCZBDM text,
JCZBJGDL number,
JCZBJGDW text,
... | SELECT zyjzjlb.CYKSDM, zyjzjlb.CYKSMC FROM zyjzjlb WHERE zyjzjlb.JZLSH = '57012186438' | css |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid numb... | SELECT microlab.culturesite FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-22988')) AND STRFTIME('%y-%m', microlab.culturetakentime) = '2102-... | eicu |
CREATE TABLE table_19811 (
"Software" text,
"Version" text,
"Operating systems" text,
"Developer" text,
"License" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many licenses have mind workstation software?
| SELECT COUNT("License") FROM table_19811 WHERE "Software" = 'Mind WorkStation' | 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 diagnoses (
... | SELECT MAX(demographic.age) FROM demographic WHERE demographic.admission_type = "EMERGENCY" AND demographic.dod_year < "2183.0" | mimicsql_data |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.drug = "Aloe Vesta 2-n-1 Skin Cond" | mimicsql_data |
CREATE TABLE table_52231 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- On what date was the attendance of the crowd 78,431?
| SELECT "Date" FROM table_52231 WHERE "Attendance" = '78,431' | wikisql |
CREATE TABLE Student_Course_Enrolment (
registration_id INTEGER,
student_id INTEGER,
course_id INTEGER,
date_of_enrolment DATETIME,
date_of_completion DATETIME
)
CREATE TABLE Courses (
course_id INTEGER,
author_id INTEGER,
subject_id INTEGER,
course_name VARCHAR(120),
course_des... | SELECT subject_name, COUNT(*) FROM Courses AS T1 JOIN Subjects AS T2 ON T1.subject_id = T2.subject_id GROUP BY T1.subject_id ORDER BY COUNT(*) | nvbench |
CREATE TABLE table_name_1 (
byes VARCHAR,
draws VARCHAR,
against VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total number of byes that has 1 draw and an against of 1374?
| SELECT COUNT(byes) FROM table_name_1 WHERE draws = 1 AND against = 1374 | sql_create_context |
CREATE TABLE table_name_52 (
week INTEGER,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Week has a Date of october 4, 1992?
| SELECT MAX(week) FROM table_name_52 WHERE date = "october 4, 1992" | sql_create_context |
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
... | SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT procedures_icd.icd9_code FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 40967) ORDER BY procedures_icd.charttime DESC LIMIT 1) | mimic_iii |
CREATE TABLE table_56923 (
"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 highest rank when the bronze is less than 1 and the total is less than 1?
| SELECT MAX("Rank") FROM table_56923 WHERE "Bronze" < '1' AND "Total" < '1' | wikisql |
CREATE TABLE table_37437 (
"Race" text,
"Length" text,
"Class" text,
"Circuit" text,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which circuit was held on May 7 for 1 hour?
| SELECT "Circuit" FROM table_37437 WHERE "Date" = 'may 7' AND "Length" = '1 hour' | wikisql |
CREATE TABLE table_2553861_1 (
year VARCHAR,
open_cup VARCHAR,
playoffs VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the year for open cup did not qualify and national final
| SELECT COUNT(year) FROM table_2553861_1 WHERE open_cup = "Did not qualify" AND playoffs = "National Final" | sql_create_context |
CREATE TABLE table_23261 (
"Institution" text,
"Location" text,
"Nickname" text,
"Founded" real,
"Type" text,
"Enrollment" real,
"Primary Conference" text,
"LEC Sport" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's Fitchburg State... | SELECT "LEC Sport" FROM table_23261 WHERE "Institution" = 'Fitchburg State University' | wikisql |
CREATE TABLE table_17063 (
"Player" text,
"Position" text,
"School" text,
"Hometown" text,
"College" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the postion of the player listed from Dooly County High School?
| SELECT "Position" FROM table_17063 WHERE "School" = 'Dooly County High School' | wikisql |
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE d_labitems (
row_id ... | SELECT COUNT(*) FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 11688)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'void' AND d_items.... | mimic_iii |
CREATE TABLE table_24910733_1 (
directed_by VARCHAR,
written_by VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the director when the writter is Andrea Newman?
| SELECT directed_by FROM table_24910733_1 WHERE written_by = "Andrea Newman" | 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 prescription... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.marital_status = "MARRIED" AND lab.itemid = "50883" | mimicsql_data |
CREATE TABLE table_name_73 (
laps VARCHAR,
time_retired VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many laps were there when the Time/Retired was +1:00.003?
| SELECT laps FROM table_name_73 WHERE time_retired = "+1:00.003" | sql_create_context |
CREATE TABLE branch (
Branch_ID int,
Name text,
Open_year text,
Address_road text,
City text,
membership_amount text
)
CREATE TABLE membership_register_branch (
Member_ID int,
Branch_ID text,
Register_Year text
)
CREATE TABLE member (
Member_ID int,
Card_Number text,
Na... | SELECT Hometown, COUNT(Hometown) FROM member GROUP BY Hometown ORDER BY COUNT(Hometown) | nvbench |
CREATE TABLE table_name_74 (
station VARCHAR,
channel_tv___dt__ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which station has channel TV (DT) of 3 (26)?
| SELECT station FROM table_name_74 WHERE channel_tv___dt__ = "3 (26)" | sql_create_context |
CREATE TABLE course_offering (
offering_id int,
course_id int,
semester int,
section_number int,
start_time time,
end_time time,
monday varchar,
tuesday varchar,
wednesday varchar,
thursday varchar,
friday varchar,
saturday varchar,
sunday varchar,
has_final_proje... | SELECT DISTINCT instructor.name FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN offering_instructor ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN instructor ON offering_instructor.instructor_id = instructor.instructor_id INNER JOIN program_... | advising |
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 jyjgzbb.JCRGH, jyjgzbb.JCRXM 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 ... | css |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE treatment (
... | SELECT COUNT(*) > 0 FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '033-3009')) AND vitalperiodic.temperature > 37.1 AND NOT vitalperiod... | eicu |
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
... | SELECT prescriptions.dose_val_rx FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 56829) AND prescriptions.drug = 'heparin sodium' AND STRFTIME('%y-%m', prescriptions.startdate) <= '2105-11' ORDER BY prescriptions.startdate DESC LIMIT 1 | mimic_iii |
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_Games, ACC_Percent FROM basketball_match ORDER BY All_Games | nvbench |
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
last_wardid number,
intime time,
outtime time
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
... | SELECT SUM(outputevents.value) FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 44625)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'uri... | mimic_iii |
CREATE TABLE table_46810 (
"Event" text,
"Date" text,
"Rating" text,
"Share" text,
"Viewers" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Rating, when Event is Johnson Vs. Dodson?
| SELECT "Rating" FROM table_46810 WHERE "Event" = 'johnson vs. dodson' | wikisql |
CREATE TABLE Claims (
Claim_ID INTEGER,
Policy_ID INTEGER,
Date_Claim_Made DATE,
Date_Claim_Settled DATE,
Amount_Claimed INTEGER,
Amount_Settled INTEGER
)
CREATE TABLE Payments (
Payment_ID INTEGER,
Settlement_ID INTEGER,
Payment_Method_Code VARCHAR(255),
Date_Payment_Made DATE,... | SELECT Date_Payment_Made, SUM(Amount_Payment) FROM Payments WHERE Payment_Method_Code = 'Visa' | nvbench |
CREATE TABLE table_204_160 (
id number,
"rank" number,
"name" text,
"nationality" text,
"time" text,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- the top 3 runners were from what country ?
| SELECT "nationality" FROM table_204_160 WHERE id <= 3 | squall |
CREATE TABLE table_54084 (
"D 39 \u221a" text,
"D 40 \u221a" text,
"D 41 \u221a" text,
"D 42 \u221a" text,
"D 43 \u221a" text,
"D 44 \u221a" text,
"D 45 \u221a" text,
"D 46 \u221a" text,
"D 47 \u221a" text,
"D 48 \u221a" text
)
-- Using valid SQLite, answer the following questi... | SELECT "D 42 \u221a" FROM table_54084 WHERE "D 43 \u221a" = 'r 5' | wikisql |
CREATE TABLE table_25200461_9 (
population INTEGER,
registered_voters VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- If the registered voters is 66.8%, what is the minimum population?
| SELECT MIN(population) FROM table_25200461_9 WHERE registered_voters = "66.8%" | sql_create_context |
CREATE TABLE table_59951 (
"Rank" real,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How much gold does the tank have that has 3 silver and more than 3 bronze?
| SELECT COUNT("Gold") FROM table_59951 WHERE "Silver" = '3' AND "Bronze" > '3' | wikisql |
CREATE TABLE table_78705 (
"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,
"2004" text,
"2005" text
)
-- Using valid SQLite, answer... | SELECT "1998" FROM table_78705 WHERE "1997" = '3r' AND "1992" = 'a' | wikisql |
CREATE TABLE device (
Device_ID int,
Device text,
Carrier text,
Package_Version text,
Applications text,
Software_Platform text
)
CREATE TABLE shop (
Shop_ID int,
Shop_Name text,
Location text,
Open_Date text,
Open_Year int
)
CREATE TABLE stock (
Shop_ID int,
Device... | SELECT Location, COUNT(Location) FROM shop GROUP BY Location ORDER BY COUNT(Location) | nvbench |
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 demographic ... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Medicaid" AND procedures.long_title = "Transplant from live non-related donor" | mimicsql_data |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.