instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "BLACK/AFRICAN AMERICAN" AND demographic.admityear < "2178" | mimicsql_data |
CREATE TABLE table_name_78 (
nationality VARCHAR,
heat VARCHAR,
lane VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What nation started in lane 3 of heat 2?
| SELECT nationality FROM table_name_78 WHERE heat = 2 AND lane = 3 | sql_create_context |
CREATE TABLE person_info (
CSD text,
CSRQ time,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
MZDM text,
MZMC text,
RYBH text,
XBDM number,
XBMC text,
XLDM text,
XLMC text,
XM text,
ZYLBDM text,
ZYMC text
)
CREATE TABLE zyjzjlb (
CYBQDM text,
CYBQMC... | SELECT * FROM hz_info JOIN zyjzjlb ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE hz_info.RYBH = '30218340' AND hz_info.YLJGDM = '0208580' AND NOT zyjzjlb.JZKSMC LIKE '%医学科%' | css |
CREATE TABLE table_name_22 (
total__kg_ INTEGER,
bodyweight VARCHAR,
snatch VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total for the person with 73.28 bodyweight and fewer snatches than 75?
| SELECT AVG(total__kg_) FROM table_name_22 WHERE bodyweight = 73.28 AND snatch < 75 | sql_create_context |
CREATE TABLE table_51806 (
"Round" real,
"Player" text,
"Position" text,
"Nationality" text,
"College/Junior/Club Team (League)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the nationality for d
| SELECT "Nationality" FROM table_51806 WHERE "Position" = 'd' | wikisql |
CREATE TABLE table_69046 (
"Round" real,
"Pick #" real,
"Overall" real,
"Name" text,
"Position" text,
"College" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest Pick # for the College of Maryland-Eastern Shore?
| SELECT MAX("Pick #") FROM table_69046 WHERE "College" = 'maryland-eastern shore' | wikisql |
CREATE TABLE table_23050383_1 (
ict VARCHAR,
education VARCHAR,
ki VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the ICT when education is 1.73 and KI is ag 1.99?
| SELECT ict FROM table_23050383_1 WHERE education = "1.73" AND ki = "1.99" | sql_create_context |
CREATE TABLE table_69275 (
"Date" text,
"Visiting Team" text,
"Final Score" text,
"Host Team" text,
"Stadium" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the final score of the game at the astrodome?
| SELECT "Final Score" FROM table_69275 WHERE "Stadium" = 'astrodome' | wikisql |
CREATE TABLE table_1801 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Results" text,
"Candidates" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who were all the candidates in elections in which Steve Chabot was a can... | SELECT "Candidates" FROM table_1801 WHERE "Incumbent" = 'Steve Chabot' | wikisql |
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 vitalperiodi... | SELECT COUNT(*) > 0 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '021-32860')) AND DATETIME(treatment.treatmenttime, 'start of year') = DATETI... | eicu |
CREATE TABLE Organisations (
organisation_id INTEGER,
organisation_type VARCHAR(10),
organisation_details VARCHAR(255)
)
CREATE TABLE Projects (
project_id INTEGER,
organisation_id INTEGER,
project_details VARCHAR(255)
)
CREATE TABLE Organisation_Types (
organisation_type VARCHAR(10),
... | SELECT organisation_details, COUNT(organisation_details) FROM Grants AS T1 JOIN Organisations AS T2 ON T1.organisation_id = T2.organisation_id GROUP BY organisation_details ORDER BY organisation_details | nvbench |
CREATE TABLE zyjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
HZXM text,
JZKSDM text,
JZKSMC text,
JZLSH text,
KH text,
KLX number,
MZBMLX number,
MZJZLSH text,
MZZDBM text,
MZZDMC text,
MZZYZDZZBM... | SELECT * FROM hz_info JOIN zyjzjlb ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE hz_info.person_info_XM = '任阳舒' AND hz_info.YLJGDM = '1623012' AND NOT zyjzjlb.CYKSMC LIKE '%中医%' | css |
CREATE TABLE table_16401 (
"Pick #" real,
"CFL Team" text,
"Player" text,
"Position" text,
"College" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many fb players were drafted?
| SELECT COUNT("Pick #") FROM table_16401 WHERE "Position" = 'FB' | wikisql |
CREATE TABLE table_17195 (
"Unit" text,
"Commander" text,
"Complement" text,
"Killed" text,
"Wounded" text,
"Missing" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What were the wounded for complement of 46 off 656 men?
| SELECT "Wounded" FROM table_17195 WHERE "Complement" = '46 off 656 men' | wikisql |
CREATE TABLE table_43415 (
"Date" text,
"Result" text,
"Score" text,
"Brazil scorers" text,
"Competition" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who were the Brazil scorers who scored 3-3?
| SELECT "Brazil scorers" FROM table_43415 WHERE "Score" = '3-3' | wikisql |
CREATE TABLE table_8897 (
"Heat" real,
"Lane" real,
"Name" text,
"Country" text,
"Mark" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average heat that has 52.83 sb mark and lane less than 4?
| SELECT AVG("Heat") FROM table_8897 WHERE "Mark" = '52.83 sb' AND "Lane" < '4' | wikisql |
CREATE TABLE table_204_93 (
id number,
"round" number,
"pick" number,
"player" text,
"position" text,
"nationality" text,
"team" text,
"college" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- number of picks the st. louis hawks made in t... | SELECT COUNT("player") FROM table_204_93 WHERE "team" = 'st. louis hawks' | squall |
CREATE TABLE table_name_15 (
first_elected VARCHAR,
incumbent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which First elected has a Incumbent of none (new seat)?
| SELECT first_elected FROM table_name_15 WHERE incumbent = "none (new seat)" | sql_create_context |
CREATE TABLE table_25507 (
"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.
-- Name t... | SELECT "Score" FROM table_25507 WHERE "Location Attendance" = 'Madison Square Garden 18,828' | wikisql |
CREATE TABLE table_17002 (
"Season" real,
"Position" real,
"Win/Loss" text,
"Coach" text,
"Captain" text,
"Dudley Tuckey Medal" text,
"Leading goalkicker" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who is the captain where coach is geoff... | SELECT "Captain" FROM table_17002 WHERE "Coach" = 'Geoff Miles' | wikisql |
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 DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'treatment' AND cost.eventid IN (SELECT treatment.treatmentid FROM treatment WHERE treatment.treatmentname = 'glucose - d50') | eicu |
CREATE TABLE table_name_92 (
year_s__of_manufacture VARCHAR,
axle_arrangement VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Year(s) of manufacture has an Axle arrangement of 2 b n2?
| SELECT year_s__of_manufacture FROM table_name_92 WHERE axle_arrangement = "2′b n2" | sql_create_context |
CREATE TABLE table_16592 (
"Finishing position" text,
"Points awarded (Platinum)" real,
"Points awarded (Gold)" real,
"Points awarded (Silver)" real,
"Points awarded (Satellite)" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many platinum point... | SELECT MAX("Points awarded (Platinum)") FROM table_16592 WHERE "Finishing position" = '5th' | wikisql |
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.
-- What is the average age for... | SELECT job, AVG(age) FROM Person WHERE gender = 'male' GROUP BY job ORDER BY job DESC | nvbench |
CREATE TABLE table_name_88 (
enrollment INTEGER,
ihsaa_class VARCHAR,
mascot VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the most enrolled having the dragons for a mascot and an AAA for the IHSAA Class?
| SELECT MAX(enrollment) FROM table_name_88 WHERE ihsaa_class = "aaa" AND mascot = "dragons" | 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 d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
... | SELECT prescriptions.startdate FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 26195 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1) AND prescriptions.drug = 'amikacin' ORDER BY prescriptions.startdate DESC LIMIT... | mimic_iii |
CREATE TABLE table_54522 (
"Species" text,
"Strain" text,
"Type" text,
"Base Pairs" real,
"Genes" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest number of genes with less than 927,303 base pairs in Acidobacteria Bacterium?
| SELECT MIN("Genes") FROM table_54522 WHERE "Base Pairs" < '927,303' AND "Species" = 'acidobacteria bacterium' | wikisql |
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
... | SELECT HIRE_DATE, SALARY FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) | nvbench |
CREATE TABLE Invoice_Line_Items (
order_item_id INTEGER,
invoice_number INTEGER,
product_id INTEGER,
product_title VARCHAR(80),
product_quantity VARCHAR(50),
product_price DECIMAL(19,4),
derived_product_cost DECIMAL(19,4),
derived_vat_payable DECIMAL(19,4),
derived_total_cost DECIMAL... | SELECT order_id, COUNT(*) FROM Order_Items GROUP BY order_id | nvbench |
CREATE TABLE table_3409 (
"No." real,
"#" real,
"Episode" text,
"Writer" text,
"Director" text,
"Original air date" text,
"Viewing figure" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What episode number of the season did Tony Basgallop wr... | SELECT MIN("#") FROM table_3409 WHERE "Writer" = 'Tony Basgallop' | wikisql |
CREATE TABLE table_48710 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total attendance in a week less than 5 when the result was l 24-20?
| SELECT COUNT("Attendance") FROM table_48710 WHERE "Result" = 'l 24-20' AND "Week" < '5' | wikisql |
CREATE TABLE table_30654 (
"#" real,
"Stadium" text,
"Capacity" real,
"Opened" text,
"City / Town" text,
"Home team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What stadium does FK Rudar play in?
| SELECT "Stadium" FROM table_30654 WHERE "Home team" = 'FK Rudar' | wikisql |
CREATE TABLE table_204_902 (
id number,
"rank" number,
"name" text,
"nationality" text,
"time" text,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who was from the same country as stowers ?
| SELECT "name" FROM table_204_902 WHERE "name" <> 'julia stowers' AND "nationality" = (SELECT "nationality" FROM table_204_902 WHERE "name" = 'julia stowers') | squall |
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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "DMI neuro nt st uncntrld" AND prescriptions.drug_type = "MAIN" | mimicsql_data |
CREATE TABLE table_1184344_1 (
cr_no VARCHAR,
l INTEGER,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the maximum l&cr number for archimedes?
| SELECT MAX(l) & cr_no FROM table_1184344_1 WHERE name = "Archimedes" | sql_create_context |
CREATE TABLE table_79610 (
"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 most bronze can be when silver is larger than 2, and the nation is germany, and ... | SELECT MAX("Bronze") FROM table_79610 WHERE "Silver" > '2' AND "Nation" = 'germany' AND "Gold" > '8' | wikisql |
CREATE TABLE table_name_63 (
date VARCHAR,
week VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the date for HOF week?
| SELECT date FROM table_name_63 WHERE week = "hof" | sql_create_context |
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId number,
PostId number,
SuggestedEditId number,
CompletedByReviewTaskId number
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId ... | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation, Location FROM Users WHERE LOWER(Location) LIKE '%kochi%' OR UPPER(Location) LIKE '%KOCHI%' OR Location LIKE '%kochi%' ORDER BY Reputation DESC LIMIT 35 | sede |
CREATE TABLE table_name_13 (
location VARCHAR,
year VARCHAR,
runner_up VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Where in 1985 was tim mayotte runner up?
| SELECT location FROM table_name_13 WHERE year > 1985 AND runner_up = "tim mayotte" | sql_create_context |
CREATE TABLE table_37883 (
"States" text,
"Fall 05" real,
"Fall 06" real,
"Fall 07" real,
"Fall 08" real,
"Fall 09" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What number is Fall 06 from the state with 79 or less in Fall 08, 36 or greater in... | SELECT AVG("Fall 06") FROM table_37883 WHERE "Fall 08" < '79' AND "Fall 07" > '36' AND "Fall 05" > '74' | wikisql |
CREATE TABLE table_50745 (
"Region" text,
"Date" text,
"Label" text,
"Format" text,
"Catalog" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Catalog of the RCA release?
| SELECT "Catalog" FROM table_50745 WHERE "Label" = 'rca' | 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 JZZTDM, JZZTMC FROM mzjzjlb WHERE JZLSH = '48598074227' | css |
CREATE TABLE table_7059 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Leading scorer" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the home of the team with Carlos Boozer (27) as the leading scorer?
| SELECT "Home" FROM table_7059 WHERE "Leading scorer" = 'carlos boozer (27)' | wikisql |
CREATE TABLE table_69390 (
"Year" text,
"Champion" text,
"Runner-Up" text,
"3rd Place" text,
"Location" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the champion for 3rd place tbc and runner-up tbc
| SELECT "Champion" FROM table_69390 WHERE "3rd Place" = 'tbc' AND "Runner-Up" = 'tbc' | wikisql |
CREATE TABLE table_name_25 (
to_par VARCHAR,
score VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is To Par, when Score is '66', and when Player is 'Brad Faxon'?
| SELECT to_par FROM table_name_25 WHERE score = 66 AND player = "brad faxon" | sql_create_context |
CREATE TABLE table_name_70 (
chassis VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is shown for Chassis for the year of 2007?
| SELECT chassis FROM table_name_70 WHERE year = 2007 | sql_create_context |
CREATE TABLE table_19639 (
"Position" real,
"Race number" text,
"Sail number" text,
"Yacht" text,
"State/country" text,
"Yacht type" text,
"LOA (Metres)" text,
"Skipper" text,
"Elapsed time d:hh:mm:ss" text
)
-- Using valid SQLite, answer the following questions for the tables prov... | SELECT "Elapsed time d:hh:mm:ss" FROM table_19639 WHERE "Yacht type" = 'Reichel Pugh 55' | wikisql |
CREATE TABLE flight (
flno number(4,0),
origin varchar2(20),
destination varchar2(20),
distance number(6,0),
departure_date date,
arrival_date date,
price number(7,2),
aid number(9,0)
)
CREATE TABLE certificate (
eid number(9,0),
aid number(9,0)
)
CREATE TABLE aircraft (
ai... | SELECT destination, COUNT(*) FROM flight GROUP BY destination ORDER BY destination DESC | nvbench |
CREATE TABLE event (
ID int,
Name text,
Stadium_ID int,
Year text
)
CREATE TABLE stadium (
ID int,
name text,
Capacity int,
City text,
Country text,
Opening_year int
)
CREATE TABLE record (
ID int,
Result text,
Swimmer_ID int,
Event_ID int
)
CREATE TABLE swimme... | SELECT Nationality, COUNT(Nationality) FROM swimmer GROUP BY Nationality ORDER BY Nationality | nvbench |
CREATE TABLE table_name_11 (
venue VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Venue of the Competition with a Score of 4-1?
| SELECT venue FROM table_name_11 WHERE score = "4-1" | sql_create_context |
CREATE TABLE table_name_13 (
date VARCHAR,
game_site VARCHAR,
week VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which date has rich stadium as the game site for week 1?
| SELECT date FROM table_name_13 WHERE game_site = "rich stadium" AND week = 1 | sql_create_context |
CREATE TABLE jybgb (
YLJGDM text,
YLJGDM_MZJZJLB text,
YLJGDM_ZYJZJLB text,
BGDH text,
BGRQ time,
JYLX number,
JZLSH text,
JZLSH_MZJZJLB text,
JZLSH_ZYJZJLB text,
JZLX number,
KSBM text,
KSMC text,
SQRGH text,
SQRXM text,
BGRGH text,
BGRXM text,
SHRGH ... | (SELECT mzjzjlb.YLJGDM FROM person_info JOIN hz_info JOIN mzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE person_info.XM = '韩依然') UNION (SELECT zyjzjlb.YLJGDM FROM person_info JOIN hz_info JOIN zyjzjlb ON person_info.RYBH = h... | css |
CREATE TABLE table_43216 (
"Player" text,
"Country" text,
"Year(s) won" text,
"Total" real,
"To par" text,
"Finish" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the finish with a total larger than 286, a to par of +4 and Bob Tway play... | SELECT "Finish" FROM table_43216 WHERE "Total" > '286' AND "To par" = '+4' AND "Player" = 'bob tway' | wikisql |
CREATE TABLE table_name_54 (
pick VARCHAR,
position VARCHAR,
team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the pick for the New York jets with a defensive end?
| SELECT pick FROM table_name_54 WHERE position = "defensive end" AND team = "new york jets" | sql_create_context |
CREATE TABLE member (
member_id number,
name text,
country text,
college_id number
)
CREATE TABLE college (
college_id number,
name text,
leader_name text,
college_location text
)
CREATE TABLE round (
round_id number,
member_id number,
decoration_theme text,
rank_in_rou... | SELECT name FROM member WHERE country = "United States" OR country = "Canada" | spider |
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 demographic.dob, procedures.short_title FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.name = "Jerry Deberry" | mimicsql_data |
CREATE TABLE Courses (
course_id INTEGER,
author_id INTEGER,
subject_id INTEGER,
course_name VARCHAR(120),
course_description VARCHAR(255)
)
CREATE TABLE Course_Authors_and_Tutors (
author_id INTEGER,
author_tutor_ATB VARCHAR(3),
login_name VARCHAR(40),
password VARCHAR(40),
per... | SELECT date_of_completion, COUNT(date_of_completion) FROM Student_Course_Enrolment AS T1 JOIN Student_Tests_Taken AS T2 ON T1.registration_id = T2.registration_id WHERE T2.test_result = "Fail" ORDER BY COUNT(date_of_completion) DESC | nvbench |
CREATE TABLE table_75530 (
"Date" text,
"Home" text,
"Score" text,
"Visitor" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the score on April 25?
| SELECT "Score" FROM table_75530 WHERE "Date" = 'april 25' | wikisql |
CREATE TABLE table_name_66 (
score VARCHAR,
record VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which score has a Record of 48-55?
| SELECT score FROM table_name_66 WHERE record = "48-55" | sql_create_context |
CREATE TABLE table_18416 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- To which party does Frank T. Bow belong?
| SELECT "Party" FROM table_18416 WHERE "Incumbent" = 'Frank T. Bow' | wikisql |
CREATE TABLE paper (
paperid int,
title varchar,
venueid int,
year int,
numciting int,
numcitedby int,
journalid int
)
CREATE TABLE field (
fieldid int
)
CREATE TABLE keyphrase (
keyphraseid int,
keyphrasename varchar
)
CREATE TABLE journal (
journalid int,
journalname... | SELECT DISTINCT COUNT(writes.paperid) FROM author, paper, writes WHERE author.authorname = 'Noah Smith' AND paper.year = 2010 AND writes.authorid = author.authorid AND writes.paperid = paper.paperid | scholar |
CREATE TABLE table_26198709_1 (
written_by VARCHAR,
us_viewers__million_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who wrote the episode with 18.07 million viewers?
| SELECT written_by FROM table_26198709_1 WHERE us_viewers__million_ = "18.07" | sql_create_context |
CREATE TABLE player (
player_id number,
player text,
team text,
age number,
position text,
school_id number
)
CREATE TABLE school_performance (
school_id number,
school_year text,
class_a text,
class_aa text
)
CREATE TABLE school_details (
school_id number,
nickname tex... | SELECT location FROM school WHERE NOT school_id IN (SELECT school_id FROM player) | spider |
CREATE TABLE party (
minister VARCHAR,
left_office VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Return the minister who left office at the latest time.
| SELECT minister FROM party ORDER BY left_office DESC LIMIT 1 | sql_create_context |
CREATE TABLE table_58199 (
"Character" text,
"Portrayed by" text,
"Crime" text,
"First appearance" text,
"Last appearance" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which character is portrayed by Elias Koteas?
| SELECT "Character" FROM table_58199 WHERE "Portrayed by" = 'elias koteas' | wikisql |
CREATE TABLE table_58003 (
"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.
-- Which ... | SELECT "Team" FROM table_58003 WHERE "High assists" = 'earl watson (6)' AND "Date" = 'january 19' | wikisql |
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
discharge_location text,
insurance text,
lan... | SELECT diagnoses_icd.charttime FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'liver transplant status') AND diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 30296) AND STRFTIM... | mimic_iii |
CREATE TABLE table_name_69 (
to_par VARCHAR,
country VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is South Korea's to par value?
| SELECT to_par FROM table_name_69 WHERE country = "south korea" | sql_create_context |
CREATE TABLE table_75383 (
"Polling Firm" text,
"Date" text,
"PSD - PC" text,
"UDMR" text,
"Elena B\u0103sescu" text,
"Others" text,
"Undecided" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What date has the others of 2%?
| SELECT "Date" FROM table_75383 WHERE "Others" = '2%' | wikisql |
CREATE TABLE table_204_373 (
id number,
"wager" text,
"winner" text,
"loser" text,
"location" text,
"date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many times did mocho cota lose to chamaco valaguez ?
| SELECT COUNT(*) FROM table_204_373 WHERE "loser" = 'mocho cota' AND "winner" = 'chamaco valaguez' | squall |
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
-- Using valid SQLite, answer the following questions for the... | SELECT T1.Name, T1.Manufacturer FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY T1.Name DESC | nvbench |
CREATE TABLE 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 prescriptions.formulary_drug_cd FROM prescriptions WHERE prescriptions.drug = "Doxazosin" | mimicsql_data |
CREATE TABLE table_10798928_1 (
director VARCHAR,
film_title_used_in_nomination VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many directors were there for the film Course Completed?
| SELECT COUNT(director) FROM table_10798928_1 WHERE film_title_used_in_nomination = "Course Completed" | sql_create_context |
CREATE TABLE table_1996 (
"Rank" real,
"London Borough" text,
"Black African Population" real,
"Black Caribbean Population" real,
"Other Black Population" real,
"Total Black Population" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the ... | SELECT MAX("Black Caribbean Population") FROM table_1996 WHERE "Other Black Population" = '2243' | wikisql |
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
Rejectio... | SELECT Id FROM Posts AS a WHERE EXISTS(SELECT 1 FROM Posts WHERE ParentId = a.Id AND OwnerUserId = 58974) AND EXISTS(SELECT 1 FROM Posts WHERE ParentId = a.Id AND OwnerUserId = 42545) | sede |
CREATE TABLE table_1590652_4 (
date VARCHAR,
winning_score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the date of winning score being 67-67-63=197
| SELECT date FROM table_1590652_4 WHERE winning_score = 67 - 67 - 63 = 197 | sql_create_context |
CREATE TABLE table_name_20 (
player VARCHAR,
hometown VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who's from Bay City, TX?
| SELECT player FROM table_name_20 WHERE hometown = "bay city, tx" | sql_create_context |
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE course_tags_count (
course_id int,
clear_grading int,
pop_quiz int,
group_projects int,
inspirational int,
long_lectures int,
extra_credit int,
few_tests int,
good_feedback int,
tough_... | SELECT DISTINCT COURSEalias0.department, COURSEalias0.name, COURSEalias0.number, SEMESTERalias0.semester FROM (SELECT course_id FROM student_record WHERE earn_credit = 'Y' AND student_id = 1) AS DERIVED_TABLEalias0, course AS COURSEalias0, course_offering AS COURSE_OFFERINGalias0, semester AS SEMESTERalias0 WHERE COURS... | advising |
CREATE TABLE table_name_4 (
games INTEGER,
rank VARCHAR,
rebounds VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How few games are there for a rank more than 1 and more than 212 rebounds?
| SELECT MIN(games) FROM table_name_4 WHERE rank > 1 AND rebounds > 212 | sql_create_context |
CREATE TABLE table_19853 (
"Category" text,
"Type" text,
"Attribute" text,
"Description" text,
"Bubbles" text,
"Cancelable" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many descriptions are there when the attribute is 'ondragstart'?
| SELECT COUNT("Description") FROM table_19853 WHERE "Attribute" = 'ondragstart' | wikisql |
CREATE TABLE table_22854436_1 (
population__2002_census_data_ INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the most population 2002
| SELECT MAX(population__2002_census_data_) FROM table_22854436_1 | sql_create_context |
CREATE TABLE city (
city VARCHAR,
GDP VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which city has the lowest GDP? Please list the city name and its GDP.
| SELECT city, GDP FROM city ORDER BY GDP LIMIT 1 | sql_create_context |
CREATE TABLE table_2380 (
"Year (Ceremony)" text,
"Film title used in nomination" text,
"Original title" text,
"Director" text,
"Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the total number of results for octubre
| SELECT COUNT("Result") FROM table_2380 WHERE "Original title" = 'Octubre' | wikisql |
CREATE TABLE table_name_45 (
frequency_mhz VARCHAR,
call_sign VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What frequency has call sign w228bg?
| SELECT frequency_mhz FROM table_name_45 WHERE call_sign = "w228bg" | sql_create_context |
CREATE TABLE table_42541 (
"Result" text,
"Opponent" text,
"Type" text,
"Round" text,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When has a Type of tko, and a Round of 1 (6)
| SELECT "Date" FROM table_42541 WHERE "Type" = 'tko' AND "Round" = '1 (6)' | wikisql |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
CREATE TABLE person_info (
CSD text,
CSRQ time,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
MZDM text,
MZMC text,
RYBH text,
XBDM number,
XBMC text,
XLDM text,
XLMC text,
XM text... | SELECT * FROM person_info JOIN hz_info JOIN zzmzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX AND zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jy... | css |
CREATE TABLE t_kc24 (
ACCOUNT_DASH_DATE time,
ACCOUNT_DASH_FLG number,
CASH_PAY number,
CIVIL_SUBSIDY number,
CKC102 number,
CLINIC_ID text,
CLINIC_SLT_DATE time,
COMP_ID text,
COM_ACC_PAY number,
COM_PAY number,
DATA_ID text,
ENT_ACC_PAY number,
ENT_PAY number,
F... | SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc21 JOIN t_kc22 JOIN t_kc21_t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc22.MED_CLINIC_ID AND t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID WHERE t_kc21.IN_DIAG_DIS_CD = 'L27.784' | css |
CREATE TABLE table_42449 (
"Year" real,
"Title" text,
"Producer" text,
"Actor" text,
"Role" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What role was played in 2007?
| SELECT "Role" FROM table_42449 WHERE "Year" = '2007' | wikisql |
CREATE TABLE table_50101 (
"Order" real,
"Name dates" text,
"Princess Royal from (date) to (date)" text,
"Parent" text,
"Date married" text,
"Husband dates" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the parent on the order of 6?
| SELECT "Parent" FROM table_50101 WHERE "Order" = '6' | wikisql |
CREATE TABLE class_of_service (
booking_class varchar,
rank int,
class_description text
)
CREATE TABLE airport (
airport_code varchar,
airport_name text,
airport_location text,
state_code varchar,
country_name varchar,
time_zone_code varchar,
minimum_connect_time int
)
CREATE T... | 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 = 'SAN FRANCISCO' AND date_day.day_number = 21 AND date_day.month_number = 2... | atis |
CREATE TABLE table_41764 (
"Rank" text,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which country had 1 Bronze, 1 Silver, with a total of 3 medals?
| SELECT "Nation" FROM table_41764 WHERE "Bronze" = '1' AND "Total" = '3' AND "Silver" = '1' | wikisql |
CREATE TABLE table_19283806_4 (
representative VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the 2012 election results for locations whose representative is Barbara Lee?
| SELECT 2012 AS _election_results FROM table_19283806_4 WHERE representative = "Barbara Lee" | sql_create_context |
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 INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "2043" AND lab.fluid = "Other Body Fluid" | mimicsql_data |
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
va... | SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT diagnoses_icd.icd9_code FROM diagnoses_icd WHERE diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 54825) AND DATETIME(diagnoses_icd.charttime, 'start of year') = DATETIME(C... | mimic_iii |
CREATE TABLE table_43683 (
"Rank" real,
"Title" text,
"Studio" text,
"Director" text,
"Gross" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total number of ranks that had vestron as the studio?
| SELECT COUNT("Rank") FROM table_43683 WHERE "Studio" = 'vestron' | wikisql |
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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.long_title = "Sepsis" | mimicsql_data |
CREATE TABLE table_18600760_12 (
land___sqmi__ VARCHAR,
geo_id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the land (sqmi) at geo id 3801947380?
| SELECT land___sqmi__ FROM table_18600760_12 WHERE geo_id = 3801947380 | sql_create_context |
CREATE TABLE table_66379 (
"Club" text,
"Sport" text,
"Founded" real,
"League" text,
"Venue" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What sport was played by the team founded in 2010?
| SELECT "Sport" FROM table_66379 WHERE "Founded" = '2010' | wikisql |
CREATE TABLE film (
Film_ID int,
Rank_in_series int,
Number_in_season int,
Title text,
Directed_by text,
Original_air_date text,
Production_code text
)
CREATE TABLE schedule (
Cinema_ID int,
Film_ID int,
Date text,
Show_times_per_day int,
Price float
)
CREATE TABLE cine... | SELECT Title, MAX(T1.Price) FROM schedule AS T1 JOIN film AS T2 ON T1.Film_ID = T2.Film_ID GROUP BY Title | nvbench |
CREATE TABLE party_events (
event_id number,
event_name text,
party_id number,
member_in_charge_id number
)
CREATE TABLE member (
member_id number,
member_name text,
party_id text,
in_office text
)
CREATE TABLE party (
party_id number,
minister text,
took_office text,
l... | SELECT minister, took_office, left_office FROM party ORDER BY left_office | spider |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.