instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
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.OUT_DIAG_DOC_CD, t_kc21.OUT_DIAG_DOC_NM FROM t_kc21 WHERE t_kc21.PERSON_ID = '02315348' AND t_kc21.IN_HOSP_DATE BETWEEN '2010-02-02' AND '2010-12-21' GROUP BY t_kc21.OUT_DIAG_DOC_CD ORDER BY COUNT(*) DESC LIMIT 1 | css |
CREATE TABLE table_42401 (
"Call sign" text,
"Frequency MHz" real,
"City of license" text,
"Facility ID" real,
"ERP W" real,
"Height m ( ft )" text,
"Class" text,
"FCC info" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the clas... | SELECT "Class" FROM table_42401 WHERE "Facility ID" = '150935' | wikisql |
CREATE TABLE table_name_7 (
date VARCHAR,
result VARCHAR,
site VARCHAR,
attendance VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Date at memorial stadium minneapolis, mn with an Attendance of 20,000, and a Result of w52-0?
| SELECT date FROM table_name_7 WHERE site = "memorial stadium • minneapolis, mn" AND attendance = "20,000" AND result = "w52-0" | sql_create_context |
CREATE TABLE table_62106 (
"Mission" text,
"Resident Country" text,
"Local Location" text,
"Local Mission" text,
"Non-Resident Head of Mission" text,
"Local Position" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Local Position, when Mi... | SELECT "Local Position" FROM table_62106 WHERE "Mission" = 'paraguay' | wikisql |
CREATE TABLE table_1773707_2 (
length VARCHAR,
body_style VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the length of the model with 500 E body style?
| SELECT length FROM table_1773707_2 WHERE body_style = "500 E" | sql_create_context |
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress text
)
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
... | SELECT t.TagName, COUNT(a.Id) AS NumAnswers, SUM(a.Score) AS TotalScore, AVG(a.Score + 0.0) AS AvgScore FROM Posts AS a JOIN Posts AS q ON a.ParentId = q.Id JOIN PostTags AS pt ON pt.PostId = q.Id JOIN Tags AS t ON t.Id = pt.TagId WHERE a.PostTypeId = 2 AND t.TagName IN ('java', 'c#', 'c', 'c++', 'python', 'ruby', 'sca... | sede |
CREATE TABLE table_11186 (
"Rank" text,
"City" text,
"Height" text,
"Stories" real,
"Completed" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- I want the sum of stories for guadalajara done after 2007
| SELECT SUM("Stories") FROM table_11186 WHERE "City" = 'guadalajara' AND "Completed" > '2007' | wikisql |
CREATE TABLE table_32352 (
"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 score of the Geelong away team?
| SELECT "Away team score" FROM table_32352 WHERE "Away team" = 'geelong' | wikisql |
CREATE TABLE table_77436 (
"Year" real,
"Competition" text,
"Venue" text,
"Position" text,
"Event" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Position is listed against a Venue of Debrecen, Hungary
| SELECT "Position" FROM table_77436 WHERE "Venue" = 'debrecen, hungary' | wikisql |
CREATE TABLE table_58662 (
"Position" real,
"Team" text,
"Played" real,
"Drawn" real,
"Lost" real,
"Goals For" real,
"Goals Against" real,
"Goal Difference" text,
"Points 1" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the ... | SELECT COUNT("Points 1") FROM table_58662 WHERE "Position" = '7' AND "Drawn" > '6' | wikisql |
CREATE TABLE table_29814 (
"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 "Record" FROM table_29814 WHERE "Date" = 'March 6' | wikisql |
CREATE TABLE table_33169 (
"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 team score when the Away team s... | SELECT "Home team score" FROM table_33169 WHERE "Away team score" = '17.16 (118)' | wikisql |
CREATE TABLE table_name_97 (
earnings___ INTEGER,
wins VARCHAR,
events VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the number of earning for more than 2 wins and less than 25 events?
| SELECT SUM(earnings___) AS $__ FROM table_name_97 WHERE wins > 2 AND events < 25 | sql_create_context |
CREATE TABLE student_record (
student_id int,
course_id int,
semester int,
grade varchar,
how varchar,
transfer_source varchar,
earn_credit varchar,
repeat_term varchar,
test_id varchar
)
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TAB... | SELECT DISTINCT course.department, course.name, course.number FROM course, program_course WHERE program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id | advising |
CREATE TABLE table_57859 (
"Year" real,
"Chassis" text,
"Engine" text,
"Tyres" text,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the low score for the jaguar r3 chasis?
| SELECT MIN("Points") FROM table_57859 WHERE "Chassis" = 'jaguar r3' | wikisql |
CREATE TABLE class_of_service (
booking_class varchar,
rank int,
class_description text
)
CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE month (
month_number int,
month_name text
)
CREATE TABLE... | 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 = 'CHARLOTTE' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND flight.from_airport = A... | atis |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetake... | SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, medication.drugstarttime FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE medication.drugname = 'nitroglycerin 0.4 mg sublingual tablet' AND DATETIM... | eicu |
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 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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.long_title = "Oliguria and anuria" | mimicsql_data |
CREATE TABLE table_79920 (
"Name" text,
"Country" text,
"Status" text,
"Transfer window" text,
"Transfer fee" text,
"Source" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the source for the person named Cresswell?
| SELECT "Source" FROM table_79920 WHERE "Name" = 'cresswell' | 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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "URGENT" AND lab.label = "Phenytoin" | mimicsql_data |
CREATE TABLE table_55116 (
"Region" text,
"Capital" text,
"Area (km\u00b2)" text,
"Area (sq. mi.)" text,
"Population" text,
"GDP ( bn )" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which capital has a population of 308,610?
| SELECT "Capital" FROM table_55116 WHERE "Population" = '308,610' | wikisql |
CREATE TABLE table_52077 (
"Village (German)" text,
"Village (Slovenian)" text,
"Number of people 1991" real,
"Percent of Slovenes 1991" text,
"Percent of Slovenes 1951" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Number of people 1991 has ... | SELECT MAX("Number of people 1991") FROM table_52077 WHERE "Percent of Slovenes 1991" = '14.4%' | wikisql |
CREATE TABLE table_name_46 (
polling_institute VARCHAR,
lead VARCHAR,
labour VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which polling institute showed a lead of 12% and a Labour share of the poll at 40.2%?
| SELECT polling_institute FROM table_name_46 WHERE lead = "12%" AND labour = "40.2%" | sql_create_context |
CREATE TABLE table_203_391 (
id number,
"season" text,
"greek league" text,
"greek cup" text,
"europe" text,
"coach" text,
"roster" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what was the number of players on the roster in 1952-53 ?
| SELECT "roster" FROM table_203_391 WHERE "season" = '1952-53' | squall |
CREATE TABLE table_35794 (
"Engine" text,
"Type" text,
"Displacement" text,
"Power" text,
"Torque" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which torque value is associated with the 1.3 16V multijet engine?
| SELECT "Torque" FROM table_35794 WHERE "Engine" = '1.3 16v multijet' | 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 demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND prescriptions.drug = "Cinacalcet" | mimicsql_data |
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 PostFeedback (
Id number,
PostId number,
IsAnon... | SELECT AboutMe, Id AS "user_link" FROM Users WHERE AboutMe LIKE '%grimble%' | sede |
CREATE TABLE table_name_99 (
heat INTEGER,
time VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the heat number of the athlete who finished in 2:23.95?
| SELECT AVG(heat) FROM table_name_99 WHERE time = "2:23.95" | sql_create_context |
CREATE TABLE machine (
Machine_ID int,
Making_Year int,
Class text,
Team text,
Machine_series text,
value_points real,
quality_rank int
)
CREATE TABLE repair (
repair_ID int,
name text,
Launch_Date text,
Notes text
)
CREATE TABLE technician (
technician_id real,
Nam... | SELECT Name, COUNT(Name) FROM repair_assignment AS T1 JOIN machine AS T2 ON T1.Machine_ID = T2.Machine_ID JOIN technician AS T3 ON T1.technician_id = T3.technician_id WHERE T2.value_points > 70 GROUP BY Name ORDER BY COUNT(Name) | nvbench |
CREATE TABLE table_53039 (
"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.
-- Where did Footscray play as the away team?
| SELECT "Venue" FROM table_53039 WHERE "Away team" = 'footscray' | wikisql |
CREATE TABLE table_22824297_1 (
no VARCHAR,
hometown VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is every number for the hometown of Canton, Illinois?
| SELECT no FROM table_22824297_1 WHERE hometown = "Canton, Illinois" | sql_create_context |
CREATE TABLE t_kc24 (
MED_SAFE_PAY_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
REF_SLT_FLG number,
CLINIC_SLT_DATE time,
COMP_ID text,
PERSON_ID text,
FLX_MED_ORG_ID text,
INSU_TYPE text,
MED_AMOUT number,
PER_ACC_PAY number,
OVE_PAY numb... | SELECT SUM(t_kc22.AMOUNT) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_ID = '32352612' AND t_kc21.CLINIC_TYPE = '门诊' AND t_kc22.STA_DATE BETWEEN '2000-03-18' AND '2021-05-07' AND t_kc22.MED_INV_ITEM_TYPE = '手术费' | css |
CREATE TABLE table_41785 (
"Year" real,
"Country" text,
"Team" text,
"Individual" text,
"Location" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Location when the team was seve ballesteros & manuel pi ero?
| SELECT "Location" FROM table_41785 WHERE "Team" = 'seve ballesteros & manuel piñero' | wikisql |
CREATE TABLE table_name_44 (
away_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the Away team score for Footscray?
| SELECT away_team AS score FROM table_name_44 WHERE away_team = "footscray" | sql_create_context |
CREATE TABLE table_26464364_1 (
written_by VARCHAR,
directed_by VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who are the writers of the episodes directed by Justin Hartley?
| SELECT written_by FROM table_26464364_1 WHERE directed_by = "Justin Hartley" | 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 COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.age < "58" AND demographic.admityear < "2107" | mimicsql_data |
CREATE TABLE table_35632 (
"Date" text,
"City" text,
"Opponent" text,
"Results\u00b9" text,
"Type of game" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- On November 22, what were the results of the friendly type game?
| SELECT "Results\u00b9" FROM table_35632 WHERE "Type of game" = 'friendly' AND "Date" = 'november 22' | wikisql |
CREATE TABLE table_17271495_1 (
laps VARCHAR,
points VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the laps for 18 pointss
| SELECT laps FROM table_17271495_1 WHERE points = "18" | sql_create_context |
CREATE TABLE table_42079 (
"Team" text,
"Tries for" real,
"Tries against" real,
"Try diff" text,
"Points for" real,
"Points against" real,
"Points diff" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- WHich Team that has Points against of 43?... | SELECT "Team" FROM table_42079 WHERE "Points against" = '43' | wikisql |
CREATE TABLE table_204_275 (
id number,
"date" text,
"city" text,
"opponent" text,
"results" text,
"scorers" text,
"type of game" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the number of times belgrade is listed as the city ?
| SELECT COUNT(*) FROM table_204_275 WHERE "city" = 'belgrade' | squall |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartr... | SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.patientunitstayid IN (SELECT lab.patientunitstayid FROM lab WHERE lab.labname = 'base excess' AND STRFTIME('%y', lab.labresulttime) <= '2104') | eicu |
CREATE TABLE table_21195 (
"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.
-- On wha... | SELECT "Date" FROM table_21195 WHERE "Team" = 'Philadelphia' | wikisql |
CREATE TABLE table_6665 (
"Season" text,
"Competition" text,
"Round" text,
"Club" text,
"Score" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which competition features the 1st round of Club Union Luxembourg?
| SELECT "Competition" FROM table_6665 WHERE "Round" = '1st round' AND "Club" = 'union luxembourg' | wikisql |
CREATE TABLE table_13258806_2 (
date VARCHAR,
record VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When was the record of 0-1 set?
| SELECT date FROM table_13258806_2 WHERE record = "0-1" | sql_create_context |
CREATE TABLE table_78594 (
"Position" real,
"Club" text,
"Played" real,
"Points" real,
"Wins" real,
"Draws" real,
"Losses" real,
"Goals for" real,
"Goals against" real,
"Goal Difference" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.... | SELECT AVG("Played") FROM table_78594 WHERE "Club" = 'burgos cf' AND "Draws" < '7' | wikisql |
CREATE TABLE table_68178 (
"Name" text,
"Population (2011)" real,
"Population (2006)" real,
"Change (%)" real,
"Area (km\u00b2)" real,
"Population density" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the population density of Siglunes... | SELECT COUNT("Population density") FROM table_68178 WHERE "Name" = 'siglunes' AND "Change (%)" < '-8.1' | wikisql |
CREATE TABLE table_15905399_1 (
validation VARCHAR,
iin_ranges VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the validation for iin ranges 5610, 560221-560225?
| SELECT validation FROM table_15905399_1 WHERE iin_ranges = "5610, 560221-560225" | sql_create_context |
CREATE TABLE order_items (
order_quantity INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average amount of items ordered in each order?
| SELECT AVG(order_quantity) FROM order_items | sql_create_context |
CREATE TABLE table_name_91 (
first_elected VARCHAR,
district VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many values of first elected are for district 16?
| SELECT COUNT(first_elected) FROM table_name_91 WHERE district = "16" | sql_create_context |
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
AboutMe text,
Views number,
UpVotes number,
DownVotes number,
ProfileImageUrl text,
EmailHash text,
AccountId number
)
CRE... | SELECT AVG(CAST(Score AS FLOAT)) AS VOTE FROM Posts WHERE Posts.OwnerUserId = @UserId AND Posts.PostTypeId = 2 | sede |
CREATE TABLE table_53565 (
"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.
-- Where did Footscray play as the home team?
| SELECT "Venue" FROM table_53565 WHERE "Home team" = 'footscray' | wikisql |
CREATE TABLE table_14227 (
"School" text,
"Location" text,
"Mascot" text,
"Enrollment 12-13" real,
"IHSAA Class" text,
"IHSAA Class Football" text,
"County" text,
"Year Joined" real,
"Previous Conference" text
)
-- Using valid SQLite, answer the following questions for the tables p... | SELECT "Year Joined" FROM table_14227 WHERE "IHSAA Class Football" = 'aa' AND "School" = 'park tudor' | wikisql |
CREATE TABLE table_71292 (
"Position" real,
"Club" text,
"Played" real,
"Points" text,
"Wins" real,
"Draws" real,
"Losses" real,
"Goals for" real,
"Goals against" real,
"Goal Difference" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.... | SELECT MAX("Draws") FROM table_71292 WHERE "Club" = 'real valladolid' AND "Played" < '38' | wikisql |
CREATE TABLE table_name_14 (
peak VARCHAR,
project_name VARCHAR
)
-- 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_name_14 WHERE project_name = "talakan ph 1" | sql_create_context |
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
... | SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', labevents.charttime)) FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'albumin') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 97733 AND admissions.... | mimic_iii |
CREATE TABLE projects (
code text,
name text,
hours number
)
CREATE TABLE assignedto (
scientist number,
project text
)
CREATE TABLE scientists (
ssn number,
name text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Find the number of projects w... | SELECT COUNT(*), T1.name FROM scientists AS T1 JOIN assignedto AS T2 ON T1.ssn = T2.scientist GROUP BY T1.name | spider |
CREATE TABLE employment (
Company_ID int,
People_ID int,
Year_working int
)
CREATE TABLE people (
People_ID int,
Age int,
Name text,
Nationality text,
Graduation_College text
)
CREATE TABLE company (
Company_ID real,
Name text,
Headquarters text,
Industry text,
Sale... | SELECT Headquarters, COUNT(Headquarters) FROM company GROUP BY Industry, Headquarters ORDER BY Headquarters DESC | nvbench |
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 demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob te... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.long_title = "Diabetes mellitus without mention of complication, type II or unspecified type, uncontrolle... | mimicsql_data |
CREATE TABLE table_train_32 (
"id" int,
"pregnancy_or_lactation" bool,
"renal_disease" bool,
"hemachromatosis" bool,
"glucose_6_phosphate_dehydrogenase_deficiency_g6pd" int,
"prisoners" bool,
"NOUSE" float
)
-- Using valid SQLite, answer the following questions for the tables provided abov... | SELECT * FROM table_train_32 WHERE renal_disease = 1 | criteria2sql |
CREATE TABLE table_49587 (
"Date" text,
"Opponent" text,
"Venue" text,
"Result" text,
"Attendance" real,
"Competition" text,
"Man of the Match" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What team did the Flames play against when 526 peo... | SELECT "Opponent" FROM table_49587 WHERE "Attendance" = '526' | wikisql |
CREATE TABLE table_name_45 (
level INTEGER,
leaguecontested VARCHAR,
season VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Level has a League Contested of northern premier league premier division, and a Season of 2011 12?
| SELECT AVG(level) FROM table_name_45 WHERE leaguecontested = "northern premier league premier division" AND season = "2011–12" | sql_create_context |
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 mzjzjlb.JZLSH 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 = '曹斌蔚' AND NOT mzjzjlb.JZLSH IN (SELECT JZLSH FROM jybgb WHERE BGRQ >= '2013-12-22') | css |
CREATE TABLE table_17101 (
"Player" text,
"Position" text,
"School" text,
"Hometown" text,
"College" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which hometown has the college Louisiana State?
| SELECT "Hometown" FROM table_17101 WHERE "College" = 'Louisiana State' | 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_DIRE_CD text,
MED_DIRE_NM text,... | 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 = 'Y80.928' | css |
CREATE TABLE table_name_12 (
wins INTEGER,
points VARCHAR,
podiums VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many wins are associated with 20 points and over 1 podium?
| SELECT SUM(wins) FROM table_name_12 WHERE points = 20 AND podiums > 1 | sql_create_context |
CREATE TABLE compartment_class (
compartment varchar,
class_type varchar
)
CREATE TABLE date_day (
month_number int,
day_number int,
year int,
day_name varchar
)
CREATE TABLE state (
state_code text,
state_name text,
country_name text
)
CREATE TABLE time_interval (
period text... | SELECT DISTINCT ground_service.transport_type FROM city, ground_service WHERE city.city_name = 'PITTSBURGH' AND ground_service.city_code = city.city_code | atis |
CREATE TABLE table_203_496 (
id number,
"pos" number,
"country" text,
"gold" number,
"silver" number,
"bronze" number,
"total" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the total number of boxing metals earned by the top 4 cou... | SELECT SUM("total") FROM table_203_496 WHERE "pos" <= 4 | squall |
CREATE TABLE table_dev_57 (
"id" int,
"intra_aortic_balloon_pump_iabp" bool,
"systolic_blood_pressure_sbp" int,
"heart_disease" bool,
"vasopressors" bool,
"temperature" float,
"creatinine_clearance_cl" float,
"cardiogenic_shock" bool,
"height" int,
"serum_creatinine" float,
"... | SELECT * FROM table_dev_57 WHERE heart_disease = 1 | criteria2sql |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
... | SELECT demographic.admittime FROM demographic WHERE demographic.subject_id = "2560" | mimicsql_data |
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 table_49194 (
"Team" text,
"Match" real,
"Points" real,
"Draw" real,
"Lost" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total for the draw with 0 points, and less than 14 lost?
| SELECT SUM("Draw") FROM table_49194 WHERE "Points" = '0' AND "Lost" < '14' | wikisql |
CREATE TABLE table_name_8 (
team VARCHAR,
driver_s_ VARCHAR,
rounds VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What team was Tom Sneva on in rounds 1-9?
| SELECT team FROM table_name_8 WHERE driver_s_ = "tom sneva" AND rounds = "1-9" | sql_create_context |
CREATE TABLE table_name_16 (
location_attendance VARCHAR,
team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Location Attendance, when Team is 'Orlando'?
| SELECT location_attendance FROM table_name_16 WHERE team = "orlando" | sql_create_context |
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE ReviewRejectionReasons (
Id number,
Na... | SELECT sq.Name FROM (SELECT 'Copy Editor' AS name) AS sq LEFT JOIN Badges ON Badges.Name = sq.Name WHERE Badges.Name IS NULL | sede |
CREATE TABLE table_63633 (
"Game" text,
"Date" text,
"Opponent" text,
"Score" text,
"Location/Attendance" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the opponent with a 32-25 record?
| SELECT "Opponent" FROM table_63633 WHERE "Record" = '32-25' | wikisql |
CREATE TABLE table_name_94 (
location VARCHAR,
capacity INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which location has a capacity larger than 52,000?
| SELECT location FROM table_name_94 WHERE capacity > 52 OFFSET 000 | sql_create_context |
CREATE TABLE t_kc24 (
MED_SAFE_PAY_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
REF_SLT_FLG number,
CLINIC_SLT_DATE time,
COMP_ID text,
PERSON_ID text,
FLX_MED_ORG_ID text,
INSU_TYPE text,
MED_AMOUT number,
PER_ACC_PAY number,
OVE_PAY numb... | SELECT OUT_DIAG_DOC_CD, OUT_DIAG_DOC_NM FROM t_kc21 WHERE PERSON_ID = '78376442' AND IN_HOSP_DATE BETWEEN '2003-06-30' AND '2019-07-06' GROUP BY OUT_DIAG_DOC_CD ORDER BY COUNT(*) DESC LIMIT 1 | css |
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 WHERE demographic.language = "PORT" AND demographic.age < "64" | mimicsql_data |
CREATE TABLE table_41159 (
"Rank" text,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Where does Norway rank in total medals among countries with fewer than 7 bronzes?
| SELECT "Rank" FROM table_41159 WHERE "Bronze" < '7' AND "Nation" = 'norway' | wikisql |
CREATE TABLE table_59628 (
"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 is the surface when the partner was Robert Haybittel?
| SELECT "Surface" FROM table_59628 WHERE "Partner" = 'robert haybittel' | wikisql |
CREATE TABLE user_profiles (
uid number,
name text,
email text,
partitionid number,
followers number
)
CREATE TABLE follows (
f1 number,
f2 number
)
CREATE TABLE tweets (
id number,
uid number,
text text,
createdate time
)
-- Using valid SQLite, answer the following quest... | SELECT text FROM tweets WHERE text LIKE '%intern%' | 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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.formulary_drug_cd = "ZOSY4FPB" | mimicsql_data |
CREATE TABLE table_14889048_2 (
points INTEGER,
scored VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many points when 15 is scored is considered the minimum?
| SELECT MIN(points) FROM table_14889048_2 WHERE scored = 15 | sql_create_context |
CREATE TABLE table_42188 (
"Week" real,
"Home Team" text,
"Away Team" text,
"Overall Record" text,
"Divisional Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Can you tell me the Overall Record that has the Week smaller than 16, and the Divis... | SELECT "Overall Record" FROM table_42188 WHERE "Week" < '16' AND "Divisional Record" = '(1-0)' AND "Away Team" = 'miami' | wikisql |
CREATE TABLE table_17186229_4 (
opponent VARCHAR,
record VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the total number of opponent of record 9-2
| SELECT COUNT(opponent) FROM table_17186229_4 WHERE record = "9-2" | sql_create_context |
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
... | SELECT MIN(chartevents.valuenum) FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 23070)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'hear... | mimic_iii |
CREATE TABLE mzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH text,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZDZZMC ... | SELECT * FROM person_info JOIN hz_info JOIN zyjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE person_info.XM = '褚芳泽' AND hz_info.YLJGDM = '4385705' AND NOT zyjzjlb.JZKSMC LIKE '%青光眼%' | css |
CREATE TABLE table_52517 (
"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 team score at princes park?
| SELECT "Home team score" FROM table_52517 WHERE "Venue" = 'princes park' | wikisql |
CREATE TABLE table_43021 (
"Tournament" text,
"Wins" real,
"Top-5" real,
"Top-10" real,
"Top-25" real,
"Events" real,
"Cuts made" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was Miller Barber wins with Top-5 less than 2 and 19 Events... | SELECT COUNT("Wins") FROM table_43021 WHERE "Top-5" < '2' AND "Events" = '19' | wikisql |
CREATE TABLE table_59949 (
"Rank" real,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How much silver does the rank have that has gold smaller than 4, and a total of 1 and a rank larger than 6?
| SELECT SUM("Silver") FROM table_59949 WHERE "Gold" < '4' AND "Total" = '1' AND "Rank" > '6' | wikisql |
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,
JCZBJGDX text,
JCZBMC text,
JLDW text,
JYRQ time,
JYZBLSH text,
... | SELECT COUNT(*) FROM (SELECT jybgb.KSBM FROM mzjzjlb JOIN jybgb ON mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE mzjzjlb.YLJGDM = '7755077' AND jybgb.BGRQ BETWEEN '2011-03-10' AND '2017-06-16' GROUP BY jybgb.KSBM HAVING COUNT(*) < 10) AS T | css |
CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Per... | SELECT Team_ID, ACC_Percent FROM basketball_match | nvbench |
CREATE TABLE table_62127 (
"Year" real,
"Grand Slam" text,
"Round" text,
"Winner" text,
"Loser" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the round in 1968?
| SELECT "Round" FROM table_62127 WHERE "Year" = '1968' | wikisql |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wa... | SELECT COUNT(*) > 0 FROM patient WHERE patient.uniquepid = '030-4181' AND DATETIME(patient.hospitaladmittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') | eicu |
CREATE TABLE table_203_190 (
id number,
"name" text,
"type" text,
"circle" text,
"bench" text,
"formed" number,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the total number of states formed between 1000 and 1200 ?
| SELECT COUNT("name") FROM table_203_190 WHERE "formed" >= 1000 AND "formed" <= 1200 | squall |
CREATE TABLE table_name_25 (
round VARCHAR,
time VARCHAR,
event VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many rounds had a time of 5:00 at UFC 155?
| SELECT COUNT(round) FROM table_name_25 WHERE time = "5:00" AND event = "ufc 155" | sql_create_context |
CREATE TABLE table_11677100_11 (
hometown VARCHAR,
position VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- WHAT HOMETOWN DOES HE PLAY AS THE CATCHER FOR?
| SELECT hometown FROM table_11677100_11 WHERE position = "Catcher" | sql_create_context |
CREATE TABLE table_16729930_18 (
tdp VARCHAR,
release_price___usd__ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- For a release price of $72, what is the TDP of the microprocessor?
| SELECT tdp FROM table_16729930_18 WHERE release_price___usd__ = "$72" | sql_create_context |
CREATE TABLE jybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH text,
BGJGDM text,
BGJGMC text,
BGRGH text,
BGRQ time,
BGRXM text,
BGSJ time,
CJRQ time,
JSBBRQSJ time,
JSBBSJ time,
JYBBH text,
JYJGMC text,
JYJSGH text,
JYJSQM text,
JY... | SELECT jybgb.BGDH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb 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.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB ... | css |
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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.icd9_code = "42843" AND prescriptions.route = "IVPCA" | mimicsql_data |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.