instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
CREATE TABLE zyjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
HZXM text,
JZKSDM text,
JZKSMC text,
JZLSH text,
KH text,
KLX number,... | SELECT hz_info_mzjzjlb.YLJGDM FROM person_info JOIN hz_info JOIN mzjzjlb JOIN hz_info_mzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.YLJGDM = hz_info_mzjzjlb.YL... | css |
CREATE TABLE table_name_98 (
april VARCHAR,
record VARCHAR,
points VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many days in April has a record of 42 22 12 3, and less than 99 points?
| SELECT COUNT(april) FROM table_name_98 WHERE record = "42–22–12–3" AND points < 99 | sql_create_context |
CREATE TABLE table_67299 (
"Driver" text,
"Constructor" text,
"Laps" text,
"Time/Retired" text,
"Grid" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What companyw as the constructor when the Time/Retired was collision, and a Grid of 11?
| SELECT "Constructor" FROM table_67299 WHERE "Time/Retired" = 'collision' AND "Grid" = '11' | wikisql |
CREATE TABLE table_42113 (
"Source" text,
"Date" text,
"Clinton" text,
"Obama" text,
"Undecided" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When has a Source of rasmussen reports?
| SELECT "Date" FROM table_42113 WHERE "Source" = 'rasmussen reports' | wikisql |
CREATE TABLE t_kc22 (
AMOUNT number,
CHA_ITEM_LEV number,
DATA_ID text,
DIRE_TYPE number,
DOSE_FORM text,
DOSE_UNIT text,
EACH_DOSAGE text,
EXP_OCC_DATE time,
FLX_MED_ORG_ID text,
FXBZ number,
HOSP_DOC_CD text,
HOSP_DOC_NM text,
MED_CLINIC_ID text,
MED_DIRE_CD tex... | SELECT qtb.MED_ORG_DEPT_CD, qtb.IN_DIAG_DIS_CD, AVG(qtb.PERSON_AGE) FROM qtb WHERE qtb.MED_SER_ORG_NO = '1153407' GROUP BY qtb.MED_ORG_DEPT_CD, qtb.IN_DIAG_DIS_CD UNION SELECT gyb.MED_ORG_DEPT_CD, gyb.IN_DIAG_DIS_CD, AVG(gyb.PERSON_AGE) FROM gyb WHERE gyb.MED_SER_ORG_NO = '1153407' GROUP BY gyb.MED_ORG_DEPT_CD, gyb.IN_... | css |
CREATE TABLE table_1940144_1 (
urban_area VARCHAR,
population_2011 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which urban area has a 2011 population of 5010?
| SELECT urban_area FROM table_1940144_1 WHERE population_2011 = 5010 | sql_create_context |
CREATE TABLE table_204_843 (
id number,
"volume" number,
"year" text,
"names" text,
"articles" number,
"pages" number,
"images" number,
"maps" number,
"number of copies" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the di... | SELECT ABS((SELECT "year" FROM table_204_843 WHERE "volume" = 1) - (SELECT "year" FROM table_204_843 WHERE "volume" = 13)) | squall |
CREATE TABLE Movie (
mID int,
title text,
year int,
director text
)
CREATE TABLE Reviewer (
rID int,
name text
)
CREATE TABLE Rating (
rID int,
mID int,
stars int,
ratingDate date
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Visua... | SELECT T2.title, SUM(MIN(T1.stars)) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID GROUP BY T2.title ORDER BY T2.title DESC | nvbench |
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.age < "68" AND lab.fluid = "Joint Fluid" | mimicsql_data |
CREATE TABLE table_name_56 (
round VARCHAR,
position VARCHAR,
college VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What round has a position of F/C from Iowa College?
| SELECT round FROM table_name_56 WHERE position = "f/c" AND college = "iowa" | sql_create_context |
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
-- Using valid SQLite, answer the following questions for the... | SELECT 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 Rooms (
RoomId TEXT,
roomName TEXT,
beds INTEGER,
bedType TEXT,
maxOccupancy INTEGER,
basePrice INTEGER,
decor TEXT
)
CREATE TABLE Reservations (
Code INTEGER,
Room TEXT,
CheckIn TEXT,
CheckOut TEXT,
Rate REAL,
LastName TEXT,
FirstName TEXT,
Adul... | SELECT bedType, AVG(basePrice) FROM Rooms GROUP BY bedType | nvbench |
CREATE TABLE table_40505 (
"Position" real,
"Team" text,
"Points" real,
"Played" real,
"Drawn" real,
"Lost" real,
"Against" real,
"Difference" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the smallest drawn with a position bigg... | SELECT MIN("Drawn") FROM table_40505 WHERE "Position" > '10' AND "Played" < '20' | wikisql |
CREATE TABLE table_21795650_1 (
points VARCHAR,
series VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the point total for the Formula Renault 2.0 Italy series?
| SELECT COUNT(points) FROM table_21795650_1 WHERE series = "Formula Renault 2.0 Italy" | sql_create_context |
CREATE TABLE table_name_20 (
date VARCHAR,
high_assists VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What date did Ben Gordon (8) have high assists?
| SELECT date FROM table_name_20 WHERE high_assists = "ben gordon (8)" | sql_create_context |
CREATE TABLE table_47949 (
"Institution" text,
"Location" text,
"Founded" real,
"Affiliation" text,
"Nickname" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Affiliation has a Nickname of cougars?
| SELECT "Affiliation" FROM table_47949 WHERE "Nickname" = 'cougars' | wikisql |
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 SUM(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.PERSON_ID = '14788506' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2015-12-26' AND '2017-01-21' | css |
CREATE TABLE table_74139 (
"Game" real,
"November" real,
"Opponent" text,
"Score" text,
"Location/Attendance" text,
"Record" text,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the record for score 1-3?
| SELECT "Record" FROM table_74139 WHERE "Score" = '1-3' | wikisql |
CREATE TABLE table_name_4 (
player VARCHAR,
place VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which player has a place of t2?
| SELECT player FROM table_name_4 WHERE place = "t2" | sql_create_context |
CREATE TABLE fault_log_parts (
fault_log_entry_id number,
part_fault_id number,
fault_status text
)
CREATE TABLE engineer_skills (
engineer_id number,
skill_id number
)
CREATE TABLE skills (
skill_id number,
skill_code text,
skill_description text
)
CREATE TABLE staff (
staff_id n... | SELECT T1.part_name FROM parts AS T1 JOIN part_faults AS T2 ON T1.part_id = T2.part_id GROUP BY T1.part_name ORDER BY COUNT(*) LIMIT 1 | spider |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.long_title = "Diverticulosis of colon with hemorrhage" AND lab.fluid = "Blood" | mimicsql_data |
CREATE TABLE table_52468 (
"Player" text,
"Height" text,
"School" text,
"Hometown" text,
"College" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the hometown of the player who is headed to Duke?
| SELECT "Hometown" FROM table_52468 WHERE "College" = 'duke' | wikisql |
CREATE TABLE table_name_94 (
loss INTEGER,
gain VARCHAR,
avg_g VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest Loss number when the Gain is less than 61 and the Avg/G is 6?
| SELECT MIN(loss) FROM table_name_94 WHERE gain < 61 AND avg_g = 6 | sql_create_context |
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 PostHistoryTypes (
Id number,
Name te... | SELECT p.CreationDate, p.Body, p.Id AS "post_link" FROM Posts AS p WHERE p.PostTypeId = 1 AND p.Body LIKE '%##keyword1##%' LIMIT 100 | sede |
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 WHERE demographic.language = "PORT" | mimicsql_data |
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDisplayName text... | WITH closedPerWeek AS (SELECT weeksAgo, COUNT(*) AS closedQuestions FROM (SELECT DATEDIFF(week, ClosedDate, GETDATE()) AS weeksAgo FROM Posts AS p WHERE PostTypeId = 1 AND NOT ClosedDate IS NULL) AS a GROUP BY weeksAgo), askedPerWeek AS (SELECT weeksAgo, COUNT(*) AS askedQuestions FROM (SELECT DATEDIFF(week, CreationDa... | sede |
CREATE TABLE country (
Country_id int,
Country_name text,
Capital text,
Official_native_language text
)
CREATE TABLE player (
Player_ID int,
Player text,
Years_Played text,
Total_WL text,
Singles_WL text,
Doubles_WL text,
Team int
)
CREATE TABLE match_season (
Season re... | SELECT Draft_Class, Draft_Pick_Number FROM match_season WHERE Position = "Defender" ORDER BY Draft_Pick_Number DESC | nvbench |
CREATE TABLE table_name_86 (
team_2 VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Team 2, when Score is 2 - 1?
| SELECT team_2 FROM table_name_86 WHERE score = "2 - 1" | sql_create_context |
CREATE TABLE table_20154 (
"Kinship" text,
"Proto-Austronesian" text,
"Proto-Malayo-Polynesian" text,
"Proto-Oceanic" text,
"Proto-Polynesian" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the number of proto austronesian for *natu
| SELECT COUNT("Proto-Austronesian") FROM table_20154 WHERE "Proto-Oceanic" = '*natu' | wikisql |
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 JZZDBM, JZZDSM FROM mzjzjlb WHERE JZLSH = '69348543973' | css |
CREATE TABLE table_21149 (
"Religion" text,
"Suriname" text,
"Paramaribo" text,
"Wanica" text,
"Nickerie" text,
"Coronie" text,
"Saramacca" text,
"Commewijne" text,
"Marowijne" text,
"Para" text,
"Brokopondo" text,
"Sipaliwini" text
)
-- Using valid SQLite, answer the f... | SELECT "Coronie" FROM table_21149 WHERE "Marowijne" = '6.8%' | wikisql |
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 demographic.admission_type, demographic.dischtime FROM demographic WHERE demographic.subject_id = "42820" | mimicsql_data |
CREATE TABLE table_73636 (
"Episode number Production number" text,
"Title" text,
"Original airdate" text,
"Rating/Share in Households" text,
"18\u201349 Rating Live+SD / Live+7" text,
"Share" text,
"Live+SD Total viewers" text,
"Live+7 Day DVR Total viewers" text
)
-- Using valid SQLi... | SELECT "Original airdate" FROM table_73636 WHERE "Episode number Production number" = '4 1-04' | wikisql |
CREATE TABLE table_21831 (
"Year" real,
"Network" text,
"Play-by-play" text,
"Colour commentator(s)" text,
"Sideline reporters" text,
"Pregame host" text,
"Pregame analysts" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who did the play-by-... | SELECT "Play-by-play" FROM table_21831 WHERE "Pregame host" = 'Brian Williams' AND "Sideline reporters" = 'Steve Armitage and Brenda Irving' | 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 jybgb.BGDH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN mzjzjlb_jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND mzjzjl... | css |
CREATE TABLE students (
student_id number,
student_details text
)
CREATE TABLE people_addresses (
person_address_id number,
person_id number,
address_id number,
date_from time,
date_to time
)
CREATE TABLE people (
person_id number,
first_name text,
middle_name text,
last_na... | SELECT T1.course_name FROM courses AS T1 JOIN student_course_registrations AS T2 ON T1.course_id = T2.course_id GROUP BY T1.course_id ORDER BY COUNT(*) DESC LIMIT 1 | spider |
CREATE TABLE paperdataset (
paperid int,
datasetid int
)
CREATE TABLE field (
fieldid int
)
CREATE TABLE paperkeyphrase (
paperid int,
keyphraseid int
)
CREATE TABLE dataset (
datasetid int,
datasetname varchar
)
CREATE TABLE paperfield (
fieldid int,
paperid int
)
CREATE TABLE ... | SELECT DISTINCT paper.paperid FROM author, paper, venue, writes WHERE author.authorname = 'Hans Kerp' AND venue.venueid = paper.venueid AND venue.venuename = 'Nature' AND writes.authorid = author.authorid AND writes.paperid = paper.paperid | scholar |
CREATE TABLE table_76821 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text,
"Money ( $ )" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What country has the score og 66-70-69-71=276?
| SELECT "Country" FROM table_76821 WHERE "Score" = '66-70-69-71=276' | wikisql |
CREATE TABLE table_8369 (
"Date" text,
"Home" text,
"Score" text,
"Away" text,
"Attendance" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Score when Deportes Savio is the Home team?
| SELECT "Score" FROM table_8369 WHERE "Home" = 'deportes savio' | wikisql |
CREATE TABLE date_day (
month_number int,
day_number int,
year int,
day_name varchar
)
CREATE TABLE month (
month_number int,
month_name text
)
CREATE TABLE state (
state_code text,
state_name text,
country_name text
)
CREATE TABLE code_description (
code varchar,
descript... | 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 = 'NEWARK' AND date_day.day_number = 23 AND date_day.month_number = 4 AND d... | atis |
CREATE TABLE table_6036 (
"City" text,
"State" text,
"School" text,
"Colony Name" text,
"Date Founded" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which City has a State of massachusetts, and a School of northeastern university?
| SELECT "City" FROM table_6036 WHERE "State" = 'massachusetts' AND "School" = 'northeastern university' | wikisql |
CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
CreationDate time,
UserId number,
UserDisplayName text,
Comment text,
Text text,
ContentLicense text
)... | SELECT TOP(10) AS title, DisplayName, pt.Name FROM Posts AS p JOIN Votes AS v ON p.Id = v.PostId JOIN Users AS u ON v.UserId = u.Id JOIN PostTypes AS pt ON p.PostTypeId = pt.Id | sede |
CREATE TABLE table_name_43 (
name VARCHAR,
pos VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the name of the person in the CF Pos?
| SELECT name FROM table_name_43 WHERE pos = "cf" | sql_create_context |
CREATE TABLE table_62666 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the score of the golfer representing Scotland?
| SELECT "Score" FROM table_62666 WHERE "Country" = 'scotland' | wikisql |
CREATE TABLE table_79169 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was Anders Forsbrand's score when the TO par is +4?
| SELECT "Score" FROM table_79169 WHERE "To par" = '+4' AND "Player" = 'anders forsbrand' | wikisql |
CREATE TABLE accounts (
account_id number,
statement_id number,
account_details text
)
CREATE TABLE documents_with_expenses (
document_id number,
budget_type_code text,
document_details text
)
CREATE TABLE projects (
project_id number,
project_details text
)
CREATE TABLE ref_budget_co... | SELECT T1.document_id FROM documents_with_expenses AS T1 JOIN ref_budget_codes AS T2 ON T1.budget_type_code = T2.budget_type_code WHERE T2.budget_type_description = "Government" | 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 demographic ... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.days_stay > "69" AND prescriptions.formulary_drug_cd = "METR500" | mimicsql_data |
CREATE TABLE table_name_28 (
report VARCHAR,
winning_constructor VARCHAR,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the Report with Winning constructor of maserati, and a Name of monza grand prix?
| SELECT report FROM table_name_28 WHERE winning_constructor = "maserati" AND name = "monza grand prix" | sql_create_context |
CREATE TABLE table_73966 (
"No." real,
"#" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Patient Portrayer" text,
"Original air date" text,
"Production code" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the writte... | SELECT "Written by" FROM table_73966 WHERE "Production code" = '2T5954' | 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 AVG(demographic.age) FROM demographic WHERE demographic.marital_status = "MARRIED" AND demographic.discharge_location = "SNF" | mimicsql_data |
CREATE TABLE affected_region (
Region_id int,
Storm_ID int,
Number_city_affected real
)
CREATE TABLE storm (
Storm_ID int,
Name text,
Dates_active text,
Max_speed int,
Damage_millions_USD real,
Number_Deaths int
)
CREATE TABLE region (
Region_id int,
Region_code text,
R... | SELECT Region_name, COUNT(*) FROM region AS T1 JOIN affected_region AS T2 ON T1.Region_id = T2.Region_id GROUP BY T1.Region_id | nvbench |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.short_title = "Peritonitis NOS" | mimicsql_data |
CREATE TABLE Ref_document_types (
document_type_code VARCHAR,
document_type_name VARCHAR,
document_type_description VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Show all document type codes, document type names, document type descriptions.
| SELECT document_type_code, document_type_name, document_type_description FROM Ref_document_types | sql_create_context |
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmoun... | SELECT u.Id AS "user_link", u.Reputation AS "reputation", q.LastActivityDate AS "last_active", q.ViewCount AS "views", q.Id AS "post_id", q.Id AS "post_link" FROM Posts AS q JOIN PostTags AS pt ON pt.PostId = q.Id JOIN Tags AS t ON t.Id = pt.TagId JOIN Users AS u ON u.Id = q.OwnerUserId WHERE q.PostTypeId = 1 AND q.Ans... | 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 t_kc21.CLINIC_ID FROM t_kc21 WHERE t_kc21.MED_CLINIC_ID = '98553609544' | css |
CREATE TABLE table_2112220_6 (
tournaments_played INTEGER,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the tournaments played for 2004
| SELECT MIN(tournaments_played) FROM table_2112220_6 WHERE year = 2004 | sql_create_context |
CREATE TABLE table_name_57 (
evening_gown VARCHAR,
swimsuit VARCHAR,
average VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which is the total number of evening gowns for swimsui less than 9.36 and average less than 9.23?
| SELECT COUNT(evening_gown) FROM table_name_57 WHERE swimsuit < 9.36 AND average < 9.23 | sql_create_context |
CREATE TABLE playlisttrack (
playlistid number,
trackid number
)
CREATE TABLE playlist (
playlistid number,
name text
)
CREATE TABLE genre (
genreid number,
name text
)
CREATE TABLE track (
trackid number,
name text,
albumid number,
mediatypeid number,
genreid number,
... | SELECT COUNT(DISTINCT city) FROM employee | spider |
CREATE TABLE table_465 (
"Name" text,
"Pennant" text,
"Builder" text,
"Laid Down" text,
"Launched" text,
"Commissioned" text,
"Fate" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the name for 30 september 1943?
| SELECT "Name" FROM table_465 WHERE "Launched" = '30 September 1943' | 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 prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE procedures.long_title = "Insertion of drug-eluting coronary artery stent(s)" AND lab.fluid = "Joint Fluid" | mimicsql_data |
CREATE TABLE table_14981555_1 (
venue VARCHAR,
distance VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Where was the 1400 m held?
| SELECT venue FROM table_14981555_1 WHERE distance = "1400 m" | sql_create_context |
CREATE TABLE table_23483182_1 (
no_in_season VARCHAR,
us_viewers__million_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What number was there 6.01 million u.s. drivers?
| SELECT no_in_season FROM table_23483182_1 WHERE us_viewers__million_ = "6.01" | sql_create_context |
CREATE TABLE table_79603 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Attendance" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the attendance for the away team Solihull Moors?
| SELECT "Attendance" FROM table_79603 WHERE "Away team" = 'solihull moors' | wikisql |
CREATE TABLE table_75369 (
"Country" text,
"Project Name" text,
"Year startup" text,
"Operator" text,
"Peak" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Peak with a Project Name that is talakan ph 1?
| SELECT "Peak" FROM table_75369 WHERE "Project Name" = 'talakan ph 1' | wikisql |
CREATE TABLE table_69412 (
"Installation" text,
"Cluj" real,
"Oradea" real,
"Baia Mare" real,
"Bistrita" real,
"Satu Mare" real,
"Zalau" real,
"Electrica North Transylvania" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the smal... | SELECT MIN("Satu Mare") FROM table_69412 WHERE "Baia Mare" > '523' | wikisql |
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE cost (
costid num... | SELECT intakeoutput.celllabel FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '005-40894')) AND intakeoutput.cellpath LIKE '%intake%' AND S... | eicu |
CREATE TABLE table_15578 (
"State" text,
"Born/Died" text,
"Active service" text,
"Chief Judge" text,
"Senior status" text,
"Appointed by" text,
"Reason for termination" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which state has a Reason... | SELECT "State" FROM table_15578 WHERE "Reason for termination" = 'retirement' AND "Active service" = '1926–1928' | wikisql |
CREATE TABLE table_2269 (
"Number" real,
"Name" text,
"Kilometer" real,
"Pavement" text,
"Length (in m)" real,
"Average climb (%)" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the minimum length of the locations where the average climb... | SELECT MIN("Length (in m)") FROM table_2269 WHERE "Average climb (%)" = '59' | wikisql |
CREATE TABLE table_17102076_5 (
team VARCHAR,
location_attendance VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the team for arco arena 13,685
| SELECT team FROM table_17102076_5 WHERE location_attendance = "ARCO Arena 13,685" | sql_create_context |
CREATE TABLE table_name_36 (
points_gained INTEGER,
fans_took VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the points gained of the match where fans took 403 [sunday]?
| SELECT SUM(points_gained) FROM table_name_36 WHERE fans_took = "403 [sunday]" | sql_create_context |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | SELECT AVG(demographic.age) FROM demographic WHERE demographic.marital_status = "MARRIED" AND demographic.insurance = "Government" | mimicsql_data |
CREATE TABLE table_11621915_1 (
purse__ INTEGER,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what's the maximum purse( $ ) with score value of 204 (-9)
| SELECT MAX(purse__) AS $__ FROM table_11621915_1 WHERE score = "204 (-9)" | sql_create_context |
CREATE TABLE table_25833 (
"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 "High rebounds" FROM table_25833 WHERE "Record" = '17-33' | wikisql |
CREATE TABLE table_29296103_10 (
tournament VARCHAR,
champion VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which tournament was the champion pat cash 4 6, 6 4, 6 3?
| SELECT tournament FROM table_29296103_10 WHERE champion = "Pat Cash 4–6, 6–4, 6–3" | sql_create_context |
CREATE TABLE market (
Market_ID int,
District text,
Num_of_employees int,
Num_of_shops real,
Ranking int
)
CREATE TABLE phone_market (
Market_ID int,
Phone_ID text,
Num_of_stock int
)
CREATE TABLE phone (
Name text,
Phone_ID int,
Memory_in_G int,
Carrier text,
Price... | SELECT Carrier, SUM(Memory_in_G) FROM phone GROUP BY Carrier | nvbench |
CREATE TABLE table_name_70 (
location VARCHAR,
game VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Location, when Game is 42?
| SELECT location FROM table_name_70 WHERE game = 42 | sql_create_context |
CREATE TABLE gwyjzb (
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 gwyjzb.MED_CLINIC_ID FROM gwyjzb WHERE gwyjzb.PERSON_ID = '28753994' AND NOT gwyjzb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT > 3093.86) UNION SELECT fgwyjzb.MED_CLINIC_ID FROM fgwyjzb WHERE fgwyjzb.PERSON_ID = '28753994' AND NOT fgwyjzb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLI... | css |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "2129" AND lab.label = "Albumin" | mimicsql_data |
CREATE TABLE table_name_12 (
crowd VARCHAR,
date VARCHAR,
away_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the attendence of the game on 26 April 1948 and an away team of Hawthorn?
| SELECT crowd FROM table_name_12 WHERE date = "26 april 1948" AND away_team = "hawthorn" | sql_create_context |
CREATE TABLE table_6047 (
"Month" text,
"Week" real,
"Offensive" text,
"Defensive" text,
"Goalkeeper" text,
"Rookie" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the rookie that played week 6?
| SELECT "Rookie" FROM table_6047 WHERE "Week" = '6' | wikisql |
CREATE TABLE table_11884814_3 (
evening_gown VARCHAR,
swimsuit VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the evening gown score when the swimsuit was 9.61?
| SELECT evening_gown FROM table_11884814_3 WHERE swimsuit = "9.61" | sql_create_context |
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 VoteTypes (
Id number,
Name text
)
C... | SELECT Posts.Id AS "post_link", COUNT(upvotes.Id) AS UpVotes FROM Posts LEFT JOIN Votes AS upvotes ON upvotes.PostId = Posts.Id WHERE Posts.OwnerUserId = @UserId AND Posts.PostTypeId = 1 AND upvotes.VoteTypeId = 2 GROUP BY Posts.Id ORDER BY UpVotes DESC LIMIT 100 | sede |
CREATE TABLE table_18481791_2 (
title VARCHAR,
directed_by VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the title of the episode directed by John T. Kretchmer?
| SELECT title FROM table_18481791_2 WHERE directed_by = "John T. Kretchmer" | 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 jybgb (
BBCJBW text,
BBDM tex... | SELECT jyjgzbb.JYZBLSH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN person_info_hz_info ON person_info.RYBH = person_info_hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jy... | css |
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
... | SELECT Question.Id AS P_PostId, Question.OwnerUserId AS P_UserId FROM Posts AS Question WHERE Question.Tags LIKE '%android%' ORDER BY CommentCount DESC LIMIT 500 | sede |
CREATE TABLE table_262481_2 (
enrollment VARCHAR,
left VARCHAR,
nickname VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the enrollment for the institution nicknamed the panthers that left in 2012?
| SELECT enrollment FROM table_262481_2 WHERE left = "2012" AND nickname = "Panthers" | sql_create_context |
CREATE TABLE table_name_65 (
worldwide_gross VARCHAR,
director VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the worldwide gross for the film directed by joe pytka?
| SELECT worldwide_gross FROM table_name_65 WHERE director = "joe pytka" | sql_create_context |
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
... | SELECT * FROM Posts WHERE Tags LIKE '%<java>%' AND PostTypeId = 1 AND AcceptedAnswerId != 0 | sede |
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
-- Using valid SQLite, answer the following questions for the... | SELECT Headquarter, AVG(Price) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter ORDER BY AVG(Price) | nvbench |
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 SUM(t_kc22.AMOUNT) FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_NM = '魏初雪' AND t_kc22.t_kc21_CLINIC_TYPE = '门诊' AND t_kc22.STA_DATE BETWEEN '2004-09-03' AND '2009-03-08' AND t_kc22.MED_INV_ITEM_TYPE = '手术费' | css |
CREATE TABLE table_60207 (
"Benalla DFL" text,
"Wins" real,
"Losses" real,
"Draws" real,
"Byes" real,
"Against" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest value for Byes, when Against is less than 1794, when Losses is '6'... | SELECT MAX("Byes") FROM table_60207 WHERE "Against" < '1794' AND "Losses" = '6' AND "Draws" < '0' | wikisql |
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 jyjgzbb (
BGDH text,
BGRQ tim... | SELECT jyjgzbb.YQBH, jyjgzbb.YQMC FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN mzjzjlb_jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = j... | css |
CREATE TABLE table_76813 (
"1976" text,
"1977" text,
"1978" text,
"1979" text,
"1980" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is 1977 when 1980 is chile?
| SELECT "1977" FROM table_76813 WHERE "1980" = 'chile' | wikisql |
CREATE TABLE table_name_21 (
score VARCHAR,
rank VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest first half when the score is larger than 621 and the rank 35?
| SELECT MIN(1 AS st_half) FROM table_name_21 WHERE score > 621 AND rank = 35 | sql_create_context |
CREATE TABLE table_57382 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which driver had a time/retired of fuel system?
| SELECT "Driver" FROM table_57382 WHERE "Time/Retired" = 'fuel system' | wikisql |
CREATE TABLE table_1341718_43 (
district VARCHAR,
incumbent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many districts does Ed Jones represent?
| SELECT COUNT(district) FROM table_1341718_43 WHERE incumbent = "Ed Jones" | sql_create_context |
CREATE TABLE Ref_Transaction_Types (
transaction_type_code VARCHAR(10),
transaction_type_description VARCHAR(80)
)
CREATE TABLE Transactions_Lots (
transaction_id INTEGER,
lot_id INTEGER
)
CREATE TABLE Transactions (
transaction_id INTEGER,
investor_id INTEGER,
transaction_type_code VARCHA... | SELECT lot_details, COUNT(lot_details) FROM Investors AS T1 JOIN Lots AS T2 ON T1.investor_id = T2.investor_id WHERE T1.Investor_details = "l" GROUP BY lot_details | nvbench |
CREATE TABLE table_33284 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the away team's score against Hawthorn?... | SELECT "Away team score" FROM table_33284 WHERE "Away team" = 'hawthorn' | wikisql |
CREATE TABLE zyjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
HZXM text,
JZKSDM text,
JZKSMC text,
JZLSH text,
KH text,
KLX number,
MZBMLX number,
MZJZLSH text,
MZZDBM text,
MZZDMC text,
MZZYZDZZBM... | SELECT * FROM hz_info JOIN mzjzjlb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE hz_info.person_info_XM = '曹安卉' AND hz_info.YLJGDM = '4269180' AND mzjzjlb.JZZDSM LIKE '%人格障碍%' | css |
CREATE TABLE table_204_68 (
id number,
"name" text,
"profession" text,
"hometown" text,
"term expires" number,
"office" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- other than william stuart price , which other businessman was born in tulsa ?
| SELECT "name" FROM table_204_68 WHERE "name" <> 'william stuart price' AND "hometown" = 'tulsa' | squall |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.